diff --git a/.gitignore b/.gitignore index 4cdfae96d751b..af24779b2cf5c 100755 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,7 @@ # Go test binaries *.test + +# Mercurial files +**/.hg +**/.hg* diff --git a/api/examples/external-service.json b/api/examples/external-service.json new file mode 100644 index 0000000000000..e3f1d437ced76 --- /dev/null +++ b/api/examples/external-service.json @@ -0,0 +1,8 @@ +{ + "id": "example", + "port": 8000, + "labels": { + "name": "nginx" + }, + "createExternalLoadBalancer": true +} diff --git a/api/examples/service.json b/api/examples/service.json index 015a6f1b32483..68012f445995a 100644 --- a/api/examples/service.json +++ b/api/examples/service.json @@ -1,5 +1,5 @@ { - "id": "example2", + "id": "example", "port": 8000, "labels": { "name": "nginx" diff --git a/cluster/kube-up.sh b/cluster/kube-up.sh index 095907a89dcc9..aa150feda2795 100755 --- a/cluster/kube-up.sh +++ b/cluster/kube-up.sh @@ -75,7 +75,7 @@ gcutil addinstance ${MASTER_NAME}\ --image ${IMAGE} \ --tags ${MASTER_TAG} \ --network ${NETWORK} \ - --service_account_scopes="storage-ro" \ + --service_account_scopes="storage-ro,compute-rw" \ --automatic_restart \ --metadata_from_file startup-script:${KUBE_TEMP}/master-start.sh & diff --git a/cluster/saltbase/salt/apiserver/initd b/cluster/saltbase/salt/apiserver/initd index 3a80b8bbd6456..fb71ec8bc9bf8 100644 --- a/cluster/saltbase/salt/apiserver/initd +++ b/cluster/saltbase/salt/apiserver/initd @@ -17,7 +17,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="The Kubernetes API server" NAME=apiserver DAEMON=/usr/local/bin/apiserver -DAEMON_ARGS="" +DAEMON_ARGS="-cloud_provider gce " DAEMON_LOG_FILE=/var/log/$NAME.log PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME diff --git a/cmd/apiserver/apiserver.go b/cmd/apiserver/apiserver.go index 1f238717b8865..81d0d3c927dff 100644 --- a/cmd/apiserver/apiserver.go +++ b/cmd/apiserver/apiserver.go @@ -24,6 +24,7 @@ import ( "net" "strconv" + "github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider" "github.com/GoogleCloudPlatform/kubernetes/pkg/master" "github.com/GoogleCloudPlatform/kubernetes/pkg/util" ) @@ -32,6 +33,7 @@ var ( port = flag.Uint("port", 8080, "The port to listen on. Default 8080.") address = flag.String("address", "127.0.0.1", "The address on the local server to listen to. Default 127.0.0.1") apiPrefix = flag.String("api_prefix", "/api/v1beta1", "The prefix for API requests on the server. Default '/api/v1beta1'") + cloudProvider = flag.String("cloud_provider", "", "The provider for cloud services. Empty string for no provider.") etcdServerList, machineList util.StringList ) @@ -47,12 +49,27 @@ func main() { log.Fatal("No machines specified!") } - var m *master.Master + var cloud cloudprovider.Interface + switch *cloudProvider { + case "gce": + var err error + cloud, err = cloudprovider.NewGCECloud() + if err != nil { + log.Fatal("Couldn't connect to GCE cloud: %#v", err) + } + default: + if len(*cloudProvider) > 0 { + log.Printf("Unknown cloud provider: %s", *cloudProvider) + } else { + log.Print("No cloud provider specified.") + } + } + var m *master.Master if len(etcdServerList) > 0 { - m = master.New(etcdServerList, machineList) + m = master.New(etcdServerList, machineList, cloud) } else { - m = master.NewMemoryServer(machineList) + m = master.NewMemoryServer(machineList, cloud) } log.Fatal(m.Run(net.JoinHostPort(*address, strconv.Itoa(int(*port))), *apiPrefix)) diff --git a/cmd/localkube/localkube.go b/cmd/localkube/localkube.go index 3c9ba9d65bd86..6bd25e9d81e7a 100644 --- a/cmd/localkube/localkube.go +++ b/cmd/localkube/localkube.go @@ -80,7 +80,7 @@ func fake_kubelet() { // Starts api services (the master). Never returns. func api_server() { - m := master.New([]string{*etcd_server}, []string{*kubelet_address}) + m := master.New([]string{*etcd_server}, []string{*kubelet_address}, nil) log.Fatal(m.Run(net.JoinHostPort(*master_address, strconv.Itoa(int(*master_port))), *apiPrefix)) } diff --git a/examples/guestbook/frontend-controller.json b/examples/guestbook/frontend-controller.json index 7575b47595877..f3c94ea496d69 100644 --- a/examples/guestbook/frontend-controller.json +++ b/examples/guestbook/frontend-controller.json @@ -1,7 +1,7 @@ { "id": "frontendController", "desiredState": { - "replicas": 3, + "replicas": 1, "replicasInSet": {"name": "frontend"}, "podTemplate": { "desiredState": { diff --git a/pkg/api/types.go b/pkg/api/types.go index 74aeb93b44fb1..0c7ea04a75610 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -140,9 +140,10 @@ type ServiceList struct { // Defines a service abstraction by a name (for example, mysql) consisting of local port // (for example 3306) that the proxy listens on, and the labels that define the service. type Service struct { - JSONBase `json:",inline" yaml:",inline"` - Port int `json:"port,omitempty" yaml:"port,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` + JSONBase `json:",inline" yaml:",inline"` + Port int `json:"port,omitempty" yaml:"port,omitempty"` + Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` + CreateExternalLoadBalancer bool `json:"createExternalLoadBalancer,omitempty" yaml:"createExternalLoadBalancer,omitempty"` } // Defines the endpoints that implement the actual service, for example: diff --git a/pkg/apiserver/apiserver.go b/pkg/apiserver/apiserver.go index 8c946488d376a..ea58302a0bc8e 100644 --- a/pkg/apiserver/apiserver.go +++ b/pkg/apiserver/apiserver.go @@ -190,8 +190,12 @@ func (server *ApiServer) handleREST(parts []string, requestUrl *url.URL, req *ht server.error(err, w) return } - storage.Create(obj) - server.write(200, obj, w) + err = storage.Create(obj) + if err != nil { + server.error(err, w) + } else { + server.write(200, obj, w) + } return case "DELETE": if len(parts) != 2 { diff --git a/pkg/cloudprovider/cloud.go b/pkg/cloudprovider/cloud.go new file mode 100644 index 0000000000000..1cf38f49ebc30 --- /dev/null +++ b/pkg/cloudprovider/cloud.go @@ -0,0 +1,31 @@ +/* +Copyright 2014 Google Inc. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cloudprovider + +// CloudInterface is an abstract, pluggable interface for cloud providers +type Interface interface { + // TCPLoadBalancer returns a balancer interface, or nil if none is supported. Returns an error if one occurs. + TCPLoadBalancer() (TCPLoadBalancer, error) +} + +type TCPLoadBalancer interface { + // TODO: Break this up into different interfaces (LB, etc) when we have more than one type of service + TCPLoadBalancerExists(name, region string) (bool, error) + CreateTCPLoadBalancer(name, region string, port int, hosts []string) error + UpdateTCPLoadBalancer(name, region string, hosts []string) error + DeleteTCPLoadBalancer(name, region string) error +} diff --git a/pkg/cloudprovider/doc.go b/pkg/cloudprovider/doc.go new file mode 100644 index 0000000000000..f5d5c6c65324b --- /dev/null +++ b/pkg/cloudprovider/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2014 Google Inc. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package cloudprovider supplies interfaces and implementations for cloud service providers +package cloudprovider + +import () diff --git a/pkg/cloudprovider/gce.go b/pkg/cloudprovider/gce.go new file mode 100644 index 0000000000000..ecc4e9c24c0fe --- /dev/null +++ b/pkg/cloudprovider/gce.go @@ -0,0 +1,164 @@ +/* +Copyright 2014 Google Inc. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cloudprovider + +import ( + "fmt" + "io/ioutil" + "net/http" + "strconv" + "strings" + "time" + + "code.google.com/p/goauth2/compute/serviceaccount" + compute "code.google.com/p/google-api-go-client/compute/v1" +) + +type GCECloud struct { + service *compute.Service + projectID string + zone string +} + +func getProjectAndZone() (string, string, error) { + client := http.Client{} + url := "http://metadata/computeMetadata/v1/instance/zone" + req, err := http.NewRequest("GET", url, nil) + if err != nil { + return "", "", err + } + req.Header.Add("X-Google-Metadata-Request", "True") + res, err := client.Do(req) + if err != nil { + return "", "", err + } + defer res.Body.Close() + data, err := ioutil.ReadAll(res.Body) + if err != nil { + return "", "", err + } + parts := strings.Split(string(data), "/") + if len(parts) != 4 { + return "", "", fmt.Errorf("Unexpected response: %s", string(data)) + } + return parts[1], parts[3], nil +} + +func NewGCECloud() (*GCECloud, error) { + projectID, zone, err := getProjectAndZone() + if err != nil { + return nil, err + } + client, err := serviceaccount.NewClient(&serviceaccount.Options{}) + if err != nil { + return nil, err + } + svc, err := compute.New(client) + if err != nil { + return nil, err + } + return &GCECloud{ + service: svc, + projectID: projectID, + zone: zone, + }, nil +} + +func (gce *GCECloud) TCPLoadBalancer() (TCPLoadBalancer, error) { + return gce, nil +} + +func makeHostLink(projectID, zone, host string) string { + ix := strings.Index(host, ".") + if ix != -1 { + host = host[:ix] + } + return fmt.Sprintf("https://www.googleapis.com/compute/v1/projects/%s/zones/%s/instances/%s", + projectID, zone, host) +} + +func (gce *GCECloud) makeTargetPool(name, region string, hosts []string) (string, error) { + var instances []string + for _, host := range hosts { + instances = append(instances, makeHostLink(gce.projectID, gce.zone, host)) + } + pool := &compute.TargetPool{ + Name: name, + Instances: instances, + } + _, err := gce.service.TargetPools.Insert(gce.projectID, region, pool).Do() + if err != nil { + return "", err + } + link := fmt.Sprintf("https://www.googleapis.com/compute/v1/projects/%s/regions/%s/targetPools/%s", gce.projectID, region, name) + return link, nil +} + +func (gce *GCECloud) waitForRegionOp(op *compute.Operation, region string) error { + pollOp := op + for pollOp.Status != "DONE" { + var err error + time.Sleep(time.Second * 10) + pollOp, err = gce.service.RegionOperations.Get(gce.projectID, region, op.Name).Do() + if err != nil { + return err + } + } + return nil +} + +func (gce *GCECloud) TCPLoadBalancerExists(name, region string) (bool, error) { + _, err := gce.service.ForwardingRules.Get(gce.projectID, region, name).Do() + return false, err +} + +func (gce *GCECloud) CreateTCPLoadBalancer(name, region string, port int, hosts []string) error { + pool, err := gce.makeTargetPool(name, region, hosts) + if err != nil { + return err + } + req := &compute.ForwardingRule{ + Name: name, + IPProtocol: "TCP", + PortRange: strconv.Itoa(port), + Target: pool, + } + _, err = gce.service.ForwardingRules.Insert(gce.projectID, region, req).Do() + return err +} + +func (gce *GCECloud) UpdateTCPLoadBalancer(name, region string, hosts []string) error { + var refs []*compute.InstanceReference + for _, host := range hosts { + refs = append(refs, &compute.InstanceReference{host}) + } + req := &compute.TargetPoolsAddInstanceRequest{ + Instances: refs, + } + + _, err := gce.service.TargetPools.AddInstance(gce.projectID, region, name, req).Do() + return err +} + +func (gce *GCECloud) DeleteTCPLoadBalancer(name, region string) error { + _, err := gce.service.ForwardingRules.Delete(gce.projectID, region, name).Do() + if err != nil { + return err + } + _, err = gce.service.TargetPools.Delete(gce.projectID, region, name).Do() + return err +} diff --git a/pkg/master/master.go b/pkg/master/master.go index ab18d2743d937..a14021e2c4718 100644 --- a/pkg/master/master.go +++ b/pkg/master/master.go @@ -23,6 +23,7 @@ import ( "github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver" "github.com/GoogleCloudPlatform/kubernetes/pkg/client" + "github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider" "github.com/GoogleCloudPlatform/kubernetes/pkg/registry" "github.com/GoogleCloudPlatform/kubernetes/pkg/util" "github.com/coreos/go-etcd/etcd" @@ -40,29 +41,29 @@ type Master struct { } // Returns a memory (not etcd) backed apiserver. -func NewMemoryServer(minions []string) *Master { +func NewMemoryServer(minions []string, cloud cloudprovider.Interface) *Master { m := &Master{ podRegistry: registry.MakeMemoryRegistry(), controllerRegistry: registry.MakeMemoryRegistry(), serviceRegistry: registry.MakeMemoryRegistry(), } - m.init(minions) + m.init(minions, cloud) return m } // Returns a new apiserver. -func New(etcdServers, minions []string) *Master { +func New(etcdServers, minions []string, cloud cloudprovider.Interface) *Master { etcdClient := etcd.NewClient(etcdServers) m := &Master{ podRegistry: registry.MakeEtcdRegistry(etcdClient, minions), controllerRegistry: registry.MakeEtcdRegistry(etcdClient, minions), serviceRegistry: registry.MakeEtcdRegistry(etcdClient, minions), } - m.init(minions) + m.init(minions, cloud) return m } -func (m *Master) init(minions []string) { +func (m *Master) init(minions []string, cloud cloudprovider.Interface) { containerInfo := &client.HTTPContainerInfo{ Client: http.DefaultClient, Port: 10250, @@ -73,7 +74,7 @@ func (m *Master) init(minions []string) { m.storage = map[string]apiserver.RESTStorage{ "pods": registry.MakePodRegistryStorage(m.podRegistry, containerInfo, registry.MakeFirstFitScheduler(m.minions, m.podRegistry, m.random)), "replicationControllers": registry.MakeControllerRegistryStorage(m.controllerRegistry), - "services": registry.MakeServiceRegistryStorage(m.serviceRegistry), + "services": registry.MakeServiceRegistryStorage(m.serviceRegistry, cloud, m.minions), } } diff --git a/pkg/registry/service_registry.go b/pkg/registry/service_registry.go index aaf5c4f68a578..43762a3170bdd 100644 --- a/pkg/registry/service_registry.go +++ b/pkg/registry/service_registry.go @@ -17,20 +17,28 @@ package registry import ( "encoding/json" + "fmt" "strconv" "strings" "github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver" + "github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider" "github.com/GoogleCloudPlatform/kubernetes/pkg/labels" ) type ServiceRegistryStorage struct { registry ServiceRegistry + cloud cloudprovider.Interface + hosts []string } -func MakeServiceRegistryStorage(registry ServiceRegistry) apiserver.RESTStorage { - return &ServiceRegistryStorage{registry: registry} +func MakeServiceRegistryStorage(registry ServiceRegistry, cloud cloudprovider.Interface, hosts []string) apiserver.RESTStorage { + return &ServiceRegistryStorage{ + registry: registry, + cloud: cloud, + hosts: hosts, + } } // GetServiceEnvironmentVariables populates a list of environment variables that are use @@ -76,6 +84,25 @@ func (sr *ServiceRegistryStorage) Get(id string) (interface{}, error) { } func (sr *ServiceRegistryStorage) Delete(id string) error { + svc, err := sr.Get(id) + if err != nil { + return err + } + if svc.(api.Service).CreateExternalLoadBalancer { + var balancer cloudprovider.TCPLoadBalancer + if sr.cloud != nil { + balancer, err = sr.cloud.TCPLoadBalancer() + if err != nil { + return err + } + } + if balancer != nil { + err = balancer.DeleteTCPLoadBalancer(id, "us-central1") + if err != nil { + return err + } + } + } return sr.registry.DeleteService(id) } @@ -87,7 +114,26 @@ func (sr *ServiceRegistryStorage) Extract(body string) (interface{}, error) { } func (sr *ServiceRegistryStorage) Create(obj interface{}) error { - return sr.registry.CreateService(obj.(api.Service)) + srv := obj.(api.Service) + if srv.CreateExternalLoadBalancer { + var balancer cloudprovider.TCPLoadBalancer + if sr.cloud != nil { + var err error + balancer, err = sr.cloud.TCPLoadBalancer() + if err != nil { + return err + } + } + if balancer != nil { + err := balancer.CreateTCPLoadBalancer(srv.ID, "us-central1", srv.Port, sr.hosts) + if err != nil { + return err + } + } else { + return fmt.Errorf("requested an external service, but no cloud provider supplied.") + } + } + return sr.registry.CreateService(srv) } func (sr *ServiceRegistryStorage) Update(obj interface{}) error { diff --git a/third_party/deps.sh b/third_party/deps.sh index df6825ac363e1..1391af1b0b6fd 100755 --- a/third_party/deps.sh +++ b/third_party/deps.sh @@ -1,11 +1,15 @@ TOP_PACKAGES=" github.com/coreos/go-etcd/etcd github.com/fsouza/go-dockerclient + code.google.com/p/goauth2/compute/serviceaccount + code.google.com/p/goauth2/oauth + code.google.com/p/google-api-go-client/compute/v1 " DEP_PACKAGES=" gopkg.in/v1/yaml bitbucket.org/kardianos/osext + code.google.com/p/google-api-go-client/googleapi github.com/coreos/go-log/log github.com/coreos/go-systemd/journal " diff --git a/third_party/src/code.google.com/p/goauth2/AUTHORS b/third_party/src/code.google.com/p/goauth2/AUTHORS new file mode 100644 index 0000000000000..15167cd746c56 --- /dev/null +++ b/third_party/src/code.google.com/p/goauth2/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/third_party/src/code.google.com/p/goauth2/CONTRIBUTORS b/third_party/src/code.google.com/p/goauth2/CONTRIBUTORS new file mode 100644 index 0000000000000..1c4577e968061 --- /dev/null +++ b/third_party/src/code.google.com/p/goauth2/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/third_party/src/code.google.com/p/goauth2/LICENSE b/third_party/src/code.google.com/p/goauth2/LICENSE new file mode 100644 index 0000000000000..6765f090b4187 --- /dev/null +++ b/third_party/src/code.google.com/p/goauth2/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The goauth2 Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/third_party/src/code.google.com/p/goauth2/PATENTS b/third_party/src/code.google.com/p/goauth2/PATENTS new file mode 100644 index 0000000000000..9e8716353d82c --- /dev/null +++ b/third_party/src/code.google.com/p/goauth2/PATENTS @@ -0,0 +1,22 @@ +Additional IP Rights Grant (Patents) + +"This implementation" means the copyrightable works distributed by +Google as part of the goauth2 project. + +Google hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable (except as stated in this section) +patent license to make, have made, use, offer to sell, sell, import, +transfer and otherwise run, modify and propagate the contents of this +implementation of Go, where such license applies only to those patent +claims, both currently owned or controlled by Google and acquired in +the future, licensable by Google that are necessarily infringed by this +implementation of Go. This grant does not include claims that would be +infringed only as a consequence of further modification of this +implementation. If you or your agent or exclusive licensee institute or +order or agree to the institution of patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging +that this implementation of Go or any code incorporated within this +implementation of Go constitutes direct or contributory patent +infringement, or inducement of patent infringement, then any patent +rights granted to you under this License for this implementation of Go +shall terminate as of the date such litigation is filed. diff --git a/third_party/src/code.google.com/p/goauth2/README b/third_party/src/code.google.com/p/goauth2/README new file mode 100644 index 0000000000000..ff8973d835bd7 --- /dev/null +++ b/third_party/src/code.google.com/p/goauth2/README @@ -0,0 +1,7 @@ +This is the repository for goauth2; an OAuth 2.0 client library for Go. + +To contribute, follow the Go Programming Language's contribution process: + http://golang.org/doc/contribute.html +Except use the goauth2 repository instead of the go repo. + +Contact Andrew Gerrand with any enquiries. diff --git a/third_party/src/code.google.com/p/goauth2/appengine/serviceaccount/cache.go b/third_party/src/code.google.com/p/goauth2/appengine/serviceaccount/cache.go new file mode 100644 index 0000000000000..c88aa4cc4d3b8 --- /dev/null +++ b/third_party/src/code.google.com/p/goauth2/appengine/serviceaccount/cache.go @@ -0,0 +1,42 @@ +// Copyright 2013 The goauth2 Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build appengine + +package serviceaccount + +import ( + "time" + + "appengine" + "appengine/memcache" + + "code.google.com/p/goauth2/oauth" +) + +// cache implementss TokenCache using memcache to store AccessToken +// for the application service account. +type cache struct { + Context appengine.Context + Key string +} + +func (m cache) Token() (*oauth.Token, error) { + item, err := memcache.Get(m.Context, m.Key) + if err != nil { + return nil, err + } + return &oauth.Token{ + AccessToken: string(item.Value), + Expiry: time.Now().Add(item.Expiration), + }, nil +} + +func (m cache) PutToken(tok *oauth.Token) error { + return memcache.Set(m.Context, &memcache.Item{ + Key: m.Key, + Value: []byte(tok.AccessToken), + Expiration: tok.Expiry.Sub(time.Now()), + }) +} diff --git a/third_party/src/code.google.com/p/goauth2/appengine/serviceaccount/serviceaccount.go b/third_party/src/code.google.com/p/goauth2/appengine/serviceaccount/serviceaccount.go new file mode 100644 index 0000000000000..1c594824be2fe --- /dev/null +++ b/third_party/src/code.google.com/p/goauth2/appengine/serviceaccount/serviceaccount.go @@ -0,0 +1,133 @@ +// Copyright 2013 The goauth2 Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build appengine + +// The serviceaccount package provides support for making +// OAuth2-authorized HTTP requests from App Engine using service +// accounts. +// +// See: https://developers.google.com/appengine/docs/go/reference#AccessToken +// +// Example usage: +// +// c := appengine.NewContext() +// client, err := serviceaccount.NewClient(c, "https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/bigquery") +// if err != nil { +// c.Errorf("failed to create service account client: %q", err) +// return err +// } +// client.Post("https://www.googleapis.com/compute/...", ...) +// client.Post("https://www.googleapis.com/bigquery/...", ...) +// +package serviceaccount + +import ( + "net/http" + "strings" + + "appengine" + "appengine/urlfetch" + + "code.google.com/p/goauth2/oauth" +) + +// NewClient returns an *http.Client authorized for the +// given scopes with the service account owned by the application. +// Tokens are cached in memcache until they expire. +func NewClient(c appengine.Context, scopes ...string) (*http.Client, error) { + t := &transport{ + Context: c, + Scopes: scopes, + Transport: &urlfetch.Transport{ + Context: c, + Deadline: 0, + AllowInvalidServerCertificate: false, + }, + TokenCache: &cache{ + Context: c, + Key: "goauth2_serviceaccount_" + strings.Join(scopes, "_"), + }, + } + // Get the initial access token. + if err := t.FetchToken(); err != nil { + return nil, err + } + return &http.Client{ + Transport: t, + }, nil +} + +// transport is an oauth.Transport with a custom Refresh and RoundTrip implementation. +type transport struct { + *oauth.Token + Context appengine.Context + Scopes []string + Transport http.RoundTripper + TokenCache oauth.Cache +} + +func (t *transport) Refresh() error { + // Get a new access token for the application service account. + tok, expiry, err := appengine.AccessToken(t.Context, t.Scopes...) + if err != nil { + return err + } + t.Token = &oauth.Token{ + AccessToken: tok, + Expiry: expiry, + } + if t.TokenCache != nil { + // Cache the token and ignore error (as we can always get a new one). + t.TokenCache.PutToken(t.Token) + } + return nil +} + +// Fetch token from cache or generate a new one if cache miss or expired. +func (t *transport) FetchToken() error { + // Try to get the Token from the cache if enabled. + if t.Token == nil && t.TokenCache != nil { + // Ignore cache error as we can always get a new token with Refresh. + t.Token, _ = t.TokenCache.Token() + } + + // Get a new token using Refresh in case of a cache miss of if it has expired. + if t.Token == nil || t.Expired() { + if err := t.Refresh(); err != nil { + return err + } + } + return nil +} + +// cloneRequest returns a clone of the provided *http.Request. +// The clone is a shallow copy of the struct and its Header map. +func cloneRequest(r *http.Request) *http.Request { + // shallow copy of the struct + r2 := new(http.Request) + *r2 = *r + // deep copy of the Header + r2.Header = make(http.Header) + for k, s := range r.Header { + r2.Header[k] = s + } + return r2 +} + +// RoundTrip issues an authorized HTTP request and returns its response. +func (t *transport) RoundTrip(req *http.Request) (*http.Response, error) { + if err := t.FetchToken(); err != nil { + return nil, err + } + + // To set the Authorization header, we must make a copy of the Request + // so that we don't modify the Request we were given. + // This is required by the specification of http.RoundTripper. + newReq := cloneRequest(req) + newReq.Header.Set("Authorization", "Bearer "+t.AccessToken) + + // Make the HTTP request. + return t.Transport.RoundTrip(newReq) +} diff --git a/third_party/src/code.google.com/p/goauth2/compute/serviceaccount/serviceaccount.go b/third_party/src/code.google.com/p/goauth2/compute/serviceaccount/serviceaccount.go new file mode 100644 index 0000000000000..e6fb642466260 --- /dev/null +++ b/third_party/src/code.google.com/p/goauth2/compute/serviceaccount/serviceaccount.go @@ -0,0 +1,172 @@ +// Copyright 2013 The goauth2 Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package serviceaccount provides support for making OAuth2-authorized +// HTTP requests from Google Compute Engine instances using service accounts. +// +// See: https://developers.google.com/compute/docs/authentication +// +// Example usage: +// +// client, err := serviceaccount.NewClient(&serviceaccount.Options{}) +// if err != nil { +// c.Errorf("failed to create service account client: %q", err) +// return err +// } +// client.Post("https://www.googleapis.com/compute/...", ...) +// client.Post("https://www.googleapis.com/bigquery/...", ...) +// +package serviceaccount + +import ( + "encoding/json" + "net/http" + "net/url" + "path" + "sync" + "time" + + "code.google.com/p/goauth2/oauth" +) + +const ( + metadataServer = "metadata" + serviceAccountPath = "/computeMetadata/v1/instance/service-accounts" +) + +// Options configures a service account Client. +type Options struct { + // Underlying transport of service account Client. + // If nil, http.DefaultTransport is used. + Transport http.RoundTripper + + // Service account name. + // If empty, "default" is used. + Account string +} + +// NewClient returns an *http.Client authorized with the service account +// configured in the Google Compute Engine instance. +func NewClient(opt *Options) (*http.Client, error) { + tr := http.DefaultTransport + account := "default" + if opt != nil { + if opt.Transport != nil { + tr = opt.Transport + } + if opt.Account != "" { + account = opt.Account + } + } + t := &transport{ + Transport: tr, + Account: account, + } + // Get the initial access token. + if _, err := fetchToken(t); err != nil { + return nil, err + } + return &http.Client{ + Transport: t, + }, nil +} + +type tokenData struct { + AccessToken string `json:"access_token"` + ExpiresIn float64 `json:"expires_in"` + TokenType string `json:"token_type"` +} + +// transport is an oauth.Transport with a custom Refresh and RoundTrip implementation. +type transport struct { + Transport http.RoundTripper + Account string + + mu sync.Mutex + *oauth.Token +} + +// Refresh renews the transport's AccessToken. +// t.mu sould be held when this is called. +func (t *transport) refresh() error { + // https://developers.google.com/compute/docs/metadata + // v1 requires "X-Google-Metadata-Request: True" header. + tokenURL := &url.URL{ + Scheme: "http", + Host: metadataServer, + Path: path.Join(serviceAccountPath, t.Account, "token"), + } + req, err := http.NewRequest("GET", tokenURL.String(), nil) + if err != nil { + return err + } + req.Header.Add("X-Google-Metadata-Request", "True") + resp, err := http.DefaultClient.Do(req) + if err != nil { + return err + } + defer resp.Body.Close() + d := json.NewDecoder(resp.Body) + var token tokenData + err = d.Decode(&token) + if err != nil { + return err + } + t.Token = &oauth.Token{ + AccessToken: token.AccessToken, + Expiry: time.Now().Add(time.Duration(token.ExpiresIn) * time.Second), + } + return nil +} + +// Refresh renews the transport's AccessToken. +func (t *transport) Refresh() error { + t.mu.Lock() + defer t.mu.Unlock() + return t.refresh() +} + +// Fetch token from cache or generate a new one if cache miss or expired. +func fetchToken(t *transport) (*oauth.Token, error) { + // Get a new token using Refresh in case of a cache miss of if it has expired. + t.mu.Lock() + defer t.mu.Unlock() + if t.Token == nil || t.Expired() { + if err := t.refresh(); err != nil { + return nil, err + } + } + return t.Token, nil +} + +// cloneRequest returns a clone of the provided *http.Request. +// The clone is a shallow copy of the struct and its Header map. +func cloneRequest(r *http.Request) *http.Request { + // shallow copy of the struct + r2 := new(http.Request) + *r2 = *r + // deep copy of the Header + r2.Header = make(http.Header) + for k, s := range r.Header { + r2.Header[k] = s + } + return r2 +} + +// RoundTrip issues an authorized HTTP request and returns its response. +func (t *transport) RoundTrip(req *http.Request) (*http.Response, error) { + token, err := fetchToken(t) + if err != nil { + return nil, err + } + + // To set the Authorization header, we must make a copy of the Request + // so that we don't modify the Request we were given. + // This is required by the specification of http.RoundTripper. + newReq := cloneRequest(req) + newReq.Header.Set("Authorization", "Bearer "+token.AccessToken) + + // Make the HTTP request. + return t.Transport.RoundTrip(newReq) +} diff --git a/third_party/src/code.google.com/p/goauth2/lib/codereview/codereview.cfg b/third_party/src/code.google.com/p/goauth2/lib/codereview/codereview.cfg new file mode 100644 index 0000000000000..e3eb47ca0d78d --- /dev/null +++ b/third_party/src/code.google.com/p/goauth2/lib/codereview/codereview.cfg @@ -0,0 +1,2 @@ +defaultcc: golang-dev@googlegroups.com +contributors: http://go.googlecode.com/hg/CONTRIBUTORS diff --git a/third_party/src/code.google.com/p/goauth2/oauth/example/oauthreq.go b/third_party/src/code.google.com/p/goauth2/oauth/example/oauthreq.go new file mode 100755 index 0000000000000..0bedc754bcc38 --- /dev/null +++ b/third_party/src/code.google.com/p/goauth2/oauth/example/oauthreq.go @@ -0,0 +1,100 @@ +// Copyright 2011 The goauth2 Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This program makes a call to the specified API, authenticated with OAuth2. +// a list of example APIs can be found at https://code.google.com/oauthplayground/ +package main + +import ( + "flag" + "fmt" + "io" + "log" + "os" + + "code.google.com/p/goauth2/oauth" +) + +var ( + clientId = flag.String("id", "", "Client ID") + clientSecret = flag.String("secret", "", "Client Secret") + scope = flag.String("scope", "https://www.googleapis.com/auth/userinfo.profile", "OAuth scope") + redirectURL = flag.String("redirect_url", "oob", "Redirect URL") + authURL = flag.String("auth_url", "https://accounts.google.com/o/oauth2/auth", "Authentication URL") + tokenURL = flag.String("token_url", "https://accounts.google.com/o/oauth2/token", "Token URL") + requestURL = flag.String("request_url", "https://www.googleapis.com/oauth2/v1/userinfo", "API request") + code = flag.String("code", "", "Authorization Code") + cachefile = flag.String("cache", "cache.json", "Token cache file") +) + +const usageMsg = ` +To obtain a request token you must specify both -id and -secret. + +To obtain Client ID and Secret, see the "OAuth 2 Credentials" section under +the "API Access" tab on this page: https://code.google.com/apis/console/ + +Once you have completed the OAuth flow, the credentials should be stored inside +the file specified by -cache and you may run without the -id and -secret flags. +` + +func main() { + flag.Parse() + + // Set up a configuration. + config := &oauth.Config{ + ClientId: *clientId, + ClientSecret: *clientSecret, + RedirectURL: *redirectURL, + Scope: *scope, + AuthURL: *authURL, + TokenURL: *tokenURL, + TokenCache: oauth.CacheFile(*cachefile), + } + + // Set up a Transport using the config. + transport := &oauth.Transport{Config: config} + + // Try to pull the token from the cache; if this fails, we need to get one. + token, err := config.TokenCache.Token() + if err != nil { + if *clientId == "" || *clientSecret == "" { + flag.Usage() + fmt.Fprint(os.Stderr, usageMsg) + os.Exit(2) + } + if *code == "" { + // Get an authorization code from the data provider. + // ("Please ask the user if I can access this resource.") + url := config.AuthCodeURL("") + fmt.Println("Visit this URL to get a code, then run again with -code=YOUR_CODE\n") + fmt.Println(url) + return + } + // Exchange the authorization code for an access token. + // ("Here's the code you gave the user, now give me a token!") + token, err = transport.Exchange(*code) + if err != nil { + log.Fatal("Exchange:", err) + } + // (The Exchange method will automatically cache the token.) + fmt.Printf("Token is cached in %v\n", config.TokenCache) + } + + // Make the actual request using the cached token to authenticate. + // ("Here's the token, let me in!") + transport.Token = token + + // Make the request. + r, err := transport.Client().Get(*requestURL) + if err != nil { + log.Fatal("Get:", err) + } + defer r.Body.Close() + + // Write the response to standard output. + io.Copy(os.Stdout, r.Body) + + // Send final carriage return, just to be neat. + fmt.Println() +} diff --git a/third_party/src/code.google.com/p/goauth2/oauth/jwt/example/example.client_secrets.json b/third_party/src/code.google.com/p/goauth2/oauth/jwt/example/example.client_secrets.json new file mode 100644 index 0000000000000..2ea86f2fc2969 --- /dev/null +++ b/third_party/src/code.google.com/p/goauth2/oauth/jwt/example/example.client_secrets.json @@ -0,0 +1 @@ +{"web":{"auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://accounts.google.com/o/oauth2/token","client_email":"XXXXXXXXXXXX@developer.gserviceaccount.com","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/XXXXXXXXXXXX@developer.gserviceaccount.com","client_id":"XXXXXXXXXXXX.apps.googleusercontent.com","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs"}} diff --git a/third_party/src/code.google.com/p/goauth2/oauth/jwt/example/example.pem b/third_party/src/code.google.com/p/goauth2/oauth/jwt/example/example.pem new file mode 100644 index 0000000000000..8f78b922d698b --- /dev/null +++ b/third_party/src/code.google.com/p/goauth2/oauth/jwt/example/example.pem @@ -0,0 +1,20 @@ +Bag Attributes + friendlyName: privatekey + localKeyID: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +Key Attributes: +-----BEGIN PRIVATE KEY----- +XXXXxyXXXXXXXxxyxxxX9y0XXYXXXXYXXxXyxxXxXxXXXyXXXXx4yx1xy1xyYxxY +1XxYy38YxXxxxyXxyyxx+xxxxyx1Y1xYx7yx2/Y1XyyXYYYxY5YXxX0xY/Y642yX +zYYxYXzXYxY0Y8y9YxyYXxxX40YyXxxXX4XXxx7XxXxxXyXxYYXxXyxX5XY0Yy2X +1YX0XXyy6YXyXx9XxXxyXX9XXYXxXxXXXXXXxYXYY3Y8Yy311XYYY81XyY14Xyyx +xXyx7xxXXXxxxxyyyX4YYYXyYyYXyxX4XYXYyxXYyx9xy23xXYyXyxYxXxx1XXXY +y98yX6yYxyyyX4Xyx1Xy/0yxxYxXxYYx2xx7yYXXXxYXXXxyXyyYYxx5XX2xxyxy +y6Yyyx0XX3YYYyx9YYXXXX7y0yxXXy+90XYz1y2xyx7yXxX+8X0xYxXXYxxyxYYy +YXx8Yy4yX0Xyxxx6yYX92yxy1YYYzyyyyxy55x/yyXXXYYXYXXzXXxYYxyXY8XXX ++y9+yXxX7XxxyYYxxXYxyY623xxXxYX59x5Y6yYyXYY4YxXXYXXXYxXYxXxXXx6x +YXX7XxXX2X0XY7YXyYy1XXxYXxXxYY1xXXxxxyy+07zXYxYxxXyyxxyxXx1XYy5X +5XYzyxYxXXYyX9XX7xX8xXxx+XXYyYXXXX5YY1x8Yxyx54Xy/1XXyyYXY5YxYyxY +XyyxXyX/YxxXXXxXXYXxyxx63xX/xxyYXXyYzx0XY+YxX5xyYyyxxxXXYX/94XXy +Xx63xYxXyXY3/XXxyyXX15XXXyz08XYY5YYXY/YXy/96x68XyyXXxYyXy4xYXx5x +7yxxyxxYxXxyx3y= +-----END PRIVATE KEY----- diff --git a/third_party/src/code.google.com/p/goauth2/oauth/jwt/example/main.go b/third_party/src/code.google.com/p/goauth2/oauth/jwt/example/main.go new file mode 100644 index 0000000000000..2256e9c621c8a --- /dev/null +++ b/third_party/src/code.google.com/p/goauth2/oauth/jwt/example/main.go @@ -0,0 +1,114 @@ +// Copyright 2011 The goauth2 Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This program makes a read only call to the Google Cloud Storage API, +// authenticated with OAuth2. A list of example APIs can be found at +// https://code.google.com/oauthplayground/ +package main + +import ( + "encoding/json" + "flag" + "fmt" + "io/ioutil" + "log" + "net/http" + "strings" + + "code.google.com/p/goauth2/oauth/jwt" +) + +const scope = "https://www.googleapis.com/auth/devstorage.read_only" + +var ( + secretsFile = flag.String("s", "", "JSON encoded secrets for the service account") + pemFile = flag.String("k", "", "private pem key file for the service account") +) + +const usageMsg = ` +You must specify -k and -s. + +To obtain client secrets and pem, see the "OAuth 2 Credentials" section under +the "API Access" tab on this page: https://code.google.com/apis/console/ + +Google Cloud Storage must also be turned on in the API console. +` + +func main() { + flag.Parse() + + if *secretsFile == "" || *pemFile == "" { + flag.Usage() + fmt.Println(usageMsg) + return + } + + // Read the secret file bytes into the config. + secretBytes, err := ioutil.ReadFile(*secretsFile) + if err != nil { + log.Fatal("error reading secerets file:", err) + } + var config struct { + Web struct { + ClientEmail string `json:"client_email"` + ClientID string `json:"client_id"` + TokenURI string `json:"token_uri"` + } + } + err = json.Unmarshal(secretBytes, &config) + if err != nil { + log.Fatal("error unmarshalling secerets:", err) + } + + // Get the project ID from the client ID. + projectID := strings.SplitN(config.Web.ClientID, "-", 2)[0] + + // Read the pem file bytes for the private key. + keyBytes, err := ioutil.ReadFile(*pemFile) + if err != nil { + log.Fatal("error reading private key file:", err) + } + + // Craft the ClaimSet and JWT token. + t := jwt.NewToken(config.Web.ClientEmail, scope, keyBytes) + t.ClaimSet.Aud = config.Web.TokenURI + + // We need to provide a client. + c := &http.Client{} + + // Get the access token. + o, err := t.Assert(c) + if err != nil { + log.Fatal("assertion error:", err) + } + + // Refresh token will be missing, but this access_token will be good + // for one hour. + fmt.Printf("access_token = %v\n", o.AccessToken) + fmt.Printf("refresh_token = %v\n", o.RefreshToken) + fmt.Printf("expires %v\n", o.Expiry) + + // Form the request to list Google Cloud Storage buckets. + req, err := http.NewRequest("GET", "https://storage.googleapis.com/", nil) + if err != nil { + log.Fatal("http.NewRequest:", err) + } + req.Header.Set("Authorization", "OAuth "+o.AccessToken) + req.Header.Set("x-goog-api-version", "2") + req.Header.Set("x-goog-project-id", projectID) + + // Make the request. + r, err := c.Do(req) + if err != nil { + log.Fatal("API request error:", err) + } + defer r.Body.Close() + + // Write the response to standard output. + res, err := ioutil.ReadAll(r.Body) + if err != nil { + log.Fatal("error reading API request results:", err) + } + fmt.Printf("\nRESULT:\n%s\n", res) +} diff --git a/third_party/src/code.google.com/p/goauth2/oauth/jwt/jwt.go b/third_party/src/code.google.com/p/goauth2/oauth/jwt/jwt.go new file mode 100644 index 0000000000000..61bf5ce9368f1 --- /dev/null +++ b/third_party/src/code.google.com/p/goauth2/oauth/jwt/jwt.go @@ -0,0 +1,511 @@ +// Copyright 2012 The goauth2 Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// The jwt package provides support for creating credentials for OAuth2 service +// account requests. +// +// For examples of the package usage please see jwt_test.go. +// Example usage (error handling omitted for brevity): +// +// // Craft the ClaimSet and JWT token. +// iss := "XXXXXXXXXXXX@developer.gserviceaccount.com" +// scope := "https://www.googleapis.com/auth/devstorage.read_only" +// t := jwt.NewToken(iss, scope, pemKeyBytes) +// +// // We need to provide a client. +// c := &http.Client{} +// +// // Get the access token. +// o, _ := t.Assert(c) +// +// // Form the request to the service. +// req, _ := http.NewRequest("GET", "https://storage.googleapis.com/", nil) +// req.Header.Set("Authorization", "OAuth "+o.AccessToken) +// req.Header.Set("x-goog-api-version", "2") +// req.Header.Set("x-goog-project-id", "XXXXXXXXXXXX") +// +// // Make the request. +// result, _ := c.Do(req) +// +// For info on OAuth2 service accounts please see the online documentation. +// https://developers.google.com/accounts/docs/OAuth2ServiceAccount +// +package jwt + +import ( + "bytes" + "crypto" + "crypto/rand" + "crypto/rsa" + "crypto/sha256" + "crypto/x509" + "encoding/base64" + "encoding/json" + "encoding/pem" + "errors" + "fmt" + "net/http" + "net/url" + "strings" + "time" + + "code.google.com/p/goauth2/oauth" +) + +// These are the default/standard values for this to work for Google service accounts. +const ( + stdAlgorithm = "RS256" + stdType = "JWT" + stdAssertionType = "http://oauth.net/grant_type/jwt/1.0/bearer" + stdGrantType = "urn:ietf:params:oauth:grant-type:jwt-bearer" + stdAud = "https://accounts.google.com/o/oauth2/token" +) + +var ( + ErrInvalidKey = errors.New("Invalid Key") +) + +// base64Encode returns and Base64url encoded version of the input string with any +// trailing "=" stripped. +func base64Encode(b []byte) string { + return strings.TrimRight(base64.URLEncoding.EncodeToString(b), "=") +} + +// base64Decode decodes the Base64url encoded string +func base64Decode(s string) ([]byte, error) { + // add back missing padding + switch len(s) % 4 { + case 2: + s += "==" + case 3: + s += "=" + } + return base64.URLEncoding.DecodeString(s) +} + +// The JWT claim set contains information about the JWT including the +// permissions being requested (scopes), the target of the token, the issuer, +// the time the token was issued, and the lifetime of the token. +// +// Aud is usually https://accounts.google.com/o/oauth2/token +type ClaimSet struct { + Iss string `json:"iss"` // email address of the client_id of the application making the access token request + Scope string `json:"scope,omitempty"` // space-delimited list of the permissions the application requests + Aud string `json:"aud"` // descriptor of the intended target of the assertion (Optional). + Prn string `json:"prn,omitempty"` // email for which the application is requesting delegated access (Optional). + Exp int64 `json:"exp"` + Iat int64 `json:"iat"` + Typ string `json:"typ,omitempty"` + Sub string `json:"sub,omitempty"` // Add support for googleapi delegation support + + // See http://tools.ietf.org/html/draft-jones-json-web-token-10#section-4.3 + // This array is marshalled using custom code (see (c *ClaimSet) encode()). + PrivateClaims map[string]interface{} `json:"-"` + + exp time.Time + iat time.Time +} + +// setTimes sets iat and exp to time.Now() and iat.Add(time.Hour) respectively. +// +// Note that these times have nothing to do with the expiration time for the +// access_token returned by the server. These have to do with the lifetime of +// the encoded JWT. +// +// A JWT can be re-used for up to one hour after it was encoded. The access +// token that is granted will also be good for one hour so there is little point +// in trying to use the JWT a second time. +func (c *ClaimSet) setTimes(t time.Time) { + c.iat = t + c.exp = c.iat.Add(time.Hour) +} + +var ( + jsonStart = []byte{'{'} + jsonEnd = []byte{'}'} +) + +// encode returns the Base64url encoded form of the Signature. +func (c *ClaimSet) encode() string { + if c.exp.IsZero() || c.iat.IsZero() { + c.setTimes(time.Now()) + } + if c.Aud == "" { + c.Aud = stdAud + } + c.Exp = c.exp.Unix() + c.Iat = c.iat.Unix() + + b, err := json.Marshal(c) + if err != nil { + panic(err) + } + + if len(c.PrivateClaims) == 0 { + return base64Encode(b) + } + + // Marshal private claim set and then append it to b. + prv, err := json.Marshal(c.PrivateClaims) + if err != nil { + panic(fmt.Errorf("Invalid map of private claims %v", c.PrivateClaims)) + } + + // Concatenate public and private claim JSON objects. + if !bytes.HasSuffix(b, jsonEnd) { + panic(fmt.Errorf("Invalid JSON %s", b)) + } + if !bytes.HasPrefix(prv, jsonStart) { + panic(fmt.Errorf("Invalid JSON %s", prv)) + } + b[len(b)-1] = ',' // Replace closing curly brace with a comma. + b = append(b, prv[1:]...) // Append private claims. + + return base64Encode(b) +} + +// Header describes the algorithm and type of token being generated, +// and optionally a KeyID describing additional parameters for the +// signature. +type Header struct { + Algorithm string `json:"alg"` + Type string `json:"typ"` + KeyId string `json:"kid,omitempty"` +} + +func (h *Header) encode() string { + b, err := json.Marshal(h) + if err != nil { + panic(err) + } + return base64Encode(b) +} + +// A JWT is composed of three parts: a header, a claim set, and a signature. +// The well formed and encoded JWT can then be exchanged for an access token. +// +// The Token is not a JWT, but is is encoded to produce a well formed JWT. +// +// When obtaining a key from the Google API console it will be downloaded in a +// PKCS12 encoding. To use this key you will need to convert it to a PEM file. +// This can be achieved with openssl. +// +// $ openssl pkcs12 -in -nocerts -passin pass:notasecret -nodes -out +// +// The contents of this file can then be used as the Key. +type Token struct { + ClaimSet *ClaimSet // claim set used to construct the JWT + Header *Header // header used to construct the JWT + Key []byte // PEM printable encoding of the private key + pKey *rsa.PrivateKey + + header string + claim string + sig string + + useExternalSigner bool + signer Signer +} + +// NewToken returns a filled in *Token based on the standard header, +// and sets the Iat and Exp times based on when the call to Assert is +// made. +func NewToken(iss, scope string, key []byte) *Token { + c := &ClaimSet{ + Iss: iss, + Scope: scope, + Aud: stdAud, + } + h := &Header{ + Algorithm: stdAlgorithm, + Type: stdType, + } + t := &Token{ + ClaimSet: c, + Header: h, + Key: key, + } + return t +} + +// Signer is an interface that given a JWT token, returns the header & +// claim (serialized and urlEncoded to a byte slice), along with the +// signature and an error (if any occured). It could modify any data +// to sign (typically the KeyID). +// +// Example usage where a SHA256 hash of the original url-encoded token +// with an added KeyID and secret data is used as a signature: +// +// var privateData = "secret data added to hash, indexed by KeyID" +// +// type SigningService struct{} +// +// func (ss *SigningService) Sign(in *jwt.Token) (newTokenData, sig []byte, err error) { +// in.Header.KeyID = "signing service" +// newTokenData = in.EncodeWithoutSignature() +// dataToSign := fmt.Sprintf("%s.%s", newTokenData, privateData) +// h := sha256.New() +// _, err := h.Write([]byte(dataToSign)) +// sig = h.Sum(nil) +// return +// } +type Signer interface { + Sign(in *Token) (tokenData, signature []byte, err error) +} + +// NewSignerToken returns a *Token, using an external signer function +func NewSignerToken(iss, scope string, signer Signer) *Token { + t := NewToken(iss, scope, nil) + t.useExternalSigner = true + t.signer = signer + return t +} + +// Expired returns a boolean value letting us know if the token has expired. +func (t *Token) Expired() bool { + return t.ClaimSet.exp.Before(time.Now()) +} + +// Encode constructs and signs a Token returning a JWT ready to use for +// requesting an access token. +func (t *Token) Encode() (string, error) { + var tok string + t.header = t.Header.encode() + t.claim = t.ClaimSet.encode() + err := t.sign() + if err != nil { + return tok, err + } + tok = fmt.Sprintf("%s.%s.%s", t.header, t.claim, t.sig) + return tok, nil +} + +// EncodeWithoutSignature returns the url-encoded value of the Token +// before signing has occured (typically for use by external signers). +func (t *Token) EncodeWithoutSignature() string { + t.header = t.Header.encode() + t.claim = t.ClaimSet.encode() + return fmt.Sprintf("%s.%s", t.header, t.claim) +} + +// sign computes the signature for a Token. The details for this can be found +// in the OAuth2 Service Account documentation. +// https://developers.google.com/accounts/docs/OAuth2ServiceAccount#computingsignature +func (t *Token) sign() error { + if t.useExternalSigner { + fulldata, sig, err := t.signer.Sign(t) + if err != nil { + return err + } + split := strings.Split(string(fulldata), ".") + if len(split) != 2 { + return errors.New("no token returned") + } + t.header = split[0] + t.claim = split[1] + t.sig = base64Encode(sig) + return err + } + ss := fmt.Sprintf("%s.%s", t.header, t.claim) + if t.pKey == nil { + err := t.parsePrivateKey() + if err != nil { + return err + } + } + h := sha256.New() + h.Write([]byte(ss)) + b, err := rsa.SignPKCS1v15(rand.Reader, t.pKey, crypto.SHA256, h.Sum(nil)) + t.sig = base64Encode(b) + return err +} + +// parsePrivateKey converts the Token's Key ([]byte) into a parsed +// rsa.PrivateKey. If the key is not well formed this method will return an +// ErrInvalidKey error. +func (t *Token) parsePrivateKey() error { + block, _ := pem.Decode(t.Key) + if block == nil { + return ErrInvalidKey + } + parsedKey, err := x509.ParsePKCS8PrivateKey(block.Bytes) + if err != nil { + parsedKey, err = x509.ParsePKCS1PrivateKey(block.Bytes) + if err != nil { + return err + } + } + var ok bool + t.pKey, ok = parsedKey.(*rsa.PrivateKey) + if !ok { + return ErrInvalidKey + } + return nil +} + +// Assert obtains an *oauth.Token from the remote server by encoding and sending +// a JWT. The access_token will expire in one hour (3600 seconds) and cannot be +// refreshed (no refresh_token is returned with the response). Once this token +// expires call this method again to get a fresh one. +func (t *Token) Assert(c *http.Client) (*oauth.Token, error) { + var o *oauth.Token + t.ClaimSet.setTimes(time.Now()) + u, v, err := t.buildRequest() + if err != nil { + return o, err + } + resp, err := c.PostForm(u, v) + if err != nil { + return o, err + } + o, err = handleResponse(resp) + return o, err +} + +// buildRequest sets up the URL values and the proper URL string for making our +// access_token request. +func (t *Token) buildRequest() (string, url.Values, error) { + v := url.Values{} + j, err := t.Encode() + if err != nil { + return t.ClaimSet.Aud, v, err + } + v.Set("grant_type", stdGrantType) + v.Set("assertion", j) + return t.ClaimSet.Aud, v, nil +} + +// Used for decoding the response body. +type respBody struct { + IdToken string `json:"id_token"` + Access string `json:"access_token"` + Type string `json:"token_type"` + ExpiresIn time.Duration `json:"expires_in"` +} + +// handleResponse returns a filled in *oauth.Token given the *http.Response from +// a *http.Request created by buildRequest. +func handleResponse(r *http.Response) (*oauth.Token, error) { + o := &oauth.Token{} + defer r.Body.Close() + if r.StatusCode != 200 { + return o, errors.New("invalid response: " + r.Status) + } + b := &respBody{} + err := json.NewDecoder(r.Body).Decode(b) + if err != nil { + return o, err + } + o.AccessToken = b.Access + if b.IdToken != "" { + // decode returned id token to get expiry + o.AccessToken = b.IdToken + s := strings.Split(b.IdToken, ".") + if len(s) < 2 { + return nil, errors.New("invalid token received") + } + d, err := base64Decode(s[1]) + if err != nil { + return o, err + } + c := &ClaimSet{} + err = json.NewDecoder(bytes.NewBuffer(d)).Decode(c) + if err != nil { + return o, err + } + o.Expiry = time.Unix(c.Exp, 0) + return o, nil + } + o.Expiry = time.Now().Add(b.ExpiresIn * time.Second) + return o, nil +} + +// Transport implements http.RoundTripper. When configured with a valid +// JWT and OAuth tokens it can be used to make authenticated HTTP requests. +// +// t := &jwt.Transport{jwtToken, oauthToken} +// r, _, err := t.Client().Get("http://example.org/url/requiring/auth") +// +// It will automatically refresh the OAuth token if it can, updating in place. +type Transport struct { + JWTToken *Token + OAuthToken *oauth.Token + + // Transport is the HTTP transport to use when making requests. + // It will default to http.DefaultTransport if nil. + Transport http.RoundTripper +} + +// Creates a new authenticated transport. +func NewTransport(token *Token) (*Transport, error) { + oa, err := token.Assert(new(http.Client)) + if err != nil { + return nil, err + } + return &Transport{ + JWTToken: token, + OAuthToken: oa, + }, nil +} + +// Client returns an *http.Client that makes OAuth-authenticated requests. +func (t *Transport) Client() *http.Client { + return &http.Client{Transport: t} +} + +// Fetches the internal transport. +func (t *Transport) transport() http.RoundTripper { + if t.Transport != nil { + return t.Transport + } + return http.DefaultTransport +} + +// RoundTrip executes a single HTTP transaction using the Transport's +// OAuthToken as authorization headers. +// +// This method will attempt to renew the token if it has expired and may return +// an error related to that token renewal before attempting the client request. +// If the token cannot be renewed a non-nil os.Error value will be returned. +// If the token is invalid callers should expect HTTP-level errors, +// as indicated by the Response's StatusCode. +func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { + // Sanity check the two tokens + if t.JWTToken == nil { + return nil, fmt.Errorf("no JWT token supplied") + } + if t.OAuthToken == nil { + return nil, fmt.Errorf("no OAuth token supplied") + } + // Refresh the OAuth token if it has expired + if t.OAuthToken.Expired() { + if oa, err := t.JWTToken.Assert(new(http.Client)); err != nil { + return nil, err + } else { + t.OAuthToken = oa + } + } + // To set the Authorization header, we must make a copy of the Request + // so that we don't modify the Request we were given. + // This is required by the specification of http.RoundTripper. + req = cloneRequest(req) + req.Header.Set("Authorization", "Bearer "+t.OAuthToken.AccessToken) + + // Make the HTTP request. + return t.transport().RoundTrip(req) +} + +// cloneRequest returns a clone of the provided *http.Request. +// The clone is a shallow copy of the struct and its Header map. +func cloneRequest(r *http.Request) *http.Request { + // shallow copy of the struct + r2 := new(http.Request) + *r2 = *r + // deep copy of the Header + r2.Header = make(http.Header) + for k, s := range r.Header { + r2.Header[k] = s + } + return r2 +} diff --git a/third_party/src/code.google.com/p/goauth2/oauth/jwt/jwt_test.go b/third_party/src/code.google.com/p/goauth2/oauth/jwt/jwt_test.go new file mode 100644 index 0000000000000..622843e168656 --- /dev/null +++ b/third_party/src/code.google.com/p/goauth2/oauth/jwt/jwt_test.go @@ -0,0 +1,486 @@ +// Copyright 2012 The goauth2 Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// For package documentation please see jwt.go. +// +package jwt + +import ( + "bytes" + "crypto" + "crypto/rand" + "crypto/rsa" + "crypto/sha256" + "crypto/x509" + "encoding/json" + "encoding/pem" + "io/ioutil" + "net/http" + "testing" + "time" +) + +const ( + stdHeaderStr = `{"alg":"RS256","typ":"JWT"}` + iss = "761326798069-r5mljlln1rd4lrbhg75efgigp36m78j5@developer.gserviceaccount.com" + scope = "https://www.googleapis.com/auth/prediction" + exp = 1328554385 + iat = 1328550785 // exp + 1 hour +) + +// Base64url encoded Header +const headerEnc = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9" + +// Base64url encoded ClaimSet +const claimSetEnc = "eyJpc3MiOiI3NjEzMjY3OTgwNjktcjVtbGpsbG4xcmQ0bHJiaGc3NWVmZ2lncDM2bTc4ajVAZGV2ZWxvcGVyLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJzY29wZSI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL2F1dGgvcHJlZGljdGlvbiIsImF1ZCI6Imh0dHBzOi8vYWNjb3VudHMuZ29vZ2xlLmNvbS9vL29hdXRoMi90b2tlbiIsImV4cCI6MTMyODU1NDM4NSwiaWF0IjoxMzI4NTUwNzg1fQ" + +// Base64url encoded Signature +const sigEnc = "olukbHreNiYrgiGCTEmY3eWGeTvYDSUHYoE84Jz3BRPBSaMdZMNOn_0CYK7UHPO7OdvUofjwft1dH59UxE9GWS02pjFti1uAQoImaqjLZoTXr8qiF6O_kDa9JNoykklWlRAIwGIZkDupCS-8cTAnM_ksSymiH1coKJrLDUX_BM0x2f4iMFQzhL5vT1ll-ZipJ0lNlxb5QsyXxDYcxtHYguF12-vpv3ItgT0STfcXoWzIGQoEbhwB9SBp9JYcQ8Ygz6pYDjm0rWX9LrchmTyDArCodpKLFtutNgcIFUP9fWxvwd1C2dNw5GjLcKr9a_SAERyoJ2WnCR1_j9N0wD2o0g" + +// Base64url encoded Token +const tokEnc = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI3NjEzMjY3OTgwNjktcjVtbGpsbG4xcmQ0bHJiaGc3NWVmZ2lncDM2bTc4ajVAZGV2ZWxvcGVyLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJzY29wZSI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL2F1dGgvcHJlZGljdGlvbiIsImF1ZCI6Imh0dHBzOi8vYWNjb3VudHMuZ29vZ2xlLmNvbS9vL29hdXRoMi90b2tlbiIsImV4cCI6MTMyODU1NDM4NSwiaWF0IjoxMzI4NTUwNzg1fQ.olukbHreNiYrgiGCTEmY3eWGeTvYDSUHYoE84Jz3BRPBSaMdZMNOn_0CYK7UHPO7OdvUofjwft1dH59UxE9GWS02pjFti1uAQoImaqjLZoTXr8qiF6O_kDa9JNoykklWlRAIwGIZkDupCS-8cTAnM_ksSymiH1coKJrLDUX_BM0x2f4iMFQzhL5vT1ll-ZipJ0lNlxb5QsyXxDYcxtHYguF12-vpv3ItgT0STfcXoWzIGQoEbhwB9SBp9JYcQ8Ygz6pYDjm0rWX9LrchmTyDArCodpKLFtutNgcIFUP9fWxvwd1C2dNw5GjLcKr9a_SAERyoJ2WnCR1_j9N0wD2o0g" + +// Private key for testing +const privateKeyPem = `-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEA4ej0p7bQ7L/r4rVGUz9RN4VQWoej1Bg1mYWIDYslvKrk1gpj +7wZgkdmM7oVK2OfgrSj/FCTkInKPqaCR0gD7K80q+mLBrN3PUkDrJQZpvRZIff3/ +xmVU1WeruQLFJjnFb2dqu0s/FY/2kWiJtBCakXvXEOb7zfbINuayL+MSsCGSdVYs +SliS5qQpgyDap+8b5fpXZVJkq92hrcNtbkg7hCYUJczt8n9hcCTJCfUpApvaFQ18 +pe+zpyl4+WzkP66I28hniMQyUlA1hBiskT7qiouq0m8IOodhv2fagSZKjOTTU2xk +SBc//fy3ZpsL7WqgsZS7Q+0VRK8gKfqkxg5OYQIDAQABAoIBAQDGGHzQxGKX+ANk +nQi53v/c6632dJKYXVJC+PDAz4+bzU800Y+n/bOYsWf/kCp94XcG4Lgsdd0Gx+Zq +HD9CI1IcqqBRR2AFscsmmX6YzPLTuEKBGMW8twaYy3utlFxElMwoUEsrSWRcCA1y +nHSDzTt871c7nxCXHxuZ6Nm/XCL7Bg8uidRTSC1sQrQyKgTPhtQdYrPQ4WZ1A4J9 +IisyDYmZodSNZe5P+LTJ6M1SCgH8KH9ZGIxv3diMwzNNpk3kxJc9yCnja4mjiGE2 +YCNusSycU5IhZwVeCTlhQGcNeV/skfg64xkiJE34c2y2ttFbdwBTPixStGaF09nU +Z422D40BAoGBAPvVyRRsC3BF+qZdaSMFwI1yiXY7vQw5+JZh01tD28NuYdRFzjcJ +vzT2n8LFpj5ZfZFvSMLMVEFVMgQvWnN0O6xdXvGov6qlRUSGaH9u+TCPNnIldjMP +B8+xTwFMqI7uQr54wBB+Poq7dVRP+0oHb0NYAwUBXoEuvYo3c/nDoRcZAoGBAOWl +aLHjMv4CJbArzT8sPfic/8waSiLV9Ixs3Re5YREUTtnLq7LoymqB57UXJB3BNz/2 +eCueuW71avlWlRtE/wXASj5jx6y5mIrlV4nZbVuyYff0QlcG+fgb6pcJQuO9DxMI +aqFGrWP3zye+LK87a6iR76dS9vRU+bHZpSVvGMKJAoGAFGt3TIKeQtJJyqeUWNSk +klORNdcOMymYMIlqG+JatXQD1rR6ThgqOt8sgRyJqFCVT++YFMOAqXOBBLnaObZZ +CFbh1fJ66BlSjoXff0W+SuOx5HuJJAa5+WtFHrPajwxeuRcNa8jwxUsB7n41wADu +UqWWSRedVBg4Ijbw3nWwYDECgYB0pLew4z4bVuvdt+HgnJA9n0EuYowVdadpTEJg +soBjNHV4msLzdNqbjrAqgz6M/n8Ztg8D2PNHMNDNJPVHjJwcR7duSTA6w2p/4k28 +bvvk/45Ta3XmzlxZcZSOct3O31Cw0i2XDVc018IY5be8qendDYM08icNo7vQYkRH +504kQQKBgQDjx60zpz8ozvm1XAj0wVhi7GwXe+5lTxiLi9Fxq721WDxPMiHDW2XL +YXfFVy/9/GIMvEiGYdmarK1NW+VhWl1DC5xhDg0kvMfxplt4tynoq1uTsQTY31Mx +BeF5CT/JuNYk3bEBF0H/Q3VGO1/ggVS+YezdFbLWIRoMnLj6XCFEGg== +-----END RSA PRIVATE KEY-----` + +// Public key to go with the private key for testing +const publicKeyPem = `-----BEGIN CERTIFICATE----- +MIIDIzCCAgugAwIBAgIJAMfISuBQ5m+5MA0GCSqGSIb3DQEBBQUAMBUxEzARBgNV +BAMTCnVuaXQtdGVzdHMwHhcNMTExMjA2MTYyNjAyWhcNMjExMjAzMTYyNjAyWjAV +MRMwEQYDVQQDEwp1bml0LXRlc3RzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEA4ej0p7bQ7L/r4rVGUz9RN4VQWoej1Bg1mYWIDYslvKrk1gpj7wZgkdmM +7oVK2OfgrSj/FCTkInKPqaCR0gD7K80q+mLBrN3PUkDrJQZpvRZIff3/xmVU1Wer +uQLFJjnFb2dqu0s/FY/2kWiJtBCakXvXEOb7zfbINuayL+MSsCGSdVYsSliS5qQp +gyDap+8b5fpXZVJkq92hrcNtbkg7hCYUJczt8n9hcCTJCfUpApvaFQ18pe+zpyl4 ++WzkP66I28hniMQyUlA1hBiskT7qiouq0m8IOodhv2fagSZKjOTTU2xkSBc//fy3 +ZpsL7WqgsZS7Q+0VRK8gKfqkxg5OYQIDAQABo3YwdDAdBgNVHQ4EFgQU2RQ8yO+O +gN8oVW2SW7RLrfYd9jEwRQYDVR0jBD4wPIAU2RQ8yO+OgN8oVW2SW7RLrfYd9jGh +GaQXMBUxEzARBgNVBAMTCnVuaXQtdGVzdHOCCQDHyErgUOZvuTAMBgNVHRMEBTAD +AQH/MA0GCSqGSIb3DQEBBQUAA4IBAQBRv+M/6+FiVu7KXNjFI5pSN17OcW5QUtPr +odJMlWrJBtynn/TA1oJlYu3yV5clc/71Vr/AxuX5xGP+IXL32YDF9lTUJXG/uUGk ++JETpKmQviPbRsvzYhz4pf6ZIOZMc3/GIcNq92ECbseGO+yAgyWUVKMmZM0HqXC9 +ovNslqe0M8C1sLm1zAR5z/h/litE7/8O2ietija3Q/qtl2TOXJdCA6sgjJX2WUql +ybrC55ct18NKf3qhpcEkGQvFU40rVYApJpi98DiZPYFdx1oBDp/f4uZ3ojpxRVFT +cDwcJLfNRCPUhormsY7fDS9xSyThiHsW9mjJYdcaKQkwYZ0F11yB +-----END CERTIFICATE-----` + +var ( + privateKeyPemBytes = []byte(privateKeyPem) + publicKeyPemBytes = []byte(publicKeyPem) + stdHeader = &Header{Algorithm: stdAlgorithm, Type: stdType} +) + +// Testing the urlEncode function. +func TestUrlEncode(t *testing.T) { + enc := base64Encode([]byte(stdHeaderStr)) + b := []byte(enc) + if b[len(b)-1] == 61 { + t.Error("TestUrlEncode: last chat == \"=\"") + } + if enc != headerEnc { + t.Error("TestUrlEncode: enc != headerEnc") + t.Errorf(" enc = %s", enc) + t.Errorf(" headerEnc = %s", headerEnc) + } +} + +// Test that the times are set properly. +func TestClaimSetSetTimes(t *testing.T) { + c := &ClaimSet{ + Iss: iss, + Scope: scope, + } + iat := time.Unix(iat, 0) + c.setTimes(iat) + if c.exp.Unix() != exp { + t.Error("TestClaimSetSetTimes: c.exp != exp") + t.Errorf(" c.Exp = %d", c.exp.Unix()) + t.Errorf(" exp = %d", exp) + } +} + +// Given a well formed ClaimSet, test for proper encoding. +func TestClaimSetEncode(t *testing.T) { + c := &ClaimSet{ + Iss: iss, + Scope: scope, + exp: time.Unix(exp, 0), + iat: time.Unix(iat, 0), + } + enc := c.encode() + re, err := base64Decode(enc) + if err != nil { + t.Fatalf("error decoding encoded claim set: %v", err) + } + + wa, err := base64Decode(claimSetEnc) + if err != nil { + t.Fatalf("error decoding encoded expected claim set: %v", err) + } + + if enc != claimSetEnc { + t.Error("TestClaimSetEncode: enc != claimSetEnc") + t.Errorf(" enc = %s", string(re)) + t.Errorf(" claimSetEnc = %s", string(wa)) + } +} + +// Test that claim sets with private claim names are encoded correctly. +func TestClaimSetWithPrivateNameEncode(t *testing.T) { + iatT := time.Unix(iat, 0) + expT := time.Unix(exp, 0) + + i, err := json.Marshal(iatT.Unix()) + if err != nil { + t.Fatalf("error marshaling iatT value of %v: %v", iatT.Unix(), err) + } + iatStr := string(i) + e, err := json.Marshal(expT.Unix()) + if err != nil { + t.Fatalf("error marshaling expT value of %v: %v", expT.Unix(), err) + } + + expStr := string(e) + + testCases := []struct { + desc string + input map[string]interface{} + want string + }{ + // Test a simple int field. + { + "single simple field", + map[string]interface{}{"amount": 22}, + `{` + + `"iss":"` + iss + `",` + + `"scope":"` + scope + `",` + + `"aud":"` + stdAud + `",` + + `"exp":` + expStr + `,` + + `"iat":` + iatStr + `,` + + `"amount":22` + + `}`, + }, + { + "multiple simple fields", + map[string]interface{}{"tracking_code": "axZf", "amount": 22}, + `{` + + `"iss":"` + iss + `",` + + `"scope":"` + scope + `",` + + `"aud":"` + stdAud + `",` + + `"exp":` + expStr + `,` + + `"iat":` + iatStr + `,` + + `"amount":22,` + + `"tracking_code":"axZf"` + + `}`, + }, + { + "nested struct fields", + map[string]interface{}{ + "tracking_code": "axZf", + "purchase": struct { + Description string `json:"desc"` + Quantity int32 `json:"q"` + Time int64 `json:"t"` + }{ + "toaster", + 5, + iat, + }, + }, + `{` + + `"iss":"` + iss + `",` + + `"scope":"` + scope + `",` + + `"aud":"` + stdAud + `",` + + `"exp":` + expStr + `,` + + `"iat":` + iatStr + `,` + + `"purchase":{"desc":"toaster","q":5,"t":` + iatStr + `},` + + `"tracking_code":"axZf"` + + `}`, + }, + } + + for _, testCase := range testCases { + c := &ClaimSet{ + Iss: iss, + Scope: scope, + Aud: stdAud, + iat: iatT, + exp: expT, + PrivateClaims: testCase.input, + } + cJSON, err := base64Decode(c.encode()) + if err != nil { + t.Fatalf("error decoding claim set: %v", err) + } + if string(cJSON) != testCase.want { + t.Errorf("TestClaimSetWithPrivateNameEncode: enc != want in case %s", testCase.desc) + t.Errorf(" enc = %s", cJSON) + t.Errorf(" want = %s", testCase.want) + } + } +} + +// Test the NewToken constructor. +func TestNewToken(t *testing.T) { + tok := NewToken(iss, scope, privateKeyPemBytes) + if tok.ClaimSet.Iss != iss { + t.Error("TestNewToken: tok.ClaimSet.Iss != iss") + t.Errorf(" tok.ClaimSet.Iss = %s", tok.ClaimSet.Iss) + t.Errorf(" iss = %s", iss) + } + if tok.ClaimSet.Scope != scope { + t.Error("TestNewToken: tok.ClaimSet.Scope != scope") + t.Errorf(" tok.ClaimSet.Scope = %s", tok.ClaimSet.Scope) + t.Errorf(" scope = %s", scope) + } + if tok.ClaimSet.Aud != stdAud { + t.Error("TestNewToken: tok.ClaimSet.Aud != stdAud") + t.Errorf(" tok.ClaimSet.Aud = %s", tok.ClaimSet.Aud) + t.Errorf(" stdAud = %s", stdAud) + } + if !bytes.Equal(tok.Key, privateKeyPemBytes) { + t.Error("TestNewToken: tok.Key != privateKeyPemBytes") + t.Errorf(" tok.Key = %s", tok.Key) + t.Errorf(" privateKeyPemBytes = %s", privateKeyPemBytes) + } +} + +// Make sure the private key parsing functions work. +func TestParsePrivateKey(t *testing.T) { + tok := &Token{ + Key: privateKeyPemBytes, + } + err := tok.parsePrivateKey() + if err != nil { + t.Errorf("TestParsePrivateKey:tok.parsePrivateKey: %v", err) + } +} + +// Test that the token signature generated matches the golden standard. +func TestTokenSign(t *testing.T) { + tok := &Token{ + Key: privateKeyPemBytes, + claim: claimSetEnc, + header: headerEnc, + } + err := tok.parsePrivateKey() + if err != nil { + t.Errorf("TestTokenSign:tok.parsePrivateKey: %v", err) + } + err = tok.sign() + if err != nil { + t.Errorf("TestTokenSign:tok.sign: %v", err) + } + if tok.sig != sigEnc { + t.Error("TestTokenSign: tok.sig != sigEnc") + t.Errorf(" tok.sig = %s", tok.sig) + t.Errorf(" sigEnc = %s", sigEnc) + } +} + +// Test that the token expiration function is working. +func TestTokenExpired(t *testing.T) { + c := &ClaimSet{} + tok := &Token{ + ClaimSet: c, + } + now := time.Now() + c.setTimes(now) + if tok.Expired() != false { + t.Error("TestTokenExpired: tok.Expired != false") + } + // Set the times as if they were set 2 hours ago. + c.setTimes(now.Add(-2 * time.Hour)) + if tok.Expired() != true { + t.Error("TestTokenExpired: tok.Expired != true") + } +} + +// Given a well formed Token, test for proper encoding. +func TestTokenEncode(t *testing.T) { + c := &ClaimSet{ + Iss: iss, + Scope: scope, + exp: time.Unix(exp, 0), + iat: time.Unix(iat, 0), + } + tok := &Token{ + ClaimSet: c, + Header: stdHeader, + Key: privateKeyPemBytes, + } + enc, err := tok.Encode() + if err != nil { + t.Errorf("TestTokenEncode:tok.Assertion: %v", err) + } + if enc != tokEnc { + t.Error("TestTokenEncode: enc != tokEnc") + t.Errorf(" enc = %s", enc) + t.Errorf(" tokEnc = %s", tokEnc) + } +} + +// Given a well formed Token we should get back a well formed request. +func TestBuildRequest(t *testing.T) { + c := &ClaimSet{ + Iss: iss, + Scope: scope, + exp: time.Unix(exp, 0), + iat: time.Unix(iat, 0), + } + tok := &Token{ + ClaimSet: c, + Header: stdHeader, + Key: privateKeyPemBytes, + } + u, v, err := tok.buildRequest() + if err != nil { + t.Errorf("TestBuildRequest:BuildRequest: %v", err) + } + if u != c.Aud { + t.Error("TestBuildRequest: u != c.Aud") + t.Errorf(" u = %s", u) + t.Errorf(" c.Aud = %s", c.Aud) + } + if v.Get("grant_type") != stdGrantType { + t.Error("TestBuildRequest: grant_type != stdGrantType") + t.Errorf(" grant_type = %s", v.Get("grant_type")) + t.Errorf(" stdGrantType = %s", stdGrantType) + } + if v.Get("assertion") != tokEnc { + t.Error("TestBuildRequest: assertion != tokEnc") + t.Errorf(" assertion = %s", v.Get("assertion")) + t.Errorf(" tokEnc = %s", tokEnc) + } +} + +// Given a well formed access request response we should get back a oauth.Token. +func TestHandleResponse(t *testing.T) { + rb := &respBody{ + Access: "1/8xbJqaOZXSUZbHLl5EOtu1pxz3fmmetKx9W8CV4t79M", + Type: "Bearer", + ExpiresIn: 3600, + } + b, err := json.Marshal(rb) + if err != nil { + t.Errorf("TestHandleResponse:json.Marshal: %v", err) + } + r := &http.Response{ + Status: "200 OK", + StatusCode: 200, + Body: ioutil.NopCloser(bytes.NewReader(b)), + } + o, err := handleResponse(r) + if err != nil { + t.Errorf("TestHandleResponse:handleResponse: %v", err) + } + if o.AccessToken != rb.Access { + t.Error("TestHandleResponse: o.AccessToken != rb.Access") + t.Errorf(" o.AccessToken = %s", o.AccessToken) + t.Errorf(" rb.Access = %s", rb.Access) + } + if o.Expired() { + t.Error("TestHandleResponse: o.Expired == true") + } +} + +// passthrough signature for test +type FakeSigner struct{} + +func (f FakeSigner) Sign(tok *Token) ([]byte, []byte, error) { + block, _ := pem.Decode(privateKeyPemBytes) + pKey, _ := x509.ParsePKCS1PrivateKey(block.Bytes) + ss := headerEnc + "." + claimSetEnc + h := sha256.New() + h.Write([]byte(ss)) + b, _ := rsa.SignPKCS1v15(rand.Reader, pKey, crypto.SHA256, h.Sum(nil)) + return []byte(ss), b, nil +} + +// Given an external signer, get back a valid and signed JWT +func TestExternalSigner(t *testing.T) { + tok := NewSignerToken(iss, scope, FakeSigner{}) + enc, _ := tok.Encode() + if enc != tokEnc { + t.Errorf("TestExternalSigner: enc != tokEnc") + t.Errorf(" enc = %s", enc) + t.Errorf(" tokEnc = %s", tokEnc) + } +} + +func TestHandleResponseWithNewExpiry(t *testing.T) { + rb := &respBody{ + IdToken: tokEnc, + } + b, err := json.Marshal(rb) + if err != nil { + t.Errorf("TestHandleResponse:json.Marshal: %v", err) + } + r := &http.Response{ + Status: "200 OK", + StatusCode: 200, + Body: ioutil.NopCloser(bytes.NewReader(b)), + } + o, err := handleResponse(r) + if err != nil { + t.Errorf("TestHandleResponse:handleResponse: %v", err) + } + if o.Expiry != time.Unix(exp, 0) { + t.Error("TestHandleResponse: o.Expiry != exp") + t.Errorf(" o.Expiry = %s", o.Expiry) + t.Errorf(" exp = %s", time.Unix(exp, 0)) + } +} + +// Placeholder for future Assert tests. +func TestAssert(t *testing.T) { + // Since this method makes a call to BuildRequest, an htttp.Client, and + // finally HandleResponse there is not much more to test. This is here + // as a placeholder if that changes. +} + +// Benchmark for the end-to-end encoding of a well formed token. +func BenchmarkTokenEncode(b *testing.B) { + b.StopTimer() + c := &ClaimSet{ + Iss: iss, + Scope: scope, + exp: time.Unix(exp, 0), + iat: time.Unix(iat, 0), + } + tok := &Token{ + ClaimSet: c, + Key: privateKeyPemBytes, + } + b.StartTimer() + for i := 0; i < b.N; i++ { + tok.Encode() + } +} diff --git a/third_party/src/code.google.com/p/goauth2/oauth/oauth.go b/third_party/src/code.google.com/p/goauth2/oauth/oauth.go new file mode 100644 index 0000000000000..eb3ebe40262b7 --- /dev/null +++ b/third_party/src/code.google.com/p/goauth2/oauth/oauth.go @@ -0,0 +1,386 @@ +// Copyright 2011 The goauth2 Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// The oauth package provides support for making +// OAuth2-authenticated HTTP requests. +// +// Example usage: +// +// // Specify your configuration. (typically as a global variable) +// var config = &oauth.Config{ +// ClientId: YOUR_CLIENT_ID, +// ClientSecret: YOUR_CLIENT_SECRET, +// Scope: "https://www.googleapis.com/auth/buzz", +// AuthURL: "https://accounts.google.com/o/oauth2/auth", +// TokenURL: "https://accounts.google.com/o/oauth2/token", +// RedirectURL: "http://you.example.org/handler", +// } +// +// // A landing page redirects to the OAuth provider to get the auth code. +// func landing(w http.ResponseWriter, r *http.Request) { +// http.Redirect(w, r, config.AuthCodeURL("foo"), http.StatusFound) +// } +// +// // The user will be redirected back to this handler, that takes the +// // "code" query parameter and Exchanges it for an access token. +// func handler(w http.ResponseWriter, r *http.Request) { +// t := &oauth.Transport{Config: config} +// t.Exchange(r.FormValue("code")) +// // The Transport now has a valid Token. Create an *http.Client +// // with which we can make authenticated API requests. +// c := t.Client() +// c.Post(...) +// // ... +// // btw, r.FormValue("state") == "foo" +// } +// +package oauth + +import ( + "encoding/json" + "io/ioutil" + "mime" + "net/http" + "net/url" + "os" + "strings" + "time" +) + +type OAuthError struct { + prefix string + msg string +} + +func (oe OAuthError) Error() string { + return "OAuthError: " + oe.prefix + ": " + oe.msg +} + +// Cache specifies the methods that implement a Token cache. +type Cache interface { + Token() (*Token, error) + PutToken(*Token) error +} + +// CacheFile implements Cache. Its value is the name of the file in which +// the Token is stored in JSON format. +type CacheFile string + +func (f CacheFile) Token() (*Token, error) { + file, err := os.Open(string(f)) + if err != nil { + return nil, OAuthError{"CacheFile.Token", err.Error()} + } + defer file.Close() + tok := &Token{} + if err := json.NewDecoder(file).Decode(tok); err != nil { + return nil, OAuthError{"CacheFile.Token", err.Error()} + } + return tok, nil +} + +func (f CacheFile) PutToken(tok *Token) error { + file, err := os.OpenFile(string(f), os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600) + if err != nil { + return OAuthError{"CacheFile.PutToken", err.Error()} + } + if err := json.NewEncoder(file).Encode(tok); err != nil { + file.Close() + return OAuthError{"CacheFile.PutToken", err.Error()} + } + if err := file.Close(); err != nil { + return OAuthError{"CacheFile.PutToken", err.Error()} + } + return nil +} + +// Config is the configuration of an OAuth consumer. +type Config struct { + // ClientId is the OAuth client identifier used when communicating with + // the configured OAuth provider. + ClientId string + + // ClientSecret is the OAuth client secret used when communicating with + // the configured OAuth provider. + ClientSecret string + + // Scope identifies the level of access being requested. Multiple scope + // values should be provided as a space-delimited string. + Scope string + + // AuthURL is the URL the user will be directed to in order to grant + // access. + AuthURL string + + // TokenURL is the URL used to retrieve OAuth tokens. + TokenURL string + + // RedirectURL is the URL to which the user will be returned after + // granting (or denying) access. + RedirectURL string + + // TokenCache allows tokens to be cached for subsequent requests. + TokenCache Cache + + AccessType string // Optional, "online" (default) or "offline", no refresh token if "online" + + // ApprovalPrompt indicates whether the user should be + // re-prompted for consent. If set to "auto" (default) the + // user will be prompted only if they haven't previously + // granted consent and the code can only be exchanged for an + // access token. + // If set to "force" the user will always be prompted, and the + // code can be exchanged for a refresh token. + ApprovalPrompt string +} + +// Token contains an end-user's tokens. +// This is the data you must store to persist authentication. +type Token struct { + AccessToken string + RefreshToken string + Expiry time.Time // If zero the token has no (known) expiry time. + Extra map[string]string // May be nil. +} + +func (t *Token) Expired() bool { + if t.Expiry.IsZero() { + return false + } + return t.Expiry.Before(time.Now()) +} + +// Transport implements http.RoundTripper. When configured with a valid +// Config and Token it can be used to make authenticated HTTP requests. +// +// t := &oauth.Transport{config} +// t.Exchange(code) +// // t now contains a valid Token +// r, _, err := t.Client().Get("http://example.org/url/requiring/auth") +// +// It will automatically refresh the Token if it can, +// updating the supplied Token in place. +type Transport struct { + *Config + *Token + + // Transport is the HTTP transport to use when making requests. + // It will default to http.DefaultTransport if nil. + // (It should never be an oauth.Transport.) + Transport http.RoundTripper +} + +// Client returns an *http.Client that makes OAuth-authenticated requests. +func (t *Transport) Client() *http.Client { + return &http.Client{Transport: t} +} + +func (t *Transport) transport() http.RoundTripper { + if t.Transport != nil { + return t.Transport + } + return http.DefaultTransport +} + +// AuthCodeURL returns a URL that the end-user should be redirected to, +// so that they may obtain an authorization code. +func (c *Config) AuthCodeURL(state string) string { + url_, err := url.Parse(c.AuthURL) + if err != nil { + panic("AuthURL malformed: " + err.Error()) + } + q := url.Values{ + "response_type": {"code"}, + "client_id": {c.ClientId}, + "redirect_uri": {c.RedirectURL}, + "scope": {c.Scope}, + "state": {state}, + "access_type": {c.AccessType}, + "approval_prompt": {c.ApprovalPrompt}, + }.Encode() + if url_.RawQuery == "" { + url_.RawQuery = q + } else { + url_.RawQuery += "&" + q + } + return url_.String() +} + +// Exchange takes a code and gets access Token from the remote server. +func (t *Transport) Exchange(code string) (*Token, error) { + if t.Config == nil { + return nil, OAuthError{"Exchange", "no Config supplied"} + } + + // If the transport or the cache already has a token, it is + // passed to `updateToken` to preserve existing refresh token. + tok := t.Token + if tok == nil && t.TokenCache != nil { + tok, _ = t.TokenCache.Token() + } + if tok == nil { + tok = new(Token) + } + err := t.updateToken(tok, url.Values{ + "grant_type": {"authorization_code"}, + "redirect_uri": {t.RedirectURL}, + "scope": {t.Scope}, + "code": {code}, + }) + if err != nil { + return nil, err + } + t.Token = tok + if t.TokenCache != nil { + return tok, t.TokenCache.PutToken(tok) + } + return tok, nil +} + +// RoundTrip executes a single HTTP transaction using the Transport's +// Token as authorization headers. +// +// This method will attempt to renew the Token if it has expired and may return +// an error related to that Token renewal before attempting the client request. +// If the Token cannot be renewed a non-nil os.Error value will be returned. +// If the Token is invalid callers should expect HTTP-level errors, +// as indicated by the Response's StatusCode. +func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { + if t.Token == nil { + if t.Config == nil { + return nil, OAuthError{"RoundTrip", "no Config supplied"} + } + if t.TokenCache == nil { + return nil, OAuthError{"RoundTrip", "no Token supplied"} + } + var err error + t.Token, err = t.TokenCache.Token() + if err != nil { + return nil, err + } + } + + // Refresh the Token if it has expired. + if t.Expired() { + if err := t.Refresh(); err != nil { + return nil, err + } + } + + // To set the Authorization header, we must make a copy of the Request + // so that we don't modify the Request we were given. + // This is required by the specification of http.RoundTripper. + req = cloneRequest(req) + req.Header.Set("Authorization", "Bearer "+t.AccessToken) + + // Make the HTTP request. + return t.transport().RoundTrip(req) +} + +// cloneRequest returns a clone of the provided *http.Request. +// The clone is a shallow copy of the struct and its Header map. +func cloneRequest(r *http.Request) *http.Request { + // shallow copy of the struct + r2 := new(http.Request) + *r2 = *r + // deep copy of the Header + r2.Header = make(http.Header) + for k, s := range r.Header { + r2.Header[k] = s + } + return r2 +} + +// Refresh renews the Transport's AccessToken using its RefreshToken. +func (t *Transport) Refresh() error { + if t.Token == nil { + return OAuthError{"Refresh", "no existing Token"} + } + if t.RefreshToken == "" { + return OAuthError{"Refresh", "Token expired; no Refresh Token"} + } + if t.Config == nil { + return OAuthError{"Refresh", "no Config supplied"} + } + + err := t.updateToken(t.Token, url.Values{ + "grant_type": {"refresh_token"}, + "refresh_token": {t.RefreshToken}, + }) + if err != nil { + return err + } + if t.TokenCache != nil { + return t.TokenCache.PutToken(t.Token) + } + return nil +} + +func (t *Transport) updateToken(tok *Token, v url.Values) error { + v.Set("client_id", t.ClientId) + v.Set("client_secret", t.ClientSecret) + client := &http.Client{Transport: t.transport()} + req, err := http.NewRequest("POST", t.TokenURL, strings.NewReader(v.Encode())) + if err != nil { + return err + } + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + req.SetBasicAuth(t.ClientId, t.ClientSecret) + r, err := client.Do(req) + if err != nil { + return err + } + defer r.Body.Close() + if r.StatusCode != 200 { + return OAuthError{"updateToken", r.Status} + } + var b struct { + Access string `json:"access_token"` + Refresh string `json:"refresh_token"` + ExpiresIn time.Duration `json:"expires_in"` + Id string `json:"id_token"` + } + + content, _, _ := mime.ParseMediaType(r.Header.Get("Content-Type")) + switch content { + case "application/x-www-form-urlencoded", "text/plain": + body, err := ioutil.ReadAll(r.Body) + if err != nil { + return err + } + vals, err := url.ParseQuery(string(body)) + if err != nil { + return err + } + + b.Access = vals.Get("access_token") + b.Refresh = vals.Get("refresh_token") + b.ExpiresIn, _ = time.ParseDuration(vals.Get("expires_in") + "s") + b.Id = vals.Get("id_token") + default: + if err = json.NewDecoder(r.Body).Decode(&b); err != nil { + return err + } + // The JSON parser treats the unitless ExpiresIn like 'ns' instead of 's' as above, + // so compensate here. + b.ExpiresIn *= time.Second + } + tok.AccessToken = b.Access + // Don't overwrite `RefreshToken` with an empty value + if len(b.Refresh) > 0 { + tok.RefreshToken = b.Refresh + } + if b.ExpiresIn == 0 { + tok.Expiry = time.Time{} + } else { + tok.Expiry = time.Now().Add(b.ExpiresIn) + } + if b.Id != "" { + if tok.Extra == nil { + tok.Extra = make(map[string]string) + } + tok.Extra["id_token"] = b.Id + } + return nil +} diff --git a/third_party/src/code.google.com/p/goauth2/oauth/oauth_test.go b/third_party/src/code.google.com/p/goauth2/oauth/oauth_test.go new file mode 100644 index 0000000000000..370d6a5f13b43 --- /dev/null +++ b/third_party/src/code.google.com/p/goauth2/oauth/oauth_test.go @@ -0,0 +1,189 @@ +// Copyright 2011 The goauth2 Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package oauth + +import ( + "io" + "io/ioutil" + "net/http" + "net/http/httptest" + "net/url" + "os" + "path/filepath" + "runtime" + "testing" + "time" +) + +var requests = []struct { + path, query, auth string // request + contenttype, body string // response +}{ + { + path: "/token", + query: "grant_type=authorization_code&code=c0d3&client_id=cl13nt1d&client_secret=s3cr3t", + contenttype: "application/json", + auth: "Basic Y2wxM250MWQ6czNjcjN0", + body: ` + { + "access_token":"token1", + "refresh_token":"refreshtoken1", + "id_token":"idtoken1", + "expires_in":3600 + } + `, + }, + {path: "/secure", auth: "Bearer token1", body: "first payload"}, + { + path: "/token", + query: "grant_type=refresh_token&refresh_token=refreshtoken1&client_id=cl13nt1d&client_secret=s3cr3t", + contenttype: "application/json", + auth: "Basic Y2wxM250MWQ6czNjcjN0", + body: ` + { + "access_token":"token2", + "refresh_token":"refreshtoken2", + "id_token":"idtoken2", + "expires_in":3600 + } + `, + }, + {path: "/secure", auth: "Bearer token2", body: "second payload"}, + { + path: "/token", + query: "grant_type=refresh_token&refresh_token=refreshtoken2&client_id=cl13nt1d&client_secret=s3cr3t", + contenttype: "application/x-www-form-urlencoded", + body: "access_token=token3&refresh_token=refreshtoken3&id_token=idtoken3&expires_in=3600", + auth: "Basic Y2wxM250MWQ6czNjcjN0", + }, + {path: "/secure", auth: "Bearer token3", body: "third payload"}, +} + +func TestOAuth(t *testing.T) { + // Set up test server. + n := 0 + handler := func(w http.ResponseWriter, r *http.Request) { + if n >= len(requests) { + t.Errorf("too many requests: %d", n) + return + } + req := requests[n] + n++ + + // Check request. + if g, w := r.URL.Path, req.path; g != w { + t.Errorf("request[%d] got path %s, want %s", n, g, w) + } + want, _ := url.ParseQuery(req.query) + for k := range want { + if g, w := r.FormValue(k), want.Get(k); g != w { + t.Errorf("query[%s] = %s, want %s", k, g, w) + } + } + if g, w := r.Header.Get("Authorization"), req.auth; w != "" && g != w { + t.Errorf("Authorization: %v, want %v", g, w) + } + + // Send response. + w.Header().Set("Content-Type", req.contenttype) + io.WriteString(w, req.body) + } + server := httptest.NewServer(http.HandlerFunc(handler)) + defer server.Close() + + config := &Config{ + ClientId: "cl13nt1d", + ClientSecret: "s3cr3t", + Scope: "https://example.net/scope", + AuthURL: server.URL + "/auth", + TokenURL: server.URL + "/token", + } + + // TODO(adg): test AuthCodeURL + + transport := &Transport{Config: config} + _, err := transport.Exchange("c0d3") + if err != nil { + t.Fatalf("Exchange: %v", err) + } + checkToken(t, transport.Token, "token1", "refreshtoken1", "idtoken1") + + c := transport.Client() + resp, err := c.Get(server.URL + "/secure") + if err != nil { + t.Fatalf("Get: %v", err) + } + checkBody(t, resp, "first payload") + + // test automatic refresh + transport.Expiry = time.Now().Add(-time.Hour) + resp, err = c.Get(server.URL + "/secure") + if err != nil { + t.Fatalf("Get: %v", err) + } + checkBody(t, resp, "second payload") + checkToken(t, transport.Token, "token2", "refreshtoken2", "idtoken2") + + // refresh one more time, but get URL-encoded token instead of JSON + transport.Expiry = time.Now().Add(-time.Hour) + resp, err = c.Get(server.URL + "/secure") + if err != nil { + t.Fatalf("Get: %v", err) + } + checkBody(t, resp, "third payload") + checkToken(t, transport.Token, "token3", "refreshtoken3", "idtoken3") +} + +func checkToken(t *testing.T, tok *Token, access, refresh, id string) { + if g, w := tok.AccessToken, access; g != w { + t.Errorf("AccessToken = %q, want %q", g, w) + } + if g, w := tok.RefreshToken, refresh; g != w { + t.Errorf("RefreshToken = %q, want %q", g, w) + } + if g, w := tok.Extra["id_token"], id; g != w { + t.Errorf("Extra['id_token'] = %q, want %q", g, w) + } + exp := tok.Expiry.Sub(time.Now()) + if (time.Hour-time.Second) > exp || exp > time.Hour { + t.Errorf("Expiry = %v, want ~1 hour", exp) + } +} + +func checkBody(t *testing.T, r *http.Response, body string) { + b, err := ioutil.ReadAll(r.Body) + if err != nil { + t.Error("reading reponse body: %v, want %q", err, body) + } + if g, w := string(b), body; g != w { + t.Errorf("request body mismatch: got %q, want %q", g, w) + } +} + +func TestCachePermissions(t *testing.T) { + if runtime.GOOS == "windows" { + // Windows doesn't support file mode bits. + return + } + + td, err := ioutil.TempDir("", "oauth-test") + if err != nil { + t.Fatalf("ioutil.TempDir: %v", err) + } + defer os.RemoveAll(td) + tempFile := filepath.Join(td, "cache-file") + + cf := CacheFile(tempFile) + if err := cf.PutToken(new(Token)); err != nil { + t.Fatalf("PutToken: %v", err) + } + fi, err := os.Stat(tempFile) + if err != nil { + t.Fatalf("os.Stat: %v", err) + } + if fi.Mode()&0077 != 0 { + t.Errorf("Created cache file has mode %#o, want non-accessible to group+other", fi.Mode()) + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/AUTHORS b/third_party/src/code.google.com/p/google-api-go-client/AUTHORS new file mode 100644 index 0000000000000..f73b7257457eb --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/AUTHORS @@ -0,0 +1,10 @@ +# 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 +# The email address is not required for organizations. + +# Please keep the list sorted. +Google Inc. diff --git a/third_party/src/code.google.com/p/google-api-go-client/CONTRIBUTORS b/third_party/src/code.google.com/p/google-api-go-client/CONTRIBUTORS new file mode 100644 index 0000000000000..afe67f8525f82 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/CONTRIBUTORS @@ -0,0 +1,44 @@ +# 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: +# +# http://code.google.com/legal/individual-cla-v1.0.html +# http://code.google.com/legal/corporate-cla-v1.0.html +# +# The agreement for individuals can be filled out on the web. +# +# 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 +# +# 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 +Andrew Gerrand +Brad Fitzpatrick +Francesc Campoy +Garrick Evans +Glenn Lewis +Jason Hall +Johan Euphrosine +Kostik Shtoyk +Nick Craig-Wood +Scott Van Woudenberg diff --git a/third_party/src/code.google.com/p/google-api-go-client/LICENSE b/third_party/src/code.google.com/p/google-api-go-client/LICENSE new file mode 100644 index 0000000000000..263aa7a0c1232 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2011 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/third_party/src/code.google.com/p/google-api-go-client/Makefile b/third_party/src/code.google.com/p/google-api-go-client/Makefile new file mode 100644 index 0000000000000..20ce8a5f7020e --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/Makefile @@ -0,0 +1,9 @@ +all: + go install code.google.com/p/google-api-go-client/googleapi + go install code.google.com/p/google-api-go-client/google-api-go-generator + $(GOPATH)/bin/google-api-go-generator -cache=false -install -api=* + +cached: + go install code.google.com/p/google-api-go-client/googleapi + go install code.google.com/p/google-api-go-client/google-api-go-generator + $(GOPATH)/bin/google-api-go-generator -cache=true -install -api=* diff --git a/third_party/src/code.google.com/p/google-api-go-client/NOTES b/third_party/src/code.google.com/p/google-api-go-client/NOTES new file mode 100644 index 0000000000000..3b10889900acc --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/NOTES @@ -0,0 +1,13 @@ +Discovery Service: +http://code.google.com/apis/discovery/ +http://code.google.com/apis/discovery/v1/reference.html + +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 +http://code.google.com/apis/discovery/v1/reference.html#parameter-format-summary + +Google JSON format docs: +http://google-styleguide.googlecode.com/svn/trunk/jsoncstyleguide.xml diff --git a/third_party/src/code.google.com/p/google-api-go-client/README b/third_party/src/code.google.com/p/google-api-go-client/README new file mode 100644 index 0000000000000..9aca57bf6f3cf --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/README @@ -0,0 +1,10 @@ +Most of this project is auto-generated. + +The notable directories which are not auto-generated: + + google-api-go-generator/ -- the generator itself + google-api/ -- shared common code, used by auto-generated code + examples/ -- sample code + +When changing the generator, re-compile all APIs and submit the +modified APIs in the same CL as the generator changes itself. diff --git a/third_party/src/code.google.com/p/google-api-go-client/TODO b/third_party/src/code.google.com/p/google-api-go-client/TODO new file mode 100644 index 0000000000000..af55f146c773b --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/TODO @@ -0,0 +1,2 @@ +Moved to: +http://code.google.com/p/google-api-go-client/issues/ diff --git a/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1.1/adexchangebuyer-api.json b/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1.1/adexchangebuyer-api.json new file mode 100644 index 0000000000000..ae76fbc6ad220 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1.1/adexchangebuyer-api.json @@ -0,0 +1,613 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/sSrTRK5rT30gpj08DDODwXhxRak\"", + "discoveryVersion": "v1", + "id": "adexchangebuyer:v1.1", + "name": "adexchangebuyer", + "canonicalName": "Ad Exchange Buyer", + "version": "v1.1", + "title": "Ad Exchange Buyer API", + "description": "Lets you manage your Ad Exchange Buyer account.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "http://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.1/", + "basePath": "/adexchangebuyer/v1.1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "adexchangebuyer/v1.1/", + "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" + }, + "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" + } + } + }, + "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" + ] + } + }, + "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" + ] + } + }, + "disapprovalReasons": { + "type": "array", + "description": "The reason 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": "string" + } + }, + "height": { + "type": "integer", + "description": "Ad height.", + "format": "int32", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "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" + } + }, + "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." + } + } + }, + "DirectDeal": { + "id": "DirectDeal", + "type": "object", + "description": "The configuration data for an Ad Exchange direct deal.", + "properties": { + "accountId": { + "type": "integer", + "description": "The account id of the buyer this deal is for.", + "format": "int32" + }, + "advertiser": { + "type": "string", + "description": "The name of the advertiser this deal is for." + }, + "currencyCode": { + "type": "string", + "description": "The currency code that applies to the fixed_cpm value. If not set then assumed to be USD." + }, + "endTime": { + "type": "string", + "description": "End time for when this deal stops being active. If not set then this deal is valid until manually disabled by the publisher. In seconds since the epoch.", + "format": "int64" + }, + "fixedCpm": { + "type": "string", + "description": "The fixed price for this direct deal. In cpm micros of currency according to currency_code.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "Deal id.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#directDeal" + }, + "name": { + "type": "string", + "description": "Deal name." + }, + "sellerNetwork": { + "type": "string", + "description": "The name of the publisher offering this direct deal." + }, + "startTime": { + "type": "string", + "description": "Start time for when this deal becomes active. If not set then this deal is active immediately upon creation. In seconds since the epoch.", + "format": "int64" + } + } + }, + "DirectDealsList": { + "id": "DirectDealsList", + "type": "object", + "description": "A direct deals feed lists Direct Deals the Ad Exchange buyer account has access to. This includes direct deals set up for the buyer account as well as its merged stream seats.", + "properties": { + "directDeals": { + "type": "array", + "description": "A list of direct deals relevant for your account.", + "items": { + "$ref": "DirectDeal" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#directDealsList" + } + } + } + }, + "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" + ] + } + } + }, + "directDeals": { + "methods": { + "get": { + "id": "adexchangebuyer.directDeals.get", + "path": "directdeals/{id}", + "httpMethod": "GET", + "description": "Gets one direct deal by ID.", + "parameters": { + "id": { + "type": "string", + "description": "The direct deal id", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "DirectDeal" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "list": { + "id": "adexchangebuyer.directDeals.list", + "path": "directdeals", + "httpMethod": "GET", + "description": "Retrieves the authenticated user's list of direct deals.", + "response": { + "$ref": "DirectDealsList" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1.1/adexchangebuyer-gen.go b/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1.1/adexchangebuyer-gen.go new file mode 100644 index 0000000000000..3610e36f1ebee --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1.1/adexchangebuyer-gen.go @@ -0,0 +1,907 @@ +// Package adexchangebuyer provides access to the Ad Exchange Buyer API. +// +// See https://developers.google.com/ad-exchange/buyer-rest +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/adexchangebuyer/v1.1" +// ... +// adexchangebuyerService, err := adexchangebuyer.New(oauthHttpClient) +package adexchangebuyer + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "adexchangebuyer:v1.1" +const apiName = "adexchangebuyer" +const apiVersion = "v1.1" +const basePath = "https://www.googleapis.com/adexchangebuyer/v1.1/" + +// OAuth2 scopes used by this API. +const ( + // Manage your Ad Exchange buyer account configuration + AdexchangeBuyerScope = "https://www.googleapis.com/auth/adexchange.buyer" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + s.Creatives = NewCreativesService(s) + s.DirectDeals = NewDirectDealsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Accounts *AccountsService + + Creatives *CreativesService + + DirectDeals *DirectDealsService +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + return rs +} + +type AccountsService struct { + s *Service +} + +func NewCreativesService(s *Service) *CreativesService { + rs := &CreativesService{s: s} + return rs +} + +type CreativesService struct { + s *Service +} + +func NewDirectDealsService(s *Service) *DirectDealsService { + rs := &DirectDealsService{s: s} + return rs +} + +type DirectDealsService struct { + s *Service +} + +type Account struct { + // BidderLocation: Your bidder locations that have distinct URLs. + BidderLocation []*AccountBidderLocation `json:"bidderLocation,omitempty"` + + // CookieMatchingNid: The nid parameter value used in cookie match + // requests. Please contact your technical account manager if you need + // to change this. + CookieMatchingNid string `json:"cookieMatchingNid,omitempty"` + + // CookieMatchingUrl: The base URL used in cookie match requests. + CookieMatchingUrl string `json:"cookieMatchingUrl,omitempty"` + + // Id: Account id. + Id int64 `json:"id,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // MaximumTotalQps: The sum of all bidderLocation.maximumQps values + // cannot exceed this. Please contact your technical account manager if + // you need to change this. + MaximumTotalQps int64 `json:"maximumTotalQps,omitempty"` +} + +type AccountBidderLocation struct { + // MaximumQps: The maximum queries per second the Ad Exchange will send. + MaximumQps int64 `json:"maximumQps,omitempty"` + + // Region: 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: + // - ASIA + // - EUROPE + // - US_EAST + // - + // US_WEST + Region string `json:"region,omitempty"` + + // Url: The URL to which the Ad Exchange will send bid requests. + Url string `json:"url,omitempty"` +} + +type AccountsList struct { + // Items: A list of accounts. + Items []*Account `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` +} + +type Creative struct { + // HTMLSnippet: The HTML snippet that displays the ad when inserted in + // the web page. If set, videoURL should not be set. + HTMLSnippet string `json:"HTMLSnippet,omitempty"` + + // AccountId: Account id. + AccountId int64 `json:"accountId,omitempty"` + + // AdvertiserId: Detected advertiser id, if any. Read-only. This field + // should not be set in requests. + AdvertiserId googleapi.Int64s `json:"advertiserId,omitempty"` + + // AdvertiserName: The name of the company being advertised in the + // creative. + AdvertiserName string `json:"advertiserName,omitempty"` + + // Attribute: All attributes for the ads that may be shown from this + // snippet. + Attribute []int64 `json:"attribute,omitempty"` + + // BuyerCreativeId: A buyer-specific id identifying the creative in this + // ad. + BuyerCreativeId string `json:"buyerCreativeId,omitempty"` + + // ClickThroughUrl: The set of destination urls for the snippet. + ClickThroughUrl []string `json:"clickThroughUrl,omitempty"` + + // DisapprovalReasons: The reason 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. + DisapprovalReasons []string `json:"disapprovalReasons,omitempty"` + + // Height: Ad height. + Height int64 `json:"height,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ProductCategories: Detected product categories, if any. Read-only. + // This field should not be set in requests. + ProductCategories []int64 `json:"productCategories,omitempty"` + + // RestrictedCategories: All restricted categories for the ads that may + // be shown from this snippet. + RestrictedCategories []int64 `json:"restrictedCategories,omitempty"` + + // SensitiveCategories: Detected sensitive categories, if any. + // Read-only. This field should not be set in requests. + SensitiveCategories []int64 `json:"sensitiveCategories,omitempty"` + + // Status: Creative serving status. Read-only. This field should not be + // set in requests. + Status string `json:"status,omitempty"` + + // VendorType: All vendor types for the ads that may be shown from this + // snippet. + VendorType []int64 `json:"vendorType,omitempty"` + + // VideoURL: The url to fetch a video ad. If set, HTMLSnippet should not + // be set. + VideoURL string `json:"videoURL,omitempty"` + + // Width: Ad width. + Width int64 `json:"width,omitempty"` +} + +type CreativesList struct { + // Items: A list of creatives. + Items []*Creative `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through creatives. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type DirectDeal struct { + // AccountId: The account id of the buyer this deal is for. + AccountId int64 `json:"accountId,omitempty"` + + // Advertiser: The name of the advertiser this deal is for. + Advertiser string `json:"advertiser,omitempty"` + + // CurrencyCode: The currency code that applies to the fixed_cpm value. + // If not set then assumed to be USD. + CurrencyCode string `json:"currencyCode,omitempty"` + + // EndTime: End time for when this deal stops being active. If not set + // then this deal is valid until manually disabled by the publisher. In + // seconds since the epoch. + EndTime int64 `json:"endTime,omitempty,string"` + + // FixedCpm: The fixed price for this direct deal. In cpm micros of + // currency according to currency_code. + FixedCpm int64 `json:"fixedCpm,omitempty,string"` + + // Id: Deal id. + Id int64 `json:"id,omitempty,string"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // Name: Deal name. + Name string `json:"name,omitempty"` + + // SellerNetwork: The name of the publisher offering this direct deal. + SellerNetwork string `json:"sellerNetwork,omitempty"` + + // StartTime: Start time for when this deal becomes active. If not set + // then this deal is active immediately upon creation. In seconds since + // the epoch. + StartTime int64 `json:"startTime,omitempty,string"` +} + +type DirectDealsList struct { + // DirectDeals: A list of direct deals relevant for your account. + DirectDeals []*DirectDeal `json:"directDeals,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` +} + +// method id "adexchangebuyer.accounts.get": + +type AccountsGetCall struct { + s *Service + id int64 + opt_ map[string]interface{} +} + +// Get: Gets one account by ID. +func (r *AccountsService) Get(id int64) *AccountsGetCall { + c := &AccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *AccountsGetCall) Do() (*Account, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", strconv.FormatInt(c.id, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one account by ID.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.accounts.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The account id", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "accounts/{id}", + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.accounts.list": + +type AccountsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves the authenticated user's list of accounts. +func (r *AccountsService) List() *AccountsListCall { + c := &AccountsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *AccountsListCall) Do() (*AccountsList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AccountsList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the authenticated user's list of accounts.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.accounts.list", + // "path": "accounts", + // "response": { + // "$ref": "AccountsList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.accounts.patch": + +type AccountsPatchCall struct { + s *Service + id int64 + account *Account + opt_ map[string]interface{} +} + +// Patch: Updates an existing account. This method supports patch +// semantics. +func (r *AccountsService) Patch(id int64, account *Account) *AccountsPatchCall { + c := &AccountsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.account = account + return c +} + +func (c *AccountsPatchCall) Do() (*Account, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", strconv.FormatInt(c.id, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "adexchangebuyer.accounts.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The account id", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "accounts/{id}", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.accounts.update": + +type AccountsUpdateCall struct { + s *Service + id int64 + account *Account + opt_ map[string]interface{} +} + +// Update: Updates an existing account. +func (r *AccountsService) Update(id int64, account *Account) *AccountsUpdateCall { + c := &AccountsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.account = account + return c +} + +func (c *AccountsUpdateCall) Do() (*Account, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", strconv.FormatInt(c.id, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account.", + // "httpMethod": "PUT", + // "id": "adexchangebuyer.accounts.update", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The account id", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "accounts/{id}", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.creatives.get": + +type CreativesGetCall struct { + s *Service + accountId int64 + buyerCreativeId string + opt_ map[string]interface{} +} + +// Get: Gets the status for a single creative. A creative will be +// available 30-40 minutes after submission. +func (r *CreativesService) Get(accountId int64, buyerCreativeId string) *CreativesGetCall { + c := &CreativesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.buyerCreativeId = buyerCreativeId + return c +} + +func (c *CreativesGetCall) Do() (*Creative, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives/{accountId}/{buyerCreativeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", strconv.FormatInt(c.accountId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{buyerCreativeId}", url.QueryEscape(c.buyerCreativeId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Creative) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the status for a single creative. A creative will be available 30-40 minutes after submission.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.creatives.get", + // "parameterOrder": [ + // "accountId", + // "buyerCreativeId" + // ], + // "parameters": { + // "accountId": { + // "description": "The id for the account that will serve this creative.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "buyerCreativeId": { + // "description": "The buyer-specific id for this creative.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "creatives/{accountId}/{buyerCreativeId}", + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.creatives.insert": + +type CreativesInsertCall struct { + s *Service + creative *Creative + opt_ map[string]interface{} +} + +// Insert: Submit a new creative. +func (r *CreativesService) Insert(creative *Creative) *CreativesInsertCall { + c := &CreativesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.creative = creative + return c +} + +func (c *CreativesInsertCall) Do() (*Creative, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Creative) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Submit a new creative.", + // "httpMethod": "POST", + // "id": "adexchangebuyer.creatives.insert", + // "path": "creatives", + // "request": { + // "$ref": "Creative" + // }, + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.creatives.list": + +type CreativesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves a list of the authenticated user's active creatives. +// A creative will be available 30-40 minutes after submission. +func (r *CreativesService) List() *CreativesListCall { + c := &CreativesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of entries returned on one result page. If not set, the default is +// 100. +func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StatusFilter sets the optional parameter "statusFilter": When +// specified, only creatives having the given status are returned. +func (c *CreativesListCall) StatusFilter(statusFilter string) *CreativesListCall { + c.opt_["statusFilter"] = statusFilter + return c +} + +func (c *CreativesListCall) Do() (*CreativesList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["statusFilter"]; ok { + params.Set("statusFilter", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CreativesList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.creatives.list", + // "parameters": { + // "maxResults": { + // "description": "Maximum number of entries returned on one result page. If not set, the default is 100. Optional.", + // "format": "uint32", + // "location": "query", + // "maximum": "1000", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response. Optional.", + // "location": "query", + // "type": "string" + // }, + // "statusFilter": { + // "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", + // "type": "string" + // } + // }, + // "path": "creatives", + // "response": { + // "$ref": "CreativesList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.directDeals.get": + +type DirectDealsGetCall struct { + s *Service + id int64 + opt_ map[string]interface{} +} + +// Get: Gets one direct deal by ID. +func (r *DirectDealsService) Get(id int64) *DirectDealsGetCall { + c := &DirectDealsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *DirectDealsGetCall) Do() (*DirectDeal, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "directdeals/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", strconv.FormatInt(c.id, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DirectDeal) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one direct deal by ID.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.directDeals.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The direct deal id", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "directdeals/{id}", + // "response": { + // "$ref": "DirectDeal" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.directDeals.list": + +type DirectDealsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves the authenticated user's list of direct deals. +func (r *DirectDealsService) List() *DirectDealsListCall { + c := &DirectDealsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *DirectDealsListCall) Do() (*DirectDealsList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "directdeals") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DirectDealsList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the authenticated user's list of direct deals.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.directDeals.list", + // "path": "directdeals", + // "response": { + // "$ref": "DirectDealsList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1.2/adexchangebuyer-api.json b/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1.2/adexchangebuyer-api.json new file mode 100644 index 0000000000000..ecaa240247a83 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1.2/adexchangebuyer-api.json @@ -0,0 +1,824 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/mlESaLdrZYKCTBOwQidwTWARgSg\"", + "discoveryVersion": "v1", + "id": "adexchangebuyer:v1.2", + "name": "adexchangebuyer", + "canonicalName": "Ad Exchange Buyer", + "version": "v1.2", + "title": "Ad Exchange Buyer API", + "description": "Lets you manage your Ad Exchange Buyer account.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "http://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" + }, + "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" + } + } + }, + "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" + }, + "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." + } + } + } + }, + "height": { + "type": "integer", + "description": "Ad height.", + "format": "int32", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "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" + } + }, + "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." + } + } + }, + "DirectDeal": { + "id": "DirectDeal", + "type": "object", + "description": "The configuration data for an Ad Exchange direct deal.", + "properties": { + "accountId": { + "type": "integer", + "description": "The account id of the buyer this deal is for.", + "format": "int32" + }, + "advertiser": { + "type": "string", + "description": "The name of the advertiser this deal is for." + }, + "currencyCode": { + "type": "string", + "description": "The currency code that applies to the fixed_cpm value. If not set then assumed to be USD." + }, + "endTime": { + "type": "string", + "description": "End time for when this deal stops being active. If not set then this deal is valid until manually disabled by the publisher. In seconds since the epoch.", + "format": "int64" + }, + "fixedCpm": { + "type": "string", + "description": "The fixed price for this direct deal. In cpm micros of currency according to currency_code. If set, then this deal is eligible for the fixed price tier of buying (highest priority, pay exactly the configured fixed price).", + "format": "int64" + }, + "id": { + "type": "string", + "description": "Deal id.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#directDeal" + }, + "name": { + "type": "string", + "description": "Deal name." + }, + "privateExchangeMinCpm": { + "type": "string", + "description": "The minimum price for this direct deal. In cpm micros of currency according to currency_code. If set, then this deal is eligible for the private exchange tier of buying (below fixed price priority, run as a second price auction).", + "format": "int64" + }, + "sellerNetwork": { + "type": "string", + "description": "The name of the publisher offering this direct deal." + }, + "startTime": { + "type": "string", + "description": "Start time for when this deal becomes active. If not set then this deal is active immediately upon creation. In seconds since the epoch.", + "format": "int64" + } + } + }, + "DirectDealsList": { + "id": "DirectDealsList", + "type": "object", + "description": "A direct deals feed lists Direct Deals the Ad Exchange buyer account has access to. This includes direct deals set up for the buyer account as well as its merged stream seats.", + "properties": { + "directDeals": { + "type": "array", + "description": "A list of direct deals relevant for your account.", + "items": { + "$ref": "DirectDeal" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#directDealsList" + } + } + }, + "PerformanceReport": { + "id": "PerformanceReport", + "type": "object", + "description": "The configuration data for an Ad Exchange performance report list. TODO(nathanbullock): need to add some release tests before releasing this. https://sites.google.com/a/google.com/adx-integration/Home/engineering/binary-releases/rtb-api-release https://cs.corp.google.com/#piper///depot/google3/contentads/adx/tools/rtb_api/adxrtb.py", + "properties": { + "calloutStatusRate": { + "type": "array", + "description": "Rate of various prefiltering statuses per match. Please refer to the callout-status-codes.txt file for different statuses.", + "items": { + "type": "any" + } + }, + "cookieMatcherStatusRate": { + "type": "array", + "description": "Average QPS for cookie matcher operations.", + "items": { + "type": "any" + } + }, + "creativeStatusRate": { + "type": "array", + "description": "Rate of ads with a given status. Please refer to the creative-status-codes.txt file for different statuses.", + "items": { + "type": "any" + } + }, + "hostedMatchStatusRate": { + "type": "array", + "description": "Average QPS for hosted match operations.", + "items": { + "type": "any" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#performanceReport" + }, + "latency50thPercentile": { + "type": "number", + "description": "The 50th percentile round trip latency(ms) as perceived from Google servers for the duration period covered by the report.", + "format": "double" + }, + "latency85thPercentile": { + "type": "number", + "description": "The 85th percentile round trip latency(ms) as perceived from Google servers for the duration period covered by the report.", + "format": "double" + }, + "latency95thPercentile": { + "type": "number", + "description": "The 95th percentile round trip latency(ms) as perceived from Google servers for the duration period covered by the report.", + "format": "double" + }, + "noQuotaInRegion": { + "type": "number", + "description": "Rate of various quota account statuses per quota check.", + "format": "double" + }, + "outOfQuota": { + "type": "number", + "description": "Rate of various quota account statuses per quota check.", + "format": "double" + }, + "pixelMatchRequests": { + "type": "number", + "description": "Average QPS for pixel match requests from clients.", + "format": "double" + }, + "pixelMatchResponses": { + "type": "number", + "description": "Average QPS for pixel match responses from clients.", + "format": "double" + }, + "quotaConfiguredLimit": { + "type": "number", + "description": "The configured quota limits for this account.", + "format": "double" + }, + "quotaThrottledLimit": { + "type": "number", + "description": "The throttled quota limits for this account.", + "format": "double" + }, + "region": { + "type": "string", + "description": "The trading location of this data." + }, + "timestamp": { + "type": "string", + "description": "The unix timestamp of the starting time of this performance data.", + "format": "int64" + } + } + }, + "PerformanceReportList": { + "id": "PerformanceReportList", + "type": "object", + "description": "The configuration data for an Ad Exchange performance report list. https://sites.google.com/a/google.com/adx-integration/Home/engineering/binary-releases/rtb-api-release https://cs.corp.google.com/#piper///depot/google3/contentads/adx/tools/rtb_api/adxrtb.py", + "properties": { + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#performanceReportList" + }, + "performance_report": { + "type": "array", + "description": "A list of performance reports relevant for the account.", + "items": { + "$ref": "PerformanceReport" + } + } + } + } + }, + "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" + ] + } + } + }, + "directDeals": { + "methods": { + "get": { + "id": "adexchangebuyer.directDeals.get", + "path": "directdeals/{id}", + "httpMethod": "GET", + "description": "Gets one direct deal by ID.", + "parameters": { + "id": { + "type": "string", + "description": "The direct deal id", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "DirectDeal" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "list": { + "id": "adexchangebuyer.directDeals.list", + "path": "directdeals", + "httpMethod": "GET", + "description": "Retrieves the authenticated user's list of direct deals.", + "response": { + "$ref": "DirectDealsList" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + }, + "performanceReport": { + "methods": { + "list": { + "id": "adexchangebuyer.performanceReport.list", + "path": "performancereport", + "httpMethod": "GET", + "description": "Retrieves the authenticated user's list of performance metrics.", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id to get the reports.", + "required": true, + "format": "int64", + "location": "query" + }, + "endDateTime": { + "type": "string", + "description": "The end time of the report in ISO 8601 timestamp format using UTC.", + "required": true, + "location": "query" + }, + "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 performance reports. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response. Optional.", + "location": "query" + }, + "startDateTime": { + "type": "string", + "description": "The start time of the report in ISO 8601 timestamp format using UTC.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "accountId", + "endDateTime", + "startDateTime" + ], + "response": { + "$ref": "PerformanceReportList" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1.2/adexchangebuyer-gen.go b/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1.2/adexchangebuyer-gen.go new file mode 100644 index 0000000000000..37566eea20bf0 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1.2/adexchangebuyer-gen.go @@ -0,0 +1,1143 @@ +// Package adexchangebuyer provides access to the Ad Exchange Buyer API. +// +// See https://developers.google.com/ad-exchange/buyer-rest +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/adexchangebuyer/v1.2" +// ... +// adexchangebuyerService, err := adexchangebuyer.New(oauthHttpClient) +package adexchangebuyer + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "adexchangebuyer:v1.2" +const apiName = "adexchangebuyer" +const apiVersion = "v1.2" +const basePath = "https://www.googleapis.com/adexchangebuyer/v1.2/" + +// OAuth2 scopes used by this API. +const ( + // Manage your Ad Exchange buyer account configuration + AdexchangeBuyerScope = "https://www.googleapis.com/auth/adexchange.buyer" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + s.Creatives = NewCreativesService(s) + s.DirectDeals = NewDirectDealsService(s) + s.PerformanceReport = NewPerformanceReportService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Accounts *AccountsService + + Creatives *CreativesService + + DirectDeals *DirectDealsService + + PerformanceReport *PerformanceReportService +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + return rs +} + +type AccountsService struct { + s *Service +} + +func NewCreativesService(s *Service) *CreativesService { + rs := &CreativesService{s: s} + return rs +} + +type CreativesService struct { + s *Service +} + +func NewDirectDealsService(s *Service) *DirectDealsService { + rs := &DirectDealsService{s: s} + return rs +} + +type DirectDealsService struct { + s *Service +} + +func NewPerformanceReportService(s *Service) *PerformanceReportService { + rs := &PerformanceReportService{s: s} + return rs +} + +type PerformanceReportService struct { + s *Service +} + +type Account struct { + // BidderLocation: Your bidder locations that have distinct URLs. + BidderLocation []*AccountBidderLocation `json:"bidderLocation,omitempty"` + + // CookieMatchingNid: The nid parameter value used in cookie match + // requests. Please contact your technical account manager if you need + // to change this. + CookieMatchingNid string `json:"cookieMatchingNid,omitempty"` + + // CookieMatchingUrl: The base URL used in cookie match requests. + CookieMatchingUrl string `json:"cookieMatchingUrl,omitempty"` + + // Id: Account id. + Id int64 `json:"id,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // MaximumTotalQps: The sum of all bidderLocation.maximumQps values + // cannot exceed this. Please contact your technical account manager if + // you need to change this. + MaximumTotalQps int64 `json:"maximumTotalQps,omitempty"` +} + +type AccountBidderLocation struct { + // MaximumQps: The maximum queries per second the Ad Exchange will send. + MaximumQps int64 `json:"maximumQps,omitempty"` + + // Region: 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: + // - ASIA + // - EUROPE + // - US_EAST + // - + // US_WEST + Region string `json:"region,omitempty"` + + // Url: The URL to which the Ad Exchange will send bid requests. + Url string `json:"url,omitempty"` +} + +type AccountsList struct { + // Items: A list of accounts. + Items []*Account `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` +} + +type Creative struct { + // HTMLSnippet: The HTML snippet that displays the ad when inserted in + // the web page. If set, videoURL should not be set. + HTMLSnippet string `json:"HTMLSnippet,omitempty"` + + // AccountId: Account id. + AccountId int64 `json:"accountId,omitempty"` + + // AdvertiserId: Detected advertiser id, if any. Read-only. This field + // should not be set in requests. + AdvertiserId googleapi.Int64s `json:"advertiserId,omitempty"` + + // AdvertiserName: The name of the company being advertised in the + // creative. + AdvertiserName string `json:"advertiserName,omitempty"` + + // AgencyId: The agency id for this creative. + AgencyId int64 `json:"agencyId,omitempty,string"` + + // Attribute: All attributes for the ads that may be shown from this + // snippet. + Attribute []int64 `json:"attribute,omitempty"` + + // BuyerCreativeId: A buyer-specific id identifying the creative in this + // ad. + BuyerCreativeId string `json:"buyerCreativeId,omitempty"` + + // ClickThroughUrl: The set of destination urls for the snippet. + ClickThroughUrl []string `json:"clickThroughUrl,omitempty"` + + // Corrections: Shows any corrections that were applied to this + // creative. Read-only. This field should not be set in requests. + Corrections []*CreativeCorrections `json:"corrections,omitempty"` + + // DisapprovalReasons: 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. + DisapprovalReasons []*CreativeDisapprovalReasons `json:"disapprovalReasons,omitempty"` + + // Height: Ad height. + Height int64 `json:"height,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ProductCategories: Detected product categories, if any. Read-only. + // This field should not be set in requests. + ProductCategories []int64 `json:"productCategories,omitempty"` + + // RestrictedCategories: All restricted categories for the ads that may + // be shown from this snippet. + RestrictedCategories []int64 `json:"restrictedCategories,omitempty"` + + // SensitiveCategories: Detected sensitive categories, if any. + // Read-only. This field should not be set in requests. + SensitiveCategories []int64 `json:"sensitiveCategories,omitempty"` + + // Status: Creative serving status. Read-only. This field should not be + // set in requests. + Status string `json:"status,omitempty"` + + // VendorType: All vendor types for the ads that may be shown from this + // snippet. + VendorType []int64 `json:"vendorType,omitempty"` + + // VideoURL: The url to fetch a video ad. If set, HTMLSnippet should not + // be set. + VideoURL string `json:"videoURL,omitempty"` + + // Width: Ad width. + Width int64 `json:"width,omitempty"` +} + +type CreativeCorrections struct { + // Details: Additional details about the correction. + Details []string `json:"details,omitempty"` + + // Reason: The type of correction that was applied to the creative. + Reason string `json:"reason,omitempty"` +} + +type CreativeDisapprovalReasons struct { + // Details: Additional details about the reason for disapproval. + Details []string `json:"details,omitempty"` + + // Reason: The categorized reason for disapproval. + Reason string `json:"reason,omitempty"` +} + +type CreativesList struct { + // Items: A list of creatives. + Items []*Creative `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through creatives. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type DirectDeal struct { + // AccountId: The account id of the buyer this deal is for. + AccountId int64 `json:"accountId,omitempty"` + + // Advertiser: The name of the advertiser this deal is for. + Advertiser string `json:"advertiser,omitempty"` + + // CurrencyCode: The currency code that applies to the fixed_cpm value. + // If not set then assumed to be USD. + CurrencyCode string `json:"currencyCode,omitempty"` + + // EndTime: End time for when this deal stops being active. If not set + // then this deal is valid until manually disabled by the publisher. In + // seconds since the epoch. + EndTime int64 `json:"endTime,omitempty,string"` + + // FixedCpm: The fixed price for this direct deal. In cpm micros of + // currency according to currency_code. If set, then this deal is + // eligible for the fixed price tier of buying (highest priority, pay + // exactly the configured fixed price). + FixedCpm int64 `json:"fixedCpm,omitempty,string"` + + // Id: Deal id. + Id int64 `json:"id,omitempty,string"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // Name: Deal name. + Name string `json:"name,omitempty"` + + // PrivateExchangeMinCpm: The minimum price for this direct deal. In cpm + // micros of currency according to currency_code. If set, then this deal + // is eligible for the private exchange tier of buying (below fixed + // price priority, run as a second price auction). + PrivateExchangeMinCpm int64 `json:"privateExchangeMinCpm,omitempty,string"` + + // SellerNetwork: The name of the publisher offering this direct deal. + SellerNetwork string `json:"sellerNetwork,omitempty"` + + // StartTime: Start time for when this deal becomes active. If not set + // then this deal is active immediately upon creation. In seconds since + // the epoch. + StartTime int64 `json:"startTime,omitempty,string"` +} + +type DirectDealsList struct { + // DirectDeals: A list of direct deals relevant for your account. + DirectDeals []*DirectDeal `json:"directDeals,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` +} + +type PerformanceReport struct { + // CalloutStatusRate: Rate of various prefiltering statuses per match. + // Please refer to the callout-status-codes.txt file for different + // statuses. + CalloutStatusRate []interface{} `json:"calloutStatusRate,omitempty"` + + // CookieMatcherStatusRate: Average QPS for cookie matcher operations. + CookieMatcherStatusRate []interface{} `json:"cookieMatcherStatusRate,omitempty"` + + // CreativeStatusRate: Rate of ads with a given status. Please refer to + // the creative-status-codes.txt file for different statuses. + CreativeStatusRate []interface{} `json:"creativeStatusRate,omitempty"` + + // HostedMatchStatusRate: Average QPS for hosted match operations. + HostedMatchStatusRate []interface{} `json:"hostedMatchStatusRate,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // Latency50thPercentile: The 50th percentile round trip latency(ms) as + // perceived from Google servers for the duration period covered by the + // report. + Latency50thPercentile float64 `json:"latency50thPercentile,omitempty"` + + // Latency85thPercentile: The 85th percentile round trip latency(ms) as + // perceived from Google servers for the duration period covered by the + // report. + Latency85thPercentile float64 `json:"latency85thPercentile,omitempty"` + + // Latency95thPercentile: The 95th percentile round trip latency(ms) as + // perceived from Google servers for the duration period covered by the + // report. + Latency95thPercentile float64 `json:"latency95thPercentile,omitempty"` + + // NoQuotaInRegion: Rate of various quota account statuses per quota + // check. + NoQuotaInRegion float64 `json:"noQuotaInRegion,omitempty"` + + // OutOfQuota: Rate of various quota account statuses per quota check. + OutOfQuota float64 `json:"outOfQuota,omitempty"` + + // PixelMatchRequests: Average QPS for pixel match requests from + // clients. + PixelMatchRequests float64 `json:"pixelMatchRequests,omitempty"` + + // PixelMatchResponses: Average QPS for pixel match responses from + // clients. + PixelMatchResponses float64 `json:"pixelMatchResponses,omitempty"` + + // QuotaConfiguredLimit: The configured quota limits for this account. + QuotaConfiguredLimit float64 `json:"quotaConfiguredLimit,omitempty"` + + // QuotaThrottledLimit: The throttled quota limits for this account. + QuotaThrottledLimit float64 `json:"quotaThrottledLimit,omitempty"` + + // Region: The trading location of this data. + Region string `json:"region,omitempty"` + + // Timestamp: The unix timestamp of the starting time of this + // performance data. + Timestamp int64 `json:"timestamp,omitempty,string"` +} + +type PerformanceReportList struct { + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // Performance_report: A list of performance reports relevant for the + // account. + Performance_report []*PerformanceReport `json:"performance_report,omitempty"` +} + +// method id "adexchangebuyer.accounts.get": + +type AccountsGetCall struct { + s *Service + id int64 + opt_ map[string]interface{} +} + +// Get: Gets one account by ID. +func (r *AccountsService) Get(id int64) *AccountsGetCall { + c := &AccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *AccountsGetCall) Do() (*Account, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", strconv.FormatInt(c.id, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one account by ID.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.accounts.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The account id", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "accounts/{id}", + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.accounts.list": + +type AccountsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves the authenticated user's list of accounts. +func (r *AccountsService) List() *AccountsListCall { + c := &AccountsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *AccountsListCall) Do() (*AccountsList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AccountsList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the authenticated user's list of accounts.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.accounts.list", + // "path": "accounts", + // "response": { + // "$ref": "AccountsList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.accounts.patch": + +type AccountsPatchCall struct { + s *Service + id int64 + account *Account + opt_ map[string]interface{} +} + +// Patch: Updates an existing account. This method supports patch +// semantics. +func (r *AccountsService) Patch(id int64, account *Account) *AccountsPatchCall { + c := &AccountsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.account = account + return c +} + +func (c *AccountsPatchCall) Do() (*Account, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", strconv.FormatInt(c.id, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "adexchangebuyer.accounts.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The account id", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "accounts/{id}", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.accounts.update": + +type AccountsUpdateCall struct { + s *Service + id int64 + account *Account + opt_ map[string]interface{} +} + +// Update: Updates an existing account. +func (r *AccountsService) Update(id int64, account *Account) *AccountsUpdateCall { + c := &AccountsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.account = account + return c +} + +func (c *AccountsUpdateCall) Do() (*Account, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", strconv.FormatInt(c.id, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account.", + // "httpMethod": "PUT", + // "id": "adexchangebuyer.accounts.update", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The account id", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "accounts/{id}", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.creatives.get": + +type CreativesGetCall struct { + s *Service + accountId int64 + buyerCreativeId string + opt_ map[string]interface{} +} + +// Get: Gets the status for a single creative. A creative will be +// available 30-40 minutes after submission. +func (r *CreativesService) Get(accountId int64, buyerCreativeId string) *CreativesGetCall { + c := &CreativesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.buyerCreativeId = buyerCreativeId + return c +} + +func (c *CreativesGetCall) Do() (*Creative, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives/{accountId}/{buyerCreativeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", strconv.FormatInt(c.accountId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{buyerCreativeId}", url.QueryEscape(c.buyerCreativeId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Creative) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the status for a single creative. A creative will be available 30-40 minutes after submission.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.creatives.get", + // "parameterOrder": [ + // "accountId", + // "buyerCreativeId" + // ], + // "parameters": { + // "accountId": { + // "description": "The id for the account that will serve this creative.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "buyerCreativeId": { + // "description": "The buyer-specific id for this creative.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "creatives/{accountId}/{buyerCreativeId}", + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.creatives.insert": + +type CreativesInsertCall struct { + s *Service + creative *Creative + opt_ map[string]interface{} +} + +// Insert: Submit a new creative. +func (r *CreativesService) Insert(creative *Creative) *CreativesInsertCall { + c := &CreativesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.creative = creative + return c +} + +func (c *CreativesInsertCall) Do() (*Creative, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Creative) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Submit a new creative.", + // "httpMethod": "POST", + // "id": "adexchangebuyer.creatives.insert", + // "path": "creatives", + // "request": { + // "$ref": "Creative" + // }, + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.creatives.list": + +type CreativesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves a list of the authenticated user's active creatives. +// A creative will be available 30-40 minutes after submission. +func (r *CreativesService) List() *CreativesListCall { + c := &CreativesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of entries returned on one result page. If not set, the default is +// 100. +func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StatusFilter sets the optional parameter "statusFilter": When +// specified, only creatives having the given status are returned. +func (c *CreativesListCall) StatusFilter(statusFilter string) *CreativesListCall { + c.opt_["statusFilter"] = statusFilter + return c +} + +func (c *CreativesListCall) Do() (*CreativesList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["statusFilter"]; ok { + params.Set("statusFilter", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CreativesList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.creatives.list", + // "parameters": { + // "maxResults": { + // "description": "Maximum number of entries returned on one result page. If not set, the default is 100. Optional.", + // "format": "uint32", + // "location": "query", + // "maximum": "1000", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response. Optional.", + // "location": "query", + // "type": "string" + // }, + // "statusFilter": { + // "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", + // "type": "string" + // } + // }, + // "path": "creatives", + // "response": { + // "$ref": "CreativesList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.directDeals.get": + +type DirectDealsGetCall struct { + s *Service + id int64 + opt_ map[string]interface{} +} + +// Get: Gets one direct deal by ID. +func (r *DirectDealsService) Get(id int64) *DirectDealsGetCall { + c := &DirectDealsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *DirectDealsGetCall) Do() (*DirectDeal, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "directdeals/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", strconv.FormatInt(c.id, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DirectDeal) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one direct deal by ID.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.directDeals.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The direct deal id", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "directdeals/{id}", + // "response": { + // "$ref": "DirectDeal" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.directDeals.list": + +type DirectDealsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves the authenticated user's list of direct deals. +func (r *DirectDealsService) List() *DirectDealsListCall { + c := &DirectDealsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *DirectDealsListCall) Do() (*DirectDealsList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "directdeals") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DirectDealsList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the authenticated user's list of direct deals.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.directDeals.list", + // "path": "directdeals", + // "response": { + // "$ref": "DirectDealsList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.performanceReport.list": + +type PerformanceReportListCall struct { + s *Service + accountId int64 + endDateTime string + startDateTime string + opt_ map[string]interface{} +} + +// List: Retrieves the authenticated user's list of performance metrics. +func (r *PerformanceReportService) List(accountId int64, endDateTime string, startDateTime string) *PerformanceReportListCall { + c := &PerformanceReportListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.endDateTime = endDateTime + c.startDateTime = startDateTime + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of entries returned on one result page. If not set, the default is +// 100. +func (c *PerformanceReportListCall) MaxResults(maxResults int64) *PerformanceReportListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token, used to page through performance reports. To retrieve the next +// page, set this parameter to the value of "nextPageToken" from the +// previous response. +func (c *PerformanceReportListCall) PageToken(pageToken string) *PerformanceReportListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *PerformanceReportListCall) Do() (*PerformanceReportList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("accountId", fmt.Sprintf("%v", c.accountId)) + params.Set("endDateTime", fmt.Sprintf("%v", c.endDateTime)) + params.Set("startDateTime", fmt.Sprintf("%v", c.startDateTime)) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "performancereport") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PerformanceReportList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the authenticated user's list of performance metrics.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.performanceReport.list", + // "parameterOrder": [ + // "accountId", + // "endDateTime", + // "startDateTime" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id to get the reports.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "endDateTime": { + // "description": "The end time of the report in ISO 8601 timestamp format using UTC.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of entries returned on one result page. If not set, the default is 100. Optional.", + // "format": "uint32", + // "location": "query", + // "maximum": "1000", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through performance reports. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response. Optional.", + // "location": "query", + // "type": "string" + // }, + // "startDateTime": { + // "description": "The start time of the report in ISO 8601 timestamp format using UTC.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "performancereport", + // "response": { + // "$ref": "PerformanceReportList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1.3/adexchangebuyer-api.json b/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1.3/adexchangebuyer-api.json new file mode 100644 index 0000000000000..d723d847ff2e2 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1.3/adexchangebuyer-api.json @@ -0,0 +1,853 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/qdni1GzBHdR8i9VRTRxjSqpGD58\"", + "discoveryVersion": "v1", + "id": "adexchangebuyer:v1.3", + "name": "adexchangebuyer", + "canonicalName": "Ad Exchange Buyer", + "version": "v1.3", + "title": "Ad Exchange Buyer API", + "description": "Lets you manage your Ad Exchange Buyer account.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "http://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.3/", + "basePath": "/adexchangebuyer/v1.3/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "adexchangebuyer/v1.3/", + "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" + }, + "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" + } + } + }, + "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" + }, + "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 \"creative-status-codes.txt\" in the Downloads section for the status codes.", + "format": "int32" + } + } + } + } + } + }, + "height": { + "type": "integer", + "description": "Ad height.", + "format": "int32", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "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" + } + }, + "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." + } + } + }, + "DirectDeal": { + "id": "DirectDeal", + "type": "object", + "description": "The configuration data for an Ad Exchange direct deal.", + "properties": { + "accountId": { + "type": "integer", + "description": "The account id of the buyer this deal is for.", + "format": "int32" + }, + "advertiser": { + "type": "string", + "description": "The name of the advertiser this deal is for." + }, + "currencyCode": { + "type": "string", + "description": "The currency code that applies to the fixed_cpm value. If not set then assumed to be USD." + }, + "endTime": { + "type": "string", + "description": "End time for when this deal stops being active. If not set then this deal is valid until manually disabled by the publisher. In seconds since the epoch.", + "format": "int64" + }, + "fixedCpm": { + "type": "string", + "description": "The fixed price for this direct deal. In cpm micros of currency according to currency_code. If set, then this deal is eligible for the fixed price tier of buying (highest priority, pay exactly the configured fixed price).", + "format": "int64" + }, + "id": { + "type": "string", + "description": "Deal id.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#directDeal" + }, + "name": { + "type": "string", + "description": "Deal name." + }, + "privateExchangeMinCpm": { + "type": "string", + "description": "The minimum price for this direct deal. In cpm micros of currency according to currency_code. If set, then this deal is eligible for the private exchange tier of buying (below fixed price priority, run as a second price auction).", + "format": "int64" + }, + "sellerNetwork": { + "type": "string", + "description": "The name of the publisher offering this direct deal." + }, + "startTime": { + "type": "string", + "description": "Start time for when this deal becomes active. If not set then this deal is active immediately upon creation. In seconds since the epoch.", + "format": "int64" + } + } + }, + "DirectDealsList": { + "id": "DirectDealsList", + "type": "object", + "description": "A direct deals feed lists Direct Deals the Ad Exchange buyer account has access to. This includes direct deals set up for the buyer account as well as its merged stream seats.", + "properties": { + "directDeals": { + "type": "array", + "description": "A list of direct deals relevant for your account.", + "items": { + "$ref": "DirectDeal" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#directDealsList" + } + } + }, + "PerformanceReport": { + "id": "PerformanceReport", + "type": "object", + "description": "The configuration data for an Ad Exchange performance report list. TODO(nathanbullock): need to add some release tests before releasing this. https://sites.google.com/a/google.com/adx-integration/Home/engineering/binary-releases/rtb-api-release https://cs.corp.google.com/#piper///depot/google3/contentads/adx/tools/rtb_api/adxrtb.py", + "properties": { + "calloutStatusRate": { + "type": "array", + "description": "Rate of various prefiltering statuses per match. Please refer to the callout-status-codes.txt file for different statuses.", + "items": { + "type": "any" + } + }, + "cookieMatcherStatusRate": { + "type": "array", + "description": "Average QPS for cookie matcher operations.", + "items": { + "type": "any" + } + }, + "creativeStatusRate": { + "type": "array", + "description": "Rate of ads with a given status. Please refer to the creative-status-codes.txt file for different statuses.", + "items": { + "type": "any" + } + }, + "hostedMatchStatusRate": { + "type": "array", + "description": "Average QPS for hosted match operations.", + "items": { + "type": "any" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#performanceReport" + }, + "latency50thPercentile": { + "type": "number", + "description": "The 50th percentile round trip latency(ms) as perceived from Google servers for the duration period covered by the report.", + "format": "double" + }, + "latency85thPercentile": { + "type": "number", + "description": "The 85th percentile round trip latency(ms) as perceived from Google servers for the duration period covered by the report.", + "format": "double" + }, + "latency95thPercentile": { + "type": "number", + "description": "The 95th percentile round trip latency(ms) as perceived from Google servers for the duration period covered by the report.", + "format": "double" + }, + "noQuotaInRegion": { + "type": "number", + "description": "Rate of various quota account statuses per quota check.", + "format": "double" + }, + "outOfQuota": { + "type": "number", + "description": "Rate of various quota account statuses per quota check.", + "format": "double" + }, + "pixelMatchRequests": { + "type": "number", + "description": "Average QPS for pixel match requests from clients.", + "format": "double" + }, + "pixelMatchResponses": { + "type": "number", + "description": "Average QPS for pixel match responses from clients.", + "format": "double" + }, + "quotaConfiguredLimit": { + "type": "number", + "description": "The configured quota limits for this account.", + "format": "double" + }, + "quotaThrottledLimit": { + "type": "number", + "description": "The throttled quota limits for this account.", + "format": "double" + }, + "region": { + "type": "string", + "description": "The trading location of this data." + }, + "timestamp": { + "type": "string", + "description": "The unix timestamp of the starting time of this performance data.", + "format": "int64" + } + } + }, + "PerformanceReportList": { + "id": "PerformanceReportList", + "type": "object", + "description": "The configuration data for an Ad Exchange performance report list. https://sites.google.com/a/google.com/adx-integration/Home/engineering/binary-releases/rtb-api-release https://cs.corp.google.com/#piper///depot/google3/contentads/adx/tools/rtb_api/adxrtb.py", + "properties": { + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#performanceReportList" + }, + "performanceReport": { + "type": "array", + "description": "A list of performance reports relevant for the account.", + "items": { + "$ref": "PerformanceReport" + } + } + } + } + }, + "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" + ] + } + } + }, + "directDeals": { + "methods": { + "get": { + "id": "adexchangebuyer.directDeals.get", + "path": "directdeals/{id}", + "httpMethod": "GET", + "description": "Gets one direct deal by ID.", + "parameters": { + "id": { + "type": "string", + "description": "The direct deal id", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "DirectDeal" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "list": { + "id": "adexchangebuyer.directDeals.list", + "path": "directdeals", + "httpMethod": "GET", + "description": "Retrieves the authenticated user's list of direct deals.", + "response": { + "$ref": "DirectDealsList" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + }, + "performanceReport": { + "methods": { + "list": { + "id": "adexchangebuyer.performanceReport.list", + "path": "performancereport", + "httpMethod": "GET", + "description": "Retrieves the authenticated user's list of performance metrics.", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id to get the reports.", + "required": true, + "format": "int64", + "location": "query" + }, + "endDateTime": { + "type": "string", + "description": "The end time of the report in ISO 8601 timestamp format using UTC.", + "required": true, + "location": "query" + }, + "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 performance reports. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response. Optional.", + "location": "query" + }, + "startDateTime": { + "type": "string", + "description": "The start time of the report in ISO 8601 timestamp format using UTC.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "accountId", + "endDateTime", + "startDateTime" + ], + "response": { + "$ref": "PerformanceReportList" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1.3/adexchangebuyer-gen.go b/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1.3/adexchangebuyer-gen.go new file mode 100644 index 0000000000000..81a761d2fb343 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1.3/adexchangebuyer-gen.go @@ -0,0 +1,1168 @@ +// Package adexchangebuyer provides access to the Ad Exchange Buyer API. +// +// See https://developers.google.com/ad-exchange/buyer-rest +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/adexchangebuyer/v1.3" +// ... +// adexchangebuyerService, err := adexchangebuyer.New(oauthHttpClient) +package adexchangebuyer + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "adexchangebuyer:v1.3" +const apiName = "adexchangebuyer" +const apiVersion = "v1.3" +const basePath = "https://www.googleapis.com/adexchangebuyer/v1.3/" + +// OAuth2 scopes used by this API. +const ( + // Manage your Ad Exchange buyer account configuration + AdexchangeBuyerScope = "https://www.googleapis.com/auth/adexchange.buyer" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + s.Creatives = NewCreativesService(s) + s.DirectDeals = NewDirectDealsService(s) + s.PerformanceReport = NewPerformanceReportService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Accounts *AccountsService + + Creatives *CreativesService + + DirectDeals *DirectDealsService + + PerformanceReport *PerformanceReportService +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + return rs +} + +type AccountsService struct { + s *Service +} + +func NewCreativesService(s *Service) *CreativesService { + rs := &CreativesService{s: s} + return rs +} + +type CreativesService struct { + s *Service +} + +func NewDirectDealsService(s *Service) *DirectDealsService { + rs := &DirectDealsService{s: s} + return rs +} + +type DirectDealsService struct { + s *Service +} + +func NewPerformanceReportService(s *Service) *PerformanceReportService { + rs := &PerformanceReportService{s: s} + return rs +} + +type PerformanceReportService struct { + s *Service +} + +type Account struct { + // BidderLocation: Your bidder locations that have distinct URLs. + BidderLocation []*AccountBidderLocation `json:"bidderLocation,omitempty"` + + // CookieMatchingNid: The nid parameter value used in cookie match + // requests. Please contact your technical account manager if you need + // to change this. + CookieMatchingNid string `json:"cookieMatchingNid,omitempty"` + + // CookieMatchingUrl: The base URL used in cookie match requests. + CookieMatchingUrl string `json:"cookieMatchingUrl,omitempty"` + + // Id: Account id. + Id int64 `json:"id,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // MaximumTotalQps: The sum of all bidderLocation.maximumQps values + // cannot exceed this. Please contact your technical account manager if + // you need to change this. + MaximumTotalQps int64 `json:"maximumTotalQps,omitempty"` +} + +type AccountBidderLocation struct { + // MaximumQps: The maximum queries per second the Ad Exchange will send. + MaximumQps int64 `json:"maximumQps,omitempty"` + + // Region: 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: + // - ASIA + // - EUROPE + // - US_EAST + // - + // US_WEST + Region string `json:"region,omitempty"` + + // Url: The URL to which the Ad Exchange will send bid requests. + Url string `json:"url,omitempty"` +} + +type AccountsList struct { + // Items: A list of accounts. + Items []*Account `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` +} + +type Creative struct { + // HTMLSnippet: The HTML snippet that displays the ad when inserted in + // the web page. If set, videoURL should not be set. + HTMLSnippet string `json:"HTMLSnippet,omitempty"` + + // AccountId: Account id. + AccountId int64 `json:"accountId,omitempty"` + + // AdvertiserId: Detected advertiser id, if any. Read-only. This field + // should not be set in requests. + AdvertiserId googleapi.Int64s `json:"advertiserId,omitempty"` + + // AdvertiserName: The name of the company being advertised in the + // creative. + AdvertiserName string `json:"advertiserName,omitempty"` + + // AgencyId: The agency id for this creative. + AgencyId int64 `json:"agencyId,omitempty,string"` + + // Attribute: All attributes for the ads that may be shown from this + // snippet. + Attribute []int64 `json:"attribute,omitempty"` + + // BuyerCreativeId: A buyer-specific id identifying the creative in this + // ad. + BuyerCreativeId string `json:"buyerCreativeId,omitempty"` + + // ClickThroughUrl: The set of destination urls for the snippet. + ClickThroughUrl []string `json:"clickThroughUrl,omitempty"` + + // Corrections: Shows any corrections that were applied to this + // creative. Read-only. This field should not be set in requests. + Corrections []*CreativeCorrections `json:"corrections,omitempty"` + + // DisapprovalReasons: 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. + DisapprovalReasons []*CreativeDisapprovalReasons `json:"disapprovalReasons,omitempty"` + + // FilteringReasons: The filtering reasons for the creative. Read-only. + // This field should not be set in requests. + FilteringReasons *CreativeFilteringReasons `json:"filteringReasons,omitempty"` + + // Height: Ad height. + Height int64 `json:"height,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ProductCategories: Detected product categories, if any. Read-only. + // This field should not be set in requests. + ProductCategories []int64 `json:"productCategories,omitempty"` + + // RestrictedCategories: All restricted categories for the ads that may + // be shown from this snippet. + RestrictedCategories []int64 `json:"restrictedCategories,omitempty"` + + // SensitiveCategories: Detected sensitive categories, if any. + // Read-only. This field should not be set in requests. + SensitiveCategories []int64 `json:"sensitiveCategories,omitempty"` + + // Status: Creative serving status. Read-only. This field should not be + // set in requests. + Status string `json:"status,omitempty"` + + // VendorType: All vendor types for the ads that may be shown from this + // snippet. + VendorType []int64 `json:"vendorType,omitempty"` + + // VideoURL: The url to fetch a video ad. If set, HTMLSnippet should not + // be set. + VideoURL string `json:"videoURL,omitempty"` + + // Width: Ad width. + Width int64 `json:"width,omitempty"` +} + +type CreativeCorrections struct { + // Details: Additional details about the correction. + Details []string `json:"details,omitempty"` + + // Reason: The type of correction that was applied to the creative. + Reason string `json:"reason,omitempty"` +} + +type CreativeDisapprovalReasons struct { + // Details: Additional details about the reason for disapproval. + Details []string `json:"details,omitempty"` + + // Reason: The categorized reason for disapproval. + Reason string `json:"reason,omitempty"` +} + +type CreativeFilteringReasons struct { + // Date: The date in ISO 8601 format for the data. The data is collected + // from 00:00:00 to 23:59:59 in PST. + Date string `json:"date,omitempty"` + + // Reasons: The filtering reasons. + Reasons []*CreativeFilteringReasonsReasons `json:"reasons,omitempty"` +} + +type CreativeFilteringReasonsReasons struct { + // FilteringCount: The number of times the creative was filtered for the + // status. The count is aggregated across all publishers on the + // exchange. + FilteringCount int64 `json:"filteringCount,omitempty,string"` + + // FilteringStatus: The filtering status code. Please refer to + // "creative-status-codes.txt" in the Downloads section for the status + // codes. + FilteringStatus int64 `json:"filteringStatus,omitempty"` +} + +type CreativesList struct { + // Items: A list of creatives. + Items []*Creative `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through creatives. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type DirectDeal struct { + // AccountId: The account id of the buyer this deal is for. + AccountId int64 `json:"accountId,omitempty"` + + // Advertiser: The name of the advertiser this deal is for. + Advertiser string `json:"advertiser,omitempty"` + + // CurrencyCode: The currency code that applies to the fixed_cpm value. + // If not set then assumed to be USD. + CurrencyCode string `json:"currencyCode,omitempty"` + + // EndTime: End time for when this deal stops being active. If not set + // then this deal is valid until manually disabled by the publisher. In + // seconds since the epoch. + EndTime int64 `json:"endTime,omitempty,string"` + + // FixedCpm: The fixed price for this direct deal. In cpm micros of + // currency according to currency_code. If set, then this deal is + // eligible for the fixed price tier of buying (highest priority, pay + // exactly the configured fixed price). + FixedCpm int64 `json:"fixedCpm,omitempty,string"` + + // Id: Deal id. + Id int64 `json:"id,omitempty,string"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // Name: Deal name. + Name string `json:"name,omitempty"` + + // PrivateExchangeMinCpm: The minimum price for this direct deal. In cpm + // micros of currency according to currency_code. If set, then this deal + // is eligible for the private exchange tier of buying (below fixed + // price priority, run as a second price auction). + PrivateExchangeMinCpm int64 `json:"privateExchangeMinCpm,omitempty,string"` + + // SellerNetwork: The name of the publisher offering this direct deal. + SellerNetwork string `json:"sellerNetwork,omitempty"` + + // StartTime: Start time for when this deal becomes active. If not set + // then this deal is active immediately upon creation. In seconds since + // the epoch. + StartTime int64 `json:"startTime,omitempty,string"` +} + +type DirectDealsList struct { + // DirectDeals: A list of direct deals relevant for your account. + DirectDeals []*DirectDeal `json:"directDeals,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` +} + +type PerformanceReport struct { + // CalloutStatusRate: Rate of various prefiltering statuses per match. + // Please refer to the callout-status-codes.txt file for different + // statuses. + CalloutStatusRate []interface{} `json:"calloutStatusRate,omitempty"` + + // CookieMatcherStatusRate: Average QPS for cookie matcher operations. + CookieMatcherStatusRate []interface{} `json:"cookieMatcherStatusRate,omitempty"` + + // CreativeStatusRate: Rate of ads with a given status. Please refer to + // the creative-status-codes.txt file for different statuses. + CreativeStatusRate []interface{} `json:"creativeStatusRate,omitempty"` + + // HostedMatchStatusRate: Average QPS for hosted match operations. + HostedMatchStatusRate []interface{} `json:"hostedMatchStatusRate,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // Latency50thPercentile: The 50th percentile round trip latency(ms) as + // perceived from Google servers for the duration period covered by the + // report. + Latency50thPercentile float64 `json:"latency50thPercentile,omitempty"` + + // Latency85thPercentile: The 85th percentile round trip latency(ms) as + // perceived from Google servers for the duration period covered by the + // report. + Latency85thPercentile float64 `json:"latency85thPercentile,omitempty"` + + // Latency95thPercentile: The 95th percentile round trip latency(ms) as + // perceived from Google servers for the duration period covered by the + // report. + Latency95thPercentile float64 `json:"latency95thPercentile,omitempty"` + + // NoQuotaInRegion: Rate of various quota account statuses per quota + // check. + NoQuotaInRegion float64 `json:"noQuotaInRegion,omitempty"` + + // OutOfQuota: Rate of various quota account statuses per quota check. + OutOfQuota float64 `json:"outOfQuota,omitempty"` + + // PixelMatchRequests: Average QPS for pixel match requests from + // clients. + PixelMatchRequests float64 `json:"pixelMatchRequests,omitempty"` + + // PixelMatchResponses: Average QPS for pixel match responses from + // clients. + PixelMatchResponses float64 `json:"pixelMatchResponses,omitempty"` + + // QuotaConfiguredLimit: The configured quota limits for this account. + QuotaConfiguredLimit float64 `json:"quotaConfiguredLimit,omitempty"` + + // QuotaThrottledLimit: The throttled quota limits for this account. + QuotaThrottledLimit float64 `json:"quotaThrottledLimit,omitempty"` + + // Region: The trading location of this data. + Region string `json:"region,omitempty"` + + // Timestamp: The unix timestamp of the starting time of this + // performance data. + Timestamp int64 `json:"timestamp,omitempty,string"` +} + +type PerformanceReportList struct { + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // PerformanceReport: A list of performance reports relevant for the + // account. + PerformanceReport []*PerformanceReport `json:"performanceReport,omitempty"` +} + +// method id "adexchangebuyer.accounts.get": + +type AccountsGetCall struct { + s *Service + id int64 + opt_ map[string]interface{} +} + +// Get: Gets one account by ID. +func (r *AccountsService) Get(id int64) *AccountsGetCall { + c := &AccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *AccountsGetCall) Do() (*Account, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", strconv.FormatInt(c.id, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one account by ID.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.accounts.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The account id", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "accounts/{id}", + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.accounts.list": + +type AccountsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves the authenticated user's list of accounts. +func (r *AccountsService) List() *AccountsListCall { + c := &AccountsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *AccountsListCall) Do() (*AccountsList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AccountsList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the authenticated user's list of accounts.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.accounts.list", + // "path": "accounts", + // "response": { + // "$ref": "AccountsList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.accounts.patch": + +type AccountsPatchCall struct { + s *Service + id int64 + account *Account + opt_ map[string]interface{} +} + +// Patch: Updates an existing account. This method supports patch +// semantics. +func (r *AccountsService) Patch(id int64, account *Account) *AccountsPatchCall { + c := &AccountsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.account = account + return c +} + +func (c *AccountsPatchCall) Do() (*Account, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", strconv.FormatInt(c.id, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "adexchangebuyer.accounts.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The account id", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "accounts/{id}", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.accounts.update": + +type AccountsUpdateCall struct { + s *Service + id int64 + account *Account + opt_ map[string]interface{} +} + +// Update: Updates an existing account. +func (r *AccountsService) Update(id int64, account *Account) *AccountsUpdateCall { + c := &AccountsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.account = account + return c +} + +func (c *AccountsUpdateCall) Do() (*Account, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", strconv.FormatInt(c.id, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account.", + // "httpMethod": "PUT", + // "id": "adexchangebuyer.accounts.update", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The account id", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "accounts/{id}", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.creatives.get": + +type CreativesGetCall struct { + s *Service + accountId int64 + buyerCreativeId string + opt_ map[string]interface{} +} + +// Get: Gets the status for a single creative. A creative will be +// available 30-40 minutes after submission. +func (r *CreativesService) Get(accountId int64, buyerCreativeId string) *CreativesGetCall { + c := &CreativesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.buyerCreativeId = buyerCreativeId + return c +} + +func (c *CreativesGetCall) Do() (*Creative, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives/{accountId}/{buyerCreativeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", strconv.FormatInt(c.accountId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{buyerCreativeId}", url.QueryEscape(c.buyerCreativeId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Creative) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the status for a single creative. A creative will be available 30-40 minutes after submission.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.creatives.get", + // "parameterOrder": [ + // "accountId", + // "buyerCreativeId" + // ], + // "parameters": { + // "accountId": { + // "description": "The id for the account that will serve this creative.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "buyerCreativeId": { + // "description": "The buyer-specific id for this creative.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "creatives/{accountId}/{buyerCreativeId}", + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.creatives.insert": + +type CreativesInsertCall struct { + s *Service + creative *Creative + opt_ map[string]interface{} +} + +// Insert: Submit a new creative. +func (r *CreativesService) Insert(creative *Creative) *CreativesInsertCall { + c := &CreativesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.creative = creative + return c +} + +func (c *CreativesInsertCall) Do() (*Creative, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Creative) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Submit a new creative.", + // "httpMethod": "POST", + // "id": "adexchangebuyer.creatives.insert", + // "path": "creatives", + // "request": { + // "$ref": "Creative" + // }, + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.creatives.list": + +type CreativesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves a list of the authenticated user's active creatives. +// A creative will be available 30-40 minutes after submission. +func (r *CreativesService) List() *CreativesListCall { + c := &CreativesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of entries returned on one result page. If not set, the default is +// 100. +func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StatusFilter sets the optional parameter "statusFilter": When +// specified, only creatives having the given status are returned. +func (c *CreativesListCall) StatusFilter(statusFilter string) *CreativesListCall { + c.opt_["statusFilter"] = statusFilter + return c +} + +func (c *CreativesListCall) Do() (*CreativesList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["statusFilter"]; ok { + params.Set("statusFilter", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CreativesList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.creatives.list", + // "parameters": { + // "maxResults": { + // "description": "Maximum number of entries returned on one result page. If not set, the default is 100. Optional.", + // "format": "uint32", + // "location": "query", + // "maximum": "1000", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response. Optional.", + // "location": "query", + // "type": "string" + // }, + // "statusFilter": { + // "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", + // "type": "string" + // } + // }, + // "path": "creatives", + // "response": { + // "$ref": "CreativesList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.directDeals.get": + +type DirectDealsGetCall struct { + s *Service + id int64 + opt_ map[string]interface{} +} + +// Get: Gets one direct deal by ID. +func (r *DirectDealsService) Get(id int64) *DirectDealsGetCall { + c := &DirectDealsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *DirectDealsGetCall) Do() (*DirectDeal, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "directdeals/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", strconv.FormatInt(c.id, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DirectDeal) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one direct deal by ID.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.directDeals.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The direct deal id", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "directdeals/{id}", + // "response": { + // "$ref": "DirectDeal" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.directDeals.list": + +type DirectDealsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves the authenticated user's list of direct deals. +func (r *DirectDealsService) List() *DirectDealsListCall { + c := &DirectDealsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *DirectDealsListCall) Do() (*DirectDealsList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "directdeals") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DirectDealsList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the authenticated user's list of direct deals.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.directDeals.list", + // "path": "directdeals", + // "response": { + // "$ref": "DirectDealsList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.performanceReport.list": + +type PerformanceReportListCall struct { + s *Service + accountId int64 + endDateTime string + startDateTime string + opt_ map[string]interface{} +} + +// List: Retrieves the authenticated user's list of performance metrics. +func (r *PerformanceReportService) List(accountId int64, endDateTime string, startDateTime string) *PerformanceReportListCall { + c := &PerformanceReportListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.endDateTime = endDateTime + c.startDateTime = startDateTime + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of entries returned on one result page. If not set, the default is +// 100. +func (c *PerformanceReportListCall) MaxResults(maxResults int64) *PerformanceReportListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token, used to page through performance reports. To retrieve the next +// page, set this parameter to the value of "nextPageToken" from the +// previous response. +func (c *PerformanceReportListCall) PageToken(pageToken string) *PerformanceReportListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *PerformanceReportListCall) Do() (*PerformanceReportList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("accountId", fmt.Sprintf("%v", c.accountId)) + params.Set("endDateTime", fmt.Sprintf("%v", c.endDateTime)) + params.Set("startDateTime", fmt.Sprintf("%v", c.startDateTime)) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "performancereport") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PerformanceReportList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the authenticated user's list of performance metrics.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.performanceReport.list", + // "parameterOrder": [ + // "accountId", + // "endDateTime", + // "startDateTime" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id to get the reports.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "endDateTime": { + // "description": "The end time of the report in ISO 8601 timestamp format using UTC.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of entries returned on one result page. If not set, the default is 100. Optional.", + // "format": "uint32", + // "location": "query", + // "maximum": "1000", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through performance reports. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response. Optional.", + // "location": "query", + // "type": "string" + // }, + // "startDateTime": { + // "description": "The start time of the report in ISO 8601 timestamp format using UTC.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "performancereport", + // "response": { + // "$ref": "PerformanceReportList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1/adexchangebuyer-api.json b/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1/adexchangebuyer-api.json new file mode 100644 index 0000000000000..8b02542c6f7dd --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1/adexchangebuyer-api.json @@ -0,0 +1,612 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/uBdBsKoCx2blJHBc5UBukt70JEU\"", + "discoveryVersion": "v1", + "id": "adexchangebuyer:v1", + "name": "adexchangebuyer", + "canonicalName": "Ad Exchange Buyer", + "version": "v1", + "title": "Ad Exchange Buyer API", + "description": "Lets you manage your Ad Exchange Buyer account.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "http://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/", + "basePath": "/adexchangebuyer/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "adexchangebuyer/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/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" + }, + "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" + }, + "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" + } + } + }, + "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" + ] + } + }, + "adgroupId": { + "type": "string", + "description": "The pretargeting adgroup id that this creative will be associated with.", + "format": "int64", + "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" + ] + } + }, + "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" + ] + } + }, + "disapprovalReasons": { + "type": "array", + "description": "The reason 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": "string" + } + }, + "height": { + "type": "integer", + "description": "Ad height.", + "format": "int32", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "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" + } + }, + "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." + } + } + }, + "DirectDeal": { + "id": "DirectDeal", + "type": "object", + "description": "The configuration data for an Ad Exchange direct deal.", + "properties": { + "accountId": { + "type": "integer", + "description": "The account id of the buyer this deal is for.", + "format": "int32" + }, + "advertiser": { + "type": "string", + "description": "The name of the advertiser this deal is for." + }, + "currencyCode": { + "type": "string", + "description": "The currency code that applies to the fixed_cpm value. If not set then assumed to be USD." + }, + "endTime": { + "type": "string", + "description": "End time for when this deal stops being active. If not set then this deal is valid until manually disabled by the publisher. In seconds since the epoch.", + "format": "int64" + }, + "fixedCpm": { + "type": "string", + "description": "The fixed price for this direct deal. In cpm micros of currency according to currency_code.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "Deal id.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#directDeal" + }, + "name": { + "type": "string", + "description": "Deal name." + }, + "sellerNetwork": { + "type": "string", + "description": "The name of the publisher offering this direct deal." + }, + "startTime": { + "type": "string", + "description": "Start time for when this deal becomes active. If not set then this deal is active immediately upon creation. In seconds since the epoch.", + "format": "int64" + } + } + }, + "DirectDealsList": { + "id": "DirectDealsList", + "type": "object", + "description": "A direct deals feed lists Direct Deals the Ad Exchange buyer account has access to. This includes direct deals set up for the buyer account as well as its merged stream seats.", + "properties": { + "directDeals": { + "type": "array", + "description": "A list of direct deals relevant for your account.", + "items": { + "$ref": "DirectDeal" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#directDealsList" + } + } + } + }, + "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.", + "parameters": { + "accountId": { + "type": "integer", + "description": "The id for the account that will serve this creative.", + "required": true, + "format": "int32", + "location": "path" + }, + "adgroupId": { + "type": "string", + "description": "The adgroup this creative belongs to.", + "required": true, + "format": "int64", + "location": "query" + }, + "buyerCreativeId": { + "type": "string", + "description": "The buyer-specific id for this creative.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "buyerCreativeId", + "adgroupId" + ], + "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.", + "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" + } + }, + "response": { + "$ref": "CreativesList" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + }, + "directDeals": { + "methods": { + "get": { + "id": "adexchangebuyer.directDeals.get", + "path": "directdeals/{id}", + "httpMethod": "GET", + "description": "Gets one direct deal by ID.", + "parameters": { + "id": { + "type": "string", + "description": "The direct deal id", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "DirectDeal" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "list": { + "id": "adexchangebuyer.directDeals.list", + "path": "directdeals", + "httpMethod": "GET", + "description": "Retrieves the authenticated user's list of direct deals.", + "response": { + "$ref": "DirectDealsList" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1/adexchangebuyer-gen.go b/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1/adexchangebuyer-gen.go new file mode 100644 index 0000000000000..f3fc294f8d4c4 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adexchangebuyer/v1/adexchangebuyer-gen.go @@ -0,0 +1,885 @@ +// Package adexchangebuyer provides access to the Ad Exchange Buyer API. +// +// See https://developers.google.com/ad-exchange/buyer-rest +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/adexchangebuyer/v1" +// ... +// adexchangebuyerService, err := adexchangebuyer.New(oauthHttpClient) +package adexchangebuyer + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "adexchangebuyer:v1" +const apiName = "adexchangebuyer" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/adexchangebuyer/v1/" + +// OAuth2 scopes used by this API. +const ( + // Manage your Ad Exchange buyer account configuration + AdexchangeBuyerScope = "https://www.googleapis.com/auth/adexchange.buyer" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + s.Creatives = NewCreativesService(s) + s.DirectDeals = NewDirectDealsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Accounts *AccountsService + + Creatives *CreativesService + + DirectDeals *DirectDealsService +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + return rs +} + +type AccountsService struct { + s *Service +} + +func NewCreativesService(s *Service) *CreativesService { + rs := &CreativesService{s: s} + return rs +} + +type CreativesService struct { + s *Service +} + +func NewDirectDealsService(s *Service) *DirectDealsService { + rs := &DirectDealsService{s: s} + return rs +} + +type DirectDealsService struct { + s *Service +} + +type Account struct { + // BidderLocation: Your bidder locations that have distinct URLs. + BidderLocation []*AccountBidderLocation `json:"bidderLocation,omitempty"` + + // CookieMatchingNid: The nid parameter value used in cookie match + // requests. Please contact your technical account manager if you need + // to change this. + CookieMatchingNid string `json:"cookieMatchingNid,omitempty"` + + // CookieMatchingUrl: The base URL used in cookie match requests. + CookieMatchingUrl string `json:"cookieMatchingUrl,omitempty"` + + // Id: Account id. + Id int64 `json:"id,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // MaximumTotalQps: The sum of all bidderLocation.maximumQps values + // cannot exceed this. Please contact your technical account manager if + // you need to change this. + MaximumTotalQps int64 `json:"maximumTotalQps,omitempty"` +} + +type AccountBidderLocation struct { + // MaximumQps: The maximum queries per second the Ad Exchange will send. + MaximumQps int64 `json:"maximumQps,omitempty"` + + // Url: The URL to which the Ad Exchange will send bid requests. + Url string `json:"url,omitempty"` +} + +type AccountsList struct { + // Items: A list of accounts. + Items []*Account `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` +} + +type Creative struct { + // HTMLSnippet: The HTML snippet that displays the ad when inserted in + // the web page. If set, videoURL should not be set. + HTMLSnippet string `json:"HTMLSnippet,omitempty"` + + // AccountId: Account id. + AccountId int64 `json:"accountId,omitempty"` + + // AdgroupId: The pretargeting adgroup id that this creative will be + // associated with. + AdgroupId int64 `json:"adgroupId,omitempty,string"` + + // AdvertiserId: Detected advertiser id, if any. Read-only. This field + // should not be set in requests. + AdvertiserId googleapi.Int64s `json:"advertiserId,omitempty"` + + // AdvertiserName: The name of the company being advertised in the + // creative. + AdvertiserName string `json:"advertiserName,omitempty"` + + // Attribute: All attributes for the ads that may be shown from this + // snippet. + Attribute []int64 `json:"attribute,omitempty"` + + // BuyerCreativeId: A buyer-specific id identifying the creative in this + // ad. + BuyerCreativeId string `json:"buyerCreativeId,omitempty"` + + // ClickThroughUrl: The set of destination urls for the snippet. + ClickThroughUrl []string `json:"clickThroughUrl,omitempty"` + + // DisapprovalReasons: The reason 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. + DisapprovalReasons []string `json:"disapprovalReasons,omitempty"` + + // Height: Ad height. + Height int64 `json:"height,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ProductCategories: Detected product categories, if any. Read-only. + // This field should not be set in requests. + ProductCategories []int64 `json:"productCategories,omitempty"` + + // RestrictedCategories: All restricted categories for the ads that may + // be shown from this snippet. + RestrictedCategories []int64 `json:"restrictedCategories,omitempty"` + + // SensitiveCategories: Detected sensitive categories, if any. + // Read-only. This field should not be set in requests. + SensitiveCategories []int64 `json:"sensitiveCategories,omitempty"` + + // Status: Creative serving status. Read-only. This field should not be + // set in requests. + Status string `json:"status,omitempty"` + + // VendorType: All vendor types for the ads that may be shown from this + // snippet. + VendorType []int64 `json:"vendorType,omitempty"` + + // VideoURL: The url to fetch a video ad. If set, HTMLSnippet should not + // be set. + VideoURL string `json:"videoURL,omitempty"` + + // Width: Ad width. + Width int64 `json:"width,omitempty"` +} + +type CreativesList struct { + // Items: A list of creatives. + Items []*Creative `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through creatives. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type DirectDeal struct { + // AccountId: The account id of the buyer this deal is for. + AccountId int64 `json:"accountId,omitempty"` + + // Advertiser: The name of the advertiser this deal is for. + Advertiser string `json:"advertiser,omitempty"` + + // CurrencyCode: The currency code that applies to the fixed_cpm value. + // If not set then assumed to be USD. + CurrencyCode string `json:"currencyCode,omitempty"` + + // EndTime: End time for when this deal stops being active. If not set + // then this deal is valid until manually disabled by the publisher. In + // seconds since the epoch. + EndTime int64 `json:"endTime,omitempty,string"` + + // FixedCpm: The fixed price for this direct deal. In cpm micros of + // currency according to currency_code. + FixedCpm int64 `json:"fixedCpm,omitempty,string"` + + // Id: Deal id. + Id int64 `json:"id,omitempty,string"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // Name: Deal name. + Name string `json:"name,omitempty"` + + // SellerNetwork: The name of the publisher offering this direct deal. + SellerNetwork string `json:"sellerNetwork,omitempty"` + + // StartTime: Start time for when this deal becomes active. If not set + // then this deal is active immediately upon creation. In seconds since + // the epoch. + StartTime int64 `json:"startTime,omitempty,string"` +} + +type DirectDealsList struct { + // DirectDeals: A list of direct deals relevant for your account. + DirectDeals []*DirectDeal `json:"directDeals,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` +} + +// method id "adexchangebuyer.accounts.get": + +type AccountsGetCall struct { + s *Service + id int64 + opt_ map[string]interface{} +} + +// Get: Gets one account by ID. +func (r *AccountsService) Get(id int64) *AccountsGetCall { + c := &AccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *AccountsGetCall) Do() (*Account, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", strconv.FormatInt(c.id, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one account by ID.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.accounts.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The account id", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "accounts/{id}", + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.accounts.list": + +type AccountsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves the authenticated user's list of accounts. +func (r *AccountsService) List() *AccountsListCall { + c := &AccountsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *AccountsListCall) Do() (*AccountsList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AccountsList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the authenticated user's list of accounts.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.accounts.list", + // "path": "accounts", + // "response": { + // "$ref": "AccountsList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.accounts.patch": + +type AccountsPatchCall struct { + s *Service + id int64 + account *Account + opt_ map[string]interface{} +} + +// Patch: Updates an existing account. This method supports patch +// semantics. +func (r *AccountsService) Patch(id int64, account *Account) *AccountsPatchCall { + c := &AccountsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.account = account + return c +} + +func (c *AccountsPatchCall) Do() (*Account, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", strconv.FormatInt(c.id, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "adexchangebuyer.accounts.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The account id", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "accounts/{id}", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.accounts.update": + +type AccountsUpdateCall struct { + s *Service + id int64 + account *Account + opt_ map[string]interface{} +} + +// Update: Updates an existing account. +func (r *AccountsService) Update(id int64, account *Account) *AccountsUpdateCall { + c := &AccountsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.account = account + return c +} + +func (c *AccountsUpdateCall) Do() (*Account, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", strconv.FormatInt(c.id, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account.", + // "httpMethod": "PUT", + // "id": "adexchangebuyer.accounts.update", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The account id", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "accounts/{id}", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.creatives.get": + +type CreativesGetCall struct { + s *Service + accountId int64 + buyerCreativeId string + adgroupId int64 + opt_ map[string]interface{} +} + +// Get: Gets the status for a single creative. +func (r *CreativesService) Get(accountId int64, buyerCreativeId string, adgroupId int64) *CreativesGetCall { + c := &CreativesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.buyerCreativeId = buyerCreativeId + c.adgroupId = adgroupId + return c +} + +func (c *CreativesGetCall) Do() (*Creative, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("adgroupId", fmt.Sprintf("%v", c.adgroupId)) + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives/{accountId}/{buyerCreativeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", strconv.FormatInt(c.accountId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{buyerCreativeId}", url.QueryEscape(c.buyerCreativeId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Creative) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the status for a single creative.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.creatives.get", + // "parameterOrder": [ + // "accountId", + // "buyerCreativeId", + // "adgroupId" + // ], + // "parameters": { + // "accountId": { + // "description": "The id for the account that will serve this creative.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "adgroupId": { + // "description": "The adgroup this creative belongs to.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "buyerCreativeId": { + // "description": "The buyer-specific id for this creative.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "creatives/{accountId}/{buyerCreativeId}", + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.creatives.insert": + +type CreativesInsertCall struct { + s *Service + creative *Creative + opt_ map[string]interface{} +} + +// Insert: Submit a new creative. +func (r *CreativesService) Insert(creative *Creative) *CreativesInsertCall { + c := &CreativesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.creative = creative + return c +} + +func (c *CreativesInsertCall) Do() (*Creative, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Creative) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Submit a new creative.", + // "httpMethod": "POST", + // "id": "adexchangebuyer.creatives.insert", + // "path": "creatives", + // "request": { + // "$ref": "Creative" + // }, + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.creatives.list": + +type CreativesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves a list of the authenticated user's active creatives. +func (r *CreativesService) List() *CreativesListCall { + c := &CreativesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of entries returned on one result page. If not set, the default is +// 100. +func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CreativesListCall) Do() (*CreativesList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CreativesList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of the authenticated user's active creatives.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.creatives.list", + // "parameters": { + // "maxResults": { + // "description": "Maximum number of entries returned on one result page. If not set, the default is 100. Optional.", + // "format": "uint32", + // "location": "query", + // "maximum": "1000", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response. Optional.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "creatives", + // "response": { + // "$ref": "CreativesList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.directDeals.get": + +type DirectDealsGetCall struct { + s *Service + id int64 + opt_ map[string]interface{} +} + +// Get: Gets one direct deal by ID. +func (r *DirectDealsService) Get(id int64) *DirectDealsGetCall { + c := &DirectDealsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *DirectDealsGetCall) Do() (*DirectDeal, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "directdeals/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", strconv.FormatInt(c.id, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DirectDeal) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one direct deal by ID.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.directDeals.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The direct deal id", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "directdeals/{id}", + // "response": { + // "$ref": "DirectDeal" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.directDeals.list": + +type DirectDealsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves the authenticated user's list of direct deals. +func (r *DirectDealsService) List() *DirectDealsListCall { + c := &DirectDealsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *DirectDealsListCall) Do() (*DirectDealsList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "directdeals") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DirectDealsList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the authenticated user's list of direct deals.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.directDeals.list", + // "path": "directdeals", + // "response": { + // "$ref": "DirectDealsList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adexchangeseller/v1.1/adexchangeseller-api.json b/third_party/src/code.google.com/p/google-api-go-client/adexchangeseller/v1.1/adexchangeseller-api.json new file mode 100644 index 0000000000000..b2b9297c90c87 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adexchangeseller/v1.1/adexchangeseller-api.json @@ -0,0 +1,1240 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/o4lGc4skdE8M5fsjyXciyvLhoWk\"", + "discoveryVersion": "v1", + "id": "adexchangeseller:v1.1", + "name": "adexchangeseller", + "canonicalName": "Ad Exchange Seller", + "version": "v1.1", + "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": "http://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "http://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.1/", + "basePath": "/adexchangeseller/v1.1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "adexchangeseller/v1.1/", + "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": { + "Account": { + "id": "Account", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of this account." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adexchangeseller#account.", + "default": "adexchangeseller#account" + }, + "name": { + "type": "string", + "description": "Name of this account." + } + } + }, + "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." + } + } + }, + "Alert": { + "id": "Alert", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of this alert. 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#alert.", + "default": "adexchangeseller#alert" + }, + "message": { + "type": "string", + "description": "The localized alert message." + }, + "severity": { + "type": "string", + "description": "Severity of this alert. Possible values: INFO, WARNING, SEVERE." + }, + "type": { + "type": "string", + "description": "Type of this alert. Possible values: SELF_HOLD, MIGRATED_TO_BILLING3, ADDRESS_PIN_VERIFICATION, PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, GRAYLISTED_PUBLISHER, API_HOLD." + } + } + }, + "Alerts": { + "id": "Alerts", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The alerts returned in this list response.", + "items": { + "$ref": "Alert" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adexchangeseller#alerts.", + "default": "adexchangeseller#alerts" + } + } + }, + "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." + } + } + }, + "Metadata": { + "id": "Metadata", + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "ReportingMetadataEntry" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adexchangeseller#metadata.", + "default": "adexchangeseller#metadata" + } + } + }, + "PreferredDeal": { + "id": "PreferredDeal", + "type": "object", + "properties": { + "advertiserName": { + "type": "string", + "description": "The name of the advertiser this deal is for." + }, + "buyerNetworkName": { + "type": "string", + "description": "The name of the buyer network this deal is for." + }, + "currencyCode": { + "type": "string", + "description": "The currency code that applies to the fixed_cpm value. If not set then assumed to be USD." + }, + "endTime": { + "type": "string", + "description": "Time when this deal stops being active in seconds since the epoch (GMT). If not set then this deal is valid until manually disabled by the publisher.", + "format": "uint64" + }, + "fixedCpm": { + "type": "string", + "description": "The fixed price for this preferred deal. In cpm micros of currency according to currencyCode. If set, then this preferred deal is eligible for the fixed price tier of buying (highest priority, pay exactly the configured fixed price).", + "format": "int64" + }, + "id": { + "type": "string", + "description": "Unique identifier of this preferred deal.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adexchangeseller#preferredDeal.", + "default": "adexchangeseller#preferredDeal" + }, + "startTime": { + "type": "string", + "description": "Time when this deal becomes active in seconds since the epoch (GMT). If not set then this deal is active immediately upon creation.", + "format": "uint64" + } + } + }, + "PreferredDeals": { + "id": "PreferredDeals", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The preferred deals returned in this list response.", + "items": { + "$ref": "PreferredDeal" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adexchangeseller#preferredDeals.", + "default": "adexchangeseller#preferredDeals" + } + } + }, + "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" + } + } + } + }, + "ReportingMetadataEntry": { + "id": "ReportingMetadataEntry", + "type": "object", + "properties": { + "compatibleDimensions": { + "type": "array", + "description": "For metrics this is a list of dimension IDs which the metric is compatible with, for dimensions it is a list of compatibility groups the dimension belongs to.", + "items": { + "type": "string" + } + }, + "compatibleMetrics": { + "type": "array", + "description": "The names of the metrics the dimension or metric this reporting metadata entry describes is compatible with.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "Unique identifier of this reporting metadata entry, corresponding to the name of the appropriate dimension or metric." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adexchangeseller#reportingMetadataEntry.", + "default": "adexchangeseller#reportingMetadataEntry" + }, + "requiredDimensions": { + "type": "array", + "description": "The names of the dimensions which the dimension or metric this reporting metadata entry describes requires to also be present in order for the report to be valid. Omitting these will not cause an error or warning, but may result in data which cannot be correctly interpreted.", + "items": { + "type": "string" + } + }, + "requiredMetrics": { + "type": "array", + "description": "The names of the metrics which the dimension or metric this reporting metadata entry describes requires to also be present in order for the report to be valid. Omitting these will not cause an error or warning, but may result in data which cannot be correctly interpreted.", + "items": { + "type": "string" + } + }, + "supportedProducts": { + "type": "array", + "description": "The codes of the projects supported by the dimension or metric this reporting metadata entry describes.", + "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": { + "accounts": { + "methods": { + "get": { + "id": "adexchangeseller.accounts.get", + "path": "accounts/{accountId}", + "httpMethod": "GET", + "description": "Get information about the selected Ad Exchange account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to get information about. Tip: 'myaccount' is a valid ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + } + }, + "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" + ] + } + } + } + } + }, + "alerts": { + "methods": { + "list": { + "id": "adexchangeseller.alerts.list", + "path": "alerts", + "httpMethod": "GET", + "description": "List the alerts for this Ad Exchange account.", + "parameters": { + "locale": { + "type": "string", + "description": "The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported.", + "location": "query" + } + }, + "response": { + "$ref": "Alerts" + }, + "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" + ] + } + } + } + } + }, + "metadata": { + "resources": { + "dimensions": { + "methods": { + "list": { + "id": "adexchangeseller.metadata.dimensions.list", + "path": "metadata/dimensions", + "httpMethod": "GET", + "description": "List the metadata for the dimensions available to this AdExchange account.", + "response": { + "$ref": "Metadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + } + }, + "metrics": { + "methods": { + "list": { + "id": "adexchangeseller.metadata.metrics.list", + "path": "metadata/metrics", + "httpMethod": "GET", + "description": "List the metadata for the metrics available to this AdExchange account.", + "response": { + "$ref": "Metadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + } + } + } + }, + "preferreddeals": { + "methods": { + "get": { + "id": "adexchangeseller.preferreddeals.get", + "path": "preferreddeals/{dealId}", + "httpMethod": "GET", + "description": "Get information about the selected Ad Exchange Preferred Deal.", + "parameters": { + "dealId": { + "type": "string", + "description": "Preferred deal to get information about.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "dealId" + ], + "response": { + "$ref": "PreferredDeal" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + }, + "list": { + "id": "adexchangeseller.preferreddeals.list", + "path": "preferreddeals", + "httpMethod": "GET", + "description": "List the preferred deals for this Ad Exchange account.", + "response": { + "$ref": "PreferredDeals" + }, + "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" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adexchangeseller/v1.1/adexchangeseller-gen.go b/third_party/src/code.google.com/p/google-api-go-client/adexchangeseller/v1.1/adexchangeseller-gen.go new file mode 100644 index 0000000000000..d258cd472dc6c --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adexchangeseller/v1.1/adexchangeseller-gen.go @@ -0,0 +1,2167 @@ +// Package adexchangeseller provides access to the Ad Exchange Seller API. +// +// See https://developers.google.com/ad-exchange/seller-rest/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/adexchangeseller/v1.1" +// ... +// adexchangesellerService, err := adexchangeseller.New(oauthHttpClient) +package adexchangeseller + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "adexchangeseller:v1.1" +const apiName = "adexchangeseller" +const apiVersion = "v1.1" +const basePath = "https://www.googleapis.com/adexchangeseller/v1.1/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Ad Exchange data + AdexchangeSellerScope = "https://www.googleapis.com/auth/adexchange.seller" + + // View your Ad Exchange data + AdexchangeSellerReadonlyScope = "https://www.googleapis.com/auth/adexchange.seller.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.Accounts = NewAccountsService(s) + s.Adclients = NewAdclientsService(s) + s.Adunits = NewAdunitsService(s) + s.Alerts = NewAlertsService(s) + s.Customchannels = NewCustomchannelsService(s) + s.Metadata = NewMetadataService(s) + s.Preferreddeals = NewPreferreddealsService(s) + s.Reports = NewReportsService(s) + s.Urlchannels = NewUrlchannelsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Accounts *AccountsService + + Adclients *AdclientsService + + Adunits *AdunitsService + + Alerts *AlertsService + + Customchannels *CustomchannelsService + + Metadata *MetadataService + + Preferreddeals *PreferreddealsService + + Reports *ReportsService + + Urlchannels *UrlchannelsService +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + return rs +} + +type AccountsService struct { + s *Service +} + +func NewAdclientsService(s *Service) *AdclientsService { + rs := &AdclientsService{s: s} + return rs +} + +type AdclientsService struct { + s *Service +} + +func NewAdunitsService(s *Service) *AdunitsService { + rs := &AdunitsService{s: s} + rs.Customchannels = NewAdunitsCustomchannelsService(s) + return rs +} + +type AdunitsService struct { + s *Service + + Customchannels *AdunitsCustomchannelsService +} + +func NewAdunitsCustomchannelsService(s *Service) *AdunitsCustomchannelsService { + rs := &AdunitsCustomchannelsService{s: s} + return rs +} + +type AdunitsCustomchannelsService struct { + s *Service +} + +func NewAlertsService(s *Service) *AlertsService { + rs := &AlertsService{s: s} + return rs +} + +type AlertsService struct { + s *Service +} + +func NewCustomchannelsService(s *Service) *CustomchannelsService { + rs := &CustomchannelsService{s: s} + rs.Adunits = NewCustomchannelsAdunitsService(s) + return rs +} + +type CustomchannelsService struct { + s *Service + + Adunits *CustomchannelsAdunitsService +} + +func NewCustomchannelsAdunitsService(s *Service) *CustomchannelsAdunitsService { + rs := &CustomchannelsAdunitsService{s: s} + return rs +} + +type CustomchannelsAdunitsService struct { + s *Service +} + +func NewMetadataService(s *Service) *MetadataService { + rs := &MetadataService{s: s} + rs.Dimensions = NewMetadataDimensionsService(s) + rs.Metrics = NewMetadataMetricsService(s) + return rs +} + +type MetadataService struct { + s *Service + + Dimensions *MetadataDimensionsService + + Metrics *MetadataMetricsService +} + +func NewMetadataDimensionsService(s *Service) *MetadataDimensionsService { + rs := &MetadataDimensionsService{s: s} + return rs +} + +type MetadataDimensionsService struct { + s *Service +} + +func NewMetadataMetricsService(s *Service) *MetadataMetricsService { + rs := &MetadataMetricsService{s: s} + return rs +} + +type MetadataMetricsService struct { + s *Service +} + +func NewPreferreddealsService(s *Service) *PreferreddealsService { + rs := &PreferreddealsService{s: s} + return rs +} + +type PreferreddealsService struct { + s *Service +} + +func NewReportsService(s *Service) *ReportsService { + rs := &ReportsService{s: s} + rs.Saved = NewReportsSavedService(s) + return rs +} + +type ReportsService struct { + s *Service + + Saved *ReportsSavedService +} + +func NewReportsSavedService(s *Service) *ReportsSavedService { + rs := &ReportsSavedService{s: s} + return rs +} + +type ReportsSavedService struct { + s *Service +} + +func NewUrlchannelsService(s *Service) *UrlchannelsService { + rs := &UrlchannelsService{s: s} + return rs +} + +type UrlchannelsService struct { + s *Service +} + +type Account struct { + // Id: Unique identifier of this account. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case + // adexchangeseller#account. + Kind string `json:"kind,omitempty"` + + // Name: Name of this account. + Name string `json:"name,omitempty"` +} + +type AdClient struct { + // ArcOptIn: Whether this ad client is opted in to ARC. + ArcOptIn bool `json:"arcOptIn,omitempty"` + + // Id: Unique identifier of this ad client. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case + // adexchangeseller#adClient. + Kind string `json:"kind,omitempty"` + + // ProductCode: This ad client's product code, which corresponds to the + // PRODUCT_CODE report dimension. + ProductCode string `json:"productCode,omitempty"` + + // SupportsReporting: Whether this ad client supports being reported on. + SupportsReporting bool `json:"supportsReporting,omitempty"` +} + +type AdClients struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The ad clients returned in this list response. + Items []*AdClient `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adexchangeseller#adClients. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad clients. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AdUnit struct { + // Code: Identity code of this ad unit, not necessarily unique across ad + // clients. + Code string `json:"code,omitempty"` + + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adexchangeseller#adUnit. + Kind string `json:"kind,omitempty"` + + // Name: Name of this ad unit. + Name string `json:"name,omitempty"` + + // Status: Status of this ad unit. Possible values are: + // NEW: Indicates + // that the ad unit was created within the last seven days and does not + // yet have any activity associated with it. + // + // ACTIVE: Indicates that + // there has been activity on this ad unit in the last seven + // days. + // + // INACTIVE: Indicates that there has been no activity on this ad + // unit in the last seven days. + Status string `json:"status,omitempty"` +} + +type AdUnits struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The ad units returned in this list response. + Items []*AdUnit `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adexchangeseller#adUnits. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad units. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Alert struct { + // Id: Unique identifier of this alert. This should be considered an + // opaque identifier; it is not safe to rely on it being in any + // particular format. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adexchangeseller#alert. + Kind string `json:"kind,omitempty"` + + // Message: The localized alert message. + Message string `json:"message,omitempty"` + + // Severity: Severity of this alert. Possible values: INFO, WARNING, + // SEVERE. + Severity string `json:"severity,omitempty"` + + // Type: Type of this alert. Possible values: SELF_HOLD, + // MIGRATED_TO_BILLING3, ADDRESS_PIN_VERIFICATION, + // PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, GRAYLISTED_PUBLISHER, + // API_HOLD. + Type string `json:"type,omitempty"` +} + +type Alerts struct { + // Items: The alerts returned in this list response. + Items []*Alert `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adexchangeseller#alerts. + Kind string `json:"kind,omitempty"` +} + +type CustomChannel struct { + // Code: Code of this custom channel, not necessarily unique across ad + // clients. + Code string `json:"code,omitempty"` + + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case + // adexchangeseller#customChannel. + Kind string `json:"kind,omitempty"` + + // Name: Name of this custom channel. + Name string `json:"name,omitempty"` + + // TargetingInfo: The targeting information of this custom channel, if + // activated. + TargetingInfo *CustomChannelTargetingInfo `json:"targetingInfo,omitempty"` +} + +type CustomChannelTargetingInfo struct { + // AdsAppearOn: The name used to describe this channel externally. + AdsAppearOn string `json:"adsAppearOn,omitempty"` + + // Description: The external description of the channel. + Description string `json:"description,omitempty"` + + // Location: 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. + Location string `json:"location,omitempty"` + + // SiteLanguage: The language of the sites ads will be displayed on. + SiteLanguage string `json:"siteLanguage,omitempty"` +} + +type CustomChannels struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The custom channels returned in this list response. + Items []*CustomChannel `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case + // adexchangeseller#customChannels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through custom + // channels. To retrieve the next page of results, set the next + // request's "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Metadata struct { + Items []*ReportingMetadataEntry `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adexchangeseller#metadata. + Kind string `json:"kind,omitempty"` +} + +type PreferredDeal struct { + // AdvertiserName: The name of the advertiser this deal is for. + AdvertiserName string `json:"advertiserName,omitempty"` + + // BuyerNetworkName: The name of the buyer network this deal is for. + BuyerNetworkName string `json:"buyerNetworkName,omitempty"` + + // CurrencyCode: The currency code that applies to the fixed_cpm value. + // If not set then assumed to be USD. + CurrencyCode string `json:"currencyCode,omitempty"` + + // EndTime: Time when this deal stops being active in seconds since the + // epoch (GMT). If not set then this deal is valid until manually + // disabled by the publisher. + EndTime uint64 `json:"endTime,omitempty,string"` + + // FixedCpm: The fixed price for this preferred deal. In cpm micros of + // currency according to currencyCode. If set, then this preferred deal + // is eligible for the fixed price tier of buying (highest priority, pay + // exactly the configured fixed price). + FixedCpm int64 `json:"fixedCpm,omitempty,string"` + + // Id: Unique identifier of this preferred deal. + Id int64 `json:"id,omitempty,string"` + + // Kind: Kind of resource this is, in this case + // adexchangeseller#preferredDeal. + Kind string `json:"kind,omitempty"` + + // StartTime: Time when this deal becomes active in seconds since the + // epoch (GMT). If not set then this deal is active immediately upon + // creation. + StartTime uint64 `json:"startTime,omitempty,string"` +} + +type PreferredDeals struct { + // Items: The preferred deals returned in this list response. + Items []*PreferredDeal `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case + // adexchangeseller#preferredDeals. + Kind string `json:"kind,omitempty"` +} + +type Report struct { + // Averages: The averages of the report. This is the same length as any + // other row in the report; cells corresponding to dimension columns are + // empty. + Averages []string `json:"averages,omitempty"` + + // Headers: 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. + Headers []*ReportHeaders `json:"headers,omitempty"` + + // Kind: Kind this is, in this case adexchangeseller#report. + Kind string `json:"kind,omitempty"` + + // Rows: 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. + Rows [][]string `json:"rows,omitempty"` + + // TotalMatchedRows: 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. + TotalMatchedRows int64 `json:"totalMatchedRows,omitempty,string"` + + // Totals: The totals of the report. This is the same length as any + // other row in the report; cells corresponding to dimension columns are + // empty. + Totals []string `json:"totals,omitempty"` + + // Warnings: Any warnings associated with generation of the report. + Warnings []string `json:"warnings,omitempty"` +} + +type ReportHeaders struct { + // Currency: The currency of this column. Only present if the header + // type is METRIC_CURRENCY. + Currency string `json:"currency,omitempty"` + + // Name: The name of the header. + Name string `json:"name,omitempty"` + + // Type: The type of the header; one of DIMENSION, METRIC_TALLY, + // METRIC_RATIO, or METRIC_CURRENCY. + Type string `json:"type,omitempty"` +} + +type ReportingMetadataEntry struct { + // CompatibleDimensions: For metrics this is a list of dimension IDs + // which the metric is compatible with, for dimensions it is a list of + // compatibility groups the dimension belongs to. + CompatibleDimensions []string `json:"compatibleDimensions,omitempty"` + + // CompatibleMetrics: The names of the metrics the dimension or metric + // this reporting metadata entry describes is compatible with. + CompatibleMetrics []string `json:"compatibleMetrics,omitempty"` + + // Id: Unique identifier of this reporting metadata entry, corresponding + // to the name of the appropriate dimension or metric. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case + // adexchangeseller#reportingMetadataEntry. + Kind string `json:"kind,omitempty"` + + // RequiredDimensions: The names of the dimensions which the dimension + // or metric this reporting metadata entry describes requires to also be + // present in order for the report to be valid. Omitting these will not + // cause an error or warning, but may result in data which cannot be + // correctly interpreted. + RequiredDimensions []string `json:"requiredDimensions,omitempty"` + + // RequiredMetrics: The names of the metrics which the dimension or + // metric this reporting metadata entry describes requires to also be + // present in order for the report to be valid. Omitting these will not + // cause an error or warning, but may result in data which cannot be + // correctly interpreted. + RequiredMetrics []string `json:"requiredMetrics,omitempty"` + + // SupportedProducts: The codes of the projects supported by the + // dimension or metric this reporting metadata entry describes. + SupportedProducts []string `json:"supportedProducts,omitempty"` +} + +type SavedReport struct { + // Id: Unique identifier of this saved report. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case + // adexchangeseller#savedReport. + Kind string `json:"kind,omitempty"` + + // Name: This saved report's name. + Name string `json:"name,omitempty"` +} + +type SavedReports struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The saved reports returned in this list response. + Items []*SavedReport `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case + // adexchangeseller#savedReports. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through saved reports. + // To retrieve the next page of results, set the next request's + // "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type UrlChannel struct { + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case + // adexchangeseller#urlChannel. + Kind string `json:"kind,omitempty"` + + // UrlPattern: URL Pattern of this URL channel. Does not include + // "http://" or "https://". Example: www.example.com/home + UrlPattern string `json:"urlPattern,omitempty"` +} + +type UrlChannels struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The URL channels returned in this list response. + Items []*UrlChannel `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case + // adexchangeseller#urlChannels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through URL channels. + // To retrieve the next page of results, set the next request's + // "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +// method id "adexchangeseller.accounts.get": + +type AccountsGetCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// Get: Get information about the selected Ad Exchange account. +func (r *AccountsService) Get(accountId string) *AccountsGetCall { + c := &AccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +func (c *AccountsGetCall) Do() (*Account, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get information about the selected Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.accounts.get", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to get information about. Tip: 'myaccount' is a valid ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}", + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.adclients.list": + +type AdclientsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all ad clients in this Ad Exchange account. +func (r *AdclientsService) List() *AdclientsListCall { + c := &AdclientsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad clients to include in the response, used for paging. +func (c *AdclientsListCall) MaxResults(maxResults int64) *AdclientsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdclientsListCall) PageToken(pageToken string) *AdclientsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdclientsListCall) Do() (*AdClients, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdClients) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad clients in this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.adclients.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of ad clients to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "adclients", + // "response": { + // "$ref": "AdClients" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.adunits.get": + +type AdunitsGetCall struct { + s *Service + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// Get: Gets the specified ad unit in the specified ad client. +func (r *AdunitsService) Get(adClientId string, adUnitId string) *AdunitsGetCall { + c := &AdunitsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +func (c *AdunitsGetCall) Do() (*AdUnit, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified ad unit in the specified ad client.", + // "httpMethod": "GET", + // "id": "adexchangeseller.adunits.get", + // "parameterOrder": [ + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to get the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits/{adUnitId}", + // "response": { + // "$ref": "AdUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.adunits.list": + +type AdunitsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified ad client for this Ad +// Exchange account. +func (r *AdunitsService) List(adClientId string) *AdunitsListCall { + c := &AdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *AdunitsListCall) IncludeInactive(includeInactive bool) *AdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *AdunitsListCall) MaxResults(maxResults int64) *AdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdunitsListCall) PageToken(pageToken string) *AdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified ad client for this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.adunits.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.adunits.customchannels.list": + +type AdunitsCustomchannelsListCall struct { + s *Service + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// List: List all custom channels which the specified ad unit belongs +// to. +func (r *AdunitsCustomchannelsService) List(adClientId string, adUnitId string) *AdunitsCustomchannelsListCall { + c := &AdunitsCustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *AdunitsCustomchannelsListCall) MaxResults(maxResults int64) *AdunitsCustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdunitsCustomchannelsListCall) PageToken(pageToken string) *AdunitsCustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdunitsCustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels which the specified ad unit belongs to.", + // "httpMethod": "GET", + // "id": "adexchangeseller.adunits.customchannels.list", + // "parameterOrder": [ + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client which contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits/{adUnitId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.alerts.list": + +type AlertsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List the alerts for this Ad Exchange account. +func (r *AlertsService) List() *AlertsListCall { + c := &AlertsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Locale sets the optional parameter "locale": The locale to use for +// translating alert messages. The account locale will be used if this +// is not supplied. The AdSense default (English) will be used if the +// supplied locale is invalid or unsupported. +func (c *AlertsListCall) Locale(locale string) *AlertsListCall { + c.opt_["locale"] = locale + return c +} + +func (c *AlertsListCall) Do() (*Alerts, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "alerts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Alerts) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the alerts for this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.alerts.list", + // "parameters": { + // "locale": { + // "description": "The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "alerts", + // "response": { + // "$ref": "Alerts" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.customchannels.get": + +type CustomchannelsGetCall struct { + s *Service + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// Get: Get the specified custom channel from the specified ad client. +func (r *CustomchannelsService) Get(adClientId string, customChannelId string) *CustomchannelsGetCall { + c := &CustomchannelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +func (c *CustomchannelsGetCall) Do() (*CustomChannel, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the specified custom channel from the specified ad client.", + // "httpMethod": "GET", + // "id": "adexchangeseller.customchannels.get", + // "parameterOrder": [ + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels/{customChannelId}", + // "response": { + // "$ref": "CustomChannel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.customchannels.list": + +type CustomchannelsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all custom channels in the specified ad client for this Ad +// Exchange account. +func (r *CustomchannelsService) List(adClientId string) *CustomchannelsListCall { + c := &CustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *CustomchannelsListCall) MaxResults(maxResults int64) *CustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *CustomchannelsListCall) PageToken(pageToken string) *CustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels in the specified ad client for this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.customchannels.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.customchannels.adunits.list": + +type CustomchannelsAdunitsListCall struct { + s *Service + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified custom channel. +func (r *CustomchannelsAdunitsService) List(adClientId string, customChannelId string) *CustomchannelsAdunitsListCall { + c := &CustomchannelsAdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *CustomchannelsAdunitsListCall) IncludeInactive(includeInactive bool) *CustomchannelsAdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *CustomchannelsAdunitsListCall) MaxResults(maxResults int64) *CustomchannelsAdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *CustomchannelsAdunitsListCall) PageToken(pageToken string) *CustomchannelsAdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CustomchannelsAdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified custom channel.", + // "httpMethod": "GET", + // "id": "adexchangeseller.customchannels.adunits.list", + // "parameterOrder": [ + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels/{customChannelId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.metadata.dimensions.list": + +type MetadataDimensionsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List the metadata for the dimensions available to this +// AdExchange account. +func (r *MetadataDimensionsService) List() *MetadataDimensionsListCall { + c := &MetadataDimensionsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *MetadataDimensionsListCall) Do() (*Metadata, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/dimensions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Metadata) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the metadata for the dimensions available to this AdExchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.metadata.dimensions.list", + // "path": "metadata/dimensions", + // "response": { + // "$ref": "Metadata" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.metadata.metrics.list": + +type MetadataMetricsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List the metadata for the metrics available to this AdExchange +// account. +func (r *MetadataMetricsService) List() *MetadataMetricsListCall { + c := &MetadataMetricsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *MetadataMetricsListCall) Do() (*Metadata, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/metrics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Metadata) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the metadata for the metrics available to this AdExchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.metadata.metrics.list", + // "path": "metadata/metrics", + // "response": { + // "$ref": "Metadata" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.preferreddeals.get": + +type PreferreddealsGetCall struct { + s *Service + dealId string + opt_ map[string]interface{} +} + +// Get: Get information about the selected Ad Exchange Preferred Deal. +func (r *PreferreddealsService) Get(dealId string) *PreferreddealsGetCall { + c := &PreferreddealsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.dealId = dealId + return c +} + +func (c *PreferreddealsGetCall) Do() (*PreferredDeal, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "preferreddeals/{dealId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{dealId}", url.QueryEscape(c.dealId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PreferredDeal) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get information about the selected Ad Exchange Preferred Deal.", + // "httpMethod": "GET", + // "id": "adexchangeseller.preferreddeals.get", + // "parameterOrder": [ + // "dealId" + // ], + // "parameters": { + // "dealId": { + // "description": "Preferred deal to get information about.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "preferreddeals/{dealId}", + // "response": { + // "$ref": "PreferredDeal" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.preferreddeals.list": + +type PreferreddealsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List the preferred deals for this Ad Exchange account. +func (r *PreferreddealsService) List() *PreferreddealsListCall { + c := &PreferreddealsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *PreferreddealsListCall) Do() (*PreferredDeals, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "preferreddeals") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PreferredDeals) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the preferred deals for this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.preferreddeals.list", + // "path": "preferreddeals", + // "response": { + // "$ref": "PreferredDeals" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.reports.generate": + +type ReportsGenerateCall struct { + s *Service + startDate string + endDate string + opt_ map[string]interface{} +} + +// Generate: 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. +func (r *ReportsService) Generate(startDate string, endDate string) *ReportsGenerateCall { + c := &ReportsGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.startDate = startDate + c.endDate = endDate + return c +} + +// Dimension sets the optional parameter "dimension": Dimensions to base +// the report on. +func (c *ReportsGenerateCall) Dimension(dimension string) *ReportsGenerateCall { + c.opt_["dimension"] = dimension + return c +} + +// Filter sets the optional parameter "filter": Filters to be run on the +// report. +func (c *ReportsGenerateCall) Filter(filter string) *ReportsGenerateCall { + c.opt_["filter"] = filter + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *ReportsGenerateCall) Locale(locale string) *ReportsGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *ReportsGenerateCall) MaxResults(maxResults int64) *ReportsGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Metric sets the optional parameter "metric": Numeric columns to +// include in the report. +func (c *ReportsGenerateCall) Metric(metric string) *ReportsGenerateCall { + c.opt_["metric"] = metric + return c +} + +// Sort sets the optional parameter "sort": 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. +func (c *ReportsGenerateCall) Sort(sort string) *ReportsGenerateCall { + c.opt_["sort"] = sort + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *ReportsGenerateCall) StartIndex(startIndex int64) *ReportsGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *ReportsGenerateCall) Do() (*Report, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("endDate", fmt.Sprintf("%v", c.endDate)) + params.Set("startDate", fmt.Sprintf("%v", c.startDate)) + if v, ok := c.opt_["dimension"]; ok { + params.Set("dimension", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["metric"]; ok { + params.Set("metric", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "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.", + // "httpMethod": "GET", + // "id": "adexchangeseller.reports.generate", + // "parameterOrder": [ + // "startDate", + // "endDate" + // ], + // "parameters": { + // "dimension": { + // "description": "Dimensions to base the report on.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "endDate": { + // "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)", + // "required": true, + // "type": "string" + // }, + // "filter": { + // "description": "Filters to be run on the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+(==|=@).+", + // "repeated": true, + // "type": "string" + // }, + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "uint32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "metric": { + // "description": "Numeric columns to include in the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "sort": { + // "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.", + // "location": "query", + // "pattern": "(\\+|-)?[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "startDate": { + // "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "uint32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "reports", + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "adexchangeseller.reports.saved.generate": + +type ReportsSavedGenerateCall struct { + s *Service + savedReportId string + opt_ map[string]interface{} +} + +// Generate: Generate an Ad Exchange report based on the saved report ID +// sent in the query parameters. +func (r *ReportsSavedService) Generate(savedReportId string) *ReportsSavedGenerateCall { + c := &ReportsSavedGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.savedReportId = savedReportId + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *ReportsSavedGenerateCall) Locale(locale string) *ReportsSavedGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *ReportsSavedGenerateCall) MaxResults(maxResults int64) *ReportsSavedGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *ReportsSavedGenerateCall) StartIndex(startIndex int64) *ReportsSavedGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *ReportsSavedGenerateCall) Do() (*Report, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{savedReportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{savedReportId}", url.QueryEscape(c.savedReportId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an Ad Exchange report based on the saved report ID sent in the query parameters.", + // "httpMethod": "GET", + // "id": "adexchangeseller.reports.saved.generate", + // "parameterOrder": [ + // "savedReportId" + // ], + // "parameters": { + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "savedReportId": { + // "description": "The saved report to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "reports/{savedReportId}", + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.reports.saved.list": + +type ReportsSavedListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all saved reports in this Ad Exchange account. +func (r *ReportsSavedService) List() *ReportsSavedListCall { + c := &ReportsSavedListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of saved reports to include in the response, used for paging. +func (c *ReportsSavedListCall) MaxResults(maxResults int64) *ReportsSavedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *ReportsSavedListCall) PageToken(pageToken string) *ReportsSavedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ReportsSavedListCall) Do() (*SavedReports, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/saved") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedReports) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all saved reports in this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.reports.saved.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of saved reports to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "reports/saved", + // "response": { + // "$ref": "SavedReports" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.urlchannels.list": + +type UrlchannelsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all URL channels in the specified ad client for this Ad +// Exchange account. +func (r *UrlchannelsService) List(adClientId string) *UrlchannelsListCall { + c := &UrlchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of URL channels to include in the response, used for paging. +func (c *UrlchannelsListCall) MaxResults(maxResults int64) *UrlchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *UrlchannelsListCall) PageToken(pageToken string) *UrlchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *UrlchannelsListCall) Do() (*UrlChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UrlChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all URL channels in the specified ad client for this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.urlchannels.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list URL channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of URL channels to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/urlchannels", + // "response": { + // "$ref": "UrlChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adexchangeseller/v1/adexchangeseller-api.json b/third_party/src/code.google.com/p/google-api-go-client/adexchangeseller/v1/adexchangeseller-api.json new file mode 100644 index 0000000000000..cae061ea7745b --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adexchangeseller/v1/adexchangeseller-api.json @@ -0,0 +1,917 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/k4EGd11ZUVmhrZoqHDxlI_JyIAo\"", + "discoveryVersion": "v1", + "id": "adexchangeseller:v1", + "name": "adexchangeseller", + "canonicalName": "Ad Exchange Seller", + "version": "v1", + "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": "http://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "http://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" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adexchangeseller/v1/adexchangeseller-gen.go b/third_party/src/code.google.com/p/google-api-go-client/adexchangeseller/v1/adexchangeseller-gen.go new file mode 100644 index 0000000000000..8cd8694912bb0 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adexchangeseller/v1/adexchangeseller-gen.go @@ -0,0 +1,1609 @@ +// Package adexchangeseller provides access to the Ad Exchange Seller API. +// +// See https://developers.google.com/ad-exchange/seller-rest/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/adexchangeseller/v1" +// ... +// adexchangesellerService, err := adexchangeseller.New(oauthHttpClient) +package adexchangeseller + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "adexchangeseller:v1" +const apiName = "adexchangeseller" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/adexchangeseller/v1/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Ad Exchange data + AdexchangeSellerScope = "https://www.googleapis.com/auth/adexchange.seller" + + // View your Ad Exchange data + AdexchangeSellerReadonlyScope = "https://www.googleapis.com/auth/adexchange.seller.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.Adclients = NewAdclientsService(s) + s.Adunits = NewAdunitsService(s) + s.Customchannels = NewCustomchannelsService(s) + s.Reports = NewReportsService(s) + s.Urlchannels = NewUrlchannelsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Adclients *AdclientsService + + Adunits *AdunitsService + + Customchannels *CustomchannelsService + + Reports *ReportsService + + Urlchannels *UrlchannelsService +} + +func NewAdclientsService(s *Service) *AdclientsService { + rs := &AdclientsService{s: s} + return rs +} + +type AdclientsService struct { + s *Service +} + +func NewAdunitsService(s *Service) *AdunitsService { + rs := &AdunitsService{s: s} + rs.Customchannels = NewAdunitsCustomchannelsService(s) + return rs +} + +type AdunitsService struct { + s *Service + + Customchannels *AdunitsCustomchannelsService +} + +func NewAdunitsCustomchannelsService(s *Service) *AdunitsCustomchannelsService { + rs := &AdunitsCustomchannelsService{s: s} + return rs +} + +type AdunitsCustomchannelsService struct { + s *Service +} + +func NewCustomchannelsService(s *Service) *CustomchannelsService { + rs := &CustomchannelsService{s: s} + rs.Adunits = NewCustomchannelsAdunitsService(s) + return rs +} + +type CustomchannelsService struct { + s *Service + + Adunits *CustomchannelsAdunitsService +} + +func NewCustomchannelsAdunitsService(s *Service) *CustomchannelsAdunitsService { + rs := &CustomchannelsAdunitsService{s: s} + return rs +} + +type CustomchannelsAdunitsService struct { + s *Service +} + +func NewReportsService(s *Service) *ReportsService { + rs := &ReportsService{s: s} + rs.Saved = NewReportsSavedService(s) + return rs +} + +type ReportsService struct { + s *Service + + Saved *ReportsSavedService +} + +func NewReportsSavedService(s *Service) *ReportsSavedService { + rs := &ReportsSavedService{s: s} + return rs +} + +type ReportsSavedService struct { + s *Service +} + +func NewUrlchannelsService(s *Service) *UrlchannelsService { + rs := &UrlchannelsService{s: s} + return rs +} + +type UrlchannelsService struct { + s *Service +} + +type AdClient struct { + // ArcOptIn: Whether this ad client is opted in to ARC. + ArcOptIn bool `json:"arcOptIn,omitempty"` + + // Id: Unique identifier of this ad client. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case + // adexchangeseller#adClient. + Kind string `json:"kind,omitempty"` + + // ProductCode: This ad client's product code, which corresponds to the + // PRODUCT_CODE report dimension. + ProductCode string `json:"productCode,omitempty"` + + // SupportsReporting: Whether this ad client supports being reported on. + SupportsReporting bool `json:"supportsReporting,omitempty"` +} + +type AdClients struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The ad clients returned in this list response. + Items []*AdClient `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adexchangeseller#adClients. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad clients. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AdUnit struct { + // Code: Identity code of this ad unit, not necessarily unique across ad + // clients. + Code string `json:"code,omitempty"` + + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adexchangeseller#adUnit. + Kind string `json:"kind,omitempty"` + + // Name: Name of this ad unit. + Name string `json:"name,omitempty"` + + // Status: Status of this ad unit. Possible values are: + // NEW: Indicates + // that the ad unit was created within the last seven days and does not + // yet have any activity associated with it. + // + // ACTIVE: Indicates that + // there has been activity on this ad unit in the last seven + // days. + // + // INACTIVE: Indicates that there has been no activity on this ad + // unit in the last seven days. + Status string `json:"status,omitempty"` +} + +type AdUnits struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The ad units returned in this list response. + Items []*AdUnit `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adexchangeseller#adUnits. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad units. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type CustomChannel struct { + // Code: Code of this custom channel, not necessarily unique across ad + // clients. + Code string `json:"code,omitempty"` + + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case + // adexchangeseller#customChannel. + Kind string `json:"kind,omitempty"` + + // Name: Name of this custom channel. + Name string `json:"name,omitempty"` + + // TargetingInfo: The targeting information of this custom channel, if + // activated. + TargetingInfo *CustomChannelTargetingInfo `json:"targetingInfo,omitempty"` +} + +type CustomChannelTargetingInfo struct { + // AdsAppearOn: The name used to describe this channel externally. + AdsAppearOn string `json:"adsAppearOn,omitempty"` + + // Description: The external description of the channel. + Description string `json:"description,omitempty"` + + // Location: 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. + Location string `json:"location,omitempty"` + + // SiteLanguage: The language of the sites ads will be displayed on. + SiteLanguage string `json:"siteLanguage,omitempty"` +} + +type CustomChannels struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The custom channels returned in this list response. + Items []*CustomChannel `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case + // adexchangeseller#customChannels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through custom + // channels. To retrieve the next page of results, set the next + // request's "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Report struct { + // Averages: The averages of the report. This is the same length as any + // other row in the report; cells corresponding to dimension columns are + // empty. + Averages []string `json:"averages,omitempty"` + + // Headers: 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. + Headers []*ReportHeaders `json:"headers,omitempty"` + + // Kind: Kind this is, in this case adexchangeseller#report. + Kind string `json:"kind,omitempty"` + + // Rows: 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. + Rows [][]string `json:"rows,omitempty"` + + // TotalMatchedRows: 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. + TotalMatchedRows int64 `json:"totalMatchedRows,omitempty,string"` + + // Totals: The totals of the report. This is the same length as any + // other row in the report; cells corresponding to dimension columns are + // empty. + Totals []string `json:"totals,omitempty"` + + // Warnings: Any warnings associated with generation of the report. + Warnings []string `json:"warnings,omitempty"` +} + +type ReportHeaders struct { + // Currency: The currency of this column. Only present if the header + // type is METRIC_CURRENCY. + Currency string `json:"currency,omitempty"` + + // Name: The name of the header. + Name string `json:"name,omitempty"` + + // Type: The type of the header; one of DIMENSION, METRIC_TALLY, + // METRIC_RATIO, or METRIC_CURRENCY. + Type string `json:"type,omitempty"` +} + +type SavedReport struct { + // Id: Unique identifier of this saved report. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case + // adexchangeseller#savedReport. + Kind string `json:"kind,omitempty"` + + // Name: This saved report's name. + Name string `json:"name,omitempty"` +} + +type SavedReports struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The saved reports returned in this list response. + Items []*SavedReport `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case + // adexchangeseller#savedReports. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through saved reports. + // To retrieve the next page of results, set the next request's + // "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type UrlChannel struct { + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case + // adexchangeseller#urlChannel. + Kind string `json:"kind,omitempty"` + + // UrlPattern: URL Pattern of this URL channel. Does not include + // "http://" or "https://". Example: www.example.com/home + UrlPattern string `json:"urlPattern,omitempty"` +} + +type UrlChannels struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The URL channels returned in this list response. + Items []*UrlChannel `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case + // adexchangeseller#urlChannels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through URL channels. + // To retrieve the next page of results, set the next request's + // "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +// method id "adexchangeseller.adclients.list": + +type AdclientsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all ad clients in this Ad Exchange account. +func (r *AdclientsService) List() *AdclientsListCall { + c := &AdclientsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad clients to include in the response, used for paging. +func (c *AdclientsListCall) MaxResults(maxResults int64) *AdclientsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdclientsListCall) PageToken(pageToken string) *AdclientsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdclientsListCall) Do() (*AdClients, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdClients) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad clients in this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.adclients.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of ad clients to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "adclients", + // "response": { + // "$ref": "AdClients" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.adunits.get": + +type AdunitsGetCall struct { + s *Service + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// Get: Gets the specified ad unit in the specified ad client. +func (r *AdunitsService) Get(adClientId string, adUnitId string) *AdunitsGetCall { + c := &AdunitsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +func (c *AdunitsGetCall) Do() (*AdUnit, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified ad unit in the specified ad client.", + // "httpMethod": "GET", + // "id": "adexchangeseller.adunits.get", + // "parameterOrder": [ + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to get the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits/{adUnitId}", + // "response": { + // "$ref": "AdUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.adunits.list": + +type AdunitsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified ad client for this Ad +// Exchange account. +func (r *AdunitsService) List(adClientId string) *AdunitsListCall { + c := &AdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *AdunitsListCall) IncludeInactive(includeInactive bool) *AdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *AdunitsListCall) MaxResults(maxResults int64) *AdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdunitsListCall) PageToken(pageToken string) *AdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified ad client for this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.adunits.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.adunits.customchannels.list": + +type AdunitsCustomchannelsListCall struct { + s *Service + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// List: List all custom channels which the specified ad unit belongs +// to. +func (r *AdunitsCustomchannelsService) List(adClientId string, adUnitId string) *AdunitsCustomchannelsListCall { + c := &AdunitsCustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *AdunitsCustomchannelsListCall) MaxResults(maxResults int64) *AdunitsCustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdunitsCustomchannelsListCall) PageToken(pageToken string) *AdunitsCustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdunitsCustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels which the specified ad unit belongs to.", + // "httpMethod": "GET", + // "id": "adexchangeseller.adunits.customchannels.list", + // "parameterOrder": [ + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client which contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits/{adUnitId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.customchannels.get": + +type CustomchannelsGetCall struct { + s *Service + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// Get: Get the specified custom channel from the specified ad client. +func (r *CustomchannelsService) Get(adClientId string, customChannelId string) *CustomchannelsGetCall { + c := &CustomchannelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +func (c *CustomchannelsGetCall) Do() (*CustomChannel, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the specified custom channel from the specified ad client.", + // "httpMethod": "GET", + // "id": "adexchangeseller.customchannels.get", + // "parameterOrder": [ + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels/{customChannelId}", + // "response": { + // "$ref": "CustomChannel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.customchannels.list": + +type CustomchannelsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all custom channels in the specified ad client for this Ad +// Exchange account. +func (r *CustomchannelsService) List(adClientId string) *CustomchannelsListCall { + c := &CustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *CustomchannelsListCall) MaxResults(maxResults int64) *CustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *CustomchannelsListCall) PageToken(pageToken string) *CustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels in the specified ad client for this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.customchannels.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.customchannels.adunits.list": + +type CustomchannelsAdunitsListCall struct { + s *Service + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified custom channel. +func (r *CustomchannelsAdunitsService) List(adClientId string, customChannelId string) *CustomchannelsAdunitsListCall { + c := &CustomchannelsAdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *CustomchannelsAdunitsListCall) IncludeInactive(includeInactive bool) *CustomchannelsAdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *CustomchannelsAdunitsListCall) MaxResults(maxResults int64) *CustomchannelsAdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *CustomchannelsAdunitsListCall) PageToken(pageToken string) *CustomchannelsAdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CustomchannelsAdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified custom channel.", + // "httpMethod": "GET", + // "id": "adexchangeseller.customchannels.adunits.list", + // "parameterOrder": [ + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels/{customChannelId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.reports.generate": + +type ReportsGenerateCall struct { + s *Service + startDate string + endDate string + opt_ map[string]interface{} +} + +// Generate: 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. +func (r *ReportsService) Generate(startDate string, endDate string) *ReportsGenerateCall { + c := &ReportsGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.startDate = startDate + c.endDate = endDate + return c +} + +// Dimension sets the optional parameter "dimension": Dimensions to base +// the report on. +func (c *ReportsGenerateCall) Dimension(dimension string) *ReportsGenerateCall { + c.opt_["dimension"] = dimension + return c +} + +// Filter sets the optional parameter "filter": Filters to be run on the +// report. +func (c *ReportsGenerateCall) Filter(filter string) *ReportsGenerateCall { + c.opt_["filter"] = filter + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *ReportsGenerateCall) Locale(locale string) *ReportsGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *ReportsGenerateCall) MaxResults(maxResults int64) *ReportsGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Metric sets the optional parameter "metric": Numeric columns to +// include in the report. +func (c *ReportsGenerateCall) Metric(metric string) *ReportsGenerateCall { + c.opt_["metric"] = metric + return c +} + +// Sort sets the optional parameter "sort": 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. +func (c *ReportsGenerateCall) Sort(sort string) *ReportsGenerateCall { + c.opt_["sort"] = sort + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *ReportsGenerateCall) StartIndex(startIndex int64) *ReportsGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *ReportsGenerateCall) Do() (*Report, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("endDate", fmt.Sprintf("%v", c.endDate)) + params.Set("startDate", fmt.Sprintf("%v", c.startDate)) + if v, ok := c.opt_["dimension"]; ok { + params.Set("dimension", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["metric"]; ok { + params.Set("metric", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "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.", + // "httpMethod": "GET", + // "id": "adexchangeseller.reports.generate", + // "parameterOrder": [ + // "startDate", + // "endDate" + // ], + // "parameters": { + // "dimension": { + // "description": "Dimensions to base the report on.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "endDate": { + // "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)", + // "required": true, + // "type": "string" + // }, + // "filter": { + // "description": "Filters to be run on the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+(==|=@).+", + // "repeated": true, + // "type": "string" + // }, + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "uint32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "metric": { + // "description": "Numeric columns to include in the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "sort": { + // "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.", + // "location": "query", + // "pattern": "(\\+|-)?[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "startDate": { + // "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "uint32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "reports", + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "adexchangeseller.reports.saved.generate": + +type ReportsSavedGenerateCall struct { + s *Service + savedReportId string + opt_ map[string]interface{} +} + +// Generate: Generate an Ad Exchange report based on the saved report ID +// sent in the query parameters. +func (r *ReportsSavedService) Generate(savedReportId string) *ReportsSavedGenerateCall { + c := &ReportsSavedGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.savedReportId = savedReportId + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *ReportsSavedGenerateCall) Locale(locale string) *ReportsSavedGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *ReportsSavedGenerateCall) MaxResults(maxResults int64) *ReportsSavedGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *ReportsSavedGenerateCall) StartIndex(startIndex int64) *ReportsSavedGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *ReportsSavedGenerateCall) Do() (*Report, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{savedReportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{savedReportId}", url.QueryEscape(c.savedReportId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an Ad Exchange report based on the saved report ID sent in the query parameters.", + // "httpMethod": "GET", + // "id": "adexchangeseller.reports.saved.generate", + // "parameterOrder": [ + // "savedReportId" + // ], + // "parameters": { + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "savedReportId": { + // "description": "The saved report to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "reports/{savedReportId}", + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.reports.saved.list": + +type ReportsSavedListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all saved reports in this Ad Exchange account. +func (r *ReportsSavedService) List() *ReportsSavedListCall { + c := &ReportsSavedListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of saved reports to include in the response, used for paging. +func (c *ReportsSavedListCall) MaxResults(maxResults int64) *ReportsSavedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *ReportsSavedListCall) PageToken(pageToken string) *ReportsSavedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ReportsSavedListCall) Do() (*SavedReports, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/saved") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedReports) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all saved reports in this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.reports.saved.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of saved reports to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "reports/saved", + // "response": { + // "$ref": "SavedReports" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.urlchannels.list": + +type UrlchannelsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all URL channels in the specified ad client for this Ad +// Exchange account. +func (r *UrlchannelsService) List(adClientId string) *UrlchannelsListCall { + c := &UrlchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of URL channels to include in the response, used for paging. +func (c *UrlchannelsListCall) MaxResults(maxResults int64) *UrlchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *UrlchannelsListCall) PageToken(pageToken string) *UrlchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *UrlchannelsListCall) Do() (*UrlChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UrlChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all URL channels in the specified ad client for this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.urlchannels.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list URL channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of URL channels to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/urlchannels", + // "response": { + // "$ref": "UrlChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/admin/directory_v1/admin-api.json b/third_party/src/code.google.com/p/google-api-go-client/admin/directory_v1/admin-api.json new file mode 100644 index 0000000000000..27b65110a99e0 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/admin/directory_v1/admin-api.json @@ -0,0 +1,3602 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/xqSX7-n8LugACXqRoz62D83GEuE\"", + "discoveryVersion": "v1", + "id": "admin:directory_v1", + "name": "admin", + "canonicalName": "directory", + "version": "directory_v1", + "title": "Admin Directory API", + "description": "The Admin SDK Directory API lets you view and manage enterprise resources such as users and groups, administrative notifications, security features, and more.", + "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/directory/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/admin/directory/v1/", + "basePath": "/admin/directory/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "admin/directory/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.directory.device.chromeos": { + "description": "View and manage your Chrome OS devices' metadata" + }, + "https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly": { + "description": "View your Chrome OS devices' metadata" + }, + "https://www.googleapis.com/auth/admin.directory.device.mobile": { + "description": "View and manage your mobile devices' metadata" + }, + "https://www.googleapis.com/auth/admin.directory.device.mobile.action": { + "description": "Manage your mobile devices by performing administrative tasks" + }, + "https://www.googleapis.com/auth/admin.directory.device.mobile.readonly": { + "description": "View your mobile devices' metadata" + }, + "https://www.googleapis.com/auth/admin.directory.group": { + "description": "View and manage the provisioning of groups on your domain" + }, + "https://www.googleapis.com/auth/admin.directory.group.member": { + "description": "View and manage group subscriptions on your domain" + }, + "https://www.googleapis.com/auth/admin.directory.group.member.readonly": { + "description": "View group subscriptions on your domain" + }, + "https://www.googleapis.com/auth/admin.directory.group.readonly": { + "description": "View groups on your domain" + }, + "https://www.googleapis.com/auth/admin.directory.notifications": { + "description": "View and manage notifications received on your domain" + }, + "https://www.googleapis.com/auth/admin.directory.orgunit": { + "description": "View and manage organization units on your domain" + }, + "https://www.googleapis.com/auth/admin.directory.orgunit.readonly": { + "description": "View organization units on your domain" + }, + "https://www.googleapis.com/auth/admin.directory.user": { + "description": "View and manage the provisioning of users on your domain" + }, + "https://www.googleapis.com/auth/admin.directory.user.alias": { + "description": "View and manage user aliases on your domain" + }, + "https://www.googleapis.com/auth/admin.directory.user.alias.readonly": { + "description": "View user aliases on your domain" + }, + "https://www.googleapis.com/auth/admin.directory.user.readonly": { + "description": "View users on your domain" + }, + "https://www.googleapis.com/auth/admin.directory.user.security": { + "description": "Manage data access permissions for users on your domain" + } + } + } + }, + "schemas": { + "Alias": { + "id": "Alias", + "type": "object", + "description": "JSON template for Alias object in Apps Directory API.", + "properties": { + "alias": { + "type": "string", + "description": "A alias email" + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "id": { + "type": "string", + "description": "Unique id of the group (Read-only) Unique id of the user (Read-only)" + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#alias" + }, + "primaryEmail": { + "type": "string", + "description": "Group's primary email (Read-only) User's primary email (Read-only)" + } + } + }, + "Aliases": { + "id": "Aliases", + "type": "object", + "description": "JSON response template to list aliases in Apps Directory API.", + "properties": { + "aliases": { + "type": "array", + "description": "List of alias objects.", + "items": { + "$ref": "Alias" + } + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#aliases" + } + } + }, + "Asp": { + "id": "Asp", + "type": "object", + "description": "The template that returns individual ASP (Access Code) data.", + "properties": { + "codeId": { + "type": "integer", + "description": "The unique ID of the ASP.", + "format": "int32" + }, + "creationTime": { + "type": "string", + "description": "The time when the ASP was created. Expressed in Unix time format.", + "format": "int64" + }, + "etag": { + "type": "string", + "description": "ETag of the ASP." + }, + "kind": { + "type": "string", + "description": "The type of the API resource. This is always admin#directory#asp.", + "default": "admin#directory#asp" + }, + "lastTimeUsed": { + "type": "string", + "description": "The time when the ASP was last used. Expressed in Unix time format.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "The name of the application that the user, represented by their userId, entered when the ASP was created." + }, + "userKey": { + "type": "string", + "description": "The unique ID of the user who issued the ASP." + } + } + }, + "Asps": { + "id": "Asps", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "items": { + "type": "array", + "description": "A list of ASP resources.", + "items": { + "$ref": "Asp" + } + }, + "kind": { + "type": "string", + "description": "The type of the API resource. This is always admin#directory#aspList.", + "default": "admin#directory#aspList" + } + } + }, + "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." + } + } + }, + "ChromeOsDevice": { + "id": "ChromeOsDevice", + "type": "object", + "description": "JSON template for Chrome Os Device resource in Apps Directory API.", + "properties": { + "annotatedLocation": { + "type": "string", + "description": "Address or location of the device as noted by the administrator" + }, + "annotatedUser": { + "type": "string", + "description": "User of the device" + }, + "bootMode": { + "type": "string", + "description": "Chromebook boot mode (Read-only)" + }, + "deviceId": { + "type": "string", + "description": "Unique identifier of Chrome OS Device (Read-only)" + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "firmwareVersion": { + "type": "string", + "description": "Chromebook firmware version (Read-only)" + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#chromeosdevice" + }, + "lastEnrollmentTime": { + "type": "string", + "description": "Date and time the device was last enrolled (Read-only)", + "format": "date-time" + }, + "lastSync": { + "type": "string", + "description": "Date and time the device was last synchronized with the policy settings in the Google Apps administrator control panel (Read-only)", + "format": "date-time" + }, + "macAddress": { + "type": "string", + "description": "Chromebook Mac Address (Read-only)" + }, + "meid": { + "type": "string", + "description": "Mobile Equipment identifier for the 3G mobile card in the Chromebook (Read-only)" + }, + "model": { + "type": "string", + "description": "Chromebook Model (Read-only)" + }, + "notes": { + "type": "string", + "description": "Notes added by the administrator" + }, + "orderNumber": { + "type": "string", + "description": "Chromebook order number (Read-only)" + }, + "orgUnitPath": { + "type": "string", + "description": "OrgUnit of the device" + }, + "osVersion": { + "type": "string", + "description": "Chromebook Os Version (Read-only)" + }, + "platformVersion": { + "type": "string", + "description": "Chromebook platform version (Read-only)" + }, + "serialNumber": { + "type": "string", + "description": "Chromebook serial number (Read-only)" + }, + "status": { + "type": "string", + "description": "status of the device (Read-only)" + }, + "supportEndDate": { + "type": "string", + "description": "Final date the device will be supported (Read-only)", + "format": "date-time" + }, + "willAutoRenew": { + "type": "boolean", + "description": "Will Chromebook auto reniew after support end date (Read-only)" + } + } + }, + "ChromeOsDevices": { + "id": "ChromeOsDevices", + "type": "object", + "description": "JSON response template for List Chrome OS Devices operation in Apps Directory API.", + "properties": { + "chromeosdevices": { + "type": "array", + "description": "List of Chrome OS Device objects.", + "items": { + "$ref": "ChromeOsDevice" + } + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#chromeosdevices" + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access next page of this result." + } + } + }, + "Group": { + "id": "Group", + "type": "object", + "description": "JSON template for Group resource in Apps Directory API.", + "properties": { + "adminCreated": { + "type": "boolean", + "description": "Is the group created by admin (Read-only) *" + }, + "aliases": { + "type": "array", + "description": "List of aliases (Read-only)", + "items": { + "type": "string" + } + }, + "description": { + "type": "string", + "description": "Description of the group" + }, + "directMembersCount": { + "type": "string", + "description": "Group direct members count", + "format": "int64" + }, + "email": { + "type": "string", + "description": "Email of Group", + "annotations": { + "required": [ + "directory.groups.insert" + ] + } + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier of Group (Read-only)" + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#group" + }, + "name": { + "type": "string", + "description": "Group name" + }, + "nonEditableAliases": { + "type": "array", + "description": "List of non editable aliases (Read-only)", + "items": { + "type": "string" + } + } + } + }, + "Groups": { + "id": "Groups", + "type": "object", + "description": "JSON response template for List Groups operation in Apps Directory API.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "groups": { + "type": "array", + "description": "List of group objects.", + "items": { + "$ref": "Group" + } + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#groups" + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access next page of this result." + } + } + }, + "Member": { + "id": "Member", + "type": "object", + "description": "JSON template for Member resource in Apps Directory API.", + "properties": { + "email": { + "type": "string", + "description": "Email of member (Read-only)" + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier of customer member (Read-only) Unique identifier of group (Read-only) Unique identifier of member (Read-only)" + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#member" + }, + "role": { + "type": "string", + "description": "Role of member" + }, + "type": { + "type": "string", + "description": "Type of member (Immutable)" + } + } + }, + "Members": { + "id": "Members", + "type": "object", + "description": "JSON response template for List Members operation in Apps Directory API.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#members" + }, + "members": { + "type": "array", + "description": "List of member objects.", + "items": { + "$ref": "Member" + } + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access next page of this result." + } + } + }, + "MobileDevice": { + "id": "MobileDevice", + "type": "object", + "description": "JSON template for Mobile Device resource in Apps Directory API.", + "properties": { + "applications": { + "type": "array", + "description": "List of applications installed on Mobile Device", + "items": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Display name of application" + }, + "packageName": { + "type": "string", + "description": "Package name of application" + }, + "permission": { + "type": "array", + "description": "List of Permissions for application", + "items": { + "type": "string" + } + }, + "versionCode": { + "type": "integer", + "description": "Version code of application", + "format": "int32" + }, + "versionName": { + "type": "string", + "description": "Version name of application" + } + } + } + }, + "deviceId": { + "type": "string", + "description": "Mobile Device serial number (Read-only)" + }, + "email": { + "type": "array", + "description": "List of owner user's email addresses (Read-only)", + "items": { + "type": "string" + } + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "firstSync": { + "type": "string", + "description": "Date and time the device was first synchronized with the policy settings in the Google Apps administrator control panel (Read-only)", + "format": "date-time" + }, + "hardwareId": { + "type": "string", + "description": "Mobile Device Hardware Id (Read-only)" + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#mobiledevice" + }, + "lastSync": { + "type": "string", + "description": "Date and time the device was last synchronized with the policy settings in the Google Apps administrator control panel (Read-only)", + "format": "date-time" + }, + "model": { + "type": "string", + "description": "Name of the model of the device" + }, + "name": { + "type": "array", + "description": "List of owner user's names (Read-only)", + "items": { + "type": "string" + } + }, + "os": { + "type": "string", + "description": "Name of the mobile operating system" + }, + "resourceId": { + "type": "string", + "description": "Unique identifier of Mobile Device (Read-only)" + }, + "status": { + "type": "string", + "description": "Status of the device (Read-only)" + }, + "type": { + "type": "string", + "description": "The type of device (Read-only)" + }, + "userAgent": { + "type": "string", + "description": "Mobile Device user agent" + } + } + }, + "MobileDeviceAction": { + "id": "MobileDeviceAction", + "type": "object", + "description": "JSON request template for firing commands on Mobile Device in Apps Directory Devices API.", + "properties": { + "action": { + "type": "string", + "description": "Action to be taken on the Mobile Device", + "annotations": { + "required": [ + "directory.mobiledevices.action" + ] + } + } + } + }, + "MobileDevices": { + "id": "MobileDevices", + "type": "object", + "description": "JSON response template for List Mobile Devices operation in Apps Directory API.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#mobiledevices" + }, + "mobiledevices": { + "type": "array", + "description": "List of Mobile Device objects.", + "items": { + "$ref": "MobileDevice" + } + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access next page of this result." + } + } + }, + "Notification": { + "id": "Notification", + "type": "object", + "description": "Template for a notification resource.", + "properties": { + "body": { + "type": "string", + "description": "Body of the notification (Read-only)" + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "fromAddress": { + "type": "string", + "description": "Address from which the notification is received (Read-only)" + }, + "isUnread": { + "type": "boolean", + "description": "Boolean indicating whether the notification is unread or not." + }, + "kind": { + "type": "string", + "description": "The type of the resource.", + "default": "admin#directory#notification" + }, + "notificationId": { + "type": "string" + }, + "sendTime": { + "type": "string", + "description": "Time at which notification was sent (Read-only)", + "format": "date-time" + }, + "subject": { + "type": "string", + "description": "Subject of the notification (Read-only)" + } + } + }, + "Notifications": { + "id": "Notifications", + "type": "object", + "description": "Template for notifications list response.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "items": { + "type": "array", + "description": "List of notifications in this page.", + "items": { + "$ref": "Notification" + } + }, + "kind": { + "type": "string", + "description": "The type of the resource.", + "default": "admin#directory#notifications" + }, + "nextPageToken": { + "type": "string", + "description": "Token for fetching the next page of notifications." + }, + "unreadNotificationsCount": { + "type": "integer", + "description": "Number of unread notification for the domain.", + "format": "int32" + } + } + }, + "OrgUnit": { + "id": "OrgUnit", + "type": "object", + "description": "JSON template for Org Unit resource in Apps Directory API.", + "properties": { + "blockInheritance": { + "type": "boolean", + "description": "Should block inheritance" + }, + "description": { + "type": "string", + "description": "Description of OrgUnit" + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#orgUnit" + }, + "name": { + "type": "string", + "description": "Name of OrgUnit", + "annotations": { + "required": [ + "directory.orgunits.insert" + ] + } + }, + "orgUnitPath": { + "type": "string", + "description": "Path of OrgUnit" + }, + "parentOrgUnitPath": { + "type": "string", + "description": "Path of parent OrgUnit", + "annotations": { + "required": [ + "directory.orgunits.insert" + ] + } + } + } + }, + "OrgUnits": { + "id": "OrgUnits", + "type": "object", + "description": "JSON response template for List Organization Units operation in Apps Directory API.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#orgUnits" + }, + "organizationUnits": { + "type": "array", + "description": "List of user objects.", + "items": { + "$ref": "OrgUnit" + } + } + } + }, + "Token": { + "id": "Token", + "type": "object", + "description": "JSON template for token resource in Apps Directory API.", + "properties": { + "anonymous": { + "type": "boolean", + "description": "Whether the application is registered with Google. The value is true if the application has an anonymous Client ID." + }, + "clientId": { + "type": "string", + "description": "The Client ID of the application the token is issued to." + }, + "displayText": { + "type": "string", + "description": "The displayable name of the application the token is issued to." + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "The type of the API resource. This is always admin#directory#token.", + "default": "admin#directory#token" + }, + "nativeApp": { + "type": "boolean", + "description": "Whether the token is issued to an installed application. The value is true if the application is installed to a desktop or mobile device." + }, + "scopes": { + "type": "array", + "description": "A list of authorization scopes the application is granted.", + "items": { + "type": "string" + } + }, + "userKey": { + "type": "string", + "description": "The unique ID of the user that issued the token." + } + } + }, + "Tokens": { + "id": "Tokens", + "type": "object", + "description": "JSON response template for List tokens operation in Apps Directory API.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "items": { + "type": "array", + "description": "A list of Token resources.", + "items": { + "$ref": "Token" + } + }, + "kind": { + "type": "string", + "description": "The type of the API resource. This is always admin#directory#tokenList.", + "default": "admin#directory#tokenList" + } + } + }, + "User": { + "id": "User", + "type": "object", + "description": "JSON template for User object in Apps Directory API.", + "properties": { + "addresses": { + "type": "array", + "description": "Addresses of User", + "items": { + "$ref": "UserAddress" + } + }, + "agreedToTerms": { + "type": "boolean", + "description": "Indicates if user has agreed to terms (Read-only)" + }, + "aliases": { + "type": "array", + "description": "List of aliases (Read-only)", + "items": { + "type": "string" + } + }, + "changePasswordAtNextLogin": { + "type": "boolean", + "description": "Boolean indicating if the user should change password in next login" + }, + "creationTime": { + "type": "string", + "description": "User's Google account creation time. (Read-only)", + "format": "date-time" + }, + "customerId": { + "type": "string", + "description": "CustomerId of User (Read-only)" + }, + "deletionTime": { + "type": "string", + "format": "date-time" + }, + "emails": { + "type": "array", + "description": "Emails of User", + "items": { + "$ref": "UserEmail" + } + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "externalIds": { + "type": "array", + "description": "The external Ids of User *", + "items": { + "$ref": "UserExternalId" + } + }, + "hashFunction": { + "type": "string", + "description": "Hash function name for password. Supported are MD5, SHA-1 and crypt" + }, + "id": { + "type": "string", + "description": "Unique identifier of User (Read-only)" + }, + "ims": { + "type": "array", + "description": "User's Instant Messenger", + "items": { + "$ref": "UserIm" + } + }, + "includeInGlobalAddressList": { + "type": "boolean", + "description": "Boolean indicating if user is included in Global Address List" + }, + "ipWhitelisted": { + "type": "boolean", + "description": "Boolean indicating if ip is whitelisted" + }, + "isAdmin": { + "type": "boolean", + "description": "Boolean indicating if the user is admin (Read-only)" + }, + "isDelegatedAdmin": { + "type": "boolean", + "description": "Boolean indicating if the user is delegated admin (Read-only)" + }, + "isMailboxSetup": { + "type": "boolean", + "description": "Is mailbox setup (Read-only)" + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#user" + }, + "lastLoginTime": { + "type": "string", + "description": "User's last login time. (Read-only)", + "format": "date-time" + }, + "name": { + "$ref": "UserName", + "description": "User's name", + "annotations": { + "required": [ + "directory.users.insert" + ] + } + }, + "nonEditableAliases": { + "type": "array", + "description": "List of non editable aliases (Read-only)", + "items": { + "type": "string" + } + }, + "orgUnitPath": { + "type": "string", + "description": "OrgUnit of User" + }, + "organizations": { + "type": "array", + "description": "Organizations of User", + "items": { + "$ref": "UserOrganization" + } + }, + "password": { + "type": "string", + "description": "User's password", + "annotations": { + "required": [ + "directory.users.insert" + ] + } + }, + "phones": { + "type": "array", + "description": "Phone numbers of User", + "items": { + "$ref": "UserPhone" + } + }, + "primaryEmail": { + "type": "string", + "description": "username of User", + "annotations": { + "required": [ + "directory.users.insert" + ] + } + }, + "relations": { + "type": "array", + "description": "The Relations of User *", + "items": { + "$ref": "UserRelation" + } + }, + "suspended": { + "type": "boolean", + "description": "Indicates if user is suspended" + }, + "suspensionReason": { + "type": "string", + "description": "Suspension reason if user is suspended (Read-only)" + }, + "thumbnailPhotoUrl": { + "type": "string", + "description": "Photo Url of the user (Read-only)" + } + } + }, + "UserAddress": { + "id": "UserAddress", + "type": "object", + "description": "JSON template for address.", + "properties": { + "country": { + "type": "string", + "description": "Country." + }, + "countryCode": { + "type": "string", + "description": "Country code." + }, + "customType": { + "type": "string", + "description": "Custom type." + }, + "extendedAddress": { + "type": "string", + "description": "Extended Address." + }, + "formatted": { + "type": "string", + "description": "Formatted address (read-only field)" + }, + "locality": { + "type": "string", + "description": "Locality." + }, + "poBox": { + "type": "string", + "description": "Other parts of address." + }, + "postalCode": { + "type": "string", + "description": "Postal code." + }, + "primary": { + "type": "boolean", + "description": "If this is user's primary address. Only one entry could be marked as primary." + }, + "region": { + "type": "string", + "description": "Region." + }, + "sourceIsStructured": { + "type": "boolean", + "description": "User supplied address was structured. Structured addresses are NOT supported at this time. You might be able to write structured addresses, but any values will eventually be clobbered." + }, + "streetAddress": { + "type": "string", + "description": "Street." + }, + "type": { + "type": "string", + "description": "Each entry can have a type which indicates standard values of that entry. For example address could be of home, work etc. In addition to the standard type, an entry can have a custom type and can take any value. Such type should have the CUSTOM value as type and also have a customType value." + } + } + }, + "UserEmail": { + "id": "UserEmail", + "type": "object", + "description": "JSON template for an email.", + "properties": { + "address": { + "type": "string", + "description": "Email id of the user." + }, + "customType": { + "type": "string", + "description": "Custom Type." + }, + "primary": { + "type": "boolean", + "description": "If this is user's primary email. Only one entry could be marked as primary." + }, + "type": { + "type": "string", + "description": "Each entry can have a type which indicates standard types of that entry. For example email could be of home, work etc. In addition to the standard type, an entry can have a custom type and can take any value Such typess should have the CUSTOM value as type and also have a customType value." + } + } + }, + "UserExternalId": { + "id": "UserExternalId", + "type": "object", + "description": "JSON template for an externalId entry.", + "properties": { + "customType": { + "type": "string", + "description": "Custom type." + }, + "type": { + "type": "string", + "description": "The type of the Id." + }, + "value": { + "type": "string", + "description": "The value of the id." + } + } + }, + "UserIm": { + "id": "UserIm", + "type": "object", + "description": "JSON template for instant messenger of an user.", + "properties": { + "customProtocol": { + "type": "string", + "description": "Custom protocol." + }, + "customType": { + "type": "string", + "description": "Custom type." + }, + "im": { + "type": "string", + "description": "Instant messenger id." + }, + "primary": { + "type": "boolean", + "description": "If this is user's priamry im. Only one entry could be marked as primary." + }, + "protocol": { + "type": "string", + "description": "Protocol used in the instant messenger. It should be one of the values from ImProtocolTypes map. Simalar to type, it can take a CUSTOM value and specify the custom name in customProtocol field." + }, + "type": { + "type": "string", + "description": "Each entry can have a type which indicates standard types of that entry. For example instant messengers could be of home, work etc. In addition to the standard type, an entry can have a custom type and can take any value. Such types should have the CUSTOM value as type and also have a customType value." + } + } + }, + "UserMakeAdmin": { + "id": "UserMakeAdmin", + "type": "object", + "description": "JSON request template for setting/revoking admin status of a user in Apps Directory API.", + "properties": { + "status": { + "type": "boolean", + "description": "Boolean indicating new admin status of the user", + "annotations": { + "required": [ + "directory.users.makeAdmin" + ] + } + } + } + }, + "UserName": { + "id": "UserName", + "type": "object", + "description": "JSON template for name of a user in Apps Directory API.", + "properties": { + "familyName": { + "type": "string", + "description": "Last Name", + "annotations": { + "required": [ + "directory.users.insert" + ] + } + }, + "fullName": { + "type": "string", + "description": "Full Name" + }, + "givenName": { + "type": "string", + "description": "First Name", + "annotations": { + "required": [ + "directory.users.insert" + ] + } + } + } + }, + "UserOrganization": { + "id": "UserOrganization", + "type": "object", + "description": "JSON template for an organization entry.", + "properties": { + "costCenter": { + "type": "string", + "description": "The cost center of the users department." + }, + "customType": { + "type": "string", + "description": "Custom type." + }, + "department": { + "type": "string", + "description": "Department within the organization." + }, + "description": { + "type": "string", + "description": "Description of the organization." + }, + "domain": { + "type": "string", + "description": "The domain to which the organization belongs to." + }, + "location": { + "type": "string", + "description": "Location of the organization. This need not be fully qualified address." + }, + "name": { + "type": "string", + "description": "Name of the organization" + }, + "primary": { + "type": "boolean", + "description": "If it user's primary organization." + }, + "symbol": { + "type": "string", + "description": "Symobol of the organization." + }, + "title": { + "type": "string", + "description": "Title (designation) of the user in the organization." + }, + "type": { + "type": "string", + "description": "Each entry can have a type which indicates standard types of that entry. For example organization could be of school, work etc. In addition to the standard type, an entry can have a custom type and can give it any name. Such types should have the CUSTOM value as type and also have a CustomType value." + } + } + }, + "UserPhone": { + "id": "UserPhone", + "type": "object", + "description": "JSON template for a phone entry.", + "properties": { + "customType": { + "type": "string", + "description": "Custom Type." + }, + "primary": { + "type": "boolean", + "description": "If this is user's primary phone or not." + }, + "type": { + "type": "string", + "description": "Each entry can have a type which indicates standard types of that entry. For example phone could be of home_fax, work, mobile etc. In addition to the standard type, an entry can have a custom type and can give it any name. Such types should have the CUSTOM value as type and also have a customType value." + }, + "value": { + "type": "string", + "description": "Phone number." + } + } + }, + "UserPhoto": { + "id": "UserPhoto", + "type": "object", + "description": "JSON template for Photo object in Apps Directory API.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "height": { + "type": "integer", + "description": "Height in pixels of the photo", + "format": "int32" + }, + "id": { + "type": "string", + "description": "Unique identifier of User (Read-only)" + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#user#photo" + }, + "mimeType": { + "type": "string", + "description": "Mime Type of the photo" + }, + "photoData": { + "type": "string", + "description": "Base64 encoded photo data", + "format": "byte", + "annotations": { + "required": [ + "directory.users.photos.update" + ] + } + }, + "primaryEmail": { + "type": "string", + "description": "Primary email of User (Read-only)" + }, + "width": { + "type": "integer", + "description": "Width in pixels of the photo", + "format": "int32" + } + } + }, + "UserRelation": { + "id": "UserRelation", + "type": "object", + "description": "JSON template for a relation entry.", + "properties": { + "customType": { + "type": "string", + "description": "Custom Type." + }, + "type": { + "type": "string", + "description": "The relation of the user. Some of the possible values are mother, father, sister, brother, manager, assistant, partner." + }, + "value": { + "type": "string", + "description": "The name of the relation." + } + } + }, + "UserUndelete": { + "id": "UserUndelete", + "type": "object", + "description": "JSON request template to undelete a user in Apps Directory API.", + "properties": { + "orgUnitPath": { + "type": "string", + "description": "OrgUnit of User" + } + } + }, + "Users": { + "id": "Users", + "type": "object", + "description": "JSON response template for List Users operation in Apps Directory API.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#users" + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access next page of this result." + }, + "trigger_event": { + "type": "string", + "description": "Event that triggered this response (only used in case of Push Response)" + }, + "users": { + "type": "array", + "description": "List of user objects.", + "items": { + "$ref": "User" + } + } + } + }, + "VerificationCode": { + "id": "VerificationCode", + "type": "object", + "description": "JSON template for verification codes in Apps Directory API.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "The type of the resource. This is always admin#directory#verificationCode.", + "default": "admin#directory#verificationCode" + }, + "userId": { + "type": "string", + "description": "The obfuscated unique ID of the user." + }, + "verificationCode": { + "type": "string", + "description": "A current verification code for the user. Invalidated or used verification codes are not returned as part of the result." + } + } + }, + "VerificationCodes": { + "id": "VerificationCodes", + "type": "object", + "description": "JSON response template for List verification codes operation in Apps Directory API.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "items": { + "type": "array", + "description": "A list of verification code resources.", + "items": { + "$ref": "VerificationCode" + } + }, + "kind": { + "type": "string", + "description": "The type of the resource. This is always admin#directory#verificationCodesList.", + "default": "admin#directory#verificationCodesList" + } + } + } + }, + "resources": { + "asps": { + "methods": { + "delete": { + "id": "directory.asps.delete", + "path": "users/{userKey}/asps/{codeId}", + "httpMethod": "DELETE", + "description": "Delete an ASP issued by a user.", + "parameters": { + "codeId": { + "type": "integer", + "description": "The unique ID of the ASP to be deleted.", + "required": true, + "format": "int32", + "location": "path" + }, + "userKey": { + "type": "string", + "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey", + "codeId" + ], + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user.security" + ] + }, + "get": { + "id": "directory.asps.get", + "path": "users/{userKey}/asps/{codeId}", + "httpMethod": "GET", + "description": "Get information about an ASP issued by a user.", + "parameters": { + "codeId": { + "type": "integer", + "description": "The unique ID of the ASP.", + "required": true, + "format": "int32", + "location": "path" + }, + "userKey": { + "type": "string", + "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey", + "codeId" + ], + "response": { + "$ref": "Asp" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user.security" + ] + }, + "list": { + "id": "directory.asps.list", + "path": "users/{userKey}/asps", + "httpMethod": "GET", + "description": "List the ASPs issued by a user.", + "parameters": { + "userKey": { + "type": "string", + "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "response": { + "$ref": "Asps" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user.security" + ] + } + } + }, + "channels": { + "methods": { + "stop": { + "id": "admin.channels.stop", + "path": "/admin/directory_v1/channels/stop", + "httpMethod": "POST", + "description": "Stop watching resources through this channel", + "request": { + "$ref": "Channel", + "parameterName": "resource" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user", + "https://www.googleapis.com/auth/admin.directory.user.alias", + "https://www.googleapis.com/auth/admin.directory.user.alias.readonly", + "https://www.googleapis.com/auth/admin.directory.user.readonly" + ] + } + } + }, + "chromeosdevices": { + "methods": { + "get": { + "id": "directory.chromeosdevices.get", + "path": "customer/{customerId}/devices/chromeos/{deviceId}", + "httpMethod": "GET", + "description": "Retrieve Chrome OS Device", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + }, + "deviceId": { + "type": "string", + "description": "Immutable id of Chrome OS Device", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "Restrict information returned to a set of selected fields.", + "enum": [ + "BASIC", + "FULL" + ], + "enumDescriptions": [ + "Includes only the basic metadata fields (e.g., deviceId, serialNumber, status, and user)", + "Includes all metadata fields" + ], + "location": "query" + } + }, + "parameterOrder": [ + "customerId", + "deviceId" + ], + "response": { + "$ref": "ChromeOsDevice" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.device.chromeos", + "https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly" + ] + }, + "list": { + "id": "directory.chromeosdevices.list", + "path": "customer/{customerId}/devices/chromeos", + "httpMethod": "GET", + "description": "Retrieve all Chrome OS Devices of a customer (paginated)", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return. Default is 100", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Column to use for sorting results", + "enum": [ + "annotatedLocation", + "annotatedUser", + "lastSync", + "notes", + "serialNumber", + "status", + "supportEndDate" + ], + "enumDescriptions": [ + "Chromebook location as annotated by the administrator.", + "Chromebook user as annotated by administrator.", + "Chromebook last sync.", + "Chromebook notes as annotated by the administrator.", + "Chromebook Serial Number.", + "Chromebook status.", + "Chromebook support end date." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token to specify next page in the list", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Restrict information returned to a set of selected fields.", + "enum": [ + "BASIC", + "FULL" + ], + "enumDescriptions": [ + "Includes only the basic metadata fields (e.g., deviceId, serialNumber, status, and user)", + "Includes all metadata fields" + ], + "location": "query" + }, + "query": { + "type": "string", + "description": "Search string in the format given at http://support.google.com/chromeos/a/bin/answer.py?hl=en&answer=1698333", + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Whether to return results in ascending or descending order. Only of use when orderBy is also used", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "parameterOrder": [ + "customerId" + ], + "response": { + "$ref": "ChromeOsDevices" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.device.chromeos", + "https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly" + ] + }, + "patch": { + "id": "directory.chromeosdevices.patch", + "path": "customer/{customerId}/devices/chromeos/{deviceId}", + "httpMethod": "PATCH", + "description": "Update Chrome OS Device. This method supports patch semantics.", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + }, + "deviceId": { + "type": "string", + "description": "Immutable id of Chrome OS Device", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "Restrict information returned to a set of selected fields.", + "enum": [ + "BASIC", + "FULL" + ], + "enumDescriptions": [ + "Includes only the basic metadata fields (e.g., deviceId, serialNumber, status, and user)", + "Includes all metadata fields" + ], + "location": "query" + } + }, + "parameterOrder": [ + "customerId", + "deviceId" + ], + "request": { + "$ref": "ChromeOsDevice" + }, + "response": { + "$ref": "ChromeOsDevice" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.device.chromeos" + ] + }, + "update": { + "id": "directory.chromeosdevices.update", + "path": "customer/{customerId}/devices/chromeos/{deviceId}", + "httpMethod": "PUT", + "description": "Update Chrome OS Device", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + }, + "deviceId": { + "type": "string", + "description": "Immutable id of Chrome OS Device", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "Restrict information returned to a set of selected fields.", + "enum": [ + "BASIC", + "FULL" + ], + "enumDescriptions": [ + "Includes only the basic metadata fields (e.g., deviceId, serialNumber, status, and user)", + "Includes all metadata fields" + ], + "location": "query" + } + }, + "parameterOrder": [ + "customerId", + "deviceId" + ], + "request": { + "$ref": "ChromeOsDevice" + }, + "response": { + "$ref": "ChromeOsDevice" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.device.chromeos" + ] + } + } + }, + "groups": { + "methods": { + "delete": { + "id": "directory.groups.delete", + "path": "groups/{groupKey}", + "httpMethod": "DELETE", + "description": "Delete Group", + "parameters": { + "groupKey": { + "type": "string", + "description": "Email or immutable Id of the group", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "groupKey" + ], + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.group" + ] + }, + "get": { + "id": "directory.groups.get", + "path": "groups/{groupKey}", + "httpMethod": "GET", + "description": "Retrieve Group", + "parameters": { + "groupKey": { + "type": "string", + "description": "Email or immutable Id of the group", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "groupKey" + ], + "response": { + "$ref": "Group" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.group", + "https://www.googleapis.com/auth/admin.directory.group.readonly" + ] + }, + "insert": { + "id": "directory.groups.insert", + "path": "groups", + "httpMethod": "POST", + "description": "Create Group", + "request": { + "$ref": "Group" + }, + "response": { + "$ref": "Group" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.group" + ] + }, + "list": { + "id": "directory.groups.list", + "path": "groups", + "httpMethod": "GET", + "description": "Retrieve all groups in a domain (paginated)", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable id of the Google Apps account. In case of multi-domain, to fetch all groups for a customer, fill this field instead of domain.", + "location": "query" + }, + "domain": { + "type": "string", + "description": "Name of the domain. Fill this field to get groups from only this domain. To return all groups in a multi-domain fill customer field instead.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return. Default is 200", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token to specify next page in the list", + "location": "query" + }, + "userKey": { + "type": "string", + "description": "Email or immutable Id of the user if only those groups are to be listed, the given user is a member of. If Id, it should match with id of user object", + "location": "query" + } + }, + "response": { + "$ref": "Groups" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.group", + "https://www.googleapis.com/auth/admin.directory.group.readonly" + ] + }, + "patch": { + "id": "directory.groups.patch", + "path": "groups/{groupKey}", + "httpMethod": "PATCH", + "description": "Update Group. This method supports patch semantics.", + "parameters": { + "groupKey": { + "type": "string", + "description": "Email or immutable Id of the group. If Id, it should match with id of group object", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "groupKey" + ], + "request": { + "$ref": "Group" + }, + "response": { + "$ref": "Group" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.group" + ] + }, + "update": { + "id": "directory.groups.update", + "path": "groups/{groupKey}", + "httpMethod": "PUT", + "description": "Update Group", + "parameters": { + "groupKey": { + "type": "string", + "description": "Email or immutable Id of the group. If Id, it should match with id of group object", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "groupKey" + ], + "request": { + "$ref": "Group" + }, + "response": { + "$ref": "Group" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.group" + ] + } + }, + "resources": { + "aliases": { + "methods": { + "delete": { + "id": "directory.groups.aliases.delete", + "path": "groups/{groupKey}/aliases/{alias}", + "httpMethod": "DELETE", + "description": "Remove a alias for the group", + "parameters": { + "alias": { + "type": "string", + "description": "The alias to be removed", + "required": true, + "location": "path" + }, + "groupKey": { + "type": "string", + "description": "Email or immutable Id of the group", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "groupKey", + "alias" + ], + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.group" + ] + }, + "insert": { + "id": "directory.groups.aliases.insert", + "path": "groups/{groupKey}/aliases", + "httpMethod": "POST", + "description": "Add a alias for the group", + "parameters": { + "groupKey": { + "type": "string", + "description": "Email or immutable Id of the group", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "groupKey" + ], + "request": { + "$ref": "Alias" + }, + "response": { + "$ref": "Alias" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.group" + ] + }, + "list": { + "id": "directory.groups.aliases.list", + "path": "groups/{groupKey}/aliases", + "httpMethod": "GET", + "description": "List all aliases for a group", + "parameters": { + "groupKey": { + "type": "string", + "description": "Email or immutable Id of the group", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "groupKey" + ], + "response": { + "$ref": "Aliases" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.group", + "https://www.googleapis.com/auth/admin.directory.group.readonly" + ], + "supportsSubscription": true + } + } + } + } + }, + "members": { + "methods": { + "delete": { + "id": "directory.members.delete", + "path": "groups/{groupKey}/members/{memberKey}", + "httpMethod": "DELETE", + "description": "Remove membership.", + "parameters": { + "groupKey": { + "type": "string", + "description": "Email or immutable Id of the group", + "required": true, + "location": "path" + }, + "memberKey": { + "type": "string", + "description": "Email or immutable Id of the member", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "groupKey", + "memberKey" + ], + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.group", + "https://www.googleapis.com/auth/admin.directory.group.member" + ] + }, + "get": { + "id": "directory.members.get", + "path": "groups/{groupKey}/members/{memberKey}", + "httpMethod": "GET", + "description": "Retrieve Group Member", + "parameters": { + "groupKey": { + "type": "string", + "description": "Email or immutable Id of the group", + "required": true, + "location": "path" + }, + "memberKey": { + "type": "string", + "description": "Email or immutable Id of the member", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "groupKey", + "memberKey" + ], + "response": { + "$ref": "Member" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.group", + "https://www.googleapis.com/auth/admin.directory.group.member", + "https://www.googleapis.com/auth/admin.directory.group.member.readonly", + "https://www.googleapis.com/auth/admin.directory.group.readonly" + ] + }, + "insert": { + "id": "directory.members.insert", + "path": "groups/{groupKey}/members", + "httpMethod": "POST", + "description": "Add user to the specified group.", + "parameters": { + "groupKey": { + "type": "string", + "description": "Email or immutable Id of the group", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "groupKey" + ], + "request": { + "$ref": "Member" + }, + "response": { + "$ref": "Member" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.group", + "https://www.googleapis.com/auth/admin.directory.group.member" + ] + }, + "list": { + "id": "directory.members.list", + "path": "groups/{groupKey}/members", + "httpMethod": "GET", + "description": "Retrieve all members in a group (paginated)", + "parameters": { + "groupKey": { + "type": "string", + "description": "Email or immutable Id of the group", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return. Default is 200", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token to specify next page in the list", + "location": "query" + }, + "roles": { + "type": "string", + "description": "Comma separated role values to filter list results on.", + "location": "query" + } + }, + "parameterOrder": [ + "groupKey" + ], + "response": { + "$ref": "Members" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.group", + "https://www.googleapis.com/auth/admin.directory.group.member", + "https://www.googleapis.com/auth/admin.directory.group.member.readonly", + "https://www.googleapis.com/auth/admin.directory.group.readonly" + ] + }, + "patch": { + "id": "directory.members.patch", + "path": "groups/{groupKey}/members/{memberKey}", + "httpMethod": "PATCH", + "description": "Update membership of a user in the specified group. This method supports patch semantics.", + "parameters": { + "groupKey": { + "type": "string", + "description": "Email or immutable Id of the group. If Id, it should match with id of group object", + "required": true, + "location": "path" + }, + "memberKey": { + "type": "string", + "description": "Email or immutable Id of the user. If Id, it should match with id of member object", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "groupKey", + "memberKey" + ], + "request": { + "$ref": "Member" + }, + "response": { + "$ref": "Member" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.group", + "https://www.googleapis.com/auth/admin.directory.group.member" + ] + }, + "update": { + "id": "directory.members.update", + "path": "groups/{groupKey}/members/{memberKey}", + "httpMethod": "PUT", + "description": "Update membership of a user in the specified group.", + "parameters": { + "groupKey": { + "type": "string", + "description": "Email or immutable Id of the group. If Id, it should match with id of group object", + "required": true, + "location": "path" + }, + "memberKey": { + "type": "string", + "description": "Email or immutable Id of the user. If Id, it should match with id of member object", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "groupKey", + "memberKey" + ], + "request": { + "$ref": "Member" + }, + "response": { + "$ref": "Member" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.group", + "https://www.googleapis.com/auth/admin.directory.group.member" + ] + } + } + }, + "mobiledevices": { + "methods": { + "action": { + "id": "directory.mobiledevices.action", + "path": "customer/{customerId}/devices/mobile/{resourceId}/action", + "httpMethod": "POST", + "description": "Take action on Mobile Device", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + }, + "resourceId": { + "type": "string", + "description": "Immutable id of Mobile Device", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "resourceId" + ], + "request": { + "$ref": "MobileDeviceAction" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.device.mobile", + "https://www.googleapis.com/auth/admin.directory.device.mobile.action" + ] + }, + "delete": { + "id": "directory.mobiledevices.delete", + "path": "customer/{customerId}/devices/mobile/{resourceId}", + "httpMethod": "DELETE", + "description": "Delete Mobile Device", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + }, + "resourceId": { + "type": "string", + "description": "Immutable id of Mobile Device", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "resourceId" + ], + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.device.mobile" + ] + }, + "get": { + "id": "directory.mobiledevices.get", + "path": "customer/{customerId}/devices/mobile/{resourceId}", + "httpMethod": "GET", + "description": "Retrieve Mobile Device", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "Restrict information returned to a set of selected fields.", + "enum": [ + "BASIC", + "FULL" + ], + "enumDescriptions": [ + "Includes only the basic metadata fields (e.g., deviceId, model, status, type, and status)", + "Includes all metadata fields" + ], + "location": "query" + }, + "resourceId": { + "type": "string", + "description": "Immutable id of Mobile Device", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "resourceId" + ], + "response": { + "$ref": "MobileDevice" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.device.mobile", + "https://www.googleapis.com/auth/admin.directory.device.mobile.action", + "https://www.googleapis.com/auth/admin.directory.device.mobile.readonly" + ] + }, + "list": { + "id": "directory.mobiledevices.list", + "path": "customer/{customerId}/devices/mobile", + "httpMethod": "GET", + "description": "Retrieve all Mobile Devices of a customer (paginated)", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return. Default is 100", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Column to use for sorting results", + "enum": [ + "deviceId", + "email", + "lastSync", + "model", + "name", + "os", + "status", + "type" + ], + "enumDescriptions": [ + "Mobile Device serial number.", + "Owner user email.", + "Last policy settings sync date time of the device.", + "Mobile Device model.", + "Owner user name.", + "Mobile operating system.", + "Status of the device.", + "Type of the device." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token to specify next page in the list", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Restrict information returned to a set of selected fields.", + "enum": [ + "BASIC", + "FULL" + ], + "enumDescriptions": [ + "Includes only the basic metadata fields (e.g., deviceId, model, status, type, and status)", + "Includes all metadata fields" + ], + "location": "query" + }, + "query": { + "type": "string", + "description": "Search string in the format given at http://support.google.com/a/bin/answer.py?hl=en&answer=1408863#search", + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Whether to return results in ascending or descending order. Only of use when orderBy is also used", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "parameterOrder": [ + "customerId" + ], + "response": { + "$ref": "MobileDevices" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.device.mobile", + "https://www.googleapis.com/auth/admin.directory.device.mobile.action", + "https://www.googleapis.com/auth/admin.directory.device.mobile.readonly" + ] + } + } + }, + "notifications": { + "methods": { + "delete": { + "id": "directory.notifications.delete", + "path": "customer/{customer}/notifications/{notificationId}", + "httpMethod": "DELETE", + "description": "Deletes a notification", + "parameters": { + "customer": { + "type": "string", + "description": "The unique ID for the customer's Google account. The customerId is also returned as part of the Users resource.", + "required": true, + "location": "path" + }, + "notificationId": { + "type": "string", + "description": "The unique ID of the notification.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer", + "notificationId" + ], + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.notifications" + ] + }, + "get": { + "id": "directory.notifications.get", + "path": "customer/{customer}/notifications/{notificationId}", + "httpMethod": "GET", + "description": "Retrieves a notification.", + "parameters": { + "customer": { + "type": "string", + "description": "The unique ID for the customer's Google account. The customerId is also returned as part of the Users resource.", + "required": true, + "location": "path" + }, + "notificationId": { + "type": "string", + "description": "The unique ID of the notification.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer", + "notificationId" + ], + "response": { + "$ref": "Notification" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.notifications" + ] + }, + "list": { + "id": "directory.notifications.list", + "path": "customer/{customer}/notifications", + "httpMethod": "GET", + "description": "Retrieves a list of notifications.", + "parameters": { + "customer": { + "type": "string", + "description": "The unique ID for the customer's Google account.", + "required": true, + "location": "path" + }, + "language": { + "type": "string", + "description": "The ISO 639-1 code of the language notifications are returned in. The default is English (en).", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of notifications to return per page. The default is 100.", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The token to specify the page of results to retrieve.", + "location": "query" + } + }, + "parameterOrder": [ + "customer" + ], + "response": { + "$ref": "Notifications" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.notifications" + ] + }, + "patch": { + "id": "directory.notifications.patch", + "path": "customer/{customer}/notifications/{notificationId}", + "httpMethod": "PATCH", + "description": "Updates a notification. This method supports patch semantics.", + "parameters": { + "customer": { + "type": "string", + "description": "The unique ID for the customer's Google account.", + "required": true, + "location": "path" + }, + "notificationId": { + "type": "string", + "description": "The unique ID of the notification.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer", + "notificationId" + ], + "request": { + "$ref": "Notification" + }, + "response": { + "$ref": "Notification" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.notifications" + ] + }, + "update": { + "id": "directory.notifications.update", + "path": "customer/{customer}/notifications/{notificationId}", + "httpMethod": "PUT", + "description": "Updates a notification.", + "parameters": { + "customer": { + "type": "string", + "description": "The unique ID for the customer's Google account.", + "required": true, + "location": "path" + }, + "notificationId": { + "type": "string", + "description": "The unique ID of the notification.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer", + "notificationId" + ], + "request": { + "$ref": "Notification" + }, + "response": { + "$ref": "Notification" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.notifications" + ] + } + } + }, + "orgunits": { + "methods": { + "delete": { + "id": "directory.orgunits.delete", + "path": "customer/{customerId}/orgunits{/orgUnitPath*}", + "httpMethod": "DELETE", + "description": "Remove Organization Unit", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + }, + "orgUnitPath": { + "type": "string", + "description": "Full path of the organization unit", + "required": true, + "repeated": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "orgUnitPath" + ], + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.orgunit" + ] + }, + "get": { + "id": "directory.orgunits.get", + "path": "customer/{customerId}/orgunits{/orgUnitPath*}", + "httpMethod": "GET", + "description": "Retrieve Organization Unit", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + }, + "orgUnitPath": { + "type": "string", + "description": "Full path of the organization unit", + "required": true, + "repeated": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "orgUnitPath" + ], + "response": { + "$ref": "OrgUnit" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.orgunit", + "https://www.googleapis.com/auth/admin.directory.orgunit.readonly" + ] + }, + "insert": { + "id": "directory.orgunits.insert", + "path": "customer/{customerId}/orgunits", + "httpMethod": "POST", + "description": "Add Organization Unit", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId" + ], + "request": { + "$ref": "OrgUnit" + }, + "response": { + "$ref": "OrgUnit" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.orgunit" + ] + }, + "list": { + "id": "directory.orgunits.list", + "path": "customer/{customerId}/orgunits", + "httpMethod": "GET", + "description": "Retrieve all Organization Units", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + }, + "orgUnitPath": { + "type": "string", + "description": "the URL-encoded organization unit", + "default": "", + "location": "query" + }, + "type": { + "type": "string", + "description": "Whether to return all sub-organizations or just immediate children", + "enum": [ + "all", + "children" + ], + "enumDescriptions": [ + "All sub-organization units.", + "Immediate children only (default)." + ], + "location": "query" + } + }, + "parameterOrder": [ + "customerId" + ], + "response": { + "$ref": "OrgUnits" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.orgunit", + "https://www.googleapis.com/auth/admin.directory.orgunit.readonly" + ] + }, + "patch": { + "id": "directory.orgunits.patch", + "path": "customer/{customerId}/orgunits{/orgUnitPath*}", + "httpMethod": "PATCH", + "description": "Update Organization Unit. This method supports patch semantics.", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + }, + "orgUnitPath": { + "type": "string", + "description": "Full path of the organization unit", + "required": true, + "repeated": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "orgUnitPath" + ], + "request": { + "$ref": "OrgUnit" + }, + "response": { + "$ref": "OrgUnit" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.orgunit" + ] + }, + "update": { + "id": "directory.orgunits.update", + "path": "customer/{customerId}/orgunits{/orgUnitPath*}", + "httpMethod": "PUT", + "description": "Update Organization Unit", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + }, + "orgUnitPath": { + "type": "string", + "description": "Full path of the organization unit", + "required": true, + "repeated": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "orgUnitPath" + ], + "request": { + "$ref": "OrgUnit" + }, + "response": { + "$ref": "OrgUnit" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.orgunit" + ] + } + } + }, + "tokens": { + "methods": { + "delete": { + "id": "directory.tokens.delete", + "path": "users/{userKey}/tokens/{clientId}", + "httpMethod": "DELETE", + "description": "Delete all access tokens issued by a user for an application.", + "parameters": { + "clientId": { + "type": "string", + "description": "The Client ID of the application the token is issued to.", + "required": true, + "location": "path" + }, + "userKey": { + "type": "string", + "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey", + "clientId" + ], + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user.security" + ] + }, + "get": { + "id": "directory.tokens.get", + "path": "users/{userKey}/tokens/{clientId}", + "httpMethod": "GET", + "description": "Get information about an access token issued by a user.", + "parameters": { + "clientId": { + "type": "string", + "description": "The Client ID of the application the token is issued to.", + "required": true, + "location": "path" + }, + "userKey": { + "type": "string", + "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey", + "clientId" + ], + "response": { + "$ref": "Token" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user.security" + ] + }, + "list": { + "id": "directory.tokens.list", + "path": "users/{userKey}/tokens", + "httpMethod": "GET", + "description": "Returns the set of current, valid verification codes for the specified user.", + "parameters": { + "userKey": { + "type": "string", + "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "response": { + "$ref": "Tokens" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user.security" + ] + } + } + }, + "users": { + "methods": { + "delete": { + "id": "directory.users.delete", + "path": "users/{userKey}", + "httpMethod": "DELETE", + "description": "Delete user", + "parameters": { + "userKey": { + "type": "string", + "description": "Email or immutable Id of the user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user" + ] + }, + "get": { + "id": "directory.users.get", + "path": "users/{userKey}", + "httpMethod": "GET", + "description": "retrieve user", + "parameters": { + "userKey": { + "type": "string", + "description": "Email or immutable Id of the user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user", + "https://www.googleapis.com/auth/admin.directory.user.readonly" + ] + }, + "insert": { + "id": "directory.users.insert", + "path": "users", + "httpMethod": "POST", + "description": "create user.", + "request": { + "$ref": "User" + }, + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user" + ] + }, + "list": { + "id": "directory.users.list", + "path": "users", + "httpMethod": "GET", + "description": "Retrieve either deleted users or all users in a domain (paginated)", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable id of the Google Apps account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain.", + "location": "query" + }, + "domain": { + "type": "string", + "description": "Name of the domain. Fill this field to get users from only this domain. To return all users in a multi-domain fill customer field instead.", + "location": "query" + }, + "event": { + "type": "string", + "description": "Event on which subscription is intended (if subscribing)", + "enum": [ + "add", + "delete", + "makeAdmin", + "undelete", + "update" + ], + "enumDescriptions": [ + "User Created Event", + "User Deleted Event", + "User Admin Status Change Event", + "User Undeleted Event", + "User Updated Event" + ], + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return. Default is 100. Max allowed is 500", + "format": "int32", + "minimum": "1", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Column to use for sorting results", + "enum": [ + "email", + "familyName", + "givenName" + ], + "enumDescriptions": [ + "Primary email of the user.", + "User's family name.", + "User's given name." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token to specify next page in the list", + "location": "query" + }, + "query": { + "type": "string", + "description": "Query string search. Should be of the form \"\" where field can be any of supported fields, operators can be one of '=' for exact match or ':' for prefix match. For prefix match, the value should always be followed by a *.", + "location": "query" + }, + "showDeleted": { + "type": "string", + "description": "If set to true retrieves the list of deleted users. Default is false", + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Whether to return results in ascending or descending order.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "response": { + "$ref": "Users" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user", + "https://www.googleapis.com/auth/admin.directory.user.readonly" + ], + "supportsSubscription": true + }, + "makeAdmin": { + "id": "directory.users.makeAdmin", + "path": "users/{userKey}/makeAdmin", + "httpMethod": "POST", + "description": "change admin status of a user", + "parameters": { + "userKey": { + "type": "string", + "description": "Email or immutable Id of the user as admin", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "request": { + "$ref": "UserMakeAdmin" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user" + ] + }, + "patch": { + "id": "directory.users.patch", + "path": "users/{userKey}", + "httpMethod": "PATCH", + "description": "update user. This method supports patch semantics.", + "parameters": { + "userKey": { + "type": "string", + "description": "Email or immutable Id of the user. If Id, it should match with id of user object", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "request": { + "$ref": "User" + }, + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user" + ] + }, + "undelete": { + "id": "directory.users.undelete", + "path": "users/{userKey}/undelete", + "httpMethod": "POST", + "description": "Undelete a deleted user", + "parameters": { + "userKey": { + "type": "string", + "description": "The immutable id of the user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "request": { + "$ref": "UserUndelete" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user" + ] + }, + "update": { + "id": "directory.users.update", + "path": "users/{userKey}", + "httpMethod": "PUT", + "description": "update user", + "parameters": { + "userKey": { + "type": "string", + "description": "Email or immutable Id of the user. If Id, it should match with id of user object", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "request": { + "$ref": "User" + }, + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user" + ] + }, + "watch": { + "id": "directory.users.watch", + "path": "users/watch", + "httpMethod": "POST", + "description": "Watch for changes in users list", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable id of the Google Apps account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain.", + "location": "query" + }, + "domain": { + "type": "string", + "description": "Name of the domain. Fill this field to get users from only this domain. To return all users in a multi-domain fill customer field instead.", + "location": "query" + }, + "event": { + "type": "string", + "description": "Event on which subscription is intended (if subscribing)", + "enum": [ + "add", + "delete", + "makeAdmin", + "undelete", + "update" + ], + "enumDescriptions": [ + "User Created Event", + "User Deleted Event", + "User Admin Status Change Event", + "User Undeleted Event", + "User Updated Event" + ], + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return. Default is 100. Max allowed is 500", + "format": "int32", + "minimum": "1", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Column to use for sorting results", + "enum": [ + "email", + "familyName", + "givenName" + ], + "enumDescriptions": [ + "Primary email of the user.", + "User's family name.", + "User's given name." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token to specify next page in the list", + "location": "query" + }, + "query": { + "type": "string", + "description": "Query string search. Should be of the form \"\" where field can be any of supported fields, operators can be one of '=' for exact match or ':' for prefix match. For prefix match, the value should always be followed by a *.", + "location": "query" + }, + "showDeleted": { + "type": "string", + "description": "If set to true retrieves the list of deleted users. Default is false", + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Whether to return results in ascending or descending order.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "request": { + "$ref": "Channel", + "parameterName": "resource" + }, + "response": { + "$ref": "Channel" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user", + "https://www.googleapis.com/auth/admin.directory.user.readonly" + ], + "supportsSubscription": true + } + }, + "resources": { + "aliases": { + "methods": { + "delete": { + "id": "directory.users.aliases.delete", + "path": "users/{userKey}/aliases/{alias}", + "httpMethod": "DELETE", + "description": "Remove a alias for the user", + "parameters": { + "alias": { + "type": "string", + "description": "The alias to be removed", + "required": true, + "location": "path" + }, + "userKey": { + "type": "string", + "description": "Email or immutable Id of the user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey", + "alias" + ], + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user", + "https://www.googleapis.com/auth/admin.directory.user.alias" + ] + }, + "insert": { + "id": "directory.users.aliases.insert", + "path": "users/{userKey}/aliases", + "httpMethod": "POST", + "description": "Add a alias for the user", + "parameters": { + "userKey": { + "type": "string", + "description": "Email or immutable Id of the user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "request": { + "$ref": "Alias" + }, + "response": { + "$ref": "Alias" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user", + "https://www.googleapis.com/auth/admin.directory.user.alias" + ] + }, + "list": { + "id": "directory.users.aliases.list", + "path": "users/{userKey}/aliases", + "httpMethod": "GET", + "description": "List all aliases for a user", + "parameters": { + "event": { + "type": "string", + "description": "Event on which subscription is intended (if subscribing)", + "enum": [ + "add", + "delete" + ], + "enumDescriptions": [ + "Alias Created Event", + "Alias Deleted Event" + ], + "location": "query" + }, + "userKey": { + "type": "string", + "description": "Email or immutable Id of the user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "response": { + "$ref": "Aliases" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user", + "https://www.googleapis.com/auth/admin.directory.user.alias", + "https://www.googleapis.com/auth/admin.directory.user.alias.readonly", + "https://www.googleapis.com/auth/admin.directory.user.readonly" + ], + "supportsSubscription": true + }, + "watch": { + "id": "directory.users.aliases.watch", + "path": "users/{userKey}/aliases/watch", + "httpMethod": "POST", + "description": "Watch for changes in user aliases list", + "parameters": { + "event": { + "type": "string", + "description": "Event on which subscription is intended (if subscribing)", + "enum": [ + "add", + "delete" + ], + "enumDescriptions": [ + "Alias Created Event", + "Alias Deleted Event" + ], + "location": "query" + }, + "userKey": { + "type": "string", + "description": "Email or immutable Id of the user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "request": { + "$ref": "Channel", + "parameterName": "resource" + }, + "response": { + "$ref": "Channel" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user", + "https://www.googleapis.com/auth/admin.directory.user.alias", + "https://www.googleapis.com/auth/admin.directory.user.alias.readonly", + "https://www.googleapis.com/auth/admin.directory.user.readonly" + ], + "supportsSubscription": true + } + } + }, + "photos": { + "methods": { + "delete": { + "id": "directory.users.photos.delete", + "path": "users/{userKey}/photos/thumbnail", + "httpMethod": "DELETE", + "description": "Remove photos for the user", + "parameters": { + "userKey": { + "type": "string", + "description": "Email or immutable Id of the user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user" + ] + }, + "get": { + "id": "directory.users.photos.get", + "path": "users/{userKey}/photos/thumbnail", + "httpMethod": "GET", + "description": "Retrieve photo of a user", + "parameters": { + "userKey": { + "type": "string", + "description": "Email or immutable Id of the user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "response": { + "$ref": "UserPhoto" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user", + "https://www.googleapis.com/auth/admin.directory.user.readonly" + ] + }, + "patch": { + "id": "directory.users.photos.patch", + "path": "users/{userKey}/photos/thumbnail", + "httpMethod": "PATCH", + "description": "Add a photo for the user. This method supports patch semantics.", + "parameters": { + "userKey": { + "type": "string", + "description": "Email or immutable Id of the user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "request": { + "$ref": "UserPhoto" + }, + "response": { + "$ref": "UserPhoto" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user" + ] + }, + "update": { + "id": "directory.users.photos.update", + "path": "users/{userKey}/photos/thumbnail", + "httpMethod": "PUT", + "description": "Add a photo for the user", + "parameters": { + "userKey": { + "type": "string", + "description": "Email or immutable Id of the user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "request": { + "$ref": "UserPhoto" + }, + "response": { + "$ref": "UserPhoto" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user" + ] + } + } + } + } + }, + "verificationCodes": { + "methods": { + "generate": { + "id": "directory.verificationCodes.generate", + "path": "users/{userKey}/verificationCodes/generate", + "httpMethod": "POST", + "description": "Generate new backup verification codes for the user.", + "parameters": { + "userKey": { + "type": "string", + "description": "Email or immutable Id of the user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user.security" + ] + }, + "invalidate": { + "id": "directory.verificationCodes.invalidate", + "path": "users/{userKey}/verificationCodes/invalidate", + "httpMethod": "POST", + "description": "Invalidate the current backup verification codes for the user.", + "parameters": { + "userKey": { + "type": "string", + "description": "Email or immutable Id of the user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user.security" + ] + }, + "list": { + "id": "directory.verificationCodes.list", + "path": "users/{userKey}/verificationCodes", + "httpMethod": "GET", + "description": "Returns the current set of valid backup verification codes for the specified user.", + "parameters": { + "userKey": { + "type": "string", + "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "response": { + "$ref": "VerificationCodes" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.user.security" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/admin/directory_v1/admin-gen.go b/third_party/src/code.google.com/p/google-api-go-client/admin/directory_v1/admin-gen.go new file mode 100644 index 0000000000000..1318c7f6ed51c --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/admin/directory_v1/admin-gen.go @@ -0,0 +1,6375 @@ +// Package admin provides access to the Admin Directory API. +// +// See https://developers.google.com/admin-sdk/directory/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/admin/directory_v1" +// ... +// adminService, err := admin.New(oauthHttpClient) +package admin + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "admin:directory_v1" +const apiName = "admin" +const apiVersion = "directory_v1" +const basePath = "https://www.googleapis.com/admin/directory/v1/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Chrome OS devices' metadata + AdminDirectoryDeviceChromeosScope = "https://www.googleapis.com/auth/admin.directory.device.chromeos" + + // View your Chrome OS devices' metadata + AdminDirectoryDeviceChromeosReadonlyScope = "https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly" + + // View and manage your mobile devices' metadata + AdminDirectoryDeviceMobileScope = "https://www.googleapis.com/auth/admin.directory.device.mobile" + + // Manage your mobile devices by performing administrative tasks + AdminDirectoryDeviceMobileActionScope = "https://www.googleapis.com/auth/admin.directory.device.mobile.action" + + // View your mobile devices' metadata + AdminDirectoryDeviceMobileReadonlyScope = "https://www.googleapis.com/auth/admin.directory.device.mobile.readonly" + + // View and manage the provisioning of groups on your domain + AdminDirectoryGroupScope = "https://www.googleapis.com/auth/admin.directory.group" + + // View and manage group subscriptions on your domain + AdminDirectoryGroupMemberScope = "https://www.googleapis.com/auth/admin.directory.group.member" + + // View group subscriptions on your domain + AdminDirectoryGroupMemberReadonlyScope = "https://www.googleapis.com/auth/admin.directory.group.member.readonly" + + // View groups on your domain + AdminDirectoryGroupReadonlyScope = "https://www.googleapis.com/auth/admin.directory.group.readonly" + + // View and manage notifications received on your domain + AdminDirectoryNotificationsScope = "https://www.googleapis.com/auth/admin.directory.notifications" + + // View and manage organization units on your domain + AdminDirectoryOrgunitScope = "https://www.googleapis.com/auth/admin.directory.orgunit" + + // View organization units on your domain + AdminDirectoryOrgunitReadonlyScope = "https://www.googleapis.com/auth/admin.directory.orgunit.readonly" + + // View and manage the provisioning of users on your domain + AdminDirectoryUserScope = "https://www.googleapis.com/auth/admin.directory.user" + + // View and manage user aliases on your domain + AdminDirectoryUserAliasScope = "https://www.googleapis.com/auth/admin.directory.user.alias" + + // View user aliases on your domain + AdminDirectoryUserAliasReadonlyScope = "https://www.googleapis.com/auth/admin.directory.user.alias.readonly" + + // View users on your domain + AdminDirectoryUserReadonlyScope = "https://www.googleapis.com/auth/admin.directory.user.readonly" + + // Manage data access permissions for users on your domain + AdminDirectoryUserSecurityScope = "https://www.googleapis.com/auth/admin.directory.user.security" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Asps = NewAspsService(s) + s.Channels = NewChannelsService(s) + s.Chromeosdevices = NewChromeosdevicesService(s) + s.Groups = NewGroupsService(s) + s.Members = NewMembersService(s) + s.Mobiledevices = NewMobiledevicesService(s) + s.Notifications = NewNotificationsService(s) + s.Orgunits = NewOrgunitsService(s) + s.Tokens = NewTokensService(s) + s.Users = NewUsersService(s) + s.VerificationCodes = NewVerificationCodesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Asps *AspsService + + Channels *ChannelsService + + Chromeosdevices *ChromeosdevicesService + + Groups *GroupsService + + Members *MembersService + + Mobiledevices *MobiledevicesService + + Notifications *NotificationsService + + Orgunits *OrgunitsService + + Tokens *TokensService + + Users *UsersService + + VerificationCodes *VerificationCodesService +} + +func NewAspsService(s *Service) *AspsService { + rs := &AspsService{s: s} + return rs +} + +type AspsService struct { + s *Service +} + +func NewChannelsService(s *Service) *ChannelsService { + rs := &ChannelsService{s: s} + return rs +} + +type ChannelsService struct { + s *Service +} + +func NewChromeosdevicesService(s *Service) *ChromeosdevicesService { + rs := &ChromeosdevicesService{s: s} + return rs +} + +type ChromeosdevicesService struct { + s *Service +} + +func NewGroupsService(s *Service) *GroupsService { + rs := &GroupsService{s: s} + rs.Aliases = NewGroupsAliasesService(s) + return rs +} + +type GroupsService struct { + s *Service + + Aliases *GroupsAliasesService +} + +func NewGroupsAliasesService(s *Service) *GroupsAliasesService { + rs := &GroupsAliasesService{s: s} + return rs +} + +type GroupsAliasesService struct { + s *Service +} + +func NewMembersService(s *Service) *MembersService { + rs := &MembersService{s: s} + return rs +} + +type MembersService struct { + s *Service +} + +func NewMobiledevicesService(s *Service) *MobiledevicesService { + rs := &MobiledevicesService{s: s} + return rs +} + +type MobiledevicesService struct { + s *Service +} + +func NewNotificationsService(s *Service) *NotificationsService { + rs := &NotificationsService{s: s} + return rs +} + +type NotificationsService struct { + s *Service +} + +func NewOrgunitsService(s *Service) *OrgunitsService { + rs := &OrgunitsService{s: s} + return rs +} + +type OrgunitsService struct { + s *Service +} + +func NewTokensService(s *Service) *TokensService { + rs := &TokensService{s: s} + return rs +} + +type TokensService struct { + s *Service +} + +func NewUsersService(s *Service) *UsersService { + rs := &UsersService{s: s} + rs.Aliases = NewUsersAliasesService(s) + rs.Photos = NewUsersPhotosService(s) + return rs +} + +type UsersService struct { + s *Service + + Aliases *UsersAliasesService + + Photos *UsersPhotosService +} + +func NewUsersAliasesService(s *Service) *UsersAliasesService { + rs := &UsersAliasesService{s: s} + return rs +} + +type UsersAliasesService struct { + s *Service +} + +func NewUsersPhotosService(s *Service) *UsersPhotosService { + rs := &UsersPhotosService{s: s} + return rs +} + +type UsersPhotosService struct { + s *Service +} + +func NewVerificationCodesService(s *Service) *VerificationCodesService { + rs := &VerificationCodesService{s: s} + return rs +} + +type VerificationCodesService struct { + s *Service +} + +type Alias struct { + // Alias: A alias email + Alias string `json:"alias,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Id: Unique id of the group (Read-only) Unique id of the user + // (Read-only) + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // PrimaryEmail: Group's primary email (Read-only) User's primary email + // (Read-only) + PrimaryEmail string `json:"primaryEmail,omitempty"` +} + +type Aliases struct { + // Aliases: List of alias objects. + Aliases []*Alias `json:"aliases,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` +} + +type Asp struct { + // CodeId: The unique ID of the ASP. + CodeId int64 `json:"codeId,omitempty"` + + // CreationTime: The time when the ASP was created. Expressed in Unix + // time format. + CreationTime int64 `json:"creationTime,omitempty,string"` + + // Etag: ETag of the ASP. + Etag string `json:"etag,omitempty"` + + // Kind: The type of the API resource. This is always + // admin#directory#asp. + Kind string `json:"kind,omitempty"` + + // LastTimeUsed: The time when the ASP was last used. Expressed in Unix + // time format. + LastTimeUsed int64 `json:"lastTimeUsed,omitempty,string"` + + // Name: The name of the application that the user, represented by their + // userId, entered when the ASP was created. + Name string `json:"name,omitempty"` + + // UserKey: The unique ID of the user who issued the ASP. + UserKey string `json:"userKey,omitempty"` +} + +type Asps struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Items: A list of ASP resources. + Items []*Asp `json:"items,omitempty"` + + // Kind: The type of the API resource. This is always + // admin#directory#aspList. + Kind string `json:"kind,omitempty"` +} + +type Channel struct { + // Address: The address where notifications are delivered for this + // channel. + Address string `json:"address,omitempty"` + + // Expiration: Date and time of notification channel expiration, + // expressed as a Unix timestamp, in milliseconds. Optional. + Expiration int64 `json:"expiration,omitempty,string"` + + // Id: A UUID or similar unique string that identifies this channel. + Id string `json:"id,omitempty"` + + // Kind: Identifies this as a notification channel used to watch for + // changes to a resource. Value: the fixed string "api#channel". + Kind string `json:"kind,omitempty"` + + // Params: Additional parameters controlling delivery channel behavior. + // Optional. + Params map[string]string `json:"params,omitempty"` + + // Payload: A Boolean value to indicate whether payload is wanted. + // Optional. + Payload bool `json:"payload,omitempty"` + + // ResourceId: An opaque ID that identifies the resource being watched + // on this channel. Stable across different API versions. + ResourceId string `json:"resourceId,omitempty"` + + // ResourceUri: A version-specific identifier for the watched resource. + ResourceUri string `json:"resourceUri,omitempty"` + + // Token: An arbitrary string delivered to the target address with each + // notification delivered over this channel. Optional. + Token string `json:"token,omitempty"` + + // Type: The type of delivery mechanism used for this channel. + Type string `json:"type,omitempty"` +} + +type ChromeOsDevice struct { + // AnnotatedLocation: Address or location of the device as noted by the + // administrator + AnnotatedLocation string `json:"annotatedLocation,omitempty"` + + // AnnotatedUser: User of the device + AnnotatedUser string `json:"annotatedUser,omitempty"` + + // BootMode: Chromebook boot mode (Read-only) + BootMode string `json:"bootMode,omitempty"` + + // DeviceId: Unique identifier of Chrome OS Device (Read-only) + DeviceId string `json:"deviceId,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // FirmwareVersion: Chromebook firmware version (Read-only) + FirmwareVersion string `json:"firmwareVersion,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // LastEnrollmentTime: Date and time the device was last enrolled + // (Read-only) + LastEnrollmentTime string `json:"lastEnrollmentTime,omitempty"` + + // LastSync: Date and time the device was last synchronized with the + // policy settings in the Google Apps administrator control panel + // (Read-only) + LastSync string `json:"lastSync,omitempty"` + + // MacAddress: Chromebook Mac Address (Read-only) + MacAddress string `json:"macAddress,omitempty"` + + // Meid: Mobile Equipment identifier for the 3G mobile card in the + // Chromebook (Read-only) + Meid string `json:"meid,omitempty"` + + // Model: Chromebook Model (Read-only) + Model string `json:"model,omitempty"` + + // Notes: Notes added by the administrator + Notes string `json:"notes,omitempty"` + + // OrderNumber: Chromebook order number (Read-only) + OrderNumber string `json:"orderNumber,omitempty"` + + // OrgUnitPath: OrgUnit of the device + OrgUnitPath string `json:"orgUnitPath,omitempty"` + + // OsVersion: Chromebook Os Version (Read-only) + OsVersion string `json:"osVersion,omitempty"` + + // PlatformVersion: Chromebook platform version (Read-only) + PlatformVersion string `json:"platformVersion,omitempty"` + + // SerialNumber: Chromebook serial number (Read-only) + SerialNumber string `json:"serialNumber,omitempty"` + + // Status: status of the device (Read-only) + Status string `json:"status,omitempty"` + + // SupportEndDate: Final date the device will be supported (Read-only) + SupportEndDate string `json:"supportEndDate,omitempty"` + + // WillAutoRenew: Will Chromebook auto reniew after support end date + // (Read-only) + WillAutoRenew bool `json:"willAutoRenew,omitempty"` +} + +type ChromeOsDevices struct { + // Chromeosdevices: List of Chrome OS Device objects. + Chromeosdevices []*ChromeOsDevice `json:"chromeosdevices,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token used to access next page of this result. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Group struct { + // AdminCreated: Is the group created by admin (Read-only) * + AdminCreated bool `json:"adminCreated,omitempty"` + + // Aliases: List of aliases (Read-only) + Aliases []string `json:"aliases,omitempty"` + + // Description: Description of the group + Description string `json:"description,omitempty"` + + // DirectMembersCount: Group direct members count + DirectMembersCount int64 `json:"directMembersCount,omitempty,string"` + + // Email: Email of Group + Email string `json:"email,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Id: Unique identifier of Group (Read-only) + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // Name: Group name + Name string `json:"name,omitempty"` + + // NonEditableAliases: List of non editable aliases (Read-only) + NonEditableAliases []string `json:"nonEditableAliases,omitempty"` +} + +type Groups struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Groups: List of group objects. + Groups []*Group `json:"groups,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token used to access next page of this result. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Member struct { + // Email: Email of member (Read-only) + Email string `json:"email,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Id: Unique identifier of customer member (Read-only) Unique + // identifier of group (Read-only) Unique identifier of member + // (Read-only) + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // Role: Role of member + Role string `json:"role,omitempty"` + + // Type: Type of member (Immutable) + Type string `json:"type,omitempty"` +} + +type Members struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // Members: List of member objects. + Members []*Member `json:"members,omitempty"` + + // NextPageToken: Token used to access next page of this result. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type MobileDevice struct { + // Applications: List of applications installed on Mobile Device + Applications []*MobileDeviceApplications `json:"applications,omitempty"` + + // DeviceId: Mobile Device serial number (Read-only) + DeviceId string `json:"deviceId,omitempty"` + + // Email: List of owner user's email addresses (Read-only) + Email []string `json:"email,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // FirstSync: Date and time the device was first synchronized with the + // policy settings in the Google Apps administrator control panel + // (Read-only) + FirstSync string `json:"firstSync,omitempty"` + + // HardwareId: Mobile Device Hardware Id (Read-only) + HardwareId string `json:"hardwareId,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // LastSync: Date and time the device was last synchronized with the + // policy settings in the Google Apps administrator control panel + // (Read-only) + LastSync string `json:"lastSync,omitempty"` + + // Model: Name of the model of the device + Model string `json:"model,omitempty"` + + // Name: List of owner user's names (Read-only) + Name []string `json:"name,omitempty"` + + // Os: Name of the mobile operating system + Os string `json:"os,omitempty"` + + // ResourceId: Unique identifier of Mobile Device (Read-only) + ResourceId string `json:"resourceId,omitempty"` + + // Status: Status of the device (Read-only) + Status string `json:"status,omitempty"` + + // Type: The type of device (Read-only) + Type string `json:"type,omitempty"` + + // UserAgent: Mobile Device user agent + UserAgent string `json:"userAgent,omitempty"` +} + +type MobileDeviceApplications struct { + // DisplayName: Display name of application + DisplayName string `json:"displayName,omitempty"` + + // PackageName: Package name of application + PackageName string `json:"packageName,omitempty"` + + // Permission: List of Permissions for application + Permission []string `json:"permission,omitempty"` + + // VersionCode: Version code of application + VersionCode int64 `json:"versionCode,omitempty"` + + // VersionName: Version name of application + VersionName string `json:"versionName,omitempty"` +} + +type MobileDeviceAction struct { + // Action: Action to be taken on the Mobile Device + Action string `json:"action,omitempty"` +} + +type MobileDevices struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // Mobiledevices: List of Mobile Device objects. + Mobiledevices []*MobileDevice `json:"mobiledevices,omitempty"` + + // NextPageToken: Token used to access next page of this result. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Notification struct { + // Body: Body of the notification (Read-only) + Body string `json:"body,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // FromAddress: Address from which the notification is received + // (Read-only) + FromAddress string `json:"fromAddress,omitempty"` + + // IsUnread: Boolean indicating whether the notification is unread or + // not. + IsUnread bool `json:"isUnread,omitempty"` + + // Kind: The type of the resource. + Kind string `json:"kind,omitempty"` + + NotificationId string `json:"notificationId,omitempty"` + + // SendTime: Time at which notification was sent (Read-only) + SendTime string `json:"sendTime,omitempty"` + + // Subject: Subject of the notification (Read-only) + Subject string `json:"subject,omitempty"` +} + +type Notifications struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Items: List of notifications in this page. + Items []*Notification `json:"items,omitempty"` + + // Kind: The type of the resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token for fetching the next page of notifications. + NextPageToken string `json:"nextPageToken,omitempty"` + + // UnreadNotificationsCount: Number of unread notification for the + // domain. + UnreadNotificationsCount int64 `json:"unreadNotificationsCount,omitempty"` +} + +type OrgUnit struct { + // BlockInheritance: Should block inheritance + BlockInheritance bool `json:"blockInheritance,omitempty"` + + // Description: Description of OrgUnit + Description string `json:"description,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // Name: Name of OrgUnit + Name string `json:"name,omitempty"` + + // OrgUnitPath: Path of OrgUnit + OrgUnitPath string `json:"orgUnitPath,omitempty"` + + // ParentOrgUnitPath: Path of parent OrgUnit + ParentOrgUnitPath string `json:"parentOrgUnitPath,omitempty"` +} + +type OrgUnits struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // OrganizationUnits: List of user objects. + OrganizationUnits []*OrgUnit `json:"organizationUnits,omitempty"` +} + +type Token struct { + // Anonymous: Whether the application is registered with Google. The + // value is true if the application has an anonymous Client ID. + Anonymous bool `json:"anonymous,omitempty"` + + // ClientId: The Client ID of the application the token is issued to. + ClientId string `json:"clientId,omitempty"` + + // DisplayText: The displayable name of the application the token is + // issued to. + DisplayText string `json:"displayText,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Kind: The type of the API resource. This is always + // admin#directory#token. + Kind string `json:"kind,omitempty"` + + // NativeApp: Whether the token is issued to an installed application. + // The value is true if the application is installed to a desktop or + // mobile device. + NativeApp bool `json:"nativeApp,omitempty"` + + // Scopes: A list of authorization scopes the application is granted. + Scopes []string `json:"scopes,omitempty"` + + // UserKey: The unique ID of the user that issued the token. + UserKey string `json:"userKey,omitempty"` +} + +type Tokens struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Items: A list of Token resources. + Items []*Token `json:"items,omitempty"` + + // Kind: The type of the API resource. This is always + // admin#directory#tokenList. + Kind string `json:"kind,omitempty"` +} + +type User struct { + // Addresses: Addresses of User + Addresses []*UserAddress `json:"addresses,omitempty"` + + // AgreedToTerms: Indicates if user has agreed to terms (Read-only) + AgreedToTerms bool `json:"agreedToTerms,omitempty"` + + // Aliases: List of aliases (Read-only) + Aliases []string `json:"aliases,omitempty"` + + // ChangePasswordAtNextLogin: Boolean indicating if the user should + // change password in next login + ChangePasswordAtNextLogin bool `json:"changePasswordAtNextLogin,omitempty"` + + // CreationTime: User's Google account creation time. (Read-only) + CreationTime string `json:"creationTime,omitempty"` + + // CustomerId: CustomerId of User (Read-only) + CustomerId string `json:"customerId,omitempty"` + + DeletionTime string `json:"deletionTime,omitempty"` + + // Emails: Emails of User + Emails []*UserEmail `json:"emails,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // ExternalIds: The external Ids of User * + ExternalIds []*UserExternalId `json:"externalIds,omitempty"` + + // HashFunction: Hash function name for password. Supported are MD5, + // SHA-1 and crypt + HashFunction string `json:"hashFunction,omitempty"` + + // Id: Unique identifier of User (Read-only) + Id string `json:"id,omitempty"` + + // Ims: User's Instant Messenger + Ims []*UserIm `json:"ims,omitempty"` + + // IncludeInGlobalAddressList: Boolean indicating if user is included in + // Global Address List + IncludeInGlobalAddressList bool `json:"includeInGlobalAddressList,omitempty"` + + // IpWhitelisted: Boolean indicating if ip is whitelisted + IpWhitelisted bool `json:"ipWhitelisted,omitempty"` + + // IsAdmin: Boolean indicating if the user is admin (Read-only) + IsAdmin bool `json:"isAdmin,omitempty"` + + // IsDelegatedAdmin: Boolean indicating if the user is delegated admin + // (Read-only) + IsDelegatedAdmin bool `json:"isDelegatedAdmin,omitempty"` + + // IsMailboxSetup: Is mailbox setup (Read-only) + IsMailboxSetup bool `json:"isMailboxSetup,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // LastLoginTime: User's last login time. (Read-only) + LastLoginTime string `json:"lastLoginTime,omitempty"` + + // Name: User's name + Name *UserName `json:"name,omitempty"` + + // NonEditableAliases: List of non editable aliases (Read-only) + NonEditableAliases []string `json:"nonEditableAliases,omitempty"` + + // OrgUnitPath: OrgUnit of User + OrgUnitPath string `json:"orgUnitPath,omitempty"` + + // Organizations: Organizations of User + Organizations []*UserOrganization `json:"organizations,omitempty"` + + // Password: User's password + Password string `json:"password,omitempty"` + + // Phones: Phone numbers of User + Phones []*UserPhone `json:"phones,omitempty"` + + // PrimaryEmail: username of User + PrimaryEmail string `json:"primaryEmail,omitempty"` + + // Relations: The Relations of User * + Relations []*UserRelation `json:"relations,omitempty"` + + // Suspended: Indicates if user is suspended + Suspended bool `json:"suspended,omitempty"` + + // SuspensionReason: Suspension reason if user is suspended (Read-only) + SuspensionReason string `json:"suspensionReason,omitempty"` + + // ThumbnailPhotoUrl: Photo Url of the user (Read-only) + ThumbnailPhotoUrl string `json:"thumbnailPhotoUrl,omitempty"` +} + +type UserAddress struct { + // Country: Country. + Country string `json:"country,omitempty"` + + // CountryCode: Country code. + CountryCode string `json:"countryCode,omitempty"` + + // CustomType: Custom type. + CustomType string `json:"customType,omitempty"` + + // ExtendedAddress: Extended Address. + ExtendedAddress string `json:"extendedAddress,omitempty"` + + // Formatted: Formatted address (read-only field) + Formatted string `json:"formatted,omitempty"` + + // Locality: Locality. + Locality string `json:"locality,omitempty"` + + // PoBox: Other parts of address. + PoBox string `json:"poBox,omitempty"` + + // PostalCode: Postal code. + PostalCode string `json:"postalCode,omitempty"` + + // Primary: If this is user's primary address. Only one entry could be + // marked as primary. + Primary bool `json:"primary,omitempty"` + + // Region: Region. + Region string `json:"region,omitempty"` + + // SourceIsStructured: User supplied address was structured. Structured + // addresses are NOT supported at this time. You might be able to write + // structured addresses, but any values will eventually be clobbered. + SourceIsStructured bool `json:"sourceIsStructured,omitempty"` + + // StreetAddress: Street. + StreetAddress string `json:"streetAddress,omitempty"` + + // Type: Each entry can have a type which indicates standard values of + // that entry. For example address could be of home, work etc. In + // addition to the standard type, an entry can have a custom type and + // can take any value. Such type should have the CUSTOM value as type + // and also have a customType value. + Type string `json:"type,omitempty"` +} + +type UserEmail struct { + // Address: Email id of the user. + Address string `json:"address,omitempty"` + + // CustomType: Custom Type. + CustomType string `json:"customType,omitempty"` + + // Primary: If this is user's primary email. Only one entry could be + // marked as primary. + Primary bool `json:"primary,omitempty"` + + // Type: Each entry can have a type which indicates standard types of + // that entry. For example email could be of home, work etc. In addition + // to the standard type, an entry can have a custom type and can take + // any value Such typess should have the CUSTOM value as type and also + // have a customType value. + Type string `json:"type,omitempty"` +} + +type UserExternalId struct { + // CustomType: Custom type. + CustomType string `json:"customType,omitempty"` + + // Type: The type of the Id. + Type string `json:"type,omitempty"` + + // Value: The value of the id. + Value string `json:"value,omitempty"` +} + +type UserIm struct { + // CustomProtocol: Custom protocol. + CustomProtocol string `json:"customProtocol,omitempty"` + + // CustomType: Custom type. + CustomType string `json:"customType,omitempty"` + + // Im: Instant messenger id. + Im string `json:"im,omitempty"` + + // Primary: If this is user's priamry im. Only one entry could be marked + // as primary. + Primary bool `json:"primary,omitempty"` + + // Protocol: Protocol used in the instant messenger. It should be one of + // the values from ImProtocolTypes map. Simalar to type, it can take a + // CUSTOM value and specify the custom name in customProtocol field. + Protocol string `json:"protocol,omitempty"` + + // Type: Each entry can have a type which indicates standard types of + // that entry. For example instant messengers could be of home, work + // etc. In addition to the standard type, an entry can have a custom + // type and can take any value. Such types should have the CUSTOM value + // as type and also have a customType value. + Type string `json:"type,omitempty"` +} + +type UserMakeAdmin struct { + // Status: Boolean indicating new admin status of the user + Status bool `json:"status,omitempty"` +} + +type UserName struct { + // FamilyName: Last Name + FamilyName string `json:"familyName,omitempty"` + + // FullName: Full Name + FullName string `json:"fullName,omitempty"` + + // GivenName: First Name + GivenName string `json:"givenName,omitempty"` +} + +type UserOrganization struct { + // CostCenter: The cost center of the users department. + CostCenter string `json:"costCenter,omitempty"` + + // CustomType: Custom type. + CustomType string `json:"customType,omitempty"` + + // Department: Department within the organization. + Department string `json:"department,omitempty"` + + // Description: Description of the organization. + Description string `json:"description,omitempty"` + + // Domain: The domain to which the organization belongs to. + Domain string `json:"domain,omitempty"` + + // Location: Location of the organization. This need not be fully + // qualified address. + Location string `json:"location,omitempty"` + + // Name: Name of the organization + Name string `json:"name,omitempty"` + + // Primary: If it user's primary organization. + Primary bool `json:"primary,omitempty"` + + // Symbol: Symobol of the organization. + Symbol string `json:"symbol,omitempty"` + + // Title: Title (designation) of the user in the organization. + Title string `json:"title,omitempty"` + + // Type: Each entry can have a type which indicates standard types of + // that entry. For example organization could be of school, work etc. In + // addition to the standard type, an entry can have a custom type and + // can give it any name. Such types should have the CUSTOM value as type + // and also have a CustomType value. + Type string `json:"type,omitempty"` +} + +type UserPhone struct { + // CustomType: Custom Type. + CustomType string `json:"customType,omitempty"` + + // Primary: If this is user's primary phone or not. + Primary bool `json:"primary,omitempty"` + + // Type: Each entry can have a type which indicates standard types of + // that entry. For example phone could be of home_fax, work, mobile etc. + // In addition to the standard type, an entry can have a custom type and + // can give it any name. Such types should have the CUSTOM value as type + // and also have a customType value. + Type string `json:"type,omitempty"` + + // Value: Phone number. + Value string `json:"value,omitempty"` +} + +type UserPhoto struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Height: Height in pixels of the photo + Height int64 `json:"height,omitempty"` + + // Id: Unique identifier of User (Read-only) + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // MimeType: Mime Type of the photo + MimeType string `json:"mimeType,omitempty"` + + // PhotoData: Base64 encoded photo data + PhotoData string `json:"photoData,omitempty"` + + // PrimaryEmail: Primary email of User (Read-only) + PrimaryEmail string `json:"primaryEmail,omitempty"` + + // Width: Width in pixels of the photo + Width int64 `json:"width,omitempty"` +} + +type UserRelation struct { + // CustomType: Custom Type. + CustomType string `json:"customType,omitempty"` + + // Type: The relation of the user. Some of the possible values are + // mother, father, sister, brother, manager, assistant, partner. + Type string `json:"type,omitempty"` + + // Value: The name of the relation. + Value string `json:"value,omitempty"` +} + +type UserUndelete struct { + // OrgUnitPath: OrgUnit of User + OrgUnitPath string `json:"orgUnitPath,omitempty"` +} + +type Users struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token used to access next page of this result. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Trigger_event: Event that triggered this response (only used in case + // of Push Response) + Trigger_event string `json:"trigger_event,omitempty"` + + // Users: List of user objects. + Users []*User `json:"users,omitempty"` +} + +type VerificationCode struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Kind: The type of the resource. This is always + // admin#directory#verificationCode. + Kind string `json:"kind,omitempty"` + + // UserId: The obfuscated unique ID of the user. + UserId string `json:"userId,omitempty"` + + // VerificationCode: A current verification code for the user. + // Invalidated or used verification codes are not returned as part of + // the result. + VerificationCode string `json:"verificationCode,omitempty"` +} + +type VerificationCodes struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Items: A list of verification code resources. + Items []*VerificationCode `json:"items,omitempty"` + + // Kind: The type of the resource. This is always + // admin#directory#verificationCodesList. + Kind string `json:"kind,omitempty"` +} + +// method id "directory.asps.delete": + +type AspsDeleteCall struct { + s *Service + userKey string + codeId int64 + opt_ map[string]interface{} +} + +// Delete: Delete an ASP issued by a user. +func (r *AspsService) Delete(userKey string, codeId int64) *AspsDeleteCall { + c := &AspsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + c.codeId = codeId + return c +} + +func (c *AspsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/asps/{codeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{codeId}", strconv.FormatInt(c.codeId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete an ASP issued by a user.", + // "httpMethod": "DELETE", + // "id": "directory.asps.delete", + // "parameterOrder": [ + // "userKey", + // "codeId" + // ], + // "parameters": { + // "codeId": { + // "description": "The unique ID of the ASP to be deleted.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "userKey": { + // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/asps/{codeId}", + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user.security" + // ] + // } + +} + +// method id "directory.asps.get": + +type AspsGetCall struct { + s *Service + userKey string + codeId int64 + opt_ map[string]interface{} +} + +// Get: Get information about an ASP issued by a user. +func (r *AspsService) Get(userKey string, codeId int64) *AspsGetCall { + c := &AspsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + c.codeId = codeId + return c +} + +func (c *AspsGetCall) Do() (*Asp, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/asps/{codeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{codeId}", strconv.FormatInt(c.codeId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Asp) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get information about an ASP issued by a user.", + // "httpMethod": "GET", + // "id": "directory.asps.get", + // "parameterOrder": [ + // "userKey", + // "codeId" + // ], + // "parameters": { + // "codeId": { + // "description": "The unique ID of the ASP.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "userKey": { + // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/asps/{codeId}", + // "response": { + // "$ref": "Asp" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user.security" + // ] + // } + +} + +// method id "directory.asps.list": + +type AspsListCall struct { + s *Service + userKey string + opt_ map[string]interface{} +} + +// List: List the ASPs issued by a user. +func (r *AspsService) List(userKey string) *AspsListCall { + c := &AspsListCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + return c +} + +func (c *AspsListCall) Do() (*Asps, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/asps") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Asps) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the ASPs issued by a user.", + // "httpMethod": "GET", + // "id": "directory.asps.list", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "userKey": { + // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/asps", + // "response": { + // "$ref": "Asps" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user.security" + // ] + // } + +} + +// method id "admin.channels.stop": + +type ChannelsStopCall struct { + s *Service + channel *Channel + opt_ map[string]interface{} +} + +// Stop: Stop watching resources through this channel +func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall { + c := &ChannelsStopCall{s: r.s, opt_: make(map[string]interface{})} + c.channel = channel + return c +} + +func (c *ChannelsStopCall) Do() error { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + if err != nil { + return err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "/admin/directory_v1/channels/stop") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Stop watching resources through this channel", + // "httpMethod": "POST", + // "id": "admin.channels.stop", + // "path": "/admin/directory_v1/channels/stop", + // "request": { + // "$ref": "Channel", + // "parameterName": "resource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user", + // "https://www.googleapis.com/auth/admin.directory.user.alias", + // "https://www.googleapis.com/auth/admin.directory.user.alias.readonly", + // "https://www.googleapis.com/auth/admin.directory.user.readonly" + // ] + // } + +} + +// method id "directory.chromeosdevices.get": + +type ChromeosdevicesGetCall struct { + s *Service + customerId string + deviceId string + opt_ map[string]interface{} +} + +// Get: Retrieve Chrome OS Device +func (r *ChromeosdevicesService) Get(customerId string, deviceId string) *ChromeosdevicesGetCall { + c := &ChromeosdevicesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.deviceId = deviceId + return c +} + +// Projection sets the optional parameter "projection": Restrict +// information returned to a set of selected fields. +func (c *ChromeosdevicesGetCall) Projection(projection string) *ChromeosdevicesGetCall { + c.opt_["projection"] = projection + return c +} + +func (c *ChromeosdevicesGetCall) Do() (*ChromeOsDevice, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/devices/chromeos/{deviceId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{deviceId}", url.QueryEscape(c.deviceId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ChromeOsDevice) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve Chrome OS Device", + // "httpMethod": "GET", + // "id": "directory.chromeosdevices.get", + // "parameterOrder": [ + // "customerId", + // "deviceId" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "deviceId": { + // "description": "Immutable id of Chrome OS Device", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "Restrict information returned to a set of selected fields.", + // "enum": [ + // "BASIC", + // "FULL" + // ], + // "enumDescriptions": [ + // "Includes only the basic metadata fields (e.g., deviceId, serialNumber, status, and user)", + // "Includes all metadata fields" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/devices/chromeos/{deviceId}", + // "response": { + // "$ref": "ChromeOsDevice" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.device.chromeos", + // "https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly" + // ] + // } + +} + +// method id "directory.chromeosdevices.list": + +type ChromeosdevicesListCall struct { + s *Service + customerId string + opt_ map[string]interface{} +} + +// List: Retrieve all Chrome OS Devices of a customer (paginated) +func (r *ChromeosdevicesService) List(customerId string) *ChromeosdevicesListCall { + c := &ChromeosdevicesListCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. Default is 100 +func (c *ChromeosdevicesListCall) MaxResults(maxResults int64) *ChromeosdevicesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Column to use for +// sorting results +func (c *ChromeosdevicesListCall) OrderBy(orderBy string) *ChromeosdevicesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Token to specify +// next page in the list +func (c *ChromeosdevicesListCall) PageToken(pageToken string) *ChromeosdevicesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Projection sets the optional parameter "projection": Restrict +// information returned to a set of selected fields. +func (c *ChromeosdevicesListCall) Projection(projection string) *ChromeosdevicesListCall { + c.opt_["projection"] = projection + return c +} + +// Query sets the optional parameter "query": Search string in the +// format given at +// http://support.google.com/chromeos/a/bin/answer.py?hl=en&answer=169833 +// 3 +func (c *ChromeosdevicesListCall) Query(query string) *ChromeosdevicesListCall { + c.opt_["query"] = query + return c +} + +// SortOrder sets the optional parameter "sortOrder": Whether to return +// results in ascending or descending order. Only of use when orderBy is +// also used +func (c *ChromeosdevicesListCall) SortOrder(sortOrder string) *ChromeosdevicesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *ChromeosdevicesListCall) Do() (*ChromeOsDevices, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["query"]; ok { + params.Set("query", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/devices/chromeos") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ChromeOsDevices) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve all Chrome OS Devices of a customer (paginated)", + // "httpMethod": "GET", + // "id": "directory.chromeosdevices.list", + // "parameterOrder": [ + // "customerId" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return. Default is 100", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Column to use for sorting results", + // "enum": [ + // "annotatedLocation", + // "annotatedUser", + // "lastSync", + // "notes", + // "serialNumber", + // "status", + // "supportEndDate" + // ], + // "enumDescriptions": [ + // "Chromebook location as annotated by the administrator.", + // "Chromebook user as annotated by administrator.", + // "Chromebook last sync.", + // "Chromebook notes as annotated by the administrator.", + // "Chromebook Serial Number.", + // "Chromebook status.", + // "Chromebook support end date." + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Token to specify next page in the list", + // "location": "query", + // "type": "string" + // }, + // "projection": { + // "description": "Restrict information returned to a set of selected fields.", + // "enum": [ + // "BASIC", + // "FULL" + // ], + // "enumDescriptions": [ + // "Includes only the basic metadata fields (e.g., deviceId, serialNumber, status, and user)", + // "Includes all metadata fields" + // ], + // "location": "query", + // "type": "string" + // }, + // "query": { + // "description": "Search string in the format given at http://support.google.com/chromeos/a/bin/answer.py?hl=en\u0026answer=1698333", + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Whether to return results in ascending or descending order. Only of use when orderBy is also used", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "Ascending order.", + // "Descending order." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/devices/chromeos", + // "response": { + // "$ref": "ChromeOsDevices" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.device.chromeos", + // "https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly" + // ] + // } + +} + +// method id "directory.chromeosdevices.patch": + +type ChromeosdevicesPatchCall struct { + s *Service + customerId string + deviceId string + chromeosdevice *ChromeOsDevice + opt_ map[string]interface{} +} + +// Patch: Update Chrome OS Device. This method supports patch semantics. +func (r *ChromeosdevicesService) Patch(customerId string, deviceId string, chromeosdevice *ChromeOsDevice) *ChromeosdevicesPatchCall { + c := &ChromeosdevicesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.deviceId = deviceId + c.chromeosdevice = chromeosdevice + return c +} + +// Projection sets the optional parameter "projection": Restrict +// information returned to a set of selected fields. +func (c *ChromeosdevicesPatchCall) Projection(projection string) *ChromeosdevicesPatchCall { + c.opt_["projection"] = projection + return c +} + +func (c *ChromeosdevicesPatchCall) Do() (*ChromeOsDevice, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.chromeosdevice) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/devices/chromeos/{deviceId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{deviceId}", url.QueryEscape(c.deviceId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ChromeOsDevice) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update Chrome OS Device. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "directory.chromeosdevices.patch", + // "parameterOrder": [ + // "customerId", + // "deviceId" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "deviceId": { + // "description": "Immutable id of Chrome OS Device", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "Restrict information returned to a set of selected fields.", + // "enum": [ + // "BASIC", + // "FULL" + // ], + // "enumDescriptions": [ + // "Includes only the basic metadata fields (e.g., deviceId, serialNumber, status, and user)", + // "Includes all metadata fields" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/devices/chromeos/{deviceId}", + // "request": { + // "$ref": "ChromeOsDevice" + // }, + // "response": { + // "$ref": "ChromeOsDevice" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.device.chromeos" + // ] + // } + +} + +// method id "directory.chromeosdevices.update": + +type ChromeosdevicesUpdateCall struct { + s *Service + customerId string + deviceId string + chromeosdevice *ChromeOsDevice + opt_ map[string]interface{} +} + +// Update: Update Chrome OS Device +func (r *ChromeosdevicesService) Update(customerId string, deviceId string, chromeosdevice *ChromeOsDevice) *ChromeosdevicesUpdateCall { + c := &ChromeosdevicesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.deviceId = deviceId + c.chromeosdevice = chromeosdevice + return c +} + +// Projection sets the optional parameter "projection": Restrict +// information returned to a set of selected fields. +func (c *ChromeosdevicesUpdateCall) Projection(projection string) *ChromeosdevicesUpdateCall { + c.opt_["projection"] = projection + return c +} + +func (c *ChromeosdevicesUpdateCall) Do() (*ChromeOsDevice, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.chromeosdevice) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/devices/chromeos/{deviceId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{deviceId}", url.QueryEscape(c.deviceId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ChromeOsDevice) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update Chrome OS Device", + // "httpMethod": "PUT", + // "id": "directory.chromeosdevices.update", + // "parameterOrder": [ + // "customerId", + // "deviceId" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "deviceId": { + // "description": "Immutable id of Chrome OS Device", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "Restrict information returned to a set of selected fields.", + // "enum": [ + // "BASIC", + // "FULL" + // ], + // "enumDescriptions": [ + // "Includes only the basic metadata fields (e.g., deviceId, serialNumber, status, and user)", + // "Includes all metadata fields" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/devices/chromeos/{deviceId}", + // "request": { + // "$ref": "ChromeOsDevice" + // }, + // "response": { + // "$ref": "ChromeOsDevice" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.device.chromeos" + // ] + // } + +} + +// method id "directory.groups.delete": + +type GroupsDeleteCall struct { + s *Service + groupKey string + opt_ map[string]interface{} +} + +// Delete: Delete Group +func (r *GroupsService) Delete(groupKey string) *GroupsDeleteCall { + c := &GroupsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.groupKey = groupKey + return c +} + +func (c *GroupsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{groupKey}", url.QueryEscape(c.groupKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete Group", + // "httpMethod": "DELETE", + // "id": "directory.groups.delete", + // "parameterOrder": [ + // "groupKey" + // ], + // "parameters": { + // "groupKey": { + // "description": "Email or immutable Id of the group", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "groups/{groupKey}", + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.group" + // ] + // } + +} + +// method id "directory.groups.get": + +type GroupsGetCall struct { + s *Service + groupKey string + opt_ map[string]interface{} +} + +// Get: Retrieve Group +func (r *GroupsService) Get(groupKey string) *GroupsGetCall { + c := &GroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.groupKey = groupKey + return c +} + +func (c *GroupsGetCall) Do() (*Group, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{groupKey}", url.QueryEscape(c.groupKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Group) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve Group", + // "httpMethod": "GET", + // "id": "directory.groups.get", + // "parameterOrder": [ + // "groupKey" + // ], + // "parameters": { + // "groupKey": { + // "description": "Email or immutable Id of the group", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "groups/{groupKey}", + // "response": { + // "$ref": "Group" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.group", + // "https://www.googleapis.com/auth/admin.directory.group.readonly" + // ] + // } + +} + +// method id "directory.groups.insert": + +type GroupsInsertCall struct { + s *Service + group *Group + opt_ map[string]interface{} +} + +// Insert: Create Group +func (r *GroupsService) Insert(group *Group) *GroupsInsertCall { + c := &GroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.group = group + return c +} + +func (c *GroupsInsertCall) Do() (*Group, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "groups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Group) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create Group", + // "httpMethod": "POST", + // "id": "directory.groups.insert", + // "path": "groups", + // "request": { + // "$ref": "Group" + // }, + // "response": { + // "$ref": "Group" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.group" + // ] + // } + +} + +// method id "directory.groups.list": + +type GroupsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieve all groups in a domain (paginated) +func (r *GroupsService) List() *GroupsListCall { + c := &GroupsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Customer sets the optional parameter "customer": Immutable id of the +// Google Apps account. In case of multi-domain, to fetch all groups for +// a customer, fill this field instead of domain. +func (c *GroupsListCall) Customer(customer string) *GroupsListCall { + c.opt_["customer"] = customer + return c +} + +// Domain sets the optional parameter "domain": Name of the domain. Fill +// this field to get groups from only this domain. To return all groups +// in a multi-domain fill customer field instead. +func (c *GroupsListCall) Domain(domain string) *GroupsListCall { + c.opt_["domain"] = domain + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. Default is 200 +func (c *GroupsListCall) MaxResults(maxResults int64) *GroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Token to specify +// next page in the list +func (c *GroupsListCall) PageToken(pageToken string) *GroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// UserKey sets the optional parameter "userKey": Email or immutable Id +// of the user if only those groups are to be listed, the given user is +// a member of. If Id, it should match with id of user object +func (c *GroupsListCall) UserKey(userKey string) *GroupsListCall { + c.opt_["userKey"] = userKey + return c +} + +func (c *GroupsListCall) Do() (*Groups, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["customer"]; ok { + params.Set("customer", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["domain"]; ok { + params.Set("domain", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["userKey"]; ok { + params.Set("userKey", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "groups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Groups) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve all groups in a domain (paginated)", + // "httpMethod": "GET", + // "id": "directory.groups.list", + // "parameters": { + // "customer": { + // "description": "Immutable id of the Google Apps account. In case of multi-domain, to fetch all groups for a customer, fill this field instead of domain.", + // "location": "query", + // "type": "string" + // }, + // "domain": { + // "description": "Name of the domain. Fill this field to get groups from only this domain. To return all groups in a multi-domain fill customer field instead.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return. Default is 200", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Token to specify next page in the list", + // "location": "query", + // "type": "string" + // }, + // "userKey": { + // "description": "Email or immutable Id of the user if only those groups are to be listed, the given user is a member of. If Id, it should match with id of user object", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "groups", + // "response": { + // "$ref": "Groups" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.group", + // "https://www.googleapis.com/auth/admin.directory.group.readonly" + // ] + // } + +} + +// method id "directory.groups.patch": + +type GroupsPatchCall struct { + s *Service + groupKey string + group *Group + opt_ map[string]interface{} +} + +// Patch: Update Group. This method supports patch semantics. +func (r *GroupsService) Patch(groupKey string, group *Group) *GroupsPatchCall { + c := &GroupsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.groupKey = groupKey + c.group = group + return c +} + +func (c *GroupsPatchCall) Do() (*Group, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{groupKey}", url.QueryEscape(c.groupKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Group) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update Group. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "directory.groups.patch", + // "parameterOrder": [ + // "groupKey" + // ], + // "parameters": { + // "groupKey": { + // "description": "Email or immutable Id of the group. If Id, it should match with id of group object", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "groups/{groupKey}", + // "request": { + // "$ref": "Group" + // }, + // "response": { + // "$ref": "Group" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.group" + // ] + // } + +} + +// method id "directory.groups.update": + +type GroupsUpdateCall struct { + s *Service + groupKey string + group *Group + opt_ map[string]interface{} +} + +// Update: Update Group +func (r *GroupsService) Update(groupKey string, group *Group) *GroupsUpdateCall { + c := &GroupsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.groupKey = groupKey + c.group = group + return c +} + +func (c *GroupsUpdateCall) Do() (*Group, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{groupKey}", url.QueryEscape(c.groupKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Group) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update Group", + // "httpMethod": "PUT", + // "id": "directory.groups.update", + // "parameterOrder": [ + // "groupKey" + // ], + // "parameters": { + // "groupKey": { + // "description": "Email or immutable Id of the group. If Id, it should match with id of group object", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "groups/{groupKey}", + // "request": { + // "$ref": "Group" + // }, + // "response": { + // "$ref": "Group" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.group" + // ] + // } + +} + +// method id "directory.groups.aliases.delete": + +type GroupsAliasesDeleteCall struct { + s *Service + groupKey string + alias string + opt_ map[string]interface{} +} + +// Delete: Remove a alias for the group +func (r *GroupsAliasesService) Delete(groupKey string, alias string) *GroupsAliasesDeleteCall { + c := &GroupsAliasesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.groupKey = groupKey + c.alias = alias + return c +} + +func (c *GroupsAliasesDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}/aliases/{alias}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{groupKey}", url.QueryEscape(c.groupKey), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{alias}", url.QueryEscape(c.alias), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Remove a alias for the group", + // "httpMethod": "DELETE", + // "id": "directory.groups.aliases.delete", + // "parameterOrder": [ + // "groupKey", + // "alias" + // ], + // "parameters": { + // "alias": { + // "description": "The alias to be removed", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "groupKey": { + // "description": "Email or immutable Id of the group", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "groups/{groupKey}/aliases/{alias}", + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.group" + // ] + // } + +} + +// method id "directory.groups.aliases.insert": + +type GroupsAliasesInsertCall struct { + s *Service + groupKey string + alias *Alias + opt_ map[string]interface{} +} + +// Insert: Add a alias for the group +func (r *GroupsAliasesService) Insert(groupKey string, alias *Alias) *GroupsAliasesInsertCall { + c := &GroupsAliasesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.groupKey = groupKey + c.alias = alias + return c +} + +func (c *GroupsAliasesInsertCall) Do() (*Alias, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.alias) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}/aliases") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{groupKey}", url.QueryEscape(c.groupKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Alias) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add a alias for the group", + // "httpMethod": "POST", + // "id": "directory.groups.aliases.insert", + // "parameterOrder": [ + // "groupKey" + // ], + // "parameters": { + // "groupKey": { + // "description": "Email or immutable Id of the group", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "groups/{groupKey}/aliases", + // "request": { + // "$ref": "Alias" + // }, + // "response": { + // "$ref": "Alias" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.group" + // ] + // } + +} + +// method id "directory.groups.aliases.list": + +type GroupsAliasesListCall struct { + s *Service + groupKey string + opt_ map[string]interface{} +} + +// List: List all aliases for a group +func (r *GroupsAliasesService) List(groupKey string) *GroupsAliasesListCall { + c := &GroupsAliasesListCall{s: r.s, opt_: make(map[string]interface{})} + c.groupKey = groupKey + return c +} + +func (c *GroupsAliasesListCall) Do() (*Aliases, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}/aliases") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{groupKey}", url.QueryEscape(c.groupKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Aliases) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all aliases for a group", + // "httpMethod": "GET", + // "id": "directory.groups.aliases.list", + // "parameterOrder": [ + // "groupKey" + // ], + // "parameters": { + // "groupKey": { + // "description": "Email or immutable Id of the group", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "groups/{groupKey}/aliases", + // "response": { + // "$ref": "Aliases" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.group", + // "https://www.googleapis.com/auth/admin.directory.group.readonly" + // ], + // "supportsSubscription": true + // } + +} + +// method id "directory.members.delete": + +type MembersDeleteCall struct { + s *Service + groupKey string + memberKey string + opt_ map[string]interface{} +} + +// Delete: Remove membership. +func (r *MembersService) Delete(groupKey string, memberKey string) *MembersDeleteCall { + c := &MembersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.groupKey = groupKey + c.memberKey = memberKey + return c +} + +func (c *MembersDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}/members/{memberKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{groupKey}", url.QueryEscape(c.groupKey), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{memberKey}", url.QueryEscape(c.memberKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Remove membership.", + // "httpMethod": "DELETE", + // "id": "directory.members.delete", + // "parameterOrder": [ + // "groupKey", + // "memberKey" + // ], + // "parameters": { + // "groupKey": { + // "description": "Email or immutable Id of the group", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "memberKey": { + // "description": "Email or immutable Id of the member", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "groups/{groupKey}/members/{memberKey}", + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.group", + // "https://www.googleapis.com/auth/admin.directory.group.member" + // ] + // } + +} + +// method id "directory.members.get": + +type MembersGetCall struct { + s *Service + groupKey string + memberKey string + opt_ map[string]interface{} +} + +// Get: Retrieve Group Member +func (r *MembersService) Get(groupKey string, memberKey string) *MembersGetCall { + c := &MembersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.groupKey = groupKey + c.memberKey = memberKey + return c +} + +func (c *MembersGetCall) Do() (*Member, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}/members/{memberKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{groupKey}", url.QueryEscape(c.groupKey), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{memberKey}", url.QueryEscape(c.memberKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Member) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve Group Member", + // "httpMethod": "GET", + // "id": "directory.members.get", + // "parameterOrder": [ + // "groupKey", + // "memberKey" + // ], + // "parameters": { + // "groupKey": { + // "description": "Email or immutable Id of the group", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "memberKey": { + // "description": "Email or immutable Id of the member", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "groups/{groupKey}/members/{memberKey}", + // "response": { + // "$ref": "Member" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.group", + // "https://www.googleapis.com/auth/admin.directory.group.member", + // "https://www.googleapis.com/auth/admin.directory.group.member.readonly", + // "https://www.googleapis.com/auth/admin.directory.group.readonly" + // ] + // } + +} + +// method id "directory.members.insert": + +type MembersInsertCall struct { + s *Service + groupKey string + member *Member + opt_ map[string]interface{} +} + +// Insert: Add user to the specified group. +func (r *MembersService) Insert(groupKey string, member *Member) *MembersInsertCall { + c := &MembersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.groupKey = groupKey + c.member = member + return c +} + +func (c *MembersInsertCall) Do() (*Member, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.member) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}/members") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{groupKey}", url.QueryEscape(c.groupKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Member) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add user to the specified group.", + // "httpMethod": "POST", + // "id": "directory.members.insert", + // "parameterOrder": [ + // "groupKey" + // ], + // "parameters": { + // "groupKey": { + // "description": "Email or immutable Id of the group", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "groups/{groupKey}/members", + // "request": { + // "$ref": "Member" + // }, + // "response": { + // "$ref": "Member" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.group", + // "https://www.googleapis.com/auth/admin.directory.group.member" + // ] + // } + +} + +// method id "directory.members.list": + +type MembersListCall struct { + s *Service + groupKey string + opt_ map[string]interface{} +} + +// List: Retrieve all members in a group (paginated) +func (r *MembersService) List(groupKey string) *MembersListCall { + c := &MembersListCall{s: r.s, opt_: make(map[string]interface{})} + c.groupKey = groupKey + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. Default is 200 +func (c *MembersListCall) MaxResults(maxResults int64) *MembersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Token to specify +// next page in the list +func (c *MembersListCall) PageToken(pageToken string) *MembersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Roles sets the optional parameter "roles": Comma separated role +// values to filter list results on. +func (c *MembersListCall) Roles(roles string) *MembersListCall { + c.opt_["roles"] = roles + return c +} + +func (c *MembersListCall) Do() (*Members, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["roles"]; ok { + params.Set("roles", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}/members") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{groupKey}", url.QueryEscape(c.groupKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Members) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve all members in a group (paginated)", + // "httpMethod": "GET", + // "id": "directory.members.list", + // "parameterOrder": [ + // "groupKey" + // ], + // "parameters": { + // "groupKey": { + // "description": "Email or immutable Id of the group", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return. Default is 200", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Token to specify next page in the list", + // "location": "query", + // "type": "string" + // }, + // "roles": { + // "description": "Comma separated role values to filter list results on.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "groups/{groupKey}/members", + // "response": { + // "$ref": "Members" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.group", + // "https://www.googleapis.com/auth/admin.directory.group.member", + // "https://www.googleapis.com/auth/admin.directory.group.member.readonly", + // "https://www.googleapis.com/auth/admin.directory.group.readonly" + // ] + // } + +} + +// method id "directory.members.patch": + +type MembersPatchCall struct { + s *Service + groupKey string + memberKey string + member *Member + opt_ map[string]interface{} +} + +// Patch: Update membership of a user in the specified group. This +// method supports patch semantics. +func (r *MembersService) Patch(groupKey string, memberKey string, member *Member) *MembersPatchCall { + c := &MembersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.groupKey = groupKey + c.memberKey = memberKey + c.member = member + return c +} + +func (c *MembersPatchCall) Do() (*Member, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.member) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}/members/{memberKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{groupKey}", url.QueryEscape(c.groupKey), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{memberKey}", url.QueryEscape(c.memberKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Member) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update membership of a user in the specified group. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "directory.members.patch", + // "parameterOrder": [ + // "groupKey", + // "memberKey" + // ], + // "parameters": { + // "groupKey": { + // "description": "Email or immutable Id of the group. If Id, it should match with id of group object", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "memberKey": { + // "description": "Email or immutable Id of the user. If Id, it should match with id of member object", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "groups/{groupKey}/members/{memberKey}", + // "request": { + // "$ref": "Member" + // }, + // "response": { + // "$ref": "Member" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.group", + // "https://www.googleapis.com/auth/admin.directory.group.member" + // ] + // } + +} + +// method id "directory.members.update": + +type MembersUpdateCall struct { + s *Service + groupKey string + memberKey string + member *Member + opt_ map[string]interface{} +} + +// Update: Update membership of a user in the specified group. +func (r *MembersService) Update(groupKey string, memberKey string, member *Member) *MembersUpdateCall { + c := &MembersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.groupKey = groupKey + c.memberKey = memberKey + c.member = member + return c +} + +func (c *MembersUpdateCall) Do() (*Member, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.member) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}/members/{memberKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{groupKey}", url.QueryEscape(c.groupKey), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{memberKey}", url.QueryEscape(c.memberKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Member) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update membership of a user in the specified group.", + // "httpMethod": "PUT", + // "id": "directory.members.update", + // "parameterOrder": [ + // "groupKey", + // "memberKey" + // ], + // "parameters": { + // "groupKey": { + // "description": "Email or immutable Id of the group. If Id, it should match with id of group object", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "memberKey": { + // "description": "Email or immutable Id of the user. If Id, it should match with id of member object", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "groups/{groupKey}/members/{memberKey}", + // "request": { + // "$ref": "Member" + // }, + // "response": { + // "$ref": "Member" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.group", + // "https://www.googleapis.com/auth/admin.directory.group.member" + // ] + // } + +} + +// method id "directory.mobiledevices.action": + +type MobiledevicesActionCall struct { + s *Service + customerId string + resourceId string + mobiledeviceaction *MobileDeviceAction + opt_ map[string]interface{} +} + +// Action: Take action on Mobile Device +func (r *MobiledevicesService) Action(customerId string, resourceId string, mobiledeviceaction *MobileDeviceAction) *MobiledevicesActionCall { + c := &MobiledevicesActionCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.resourceId = resourceId + c.mobiledeviceaction = mobiledeviceaction + return c +} + +func (c *MobiledevicesActionCall) Do() error { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.mobiledeviceaction) + if err != nil { + return err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/devices/mobile/{resourceId}/action") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{resourceId}", url.QueryEscape(c.resourceId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Take action on Mobile Device", + // "httpMethod": "POST", + // "id": "directory.mobiledevices.action", + // "parameterOrder": [ + // "customerId", + // "resourceId" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceId": { + // "description": "Immutable id of Mobile Device", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/devices/mobile/{resourceId}/action", + // "request": { + // "$ref": "MobileDeviceAction" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.device.mobile", + // "https://www.googleapis.com/auth/admin.directory.device.mobile.action" + // ] + // } + +} + +// method id "directory.mobiledevices.delete": + +type MobiledevicesDeleteCall struct { + s *Service + customerId string + resourceId string + opt_ map[string]interface{} +} + +// Delete: Delete Mobile Device +func (r *MobiledevicesService) Delete(customerId string, resourceId string) *MobiledevicesDeleteCall { + c := &MobiledevicesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.resourceId = resourceId + return c +} + +func (c *MobiledevicesDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/devices/mobile/{resourceId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{resourceId}", url.QueryEscape(c.resourceId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete Mobile Device", + // "httpMethod": "DELETE", + // "id": "directory.mobiledevices.delete", + // "parameterOrder": [ + // "customerId", + // "resourceId" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceId": { + // "description": "Immutable id of Mobile Device", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/devices/mobile/{resourceId}", + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.device.mobile" + // ] + // } + +} + +// method id "directory.mobiledevices.get": + +type MobiledevicesGetCall struct { + s *Service + customerId string + resourceId string + opt_ map[string]interface{} +} + +// Get: Retrieve Mobile Device +func (r *MobiledevicesService) Get(customerId string, resourceId string) *MobiledevicesGetCall { + c := &MobiledevicesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.resourceId = resourceId + return c +} + +// Projection sets the optional parameter "projection": Restrict +// information returned to a set of selected fields. +func (c *MobiledevicesGetCall) Projection(projection string) *MobiledevicesGetCall { + c.opt_["projection"] = projection + return c +} + +func (c *MobiledevicesGetCall) Do() (*MobileDevice, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/devices/mobile/{resourceId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{resourceId}", url.QueryEscape(c.resourceId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(MobileDevice) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve Mobile Device", + // "httpMethod": "GET", + // "id": "directory.mobiledevices.get", + // "parameterOrder": [ + // "customerId", + // "resourceId" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "Restrict information returned to a set of selected fields.", + // "enum": [ + // "BASIC", + // "FULL" + // ], + // "enumDescriptions": [ + // "Includes only the basic metadata fields (e.g., deviceId, model, status, type, and status)", + // "Includes all metadata fields" + // ], + // "location": "query", + // "type": "string" + // }, + // "resourceId": { + // "description": "Immutable id of Mobile Device", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/devices/mobile/{resourceId}", + // "response": { + // "$ref": "MobileDevice" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.device.mobile", + // "https://www.googleapis.com/auth/admin.directory.device.mobile.action", + // "https://www.googleapis.com/auth/admin.directory.device.mobile.readonly" + // ] + // } + +} + +// method id "directory.mobiledevices.list": + +type MobiledevicesListCall struct { + s *Service + customerId string + opt_ map[string]interface{} +} + +// List: Retrieve all Mobile Devices of a customer (paginated) +func (r *MobiledevicesService) List(customerId string) *MobiledevicesListCall { + c := &MobiledevicesListCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. Default is 100 +func (c *MobiledevicesListCall) MaxResults(maxResults int64) *MobiledevicesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Column to use for +// sorting results +func (c *MobiledevicesListCall) OrderBy(orderBy string) *MobiledevicesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Token to specify +// next page in the list +func (c *MobiledevicesListCall) PageToken(pageToken string) *MobiledevicesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Projection sets the optional parameter "projection": Restrict +// information returned to a set of selected fields. +func (c *MobiledevicesListCall) Projection(projection string) *MobiledevicesListCall { + c.opt_["projection"] = projection + return c +} + +// Query sets the optional parameter "query": Search string in the +// format given at +// http://support.google.com/a/bin/answer.py?hl=en&answer=1408863#search +func (c *MobiledevicesListCall) Query(query string) *MobiledevicesListCall { + c.opt_["query"] = query + return c +} + +// SortOrder sets the optional parameter "sortOrder": Whether to return +// results in ascending or descending order. Only of use when orderBy is +// also used +func (c *MobiledevicesListCall) SortOrder(sortOrder string) *MobiledevicesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *MobiledevicesListCall) Do() (*MobileDevices, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["query"]; ok { + params.Set("query", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/devices/mobile") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(MobileDevices) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve all Mobile Devices of a customer (paginated)", + // "httpMethod": "GET", + // "id": "directory.mobiledevices.list", + // "parameterOrder": [ + // "customerId" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return. Default is 100", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Column to use for sorting results", + // "enum": [ + // "deviceId", + // "email", + // "lastSync", + // "model", + // "name", + // "os", + // "status", + // "type" + // ], + // "enumDescriptions": [ + // "Mobile Device serial number.", + // "Owner user email.", + // "Last policy settings sync date time of the device.", + // "Mobile Device model.", + // "Owner user name.", + // "Mobile operating system.", + // "Status of the device.", + // "Type of the device." + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Token to specify next page in the list", + // "location": "query", + // "type": "string" + // }, + // "projection": { + // "description": "Restrict information returned to a set of selected fields.", + // "enum": [ + // "BASIC", + // "FULL" + // ], + // "enumDescriptions": [ + // "Includes only the basic metadata fields (e.g., deviceId, model, status, type, and status)", + // "Includes all metadata fields" + // ], + // "location": "query", + // "type": "string" + // }, + // "query": { + // "description": "Search string in the format given at http://support.google.com/a/bin/answer.py?hl=en\u0026answer=1408863#search", + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Whether to return results in ascending or descending order. Only of use when orderBy is also used", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "Ascending order.", + // "Descending order." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/devices/mobile", + // "response": { + // "$ref": "MobileDevices" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.device.mobile", + // "https://www.googleapis.com/auth/admin.directory.device.mobile.action", + // "https://www.googleapis.com/auth/admin.directory.device.mobile.readonly" + // ] + // } + +} + +// method id "directory.notifications.delete": + +type NotificationsDeleteCall struct { + s *Service + customer string + notificationId string + opt_ map[string]interface{} +} + +// Delete: Deletes a notification +func (r *NotificationsService) Delete(customer string, notificationId string) *NotificationsDeleteCall { + c := &NotificationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + c.notificationId = notificationId + return c +} + +func (c *NotificationsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/notifications/{notificationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customer}", url.QueryEscape(c.customer), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{notificationId}", url.QueryEscape(c.notificationId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a notification", + // "httpMethod": "DELETE", + // "id": "directory.notifications.delete", + // "parameterOrder": [ + // "customer", + // "notificationId" + // ], + // "parameters": { + // "customer": { + // "description": "The unique ID for the customer's Google account. The customerId is also returned as part of the Users resource.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "notificationId": { + // "description": "The unique ID of the notification.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/notifications/{notificationId}", + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.notifications" + // ] + // } + +} + +// method id "directory.notifications.get": + +type NotificationsGetCall struct { + s *Service + customer string + notificationId string + opt_ map[string]interface{} +} + +// Get: Retrieves a notification. +func (r *NotificationsService) Get(customer string, notificationId string) *NotificationsGetCall { + c := &NotificationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + c.notificationId = notificationId + return c +} + +func (c *NotificationsGetCall) Do() (*Notification, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/notifications/{notificationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customer}", url.QueryEscape(c.customer), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{notificationId}", url.QueryEscape(c.notificationId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Notification) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a notification.", + // "httpMethod": "GET", + // "id": "directory.notifications.get", + // "parameterOrder": [ + // "customer", + // "notificationId" + // ], + // "parameters": { + // "customer": { + // "description": "The unique ID for the customer's Google account. The customerId is also returned as part of the Users resource.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "notificationId": { + // "description": "The unique ID of the notification.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/notifications/{notificationId}", + // "response": { + // "$ref": "Notification" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.notifications" + // ] + // } + +} + +// method id "directory.notifications.list": + +type NotificationsListCall struct { + s *Service + customer string + opt_ map[string]interface{} +} + +// List: Retrieves a list of notifications. +func (r *NotificationsService) List(customer string) *NotificationsListCall { + c := &NotificationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + return c +} + +// Language sets the optional parameter "language": The ISO 639-1 code +// of the language notifications are returned in. The default is English +// (en). +func (c *NotificationsListCall) Language(language string) *NotificationsListCall { + c.opt_["language"] = language + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of notifications to return per page. The default is 100. +func (c *NotificationsListCall) MaxResults(maxResults int64) *NotificationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token to +// specify the page of results to retrieve. +func (c *NotificationsListCall) PageToken(pageToken string) *NotificationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *NotificationsListCall) Do() (*Notifications, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/notifications") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customer}", url.QueryEscape(c.customer), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Notifications) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of notifications.", + // "httpMethod": "GET", + // "id": "directory.notifications.list", + // "parameterOrder": [ + // "customer" + // ], + // "parameters": { + // "customer": { + // "description": "The unique ID for the customer's Google account.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The ISO 639-1 code of the language notifications are returned in. The default is English (en).", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of notifications to return per page. The default is 100.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The token to specify the page of results to retrieve.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "customer/{customer}/notifications", + // "response": { + // "$ref": "Notifications" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.notifications" + // ] + // } + +} + +// method id "directory.notifications.patch": + +type NotificationsPatchCall struct { + s *Service + customer string + notificationId string + notification *Notification + opt_ map[string]interface{} +} + +// Patch: Updates a notification. This method supports patch semantics. +func (r *NotificationsService) Patch(customer string, notificationId string, notification *Notification) *NotificationsPatchCall { + c := &NotificationsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + c.notificationId = notificationId + c.notification = notification + return c +} + +func (c *NotificationsPatchCall) Do() (*Notification, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.notification) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/notifications/{notificationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customer}", url.QueryEscape(c.customer), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{notificationId}", url.QueryEscape(c.notificationId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Notification) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a notification. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "directory.notifications.patch", + // "parameterOrder": [ + // "customer", + // "notificationId" + // ], + // "parameters": { + // "customer": { + // "description": "The unique ID for the customer's Google account.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "notificationId": { + // "description": "The unique ID of the notification.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/notifications/{notificationId}", + // "request": { + // "$ref": "Notification" + // }, + // "response": { + // "$ref": "Notification" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.notifications" + // ] + // } + +} + +// method id "directory.notifications.update": + +type NotificationsUpdateCall struct { + s *Service + customer string + notificationId string + notification *Notification + opt_ map[string]interface{} +} + +// Update: Updates a notification. +func (r *NotificationsService) Update(customer string, notificationId string, notification *Notification) *NotificationsUpdateCall { + c := &NotificationsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + c.notificationId = notificationId + c.notification = notification + return c +} + +func (c *NotificationsUpdateCall) Do() (*Notification, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.notification) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/notifications/{notificationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customer}", url.QueryEscape(c.customer), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{notificationId}", url.QueryEscape(c.notificationId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Notification) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a notification.", + // "httpMethod": "PUT", + // "id": "directory.notifications.update", + // "parameterOrder": [ + // "customer", + // "notificationId" + // ], + // "parameters": { + // "customer": { + // "description": "The unique ID for the customer's Google account.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "notificationId": { + // "description": "The unique ID of the notification.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/notifications/{notificationId}", + // "request": { + // "$ref": "Notification" + // }, + // "response": { + // "$ref": "Notification" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.notifications" + // ] + // } + +} + +// method id "directory.orgunits.delete": + +type OrgunitsDeleteCall struct { + s *Service + customerId string + orgUnitPath []string + opt_ map[string]interface{} +} + +// Delete: Remove Organization Unit +func (r *OrgunitsService) Delete(customerId string, orgUnitPath []string) *OrgunitsDeleteCall { + c := &OrgunitsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.orgUnitPath = orgUnitPath + return c +} + +func (c *OrgunitsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/orgunits{/orgUnitPath*}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{orgUnitPath}", url.QueryEscape(c.orgUnitPath[0]), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Remove Organization Unit", + // "httpMethod": "DELETE", + // "id": "directory.orgunits.delete", + // "parameterOrder": [ + // "customerId", + // "orgUnitPath" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orgUnitPath": { + // "description": "Full path of the organization unit", + // "location": "path", + // "repeated": true, + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/orgunits{/orgUnitPath*}", + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.orgunit" + // ] + // } + +} + +// method id "directory.orgunits.get": + +type OrgunitsGetCall struct { + s *Service + customerId string + orgUnitPath []string + opt_ map[string]interface{} +} + +// Get: Retrieve Organization Unit +func (r *OrgunitsService) Get(customerId string, orgUnitPath []string) *OrgunitsGetCall { + c := &OrgunitsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.orgUnitPath = orgUnitPath + return c +} + +func (c *OrgunitsGetCall) Do() (*OrgUnit, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/orgunits{/orgUnitPath*}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{orgUnitPath}", url.QueryEscape(c.orgUnitPath[0]), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OrgUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve Organization Unit", + // "httpMethod": "GET", + // "id": "directory.orgunits.get", + // "parameterOrder": [ + // "customerId", + // "orgUnitPath" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orgUnitPath": { + // "description": "Full path of the organization unit", + // "location": "path", + // "repeated": true, + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/orgunits{/orgUnitPath*}", + // "response": { + // "$ref": "OrgUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.orgunit", + // "https://www.googleapis.com/auth/admin.directory.orgunit.readonly" + // ] + // } + +} + +// method id "directory.orgunits.insert": + +type OrgunitsInsertCall struct { + s *Service + customerId string + orgunit *OrgUnit + opt_ map[string]interface{} +} + +// Insert: Add Organization Unit +func (r *OrgunitsService) Insert(customerId string, orgunit *OrgUnit) *OrgunitsInsertCall { + c := &OrgunitsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.orgunit = orgunit + return c +} + +func (c *OrgunitsInsertCall) Do() (*OrgUnit, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.orgunit) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/orgunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OrgUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add Organization Unit", + // "httpMethod": "POST", + // "id": "directory.orgunits.insert", + // "parameterOrder": [ + // "customerId" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/orgunits", + // "request": { + // "$ref": "OrgUnit" + // }, + // "response": { + // "$ref": "OrgUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.orgunit" + // ] + // } + +} + +// method id "directory.orgunits.list": + +type OrgunitsListCall struct { + s *Service + customerId string + opt_ map[string]interface{} +} + +// List: Retrieve all Organization Units +func (r *OrgunitsService) List(customerId string) *OrgunitsListCall { + c := &OrgunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + return c +} + +// OrgUnitPath sets the optional parameter "orgUnitPath": the +// URL-encoded organization unit +func (c *OrgunitsListCall) OrgUnitPath(orgUnitPath string) *OrgunitsListCall { + c.opt_["orgUnitPath"] = orgUnitPath + return c +} + +// Type sets the optional parameter "type": Whether to return all +// sub-organizations or just immediate children +func (c *OrgunitsListCall) Type(type_ string) *OrgunitsListCall { + c.opt_["type"] = type_ + return c +} + +func (c *OrgunitsListCall) Do() (*OrgUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["orgUnitPath"]; ok { + params.Set("orgUnitPath", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["type"]; ok { + params.Set("type", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/orgunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OrgUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve all Organization Units", + // "httpMethod": "GET", + // "id": "directory.orgunits.list", + // "parameterOrder": [ + // "customerId" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orgUnitPath": { + // "default": "", + // "description": "the URL-encoded organization unit", + // "location": "query", + // "type": "string" + // }, + // "type": { + // "description": "Whether to return all sub-organizations or just immediate children", + // "enum": [ + // "all", + // "children" + // ], + // "enumDescriptions": [ + // "All sub-organization units.", + // "Immediate children only (default)." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/orgunits", + // "response": { + // "$ref": "OrgUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.orgunit", + // "https://www.googleapis.com/auth/admin.directory.orgunit.readonly" + // ] + // } + +} + +// method id "directory.orgunits.patch": + +type OrgunitsPatchCall struct { + s *Service + customerId string + orgUnitPath []string + orgunit *OrgUnit + opt_ map[string]interface{} +} + +// Patch: Update Organization Unit. This method supports patch +// semantics. +func (r *OrgunitsService) Patch(customerId string, orgUnitPath []string, orgunit *OrgUnit) *OrgunitsPatchCall { + c := &OrgunitsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.orgUnitPath = orgUnitPath + c.orgunit = orgunit + return c +} + +func (c *OrgunitsPatchCall) Do() (*OrgUnit, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.orgunit) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/orgunits{/orgUnitPath*}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{orgUnitPath}", url.QueryEscape(c.orgUnitPath[0]), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OrgUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update Organization Unit. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "directory.orgunits.patch", + // "parameterOrder": [ + // "customerId", + // "orgUnitPath" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orgUnitPath": { + // "description": "Full path of the organization unit", + // "location": "path", + // "repeated": true, + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/orgunits{/orgUnitPath*}", + // "request": { + // "$ref": "OrgUnit" + // }, + // "response": { + // "$ref": "OrgUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.orgunit" + // ] + // } + +} + +// method id "directory.orgunits.update": + +type OrgunitsUpdateCall struct { + s *Service + customerId string + orgUnitPath []string + orgunit *OrgUnit + opt_ map[string]interface{} +} + +// Update: Update Organization Unit +func (r *OrgunitsService) Update(customerId string, orgUnitPath []string, orgunit *OrgUnit) *OrgunitsUpdateCall { + c := &OrgunitsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.orgUnitPath = orgUnitPath + c.orgunit = orgunit + return c +} + +func (c *OrgunitsUpdateCall) Do() (*OrgUnit, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.orgunit) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/orgunits{/orgUnitPath*}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{orgUnitPath}", url.QueryEscape(c.orgUnitPath[0]), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OrgUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update Organization Unit", + // "httpMethod": "PUT", + // "id": "directory.orgunits.update", + // "parameterOrder": [ + // "customerId", + // "orgUnitPath" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orgUnitPath": { + // "description": "Full path of the organization unit", + // "location": "path", + // "repeated": true, + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/orgunits{/orgUnitPath*}", + // "request": { + // "$ref": "OrgUnit" + // }, + // "response": { + // "$ref": "OrgUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.orgunit" + // ] + // } + +} + +// method id "directory.tokens.delete": + +type TokensDeleteCall struct { + s *Service + userKey string + clientId string + opt_ map[string]interface{} +} + +// Delete: Delete all access tokens issued by a user for an application. +func (r *TokensService) Delete(userKey string, clientId string) *TokensDeleteCall { + c := &TokensDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + c.clientId = clientId + return c +} + +func (c *TokensDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/tokens/{clientId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{clientId}", url.QueryEscape(c.clientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete all access tokens issued by a user for an application.", + // "httpMethod": "DELETE", + // "id": "directory.tokens.delete", + // "parameterOrder": [ + // "userKey", + // "clientId" + // ], + // "parameters": { + // "clientId": { + // "description": "The Client ID of the application the token is issued to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userKey": { + // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/tokens/{clientId}", + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user.security" + // ] + // } + +} + +// method id "directory.tokens.get": + +type TokensGetCall struct { + s *Service + userKey string + clientId string + opt_ map[string]interface{} +} + +// Get: Get information about an access token issued by a user. +func (r *TokensService) Get(userKey string, clientId string) *TokensGetCall { + c := &TokensGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + c.clientId = clientId + return c +} + +func (c *TokensGetCall) Do() (*Token, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/tokens/{clientId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{clientId}", url.QueryEscape(c.clientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Token) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get information about an access token issued by a user.", + // "httpMethod": "GET", + // "id": "directory.tokens.get", + // "parameterOrder": [ + // "userKey", + // "clientId" + // ], + // "parameters": { + // "clientId": { + // "description": "The Client ID of the application the token is issued to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userKey": { + // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/tokens/{clientId}", + // "response": { + // "$ref": "Token" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user.security" + // ] + // } + +} + +// method id "directory.tokens.list": + +type TokensListCall struct { + s *Service + userKey string + opt_ map[string]interface{} +} + +// List: Returns the set of current, valid verification codes for the +// specified user. +func (r *TokensService) List(userKey string) *TokensListCall { + c := &TokensListCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + return c +} + +func (c *TokensListCall) Do() (*Tokens, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/tokens") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Tokens) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the set of current, valid verification codes for the specified user.", + // "httpMethod": "GET", + // "id": "directory.tokens.list", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "userKey": { + // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/tokens", + // "response": { + // "$ref": "Tokens" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user.security" + // ] + // } + +} + +// method id "directory.users.delete": + +type UsersDeleteCall struct { + s *Service + userKey string + opt_ map[string]interface{} +} + +// Delete: Delete user +func (r *UsersService) Delete(userKey string) *UsersDeleteCall { + c := &UsersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + return c +} + +func (c *UsersDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete user", + // "httpMethod": "DELETE", + // "id": "directory.users.delete", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "userKey": { + // "description": "Email or immutable Id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}", + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user" + // ] + // } + +} + +// method id "directory.users.get": + +type UsersGetCall struct { + s *Service + userKey string + opt_ map[string]interface{} +} + +// Get: retrieve user +func (r *UsersService) Get(userKey string) *UsersGetCall { + c := &UsersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + return c +} + +func (c *UsersGetCall) Do() (*User, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(User) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "retrieve user", + // "httpMethod": "GET", + // "id": "directory.users.get", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "userKey": { + // "description": "Email or immutable Id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}", + // "response": { + // "$ref": "User" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user", + // "https://www.googleapis.com/auth/admin.directory.user.readonly" + // ] + // } + +} + +// method id "directory.users.insert": + +type UsersInsertCall struct { + s *Service + user *User + opt_ map[string]interface{} +} + +// Insert: create user. +func (r *UsersService) Insert(user *User) *UsersInsertCall { + c := &UsersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.user = user + return c +} + +func (c *UsersInsertCall) Do() (*User, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(User) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "create user.", + // "httpMethod": "POST", + // "id": "directory.users.insert", + // "path": "users", + // "request": { + // "$ref": "User" + // }, + // "response": { + // "$ref": "User" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user" + // ] + // } + +} + +// method id "directory.users.list": + +type UsersListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieve either deleted users or all users in a domain +// (paginated) +func (r *UsersService) List() *UsersListCall { + c := &UsersListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Customer sets the optional parameter "customer": Immutable id of the +// Google Apps account. In case of multi-domain, to fetch all users for +// a customer, fill this field instead of domain. +func (c *UsersListCall) Customer(customer string) *UsersListCall { + c.opt_["customer"] = customer + return c +} + +// Domain sets the optional parameter "domain": Name of the domain. Fill +// this field to get users from only this domain. To return all users in +// a multi-domain fill customer field instead. +func (c *UsersListCall) Domain(domain string) *UsersListCall { + c.opt_["domain"] = domain + return c +} + +// Event sets the optional parameter "event": Event on which +// subscription is intended (if subscribing) +func (c *UsersListCall) Event(event string) *UsersListCall { + c.opt_["event"] = event + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. Default is 100. Max allowed is 500 +func (c *UsersListCall) MaxResults(maxResults int64) *UsersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Column to use for +// sorting results +func (c *UsersListCall) OrderBy(orderBy string) *UsersListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Token to specify +// next page in the list +func (c *UsersListCall) PageToken(pageToken string) *UsersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Query sets the optional parameter "query": Query string search. +// Should be of the form "" where field can be any of supported fields, +// operators can be one of '=' for exact match or ':' for prefix match. +// For prefix match, the value should always be followed by a *. +func (c *UsersListCall) Query(query string) *UsersListCall { + c.opt_["query"] = query + return c +} + +// ShowDeleted sets the optional parameter "showDeleted": If set to true +// retrieves the list of deleted users. Default is false +func (c *UsersListCall) ShowDeleted(showDeleted string) *UsersListCall { + c.opt_["showDeleted"] = showDeleted + return c +} + +// SortOrder sets the optional parameter "sortOrder": Whether to return +// results in ascending or descending order. +func (c *UsersListCall) SortOrder(sortOrder string) *UsersListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *UsersListCall) Do() (*Users, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["customer"]; ok { + params.Set("customer", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["domain"]; ok { + params.Set("domain", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["event"]; ok { + params.Set("event", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["query"]; ok { + params.Set("query", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["showDeleted"]; ok { + params.Set("showDeleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Users) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve either deleted users or all users in a domain (paginated)", + // "httpMethod": "GET", + // "id": "directory.users.list", + // "parameters": { + // "customer": { + // "description": "Immutable id of the Google Apps account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain.", + // "location": "query", + // "type": "string" + // }, + // "domain": { + // "description": "Name of the domain. Fill this field to get users from only this domain. To return all users in a multi-domain fill customer field instead.", + // "location": "query", + // "type": "string" + // }, + // "event": { + // "description": "Event on which subscription is intended (if subscribing)", + // "enum": [ + // "add", + // "delete", + // "makeAdmin", + // "undelete", + // "update" + // ], + // "enumDescriptions": [ + // "User Created Event", + // "User Deleted Event", + // "User Admin Status Change Event", + // "User Undeleted Event", + // "User Updated Event" + // ], + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return. Default is 100. Max allowed is 500", + // "format": "int32", + // "location": "query", + // "maximum": "500", + // "minimum": "1", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Column to use for sorting results", + // "enum": [ + // "email", + // "familyName", + // "givenName" + // ], + // "enumDescriptions": [ + // "Primary email of the user.", + // "User's family name.", + // "User's given name." + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Token to specify next page in the list", + // "location": "query", + // "type": "string" + // }, + // "query": { + // "description": "Query string search. Should be of the form \"\" where field can be any of supported fields, operators can be one of '=' for exact match or ':' for prefix match. For prefix match, the value should always be followed by a *.", + // "location": "query", + // "type": "string" + // }, + // "showDeleted": { + // "description": "If set to true retrieves the list of deleted users. Default is false", + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Whether to return results in ascending or descending order.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "Ascending order.", + // "Descending order." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "users", + // "response": { + // "$ref": "Users" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user", + // "https://www.googleapis.com/auth/admin.directory.user.readonly" + // ], + // "supportsSubscription": true + // } + +} + +// method id "directory.users.makeAdmin": + +type UsersMakeAdminCall struct { + s *Service + userKey string + usermakeadmin *UserMakeAdmin + opt_ map[string]interface{} +} + +// MakeAdmin: change admin status of a user +func (r *UsersService) MakeAdmin(userKey string, usermakeadmin *UserMakeAdmin) *UsersMakeAdminCall { + c := &UsersMakeAdminCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + c.usermakeadmin = usermakeadmin + return c +} + +func (c *UsersMakeAdminCall) Do() error { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.usermakeadmin) + if err != nil { + return err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/makeAdmin") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "change admin status of a user", + // "httpMethod": "POST", + // "id": "directory.users.makeAdmin", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "userKey": { + // "description": "Email or immutable Id of the user as admin", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/makeAdmin", + // "request": { + // "$ref": "UserMakeAdmin" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user" + // ] + // } + +} + +// method id "directory.users.patch": + +type UsersPatchCall struct { + s *Service + userKey string + user *User + opt_ map[string]interface{} +} + +// Patch: update user. This method supports patch semantics. +func (r *UsersService) Patch(userKey string, user *User) *UsersPatchCall { + c := &UsersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + c.user = user + return c +} + +func (c *UsersPatchCall) Do() (*User, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(User) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "update user. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "directory.users.patch", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "userKey": { + // "description": "Email or immutable Id of the user. If Id, it should match with id of user object", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}", + // "request": { + // "$ref": "User" + // }, + // "response": { + // "$ref": "User" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user" + // ] + // } + +} + +// method id "directory.users.undelete": + +type UsersUndeleteCall struct { + s *Service + userKey string + userundelete *UserUndelete + opt_ map[string]interface{} +} + +// Undelete: Undelete a deleted user +func (r *UsersService) Undelete(userKey string, userundelete *UserUndelete) *UsersUndeleteCall { + c := &UsersUndeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + c.userundelete = userundelete + return c +} + +func (c *UsersUndeleteCall) Do() error { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.userundelete) + if err != nil { + return err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/undelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Undelete a deleted user", + // "httpMethod": "POST", + // "id": "directory.users.undelete", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "userKey": { + // "description": "The immutable id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/undelete", + // "request": { + // "$ref": "UserUndelete" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user" + // ] + // } + +} + +// method id "directory.users.update": + +type UsersUpdateCall struct { + s *Service + userKey string + user *User + opt_ map[string]interface{} +} + +// Update: update user +func (r *UsersService) Update(userKey string, user *User) *UsersUpdateCall { + c := &UsersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + c.user = user + return c +} + +func (c *UsersUpdateCall) Do() (*User, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(User) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "update user", + // "httpMethod": "PUT", + // "id": "directory.users.update", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "userKey": { + // "description": "Email or immutable Id of the user. If Id, it should match with id of user object", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}", + // "request": { + // "$ref": "User" + // }, + // "response": { + // "$ref": "User" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user" + // ] + // } + +} + +// method id "directory.users.watch": + +type UsersWatchCall struct { + s *Service + channel *Channel + opt_ map[string]interface{} +} + +// Watch: Watch for changes in users list +func (r *UsersService) Watch(channel *Channel) *UsersWatchCall { + c := &UsersWatchCall{s: r.s, opt_: make(map[string]interface{})} + c.channel = channel + return c +} + +// Customer sets the optional parameter "customer": Immutable id of the +// Google Apps account. In case of multi-domain, to fetch all users for +// a customer, fill this field instead of domain. +func (c *UsersWatchCall) Customer(customer string) *UsersWatchCall { + c.opt_["customer"] = customer + return c +} + +// Domain sets the optional parameter "domain": Name of the domain. Fill +// this field to get users from only this domain. To return all users in +// a multi-domain fill customer field instead. +func (c *UsersWatchCall) Domain(domain string) *UsersWatchCall { + c.opt_["domain"] = domain + return c +} + +// Event sets the optional parameter "event": Event on which +// subscription is intended (if subscribing) +func (c *UsersWatchCall) Event(event string) *UsersWatchCall { + c.opt_["event"] = event + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. Default is 100. Max allowed is 500 +func (c *UsersWatchCall) MaxResults(maxResults int64) *UsersWatchCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Column to use for +// sorting results +func (c *UsersWatchCall) OrderBy(orderBy string) *UsersWatchCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Token to specify +// next page in the list +func (c *UsersWatchCall) PageToken(pageToken string) *UsersWatchCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Query sets the optional parameter "query": Query string search. +// Should be of the form "" where field can be any of supported fields, +// operators can be one of '=' for exact match or ':' for prefix match. +// For prefix match, the value should always be followed by a *. +func (c *UsersWatchCall) Query(query string) *UsersWatchCall { + c.opt_["query"] = query + return c +} + +// ShowDeleted sets the optional parameter "showDeleted": If set to true +// retrieves the list of deleted users. Default is false +func (c *UsersWatchCall) ShowDeleted(showDeleted string) *UsersWatchCall { + c.opt_["showDeleted"] = showDeleted + return c +} + +// SortOrder sets the optional parameter "sortOrder": Whether to return +// results in ascending or descending order. +func (c *UsersWatchCall) SortOrder(sortOrder string) *UsersWatchCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *UsersWatchCall) Do() (*Channel, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["customer"]; ok { + params.Set("customer", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["domain"]; ok { + params.Set("domain", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["event"]; ok { + params.Set("event", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["query"]; ok { + params.Set("query", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["showDeleted"]; ok { + params.Set("showDeleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/watch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Channel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Watch for changes in users list", + // "httpMethod": "POST", + // "id": "directory.users.watch", + // "parameters": { + // "customer": { + // "description": "Immutable id of the Google Apps account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain.", + // "location": "query", + // "type": "string" + // }, + // "domain": { + // "description": "Name of the domain. Fill this field to get users from only this domain. To return all users in a multi-domain fill customer field instead.", + // "location": "query", + // "type": "string" + // }, + // "event": { + // "description": "Event on which subscription is intended (if subscribing)", + // "enum": [ + // "add", + // "delete", + // "makeAdmin", + // "undelete", + // "update" + // ], + // "enumDescriptions": [ + // "User Created Event", + // "User Deleted Event", + // "User Admin Status Change Event", + // "User Undeleted Event", + // "User Updated Event" + // ], + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return. Default is 100. Max allowed is 500", + // "format": "int32", + // "location": "query", + // "maximum": "500", + // "minimum": "1", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Column to use for sorting results", + // "enum": [ + // "email", + // "familyName", + // "givenName" + // ], + // "enumDescriptions": [ + // "Primary email of the user.", + // "User's family name.", + // "User's given name." + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Token to specify next page in the list", + // "location": "query", + // "type": "string" + // }, + // "query": { + // "description": "Query string search. Should be of the form \"\" where field can be any of supported fields, operators can be one of '=' for exact match or ':' for prefix match. For prefix match, the value should always be followed by a *.", + // "location": "query", + // "type": "string" + // }, + // "showDeleted": { + // "description": "If set to true retrieves the list of deleted users. Default is false", + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Whether to return results in ascending or descending order.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "Ascending order.", + // "Descending order." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "users/watch", + // "request": { + // "$ref": "Channel", + // "parameterName": "resource" + // }, + // "response": { + // "$ref": "Channel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user", + // "https://www.googleapis.com/auth/admin.directory.user.readonly" + // ], + // "supportsSubscription": true + // } + +} + +// method id "directory.users.aliases.delete": + +type UsersAliasesDeleteCall struct { + s *Service + userKey string + alias string + opt_ map[string]interface{} +} + +// Delete: Remove a alias for the user +func (r *UsersAliasesService) Delete(userKey string, alias string) *UsersAliasesDeleteCall { + c := &UsersAliasesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + c.alias = alias + return c +} + +func (c *UsersAliasesDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/aliases/{alias}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{alias}", url.QueryEscape(c.alias), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Remove a alias for the user", + // "httpMethod": "DELETE", + // "id": "directory.users.aliases.delete", + // "parameterOrder": [ + // "userKey", + // "alias" + // ], + // "parameters": { + // "alias": { + // "description": "The alias to be removed", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userKey": { + // "description": "Email or immutable Id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/aliases/{alias}", + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user", + // "https://www.googleapis.com/auth/admin.directory.user.alias" + // ] + // } + +} + +// method id "directory.users.aliases.insert": + +type UsersAliasesInsertCall struct { + s *Service + userKey string + alias *Alias + opt_ map[string]interface{} +} + +// Insert: Add a alias for the user +func (r *UsersAliasesService) Insert(userKey string, alias *Alias) *UsersAliasesInsertCall { + c := &UsersAliasesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + c.alias = alias + return c +} + +func (c *UsersAliasesInsertCall) Do() (*Alias, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.alias) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/aliases") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Alias) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add a alias for the user", + // "httpMethod": "POST", + // "id": "directory.users.aliases.insert", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "userKey": { + // "description": "Email or immutable Id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/aliases", + // "request": { + // "$ref": "Alias" + // }, + // "response": { + // "$ref": "Alias" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user", + // "https://www.googleapis.com/auth/admin.directory.user.alias" + // ] + // } + +} + +// method id "directory.users.aliases.list": + +type UsersAliasesListCall struct { + s *Service + userKey string + opt_ map[string]interface{} +} + +// List: List all aliases for a user +func (r *UsersAliasesService) List(userKey string) *UsersAliasesListCall { + c := &UsersAliasesListCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + return c +} + +// Event sets the optional parameter "event": Event on which +// subscription is intended (if subscribing) +func (c *UsersAliasesListCall) Event(event string) *UsersAliasesListCall { + c.opt_["event"] = event + return c +} + +func (c *UsersAliasesListCall) Do() (*Aliases, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["event"]; ok { + params.Set("event", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/aliases") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Aliases) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all aliases for a user", + // "httpMethod": "GET", + // "id": "directory.users.aliases.list", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "event": { + // "description": "Event on which subscription is intended (if subscribing)", + // "enum": [ + // "add", + // "delete" + // ], + // "enumDescriptions": [ + // "Alias Created Event", + // "Alias Deleted Event" + // ], + // "location": "query", + // "type": "string" + // }, + // "userKey": { + // "description": "Email or immutable Id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/aliases", + // "response": { + // "$ref": "Aliases" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user", + // "https://www.googleapis.com/auth/admin.directory.user.alias", + // "https://www.googleapis.com/auth/admin.directory.user.alias.readonly", + // "https://www.googleapis.com/auth/admin.directory.user.readonly" + // ], + // "supportsSubscription": true + // } + +} + +// method id "directory.users.aliases.watch": + +type UsersAliasesWatchCall struct { + s *Service + userKey string + channel *Channel + opt_ map[string]interface{} +} + +// Watch: Watch for changes in user aliases list +func (r *UsersAliasesService) Watch(userKey string, channel *Channel) *UsersAliasesWatchCall { + c := &UsersAliasesWatchCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + c.channel = channel + return c +} + +// Event sets the optional parameter "event": Event on which +// subscription is intended (if subscribing) +func (c *UsersAliasesWatchCall) Event(event string) *UsersAliasesWatchCall { + c.opt_["event"] = event + return c +} + +func (c *UsersAliasesWatchCall) Do() (*Channel, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["event"]; ok { + params.Set("event", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/aliases/watch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Channel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Watch for changes in user aliases list", + // "httpMethod": "POST", + // "id": "directory.users.aliases.watch", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "event": { + // "description": "Event on which subscription is intended (if subscribing)", + // "enum": [ + // "add", + // "delete" + // ], + // "enumDescriptions": [ + // "Alias Created Event", + // "Alias Deleted Event" + // ], + // "location": "query", + // "type": "string" + // }, + // "userKey": { + // "description": "Email or immutable Id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/aliases/watch", + // "request": { + // "$ref": "Channel", + // "parameterName": "resource" + // }, + // "response": { + // "$ref": "Channel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user", + // "https://www.googleapis.com/auth/admin.directory.user.alias", + // "https://www.googleapis.com/auth/admin.directory.user.alias.readonly", + // "https://www.googleapis.com/auth/admin.directory.user.readonly" + // ], + // "supportsSubscription": true + // } + +} + +// method id "directory.users.photos.delete": + +type UsersPhotosDeleteCall struct { + s *Service + userKey string + opt_ map[string]interface{} +} + +// Delete: Remove photos for the user +func (r *UsersPhotosService) Delete(userKey string) *UsersPhotosDeleteCall { + c := &UsersPhotosDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + return c +} + +func (c *UsersPhotosDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/photos/thumbnail") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Remove photos for the user", + // "httpMethod": "DELETE", + // "id": "directory.users.photos.delete", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "userKey": { + // "description": "Email or immutable Id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/photos/thumbnail", + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user" + // ] + // } + +} + +// method id "directory.users.photos.get": + +type UsersPhotosGetCall struct { + s *Service + userKey string + opt_ map[string]interface{} +} + +// Get: Retrieve photo of a user +func (r *UsersPhotosService) Get(userKey string) *UsersPhotosGetCall { + c := &UsersPhotosGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + return c +} + +func (c *UsersPhotosGetCall) Do() (*UserPhoto, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/photos/thumbnail") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UserPhoto) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve photo of a user", + // "httpMethod": "GET", + // "id": "directory.users.photos.get", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "userKey": { + // "description": "Email or immutable Id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/photos/thumbnail", + // "response": { + // "$ref": "UserPhoto" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user", + // "https://www.googleapis.com/auth/admin.directory.user.readonly" + // ] + // } + +} + +// method id "directory.users.photos.patch": + +type UsersPhotosPatchCall struct { + s *Service + userKey string + userphoto *UserPhoto + opt_ map[string]interface{} +} + +// Patch: Add a photo for the user. This method supports patch +// semantics. +func (r *UsersPhotosService) Patch(userKey string, userphoto *UserPhoto) *UsersPhotosPatchCall { + c := &UsersPhotosPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + c.userphoto = userphoto + return c +} + +func (c *UsersPhotosPatchCall) Do() (*UserPhoto, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.userphoto) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/photos/thumbnail") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UserPhoto) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add a photo for the user. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "directory.users.photos.patch", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "userKey": { + // "description": "Email or immutable Id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/photos/thumbnail", + // "request": { + // "$ref": "UserPhoto" + // }, + // "response": { + // "$ref": "UserPhoto" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user" + // ] + // } + +} + +// method id "directory.users.photos.update": + +type UsersPhotosUpdateCall struct { + s *Service + userKey string + userphoto *UserPhoto + opt_ map[string]interface{} +} + +// Update: Add a photo for the user +func (r *UsersPhotosService) Update(userKey string, userphoto *UserPhoto) *UsersPhotosUpdateCall { + c := &UsersPhotosUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + c.userphoto = userphoto + return c +} + +func (c *UsersPhotosUpdateCall) Do() (*UserPhoto, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.userphoto) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/photos/thumbnail") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UserPhoto) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add a photo for the user", + // "httpMethod": "PUT", + // "id": "directory.users.photos.update", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "userKey": { + // "description": "Email or immutable Id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/photos/thumbnail", + // "request": { + // "$ref": "UserPhoto" + // }, + // "response": { + // "$ref": "UserPhoto" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user" + // ] + // } + +} + +// method id "directory.verificationCodes.generate": + +type VerificationCodesGenerateCall struct { + s *Service + userKey string + opt_ map[string]interface{} +} + +// Generate: Generate new backup verification codes for the user. +func (r *VerificationCodesService) Generate(userKey string) *VerificationCodesGenerateCall { + c := &VerificationCodesGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + return c +} + +func (c *VerificationCodesGenerateCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/verificationCodes/generate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Generate new backup verification codes for the user.", + // "httpMethod": "POST", + // "id": "directory.verificationCodes.generate", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "userKey": { + // "description": "Email or immutable Id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/verificationCodes/generate", + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user.security" + // ] + // } + +} + +// method id "directory.verificationCodes.invalidate": + +type VerificationCodesInvalidateCall struct { + s *Service + userKey string + opt_ map[string]interface{} +} + +// Invalidate: Invalidate the current backup verification codes for the +// user. +func (r *VerificationCodesService) Invalidate(userKey string) *VerificationCodesInvalidateCall { + c := &VerificationCodesInvalidateCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + return c +} + +func (c *VerificationCodesInvalidateCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/verificationCodes/invalidate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Invalidate the current backup verification codes for the user.", + // "httpMethod": "POST", + // "id": "directory.verificationCodes.invalidate", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "userKey": { + // "description": "Email or immutable Id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/verificationCodes/invalidate", + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user.security" + // ] + // } + +} + +// method id "directory.verificationCodes.list": + +type VerificationCodesListCall struct { + s *Service + userKey string + opt_ map[string]interface{} +} + +// List: Returns the current set of valid backup verification codes for +// the specified user. +func (r *VerificationCodesService) List(userKey string) *VerificationCodesListCall { + c := &VerificationCodesListCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + return c +} + +func (c *VerificationCodesListCall) Do() (*VerificationCodes, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/verificationCodes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(VerificationCodes) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the current set of valid backup verification codes for the specified user.", + // "httpMethod": "GET", + // "id": "directory.verificationCodes.list", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "userKey": { + // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userKey}/verificationCodes", + // "response": { + // "$ref": "VerificationCodes" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.user.security" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/admin/email_migration_v2/admin-api.json b/third_party/src/code.google.com/p/google-api-go-client/admin/email_migration_v2/admin-api.json new file mode 100644 index 0000000000000..b612dbf588e68 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/admin/email_migration_v2/admin-api.json @@ -0,0 +1,172 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/5IR4qYAEytuHObETjxcLeQt8rDQ\"", + "discoveryVersion": "v1", + "id": "admin:email_migration_v2", + "name": "admin", + "version": "email_migration_v2", + "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": "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/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" + } + } + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/admin/email_migration_v2/admin-gen.go b/third_party/src/code.google.com/p/google-api-go-client/admin/email_migration_v2/admin-gen.go new file mode 100644 index 0000000000000..35852dddc2bc8 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/admin/email_migration_v2/admin-gen.go @@ -0,0 +1,198 @@ +// Package admin provides access to the Email Migration API v2. +// +// See https://developers.google.com/admin-sdk/email-migration/v2/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/admin/email_migration_v2" +// ... +// adminService, err := admin.New(oauthHttpClient) +package admin + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +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 + + Mail *MailService +} + +func NewMailService(s *Service) *MailService { + rs := &MailService{s: s} + return rs +} + +type MailService struct { + s *Service +} + +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"` +} + +// method id "emailMigration.mail.insert": + +type MailInsertCall struct { + s *Service + userKey string + mailitem *MailItem + opt_ map[string]interface{} + media_ io.Reader +} + +// 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 +} +func (c *MailInsertCall) Media(r io.Reader) *MailInsertCall { + c.media_ = r + return c +} + +func (c *MailInsertCall) Do() error { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.mailitem) + if err != nil { + return err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{userKey}/mail") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + 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 + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/admin/reports_v1/admin-api.json b/third_party/src/code.google.com/p/google-api-go-client/admin/reports_v1/admin-api.json new file mode 100644 index 0000000000000..5ad0599f8fc18 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/admin/reports_v1/admin-api.json @@ -0,0 +1,728 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/WhvzCm5J5nAWPdnVXhGkrRz8-Wc\"", + "discoveryVersion": "v1", + "id": "admin:reports_v1", + "name": "admin", + "canonicalName": "reports", + "version": "reports_v1", + "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" + }, + "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)|(docs)|(login)", + "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)|(docs)|(login)", + "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)|(gmail)|(calendar)|(docs)|(gplus)):.+,)*(((accounts)|(gmail)|(calendar)|(docs)|(gplus)):.+)", + "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)|(gmail)|(calendar)|(docs)|(gplus)):.+[\u003c,\u003c=,==,\u003e=,\u003e,!=].+,)*(((accounts)|(gmail)|(calendar)|(docs)|(gplus)):.+[\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)|(gmail)|(calendar)|(docs)|(gplus)):.+,)*(((accounts)|(gmail)|(calendar)|(docs)|(gplus)):.+)", + "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" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/admin/reports_v1/admin-gen.go b/third_party/src/code.google.com/p/google-api-go-client/admin/reports_v1/admin-gen.go new file mode 100644 index 0000000000000..a99fa2a6ae426 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/admin/reports_v1/admin-gen.go @@ -0,0 +1,1081 @@ +// Package admin provides access to the Admin Reports API. +// +// See https://developers.google.com/admin-sdk/reports/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/admin/reports_v1" +// ... +// adminService, err := admin.New(oauthHttpClient) +package admin + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "admin:reports_v1" +const apiName = "admin" +const apiVersion = "reports_v1" +const basePath = "https://www.googleapis.com/admin/reports/v1/" + +// OAuth2 scopes used by this API. +const ( + // View audit reports of Google Apps for your domain + AdminReportsAuditReadonlyScope = "https://www.googleapis.com/auth/admin.reports.audit.readonly" + + // View usage reports of Google Apps for your domain + AdminReportsUsageReadonlyScope = "https://www.googleapis.com/auth/admin.reports.usage.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) + s.Channels = NewChannelsService(s) + s.CustomerUsageReports = NewCustomerUsageReportsService(s) + s.UserUsageReport = NewUserUsageReportService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Activities *ActivitiesService + + Channels *ChannelsService + + CustomerUsageReports *CustomerUsageReportsService + + UserUsageReport *UserUsageReportService +} + +func NewActivitiesService(s *Service) *ActivitiesService { + rs := &ActivitiesService{s: s} + return rs +} + +type ActivitiesService struct { + s *Service +} + +func NewChannelsService(s *Service) *ChannelsService { + rs := &ChannelsService{s: s} + return rs +} + +type ChannelsService struct { + s *Service +} + +func NewCustomerUsageReportsService(s *Service) *CustomerUsageReportsService { + rs := &CustomerUsageReportsService{s: s} + return rs +} + +type CustomerUsageReportsService struct { + s *Service +} + +func NewUserUsageReportService(s *Service) *UserUsageReportService { + rs := &UserUsageReportService{s: s} + return rs +} + +type UserUsageReportService struct { + s *Service +} + +type Activities struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Items: Each record in read response. + Items []*Activity `json:"items,omitempty"` + + // Kind: Kind of list response this is. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token for retrieving the next page + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Activity struct { + // Actor: User doing the action. + Actor *ActivityActor `json:"actor,omitempty"` + + // Etag: ETag of the entry. + Etag string `json:"etag,omitempty"` + + // Events: Activity events. + Events []*ActivityEvents `json:"events,omitempty"` + + // Id: Unique identifier for each activity record. + Id *ActivityId `json:"id,omitempty"` + + // IpAddress: IP Address of the user doing the action. + IpAddress string `json:"ipAddress,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // OwnerDomain: Domain of source customer. + OwnerDomain string `json:"ownerDomain,omitempty"` +} + +type ActivityActor struct { + // CallerType: User or OAuth 2LO request. + CallerType string `json:"callerType,omitempty"` + + // Email: Email address of the user. + Email string `json:"email,omitempty"` + + // Key: For OAuth 2LO API requests, consumer_key of the requestor. + Key string `json:"key,omitempty"` + + // ProfileId: Obfuscated user id of the user. + ProfileId string `json:"profileId,omitempty"` +} + +type ActivityEvents struct { + // Name: Name of event. + Name string `json:"name,omitempty"` + + // Parameters: Parameter value pairs for various applications. + Parameters []*ActivityEventsParameters `json:"parameters,omitempty"` + + // Type: Type of event. + Type string `json:"type,omitempty"` +} + +type ActivityEventsParameters struct { + // BoolValue: Boolean value of the parameter. + BoolValue bool `json:"boolValue,omitempty"` + + // IntValue: Integral value of the parameter. + IntValue int64 `json:"intValue,omitempty,string"` + + // Name: The name of the parameter. + Name string `json:"name,omitempty"` + + // Value: String value of the parameter. + Value string `json:"value,omitempty"` +} + +type ActivityId struct { + // ApplicationName: Application name to which the event belongs. + ApplicationName string `json:"applicationName,omitempty"` + + // CustomerId: Obfuscated customer ID of the source customer. + CustomerId string `json:"customerId,omitempty"` + + // Time: Time of occurrence of the activity. + Time string `json:"time,omitempty"` + + // UniqueQualifier: Unique qualifier if multiple events have the same + // time. + UniqueQualifier int64 `json:"uniqueQualifier,omitempty,string"` +} + +type Channel struct { + // Address: The address where notifications are delivered for this + // channel. + Address string `json:"address,omitempty"` + + // Expiration: Date and time of notification channel expiration, + // expressed as a Unix timestamp, in milliseconds. Optional. + Expiration int64 `json:"expiration,omitempty,string"` + + // Id: A UUID or similar unique string that identifies this channel. + Id string `json:"id,omitempty"` + + // Kind: Identifies this as a notification channel used to watch for + // changes to a resource. Value: the fixed string "api#channel". + Kind string `json:"kind,omitempty"` + + // Params: Additional parameters controlling delivery channel behavior. + // Optional. + Params map[string]string `json:"params,omitempty"` + + // Payload: A Boolean value to indicate whether payload is wanted. + // Optional. + Payload bool `json:"payload,omitempty"` + + // ResourceId: An opaque ID that identifies the resource being watched + // on this channel. Stable across different API versions. + ResourceId string `json:"resourceId,omitempty"` + + // ResourceUri: A version-specific identifier for the watched resource. + ResourceUri string `json:"resourceUri,omitempty"` + + // Token: An arbitrary string delivered to the target address with each + // notification delivered over this channel. Optional. + Token string `json:"token,omitempty"` + + // Type: The type of delivery mechanism used for this channel. + Type string `json:"type,omitempty"` +} + +type UsageReport struct { + // Date: The date to which the record belongs. + Date string `json:"date,omitempty"` + + // Entity: Information about the type of the item. + Entity *UsageReportEntity `json:"entity,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Kind: The kind of object. + Kind string `json:"kind,omitempty"` + + // Parameters: Parameter value pairs for various applications. + Parameters []*UsageReportParameters `json:"parameters,omitempty"` +} + +type UsageReportEntity struct { + // CustomerId: Obfuscated customer id for the record. + CustomerId string `json:"customerId,omitempty"` + + // ProfileId: Obfuscated user id for the record. + ProfileId string `json:"profileId,omitempty"` + + // Type: The type of item, can be a customer or user. + Type string `json:"type,omitempty"` + + // UserEmail: user's email. + UserEmail string `json:"userEmail,omitempty"` +} + +type UsageReportParameters struct { + // BoolValue: Boolean value of the parameter. + BoolValue bool `json:"boolValue,omitempty"` + + // DatetimeValue: RFC 3339 formatted value of the parameter. + DatetimeValue string `json:"datetimeValue,omitempty"` + + // IntValue: Integral value of the parameter. + IntValue int64 `json:"intValue,omitempty,string"` + + // MsgValue: Nested message value of the parameter. + MsgValue []*UsageReportParametersMsgValue `json:"msgValue,omitempty"` + + // Name: The name of the parameter. + Name string `json:"name,omitempty"` + + // StringValue: String value of the parameter. + StringValue string `json:"stringValue,omitempty"` +} + +type UsageReportParametersMsgValue struct { +} + +type UsageReports struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Kind: The kind of object. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token for retrieving the next page + NextPageToken string `json:"nextPageToken,omitempty"` + + // UsageReports: Various application parameter records. + UsageReports []*UsageReport `json:"usageReports,omitempty"` + + // Warnings: Warnings if any. + Warnings []*UsageReportsWarnings `json:"warnings,omitempty"` +} + +type UsageReportsWarnings struct { + // Code: Machine readable code / warning type. + Code string `json:"code,omitempty"` + + // Data: Key-Value pairs to give detailed information on the warning. + Data []*UsageReportsWarningsData `json:"data,omitempty"` + + // Message: Human readable message for the warning. + Message string `json:"message,omitempty"` +} + +type UsageReportsWarningsData struct { + // Key: Key associated with a key-value pair to give detailed + // information on the warning. + Key string `json:"key,omitempty"` + + // Value: Value associated with a key-value pair to give detailed + // information on the warning. + Value string `json:"value,omitempty"` +} + +// method id "reports.activities.list": + +type ActivitiesListCall struct { + s *Service + userKey string + applicationName string + opt_ map[string]interface{} +} + +// List: Retrieves a list of activities for a specific customer and +// application. +func (r *ActivitiesService) List(userKey string, applicationName string) *ActivitiesListCall { + c := &ActivitiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + c.applicationName = applicationName + return c +} + +// ActorIpAddress sets the optional parameter "actorIpAddress": IP +// Address of host where the event was performed. Supports both IPv4 and +// IPv6 addresses. +func (c *ActivitiesListCall) ActorIpAddress(actorIpAddress string) *ActivitiesListCall { + c.opt_["actorIpAddress"] = actorIpAddress + return c +} + +// CustomerId sets the optional parameter "customerId": Represents the +// customer for which the data is to be fetched. +func (c *ActivitiesListCall) CustomerId(customerId string) *ActivitiesListCall { + c.opt_["customerId"] = customerId + return c +} + +// EndTime sets the optional parameter "endTime": Return events which +// occured at or before this time. +func (c *ActivitiesListCall) EndTime(endTime string) *ActivitiesListCall { + c.opt_["endTime"] = endTime + return c +} + +// EventName sets the optional parameter "eventName": Name of the event +// being queried. +func (c *ActivitiesListCall) EventName(eventName string) *ActivitiesListCall { + c.opt_["eventName"] = eventName + return c +} + +// Filters sets the optional parameter "filters": Event parameters in +// the form [parameter1 name][operator][parameter1 value],[parameter2 +// name][operator][parameter2 value],... +func (c *ActivitiesListCall) Filters(filters string) *ActivitiesListCall { + c.opt_["filters"] = filters + return c +} + +// MaxResults sets the optional parameter "maxResults": Number of +// activity records to be shown in each page. +func (c *ActivitiesListCall) MaxResults(maxResults int64) *ActivitiesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Token to specify +// next page. +func (c *ActivitiesListCall) PageToken(pageToken string) *ActivitiesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartTime sets the optional parameter "startTime": Return events +// which occured at or after this time. +func (c *ActivitiesListCall) StartTime(startTime string) *ActivitiesListCall { + c.opt_["startTime"] = startTime + return c +} + +func (c *ActivitiesListCall) Do() (*Activities, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["actorIpAddress"]; ok { + params.Set("actorIpAddress", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["customerId"]; ok { + params.Set("customerId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["endTime"]; ok { + params.Set("endTime", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["eventName"]; ok { + params.Set("eventName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filters"]; ok { + params.Set("filters", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startTime"]; ok { + params.Set("startTime", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "activity/users/{userKey}/applications/{applicationName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{applicationName}", url.QueryEscape(c.applicationName), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Activities) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of activities for a specific customer and application.", + // "httpMethod": "GET", + // "id": "reports.activities.list", + // "parameterOrder": [ + // "userKey", + // "applicationName" + // ], + // "parameters": { + // "actorIpAddress": { + // "description": "IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses.", + // "location": "query", + // "type": "string" + // }, + // "applicationName": { + // "description": "Application name for which the events are to be retrieved.", + // "location": "path", + // "pattern": "(admin)|(docs)|(login)", + // "required": true, + // "type": "string" + // }, + // "customerId": { + // "description": "Represents the customer for which the data is to be fetched.", + // "location": "query", + // "pattern": "C.+", + // "type": "string" + // }, + // "endTime": { + // "description": "Return events which occured at or before this time.", + // "location": "query", + // "pattern": "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))", + // "type": "string" + // }, + // "eventName": { + // "description": "Name of the event being queried.", + // "location": "query", + // "type": "string" + // }, + // "filters": { + // "description": "Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],...", + // "location": "query", + // "pattern": "(.+[\u003c,\u003c=,==,\u003e=,\u003e,\u003c\u003e].+,)*(.+[\u003c,\u003c=,==,\u003e=,\u003e,\u003c\u003e].+)", + // "type": "string" + // }, + // "maxResults": { + // "description": "Number of activity records to be shown in each page.", + // "format": "int32", + // "location": "query", + // "maximum": "1000", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Token to specify next page.", + // "location": "query", + // "type": "string" + // }, + // "startTime": { + // "description": "Return events which occured at or after this time.", + // "location": "query", + // "pattern": "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))", + // "type": "string" + // }, + // "userKey": { + // "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.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "activity/users/{userKey}/applications/{applicationName}", + // "response": { + // "$ref": "Activities" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.reports.audit.readonly" + // ], + // "supportsSubscription": true + // } + +} + +// method id "reports.activities.watch": + +type ActivitiesWatchCall struct { + s *Service + userKey string + applicationName string + channel *Channel + opt_ map[string]interface{} +} + +// Watch: Push changes to activities +func (r *ActivitiesService) Watch(userKey string, applicationName string, channel *Channel) *ActivitiesWatchCall { + c := &ActivitiesWatchCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + c.applicationName = applicationName + c.channel = channel + return c +} + +// ActorIpAddress sets the optional parameter "actorIpAddress": IP +// Address of host where the event was performed. Supports both IPv4 and +// IPv6 addresses. +func (c *ActivitiesWatchCall) ActorIpAddress(actorIpAddress string) *ActivitiesWatchCall { + c.opt_["actorIpAddress"] = actorIpAddress + return c +} + +// CustomerId sets the optional parameter "customerId": Represents the +// customer for which the data is to be fetched. +func (c *ActivitiesWatchCall) CustomerId(customerId string) *ActivitiesWatchCall { + c.opt_["customerId"] = customerId + return c +} + +// EndTime sets the optional parameter "endTime": Return events which +// occured at or before this time. +func (c *ActivitiesWatchCall) EndTime(endTime string) *ActivitiesWatchCall { + c.opt_["endTime"] = endTime + return c +} + +// EventName sets the optional parameter "eventName": Name of the event +// being queried. +func (c *ActivitiesWatchCall) EventName(eventName string) *ActivitiesWatchCall { + c.opt_["eventName"] = eventName + return c +} + +// Filters sets the optional parameter "filters": Event parameters in +// the form [parameter1 name][operator][parameter1 value],[parameter2 +// name][operator][parameter2 value],... +func (c *ActivitiesWatchCall) Filters(filters string) *ActivitiesWatchCall { + c.opt_["filters"] = filters + return c +} + +// MaxResults sets the optional parameter "maxResults": Number of +// activity records to be shown in each page. +func (c *ActivitiesWatchCall) MaxResults(maxResults int64) *ActivitiesWatchCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Token to specify +// next page. +func (c *ActivitiesWatchCall) PageToken(pageToken string) *ActivitiesWatchCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartTime sets the optional parameter "startTime": Return events +// which occured at or after this time. +func (c *ActivitiesWatchCall) StartTime(startTime string) *ActivitiesWatchCall { + c.opt_["startTime"] = startTime + return c +} + +func (c *ActivitiesWatchCall) Do() (*Channel, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["actorIpAddress"]; ok { + params.Set("actorIpAddress", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["customerId"]; ok { + params.Set("customerId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["endTime"]; ok { + params.Set("endTime", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["eventName"]; ok { + params.Set("eventName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filters"]; ok { + params.Set("filters", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startTime"]; ok { + params.Set("startTime", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "activity/users/{userKey}/applications/{applicationName}/watch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{applicationName}", url.QueryEscape(c.applicationName), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Channel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Push changes to activities", + // "httpMethod": "POST", + // "id": "reports.activities.watch", + // "parameterOrder": [ + // "userKey", + // "applicationName" + // ], + // "parameters": { + // "actorIpAddress": { + // "description": "IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses.", + // "location": "query", + // "type": "string" + // }, + // "applicationName": { + // "description": "Application name for which the events are to be retrieved.", + // "location": "path", + // "pattern": "(admin)|(docs)|(login)", + // "required": true, + // "type": "string" + // }, + // "customerId": { + // "description": "Represents the customer for which the data is to be fetched.", + // "location": "query", + // "pattern": "C.+", + // "type": "string" + // }, + // "endTime": { + // "description": "Return events which occured at or before this time.", + // "location": "query", + // "pattern": "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))", + // "type": "string" + // }, + // "eventName": { + // "description": "Name of the event being queried.", + // "location": "query", + // "type": "string" + // }, + // "filters": { + // "description": "Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],...", + // "location": "query", + // "pattern": "(.+[\u003c,\u003c=,==,\u003e=,\u003e,\u003c\u003e].+,)*(.+[\u003c,\u003c=,==,\u003e=,\u003e,\u003c\u003e].+)", + // "type": "string" + // }, + // "maxResults": { + // "description": "Number of activity records to be shown in each page.", + // "format": "int32", + // "location": "query", + // "maximum": "1000", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Token to specify next page.", + // "location": "query", + // "type": "string" + // }, + // "startTime": { + // "description": "Return events which occured at or after this time.", + // "location": "query", + // "pattern": "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))", + // "type": "string" + // }, + // "userKey": { + // "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.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "activity/users/{userKey}/applications/{applicationName}/watch", + // "request": { + // "$ref": "Channel", + // "parameterName": "resource" + // }, + // "response": { + // "$ref": "Channel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.reports.audit.readonly" + // ], + // "supportsSubscription": true + // } + +} + +// method id "admin.channels.stop": + +type ChannelsStopCall struct { + s *Service + channel *Channel + opt_ map[string]interface{} +} + +// Stop: Stop watching resources through this channel +func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall { + c := &ChannelsStopCall{s: r.s, opt_: make(map[string]interface{})} + c.channel = channel + return c +} + +func (c *ChannelsStopCall) Do() error { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + if err != nil { + return err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "/admin/reports_v1/channels/stop") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Stop watching resources through this channel", + // "httpMethod": "POST", + // "id": "admin.channels.stop", + // "path": "/admin/reports_v1/channels/stop", + // "request": { + // "$ref": "Channel", + // "parameterName": "resource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.reports.audit.readonly" + // ] + // } + +} + +// method id "reports.customerUsageReports.get": + +type CustomerUsageReportsGetCall struct { + s *Service + date string + opt_ map[string]interface{} +} + +// Get: Retrieves a report which is a collection of properties / +// statistics for a specific customer. +func (r *CustomerUsageReportsService) Get(date string) *CustomerUsageReportsGetCall { + c := &CustomerUsageReportsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.date = date + return c +} + +// CustomerId sets the optional parameter "customerId": Represents the +// customer for which the data is to be fetched. +func (c *CustomerUsageReportsGetCall) CustomerId(customerId string) *CustomerUsageReportsGetCall { + c.opt_["customerId"] = customerId + return c +} + +// PageToken sets the optional parameter "pageToken": Token to specify +// next page. +func (c *CustomerUsageReportsGetCall) PageToken(pageToken string) *CustomerUsageReportsGetCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Parameters sets the optional parameter "parameters": Represents the +// application name, parameter name pairs to fetch in csv as +// app_name1:param_name1, app_name2:param_name2. +func (c *CustomerUsageReportsGetCall) Parameters(parameters string) *CustomerUsageReportsGetCall { + c.opt_["parameters"] = parameters + return c +} + +func (c *CustomerUsageReportsGetCall) Do() (*UsageReports, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["customerId"]; ok { + params.Set("customerId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["parameters"]; ok { + params.Set("parameters", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "usage/dates/{date}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{date}", url.QueryEscape(c.date), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UsageReports) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a report which is a collection of properties / statistics for a specific customer.", + // "httpMethod": "GET", + // "id": "reports.customerUsageReports.get", + // "parameterOrder": [ + // "date" + // ], + // "parameters": { + // "customerId": { + // "description": "Represents the customer for which the data is to be fetched.", + // "location": "query", + // "pattern": "C.+", + // "type": "string" + // }, + // "date": { + // "description": "Represents the date in yyyy-mm-dd format for which the data is to be fetched.", + // "location": "path", + // "pattern": "(\\d){4}-(\\d){2}-(\\d){2}", + // "required": true, + // "type": "string" + // }, + // "pageToken": { + // "description": "Token to specify next page.", + // "location": "query", + // "type": "string" + // }, + // "parameters": { + // "description": "Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2.", + // "location": "query", + // "pattern": "(((accounts)|(gmail)|(calendar)|(docs)|(gplus)):.+,)*(((accounts)|(gmail)|(calendar)|(docs)|(gplus)):.+)", + // "type": "string" + // } + // }, + // "path": "usage/dates/{date}", + // "response": { + // "$ref": "UsageReports" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.reports.usage.readonly" + // ] + // } + +} + +// method id "reports.userUsageReport.get": + +type UserUsageReportGetCall struct { + s *Service + userKey string + date string + opt_ map[string]interface{} +} + +// Get: Retrieves a report which is a collection of properties / +// statistics for a set of users. +func (r *UserUsageReportService) Get(userKey string, date string) *UserUsageReportGetCall { + c := &UserUsageReportGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + c.date = date + return c +} + +// CustomerId sets the optional parameter "customerId": Represents the +// customer for which the data is to be fetched. +func (c *UserUsageReportGetCall) CustomerId(customerId string) *UserUsageReportGetCall { + c.opt_["customerId"] = customerId + return c +} + +// Filters sets the optional parameter "filters": Represents the set of +// filters including parameter operator value. +func (c *UserUsageReportGetCall) Filters(filters string) *UserUsageReportGetCall { + c.opt_["filters"] = filters + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. Maximum allowed is 1000 +func (c *UserUsageReportGetCall) MaxResults(maxResults int64) *UserUsageReportGetCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Token to specify +// next page. +func (c *UserUsageReportGetCall) PageToken(pageToken string) *UserUsageReportGetCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Parameters sets the optional parameter "parameters": Represents the +// application name, parameter name pairs to fetch in csv as +// app_name1:param_name1, app_name2:param_name2. +func (c *UserUsageReportGetCall) Parameters(parameters string) *UserUsageReportGetCall { + c.opt_["parameters"] = parameters + return c +} + +func (c *UserUsageReportGetCall) Do() (*UsageReports, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["customerId"]; ok { + params.Set("customerId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filters"]; ok { + params.Set("filters", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["parameters"]; ok { + params.Set("parameters", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "usage/users/{userKey}/dates/{date}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userKey}", url.QueryEscape(c.userKey), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{date}", url.QueryEscape(c.date), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UsageReports) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a report which is a collection of properties / statistics for a set of users.", + // "httpMethod": "GET", + // "id": "reports.userUsageReport.get", + // "parameterOrder": [ + // "userKey", + // "date" + // ], + // "parameters": { + // "customerId": { + // "description": "Represents the customer for which the data is to be fetched.", + // "location": "query", + // "pattern": "C.+", + // "type": "string" + // }, + // "date": { + // "description": "Represents the date in yyyy-mm-dd format for which the data is to be fetched.", + // "location": "path", + // "pattern": "(\\d){4}-(\\d){2}-(\\d){2}", + // "required": true, + // "type": "string" + // }, + // "filters": { + // "description": "Represents the set of filters including parameter operator value.", + // "location": "query", + // "pattern": "(((accounts)|(gmail)|(calendar)|(docs)|(gplus)):.+[\u003c,\u003c=,==,\u003e=,\u003e,!=].+,)*(((accounts)|(gmail)|(calendar)|(docs)|(gplus)):.+[\u003c,\u003c=,==,\u003e=,\u003e,!=].+)", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return. Maximum allowed is 1000", + // "format": "uint32", + // "location": "query", + // "maximum": "1000", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Token to specify next page.", + // "location": "query", + // "type": "string" + // }, + // "parameters": { + // "description": "Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2.", + // "location": "query", + // "pattern": "(((accounts)|(gmail)|(calendar)|(docs)|(gplus)):.+,)*(((accounts)|(gmail)|(calendar)|(docs)|(gplus)):.+)", + // "type": "string" + // }, + // "userKey": { + // "description": "Represents the profile id or the user email for which the data should be filtered.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "usage/users/{userKey}/dates/{date}", + // "response": { + // "$ref": "UsageReports" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.reports.usage.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.1/adsense-api.json b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.1/adsense-api.json new file mode 100644 index 0000000000000..270909445a866 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.1/adsense-api.json @@ -0,0 +1,1402 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"BgGnx7p-6wsAbOn4St99QhtBGbA/Ar5QHvnrmRKxw_c_OM9xYoUzlFI\"", + "discoveryVersion": "v1", + "id": "adsense:v1.1", + "name": "adsense", + "canonicalName": "AdSense", + "version": "v1.1", + "revision": "20130712", + "title": "AdSense Management API", + "description": "Gives AdSense publishers access to their inventory and the ability to generate reports", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/adsense-16.png", + "x32": "http://www.google.com/images/icons/product/adsense-32.png" + }, + "documentationLink": "https://developers.google.com/adsense/management/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/adsense/v1.1/", + "basePath": "/adsense/v1.1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "adsense/v1.1/", + "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/adsense": { + "description": "View and manage your AdSense data" + }, + "https://www.googleapis.com/auth/adsense.readonly": { + "description": "View your AdSense data" + } + } + } + }, + "schemas": { + "Account": { + "id": "Account", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of this account." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adsense#account.", + "default": "adsense#account" + }, + "name": { + "type": "string", + "description": "Name of this account." + }, + "subAccounts": { + "type": "array", + "description": "Sub accounts of the this account.", + "items": { + "$ref": "Account" + } + } + } + }, + "Accounts": { + "id": "Accounts", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The accounts returned in this list response.", + "items": { + "$ref": "Account" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adsense#accounts.", + "default": "adsense#accounts" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through accounts. To retrieve the next page of results, set the next request's \"pageToken\" value to this." + } + } + }, + "AdClient": { + "id": "AdClient", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of this ad client." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adsense#adClient.", + "default": "adsense#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 adsense#adClients.", + "default": "adsense#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 adsense#adUnit.", + "default": "adsense#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 adsense#adUnits.", + "default": "adsense#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." + } + } + }, + "AdsenseReportsGenerateResponse": { + "id": "AdsenseReportsGenerateResponse", + "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 adsense#report.", + "default": "adsense#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" + } + } + } + }, + "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 adsense#customChannel.", + "default": "adsense#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 adsense#customChannels.", + "default": "adsense#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." + } + } + }, + "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 adsense#urlChannel.", + "default": "adsense#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 adsense#urlChannels.", + "default": "adsense#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": { + "accounts": { + "methods": { + "get": { + "id": "adsense.accounts.get", + "path": "accounts/{accountId}", + "httpMethod": "GET", + "description": "Get information about the selected AdSense account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to get information about.", + "required": true, + "location": "path" + }, + "tree": { + "type": "boolean", + "description": "Whether the tree of sub accounts should be returned.", + "location": "query" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.accounts.list", + "path": "accounts", + "httpMethod": "GET", + "description": "List all accounts available to this AdSense account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of accounts to include in the response, used for paging.", + "format": "int32", + "minimum": "0", + "maximum": "10000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "response": { + "$ref": "Accounts" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "adclients": { + "methods": { + "list": { + "id": "adsense.accounts.adclients.list", + "path": "accounts/{accountId}/adclients", + "httpMethod": "GET", + "description": "List all ad clients in the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account for which to list ad clients.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of ad clients to include in the response, used for paging.", + "format": "int32", + "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" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "AdClients" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "adunits": { + "methods": { + "get": { + "id": "adsense.accounts.adunits.get", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}", + "httpMethod": "GET", + "description": "Gets the specified ad unit in the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": [ + "accountId", + "adClientId", + "adUnitId" + ], + "response": { + "$ref": "AdUnit" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.accounts.adunits.list", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits", + "httpMethod": "GET", + "description": "List all ad units in the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId" + ], + "response": { + "$ref": "AdUnits" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "customchannels": { + "methods": { + "list": { + "id": "adsense.accounts.adunits.customchannels.list", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels", + "httpMethod": "GET", + "description": "List all custom channels which the specified ad unit belongs to.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId", + "adUnitId" + ], + "response": { + "$ref": "CustomChannels" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "customchannels": { + "methods": { + "get": { + "id": "adsense.accounts.customchannels.get", + "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}", + "httpMethod": "GET", + "description": "Get the specified custom channel from the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": [ + "accountId", + "adClientId", + "customChannelId" + ], + "response": { + "$ref": "CustomChannel" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.accounts.customchannels.list", + "path": "accounts/{accountId}/adclients/{adClientId}/customchannels", + "httpMethod": "GET", + "description": "List all custom channels in the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId" + ], + "response": { + "$ref": "CustomChannels" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "adunits": { + "methods": { + "list": { + "id": "adsense.accounts.customchannels.adunits.list", + "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits", + "httpMethod": "GET", + "description": "List all ad units in the specified custom channel.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId", + "customChannelId" + ], + "response": { + "$ref": "AdUnits" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "reports": { + "methods": { + "generate": { + "id": "adsense.accounts.reports.generate", + "path": "accounts/{accountId}/reports", + "httpMethod": "GET", + "description": "Generate an AdSense 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": { + "accountId": { + "type": "string", + "description": "Account upon which to report.", + "required": true, + "location": "path" + }, + "currency": { + "type": "string", + "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.", + "pattern": "[a-zA-Z]+", + "location": "query" + }, + "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,2}?)", + "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": "int32", + "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,2}?)", + "location": "query" + }, + "startIndex": { + "type": "integer", + "description": "Index of the first row of report data to return.", + "format": "int32", + "minimum": "0", + "maximum": "5000", + "location": "query" + } + }, + "parameterOrder": [ + "accountId", + "startDate", + "endDate" + ], + "response": { + "$ref": "AdsenseReportsGenerateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ], + "supportsMediaDownload": true + } + } + }, + "urlchannels": { + "methods": { + "list": { + "id": "adsense.accounts.urlchannels.list", + "path": "accounts/{accountId}/adclients/{adClientId}/urlchannels", + "httpMethod": "GET", + "description": "List all URL channels in the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId" + ], + "response": { + "$ref": "UrlChannels" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "adclients": { + "methods": { + "list": { + "id": "adsense.adclients.list", + "path": "adclients", + "httpMethod": "GET", + "description": "List all ad clients in this AdSense account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of ad clients to include in the response, used for paging.", + "format": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "adunits": { + "methods": { + "get": { + "id": "adsense.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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.adunits.list", + "path": "adclients/{adClientId}/adunits", + "httpMethod": "GET", + "description": "List all ad units in the specified ad client for this AdSense 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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "customchannels": { + "methods": { + "list": { + "id": "adsense.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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "customchannels": { + "methods": { + "get": { + "id": "adsense.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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.customchannels.list", + "path": "adclients/{adClientId}/customchannels", + "httpMethod": "GET", + "description": "List all custom channels in the specified ad client for this AdSense 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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "adunits": { + "methods": { + "list": { + "id": "adsense.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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "reports": { + "methods": { + "generate": { + "id": "adsense.reports.generate", + "path": "reports", + "httpMethod": "GET", + "description": "Generate an AdSense 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": { + "accountId": { + "type": "string", + "description": "Accounts upon which to report.", + "repeated": true, + "location": "query" + }, + "currency": { + "type": "string", + "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.", + "pattern": "[a-zA-Z]+", + "location": "query" + }, + "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,2}?)", + "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": "int32", + "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,2}?)", + "location": "query" + }, + "startIndex": { + "type": "integer", + "description": "Index of the first row of report data to return.", + "format": "int32", + "minimum": "0", + "maximum": "5000", + "location": "query" + } + }, + "parameterOrder": [ + "startDate", + "endDate" + ], + "response": { + "$ref": "AdsenseReportsGenerateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ], + "supportsMediaDownload": true + } + } + }, + "urlchannels": { + "methods": { + "list": { + "id": "adsense.urlchannels.list", + "path": "adclients/{adClientId}/urlchannels", + "httpMethod": "GET", + "description": "List all URL channels in the specified ad client for this AdSense 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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.1/adsense-gen.go b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.1/adsense-gen.go new file mode 100644 index 0000000000000..6d45aac112afd --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.1/adsense-gen.go @@ -0,0 +1,2787 @@ +// Package adsense provides access to the AdSense Management API. +// +// See https://developers.google.com/adsense/management/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/adsense/v1.1" +// ... +// adsenseService, err := adsense.New(oauthHttpClient) +package adsense + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "adsense:v1.1" +const apiName = "adsense" +const apiVersion = "v1.1" +const basePath = "https://www.googleapis.com/adsense/v1.1/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your AdSense data + AdsenseScope = "https://www.googleapis.com/auth/adsense" + + // View your AdSense data + AdsenseReadonlyScope = "https://www.googleapis.com/auth/adsense.readonly" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client} + s.Accounts = NewAccountsService(s) + s.Adclients = NewAdclientsService(s) + s.Adunits = NewAdunitsService(s) + s.Customchannels = NewCustomchannelsService(s) + s.Reports = NewReportsService(s) + s.Urlchannels = NewUrlchannelsService(s) + return s, nil +} + +type Service struct { + client *http.Client + + Accounts *AccountsService + + Adclients *AdclientsService + + Adunits *AdunitsService + + Customchannels *CustomchannelsService + + Reports *ReportsService + + Urlchannels *UrlchannelsService +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + rs.Adclients = NewAccountsAdclientsService(s) + rs.Adunits = NewAccountsAdunitsService(s) + rs.Customchannels = NewAccountsCustomchannelsService(s) + rs.Reports = NewAccountsReportsService(s) + rs.Urlchannels = NewAccountsUrlchannelsService(s) + return rs +} + +type AccountsService struct { + s *Service + + Adclients *AccountsAdclientsService + + Adunits *AccountsAdunitsService + + Customchannels *AccountsCustomchannelsService + + Reports *AccountsReportsService + + Urlchannels *AccountsUrlchannelsService +} + +func NewAccountsAdclientsService(s *Service) *AccountsAdclientsService { + rs := &AccountsAdclientsService{s: s} + return rs +} + +type AccountsAdclientsService struct { + s *Service +} + +func NewAccountsAdunitsService(s *Service) *AccountsAdunitsService { + rs := &AccountsAdunitsService{s: s} + rs.Customchannels = NewAccountsAdunitsCustomchannelsService(s) + return rs +} + +type AccountsAdunitsService struct { + s *Service + + Customchannels *AccountsAdunitsCustomchannelsService +} + +func NewAccountsAdunitsCustomchannelsService(s *Service) *AccountsAdunitsCustomchannelsService { + rs := &AccountsAdunitsCustomchannelsService{s: s} + return rs +} + +type AccountsAdunitsCustomchannelsService struct { + s *Service +} + +func NewAccountsCustomchannelsService(s *Service) *AccountsCustomchannelsService { + rs := &AccountsCustomchannelsService{s: s} + rs.Adunits = NewAccountsCustomchannelsAdunitsService(s) + return rs +} + +type AccountsCustomchannelsService struct { + s *Service + + Adunits *AccountsCustomchannelsAdunitsService +} + +func NewAccountsCustomchannelsAdunitsService(s *Service) *AccountsCustomchannelsAdunitsService { + rs := &AccountsCustomchannelsAdunitsService{s: s} + return rs +} + +type AccountsCustomchannelsAdunitsService struct { + s *Service +} + +func NewAccountsReportsService(s *Service) *AccountsReportsService { + rs := &AccountsReportsService{s: s} + return rs +} + +type AccountsReportsService struct { + s *Service +} + +func NewAccountsUrlchannelsService(s *Service) *AccountsUrlchannelsService { + rs := &AccountsUrlchannelsService{s: s} + return rs +} + +type AccountsUrlchannelsService struct { + s *Service +} + +func NewAdclientsService(s *Service) *AdclientsService { + rs := &AdclientsService{s: s} + return rs +} + +type AdclientsService struct { + s *Service +} + +func NewAdunitsService(s *Service) *AdunitsService { + rs := &AdunitsService{s: s} + rs.Customchannels = NewAdunitsCustomchannelsService(s) + return rs +} + +type AdunitsService struct { + s *Service + + Customchannels *AdunitsCustomchannelsService +} + +func NewAdunitsCustomchannelsService(s *Service) *AdunitsCustomchannelsService { + rs := &AdunitsCustomchannelsService{s: s} + return rs +} + +type AdunitsCustomchannelsService struct { + s *Service +} + +func NewCustomchannelsService(s *Service) *CustomchannelsService { + rs := &CustomchannelsService{s: s} + rs.Adunits = NewCustomchannelsAdunitsService(s) + return rs +} + +type CustomchannelsService struct { + s *Service + + Adunits *CustomchannelsAdunitsService +} + +func NewCustomchannelsAdunitsService(s *Service) *CustomchannelsAdunitsService { + rs := &CustomchannelsAdunitsService{s: s} + return rs +} + +type CustomchannelsAdunitsService struct { + s *Service +} + +func NewReportsService(s *Service) *ReportsService { + rs := &ReportsService{s: s} + return rs +} + +type ReportsService struct { + s *Service +} + +func NewUrlchannelsService(s *Service) *UrlchannelsService { + rs := &UrlchannelsService{s: s} + return rs +} + +type UrlchannelsService struct { + s *Service +} + +type Account struct { + // Id: Unique identifier of this account. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#account. + Kind string `json:"kind,omitempty"` + + // Name: Name of this account. + Name string `json:"name,omitempty"` + + // SubAccounts: Sub accounts of the this account. + SubAccounts []*Account `json:"subAccounts,omitempty"` +} + +type Accounts struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The accounts returned in this list response. + Items []*Account `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#accounts. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through accounts. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AdClient struct { + // Id: Unique identifier of this ad client. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#adClient. + Kind string `json:"kind,omitempty"` + + // ProductCode: This ad client's product code, which corresponds to the + // PRODUCT_CODE report dimension. + ProductCode string `json:"productCode,omitempty"` + + // SupportsReporting: Whether this ad client supports being reported on. + SupportsReporting bool `json:"supportsReporting,omitempty"` +} + +type AdClients struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The ad clients returned in this list response. + Items []*AdClient `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#adClients. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad clients. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AdUnit struct { + // Code: Identity code of this ad unit, not necessarily unique across ad + // clients. + Code string `json:"code,omitempty"` + + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#adUnit. + Kind string `json:"kind,omitempty"` + + // Name: Name of this ad unit. + Name string `json:"name,omitempty"` + + // Status: Status of this ad unit. Possible values are: + // NEW: Indicates + // that the ad unit was created within the last seven days and does not + // yet have any activity associated with it. + // + // ACTIVE: Indicates that + // there has been activity on this ad unit in the last seven + // days. + // + // INACTIVE: Indicates that there has been no activity on this ad + // unit in the last seven days. + Status string `json:"status,omitempty"` +} + +type AdUnits struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The ad units returned in this list response. + Items []*AdUnit `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#adUnits. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad units. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AdsenseReportsGenerateResponse struct { + // Averages: The averages of the report. This is the same length as any + // other row in the report; cells corresponding to dimension columns are + // empty. + Averages []string `json:"averages,omitempty"` + + // Headers: 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. + Headers []*AdsenseReportsGenerateResponseHeaders `json:"headers,omitempty"` + + // Kind: Kind this is, in this case adsense#report. + Kind string `json:"kind,omitempty"` + + // Rows: 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. + Rows [][]string `json:"rows,omitempty"` + + // TotalMatchedRows: 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. + TotalMatchedRows int64 `json:"totalMatchedRows,omitempty,string"` + + // Totals: The totals of the report. This is the same length as any + // other row in the report; cells corresponding to dimension columns are + // empty. + Totals []string `json:"totals,omitempty"` + + // Warnings: Any warnings associated with generation of the report. + Warnings []string `json:"warnings,omitempty"` +} + +type AdsenseReportsGenerateResponseHeaders struct { + // Currency: The currency of this column. Only present if the header + // type is METRIC_CURRENCY. + Currency string `json:"currency,omitempty"` + + // Name: The name of the header. + Name string `json:"name,omitempty"` + + // Type: The type of the header; one of DIMENSION, METRIC_TALLY, + // METRIC_RATIO, or METRIC_CURRENCY. + Type string `json:"type,omitempty"` +} + +type CustomChannel struct { + // Code: Code of this custom channel, not necessarily unique across ad + // clients. + Code string `json:"code,omitempty"` + + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#customChannel. + Kind string `json:"kind,omitempty"` + + // Name: Name of this custom channel. + Name string `json:"name,omitempty"` + + // TargetingInfo: The targeting information of this custom channel, if + // activated. + TargetingInfo *CustomChannelTargetingInfo `json:"targetingInfo,omitempty"` +} + +type CustomChannelTargetingInfo struct { + // AdsAppearOn: The name used to describe this channel externally. + AdsAppearOn string `json:"adsAppearOn,omitempty"` + + // Description: The external description of the channel. + Description string `json:"description,omitempty"` + + // Location: 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. + Location string `json:"location,omitempty"` + + // SiteLanguage: The language of the sites ads will be displayed on. + SiteLanguage string `json:"siteLanguage,omitempty"` +} + +type CustomChannels struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The custom channels returned in this list response. + Items []*CustomChannel `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#customChannels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through custom + // channels. To retrieve the next page of results, set the next + // request's "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type UrlChannel struct { + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#urlChannel. + Kind string `json:"kind,omitempty"` + + // UrlPattern: URL Pattern of this URL channel. Does not include + // "http://" or "https://". Example: www.example.com/home + UrlPattern string `json:"urlPattern,omitempty"` +} + +type UrlChannels struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The URL channels returned in this list response. + Items []*UrlChannel `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#urlChannels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through URL channels. + // To retrieve the next page of results, set the next request's + // "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +// method id "adsense.accounts.get": + +type AccountsGetCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// Get: Get information about the selected AdSense account. +func (r *AccountsService) Get(accountId string) *AccountsGetCall { + c := &AccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// Tree sets the optional parameter "tree": Whether the tree of sub +// accounts should be returned. +func (c *AccountsGetCall) Tree(tree bool) *AccountsGetCall { + c.opt_["tree"] = tree + return c +} + +func (c *AccountsGetCall) Do() (*Account, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["tree"]; ok { + params.Set("tree", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "accounts/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get information about the selected AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.get", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to get information about.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tree": { + // "description": "Whether the tree of sub accounts should be returned.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "accounts/{accountId}", + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.list": + +type AccountsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all accounts available to this AdSense account. +func (r *AccountsService) List() *AccountsListCall { + c := &AccountsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of accounts to include in the response, used for paging. +func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token, used to page through accounts. To retrieve the next page, set +// this parameter to the value of "nextPageToken" from the previous +// response. +func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsListCall) Do() (*Accounts, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Accounts) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all accounts available to this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of accounts to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "accounts", + // "response": { + // "$ref": "Accounts" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.adclients.list": + +type AccountsAdclientsListCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// List: List all ad clients in the specified account. +func (r *AccountsAdclientsService) List(accountId string) *AccountsAdclientsListCall { + c := &AccountsAdclientsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad clients to include in the response, used for paging. +func (c *AccountsAdclientsListCall) MaxResults(maxResults int64) *AccountsAdclientsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsAdclientsListCall) PageToken(pageToken string) *AccountsAdclientsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsAdclientsListCall) Do() (*AdClients, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "accounts/{accountId}/adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdClients) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad clients in the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.adclients.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account for which to list ad clients.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of ad clients to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients", + // "response": { + // "$ref": "AdClients" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.adunits.get": + +type AccountsAdunitsGetCall struct { + s *Service + accountId string + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// Get: Gets the specified ad unit in the specified ad client for the +// specified account. +func (r *AccountsAdunitsService) Get(accountId string, adClientId string, adUnitId string) *AccountsAdunitsGetCall { + c := &AccountsAdunitsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +func (c *AccountsAdunitsGetCall) Do() (*AdUnit, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified ad unit in the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.adunits.get", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to get the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}", + // "response": { + // "$ref": "AdUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.adunits.list": + +type AccountsAdunitsListCall struct { + s *Service + accountId string + adClientId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified ad client for the specified +// account. +func (r *AccountsAdunitsService) List(accountId string, adClientId string) *AccountsAdunitsListCall { + c := &AccountsAdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *AccountsAdunitsListCall) IncludeInactive(includeInactive bool) *AccountsAdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *AccountsAdunitsListCall) MaxResults(maxResults int64) *AccountsAdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsAdunitsListCall) PageToken(pageToken string) *AccountsAdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsAdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "accounts/{accountId}/adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.adunits.list", + // "parameterOrder": [ + // "accountId", + // "adClientId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.adunits.customchannels.list": + +type AccountsAdunitsCustomchannelsListCall struct { + s *Service + accountId string + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// List: List all custom channels which the specified ad unit belongs +// to. +func (r *AccountsAdunitsCustomchannelsService) List(accountId string, adClientId string, adUnitId string) *AccountsAdunitsCustomchannelsListCall { + c := &AccountsAdunitsCustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *AccountsAdunitsCustomchannelsListCall) MaxResults(maxResults int64) *AccountsAdunitsCustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsAdunitsCustomchannelsListCall) PageToken(pageToken string) *AccountsAdunitsCustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsAdunitsCustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels which the specified ad unit belongs to.", + // "httpMethod": "GET", + // "id": "adsense.accounts.adunits.customchannels.list", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client which contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.customchannels.get": + +type AccountsCustomchannelsGetCall struct { + s *Service + accountId string + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// Get: Get the specified custom channel from the specified ad client +// for the specified account. +func (r *AccountsCustomchannelsService) Get(accountId string, adClientId string, customChannelId string) *AccountsCustomchannelsGetCall { + c := &AccountsCustomchannelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +func (c *AccountsCustomchannelsGetCall) Do() (*CustomChannel, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the specified custom channel from the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.customchannels.get", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}", + // "response": { + // "$ref": "CustomChannel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.customchannels.list": + +type AccountsCustomchannelsListCall struct { + s *Service + accountId string + adClientId string + opt_ map[string]interface{} +} + +// List: List all custom channels in the specified ad client for the +// specified account. +func (r *AccountsCustomchannelsService) List(accountId string, adClientId string) *AccountsCustomchannelsListCall { + c := &AccountsCustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *AccountsCustomchannelsListCall) MaxResults(maxResults int64) *AccountsCustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsCustomchannelsListCall) PageToken(pageToken string) *AccountsCustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsCustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "accounts/{accountId}/adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels in the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.customchannels.list", + // "parameterOrder": [ + // "accountId", + // "adClientId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.customchannels.adunits.list": + +type AccountsCustomchannelsAdunitsListCall struct { + s *Service + accountId string + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified custom channel. +func (r *AccountsCustomchannelsAdunitsService) List(accountId string, adClientId string, customChannelId string) *AccountsCustomchannelsAdunitsListCall { + c := &AccountsCustomchannelsAdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *AccountsCustomchannelsAdunitsListCall) IncludeInactive(includeInactive bool) *AccountsCustomchannelsAdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *AccountsCustomchannelsAdunitsListCall) MaxResults(maxResults int64) *AccountsCustomchannelsAdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsCustomchannelsAdunitsListCall) PageToken(pageToken string) *AccountsCustomchannelsAdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsCustomchannelsAdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified custom channel.", + // "httpMethod": "GET", + // "id": "adsense.accounts.customchannels.adunits.list", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.reports.generate": + +type AccountsReportsGenerateCall struct { + s *Service + accountId string + startDate string + endDate string + opt_ map[string]interface{} +} + +// Generate: Generate an AdSense 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. +func (r *AccountsReportsService) Generate(accountId string, startDate string, endDate string) *AccountsReportsGenerateCall { + c := &AccountsReportsGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.startDate = startDate + c.endDate = endDate + return c +} + +// Currency sets the optional parameter "currency": Optional currency to +// use when reporting on monetary metrics. Defaults to the account's +// currency if not set. +func (c *AccountsReportsGenerateCall) Currency(currency string) *AccountsReportsGenerateCall { + c.opt_["currency"] = currency + return c +} + +// Dimension sets the optional parameter "dimension": Dimensions to base +// the report on. +func (c *AccountsReportsGenerateCall) Dimension(dimension string) *AccountsReportsGenerateCall { + c.opt_["dimension"] = dimension + return c +} + +// Filter sets the optional parameter "filter": Filters to be run on the +// report. +func (c *AccountsReportsGenerateCall) Filter(filter string) *AccountsReportsGenerateCall { + c.opt_["filter"] = filter + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *AccountsReportsGenerateCall) Locale(locale string) *AccountsReportsGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *AccountsReportsGenerateCall) MaxResults(maxResults int64) *AccountsReportsGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Metric sets the optional parameter "metric": Numeric columns to +// include in the report. +func (c *AccountsReportsGenerateCall) Metric(metric string) *AccountsReportsGenerateCall { + c.opt_["metric"] = metric + return c +} + +// Sort sets the optional parameter "sort": 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. +func (c *AccountsReportsGenerateCall) Sort(sort string) *AccountsReportsGenerateCall { + c.opt_["sort"] = sort + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *AccountsReportsGenerateCall) StartIndex(startIndex int64) *AccountsReportsGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *AccountsReportsGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("endDate", fmt.Sprintf("%v", c.endDate)) + params.Set("startDate", fmt.Sprintf("%v", c.startDate)) + if v, ok := c.opt_["currency"]; ok { + params.Set("currency", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dimension"]; ok { + params.Set("dimension", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["metric"]; ok { + params.Set("metric", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "accounts/{accountId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdsenseReportsGenerateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an AdSense 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.", + // "httpMethod": "GET", + // "id": "adsense.accounts.reports.generate", + // "parameterOrder": [ + // "accountId", + // "startDate", + // "endDate" + // ], + // "parameters": { + // "accountId": { + // "description": "Account upon which to report.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "currency": { + // "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.", + // "location": "query", + // "pattern": "[a-zA-Z]+", + // "type": "string" + // }, + // "dimension": { + // "description": "Dimensions to base the report on.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "endDate": { + // "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,2}?)", + // "required": true, + // "type": "string" + // }, + // "filter": { + // "description": "Filters to be run on the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+(==|=@).+", + // "repeated": true, + // "type": "string" + // }, + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "metric": { + // "description": "Numeric columns to include in the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "sort": { + // "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.", + // "location": "query", + // "pattern": "(\\+|-)?[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "startDate": { + // "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,2}?)", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "accounts/{accountId}/reports", + // "response": { + // "$ref": "AdsenseReportsGenerateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "adsense.accounts.urlchannels.list": + +type AccountsUrlchannelsListCall struct { + s *Service + accountId string + adClientId string + opt_ map[string]interface{} +} + +// List: List all URL channels in the specified ad client for the +// specified account. +func (r *AccountsUrlchannelsService) List(accountId string, adClientId string) *AccountsUrlchannelsListCall { + c := &AccountsUrlchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of URL channels to include in the response, used for paging. +func (c *AccountsUrlchannelsListCall) MaxResults(maxResults int64) *AccountsUrlchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsUrlchannelsListCall) PageToken(pageToken string) *AccountsUrlchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsUrlchannelsListCall) Do() (*UrlChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "accounts/{accountId}/adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UrlChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all URL channels in the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.urlchannels.list", + // "parameterOrder": [ + // "accountId", + // "adClientId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to list URL channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of URL channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/urlchannels", + // "response": { + // "$ref": "UrlChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adclients.list": + +type AdclientsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all ad clients in this AdSense account. +func (r *AdclientsService) List() *AdclientsListCall { + c := &AdclientsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad clients to include in the response, used for paging. +func (c *AdclientsListCall) MaxResults(maxResults int64) *AdclientsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdclientsListCall) PageToken(pageToken string) *AdclientsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdclientsListCall) Do() (*AdClients, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdClients) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad clients in this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.adclients.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of ad clients to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "adclients", + // "response": { + // "$ref": "AdClients" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adunits.get": + +type AdunitsGetCall struct { + s *Service + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// Get: Gets the specified ad unit in the specified ad client. +func (r *AdunitsService) Get(adClientId string, adUnitId string) *AdunitsGetCall { + c := &AdunitsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +func (c *AdunitsGetCall) Do() (*AdUnit, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified ad unit in the specified ad client.", + // "httpMethod": "GET", + // "id": "adsense.adunits.get", + // "parameterOrder": [ + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to get the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits/{adUnitId}", + // "response": { + // "$ref": "AdUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adunits.list": + +type AdunitsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified ad client for this AdSense +// account. +func (r *AdunitsService) List(adClientId string) *AdunitsListCall { + c := &AdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *AdunitsListCall) IncludeInactive(includeInactive bool) *AdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *AdunitsListCall) MaxResults(maxResults int64) *AdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdunitsListCall) PageToken(pageToken string) *AdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified ad client for this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.adunits.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adunits.customchannels.list": + +type AdunitsCustomchannelsListCall struct { + s *Service + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// List: List all custom channels which the specified ad unit belongs +// to. +func (r *AdunitsCustomchannelsService) List(adClientId string, adUnitId string) *AdunitsCustomchannelsListCall { + c := &AdunitsCustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *AdunitsCustomchannelsListCall) MaxResults(maxResults int64) *AdunitsCustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdunitsCustomchannelsListCall) PageToken(pageToken string) *AdunitsCustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdunitsCustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "adclients/{adClientId}/adunits/{adUnitId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels which the specified ad unit belongs to.", + // "httpMethod": "GET", + // "id": "adsense.adunits.customchannels.list", + // "parameterOrder": [ + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client which contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits/{adUnitId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.customchannels.get": + +type CustomchannelsGetCall struct { + s *Service + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// Get: Get the specified custom channel from the specified ad client. +func (r *CustomchannelsService) Get(adClientId string, customChannelId string) *CustomchannelsGetCall { + c := &CustomchannelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +func (c *CustomchannelsGetCall) Do() (*CustomChannel, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the specified custom channel from the specified ad client.", + // "httpMethod": "GET", + // "id": "adsense.customchannels.get", + // "parameterOrder": [ + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels/{customChannelId}", + // "response": { + // "$ref": "CustomChannel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.customchannels.list": + +type CustomchannelsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all custom channels in the specified ad client for this +// AdSense account. +func (r *CustomchannelsService) List(adClientId string) *CustomchannelsListCall { + c := &CustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *CustomchannelsListCall) MaxResults(maxResults int64) *CustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *CustomchannelsListCall) PageToken(pageToken string) *CustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels in the specified ad client for this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.customchannels.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.customchannels.adunits.list": + +type CustomchannelsAdunitsListCall struct { + s *Service + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified custom channel. +func (r *CustomchannelsAdunitsService) List(adClientId string, customChannelId string) *CustomchannelsAdunitsListCall { + c := &CustomchannelsAdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *CustomchannelsAdunitsListCall) IncludeInactive(includeInactive bool) *CustomchannelsAdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *CustomchannelsAdunitsListCall) MaxResults(maxResults int64) *CustomchannelsAdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *CustomchannelsAdunitsListCall) PageToken(pageToken string) *CustomchannelsAdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CustomchannelsAdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "adclients/{adClientId}/customchannels/{customChannelId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified custom channel.", + // "httpMethod": "GET", + // "id": "adsense.customchannels.adunits.list", + // "parameterOrder": [ + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels/{customChannelId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.reports.generate": + +type ReportsGenerateCall struct { + s *Service + startDate string + endDate string + opt_ map[string]interface{} +} + +// Generate: Generate an AdSense 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. +func (r *ReportsService) Generate(startDate string, endDate string) *ReportsGenerateCall { + c := &ReportsGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.startDate = startDate + c.endDate = endDate + return c +} + +// AccountId sets the optional parameter "accountId": Accounts upon +// which to report. +func (c *ReportsGenerateCall) AccountId(accountId string) *ReportsGenerateCall { + c.opt_["accountId"] = accountId + return c +} + +// Currency sets the optional parameter "currency": Optional currency to +// use when reporting on monetary metrics. Defaults to the account's +// currency if not set. +func (c *ReportsGenerateCall) Currency(currency string) *ReportsGenerateCall { + c.opt_["currency"] = currency + return c +} + +// Dimension sets the optional parameter "dimension": Dimensions to base +// the report on. +func (c *ReportsGenerateCall) Dimension(dimension string) *ReportsGenerateCall { + c.opt_["dimension"] = dimension + return c +} + +// Filter sets the optional parameter "filter": Filters to be run on the +// report. +func (c *ReportsGenerateCall) Filter(filter string) *ReportsGenerateCall { + c.opt_["filter"] = filter + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *ReportsGenerateCall) Locale(locale string) *ReportsGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *ReportsGenerateCall) MaxResults(maxResults int64) *ReportsGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Metric sets the optional parameter "metric": Numeric columns to +// include in the report. +func (c *ReportsGenerateCall) Metric(metric string) *ReportsGenerateCall { + c.opt_["metric"] = metric + return c +} + +// Sort sets the optional parameter "sort": 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. +func (c *ReportsGenerateCall) Sort(sort string) *ReportsGenerateCall { + c.opt_["sort"] = sort + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *ReportsGenerateCall) StartIndex(startIndex int64) *ReportsGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *ReportsGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("endDate", fmt.Sprintf("%v", c.endDate)) + params.Set("startDate", fmt.Sprintf("%v", c.startDate)) + if v, ok := c.opt_["accountId"]; ok { + params.Set("accountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["currency"]; ok { + params.Set("currency", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dimension"]; ok { + params.Set("dimension", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["metric"]; ok { + params.Set("metric", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdsenseReportsGenerateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an AdSense 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.", + // "httpMethod": "GET", + // "id": "adsense.reports.generate", + // "parameterOrder": [ + // "startDate", + // "endDate" + // ], + // "parameters": { + // "accountId": { + // "description": "Accounts upon which to report.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "currency": { + // "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.", + // "location": "query", + // "pattern": "[a-zA-Z]+", + // "type": "string" + // }, + // "dimension": { + // "description": "Dimensions to base the report on.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "endDate": { + // "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,2}?)", + // "required": true, + // "type": "string" + // }, + // "filter": { + // "description": "Filters to be run on the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+(==|=@).+", + // "repeated": true, + // "type": "string" + // }, + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "metric": { + // "description": "Numeric columns to include in the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "sort": { + // "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.", + // "location": "query", + // "pattern": "(\\+|-)?[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "startDate": { + // "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,2}?)", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "reports", + // "response": { + // "$ref": "AdsenseReportsGenerateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "adsense.urlchannels.list": + +type UrlchannelsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all URL channels in the specified ad client for this +// AdSense account. +func (r *UrlchannelsService) List(adClientId string) *UrlchannelsListCall { + c := &UrlchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of URL channels to include in the response, used for paging. +func (c *UrlchannelsListCall) MaxResults(maxResults int64) *UrlchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *UrlchannelsListCall) PageToken(pageToken string) *UrlchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *UrlchannelsListCall) Do() (*UrlChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1.1/", "adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UrlChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all URL channels in the specified ad client for this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.urlchannels.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list URL channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of URL channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/urlchannels", + // "response": { + // "$ref": "UrlChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.2/adsense-api.json b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.2/adsense-api.json new file mode 100644 index 0000000000000..37a2d32fcc30b --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.2/adsense-api.json @@ -0,0 +1,1948 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/AIo_7F6prmIO5AKtg_utl79123U\"", + "discoveryVersion": "v1", + "id": "adsense:v1.2", + "name": "adsense", + "canonicalName": "AdSense", + "version": "v1.2", + "title": "AdSense Management API", + "description": "Gives AdSense publishers access to their inventory and the ability to generate reports", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/adsense-16.png", + "x32": "http://www.google.com/images/icons/product/adsense-32.png" + }, + "documentationLink": "https://developers.google.com/adsense/management/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/adsense/v1.2/", + "basePath": "/adsense/v1.2/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "adsense/v1.2/", + "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/adsense": { + "description": "View and manage your AdSense data" + }, + "https://www.googleapis.com/auth/adsense.readonly": { + "description": "View your AdSense data" + } + } + } + }, + "schemas": { + "Account": { + "id": "Account", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of this account." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adsense#account.", + "default": "adsense#account" + }, + "name": { + "type": "string", + "description": "Name of this account." + }, + "premium": { + "type": "boolean", + "description": "Whether this account is premium." + }, + "subAccounts": { + "type": "array", + "description": "Sub accounts of the this account.", + "items": { + "$ref": "Account" + } + } + } + }, + "Accounts": { + "id": "Accounts", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The accounts returned in this list response.", + "items": { + "$ref": "Account" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adsense#accounts.", + "default": "adsense#accounts" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through accounts. To retrieve the next page of results, set the next request's \"pageToken\" value to this." + } + } + }, + "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 adsense#adClient.", + "default": "adsense#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 adsense#adClients.", + "default": "adsense#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." + } + } + }, + "AdStyle": { + "id": "AdStyle", + "type": "object", + "properties": { + "colors": { + "type": "object", + "description": "The colors which are included in the style. These are represented as six hexadecimal characters, similar to HTML color codes, but without the leading hash.", + "properties": { + "background": { + "type": "string", + "description": "The color of the ad background." + }, + "border": { + "type": "string", + "description": "The color of the ad border." + }, + "text": { + "type": "string", + "description": "The color of the ad text." + }, + "title": { + "type": "string", + "description": "The color of the ad title." + }, + "url": { + "type": "string", + "description": "The color of the ad url." + } + } + }, + "corners": { + "type": "string", + "description": "The style of the corners in the ad." + }, + "font": { + "type": "object", + "description": "The font which is included in the style.", + "properties": { + "family": { + "type": "string", + "description": "The family of the font." + }, + "size": { + "type": "string", + "description": "The size of the font." + } + } + }, + "kind": { + "type": "string", + "description": "Kind this is, in this case adsense#adStyle.", + "default": "adsense#adStyle" + } + } + }, + "AdUnit": { + "id": "AdUnit", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Identity code of this ad unit, not necessarily unique across ad clients." + }, + "contentAdsSettings": { + "type": "object", + "description": "Settings specific to content ads (AFC) and highend mobile content ads (AFMC).", + "properties": { + "backupOption": { + "type": "object", + "description": "The backup option to be used in instances where no ad is available.", + "properties": { + "color": { + "type": "string", + "description": "Color to use when type is set to COLOR." + }, + "type": { + "type": "string", + "description": "Type of the backup option. Possible values are BLANK, COLOR and URL." + }, + "url": { + "type": "string", + "description": "URL to use when type is set to URL." + } + } + }, + "size": { + "type": "string", + "description": "Size of this ad unit." + }, + "type": { + "type": "string", + "description": "Type of this ad unit." + } + } + }, + "customStyle": { + "$ref": "AdStyle", + "description": "Custom style information specific to this ad unit." + }, + "feedAdsSettings": { + "type": "object", + "description": "Settings specific to feed ads (AFF).", + "properties": { + "adPosition": { + "type": "string", + "description": "The position of the ads relative to the feed entries." + }, + "frequency": { + "type": "integer", + "description": "The frequency at which ads should appear in the feed (i.e. every N entries).", + "format": "int32" + }, + "minimumWordCount": { + "type": "integer", + "description": "The minimum length an entry should be in order to have attached ads.", + "format": "int32" + }, + "type": { + "type": "string", + "description": "The type of ads which should appear." + } + } + }, + "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 adsense#adUnit.", + "default": "adsense#adUnit" + }, + "mobileContentAdsSettings": { + "type": "object", + "description": "Settings specific to WAP mobile content ads (AFMC).", + "properties": { + "markupLanguage": { + "type": "string", + "description": "The markup language to use for this ad unit." + }, + "scriptingLanguage": { + "type": "string", + "description": "The scripting language to use for this ad unit." + }, + "size": { + "type": "string", + "description": "Size of this ad unit." + }, + "type": { + "type": "string", + "description": "Type of this ad unit." + } + } + }, + "name": { + "type": "string", + "description": "Name of this ad unit." + }, + "savedStyleId": { + "type": "string", + "description": "ID of the saved ad style which holds this ad unit's style information." + }, + "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 adsense#adUnits.", + "default": "adsense#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." + } + } + }, + "AdsenseReportsGenerateResponse": { + "id": "AdsenseReportsGenerateResponse", + "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 adsense#report.", + "default": "adsense#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" + } + } + } + }, + "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 adsense#customChannel.", + "default": "adsense#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 adsense#customChannels.", + "default": "adsense#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." + } + } + }, + "SavedAdStyle": { + "id": "SavedAdStyle", + "type": "object", + "properties": { + "adStyle": { + "$ref": "AdStyle", + "description": "The AdStyle itself." + }, + "id": { + "type": "string", + "description": "Unique identifier of this saved ad style. 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 adsense#savedAdStyle.", + "default": "adsense#savedAdStyle" + }, + "name": { + "type": "string", + "description": "The user selected name of this SavedAdStyle." + } + } + }, + "SavedAdStyles": { + "id": "SavedAdStyles", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The saved ad styles returned in this list response.", + "items": { + "$ref": "SavedAdStyle" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adsense#savedAdStyles.", + "default": "adsense#savedAdStyles" + }, + "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." + } + } + }, + "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 adsense#savedReport.", + "default": "adsense#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 adsense#savedReports.", + "default": "adsense#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 adsense#urlChannel.", + "default": "adsense#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 adsense#urlChannels.", + "default": "adsense#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": { + "accounts": { + "methods": { + "get": { + "id": "adsense.accounts.get", + "path": "accounts/{accountId}", + "httpMethod": "GET", + "description": "Get information about the selected AdSense account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to get information about.", + "required": true, + "location": "path" + }, + "tree": { + "type": "boolean", + "description": "Whether the tree of sub accounts should be returned.", + "location": "query" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.accounts.list", + "path": "accounts", + "httpMethod": "GET", + "description": "List all accounts available to this AdSense account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of accounts to include in the response, used for paging.", + "format": "int32", + "minimum": "0", + "maximum": "10000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "response": { + "$ref": "Accounts" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "adclients": { + "methods": { + "list": { + "id": "adsense.accounts.adclients.list", + "path": "accounts/{accountId}/adclients", + "httpMethod": "GET", + "description": "List all ad clients in the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account for which to list ad clients.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of ad clients to include in the response, used for paging.", + "format": "int32", + "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" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "AdClients" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "adunits": { + "methods": { + "get": { + "id": "adsense.accounts.adunits.get", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}", + "httpMethod": "GET", + "description": "Gets the specified ad unit in the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": [ + "accountId", + "adClientId", + "adUnitId" + ], + "response": { + "$ref": "AdUnit" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.accounts.adunits.list", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits", + "httpMethod": "GET", + "description": "List all ad units in the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId" + ], + "response": { + "$ref": "AdUnits" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "customchannels": { + "methods": { + "list": { + "id": "adsense.accounts.adunits.customchannels.list", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels", + "httpMethod": "GET", + "description": "List all custom channels which the specified ad unit belongs to.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId", + "adUnitId" + ], + "response": { + "$ref": "CustomChannels" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "customchannels": { + "methods": { + "get": { + "id": "adsense.accounts.customchannels.get", + "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}", + "httpMethod": "GET", + "description": "Get the specified custom channel from the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": [ + "accountId", + "adClientId", + "customChannelId" + ], + "response": { + "$ref": "CustomChannel" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.accounts.customchannels.list", + "path": "accounts/{accountId}/adclients/{adClientId}/customchannels", + "httpMethod": "GET", + "description": "List all custom channels in the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId" + ], + "response": { + "$ref": "CustomChannels" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "adunits": { + "methods": { + "list": { + "id": "adsense.accounts.customchannels.adunits.list", + "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits", + "httpMethod": "GET", + "description": "List all ad units in the specified custom channel.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId", + "customChannelId" + ], + "response": { + "$ref": "AdUnits" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "reports": { + "methods": { + "generate": { + "id": "adsense.accounts.reports.generate", + "path": "accounts/{accountId}/reports", + "httpMethod": "GET", + "description": "Generate an AdSense 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": { + "accountId": { + "type": "string", + "description": "Account upon which to report.", + "required": true, + "location": "path" + }, + "currency": { + "type": "string", + "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.", + "pattern": "[a-zA-Z]+", + "location": "query" + }, + "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": "int32", + "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": "int32", + "minimum": "0", + "maximum": "5000", + "location": "query" + } + }, + "parameterOrder": [ + "accountId", + "startDate", + "endDate" + ], + "response": { + "$ref": "AdsenseReportsGenerateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ], + "supportsMediaDownload": true + } + }, + "resources": { + "saved": { + "methods": { + "generate": { + "id": "adsense.accounts.reports.saved.generate", + "path": "accounts/{accountId}/reports/{savedReportId}", + "httpMethod": "GET", + "description": "Generate an AdSense report based on the saved report ID sent in the query parameters.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the saved reports belong.", + "required": true, + "location": "path" + }, + "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": [ + "accountId", + "savedReportId" + ], + "response": { + "$ref": "AdsenseReportsGenerateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.accounts.reports.saved.list", + "path": "accounts/{accountId}/reports/saved", + "httpMethod": "GET", + "description": "List all saved reports in the specified AdSense account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the saved reports belong.", + "required": true, + "location": "path" + }, + "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" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "SavedReports" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "savedadstyles": { + "methods": { + "get": { + "id": "adsense.accounts.savedadstyles.get", + "path": "accounts/{accountId}/savedadstyles/{savedAdStyleId}", + "httpMethod": "GET", + "description": "List a specific saved ad style for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account for which to get the saved ad style.", + "required": true, + "location": "path" + }, + "savedAdStyleId": { + "type": "string", + "description": "Saved ad style to retrieve.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "savedAdStyleId" + ], + "response": { + "$ref": "SavedAdStyle" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.accounts.savedadstyles.list", + "path": "accounts/{accountId}/savedadstyles", + "httpMethod": "GET", + "description": "List all saved ad styles in the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account for which to list saved ad styles.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of saved ad styles to include in the response, used for paging.", + "format": "int32", + "minimum": "0", + "maximum": "10000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "SavedAdStyles" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "urlchannels": { + "methods": { + "list": { + "id": "adsense.accounts.urlchannels.list", + "path": "accounts/{accountId}/adclients/{adClientId}/urlchannels", + "httpMethod": "GET", + "description": "List all URL channels in the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId" + ], + "response": { + "$ref": "UrlChannels" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "adclients": { + "methods": { + "list": { + "id": "adsense.adclients.list", + "path": "adclients", + "httpMethod": "GET", + "description": "List all ad clients in this AdSense account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of ad clients to include in the response, used for paging.", + "format": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "adunits": { + "methods": { + "get": { + "id": "adsense.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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.adunits.list", + "path": "adclients/{adClientId}/adunits", + "httpMethod": "GET", + "description": "List all ad units in the specified ad client for this AdSense 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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "customchannels": { + "methods": { + "list": { + "id": "adsense.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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "customchannels": { + "methods": { + "get": { + "id": "adsense.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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.customchannels.list", + "path": "adclients/{adClientId}/customchannels", + "httpMethod": "GET", + "description": "List all custom channels in the specified ad client for this AdSense 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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "adunits": { + "methods": { + "list": { + "id": "adsense.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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "reports": { + "methods": { + "generate": { + "id": "adsense.reports.generate", + "path": "reports", + "httpMethod": "GET", + "description": "Generate an AdSense 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": { + "accountId": { + "type": "string", + "description": "Accounts upon which to report.", + "repeated": true, + "location": "query" + }, + "currency": { + "type": "string", + "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.", + "pattern": "[a-zA-Z]+", + "location": "query" + }, + "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": "int32", + "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": "int32", + "minimum": "0", + "maximum": "5000", + "location": "query" + } + }, + "parameterOrder": [ + "startDate", + "endDate" + ], + "response": { + "$ref": "AdsenseReportsGenerateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ], + "supportsMediaDownload": true + } + }, + "resources": { + "saved": { + "methods": { + "generate": { + "id": "adsense.reports.saved.generate", + "path": "reports/{savedReportId}", + "httpMethod": "GET", + "description": "Generate an AdSense 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": "AdsenseReportsGenerateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.reports.saved.list", + "path": "reports/saved", + "httpMethod": "GET", + "description": "List all saved reports in this AdSense 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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "savedadstyles": { + "methods": { + "get": { + "id": "adsense.savedadstyles.get", + "path": "savedadstyles/{savedAdStyleId}", + "httpMethod": "GET", + "description": "Get a specific saved ad style from the user's account.", + "parameters": { + "savedAdStyleId": { + "type": "string", + "description": "Saved ad style to retrieve.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "savedAdStyleId" + ], + "response": { + "$ref": "SavedAdStyle" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.savedadstyles.list", + "path": "savedadstyles", + "httpMethod": "GET", + "description": "List all saved ad styles in the user's account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of saved ad styles to include in the response, used for paging.", + "format": "int32", + "minimum": "0", + "maximum": "10000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "response": { + "$ref": "SavedAdStyles" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "urlchannels": { + "methods": { + "list": { + "id": "adsense.urlchannels.list", + "path": "adclients/{adClientId}/urlchannels", + "httpMethod": "GET", + "description": "List all URL channels in the specified ad client for this AdSense 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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.2/adsense-gen.go b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.2/adsense-gen.go new file mode 100644 index 0000000000000..cd39298070b6c --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.2/adsense-gen.go @@ -0,0 +1,3780 @@ +// Package adsense provides access to the AdSense Management API. +// +// See https://developers.google.com/adsense/management/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/adsense/v1.2" +// ... +// adsenseService, err := adsense.New(oauthHttpClient) +package adsense + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "adsense:v1.2" +const apiName = "adsense" +const apiVersion = "v1.2" +const basePath = "https://www.googleapis.com/adsense/v1.2/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your AdSense data + AdsenseScope = "https://www.googleapis.com/auth/adsense" + + // View your AdSense data + AdsenseReadonlyScope = "https://www.googleapis.com/auth/adsense.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.Accounts = NewAccountsService(s) + s.Adclients = NewAdclientsService(s) + s.Adunits = NewAdunitsService(s) + s.Customchannels = NewCustomchannelsService(s) + s.Reports = NewReportsService(s) + s.Savedadstyles = NewSavedadstylesService(s) + s.Urlchannels = NewUrlchannelsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Accounts *AccountsService + + Adclients *AdclientsService + + Adunits *AdunitsService + + Customchannels *CustomchannelsService + + Reports *ReportsService + + Savedadstyles *SavedadstylesService + + Urlchannels *UrlchannelsService +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + rs.Adclients = NewAccountsAdclientsService(s) + rs.Adunits = NewAccountsAdunitsService(s) + rs.Customchannels = NewAccountsCustomchannelsService(s) + rs.Reports = NewAccountsReportsService(s) + rs.Savedadstyles = NewAccountsSavedadstylesService(s) + rs.Urlchannels = NewAccountsUrlchannelsService(s) + return rs +} + +type AccountsService struct { + s *Service + + Adclients *AccountsAdclientsService + + Adunits *AccountsAdunitsService + + Customchannels *AccountsCustomchannelsService + + Reports *AccountsReportsService + + Savedadstyles *AccountsSavedadstylesService + + Urlchannels *AccountsUrlchannelsService +} + +func NewAccountsAdclientsService(s *Service) *AccountsAdclientsService { + rs := &AccountsAdclientsService{s: s} + return rs +} + +type AccountsAdclientsService struct { + s *Service +} + +func NewAccountsAdunitsService(s *Service) *AccountsAdunitsService { + rs := &AccountsAdunitsService{s: s} + rs.Customchannels = NewAccountsAdunitsCustomchannelsService(s) + return rs +} + +type AccountsAdunitsService struct { + s *Service + + Customchannels *AccountsAdunitsCustomchannelsService +} + +func NewAccountsAdunitsCustomchannelsService(s *Service) *AccountsAdunitsCustomchannelsService { + rs := &AccountsAdunitsCustomchannelsService{s: s} + return rs +} + +type AccountsAdunitsCustomchannelsService struct { + s *Service +} + +func NewAccountsCustomchannelsService(s *Service) *AccountsCustomchannelsService { + rs := &AccountsCustomchannelsService{s: s} + rs.Adunits = NewAccountsCustomchannelsAdunitsService(s) + return rs +} + +type AccountsCustomchannelsService struct { + s *Service + + Adunits *AccountsCustomchannelsAdunitsService +} + +func NewAccountsCustomchannelsAdunitsService(s *Service) *AccountsCustomchannelsAdunitsService { + rs := &AccountsCustomchannelsAdunitsService{s: s} + return rs +} + +type AccountsCustomchannelsAdunitsService struct { + s *Service +} + +func NewAccountsReportsService(s *Service) *AccountsReportsService { + rs := &AccountsReportsService{s: s} + rs.Saved = NewAccountsReportsSavedService(s) + return rs +} + +type AccountsReportsService struct { + s *Service + + Saved *AccountsReportsSavedService +} + +func NewAccountsReportsSavedService(s *Service) *AccountsReportsSavedService { + rs := &AccountsReportsSavedService{s: s} + return rs +} + +type AccountsReportsSavedService struct { + s *Service +} + +func NewAccountsSavedadstylesService(s *Service) *AccountsSavedadstylesService { + rs := &AccountsSavedadstylesService{s: s} + return rs +} + +type AccountsSavedadstylesService struct { + s *Service +} + +func NewAccountsUrlchannelsService(s *Service) *AccountsUrlchannelsService { + rs := &AccountsUrlchannelsService{s: s} + return rs +} + +type AccountsUrlchannelsService struct { + s *Service +} + +func NewAdclientsService(s *Service) *AdclientsService { + rs := &AdclientsService{s: s} + return rs +} + +type AdclientsService struct { + s *Service +} + +func NewAdunitsService(s *Service) *AdunitsService { + rs := &AdunitsService{s: s} + rs.Customchannels = NewAdunitsCustomchannelsService(s) + return rs +} + +type AdunitsService struct { + s *Service + + Customchannels *AdunitsCustomchannelsService +} + +func NewAdunitsCustomchannelsService(s *Service) *AdunitsCustomchannelsService { + rs := &AdunitsCustomchannelsService{s: s} + return rs +} + +type AdunitsCustomchannelsService struct { + s *Service +} + +func NewCustomchannelsService(s *Service) *CustomchannelsService { + rs := &CustomchannelsService{s: s} + rs.Adunits = NewCustomchannelsAdunitsService(s) + return rs +} + +type CustomchannelsService struct { + s *Service + + Adunits *CustomchannelsAdunitsService +} + +func NewCustomchannelsAdunitsService(s *Service) *CustomchannelsAdunitsService { + rs := &CustomchannelsAdunitsService{s: s} + return rs +} + +type CustomchannelsAdunitsService struct { + s *Service +} + +func NewReportsService(s *Service) *ReportsService { + rs := &ReportsService{s: s} + rs.Saved = NewReportsSavedService(s) + return rs +} + +type ReportsService struct { + s *Service + + Saved *ReportsSavedService +} + +func NewReportsSavedService(s *Service) *ReportsSavedService { + rs := &ReportsSavedService{s: s} + return rs +} + +type ReportsSavedService struct { + s *Service +} + +func NewSavedadstylesService(s *Service) *SavedadstylesService { + rs := &SavedadstylesService{s: s} + return rs +} + +type SavedadstylesService struct { + s *Service +} + +func NewUrlchannelsService(s *Service) *UrlchannelsService { + rs := &UrlchannelsService{s: s} + return rs +} + +type UrlchannelsService struct { + s *Service +} + +type Account struct { + // Id: Unique identifier of this account. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#account. + Kind string `json:"kind,omitempty"` + + // Name: Name of this account. + Name string `json:"name,omitempty"` + + // Premium: Whether this account is premium. + Premium bool `json:"premium,omitempty"` + + // SubAccounts: Sub accounts of the this account. + SubAccounts []*Account `json:"subAccounts,omitempty"` +} + +type Accounts struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The accounts returned in this list response. + Items []*Account `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#accounts. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through accounts. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AdClient struct { + // ArcOptIn: Whether this ad client is opted in to ARC. + ArcOptIn bool `json:"arcOptIn,omitempty"` + + // Id: Unique identifier of this ad client. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#adClient. + Kind string `json:"kind,omitempty"` + + // ProductCode: This ad client's product code, which corresponds to the + // PRODUCT_CODE report dimension. + ProductCode string `json:"productCode,omitempty"` + + // SupportsReporting: Whether this ad client supports being reported on. + SupportsReporting bool `json:"supportsReporting,omitempty"` +} + +type AdClients struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The ad clients returned in this list response. + Items []*AdClient `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#adClients. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad clients. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AdStyle struct { + // Colors: The colors which are included in the style. These are + // represented as six hexadecimal characters, similar to HTML color + // codes, but without the leading hash. + Colors *AdStyleColors `json:"colors,omitempty"` + + // Corners: The style of the corners in the ad. + Corners string `json:"corners,omitempty"` + + // Font: The font which is included in the style. + Font *AdStyleFont `json:"font,omitempty"` + + // Kind: Kind this is, in this case adsense#adStyle. + Kind string `json:"kind,omitempty"` +} + +type AdStyleColors struct { + // Background: The color of the ad background. + Background string `json:"background,omitempty"` + + // Border: The color of the ad border. + Border string `json:"border,omitempty"` + + // Text: The color of the ad text. + Text string `json:"text,omitempty"` + + // Title: The color of the ad title. + Title string `json:"title,omitempty"` + + // Url: The color of the ad url. + Url string `json:"url,omitempty"` +} + +type AdStyleFont struct { + // Family: The family of the font. + Family string `json:"family,omitempty"` + + // Size: The size of the font. + Size string `json:"size,omitempty"` +} + +type AdUnit struct { + // Code: Identity code of this ad unit, not necessarily unique across ad + // clients. + Code string `json:"code,omitempty"` + + // ContentAdsSettings: Settings specific to content ads (AFC) and + // highend mobile content ads (AFMC). + ContentAdsSettings *AdUnitContentAdsSettings `json:"contentAdsSettings,omitempty"` + + // CustomStyle: Custom style information specific to this ad unit. + CustomStyle *AdStyle `json:"customStyle,omitempty"` + + // FeedAdsSettings: Settings specific to feed ads (AFF). + FeedAdsSettings *AdUnitFeedAdsSettings `json:"feedAdsSettings,omitempty"` + + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#adUnit. + Kind string `json:"kind,omitempty"` + + // MobileContentAdsSettings: Settings specific to WAP mobile content ads + // (AFMC). + MobileContentAdsSettings *AdUnitMobileContentAdsSettings `json:"mobileContentAdsSettings,omitempty"` + + // Name: Name of this ad unit. + Name string `json:"name,omitempty"` + + // SavedStyleId: ID of the saved ad style which holds this ad unit's + // style information. + SavedStyleId string `json:"savedStyleId,omitempty"` + + // Status: Status of this ad unit. Possible values are: + // NEW: Indicates + // that the ad unit was created within the last seven days and does not + // yet have any activity associated with it. + // + // ACTIVE: Indicates that + // there has been activity on this ad unit in the last seven + // days. + // + // INACTIVE: Indicates that there has been no activity on this ad + // unit in the last seven days. + Status string `json:"status,omitempty"` +} + +type AdUnitContentAdsSettings struct { + // BackupOption: The backup option to be used in instances where no ad + // is available. + BackupOption *AdUnitContentAdsSettingsBackupOption `json:"backupOption,omitempty"` + + // Size: Size of this ad unit. + Size string `json:"size,omitempty"` + + // Type: Type of this ad unit. + Type string `json:"type,omitempty"` +} + +type AdUnitContentAdsSettingsBackupOption struct { + // Color: Color to use when type is set to COLOR. + Color string `json:"color,omitempty"` + + // Type: Type of the backup option. Possible values are BLANK, COLOR and + // URL. + Type string `json:"type,omitempty"` + + // Url: URL to use when type is set to URL. + Url string `json:"url,omitempty"` +} + +type AdUnitFeedAdsSettings struct { + // AdPosition: The position of the ads relative to the feed entries. + AdPosition string `json:"adPosition,omitempty"` + + // Frequency: The frequency at which ads should appear in the feed (i.e. + // every N entries). + Frequency int64 `json:"frequency,omitempty"` + + // MinimumWordCount: The minimum length an entry should be in order to + // have attached ads. + MinimumWordCount int64 `json:"minimumWordCount,omitempty"` + + // Type: The type of ads which should appear. + Type string `json:"type,omitempty"` +} + +type AdUnitMobileContentAdsSettings struct { + // MarkupLanguage: The markup language to use for this ad unit. + MarkupLanguage string `json:"markupLanguage,omitempty"` + + // ScriptingLanguage: The scripting language to use for this ad unit. + ScriptingLanguage string `json:"scriptingLanguage,omitempty"` + + // Size: Size of this ad unit. + Size string `json:"size,omitempty"` + + // Type: Type of this ad unit. + Type string `json:"type,omitempty"` +} + +type AdUnits struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The ad units returned in this list response. + Items []*AdUnit `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#adUnits. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad units. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AdsenseReportsGenerateResponse struct { + // Averages: The averages of the report. This is the same length as any + // other row in the report; cells corresponding to dimension columns are + // empty. + Averages []string `json:"averages,omitempty"` + + // Headers: 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. + Headers []*AdsenseReportsGenerateResponseHeaders `json:"headers,omitempty"` + + // Kind: Kind this is, in this case adsense#report. + Kind string `json:"kind,omitempty"` + + // Rows: 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. + Rows [][]string `json:"rows,omitempty"` + + // TotalMatchedRows: 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. + TotalMatchedRows int64 `json:"totalMatchedRows,omitempty,string"` + + // Totals: The totals of the report. This is the same length as any + // other row in the report; cells corresponding to dimension columns are + // empty. + Totals []string `json:"totals,omitempty"` + + // Warnings: Any warnings associated with generation of the report. + Warnings []string `json:"warnings,omitempty"` +} + +type AdsenseReportsGenerateResponseHeaders struct { + // Currency: The currency of this column. Only present if the header + // type is METRIC_CURRENCY. + Currency string `json:"currency,omitempty"` + + // Name: The name of the header. + Name string `json:"name,omitempty"` + + // Type: The type of the header; one of DIMENSION, METRIC_TALLY, + // METRIC_RATIO, or METRIC_CURRENCY. + Type string `json:"type,omitempty"` +} + +type CustomChannel struct { + // Code: Code of this custom channel, not necessarily unique across ad + // clients. + Code string `json:"code,omitempty"` + + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#customChannel. + Kind string `json:"kind,omitempty"` + + // Name: Name of this custom channel. + Name string `json:"name,omitempty"` + + // TargetingInfo: The targeting information of this custom channel, if + // activated. + TargetingInfo *CustomChannelTargetingInfo `json:"targetingInfo,omitempty"` +} + +type CustomChannelTargetingInfo struct { + // AdsAppearOn: The name used to describe this channel externally. + AdsAppearOn string `json:"adsAppearOn,omitempty"` + + // Description: The external description of the channel. + Description string `json:"description,omitempty"` + + // Location: 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. + Location string `json:"location,omitempty"` + + // SiteLanguage: The language of the sites ads will be displayed on. + SiteLanguage string `json:"siteLanguage,omitempty"` +} + +type CustomChannels struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The custom channels returned in this list response. + Items []*CustomChannel `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#customChannels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through custom + // channels. To retrieve the next page of results, set the next + // request's "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type SavedAdStyle struct { + // AdStyle: The AdStyle itself. + AdStyle *AdStyle `json:"adStyle,omitempty"` + + // Id: Unique identifier of this saved ad style. This should be + // considered an opaque identifier; it is not safe to rely on it being + // in any particular format. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#savedAdStyle. + Kind string `json:"kind,omitempty"` + + // Name: The user selected name of this SavedAdStyle. + Name string `json:"name,omitempty"` +} + +type SavedAdStyles struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The saved ad styles returned in this list response. + Items []*SavedAdStyle `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#savedAdStyles. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad units. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type SavedReport struct { + // Id: Unique identifier of this saved report. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#savedReport. + Kind string `json:"kind,omitempty"` + + // Name: This saved report's name. + Name string `json:"name,omitempty"` +} + +type SavedReports struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The saved reports returned in this list response. + Items []*SavedReport `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#savedReports. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through saved reports. + // To retrieve the next page of results, set the next request's + // "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type UrlChannel struct { + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#urlChannel. + Kind string `json:"kind,omitempty"` + + // UrlPattern: URL Pattern of this URL channel. Does not include + // "http://" or "https://". Example: www.example.com/home + UrlPattern string `json:"urlPattern,omitempty"` +} + +type UrlChannels struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The URL channels returned in this list response. + Items []*UrlChannel `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#urlChannels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through URL channels. + // To retrieve the next page of results, set the next request's + // "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +// method id "adsense.accounts.get": + +type AccountsGetCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// Get: Get information about the selected AdSense account. +func (r *AccountsService) Get(accountId string) *AccountsGetCall { + c := &AccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// Tree sets the optional parameter "tree": Whether the tree of sub +// accounts should be returned. +func (c *AccountsGetCall) Tree(tree bool) *AccountsGetCall { + c.opt_["tree"] = tree + return c +} + +func (c *AccountsGetCall) Do() (*Account, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["tree"]; ok { + params.Set("tree", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get information about the selected AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.get", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to get information about.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tree": { + // "description": "Whether the tree of sub accounts should be returned.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "accounts/{accountId}", + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.list": + +type AccountsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all accounts available to this AdSense account. +func (r *AccountsService) List() *AccountsListCall { + c := &AccountsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of accounts to include in the response, used for paging. +func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token, used to page through accounts. To retrieve the next page, set +// this parameter to the value of "nextPageToken" from the previous +// response. +func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsListCall) Do() (*Accounts, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Accounts) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all accounts available to this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of accounts to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "accounts", + // "response": { + // "$ref": "Accounts" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.adclients.list": + +type AccountsAdclientsListCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// List: List all ad clients in the specified account. +func (r *AccountsAdclientsService) List(accountId string) *AccountsAdclientsListCall { + c := &AccountsAdclientsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad clients to include in the response, used for paging. +func (c *AccountsAdclientsListCall) MaxResults(maxResults int64) *AccountsAdclientsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsAdclientsListCall) PageToken(pageToken string) *AccountsAdclientsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsAdclientsListCall) Do() (*AdClients, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdClients) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad clients in the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.adclients.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account for which to list ad clients.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of ad clients to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients", + // "response": { + // "$ref": "AdClients" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.adunits.get": + +type AccountsAdunitsGetCall struct { + s *Service + accountId string + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// Get: Gets the specified ad unit in the specified ad client for the +// specified account. +func (r *AccountsAdunitsService) Get(accountId string, adClientId string, adUnitId string) *AccountsAdunitsGetCall { + c := &AccountsAdunitsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +func (c *AccountsAdunitsGetCall) Do() (*AdUnit, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified ad unit in the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.adunits.get", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to get the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}", + // "response": { + // "$ref": "AdUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.adunits.list": + +type AccountsAdunitsListCall struct { + s *Service + accountId string + adClientId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified ad client for the specified +// account. +func (r *AccountsAdunitsService) List(accountId string, adClientId string) *AccountsAdunitsListCall { + c := &AccountsAdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *AccountsAdunitsListCall) IncludeInactive(includeInactive bool) *AccountsAdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *AccountsAdunitsListCall) MaxResults(maxResults int64) *AccountsAdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsAdunitsListCall) PageToken(pageToken string) *AccountsAdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsAdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.adunits.list", + // "parameterOrder": [ + // "accountId", + // "adClientId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.adunits.customchannels.list": + +type AccountsAdunitsCustomchannelsListCall struct { + s *Service + accountId string + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// List: List all custom channels which the specified ad unit belongs +// to. +func (r *AccountsAdunitsCustomchannelsService) List(accountId string, adClientId string, adUnitId string) *AccountsAdunitsCustomchannelsListCall { + c := &AccountsAdunitsCustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *AccountsAdunitsCustomchannelsListCall) MaxResults(maxResults int64) *AccountsAdunitsCustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsAdunitsCustomchannelsListCall) PageToken(pageToken string) *AccountsAdunitsCustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsAdunitsCustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels which the specified ad unit belongs to.", + // "httpMethod": "GET", + // "id": "adsense.accounts.adunits.customchannels.list", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client which contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.customchannels.get": + +type AccountsCustomchannelsGetCall struct { + s *Service + accountId string + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// Get: Get the specified custom channel from the specified ad client +// for the specified account. +func (r *AccountsCustomchannelsService) Get(accountId string, adClientId string, customChannelId string) *AccountsCustomchannelsGetCall { + c := &AccountsCustomchannelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +func (c *AccountsCustomchannelsGetCall) Do() (*CustomChannel, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the specified custom channel from the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.customchannels.get", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}", + // "response": { + // "$ref": "CustomChannel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.customchannels.list": + +type AccountsCustomchannelsListCall struct { + s *Service + accountId string + adClientId string + opt_ map[string]interface{} +} + +// List: List all custom channels in the specified ad client for the +// specified account. +func (r *AccountsCustomchannelsService) List(accountId string, adClientId string) *AccountsCustomchannelsListCall { + c := &AccountsCustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *AccountsCustomchannelsListCall) MaxResults(maxResults int64) *AccountsCustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsCustomchannelsListCall) PageToken(pageToken string) *AccountsCustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsCustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels in the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.customchannels.list", + // "parameterOrder": [ + // "accountId", + // "adClientId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.customchannels.adunits.list": + +type AccountsCustomchannelsAdunitsListCall struct { + s *Service + accountId string + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified custom channel. +func (r *AccountsCustomchannelsAdunitsService) List(accountId string, adClientId string, customChannelId string) *AccountsCustomchannelsAdunitsListCall { + c := &AccountsCustomchannelsAdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *AccountsCustomchannelsAdunitsListCall) IncludeInactive(includeInactive bool) *AccountsCustomchannelsAdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *AccountsCustomchannelsAdunitsListCall) MaxResults(maxResults int64) *AccountsCustomchannelsAdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsCustomchannelsAdunitsListCall) PageToken(pageToken string) *AccountsCustomchannelsAdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsCustomchannelsAdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified custom channel.", + // "httpMethod": "GET", + // "id": "adsense.accounts.customchannels.adunits.list", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.reports.generate": + +type AccountsReportsGenerateCall struct { + s *Service + accountId string + startDate string + endDate string + opt_ map[string]interface{} +} + +// Generate: Generate an AdSense 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. +func (r *AccountsReportsService) Generate(accountId string, startDate string, endDate string) *AccountsReportsGenerateCall { + c := &AccountsReportsGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.startDate = startDate + c.endDate = endDate + return c +} + +// Currency sets the optional parameter "currency": Optional currency to +// use when reporting on monetary metrics. Defaults to the account's +// currency if not set. +func (c *AccountsReportsGenerateCall) Currency(currency string) *AccountsReportsGenerateCall { + c.opt_["currency"] = currency + return c +} + +// Dimension sets the optional parameter "dimension": Dimensions to base +// the report on. +func (c *AccountsReportsGenerateCall) Dimension(dimension string) *AccountsReportsGenerateCall { + c.opt_["dimension"] = dimension + return c +} + +// Filter sets the optional parameter "filter": Filters to be run on the +// report. +func (c *AccountsReportsGenerateCall) Filter(filter string) *AccountsReportsGenerateCall { + c.opt_["filter"] = filter + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *AccountsReportsGenerateCall) Locale(locale string) *AccountsReportsGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *AccountsReportsGenerateCall) MaxResults(maxResults int64) *AccountsReportsGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Metric sets the optional parameter "metric": Numeric columns to +// include in the report. +func (c *AccountsReportsGenerateCall) Metric(metric string) *AccountsReportsGenerateCall { + c.opt_["metric"] = metric + return c +} + +// Sort sets the optional parameter "sort": 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. +func (c *AccountsReportsGenerateCall) Sort(sort string) *AccountsReportsGenerateCall { + c.opt_["sort"] = sort + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *AccountsReportsGenerateCall) StartIndex(startIndex int64) *AccountsReportsGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *AccountsReportsGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("endDate", fmt.Sprintf("%v", c.endDate)) + params.Set("startDate", fmt.Sprintf("%v", c.startDate)) + if v, ok := c.opt_["currency"]; ok { + params.Set("currency", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dimension"]; ok { + params.Set("dimension", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["metric"]; ok { + params.Set("metric", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdsenseReportsGenerateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an AdSense 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.", + // "httpMethod": "GET", + // "id": "adsense.accounts.reports.generate", + // "parameterOrder": [ + // "accountId", + // "startDate", + // "endDate" + // ], + // "parameters": { + // "accountId": { + // "description": "Account upon which to report.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "currency": { + // "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.", + // "location": "query", + // "pattern": "[a-zA-Z]+", + // "type": "string" + // }, + // "dimension": { + // "description": "Dimensions to base the report on.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "endDate": { + // "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)", + // "required": true, + // "type": "string" + // }, + // "filter": { + // "description": "Filters to be run on the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+(==|=@).+", + // "repeated": true, + // "type": "string" + // }, + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "metric": { + // "description": "Numeric columns to include in the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "sort": { + // "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.", + // "location": "query", + // "pattern": "(\\+|-)?[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "startDate": { + // "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "accounts/{accountId}/reports", + // "response": { + // "$ref": "AdsenseReportsGenerateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "adsense.accounts.reports.saved.generate": + +type AccountsReportsSavedGenerateCall struct { + s *Service + accountId string + savedReportId string + opt_ map[string]interface{} +} + +// Generate: Generate an AdSense report based on the saved report ID +// sent in the query parameters. +func (r *AccountsReportsSavedService) Generate(accountId string, savedReportId string) *AccountsReportsSavedGenerateCall { + c := &AccountsReportsSavedGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.savedReportId = savedReportId + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *AccountsReportsSavedGenerateCall) Locale(locale string) *AccountsReportsSavedGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *AccountsReportsSavedGenerateCall) MaxResults(maxResults int64) *AccountsReportsSavedGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *AccountsReportsSavedGenerateCall) StartIndex(startIndex int64) *AccountsReportsSavedGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *AccountsReportsSavedGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/{savedReportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{savedReportId}", url.QueryEscape(c.savedReportId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdsenseReportsGenerateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an AdSense report based on the saved report ID sent in the query parameters.", + // "httpMethod": "GET", + // "id": "adsense.accounts.reports.saved.generate", + // "parameterOrder": [ + // "accountId", + // "savedReportId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the saved reports belong.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "savedReportId": { + // "description": "The saved report to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "accounts/{accountId}/reports/{savedReportId}", + // "response": { + // "$ref": "AdsenseReportsGenerateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.reports.saved.list": + +type AccountsReportsSavedListCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// List: List all saved reports in the specified AdSense account. +func (r *AccountsReportsSavedService) List(accountId string) *AccountsReportsSavedListCall { + c := &AccountsReportsSavedListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of saved reports to include in the response, used for paging. +func (c *AccountsReportsSavedListCall) MaxResults(maxResults int64) *AccountsReportsSavedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsReportsSavedListCall) PageToken(pageToken string) *AccountsReportsSavedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsReportsSavedListCall) Do() (*SavedReports, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/saved") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedReports) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all saved reports in the specified AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.reports.saved.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the saved reports belong.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of saved reports to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/reports/saved", + // "response": { + // "$ref": "SavedReports" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.savedadstyles.get": + +type AccountsSavedadstylesGetCall struct { + s *Service + accountId string + savedAdStyleId string + opt_ map[string]interface{} +} + +// Get: List a specific saved ad style for the specified account. +func (r *AccountsSavedadstylesService) Get(accountId string, savedAdStyleId string) *AccountsSavedadstylesGetCall { + c := &AccountsSavedadstylesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.savedAdStyleId = savedAdStyleId + return c +} + +func (c *AccountsSavedadstylesGetCall) Do() (*SavedAdStyle, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/savedadstyles/{savedAdStyleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{savedAdStyleId}", url.QueryEscape(c.savedAdStyleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedAdStyle) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List a specific saved ad style for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.savedadstyles.get", + // "parameterOrder": [ + // "accountId", + // "savedAdStyleId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account for which to get the saved ad style.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "savedAdStyleId": { + // "description": "Saved ad style to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/savedadstyles/{savedAdStyleId}", + // "response": { + // "$ref": "SavedAdStyle" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.savedadstyles.list": + +type AccountsSavedadstylesListCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// List: List all saved ad styles in the specified account. +func (r *AccountsSavedadstylesService) List(accountId string) *AccountsSavedadstylesListCall { + c := &AccountsSavedadstylesListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of saved ad styles to include in the response, used for +// paging. +func (c *AccountsSavedadstylesListCall) MaxResults(maxResults int64) *AccountsSavedadstylesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token, used to page through saved ad styles. To retrieve the next +// page, set this parameter to the value of "nextPageToken" from the +// previous response. +func (c *AccountsSavedadstylesListCall) PageToken(pageToken string) *AccountsSavedadstylesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsSavedadstylesListCall) Do() (*SavedAdStyles, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/savedadstyles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedAdStyles) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all saved ad styles in the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.savedadstyles.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account for which to list saved ad styles.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of saved ad styles to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/savedadstyles", + // "response": { + // "$ref": "SavedAdStyles" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.urlchannels.list": + +type AccountsUrlchannelsListCall struct { + s *Service + accountId string + adClientId string + opt_ map[string]interface{} +} + +// List: List all URL channels in the specified ad client for the +// specified account. +func (r *AccountsUrlchannelsService) List(accountId string, adClientId string) *AccountsUrlchannelsListCall { + c := &AccountsUrlchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of URL channels to include in the response, used for paging. +func (c *AccountsUrlchannelsListCall) MaxResults(maxResults int64) *AccountsUrlchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsUrlchannelsListCall) PageToken(pageToken string) *AccountsUrlchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsUrlchannelsListCall) Do() (*UrlChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UrlChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all URL channels in the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.urlchannels.list", + // "parameterOrder": [ + // "accountId", + // "adClientId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to list URL channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of URL channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/urlchannels", + // "response": { + // "$ref": "UrlChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adclients.list": + +type AdclientsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all ad clients in this AdSense account. +func (r *AdclientsService) List() *AdclientsListCall { + c := &AdclientsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad clients to include in the response, used for paging. +func (c *AdclientsListCall) MaxResults(maxResults int64) *AdclientsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdclientsListCall) PageToken(pageToken string) *AdclientsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdclientsListCall) Do() (*AdClients, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdClients) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad clients in this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.adclients.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of ad clients to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "adclients", + // "response": { + // "$ref": "AdClients" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adunits.get": + +type AdunitsGetCall struct { + s *Service + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// Get: Gets the specified ad unit in the specified ad client. +func (r *AdunitsService) Get(adClientId string, adUnitId string) *AdunitsGetCall { + c := &AdunitsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +func (c *AdunitsGetCall) Do() (*AdUnit, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified ad unit in the specified ad client.", + // "httpMethod": "GET", + // "id": "adsense.adunits.get", + // "parameterOrder": [ + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to get the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits/{adUnitId}", + // "response": { + // "$ref": "AdUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adunits.list": + +type AdunitsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified ad client for this AdSense +// account. +func (r *AdunitsService) List(adClientId string) *AdunitsListCall { + c := &AdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *AdunitsListCall) IncludeInactive(includeInactive bool) *AdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *AdunitsListCall) MaxResults(maxResults int64) *AdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdunitsListCall) PageToken(pageToken string) *AdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified ad client for this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.adunits.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adunits.customchannels.list": + +type AdunitsCustomchannelsListCall struct { + s *Service + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// List: List all custom channels which the specified ad unit belongs +// to. +func (r *AdunitsCustomchannelsService) List(adClientId string, adUnitId string) *AdunitsCustomchannelsListCall { + c := &AdunitsCustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *AdunitsCustomchannelsListCall) MaxResults(maxResults int64) *AdunitsCustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdunitsCustomchannelsListCall) PageToken(pageToken string) *AdunitsCustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdunitsCustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels which the specified ad unit belongs to.", + // "httpMethod": "GET", + // "id": "adsense.adunits.customchannels.list", + // "parameterOrder": [ + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client which contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits/{adUnitId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.customchannels.get": + +type CustomchannelsGetCall struct { + s *Service + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// Get: Get the specified custom channel from the specified ad client. +func (r *CustomchannelsService) Get(adClientId string, customChannelId string) *CustomchannelsGetCall { + c := &CustomchannelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +func (c *CustomchannelsGetCall) Do() (*CustomChannel, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the specified custom channel from the specified ad client.", + // "httpMethod": "GET", + // "id": "adsense.customchannels.get", + // "parameterOrder": [ + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels/{customChannelId}", + // "response": { + // "$ref": "CustomChannel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.customchannels.list": + +type CustomchannelsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all custom channels in the specified ad client for this +// AdSense account. +func (r *CustomchannelsService) List(adClientId string) *CustomchannelsListCall { + c := &CustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *CustomchannelsListCall) MaxResults(maxResults int64) *CustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *CustomchannelsListCall) PageToken(pageToken string) *CustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels in the specified ad client for this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.customchannels.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.customchannels.adunits.list": + +type CustomchannelsAdunitsListCall struct { + s *Service + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified custom channel. +func (r *CustomchannelsAdunitsService) List(adClientId string, customChannelId string) *CustomchannelsAdunitsListCall { + c := &CustomchannelsAdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *CustomchannelsAdunitsListCall) IncludeInactive(includeInactive bool) *CustomchannelsAdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *CustomchannelsAdunitsListCall) MaxResults(maxResults int64) *CustomchannelsAdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *CustomchannelsAdunitsListCall) PageToken(pageToken string) *CustomchannelsAdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CustomchannelsAdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified custom channel.", + // "httpMethod": "GET", + // "id": "adsense.customchannels.adunits.list", + // "parameterOrder": [ + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels/{customChannelId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.reports.generate": + +type ReportsGenerateCall struct { + s *Service + startDate string + endDate string + opt_ map[string]interface{} +} + +// Generate: Generate an AdSense 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. +func (r *ReportsService) Generate(startDate string, endDate string) *ReportsGenerateCall { + c := &ReportsGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.startDate = startDate + c.endDate = endDate + return c +} + +// AccountId sets the optional parameter "accountId": Accounts upon +// which to report. +func (c *ReportsGenerateCall) AccountId(accountId string) *ReportsGenerateCall { + c.opt_["accountId"] = accountId + return c +} + +// Currency sets the optional parameter "currency": Optional currency to +// use when reporting on monetary metrics. Defaults to the account's +// currency if not set. +func (c *ReportsGenerateCall) Currency(currency string) *ReportsGenerateCall { + c.opt_["currency"] = currency + return c +} + +// Dimension sets the optional parameter "dimension": Dimensions to base +// the report on. +func (c *ReportsGenerateCall) Dimension(dimension string) *ReportsGenerateCall { + c.opt_["dimension"] = dimension + return c +} + +// Filter sets the optional parameter "filter": Filters to be run on the +// report. +func (c *ReportsGenerateCall) Filter(filter string) *ReportsGenerateCall { + c.opt_["filter"] = filter + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *ReportsGenerateCall) Locale(locale string) *ReportsGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *ReportsGenerateCall) MaxResults(maxResults int64) *ReportsGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Metric sets the optional parameter "metric": Numeric columns to +// include in the report. +func (c *ReportsGenerateCall) Metric(metric string) *ReportsGenerateCall { + c.opt_["metric"] = metric + return c +} + +// Sort sets the optional parameter "sort": 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. +func (c *ReportsGenerateCall) Sort(sort string) *ReportsGenerateCall { + c.opt_["sort"] = sort + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *ReportsGenerateCall) StartIndex(startIndex int64) *ReportsGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *ReportsGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("endDate", fmt.Sprintf("%v", c.endDate)) + params.Set("startDate", fmt.Sprintf("%v", c.startDate)) + if v, ok := c.opt_["accountId"]; ok { + params.Set("accountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["currency"]; ok { + params.Set("currency", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dimension"]; ok { + params.Set("dimension", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["metric"]; ok { + params.Set("metric", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdsenseReportsGenerateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an AdSense 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.", + // "httpMethod": "GET", + // "id": "adsense.reports.generate", + // "parameterOrder": [ + // "startDate", + // "endDate" + // ], + // "parameters": { + // "accountId": { + // "description": "Accounts upon which to report.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "currency": { + // "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.", + // "location": "query", + // "pattern": "[a-zA-Z]+", + // "type": "string" + // }, + // "dimension": { + // "description": "Dimensions to base the report on.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "endDate": { + // "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)", + // "required": true, + // "type": "string" + // }, + // "filter": { + // "description": "Filters to be run on the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+(==|=@).+", + // "repeated": true, + // "type": "string" + // }, + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "metric": { + // "description": "Numeric columns to include in the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "sort": { + // "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.", + // "location": "query", + // "pattern": "(\\+|-)?[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "startDate": { + // "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "reports", + // "response": { + // "$ref": "AdsenseReportsGenerateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "adsense.reports.saved.generate": + +type ReportsSavedGenerateCall struct { + s *Service + savedReportId string + opt_ map[string]interface{} +} + +// Generate: Generate an AdSense report based on the saved report ID +// sent in the query parameters. +func (r *ReportsSavedService) Generate(savedReportId string) *ReportsSavedGenerateCall { + c := &ReportsSavedGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.savedReportId = savedReportId + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *ReportsSavedGenerateCall) Locale(locale string) *ReportsSavedGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *ReportsSavedGenerateCall) MaxResults(maxResults int64) *ReportsSavedGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *ReportsSavedGenerateCall) StartIndex(startIndex int64) *ReportsSavedGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *ReportsSavedGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{savedReportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{savedReportId}", url.QueryEscape(c.savedReportId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdsenseReportsGenerateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an AdSense report based on the saved report ID sent in the query parameters.", + // "httpMethod": "GET", + // "id": "adsense.reports.saved.generate", + // "parameterOrder": [ + // "savedReportId" + // ], + // "parameters": { + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "savedReportId": { + // "description": "The saved report to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "reports/{savedReportId}", + // "response": { + // "$ref": "AdsenseReportsGenerateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.reports.saved.list": + +type ReportsSavedListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all saved reports in this AdSense account. +func (r *ReportsSavedService) List() *ReportsSavedListCall { + c := &ReportsSavedListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of saved reports to include in the response, used for paging. +func (c *ReportsSavedListCall) MaxResults(maxResults int64) *ReportsSavedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *ReportsSavedListCall) PageToken(pageToken string) *ReportsSavedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ReportsSavedListCall) Do() (*SavedReports, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/saved") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedReports) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all saved reports in this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.reports.saved.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of saved reports to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "reports/saved", + // "response": { + // "$ref": "SavedReports" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.savedadstyles.get": + +type SavedadstylesGetCall struct { + s *Service + savedAdStyleId string + opt_ map[string]interface{} +} + +// Get: Get a specific saved ad style from the user's account. +func (r *SavedadstylesService) Get(savedAdStyleId string) *SavedadstylesGetCall { + c := &SavedadstylesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.savedAdStyleId = savedAdStyleId + return c +} + +func (c *SavedadstylesGetCall) Do() (*SavedAdStyle, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "savedadstyles/{savedAdStyleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{savedAdStyleId}", url.QueryEscape(c.savedAdStyleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedAdStyle) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a specific saved ad style from the user's account.", + // "httpMethod": "GET", + // "id": "adsense.savedadstyles.get", + // "parameterOrder": [ + // "savedAdStyleId" + // ], + // "parameters": { + // "savedAdStyleId": { + // "description": "Saved ad style to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "savedadstyles/{savedAdStyleId}", + // "response": { + // "$ref": "SavedAdStyle" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.savedadstyles.list": + +type SavedadstylesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all saved ad styles in the user's account. +func (r *SavedadstylesService) List() *SavedadstylesListCall { + c := &SavedadstylesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of saved ad styles to include in the response, used for +// paging. +func (c *SavedadstylesListCall) MaxResults(maxResults int64) *SavedadstylesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token, used to page through saved ad styles. To retrieve the next +// page, set this parameter to the value of "nextPageToken" from the +// previous response. +func (c *SavedadstylesListCall) PageToken(pageToken string) *SavedadstylesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *SavedadstylesListCall) Do() (*SavedAdStyles, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "savedadstyles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedAdStyles) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all saved ad styles in the user's account.", + // "httpMethod": "GET", + // "id": "adsense.savedadstyles.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of saved ad styles to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "savedadstyles", + // "response": { + // "$ref": "SavedAdStyles" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.urlchannels.list": + +type UrlchannelsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all URL channels in the specified ad client for this +// AdSense account. +func (r *UrlchannelsService) List(adClientId string) *UrlchannelsListCall { + c := &UrlchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of URL channels to include in the response, used for paging. +func (c *UrlchannelsListCall) MaxResults(maxResults int64) *UrlchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *UrlchannelsListCall) PageToken(pageToken string) *UrlchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *UrlchannelsListCall) Do() (*UrlChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UrlChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all URL channels in the specified ad client for this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.urlchannels.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list URL channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of URL channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/urlchannels", + // "response": { + // "$ref": "UrlChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.3/adsense-api.json b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.3/adsense-api.json new file mode 100644 index 0000000000000..f511e58e80395 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.3/adsense-api.json @@ -0,0 +1,2249 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/RY77fvEvdMvjXK9LvO9FVN68TJk\"", + "discoveryVersion": "v1", + "id": "adsense:v1.3", + "name": "adsense", + "canonicalName": "AdSense", + "version": "v1.3", + "title": "AdSense Management API", + "description": "Gives AdSense publishers access to their inventory and the ability to generate reports", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/adsense-16.png", + "x32": "http://www.google.com/images/icons/product/adsense-32.png" + }, + "documentationLink": "https://developers.google.com/adsense/management/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/adsense/v1.3/", + "basePath": "/adsense/v1.3/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "adsense/v1.3/", + "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/adsense": { + "description": "View and manage your AdSense data" + }, + "https://www.googleapis.com/auth/adsense.readonly": { + "description": "View your AdSense data" + } + } + } + }, + "schemas": { + "Account": { + "id": "Account", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of this account." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adsense#account.", + "default": "adsense#account" + }, + "name": { + "type": "string", + "description": "Name of this account." + }, + "premium": { + "type": "boolean", + "description": "Whether this account is premium." + }, + "subAccounts": { + "type": "array", + "description": "Sub accounts of the this account.", + "items": { + "$ref": "Account" + } + } + } + }, + "Accounts": { + "id": "Accounts", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The accounts returned in this list response.", + "items": { + "$ref": "Account" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adsense#accounts.", + "default": "adsense#accounts" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through accounts. To retrieve the next page of results, set the next request's \"pageToken\" value to this." + } + } + }, + "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 adsense#adClient.", + "default": "adsense#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 adsense#adClients.", + "default": "adsense#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." + } + } + }, + "AdCode": { + "id": "AdCode", + "type": "object", + "properties": { + "adCode": { + "type": "string", + "description": "The ad code snippet." + }, + "kind": { + "type": "string", + "description": "Kind this is, in this case adsense#adCode.", + "default": "adsense#adCode" + } + } + }, + "AdStyle": { + "id": "AdStyle", + "type": "object", + "properties": { + "colors": { + "type": "object", + "description": "The colors which are included in the style. These are represented as six hexadecimal characters, similar to HTML color codes, but without the leading hash.", + "properties": { + "background": { + "type": "string", + "description": "The color of the ad background." + }, + "border": { + "type": "string", + "description": "The color of the ad border." + }, + "text": { + "type": "string", + "description": "The color of the ad text." + }, + "title": { + "type": "string", + "description": "The color of the ad title." + }, + "url": { + "type": "string", + "description": "The color of the ad url." + } + } + }, + "corners": { + "type": "string", + "description": "The style of the corners in the ad." + }, + "font": { + "type": "object", + "description": "The font which is included in the style.", + "properties": { + "family": { + "type": "string", + "description": "The family of the font." + }, + "size": { + "type": "string", + "description": "The size of the font." + } + } + }, + "kind": { + "type": "string", + "description": "Kind this is, in this case adsense#adStyle.", + "default": "adsense#adStyle" + } + } + }, + "AdUnit": { + "id": "AdUnit", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Identity code of this ad unit, not necessarily unique across ad clients." + }, + "contentAdsSettings": { + "type": "object", + "description": "Settings specific to content ads (AFC) and highend mobile content ads (AFMC).", + "properties": { + "backupOption": { + "type": "object", + "description": "The backup option to be used in instances where no ad is available.", + "properties": { + "color": { + "type": "string", + "description": "Color to use when type is set to COLOR." + }, + "type": { + "type": "string", + "description": "Type of the backup option. Possible values are BLANK, COLOR and URL." + }, + "url": { + "type": "string", + "description": "URL to use when type is set to URL." + } + } + }, + "size": { + "type": "string", + "description": "Size of this ad unit." + }, + "type": { + "type": "string", + "description": "Type of this ad unit." + } + } + }, + "customStyle": { + "$ref": "AdStyle", + "description": "Custom style information specific to this ad unit." + }, + "feedAdsSettings": { + "type": "object", + "description": "Settings specific to feed ads (AFF).", + "properties": { + "adPosition": { + "type": "string", + "description": "The position of the ads relative to the feed entries." + }, + "frequency": { + "type": "integer", + "description": "The frequency at which ads should appear in the feed (i.e. every N entries).", + "format": "int32" + }, + "minimumWordCount": { + "type": "integer", + "description": "The minimum length an entry should be in order to have attached ads.", + "format": "int32" + }, + "type": { + "type": "string", + "description": "The type of ads which should appear." + } + } + }, + "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 adsense#adUnit.", + "default": "adsense#adUnit" + }, + "mobileContentAdsSettings": { + "type": "object", + "description": "Settings specific to WAP mobile content ads (AFMC).", + "properties": { + "markupLanguage": { + "type": "string", + "description": "The markup language to use for this ad unit." + }, + "scriptingLanguage": { + "type": "string", + "description": "The scripting language to use for this ad unit." + }, + "size": { + "type": "string", + "description": "Size of this ad unit." + }, + "type": { + "type": "string", + "description": "Type of this ad unit." + } + } + }, + "name": { + "type": "string", + "description": "Name of this ad unit." + }, + "savedStyleId": { + "type": "string", + "description": "ID of the saved ad style which holds this ad unit's style information." + }, + "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 adsense#adUnits.", + "default": "adsense#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." + } + } + }, + "AdsenseReportsGenerateResponse": { + "id": "AdsenseReportsGenerateResponse", + "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 adsense#report.", + "default": "adsense#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" + } + } + } + }, + "Alert": { + "id": "Alert", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of this alert. 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 adsense#alert.", + "default": "adsense#alert" + }, + "message": { + "type": "string", + "description": "The localized alert message." + }, + "severity": { + "type": "string", + "description": "Severity of this alert. Possible values: INFO, WARNING, SEVERE." + }, + "type": { + "type": "string", + "description": "Type of this alert. Possible values: SELF_HOLD, MIGRATED_TO_BILLING3, ADDRESS_PIN_VERIFICATION, PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, GRAYLISTED_PUBLISHER, API_HOLD." + } + } + }, + "Alerts": { + "id": "Alerts", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The alerts returned in this list response.", + "items": { + "$ref": "Alert" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adsense#alerts.", + "default": "adsense#alerts" + } + } + }, + "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 adsense#customChannel.", + "default": "adsense#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 adsense#customChannels.", + "default": "adsense#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." + } + } + }, + "Metadata": { + "id": "Metadata", + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "ReportingMetadataEntry" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adsense#metadata.", + "default": "adsense#metadata" + } + } + }, + "ReportingMetadataEntry": { + "id": "ReportingMetadataEntry", + "type": "object", + "properties": { + "compatibleDimensions": { + "type": "array", + "description": "For metrics this is a list of dimension IDs which the metric is compatible with, for dimensions it is a list of compatibility groups the dimension belongs to.", + "items": { + "type": "string" + } + }, + "compatibleMetrics": { + "type": "array", + "description": "The names of the metrics the dimension or metric this reporting metadata entry describes is compatible with.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "Unique identifier of this reporting metadata entry, corresponding to the name of the appropriate dimension or metric." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adsense#reportingMetadataEntry.", + "default": "adsense#reportingMetadataEntry" + }, + "requiredDimensions": { + "type": "array", + "description": "The names of the dimensions which the dimension or metric this reporting metadata entry describes requires to also be present in order for the report to be valid. Omitting these will not cause an error or warning, but may result in data which cannot be correctly interpreted.", + "items": { + "type": "string" + } + }, + "requiredMetrics": { + "type": "array", + "description": "The names of the metrics which the dimension or metric this reporting metadata entry describes requires to also be present in order for the report to be valid. Omitting these will not cause an error or warning, but may result in data which cannot be correctly interpreted.", + "items": { + "type": "string" + } + }, + "supportedProducts": { + "type": "array", + "description": "The codes of the projects supported by the dimension or metric this reporting metadata entry describes.", + "items": { + "type": "string" + } + } + } + }, + "SavedAdStyle": { + "id": "SavedAdStyle", + "type": "object", + "properties": { + "adStyle": { + "$ref": "AdStyle", + "description": "The AdStyle itself." + }, + "id": { + "type": "string", + "description": "Unique identifier of this saved ad style. 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 adsense#savedAdStyle.", + "default": "adsense#savedAdStyle" + }, + "name": { + "type": "string", + "description": "The user selected name of this SavedAdStyle." + } + } + }, + "SavedAdStyles": { + "id": "SavedAdStyles", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The saved ad styles returned in this list response.", + "items": { + "$ref": "SavedAdStyle" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adsense#savedAdStyles.", + "default": "adsense#savedAdStyles" + }, + "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." + } + } + }, + "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 adsense#savedReport.", + "default": "adsense#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 adsense#savedReports.", + "default": "adsense#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 adsense#urlChannel.", + "default": "adsense#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 adsense#urlChannels.", + "default": "adsense#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": { + "accounts": { + "methods": { + "get": { + "id": "adsense.accounts.get", + "path": "accounts/{accountId}", + "httpMethod": "GET", + "description": "Get information about the selected AdSense account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to get information about.", + "required": true, + "location": "path" + }, + "tree": { + "type": "boolean", + "description": "Whether the tree of sub accounts should be returned.", + "location": "query" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.accounts.list", + "path": "accounts", + "httpMethod": "GET", + "description": "List all accounts available to this AdSense account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of accounts to include in the response, used for paging.", + "format": "int32", + "minimum": "0", + "maximum": "10000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "response": { + "$ref": "Accounts" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "adclients": { + "methods": { + "list": { + "id": "adsense.accounts.adclients.list", + "path": "accounts/{accountId}/adclients", + "httpMethod": "GET", + "description": "List all ad clients in the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account for which to list ad clients.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of ad clients to include in the response, used for paging.", + "format": "int32", + "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" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "AdClients" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "adunits": { + "methods": { + "get": { + "id": "adsense.accounts.adunits.get", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}", + "httpMethod": "GET", + "description": "Gets the specified ad unit in the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": [ + "accountId", + "adClientId", + "adUnitId" + ], + "response": { + "$ref": "AdUnit" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "getAdCode": { + "id": "adsense.accounts.adunits.getAdCode", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode", + "httpMethod": "GET", + "description": "Get ad code for the specified ad unit.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account which contains the ad client.", + "required": true, + "location": "path" + }, + "adClientId": { + "type": "string", + "description": "Ad client with contains the ad unit.", + "required": true, + "location": "path" + }, + "adUnitId": { + "type": "string", + "description": "Ad unit to get the code for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "adClientId", + "adUnitId" + ], + "response": { + "$ref": "AdCode" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.accounts.adunits.list", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits", + "httpMethod": "GET", + "description": "List all ad units in the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId" + ], + "response": { + "$ref": "AdUnits" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "customchannels": { + "methods": { + "list": { + "id": "adsense.accounts.adunits.customchannels.list", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels", + "httpMethod": "GET", + "description": "List all custom channels which the specified ad unit belongs to.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId", + "adUnitId" + ], + "response": { + "$ref": "CustomChannels" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "alerts": { + "methods": { + "list": { + "id": "adsense.accounts.alerts.list", + "path": "accounts/{accountId}/alerts", + "httpMethod": "GET", + "description": "List the alerts for the specified AdSense account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account for which to retrieve the alerts.", + "required": true, + "location": "path" + }, + "locale": { + "type": "string", + "description": "The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported.", + "location": "query" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "Alerts" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "customchannels": { + "methods": { + "get": { + "id": "adsense.accounts.customchannels.get", + "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}", + "httpMethod": "GET", + "description": "Get the specified custom channel from the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": [ + "accountId", + "adClientId", + "customChannelId" + ], + "response": { + "$ref": "CustomChannel" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.accounts.customchannels.list", + "path": "accounts/{accountId}/adclients/{adClientId}/customchannels", + "httpMethod": "GET", + "description": "List all custom channels in the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId" + ], + "response": { + "$ref": "CustomChannels" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "adunits": { + "methods": { + "list": { + "id": "adsense.accounts.customchannels.adunits.list", + "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits", + "httpMethod": "GET", + "description": "List all ad units in the specified custom channel.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId", + "customChannelId" + ], + "response": { + "$ref": "AdUnits" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "reports": { + "methods": { + "generate": { + "id": "adsense.accounts.reports.generate", + "path": "accounts/{accountId}/reports", + "httpMethod": "GET", + "description": "Generate an AdSense 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": { + "accountId": { + "type": "string", + "description": "Account upon which to report.", + "required": true, + "location": "path" + }, + "currency": { + "type": "string", + "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.", + "pattern": "[a-zA-Z]+", + "location": "query" + }, + "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": "int32", + "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": "int32", + "minimum": "0", + "maximum": "5000", + "location": "query" + }, + "useTimezoneReporting": { + "type": "boolean", + "description": "Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used.", + "location": "query" + } + }, + "parameterOrder": [ + "accountId", + "startDate", + "endDate" + ], + "response": { + "$ref": "AdsenseReportsGenerateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ], + "supportsMediaDownload": true + } + }, + "resources": { + "saved": { + "methods": { + "generate": { + "id": "adsense.accounts.reports.saved.generate", + "path": "accounts/{accountId}/reports/{savedReportId}", + "httpMethod": "GET", + "description": "Generate an AdSense report based on the saved report ID sent in the query parameters.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the saved reports belong.", + "required": true, + "location": "path" + }, + "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": [ + "accountId", + "savedReportId" + ], + "response": { + "$ref": "AdsenseReportsGenerateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.accounts.reports.saved.list", + "path": "accounts/{accountId}/reports/saved", + "httpMethod": "GET", + "description": "List all saved reports in the specified AdSense account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the saved reports belong.", + "required": true, + "location": "path" + }, + "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" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "SavedReports" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "savedadstyles": { + "methods": { + "get": { + "id": "adsense.accounts.savedadstyles.get", + "path": "accounts/{accountId}/savedadstyles/{savedAdStyleId}", + "httpMethod": "GET", + "description": "List a specific saved ad style for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account for which to get the saved ad style.", + "required": true, + "location": "path" + }, + "savedAdStyleId": { + "type": "string", + "description": "Saved ad style to retrieve.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "savedAdStyleId" + ], + "response": { + "$ref": "SavedAdStyle" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.accounts.savedadstyles.list", + "path": "accounts/{accountId}/savedadstyles", + "httpMethod": "GET", + "description": "List all saved ad styles in the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account for which to list saved ad styles.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of saved ad styles to include in the response, used for paging.", + "format": "int32", + "minimum": "0", + "maximum": "10000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "SavedAdStyles" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "urlchannels": { + "methods": { + "list": { + "id": "adsense.accounts.urlchannels.list", + "path": "accounts/{accountId}/adclients/{adClientId}/urlchannels", + "httpMethod": "GET", + "description": "List all URL channels in the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId" + ], + "response": { + "$ref": "UrlChannels" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "adclients": { + "methods": { + "list": { + "id": "adsense.adclients.list", + "path": "adclients", + "httpMethod": "GET", + "description": "List all ad clients in this AdSense account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of ad clients to include in the response, used for paging.", + "format": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "adunits": { + "methods": { + "get": { + "id": "adsense.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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "getAdCode": { + "id": "adsense.adunits.getAdCode", + "path": "adclients/{adClientId}/adunits/{adUnitId}/adcode", + "httpMethod": "GET", + "description": "Get ad code for the specified ad unit.", + "parameters": { + "adClientId": { + "type": "string", + "description": "Ad client with contains the ad unit.", + "required": true, + "location": "path" + }, + "adUnitId": { + "type": "string", + "description": "Ad unit to get the code for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "adClientId", + "adUnitId" + ], + "response": { + "$ref": "AdCode" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.adunits.list", + "path": "adclients/{adClientId}/adunits", + "httpMethod": "GET", + "description": "List all ad units in the specified ad client for this AdSense 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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "customchannels": { + "methods": { + "list": { + "id": "adsense.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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "alerts": { + "methods": { + "list": { + "id": "adsense.alerts.list", + "path": "alerts", + "httpMethod": "GET", + "description": "List the alerts for this AdSense account.", + "parameters": { + "locale": { + "type": "string", + "description": "The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported.", + "location": "query" + } + }, + "response": { + "$ref": "Alerts" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "customchannels": { + "methods": { + "get": { + "id": "adsense.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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.customchannels.list", + "path": "adclients/{adClientId}/customchannels", + "httpMethod": "GET", + "description": "List all custom channels in the specified ad client for this AdSense 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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "adunits": { + "methods": { + "list": { + "id": "adsense.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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "metadata": { + "resources": { + "dimensions": { + "methods": { + "list": { + "id": "adsense.metadata.dimensions.list", + "path": "metadata/dimensions", + "httpMethod": "GET", + "description": "List the metadata for the dimensions available to this AdSense account.", + "response": { + "$ref": "Metadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "metrics": { + "methods": { + "list": { + "id": "adsense.metadata.metrics.list", + "path": "metadata/metrics", + "httpMethod": "GET", + "description": "List the metadata for the metrics available to this AdSense account.", + "response": { + "$ref": "Metadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "reports": { + "methods": { + "generate": { + "id": "adsense.reports.generate", + "path": "reports", + "httpMethod": "GET", + "description": "Generate an AdSense 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": { + "accountId": { + "type": "string", + "description": "Accounts upon which to report.", + "repeated": true, + "location": "query" + }, + "currency": { + "type": "string", + "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.", + "pattern": "[a-zA-Z]+", + "location": "query" + }, + "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": "int32", + "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": "int32", + "minimum": "0", + "maximum": "5000", + "location": "query" + }, + "useTimezoneReporting": { + "type": "boolean", + "description": "Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used.", + "location": "query" + } + }, + "parameterOrder": [ + "startDate", + "endDate" + ], + "response": { + "$ref": "AdsenseReportsGenerateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ], + "supportsMediaDownload": true + } + }, + "resources": { + "saved": { + "methods": { + "generate": { + "id": "adsense.reports.saved.generate", + "path": "reports/{savedReportId}", + "httpMethod": "GET", + "description": "Generate an AdSense 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": "AdsenseReportsGenerateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.reports.saved.list", + "path": "reports/saved", + "httpMethod": "GET", + "description": "List all saved reports in this AdSense 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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "savedadstyles": { + "methods": { + "get": { + "id": "adsense.savedadstyles.get", + "path": "savedadstyles/{savedAdStyleId}", + "httpMethod": "GET", + "description": "Get a specific saved ad style from the user's account.", + "parameters": { + "savedAdStyleId": { + "type": "string", + "description": "Saved ad style to retrieve.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "savedAdStyleId" + ], + "response": { + "$ref": "SavedAdStyle" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.savedadstyles.list", + "path": "savedadstyles", + "httpMethod": "GET", + "description": "List all saved ad styles in the user's account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of saved ad styles to include in the response, used for paging.", + "format": "int32", + "minimum": "0", + "maximum": "10000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "response": { + "$ref": "SavedAdStyles" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "urlchannels": { + "methods": { + "list": { + "id": "adsense.urlchannels.list", + "path": "adclients/{adClientId}/urlchannels", + "httpMethod": "GET", + "description": "List all URL channels in the specified ad client for this AdSense 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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.3/adsense-gen.go b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.3/adsense-gen.go new file mode 100644 index 0000000000000..047434569818a --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.3/adsense-gen.go @@ -0,0 +1,4373 @@ +// Package adsense provides access to the AdSense Management API. +// +// See https://developers.google.com/adsense/management/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/adsense/v1.3" +// ... +// adsenseService, err := adsense.New(oauthHttpClient) +package adsense + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "adsense:v1.3" +const apiName = "adsense" +const apiVersion = "v1.3" +const basePath = "https://www.googleapis.com/adsense/v1.3/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your AdSense data + AdsenseScope = "https://www.googleapis.com/auth/adsense" + + // View your AdSense data + AdsenseReadonlyScope = "https://www.googleapis.com/auth/adsense.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.Accounts = NewAccountsService(s) + s.Adclients = NewAdclientsService(s) + s.Adunits = NewAdunitsService(s) + s.Alerts = NewAlertsService(s) + s.Customchannels = NewCustomchannelsService(s) + s.Metadata = NewMetadataService(s) + s.Reports = NewReportsService(s) + s.Savedadstyles = NewSavedadstylesService(s) + s.Urlchannels = NewUrlchannelsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Accounts *AccountsService + + Adclients *AdclientsService + + Adunits *AdunitsService + + Alerts *AlertsService + + Customchannels *CustomchannelsService + + Metadata *MetadataService + + Reports *ReportsService + + Savedadstyles *SavedadstylesService + + Urlchannels *UrlchannelsService +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + rs.Adclients = NewAccountsAdclientsService(s) + rs.Adunits = NewAccountsAdunitsService(s) + rs.Alerts = NewAccountsAlertsService(s) + rs.Customchannels = NewAccountsCustomchannelsService(s) + rs.Reports = NewAccountsReportsService(s) + rs.Savedadstyles = NewAccountsSavedadstylesService(s) + rs.Urlchannels = NewAccountsUrlchannelsService(s) + return rs +} + +type AccountsService struct { + s *Service + + Adclients *AccountsAdclientsService + + Adunits *AccountsAdunitsService + + Alerts *AccountsAlertsService + + Customchannels *AccountsCustomchannelsService + + Reports *AccountsReportsService + + Savedadstyles *AccountsSavedadstylesService + + Urlchannels *AccountsUrlchannelsService +} + +func NewAccountsAdclientsService(s *Service) *AccountsAdclientsService { + rs := &AccountsAdclientsService{s: s} + return rs +} + +type AccountsAdclientsService struct { + s *Service +} + +func NewAccountsAdunitsService(s *Service) *AccountsAdunitsService { + rs := &AccountsAdunitsService{s: s} + rs.Customchannels = NewAccountsAdunitsCustomchannelsService(s) + return rs +} + +type AccountsAdunitsService struct { + s *Service + + Customchannels *AccountsAdunitsCustomchannelsService +} + +func NewAccountsAdunitsCustomchannelsService(s *Service) *AccountsAdunitsCustomchannelsService { + rs := &AccountsAdunitsCustomchannelsService{s: s} + return rs +} + +type AccountsAdunitsCustomchannelsService struct { + s *Service +} + +func NewAccountsAlertsService(s *Service) *AccountsAlertsService { + rs := &AccountsAlertsService{s: s} + return rs +} + +type AccountsAlertsService struct { + s *Service +} + +func NewAccountsCustomchannelsService(s *Service) *AccountsCustomchannelsService { + rs := &AccountsCustomchannelsService{s: s} + rs.Adunits = NewAccountsCustomchannelsAdunitsService(s) + return rs +} + +type AccountsCustomchannelsService struct { + s *Service + + Adunits *AccountsCustomchannelsAdunitsService +} + +func NewAccountsCustomchannelsAdunitsService(s *Service) *AccountsCustomchannelsAdunitsService { + rs := &AccountsCustomchannelsAdunitsService{s: s} + return rs +} + +type AccountsCustomchannelsAdunitsService struct { + s *Service +} + +func NewAccountsReportsService(s *Service) *AccountsReportsService { + rs := &AccountsReportsService{s: s} + rs.Saved = NewAccountsReportsSavedService(s) + return rs +} + +type AccountsReportsService struct { + s *Service + + Saved *AccountsReportsSavedService +} + +func NewAccountsReportsSavedService(s *Service) *AccountsReportsSavedService { + rs := &AccountsReportsSavedService{s: s} + return rs +} + +type AccountsReportsSavedService struct { + s *Service +} + +func NewAccountsSavedadstylesService(s *Service) *AccountsSavedadstylesService { + rs := &AccountsSavedadstylesService{s: s} + return rs +} + +type AccountsSavedadstylesService struct { + s *Service +} + +func NewAccountsUrlchannelsService(s *Service) *AccountsUrlchannelsService { + rs := &AccountsUrlchannelsService{s: s} + return rs +} + +type AccountsUrlchannelsService struct { + s *Service +} + +func NewAdclientsService(s *Service) *AdclientsService { + rs := &AdclientsService{s: s} + return rs +} + +type AdclientsService struct { + s *Service +} + +func NewAdunitsService(s *Service) *AdunitsService { + rs := &AdunitsService{s: s} + rs.Customchannels = NewAdunitsCustomchannelsService(s) + return rs +} + +type AdunitsService struct { + s *Service + + Customchannels *AdunitsCustomchannelsService +} + +func NewAdunitsCustomchannelsService(s *Service) *AdunitsCustomchannelsService { + rs := &AdunitsCustomchannelsService{s: s} + return rs +} + +type AdunitsCustomchannelsService struct { + s *Service +} + +func NewAlertsService(s *Service) *AlertsService { + rs := &AlertsService{s: s} + return rs +} + +type AlertsService struct { + s *Service +} + +func NewCustomchannelsService(s *Service) *CustomchannelsService { + rs := &CustomchannelsService{s: s} + rs.Adunits = NewCustomchannelsAdunitsService(s) + return rs +} + +type CustomchannelsService struct { + s *Service + + Adunits *CustomchannelsAdunitsService +} + +func NewCustomchannelsAdunitsService(s *Service) *CustomchannelsAdunitsService { + rs := &CustomchannelsAdunitsService{s: s} + return rs +} + +type CustomchannelsAdunitsService struct { + s *Service +} + +func NewMetadataService(s *Service) *MetadataService { + rs := &MetadataService{s: s} + rs.Dimensions = NewMetadataDimensionsService(s) + rs.Metrics = NewMetadataMetricsService(s) + return rs +} + +type MetadataService struct { + s *Service + + Dimensions *MetadataDimensionsService + + Metrics *MetadataMetricsService +} + +func NewMetadataDimensionsService(s *Service) *MetadataDimensionsService { + rs := &MetadataDimensionsService{s: s} + return rs +} + +type MetadataDimensionsService struct { + s *Service +} + +func NewMetadataMetricsService(s *Service) *MetadataMetricsService { + rs := &MetadataMetricsService{s: s} + return rs +} + +type MetadataMetricsService struct { + s *Service +} + +func NewReportsService(s *Service) *ReportsService { + rs := &ReportsService{s: s} + rs.Saved = NewReportsSavedService(s) + return rs +} + +type ReportsService struct { + s *Service + + Saved *ReportsSavedService +} + +func NewReportsSavedService(s *Service) *ReportsSavedService { + rs := &ReportsSavedService{s: s} + return rs +} + +type ReportsSavedService struct { + s *Service +} + +func NewSavedadstylesService(s *Service) *SavedadstylesService { + rs := &SavedadstylesService{s: s} + return rs +} + +type SavedadstylesService struct { + s *Service +} + +func NewUrlchannelsService(s *Service) *UrlchannelsService { + rs := &UrlchannelsService{s: s} + return rs +} + +type UrlchannelsService struct { + s *Service +} + +type Account struct { + // Id: Unique identifier of this account. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#account. + Kind string `json:"kind,omitempty"` + + // Name: Name of this account. + Name string `json:"name,omitempty"` + + // Premium: Whether this account is premium. + Premium bool `json:"premium,omitempty"` + + // SubAccounts: Sub accounts of the this account. + SubAccounts []*Account `json:"subAccounts,omitempty"` +} + +type Accounts struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The accounts returned in this list response. + Items []*Account `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#accounts. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through accounts. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AdClient struct { + // ArcOptIn: Whether this ad client is opted in to ARC. + ArcOptIn bool `json:"arcOptIn,omitempty"` + + // Id: Unique identifier of this ad client. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#adClient. + Kind string `json:"kind,omitempty"` + + // ProductCode: This ad client's product code, which corresponds to the + // PRODUCT_CODE report dimension. + ProductCode string `json:"productCode,omitempty"` + + // SupportsReporting: Whether this ad client supports being reported on. + SupportsReporting bool `json:"supportsReporting,omitempty"` +} + +type AdClients struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The ad clients returned in this list response. + Items []*AdClient `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#adClients. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad clients. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AdCode struct { + // AdCode: The ad code snippet. + AdCode string `json:"adCode,omitempty"` + + // Kind: Kind this is, in this case adsense#adCode. + Kind string `json:"kind,omitempty"` +} + +type AdStyle struct { + // Colors: The colors which are included in the style. These are + // represented as six hexadecimal characters, similar to HTML color + // codes, but without the leading hash. + Colors *AdStyleColors `json:"colors,omitempty"` + + // Corners: The style of the corners in the ad. + Corners string `json:"corners,omitempty"` + + // Font: The font which is included in the style. + Font *AdStyleFont `json:"font,omitempty"` + + // Kind: Kind this is, in this case adsense#adStyle. + Kind string `json:"kind,omitempty"` +} + +type AdStyleColors struct { + // Background: The color of the ad background. + Background string `json:"background,omitempty"` + + // Border: The color of the ad border. + Border string `json:"border,omitempty"` + + // Text: The color of the ad text. + Text string `json:"text,omitempty"` + + // Title: The color of the ad title. + Title string `json:"title,omitempty"` + + // Url: The color of the ad url. + Url string `json:"url,omitempty"` +} + +type AdStyleFont struct { + // Family: The family of the font. + Family string `json:"family,omitempty"` + + // Size: The size of the font. + Size string `json:"size,omitempty"` +} + +type AdUnit struct { + // Code: Identity code of this ad unit, not necessarily unique across ad + // clients. + Code string `json:"code,omitempty"` + + // ContentAdsSettings: Settings specific to content ads (AFC) and + // highend mobile content ads (AFMC). + ContentAdsSettings *AdUnitContentAdsSettings `json:"contentAdsSettings,omitempty"` + + // CustomStyle: Custom style information specific to this ad unit. + CustomStyle *AdStyle `json:"customStyle,omitempty"` + + // FeedAdsSettings: Settings specific to feed ads (AFF). + FeedAdsSettings *AdUnitFeedAdsSettings `json:"feedAdsSettings,omitempty"` + + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#adUnit. + Kind string `json:"kind,omitempty"` + + // MobileContentAdsSettings: Settings specific to WAP mobile content ads + // (AFMC). + MobileContentAdsSettings *AdUnitMobileContentAdsSettings `json:"mobileContentAdsSettings,omitempty"` + + // Name: Name of this ad unit. + Name string `json:"name,omitempty"` + + // SavedStyleId: ID of the saved ad style which holds this ad unit's + // style information. + SavedStyleId string `json:"savedStyleId,omitempty"` + + // Status: Status of this ad unit. Possible values are: + // NEW: Indicates + // that the ad unit was created within the last seven days and does not + // yet have any activity associated with it. + // + // ACTIVE: Indicates that + // there has been activity on this ad unit in the last seven + // days. + // + // INACTIVE: Indicates that there has been no activity on this ad + // unit in the last seven days. + Status string `json:"status,omitempty"` +} + +type AdUnitContentAdsSettings struct { + // BackupOption: The backup option to be used in instances where no ad + // is available. + BackupOption *AdUnitContentAdsSettingsBackupOption `json:"backupOption,omitempty"` + + // Size: Size of this ad unit. + Size string `json:"size,omitempty"` + + // Type: Type of this ad unit. + Type string `json:"type,omitempty"` +} + +type AdUnitContentAdsSettingsBackupOption struct { + // Color: Color to use when type is set to COLOR. + Color string `json:"color,omitempty"` + + // Type: Type of the backup option. Possible values are BLANK, COLOR and + // URL. + Type string `json:"type,omitempty"` + + // Url: URL to use when type is set to URL. + Url string `json:"url,omitempty"` +} + +type AdUnitFeedAdsSettings struct { + // AdPosition: The position of the ads relative to the feed entries. + AdPosition string `json:"adPosition,omitempty"` + + // Frequency: The frequency at which ads should appear in the feed (i.e. + // every N entries). + Frequency int64 `json:"frequency,omitempty"` + + // MinimumWordCount: The minimum length an entry should be in order to + // have attached ads. + MinimumWordCount int64 `json:"minimumWordCount,omitempty"` + + // Type: The type of ads which should appear. + Type string `json:"type,omitempty"` +} + +type AdUnitMobileContentAdsSettings struct { + // MarkupLanguage: The markup language to use for this ad unit. + MarkupLanguage string `json:"markupLanguage,omitempty"` + + // ScriptingLanguage: The scripting language to use for this ad unit. + ScriptingLanguage string `json:"scriptingLanguage,omitempty"` + + // Size: Size of this ad unit. + Size string `json:"size,omitempty"` + + // Type: Type of this ad unit. + Type string `json:"type,omitempty"` +} + +type AdUnits struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The ad units returned in this list response. + Items []*AdUnit `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#adUnits. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad units. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AdsenseReportsGenerateResponse struct { + // Averages: The averages of the report. This is the same length as any + // other row in the report; cells corresponding to dimension columns are + // empty. + Averages []string `json:"averages,omitempty"` + + // Headers: 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. + Headers []*AdsenseReportsGenerateResponseHeaders `json:"headers,omitempty"` + + // Kind: Kind this is, in this case adsense#report. + Kind string `json:"kind,omitempty"` + + // Rows: 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. + Rows [][]string `json:"rows,omitempty"` + + // TotalMatchedRows: 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. + TotalMatchedRows int64 `json:"totalMatchedRows,omitempty,string"` + + // Totals: The totals of the report. This is the same length as any + // other row in the report; cells corresponding to dimension columns are + // empty. + Totals []string `json:"totals,omitempty"` + + // Warnings: Any warnings associated with generation of the report. + Warnings []string `json:"warnings,omitempty"` +} + +type AdsenseReportsGenerateResponseHeaders struct { + // Currency: The currency of this column. Only present if the header + // type is METRIC_CURRENCY. + Currency string `json:"currency,omitempty"` + + // Name: The name of the header. + Name string `json:"name,omitempty"` + + // Type: The type of the header; one of DIMENSION, METRIC_TALLY, + // METRIC_RATIO, or METRIC_CURRENCY. + Type string `json:"type,omitempty"` +} + +type Alert struct { + // Id: Unique identifier of this alert. This should be considered an + // opaque identifier; it is not safe to rely on it being in any + // particular format. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#alert. + Kind string `json:"kind,omitempty"` + + // Message: The localized alert message. + Message string `json:"message,omitempty"` + + // Severity: Severity of this alert. Possible values: INFO, WARNING, + // SEVERE. + Severity string `json:"severity,omitempty"` + + // Type: Type of this alert. Possible values: SELF_HOLD, + // MIGRATED_TO_BILLING3, ADDRESS_PIN_VERIFICATION, + // PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, GRAYLISTED_PUBLISHER, + // API_HOLD. + Type string `json:"type,omitempty"` +} + +type Alerts struct { + // Items: The alerts returned in this list response. + Items []*Alert `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#alerts. + Kind string `json:"kind,omitempty"` +} + +type CustomChannel struct { + // Code: Code of this custom channel, not necessarily unique across ad + // clients. + Code string `json:"code,omitempty"` + + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#customChannel. + Kind string `json:"kind,omitempty"` + + // Name: Name of this custom channel. + Name string `json:"name,omitempty"` + + // TargetingInfo: The targeting information of this custom channel, if + // activated. + TargetingInfo *CustomChannelTargetingInfo `json:"targetingInfo,omitempty"` +} + +type CustomChannelTargetingInfo struct { + // AdsAppearOn: The name used to describe this channel externally. + AdsAppearOn string `json:"adsAppearOn,omitempty"` + + // Description: The external description of the channel. + Description string `json:"description,omitempty"` + + // Location: 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. + Location string `json:"location,omitempty"` + + // SiteLanguage: The language of the sites ads will be displayed on. + SiteLanguage string `json:"siteLanguage,omitempty"` +} + +type CustomChannels struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The custom channels returned in this list response. + Items []*CustomChannel `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#customChannels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through custom + // channels. To retrieve the next page of results, set the next + // request's "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Metadata struct { + Items []*ReportingMetadataEntry `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#metadata. + Kind string `json:"kind,omitempty"` +} + +type ReportingMetadataEntry struct { + // CompatibleDimensions: For metrics this is a list of dimension IDs + // which the metric is compatible with, for dimensions it is a list of + // compatibility groups the dimension belongs to. + CompatibleDimensions []string `json:"compatibleDimensions,omitempty"` + + // CompatibleMetrics: The names of the metrics the dimension or metric + // this reporting metadata entry describes is compatible with. + CompatibleMetrics []string `json:"compatibleMetrics,omitempty"` + + // Id: Unique identifier of this reporting metadata entry, corresponding + // to the name of the appropriate dimension or metric. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case + // adsense#reportingMetadataEntry. + Kind string `json:"kind,omitempty"` + + // RequiredDimensions: The names of the dimensions which the dimension + // or metric this reporting metadata entry describes requires to also be + // present in order for the report to be valid. Omitting these will not + // cause an error or warning, but may result in data which cannot be + // correctly interpreted. + RequiredDimensions []string `json:"requiredDimensions,omitempty"` + + // RequiredMetrics: The names of the metrics which the dimension or + // metric this reporting metadata entry describes requires to also be + // present in order for the report to be valid. Omitting these will not + // cause an error or warning, but may result in data which cannot be + // correctly interpreted. + RequiredMetrics []string `json:"requiredMetrics,omitempty"` + + // SupportedProducts: The codes of the projects supported by the + // dimension or metric this reporting metadata entry describes. + SupportedProducts []string `json:"supportedProducts,omitempty"` +} + +type SavedAdStyle struct { + // AdStyle: The AdStyle itself. + AdStyle *AdStyle `json:"adStyle,omitempty"` + + // Id: Unique identifier of this saved ad style. This should be + // considered an opaque identifier; it is not safe to rely on it being + // in any particular format. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#savedAdStyle. + Kind string `json:"kind,omitempty"` + + // Name: The user selected name of this SavedAdStyle. + Name string `json:"name,omitempty"` +} + +type SavedAdStyles struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The saved ad styles returned in this list response. + Items []*SavedAdStyle `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#savedAdStyles. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad units. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type SavedReport struct { + // Id: Unique identifier of this saved report. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#savedReport. + Kind string `json:"kind,omitempty"` + + // Name: This saved report's name. + Name string `json:"name,omitempty"` +} + +type SavedReports struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The saved reports returned in this list response. + Items []*SavedReport `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#savedReports. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through saved reports. + // To retrieve the next page of results, set the next request's + // "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type UrlChannel struct { + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#urlChannel. + Kind string `json:"kind,omitempty"` + + // UrlPattern: URL Pattern of this URL channel. Does not include + // "http://" or "https://". Example: www.example.com/home + UrlPattern string `json:"urlPattern,omitempty"` +} + +type UrlChannels struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The URL channels returned in this list response. + Items []*UrlChannel `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#urlChannels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through URL channels. + // To retrieve the next page of results, set the next request's + // "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +// method id "adsense.accounts.get": + +type AccountsGetCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// Get: Get information about the selected AdSense account. +func (r *AccountsService) Get(accountId string) *AccountsGetCall { + c := &AccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// Tree sets the optional parameter "tree": Whether the tree of sub +// accounts should be returned. +func (c *AccountsGetCall) Tree(tree bool) *AccountsGetCall { + c.opt_["tree"] = tree + return c +} + +func (c *AccountsGetCall) Do() (*Account, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["tree"]; ok { + params.Set("tree", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get information about the selected AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.get", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to get information about.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tree": { + // "description": "Whether the tree of sub accounts should be returned.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "accounts/{accountId}", + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.list": + +type AccountsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all accounts available to this AdSense account. +func (r *AccountsService) List() *AccountsListCall { + c := &AccountsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of accounts to include in the response, used for paging. +func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token, used to page through accounts. To retrieve the next page, set +// this parameter to the value of "nextPageToken" from the previous +// response. +func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsListCall) Do() (*Accounts, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Accounts) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all accounts available to this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of accounts to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "accounts", + // "response": { + // "$ref": "Accounts" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.adclients.list": + +type AccountsAdclientsListCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// List: List all ad clients in the specified account. +func (r *AccountsAdclientsService) List(accountId string) *AccountsAdclientsListCall { + c := &AccountsAdclientsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad clients to include in the response, used for paging. +func (c *AccountsAdclientsListCall) MaxResults(maxResults int64) *AccountsAdclientsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsAdclientsListCall) PageToken(pageToken string) *AccountsAdclientsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsAdclientsListCall) Do() (*AdClients, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdClients) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad clients in the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.adclients.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account for which to list ad clients.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of ad clients to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients", + // "response": { + // "$ref": "AdClients" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.adunits.get": + +type AccountsAdunitsGetCall struct { + s *Service + accountId string + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// Get: Gets the specified ad unit in the specified ad client for the +// specified account. +func (r *AccountsAdunitsService) Get(accountId string, adClientId string, adUnitId string) *AccountsAdunitsGetCall { + c := &AccountsAdunitsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +func (c *AccountsAdunitsGetCall) Do() (*AdUnit, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified ad unit in the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.adunits.get", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to get the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}", + // "response": { + // "$ref": "AdUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.adunits.getAdCode": + +type AccountsAdunitsGetAdCodeCall struct { + s *Service + accountId string + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// GetAdCode: Get ad code for the specified ad unit. +func (r *AccountsAdunitsService) GetAdCode(accountId string, adClientId string, adUnitId string) *AccountsAdunitsGetAdCodeCall { + c := &AccountsAdunitsGetAdCodeCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +func (c *AccountsAdunitsGetAdCodeCall) Do() (*AdCode, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdCode) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get ad code for the specified ad unit.", + // "httpMethod": "GET", + // "id": "adsense.accounts.adunits.getAdCode", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account which contains the ad client.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client with contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit to get the code for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode", + // "response": { + // "$ref": "AdCode" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.adunits.list": + +type AccountsAdunitsListCall struct { + s *Service + accountId string + adClientId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified ad client for the specified +// account. +func (r *AccountsAdunitsService) List(accountId string, adClientId string) *AccountsAdunitsListCall { + c := &AccountsAdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *AccountsAdunitsListCall) IncludeInactive(includeInactive bool) *AccountsAdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *AccountsAdunitsListCall) MaxResults(maxResults int64) *AccountsAdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsAdunitsListCall) PageToken(pageToken string) *AccountsAdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsAdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.adunits.list", + // "parameterOrder": [ + // "accountId", + // "adClientId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.adunits.customchannels.list": + +type AccountsAdunitsCustomchannelsListCall struct { + s *Service + accountId string + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// List: List all custom channels which the specified ad unit belongs +// to. +func (r *AccountsAdunitsCustomchannelsService) List(accountId string, adClientId string, adUnitId string) *AccountsAdunitsCustomchannelsListCall { + c := &AccountsAdunitsCustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *AccountsAdunitsCustomchannelsListCall) MaxResults(maxResults int64) *AccountsAdunitsCustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsAdunitsCustomchannelsListCall) PageToken(pageToken string) *AccountsAdunitsCustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsAdunitsCustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels which the specified ad unit belongs to.", + // "httpMethod": "GET", + // "id": "adsense.accounts.adunits.customchannels.list", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client which contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.alerts.list": + +type AccountsAlertsListCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// List: List the alerts for the specified AdSense account. +func (r *AccountsAlertsService) List(accountId string) *AccountsAlertsListCall { + c := &AccountsAlertsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// Locale sets the optional parameter "locale": The locale to use for +// translating alert messages. The account locale will be used if this +// is not supplied. The AdSense default (English) will be used if the +// supplied locale is invalid or unsupported. +func (c *AccountsAlertsListCall) Locale(locale string) *AccountsAlertsListCall { + c.opt_["locale"] = locale + return c +} + +func (c *AccountsAlertsListCall) Do() (*Alerts, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/alerts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Alerts) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the alerts for the specified AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.alerts.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account for which to retrieve the alerts.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "locale": { + // "description": "The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/alerts", + // "response": { + // "$ref": "Alerts" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.customchannels.get": + +type AccountsCustomchannelsGetCall struct { + s *Service + accountId string + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// Get: Get the specified custom channel from the specified ad client +// for the specified account. +func (r *AccountsCustomchannelsService) Get(accountId string, adClientId string, customChannelId string) *AccountsCustomchannelsGetCall { + c := &AccountsCustomchannelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +func (c *AccountsCustomchannelsGetCall) Do() (*CustomChannel, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the specified custom channel from the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.customchannels.get", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}", + // "response": { + // "$ref": "CustomChannel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.customchannels.list": + +type AccountsCustomchannelsListCall struct { + s *Service + accountId string + adClientId string + opt_ map[string]interface{} +} + +// List: List all custom channels in the specified ad client for the +// specified account. +func (r *AccountsCustomchannelsService) List(accountId string, adClientId string) *AccountsCustomchannelsListCall { + c := &AccountsCustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *AccountsCustomchannelsListCall) MaxResults(maxResults int64) *AccountsCustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsCustomchannelsListCall) PageToken(pageToken string) *AccountsCustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsCustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels in the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.customchannels.list", + // "parameterOrder": [ + // "accountId", + // "adClientId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.customchannels.adunits.list": + +type AccountsCustomchannelsAdunitsListCall struct { + s *Service + accountId string + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified custom channel. +func (r *AccountsCustomchannelsAdunitsService) List(accountId string, adClientId string, customChannelId string) *AccountsCustomchannelsAdunitsListCall { + c := &AccountsCustomchannelsAdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *AccountsCustomchannelsAdunitsListCall) IncludeInactive(includeInactive bool) *AccountsCustomchannelsAdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *AccountsCustomchannelsAdunitsListCall) MaxResults(maxResults int64) *AccountsCustomchannelsAdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsCustomchannelsAdunitsListCall) PageToken(pageToken string) *AccountsCustomchannelsAdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsCustomchannelsAdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified custom channel.", + // "httpMethod": "GET", + // "id": "adsense.accounts.customchannels.adunits.list", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.reports.generate": + +type AccountsReportsGenerateCall struct { + s *Service + accountId string + startDate string + endDate string + opt_ map[string]interface{} +} + +// Generate: Generate an AdSense 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. +func (r *AccountsReportsService) Generate(accountId string, startDate string, endDate string) *AccountsReportsGenerateCall { + c := &AccountsReportsGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.startDate = startDate + c.endDate = endDate + return c +} + +// Currency sets the optional parameter "currency": Optional currency to +// use when reporting on monetary metrics. Defaults to the account's +// currency if not set. +func (c *AccountsReportsGenerateCall) Currency(currency string) *AccountsReportsGenerateCall { + c.opt_["currency"] = currency + return c +} + +// Dimension sets the optional parameter "dimension": Dimensions to base +// the report on. +func (c *AccountsReportsGenerateCall) Dimension(dimension string) *AccountsReportsGenerateCall { + c.opt_["dimension"] = dimension + return c +} + +// Filter sets the optional parameter "filter": Filters to be run on the +// report. +func (c *AccountsReportsGenerateCall) Filter(filter string) *AccountsReportsGenerateCall { + c.opt_["filter"] = filter + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *AccountsReportsGenerateCall) Locale(locale string) *AccountsReportsGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *AccountsReportsGenerateCall) MaxResults(maxResults int64) *AccountsReportsGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Metric sets the optional parameter "metric": Numeric columns to +// include in the report. +func (c *AccountsReportsGenerateCall) Metric(metric string) *AccountsReportsGenerateCall { + c.opt_["metric"] = metric + return c +} + +// Sort sets the optional parameter "sort": 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. +func (c *AccountsReportsGenerateCall) Sort(sort string) *AccountsReportsGenerateCall { + c.opt_["sort"] = sort + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *AccountsReportsGenerateCall) StartIndex(startIndex int64) *AccountsReportsGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +// UseTimezoneReporting sets the optional parameter +// "useTimezoneReporting": Whether the report should be generated in the +// AdSense account's local timezone. If false default PST/PDT timezone +// will be used. +func (c *AccountsReportsGenerateCall) UseTimezoneReporting(useTimezoneReporting bool) *AccountsReportsGenerateCall { + c.opt_["useTimezoneReporting"] = useTimezoneReporting + return c +} + +func (c *AccountsReportsGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("endDate", fmt.Sprintf("%v", c.endDate)) + params.Set("startDate", fmt.Sprintf("%v", c.startDate)) + if v, ok := c.opt_["currency"]; ok { + params.Set("currency", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dimension"]; ok { + params.Set("dimension", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["metric"]; ok { + params.Set("metric", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["useTimezoneReporting"]; ok { + params.Set("useTimezoneReporting", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdsenseReportsGenerateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an AdSense 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.", + // "httpMethod": "GET", + // "id": "adsense.accounts.reports.generate", + // "parameterOrder": [ + // "accountId", + // "startDate", + // "endDate" + // ], + // "parameters": { + // "accountId": { + // "description": "Account upon which to report.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "currency": { + // "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.", + // "location": "query", + // "pattern": "[a-zA-Z]+", + // "type": "string" + // }, + // "dimension": { + // "description": "Dimensions to base the report on.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "endDate": { + // "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)", + // "required": true, + // "type": "string" + // }, + // "filter": { + // "description": "Filters to be run on the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+(==|=@).+", + // "repeated": true, + // "type": "string" + // }, + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "metric": { + // "description": "Numeric columns to include in the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "sort": { + // "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.", + // "location": "query", + // "pattern": "(\\+|-)?[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "startDate": { + // "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // }, + // "useTimezoneReporting": { + // "description": "Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "accounts/{accountId}/reports", + // "response": { + // "$ref": "AdsenseReportsGenerateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "adsense.accounts.reports.saved.generate": + +type AccountsReportsSavedGenerateCall struct { + s *Service + accountId string + savedReportId string + opt_ map[string]interface{} +} + +// Generate: Generate an AdSense report based on the saved report ID +// sent in the query parameters. +func (r *AccountsReportsSavedService) Generate(accountId string, savedReportId string) *AccountsReportsSavedGenerateCall { + c := &AccountsReportsSavedGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.savedReportId = savedReportId + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *AccountsReportsSavedGenerateCall) Locale(locale string) *AccountsReportsSavedGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *AccountsReportsSavedGenerateCall) MaxResults(maxResults int64) *AccountsReportsSavedGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *AccountsReportsSavedGenerateCall) StartIndex(startIndex int64) *AccountsReportsSavedGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *AccountsReportsSavedGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/{savedReportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{savedReportId}", url.QueryEscape(c.savedReportId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdsenseReportsGenerateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an AdSense report based on the saved report ID sent in the query parameters.", + // "httpMethod": "GET", + // "id": "adsense.accounts.reports.saved.generate", + // "parameterOrder": [ + // "accountId", + // "savedReportId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the saved reports belong.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "savedReportId": { + // "description": "The saved report to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "accounts/{accountId}/reports/{savedReportId}", + // "response": { + // "$ref": "AdsenseReportsGenerateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.reports.saved.list": + +type AccountsReportsSavedListCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// List: List all saved reports in the specified AdSense account. +func (r *AccountsReportsSavedService) List(accountId string) *AccountsReportsSavedListCall { + c := &AccountsReportsSavedListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of saved reports to include in the response, used for paging. +func (c *AccountsReportsSavedListCall) MaxResults(maxResults int64) *AccountsReportsSavedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsReportsSavedListCall) PageToken(pageToken string) *AccountsReportsSavedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsReportsSavedListCall) Do() (*SavedReports, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/saved") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedReports) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all saved reports in the specified AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.reports.saved.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the saved reports belong.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of saved reports to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/reports/saved", + // "response": { + // "$ref": "SavedReports" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.savedadstyles.get": + +type AccountsSavedadstylesGetCall struct { + s *Service + accountId string + savedAdStyleId string + opt_ map[string]interface{} +} + +// Get: List a specific saved ad style for the specified account. +func (r *AccountsSavedadstylesService) Get(accountId string, savedAdStyleId string) *AccountsSavedadstylesGetCall { + c := &AccountsSavedadstylesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.savedAdStyleId = savedAdStyleId + return c +} + +func (c *AccountsSavedadstylesGetCall) Do() (*SavedAdStyle, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/savedadstyles/{savedAdStyleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{savedAdStyleId}", url.QueryEscape(c.savedAdStyleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedAdStyle) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List a specific saved ad style for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.savedadstyles.get", + // "parameterOrder": [ + // "accountId", + // "savedAdStyleId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account for which to get the saved ad style.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "savedAdStyleId": { + // "description": "Saved ad style to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/savedadstyles/{savedAdStyleId}", + // "response": { + // "$ref": "SavedAdStyle" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.savedadstyles.list": + +type AccountsSavedadstylesListCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// List: List all saved ad styles in the specified account. +func (r *AccountsSavedadstylesService) List(accountId string) *AccountsSavedadstylesListCall { + c := &AccountsSavedadstylesListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of saved ad styles to include in the response, used for +// paging. +func (c *AccountsSavedadstylesListCall) MaxResults(maxResults int64) *AccountsSavedadstylesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token, used to page through saved ad styles. To retrieve the next +// page, set this parameter to the value of "nextPageToken" from the +// previous response. +func (c *AccountsSavedadstylesListCall) PageToken(pageToken string) *AccountsSavedadstylesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsSavedadstylesListCall) Do() (*SavedAdStyles, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/savedadstyles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedAdStyles) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all saved ad styles in the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.savedadstyles.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account for which to list saved ad styles.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of saved ad styles to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/savedadstyles", + // "response": { + // "$ref": "SavedAdStyles" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.urlchannels.list": + +type AccountsUrlchannelsListCall struct { + s *Service + accountId string + adClientId string + opt_ map[string]interface{} +} + +// List: List all URL channels in the specified ad client for the +// specified account. +func (r *AccountsUrlchannelsService) List(accountId string, adClientId string) *AccountsUrlchannelsListCall { + c := &AccountsUrlchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of URL channels to include in the response, used for paging. +func (c *AccountsUrlchannelsListCall) MaxResults(maxResults int64) *AccountsUrlchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsUrlchannelsListCall) PageToken(pageToken string) *AccountsUrlchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsUrlchannelsListCall) Do() (*UrlChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UrlChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all URL channels in the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.urlchannels.list", + // "parameterOrder": [ + // "accountId", + // "adClientId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to list URL channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of URL channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/urlchannels", + // "response": { + // "$ref": "UrlChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adclients.list": + +type AdclientsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all ad clients in this AdSense account. +func (r *AdclientsService) List() *AdclientsListCall { + c := &AdclientsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad clients to include in the response, used for paging. +func (c *AdclientsListCall) MaxResults(maxResults int64) *AdclientsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdclientsListCall) PageToken(pageToken string) *AdclientsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdclientsListCall) Do() (*AdClients, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdClients) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad clients in this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.adclients.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of ad clients to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "adclients", + // "response": { + // "$ref": "AdClients" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adunits.get": + +type AdunitsGetCall struct { + s *Service + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// Get: Gets the specified ad unit in the specified ad client. +func (r *AdunitsService) Get(adClientId string, adUnitId string) *AdunitsGetCall { + c := &AdunitsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +func (c *AdunitsGetCall) Do() (*AdUnit, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified ad unit in the specified ad client.", + // "httpMethod": "GET", + // "id": "adsense.adunits.get", + // "parameterOrder": [ + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to get the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits/{adUnitId}", + // "response": { + // "$ref": "AdUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adunits.getAdCode": + +type AdunitsGetAdCodeCall struct { + s *Service + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// GetAdCode: Get ad code for the specified ad unit. +func (r *AdunitsService) GetAdCode(adClientId string, adUnitId string) *AdunitsGetAdCodeCall { + c := &AdunitsGetAdCodeCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +func (c *AdunitsGetAdCodeCall) Do() (*AdCode, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/adcode") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdCode) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get ad code for the specified ad unit.", + // "httpMethod": "GET", + // "id": "adsense.adunits.getAdCode", + // "parameterOrder": [ + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client with contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit to get the code for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits/{adUnitId}/adcode", + // "response": { + // "$ref": "AdCode" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adunits.list": + +type AdunitsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified ad client for this AdSense +// account. +func (r *AdunitsService) List(adClientId string) *AdunitsListCall { + c := &AdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *AdunitsListCall) IncludeInactive(includeInactive bool) *AdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *AdunitsListCall) MaxResults(maxResults int64) *AdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdunitsListCall) PageToken(pageToken string) *AdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified ad client for this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.adunits.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adunits.customchannels.list": + +type AdunitsCustomchannelsListCall struct { + s *Service + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// List: List all custom channels which the specified ad unit belongs +// to. +func (r *AdunitsCustomchannelsService) List(adClientId string, adUnitId string) *AdunitsCustomchannelsListCall { + c := &AdunitsCustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *AdunitsCustomchannelsListCall) MaxResults(maxResults int64) *AdunitsCustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdunitsCustomchannelsListCall) PageToken(pageToken string) *AdunitsCustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdunitsCustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels which the specified ad unit belongs to.", + // "httpMethod": "GET", + // "id": "adsense.adunits.customchannels.list", + // "parameterOrder": [ + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client which contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits/{adUnitId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.alerts.list": + +type AlertsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List the alerts for this AdSense account. +func (r *AlertsService) List() *AlertsListCall { + c := &AlertsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Locale sets the optional parameter "locale": The locale to use for +// translating alert messages. The account locale will be used if this +// is not supplied. The AdSense default (English) will be used if the +// supplied locale is invalid or unsupported. +func (c *AlertsListCall) Locale(locale string) *AlertsListCall { + c.opt_["locale"] = locale + return c +} + +func (c *AlertsListCall) Do() (*Alerts, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "alerts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Alerts) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the alerts for this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.alerts.list", + // "parameters": { + // "locale": { + // "description": "The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "alerts", + // "response": { + // "$ref": "Alerts" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.customchannels.get": + +type CustomchannelsGetCall struct { + s *Service + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// Get: Get the specified custom channel from the specified ad client. +func (r *CustomchannelsService) Get(adClientId string, customChannelId string) *CustomchannelsGetCall { + c := &CustomchannelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +func (c *CustomchannelsGetCall) Do() (*CustomChannel, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the specified custom channel from the specified ad client.", + // "httpMethod": "GET", + // "id": "adsense.customchannels.get", + // "parameterOrder": [ + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels/{customChannelId}", + // "response": { + // "$ref": "CustomChannel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.customchannels.list": + +type CustomchannelsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all custom channels in the specified ad client for this +// AdSense account. +func (r *CustomchannelsService) List(adClientId string) *CustomchannelsListCall { + c := &CustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *CustomchannelsListCall) MaxResults(maxResults int64) *CustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *CustomchannelsListCall) PageToken(pageToken string) *CustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels in the specified ad client for this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.customchannels.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.customchannels.adunits.list": + +type CustomchannelsAdunitsListCall struct { + s *Service + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified custom channel. +func (r *CustomchannelsAdunitsService) List(adClientId string, customChannelId string) *CustomchannelsAdunitsListCall { + c := &CustomchannelsAdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *CustomchannelsAdunitsListCall) IncludeInactive(includeInactive bool) *CustomchannelsAdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *CustomchannelsAdunitsListCall) MaxResults(maxResults int64) *CustomchannelsAdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *CustomchannelsAdunitsListCall) PageToken(pageToken string) *CustomchannelsAdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CustomchannelsAdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified custom channel.", + // "httpMethod": "GET", + // "id": "adsense.customchannels.adunits.list", + // "parameterOrder": [ + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels/{customChannelId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.metadata.dimensions.list": + +type MetadataDimensionsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List the metadata for the dimensions available to this AdSense +// account. +func (r *MetadataDimensionsService) List() *MetadataDimensionsListCall { + c := &MetadataDimensionsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *MetadataDimensionsListCall) Do() (*Metadata, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/dimensions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Metadata) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the metadata for the dimensions available to this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.metadata.dimensions.list", + // "path": "metadata/dimensions", + // "response": { + // "$ref": "Metadata" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.metadata.metrics.list": + +type MetadataMetricsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List the metadata for the metrics available to this AdSense +// account. +func (r *MetadataMetricsService) List() *MetadataMetricsListCall { + c := &MetadataMetricsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *MetadataMetricsListCall) Do() (*Metadata, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/metrics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Metadata) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the metadata for the metrics available to this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.metadata.metrics.list", + // "path": "metadata/metrics", + // "response": { + // "$ref": "Metadata" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.reports.generate": + +type ReportsGenerateCall struct { + s *Service + startDate string + endDate string + opt_ map[string]interface{} +} + +// Generate: Generate an AdSense 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. +func (r *ReportsService) Generate(startDate string, endDate string) *ReportsGenerateCall { + c := &ReportsGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.startDate = startDate + c.endDate = endDate + return c +} + +// AccountId sets the optional parameter "accountId": Accounts upon +// which to report. +func (c *ReportsGenerateCall) AccountId(accountId string) *ReportsGenerateCall { + c.opt_["accountId"] = accountId + return c +} + +// Currency sets the optional parameter "currency": Optional currency to +// use when reporting on monetary metrics. Defaults to the account's +// currency if not set. +func (c *ReportsGenerateCall) Currency(currency string) *ReportsGenerateCall { + c.opt_["currency"] = currency + return c +} + +// Dimension sets the optional parameter "dimension": Dimensions to base +// the report on. +func (c *ReportsGenerateCall) Dimension(dimension string) *ReportsGenerateCall { + c.opt_["dimension"] = dimension + return c +} + +// Filter sets the optional parameter "filter": Filters to be run on the +// report. +func (c *ReportsGenerateCall) Filter(filter string) *ReportsGenerateCall { + c.opt_["filter"] = filter + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *ReportsGenerateCall) Locale(locale string) *ReportsGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *ReportsGenerateCall) MaxResults(maxResults int64) *ReportsGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Metric sets the optional parameter "metric": Numeric columns to +// include in the report. +func (c *ReportsGenerateCall) Metric(metric string) *ReportsGenerateCall { + c.opt_["metric"] = metric + return c +} + +// Sort sets the optional parameter "sort": 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. +func (c *ReportsGenerateCall) Sort(sort string) *ReportsGenerateCall { + c.opt_["sort"] = sort + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *ReportsGenerateCall) StartIndex(startIndex int64) *ReportsGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +// UseTimezoneReporting sets the optional parameter +// "useTimezoneReporting": Whether the report should be generated in the +// AdSense account's local timezone. If false default PST/PDT timezone +// will be used. +func (c *ReportsGenerateCall) UseTimezoneReporting(useTimezoneReporting bool) *ReportsGenerateCall { + c.opt_["useTimezoneReporting"] = useTimezoneReporting + return c +} + +func (c *ReportsGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("endDate", fmt.Sprintf("%v", c.endDate)) + params.Set("startDate", fmt.Sprintf("%v", c.startDate)) + if v, ok := c.opt_["accountId"]; ok { + params.Set("accountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["currency"]; ok { + params.Set("currency", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dimension"]; ok { + params.Set("dimension", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["metric"]; ok { + params.Set("metric", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["useTimezoneReporting"]; ok { + params.Set("useTimezoneReporting", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdsenseReportsGenerateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an AdSense 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.", + // "httpMethod": "GET", + // "id": "adsense.reports.generate", + // "parameterOrder": [ + // "startDate", + // "endDate" + // ], + // "parameters": { + // "accountId": { + // "description": "Accounts upon which to report.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "currency": { + // "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.", + // "location": "query", + // "pattern": "[a-zA-Z]+", + // "type": "string" + // }, + // "dimension": { + // "description": "Dimensions to base the report on.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "endDate": { + // "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)", + // "required": true, + // "type": "string" + // }, + // "filter": { + // "description": "Filters to be run on the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+(==|=@).+", + // "repeated": true, + // "type": "string" + // }, + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "metric": { + // "description": "Numeric columns to include in the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "sort": { + // "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.", + // "location": "query", + // "pattern": "(\\+|-)?[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "startDate": { + // "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // }, + // "useTimezoneReporting": { + // "description": "Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "reports", + // "response": { + // "$ref": "AdsenseReportsGenerateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "adsense.reports.saved.generate": + +type ReportsSavedGenerateCall struct { + s *Service + savedReportId string + opt_ map[string]interface{} +} + +// Generate: Generate an AdSense report based on the saved report ID +// sent in the query parameters. +func (r *ReportsSavedService) Generate(savedReportId string) *ReportsSavedGenerateCall { + c := &ReportsSavedGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.savedReportId = savedReportId + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *ReportsSavedGenerateCall) Locale(locale string) *ReportsSavedGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *ReportsSavedGenerateCall) MaxResults(maxResults int64) *ReportsSavedGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *ReportsSavedGenerateCall) StartIndex(startIndex int64) *ReportsSavedGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *ReportsSavedGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{savedReportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{savedReportId}", url.QueryEscape(c.savedReportId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdsenseReportsGenerateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an AdSense report based on the saved report ID sent in the query parameters.", + // "httpMethod": "GET", + // "id": "adsense.reports.saved.generate", + // "parameterOrder": [ + // "savedReportId" + // ], + // "parameters": { + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "savedReportId": { + // "description": "The saved report to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "reports/{savedReportId}", + // "response": { + // "$ref": "AdsenseReportsGenerateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.reports.saved.list": + +type ReportsSavedListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all saved reports in this AdSense account. +func (r *ReportsSavedService) List() *ReportsSavedListCall { + c := &ReportsSavedListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of saved reports to include in the response, used for paging. +func (c *ReportsSavedListCall) MaxResults(maxResults int64) *ReportsSavedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *ReportsSavedListCall) PageToken(pageToken string) *ReportsSavedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ReportsSavedListCall) Do() (*SavedReports, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/saved") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedReports) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all saved reports in this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.reports.saved.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of saved reports to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "reports/saved", + // "response": { + // "$ref": "SavedReports" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.savedadstyles.get": + +type SavedadstylesGetCall struct { + s *Service + savedAdStyleId string + opt_ map[string]interface{} +} + +// Get: Get a specific saved ad style from the user's account. +func (r *SavedadstylesService) Get(savedAdStyleId string) *SavedadstylesGetCall { + c := &SavedadstylesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.savedAdStyleId = savedAdStyleId + return c +} + +func (c *SavedadstylesGetCall) Do() (*SavedAdStyle, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "savedadstyles/{savedAdStyleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{savedAdStyleId}", url.QueryEscape(c.savedAdStyleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedAdStyle) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a specific saved ad style from the user's account.", + // "httpMethod": "GET", + // "id": "adsense.savedadstyles.get", + // "parameterOrder": [ + // "savedAdStyleId" + // ], + // "parameters": { + // "savedAdStyleId": { + // "description": "Saved ad style to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "savedadstyles/{savedAdStyleId}", + // "response": { + // "$ref": "SavedAdStyle" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.savedadstyles.list": + +type SavedadstylesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all saved ad styles in the user's account. +func (r *SavedadstylesService) List() *SavedadstylesListCall { + c := &SavedadstylesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of saved ad styles to include in the response, used for +// paging. +func (c *SavedadstylesListCall) MaxResults(maxResults int64) *SavedadstylesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token, used to page through saved ad styles. To retrieve the next +// page, set this parameter to the value of "nextPageToken" from the +// previous response. +func (c *SavedadstylesListCall) PageToken(pageToken string) *SavedadstylesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *SavedadstylesListCall) Do() (*SavedAdStyles, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "savedadstyles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedAdStyles) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all saved ad styles in the user's account.", + // "httpMethod": "GET", + // "id": "adsense.savedadstyles.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of saved ad styles to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "savedadstyles", + // "response": { + // "$ref": "SavedAdStyles" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.urlchannels.list": + +type UrlchannelsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all URL channels in the specified ad client for this +// AdSense account. +func (r *UrlchannelsService) List(adClientId string) *UrlchannelsListCall { + c := &UrlchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of URL channels to include in the response, used for paging. +func (c *UrlchannelsListCall) MaxResults(maxResults int64) *UrlchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *UrlchannelsListCall) PageToken(pageToken string) *UrlchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *UrlchannelsListCall) Do() (*UrlChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UrlChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all URL channels in the specified ad client for this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.urlchannels.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list URL channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of URL channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/urlchannels", + // "response": { + // "$ref": "UrlChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.4/adsense-api.json b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.4/adsense-api.json new file mode 100644 index 0000000000000..51032c372413c --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.4/adsense-api.json @@ -0,0 +1,2406 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/G2IFVrRZc_qYUIJrbpW9h4_B9is\"", + "discoveryVersion": "v1", + "id": "adsense:v1.4", + "name": "adsense", + "canonicalName": "AdSense", + "version": "v1.4", + "title": "AdSense Management API", + "description": "Gives AdSense publishers access to their inventory and the ability to generate reports", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/adsense-16.png", + "x32": "http://www.google.com/images/icons/product/adsense-32.png" + }, + "documentationLink": "https://developers.google.com/adsense/management/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/adsense/v1.4/", + "basePath": "/adsense/v1.4/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "adsense/v1.4/", + "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/adsense": { + "description": "View and manage your AdSense data" + }, + "https://www.googleapis.com/auth/adsense.readonly": { + "description": "View your AdSense data" + } + } + } + }, + "schemas": { + "Account": { + "id": "Account", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of this account." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adsense#account.", + "default": "adsense#account" + }, + "name": { + "type": "string", + "description": "Name of this account." + }, + "premium": { + "type": "boolean", + "description": "Whether this account is premium." + }, + "subAccounts": { + "type": "array", + "description": "Sub accounts of the this account.", + "items": { + "$ref": "Account" + } + }, + "timezone": { + "type": "string", + "description": "AdSense timezone of this account." + } + } + }, + "Accounts": { + "id": "Accounts", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The accounts returned in this list response.", + "items": { + "$ref": "Account" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adsense#accounts.", + "default": "adsense#accounts" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through accounts. To retrieve the next page of results, set the next request's \"pageToken\" value to this." + } + } + }, + "AdClient": { + "id": "AdClient", + "type": "object", + "properties": { + "arcOptIn": { + "type": "boolean", + "description": "Whether this ad client is opted in to ARC." + }, + "arcReviewMode": { + "type": "string", + "description": "ARC review mode this ad client is in. Empty if the client is not opted in to ARC. Possible values: POST_REVIEW, AUTOMATIC_PRE_REVIEW." + }, + "id": { + "type": "string", + "description": "Unique identifier of this ad client." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adsense#adClient.", + "default": "adsense#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 adsense#adClients.", + "default": "adsense#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." + } + } + }, + "AdCode": { + "id": "AdCode", + "type": "object", + "properties": { + "adCode": { + "type": "string", + "description": "The ad code snippet." + }, + "kind": { + "type": "string", + "description": "Kind this is, in this case adsense#adCode.", + "default": "adsense#adCode" + } + } + }, + "AdStyle": { + "id": "AdStyle", + "type": "object", + "properties": { + "colors": { + "type": "object", + "description": "The colors which are included in the style. These are represented as six hexadecimal characters, similar to HTML color codes, but without the leading hash.", + "properties": { + "background": { + "type": "string", + "description": "The color of the ad background." + }, + "border": { + "type": "string", + "description": "The color of the ad border." + }, + "text": { + "type": "string", + "description": "The color of the ad text." + }, + "title": { + "type": "string", + "description": "The color of the ad title." + }, + "url": { + "type": "string", + "description": "The color of the ad url." + } + } + }, + "corners": { + "type": "string", + "description": "The style of the corners in the ad." + }, + "font": { + "type": "object", + "description": "The font which is included in the style.", + "properties": { + "family": { + "type": "string", + "description": "The family of the font." + }, + "size": { + "type": "string", + "description": "The size of the font." + } + } + }, + "kind": { + "type": "string", + "description": "Kind this is, in this case adsense#adStyle.", + "default": "adsense#adStyle" + } + } + }, + "AdUnit": { + "id": "AdUnit", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Identity code of this ad unit, not necessarily unique across ad clients." + }, + "contentAdsSettings": { + "type": "object", + "description": "Settings specific to content ads (AFC) and highend mobile content ads (AFMC).", + "properties": { + "backupOption": { + "type": "object", + "description": "The backup option to be used in instances where no ad is available.", + "properties": { + "color": { + "type": "string", + "description": "Color to use when type is set to COLOR." + }, + "type": { + "type": "string", + "description": "Type of the backup option. Possible values are BLANK, COLOR and URL." + }, + "url": { + "type": "string", + "description": "URL to use when type is set to URL." + } + } + }, + "size": { + "type": "string", + "description": "Size of this ad unit." + }, + "type": { + "type": "string", + "description": "Type of this ad unit." + } + } + }, + "customStyle": { + "$ref": "AdStyle", + "description": "Custom style information specific to this ad unit." + }, + "feedAdsSettings": { + "type": "object", + "description": "Settings specific to feed ads (AFF).", + "properties": { + "adPosition": { + "type": "string", + "description": "The position of the ads relative to the feed entries." + }, + "frequency": { + "type": "integer", + "description": "The frequency at which ads should appear in the feed (i.e. every N entries).", + "format": "int32" + }, + "minimumWordCount": { + "type": "integer", + "description": "The minimum length an entry should be in order to have attached ads.", + "format": "int32" + }, + "type": { + "type": "string", + "description": "The type of ads which should appear." + } + } + }, + "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 adsense#adUnit.", + "default": "adsense#adUnit" + }, + "mobileContentAdsSettings": { + "type": "object", + "description": "Settings specific to WAP mobile content ads (AFMC).", + "properties": { + "markupLanguage": { + "type": "string", + "description": "The markup language to use for this ad unit." + }, + "scriptingLanguage": { + "type": "string", + "description": "The scripting language to use for this ad unit." + }, + "size": { + "type": "string", + "description": "Size of this ad unit." + }, + "type": { + "type": "string", + "description": "Type of this ad unit." + } + } + }, + "name": { + "type": "string", + "description": "Name of this ad unit." + }, + "savedStyleId": { + "type": "string", + "description": "ID of the saved ad style which holds this ad unit's style information." + }, + "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 adsense#adUnits.", + "default": "adsense#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." + } + } + }, + "AdsenseReportsGenerateResponse": { + "id": "AdsenseReportsGenerateResponse", + "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" + } + }, + "endDate": { + "type": "string", + "description": "The requested end date in yyyy-mm-dd format." + }, + "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 adsense#report.", + "default": "adsense#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" + } + } + }, + "startDate": { + "type": "string", + "description": "The requested start date in yyyy-mm-dd format." + }, + "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" + } + } + } + }, + "Alert": { + "id": "Alert", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of this alert. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format." + }, + "isDismissible": { + "type": "boolean", + "description": "Whether this alert can be dismissed." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adsense#alert.", + "default": "adsense#alert" + }, + "message": { + "type": "string", + "description": "The localized alert message." + }, + "severity": { + "type": "string", + "description": "Severity of this alert. Possible values: INFO, WARNING, SEVERE." + }, + "type": { + "type": "string", + "description": "Type of this alert. Possible values: SELF_HOLD, MIGRATED_TO_BILLING3, ADDRESS_PIN_VERIFICATION, PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, GRAYLISTED_PUBLISHER, API_HOLD." + } + } + }, + "Alerts": { + "id": "Alerts", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The alerts returned in this list response.", + "items": { + "$ref": "Alert" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adsense#alerts.", + "default": "adsense#alerts" + } + } + }, + "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 adsense#customChannel.", + "default": "adsense#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 adsense#customChannels.", + "default": "adsense#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." + } + } + }, + "Metadata": { + "id": "Metadata", + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "ReportingMetadataEntry" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adsense#metadata.", + "default": "adsense#metadata" + } + } + }, + "Payment": { + "id": "Payment", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of this Payment." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adsense#payment.", + "default": "adsense#payment" + }, + "paymentAmount": { + "type": "string", + "description": "The amount to be paid." + }, + "paymentAmountCurrencyCode": { + "type": "string", + "description": "The currency code for the amount to be paid." + }, + "paymentDate": { + "type": "string", + "description": "The date this payment was/will be credited to the user, or none if the payment threshold has not been met." + } + } + }, + "Payments": { + "id": "Payments", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The list of Payments for the account. One or both of a) the account's most recent payment; and b) the account's upcoming payment.", + "items": { + "$ref": "Payment" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adsense#payments.", + "default": "adsense#payments" + } + } + }, + "ReportingMetadataEntry": { + "id": "ReportingMetadataEntry", + "type": "object", + "properties": { + "compatibleDimensions": { + "type": "array", + "description": "For metrics this is a list of dimension IDs which the metric is compatible with, for dimensions it is a list of compatibility groups the dimension belongs to.", + "items": { + "type": "string" + } + }, + "compatibleMetrics": { + "type": "array", + "description": "The names of the metrics the dimension or metric this reporting metadata entry describes is compatible with.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "Unique identifier of this reporting metadata entry, corresponding to the name of the appropriate dimension or metric." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adsense#reportingMetadataEntry.", + "default": "adsense#reportingMetadataEntry" + }, + "requiredDimensions": { + "type": "array", + "description": "The names of the dimensions which the dimension or metric this reporting metadata entry describes requires to also be present in order for the report to be valid. Omitting these will not cause an error or warning, but may result in data which cannot be correctly interpreted.", + "items": { + "type": "string" + } + }, + "requiredMetrics": { + "type": "array", + "description": "The names of the metrics which the dimension or metric this reporting metadata entry describes requires to also be present in order for the report to be valid. Omitting these will not cause an error or warning, but may result in data which cannot be correctly interpreted.", + "items": { + "type": "string" + } + }, + "supportedProducts": { + "type": "array", + "description": "The codes of the projects supported by the dimension or metric this reporting metadata entry describes.", + "items": { + "type": "string" + } + } + } + }, + "SavedAdStyle": { + "id": "SavedAdStyle", + "type": "object", + "properties": { + "adStyle": { + "$ref": "AdStyle", + "description": "The AdStyle itself." + }, + "id": { + "type": "string", + "description": "Unique identifier of this saved ad style. 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 adsense#savedAdStyle.", + "default": "adsense#savedAdStyle" + }, + "name": { + "type": "string", + "description": "The user selected name of this SavedAdStyle." + } + } + }, + "SavedAdStyles": { + "id": "SavedAdStyles", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The saved ad styles returned in this list response.", + "items": { + "$ref": "SavedAdStyle" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adsense#savedAdStyles.", + "default": "adsense#savedAdStyles" + }, + "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." + } + } + }, + "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 adsense#savedReport.", + "default": "adsense#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 adsense#savedReports.", + "default": "adsense#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 adsense#urlChannel.", + "default": "adsense#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 adsense#urlChannels.", + "default": "adsense#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": { + "accounts": { + "methods": { + "get": { + "id": "adsense.accounts.get", + "path": "accounts/{accountId}", + "httpMethod": "GET", + "description": "Get information about the selected AdSense account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to get information about.", + "required": true, + "location": "path" + }, + "tree": { + "type": "boolean", + "description": "Whether the tree of sub accounts should be returned.", + "location": "query" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.accounts.list", + "path": "accounts", + "httpMethod": "GET", + "description": "List all accounts available to this AdSense account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of accounts to include in the response, used for paging.", + "format": "int32", + "minimum": "0", + "maximum": "10000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "response": { + "$ref": "Accounts" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "adclients": { + "methods": { + "list": { + "id": "adsense.accounts.adclients.list", + "path": "accounts/{accountId}/adclients", + "httpMethod": "GET", + "description": "List all ad clients in the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account for which to list ad clients.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of ad clients to include in the response, used for paging.", + "format": "int32", + "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" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "AdClients" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "adunits": { + "methods": { + "get": { + "id": "adsense.accounts.adunits.get", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}", + "httpMethod": "GET", + "description": "Gets the specified ad unit in the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": [ + "accountId", + "adClientId", + "adUnitId" + ], + "response": { + "$ref": "AdUnit" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "getAdCode": { + "id": "adsense.accounts.adunits.getAdCode", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode", + "httpMethod": "GET", + "description": "Get ad code for the specified ad unit.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account which contains the ad client.", + "required": true, + "location": "path" + }, + "adClientId": { + "type": "string", + "description": "Ad client with contains the ad unit.", + "required": true, + "location": "path" + }, + "adUnitId": { + "type": "string", + "description": "Ad unit to get the code for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "adClientId", + "adUnitId" + ], + "response": { + "$ref": "AdCode" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.accounts.adunits.list", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits", + "httpMethod": "GET", + "description": "List all ad units in the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId" + ], + "response": { + "$ref": "AdUnits" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "customchannels": { + "methods": { + "list": { + "id": "adsense.accounts.adunits.customchannels.list", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels", + "httpMethod": "GET", + "description": "List all custom channels which the specified ad unit belongs to.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId", + "adUnitId" + ], + "response": { + "$ref": "CustomChannels" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "alerts": { + "methods": { + "delete": { + "id": "adsense.accounts.alerts.delete", + "path": "accounts/{accountId}/alerts/{alertId}", + "httpMethod": "DELETE", + "description": "Dismiss (delete) the specified alert from the specified publisher AdSense account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account which contains the ad unit.", + "required": true, + "location": "path" + }, + "alertId": { + "type": "string", + "description": "Alert to delete.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "alertId" + ], + "scopes": [ + "https://www.googleapis.com/auth/adsense" + ] + }, + "list": { + "id": "adsense.accounts.alerts.list", + "path": "accounts/{accountId}/alerts", + "httpMethod": "GET", + "description": "List the alerts for the specified AdSense account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account for which to retrieve the alerts.", + "required": true, + "location": "path" + }, + "locale": { + "type": "string", + "description": "The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported.", + "location": "query" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "Alerts" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "customchannels": { + "methods": { + "get": { + "id": "adsense.accounts.customchannels.get", + "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}", + "httpMethod": "GET", + "description": "Get the specified custom channel from the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": [ + "accountId", + "adClientId", + "customChannelId" + ], + "response": { + "$ref": "CustomChannel" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.accounts.customchannels.list", + "path": "accounts/{accountId}/adclients/{adClientId}/customchannels", + "httpMethod": "GET", + "description": "List all custom channels in the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId" + ], + "response": { + "$ref": "CustomChannels" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "adunits": { + "methods": { + "list": { + "id": "adsense.accounts.customchannels.adunits.list", + "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits", + "httpMethod": "GET", + "description": "List all ad units in the specified custom channel.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId", + "customChannelId" + ], + "response": { + "$ref": "AdUnits" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "payments": { + "methods": { + "list": { + "id": "adsense.accounts.payments.list", + "path": "accounts/{accountId}/payments", + "httpMethod": "GET", + "description": "List the payments for the specified AdSense account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account for which to retrieve the payments.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "Payments" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "reports": { + "methods": { + "generate": { + "id": "adsense.accounts.reports.generate", + "path": "accounts/{accountId}/reports", + "httpMethod": "GET", + "description": "Generate an AdSense 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": { + "accountId": { + "type": "string", + "description": "Account upon which to report.", + "required": true, + "location": "path" + }, + "currency": { + "type": "string", + "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.", + "pattern": "[a-zA-Z]+", + "location": "query" + }, + "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}?)|(latest-(\\d{2})-(\\d{2})(-\\d+y)?)|(latest-latest-(\\d{2})(-\\d+m)?)", + "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": "int32", + "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}?)|(latest-(\\d{2})-(\\d{2})(-\\d+y)?)|(latest-latest-(\\d{2})(-\\d+m)?)", + "location": "query" + }, + "startIndex": { + "type": "integer", + "description": "Index of the first row of report data to return.", + "format": "int32", + "minimum": "0", + "maximum": "5000", + "location": "query" + }, + "useTimezoneReporting": { + "type": "boolean", + "description": "Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used.", + "location": "query" + } + }, + "parameterOrder": [ + "accountId", + "startDate", + "endDate" + ], + "response": { + "$ref": "AdsenseReportsGenerateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ], + "supportsMediaDownload": true + } + }, + "resources": { + "saved": { + "methods": { + "generate": { + "id": "adsense.accounts.reports.saved.generate", + "path": "accounts/{accountId}/reports/{savedReportId}", + "httpMethod": "GET", + "description": "Generate an AdSense report based on the saved report ID sent in the query parameters.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the saved reports belong.", + "required": true, + "location": "path" + }, + "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": [ + "accountId", + "savedReportId" + ], + "response": { + "$ref": "AdsenseReportsGenerateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.accounts.reports.saved.list", + "path": "accounts/{accountId}/reports/saved", + "httpMethod": "GET", + "description": "List all saved reports in the specified AdSense account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the saved reports belong.", + "required": true, + "location": "path" + }, + "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" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "SavedReports" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "savedadstyles": { + "methods": { + "get": { + "id": "adsense.accounts.savedadstyles.get", + "path": "accounts/{accountId}/savedadstyles/{savedAdStyleId}", + "httpMethod": "GET", + "description": "List a specific saved ad style for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account for which to get the saved ad style.", + "required": true, + "location": "path" + }, + "savedAdStyleId": { + "type": "string", + "description": "Saved ad style to retrieve.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "savedAdStyleId" + ], + "response": { + "$ref": "SavedAdStyle" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.accounts.savedadstyles.list", + "path": "accounts/{accountId}/savedadstyles", + "httpMethod": "GET", + "description": "List all saved ad styles in the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account for which to list saved ad styles.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of saved ad styles to include in the response, used for paging.", + "format": "int32", + "minimum": "0", + "maximum": "10000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "SavedAdStyles" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "urlchannels": { + "methods": { + "list": { + "id": "adsense.accounts.urlchannels.list", + "path": "accounts/{accountId}/adclients/{adClientId}/urlchannels", + "httpMethod": "GET", + "description": "List all URL channels in the specified ad client for the specified account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "required": true, + "location": "path" + }, + "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": "int32", + "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": [ + "accountId", + "adClientId" + ], + "response": { + "$ref": "UrlChannels" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "adclients": { + "methods": { + "list": { + "id": "adsense.adclients.list", + "path": "adclients", + "httpMethod": "GET", + "description": "List all ad clients in this AdSense account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of ad clients to include in the response, used for paging.", + "format": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "adunits": { + "methods": { + "get": { + "id": "adsense.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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "getAdCode": { + "id": "adsense.adunits.getAdCode", + "path": "adclients/{adClientId}/adunits/{adUnitId}/adcode", + "httpMethod": "GET", + "description": "Get ad code for the specified ad unit.", + "parameters": { + "adClientId": { + "type": "string", + "description": "Ad client with contains the ad unit.", + "required": true, + "location": "path" + }, + "adUnitId": { + "type": "string", + "description": "Ad unit to get the code for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "adClientId", + "adUnitId" + ], + "response": { + "$ref": "AdCode" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.adunits.list", + "path": "adclients/{adClientId}/adunits", + "httpMethod": "GET", + "description": "List all ad units in the specified ad client for this AdSense 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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "customchannels": { + "methods": { + "list": { + "id": "adsense.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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "alerts": { + "methods": { + "delete": { + "id": "adsense.alerts.delete", + "path": "alerts/{alertId}", + "httpMethod": "DELETE", + "description": "Dismiss (delete) the specified alert from the publisher's AdSense account.", + "parameters": { + "alertId": { + "type": "string", + "description": "Alert to delete.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "alertId" + ], + "scopes": [ + "https://www.googleapis.com/auth/adsense" + ] + }, + "list": { + "id": "adsense.alerts.list", + "path": "alerts", + "httpMethod": "GET", + "description": "List the alerts for this AdSense account.", + "parameters": { + "locale": { + "type": "string", + "description": "The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported.", + "location": "query" + } + }, + "response": { + "$ref": "Alerts" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "customchannels": { + "methods": { + "get": { + "id": "adsense.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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.customchannels.list", + "path": "adclients/{adClientId}/customchannels", + "httpMethod": "GET", + "description": "List all custom channels in the specified ad client for this AdSense 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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + }, + "resources": { + "adunits": { + "methods": { + "list": { + "id": "adsense.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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "metadata": { + "resources": { + "dimensions": { + "methods": { + "list": { + "id": "adsense.metadata.dimensions.list", + "path": "metadata/dimensions", + "httpMethod": "GET", + "description": "List the metadata for the dimensions available to this AdSense account.", + "response": { + "$ref": "Metadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "metrics": { + "methods": { + "list": { + "id": "adsense.metadata.metrics.list", + "path": "metadata/metrics", + "httpMethod": "GET", + "description": "List the metadata for the metrics available to this AdSense account.", + "response": { + "$ref": "Metadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "payments": { + "methods": { + "list": { + "id": "adsense.payments.list", + "path": "payments", + "httpMethod": "GET", + "description": "List the payments for this AdSense account.", + "response": { + "$ref": "Payments" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "reports": { + "methods": { + "generate": { + "id": "adsense.reports.generate", + "path": "reports", + "httpMethod": "GET", + "description": "Generate an AdSense 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": { + "accountId": { + "type": "string", + "description": "Accounts upon which to report.", + "repeated": true, + "location": "query" + }, + "currency": { + "type": "string", + "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.", + "pattern": "[a-zA-Z]+", + "location": "query" + }, + "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}?)|(latest-(\\d{2})-(\\d{2})(-\\d+y)?)|(latest-latest-(\\d{2})(-\\d+m)?)", + "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": "int32", + "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}?)|(latest-(\\d{2})-(\\d{2})(-\\d+y)?)|(latest-latest-(\\d{2})(-\\d+m)?)", + "location": "query" + }, + "startIndex": { + "type": "integer", + "description": "Index of the first row of report data to return.", + "format": "int32", + "minimum": "0", + "maximum": "5000", + "location": "query" + }, + "useTimezoneReporting": { + "type": "boolean", + "description": "Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used.", + "location": "query" + } + }, + "parameterOrder": [ + "startDate", + "endDate" + ], + "response": { + "$ref": "AdsenseReportsGenerateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ], + "supportsMediaDownload": true + } + }, + "resources": { + "saved": { + "methods": { + "generate": { + "id": "adsense.reports.saved.generate", + "path": "reports/{savedReportId}", + "httpMethod": "GET", + "description": "Generate an AdSense 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": "AdsenseReportsGenerateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.reports.saved.list", + "path": "reports/saved", + "httpMethod": "GET", + "description": "List all saved reports in this AdSense 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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } + }, + "savedadstyles": { + "methods": { + "get": { + "id": "adsense.savedadstyles.get", + "path": "savedadstyles/{savedAdStyleId}", + "httpMethod": "GET", + "description": "Get a specific saved ad style from the user's account.", + "parameters": { + "savedAdStyleId": { + "type": "string", + "description": "Saved ad style to retrieve.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "savedAdStyleId" + ], + "response": { + "$ref": "SavedAdStyle" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + }, + "list": { + "id": "adsense.savedadstyles.list", + "path": "savedadstyles", + "httpMethod": "GET", + "description": "List all saved ad styles in the user's account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of saved ad styles to include in the response, used for paging.", + "format": "int32", + "minimum": "0", + "maximum": "10000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "response": { + "$ref": "SavedAdStyles" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "urlchannels": { + "methods": { + "list": { + "id": "adsense.urlchannels.list", + "path": "adclients/{adClientId}/urlchannels", + "httpMethod": "GET", + "description": "List all URL channels in the specified ad client for this AdSense 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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.4/adsense-gen.go b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.4/adsense-gen.go new file mode 100644 index 0000000000000..318d216539827 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1.4/adsense-gen.go @@ -0,0 +1,4684 @@ +// Package adsense provides access to the AdSense Management API. +// +// See https://developers.google.com/adsense/management/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/adsense/v1.4" +// ... +// adsenseService, err := adsense.New(oauthHttpClient) +package adsense + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "adsense:v1.4" +const apiName = "adsense" +const apiVersion = "v1.4" +const basePath = "https://www.googleapis.com/adsense/v1.4/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your AdSense data + AdsenseScope = "https://www.googleapis.com/auth/adsense" + + // View your AdSense data + AdsenseReadonlyScope = "https://www.googleapis.com/auth/adsense.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.Accounts = NewAccountsService(s) + s.Adclients = NewAdclientsService(s) + s.Adunits = NewAdunitsService(s) + s.Alerts = NewAlertsService(s) + s.Customchannels = NewCustomchannelsService(s) + s.Metadata = NewMetadataService(s) + s.Payments = NewPaymentsService(s) + s.Reports = NewReportsService(s) + s.Savedadstyles = NewSavedadstylesService(s) + s.Urlchannels = NewUrlchannelsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Accounts *AccountsService + + Adclients *AdclientsService + + Adunits *AdunitsService + + Alerts *AlertsService + + Customchannels *CustomchannelsService + + Metadata *MetadataService + + Payments *PaymentsService + + Reports *ReportsService + + Savedadstyles *SavedadstylesService + + Urlchannels *UrlchannelsService +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + rs.Adclients = NewAccountsAdclientsService(s) + rs.Adunits = NewAccountsAdunitsService(s) + rs.Alerts = NewAccountsAlertsService(s) + rs.Customchannels = NewAccountsCustomchannelsService(s) + rs.Payments = NewAccountsPaymentsService(s) + rs.Reports = NewAccountsReportsService(s) + rs.Savedadstyles = NewAccountsSavedadstylesService(s) + rs.Urlchannels = NewAccountsUrlchannelsService(s) + return rs +} + +type AccountsService struct { + s *Service + + Adclients *AccountsAdclientsService + + Adunits *AccountsAdunitsService + + Alerts *AccountsAlertsService + + Customchannels *AccountsCustomchannelsService + + Payments *AccountsPaymentsService + + Reports *AccountsReportsService + + Savedadstyles *AccountsSavedadstylesService + + Urlchannels *AccountsUrlchannelsService +} + +func NewAccountsAdclientsService(s *Service) *AccountsAdclientsService { + rs := &AccountsAdclientsService{s: s} + return rs +} + +type AccountsAdclientsService struct { + s *Service +} + +func NewAccountsAdunitsService(s *Service) *AccountsAdunitsService { + rs := &AccountsAdunitsService{s: s} + rs.Customchannels = NewAccountsAdunitsCustomchannelsService(s) + return rs +} + +type AccountsAdunitsService struct { + s *Service + + Customchannels *AccountsAdunitsCustomchannelsService +} + +func NewAccountsAdunitsCustomchannelsService(s *Service) *AccountsAdunitsCustomchannelsService { + rs := &AccountsAdunitsCustomchannelsService{s: s} + return rs +} + +type AccountsAdunitsCustomchannelsService struct { + s *Service +} + +func NewAccountsAlertsService(s *Service) *AccountsAlertsService { + rs := &AccountsAlertsService{s: s} + return rs +} + +type AccountsAlertsService struct { + s *Service +} + +func NewAccountsCustomchannelsService(s *Service) *AccountsCustomchannelsService { + rs := &AccountsCustomchannelsService{s: s} + rs.Adunits = NewAccountsCustomchannelsAdunitsService(s) + return rs +} + +type AccountsCustomchannelsService struct { + s *Service + + Adunits *AccountsCustomchannelsAdunitsService +} + +func NewAccountsCustomchannelsAdunitsService(s *Service) *AccountsCustomchannelsAdunitsService { + rs := &AccountsCustomchannelsAdunitsService{s: s} + return rs +} + +type AccountsCustomchannelsAdunitsService struct { + s *Service +} + +func NewAccountsPaymentsService(s *Service) *AccountsPaymentsService { + rs := &AccountsPaymentsService{s: s} + return rs +} + +type AccountsPaymentsService struct { + s *Service +} + +func NewAccountsReportsService(s *Service) *AccountsReportsService { + rs := &AccountsReportsService{s: s} + rs.Saved = NewAccountsReportsSavedService(s) + return rs +} + +type AccountsReportsService struct { + s *Service + + Saved *AccountsReportsSavedService +} + +func NewAccountsReportsSavedService(s *Service) *AccountsReportsSavedService { + rs := &AccountsReportsSavedService{s: s} + return rs +} + +type AccountsReportsSavedService struct { + s *Service +} + +func NewAccountsSavedadstylesService(s *Service) *AccountsSavedadstylesService { + rs := &AccountsSavedadstylesService{s: s} + return rs +} + +type AccountsSavedadstylesService struct { + s *Service +} + +func NewAccountsUrlchannelsService(s *Service) *AccountsUrlchannelsService { + rs := &AccountsUrlchannelsService{s: s} + return rs +} + +type AccountsUrlchannelsService struct { + s *Service +} + +func NewAdclientsService(s *Service) *AdclientsService { + rs := &AdclientsService{s: s} + return rs +} + +type AdclientsService struct { + s *Service +} + +func NewAdunitsService(s *Service) *AdunitsService { + rs := &AdunitsService{s: s} + rs.Customchannels = NewAdunitsCustomchannelsService(s) + return rs +} + +type AdunitsService struct { + s *Service + + Customchannels *AdunitsCustomchannelsService +} + +func NewAdunitsCustomchannelsService(s *Service) *AdunitsCustomchannelsService { + rs := &AdunitsCustomchannelsService{s: s} + return rs +} + +type AdunitsCustomchannelsService struct { + s *Service +} + +func NewAlertsService(s *Service) *AlertsService { + rs := &AlertsService{s: s} + return rs +} + +type AlertsService struct { + s *Service +} + +func NewCustomchannelsService(s *Service) *CustomchannelsService { + rs := &CustomchannelsService{s: s} + rs.Adunits = NewCustomchannelsAdunitsService(s) + return rs +} + +type CustomchannelsService struct { + s *Service + + Adunits *CustomchannelsAdunitsService +} + +func NewCustomchannelsAdunitsService(s *Service) *CustomchannelsAdunitsService { + rs := &CustomchannelsAdunitsService{s: s} + return rs +} + +type CustomchannelsAdunitsService struct { + s *Service +} + +func NewMetadataService(s *Service) *MetadataService { + rs := &MetadataService{s: s} + rs.Dimensions = NewMetadataDimensionsService(s) + rs.Metrics = NewMetadataMetricsService(s) + return rs +} + +type MetadataService struct { + s *Service + + Dimensions *MetadataDimensionsService + + Metrics *MetadataMetricsService +} + +func NewMetadataDimensionsService(s *Service) *MetadataDimensionsService { + rs := &MetadataDimensionsService{s: s} + return rs +} + +type MetadataDimensionsService struct { + s *Service +} + +func NewMetadataMetricsService(s *Service) *MetadataMetricsService { + rs := &MetadataMetricsService{s: s} + return rs +} + +type MetadataMetricsService struct { + s *Service +} + +func NewPaymentsService(s *Service) *PaymentsService { + rs := &PaymentsService{s: s} + return rs +} + +type PaymentsService struct { + s *Service +} + +func NewReportsService(s *Service) *ReportsService { + rs := &ReportsService{s: s} + rs.Saved = NewReportsSavedService(s) + return rs +} + +type ReportsService struct { + s *Service + + Saved *ReportsSavedService +} + +func NewReportsSavedService(s *Service) *ReportsSavedService { + rs := &ReportsSavedService{s: s} + return rs +} + +type ReportsSavedService struct { + s *Service +} + +func NewSavedadstylesService(s *Service) *SavedadstylesService { + rs := &SavedadstylesService{s: s} + return rs +} + +type SavedadstylesService struct { + s *Service +} + +func NewUrlchannelsService(s *Service) *UrlchannelsService { + rs := &UrlchannelsService{s: s} + return rs +} + +type UrlchannelsService struct { + s *Service +} + +type Account struct { + // Id: Unique identifier of this account. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#account. + Kind string `json:"kind,omitempty"` + + // Name: Name of this account. + Name string `json:"name,omitempty"` + + // Premium: Whether this account is premium. + Premium bool `json:"premium,omitempty"` + + // SubAccounts: Sub accounts of the this account. + SubAccounts []*Account `json:"subAccounts,omitempty"` + + // Timezone: AdSense timezone of this account. + Timezone string `json:"timezone,omitempty"` +} + +type Accounts struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The accounts returned in this list response. + Items []*Account `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#accounts. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through accounts. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AdClient struct { + // ArcOptIn: Whether this ad client is opted in to ARC. + ArcOptIn bool `json:"arcOptIn,omitempty"` + + // ArcReviewMode: ARC review mode this ad client is in. Empty if the + // client is not opted in to ARC. Possible values: POST_REVIEW, + // AUTOMATIC_PRE_REVIEW. + ArcReviewMode string `json:"arcReviewMode,omitempty"` + + // Id: Unique identifier of this ad client. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#adClient. + Kind string `json:"kind,omitempty"` + + // ProductCode: This ad client's product code, which corresponds to the + // PRODUCT_CODE report dimension. + ProductCode string `json:"productCode,omitempty"` + + // SupportsReporting: Whether this ad client supports being reported on. + SupportsReporting bool `json:"supportsReporting,omitempty"` +} + +type AdClients struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The ad clients returned in this list response. + Items []*AdClient `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#adClients. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad clients. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AdCode struct { + // AdCode: The ad code snippet. + AdCode string `json:"adCode,omitempty"` + + // Kind: Kind this is, in this case adsense#adCode. + Kind string `json:"kind,omitempty"` +} + +type AdStyle struct { + // Colors: The colors which are included in the style. These are + // represented as six hexadecimal characters, similar to HTML color + // codes, but without the leading hash. + Colors *AdStyleColors `json:"colors,omitempty"` + + // Corners: The style of the corners in the ad. + Corners string `json:"corners,omitempty"` + + // Font: The font which is included in the style. + Font *AdStyleFont `json:"font,omitempty"` + + // Kind: Kind this is, in this case adsense#adStyle. + Kind string `json:"kind,omitempty"` +} + +type AdStyleColors struct { + // Background: The color of the ad background. + Background string `json:"background,omitempty"` + + // Border: The color of the ad border. + Border string `json:"border,omitempty"` + + // Text: The color of the ad text. + Text string `json:"text,omitempty"` + + // Title: The color of the ad title. + Title string `json:"title,omitempty"` + + // Url: The color of the ad url. + Url string `json:"url,omitempty"` +} + +type AdStyleFont struct { + // Family: The family of the font. + Family string `json:"family,omitempty"` + + // Size: The size of the font. + Size string `json:"size,omitempty"` +} + +type AdUnit struct { + // Code: Identity code of this ad unit, not necessarily unique across ad + // clients. + Code string `json:"code,omitempty"` + + // ContentAdsSettings: Settings specific to content ads (AFC) and + // highend mobile content ads (AFMC). + ContentAdsSettings *AdUnitContentAdsSettings `json:"contentAdsSettings,omitempty"` + + // CustomStyle: Custom style information specific to this ad unit. + CustomStyle *AdStyle `json:"customStyle,omitempty"` + + // FeedAdsSettings: Settings specific to feed ads (AFF). + FeedAdsSettings *AdUnitFeedAdsSettings `json:"feedAdsSettings,omitempty"` + + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#adUnit. + Kind string `json:"kind,omitempty"` + + // MobileContentAdsSettings: Settings specific to WAP mobile content ads + // (AFMC). + MobileContentAdsSettings *AdUnitMobileContentAdsSettings `json:"mobileContentAdsSettings,omitempty"` + + // Name: Name of this ad unit. + Name string `json:"name,omitempty"` + + // SavedStyleId: ID of the saved ad style which holds this ad unit's + // style information. + SavedStyleId string `json:"savedStyleId,omitempty"` + + // Status: Status of this ad unit. Possible values are: + // NEW: Indicates + // that the ad unit was created within the last seven days and does not + // yet have any activity associated with it. + // + // ACTIVE: Indicates that + // there has been activity on this ad unit in the last seven + // days. + // + // INACTIVE: Indicates that there has been no activity on this ad + // unit in the last seven days. + Status string `json:"status,omitempty"` +} + +type AdUnitContentAdsSettings struct { + // BackupOption: The backup option to be used in instances where no ad + // is available. + BackupOption *AdUnitContentAdsSettingsBackupOption `json:"backupOption,omitempty"` + + // Size: Size of this ad unit. + Size string `json:"size,omitempty"` + + // Type: Type of this ad unit. + Type string `json:"type,omitempty"` +} + +type AdUnitContentAdsSettingsBackupOption struct { + // Color: Color to use when type is set to COLOR. + Color string `json:"color,omitempty"` + + // Type: Type of the backup option. Possible values are BLANK, COLOR and + // URL. + Type string `json:"type,omitempty"` + + // Url: URL to use when type is set to URL. + Url string `json:"url,omitempty"` +} + +type AdUnitFeedAdsSettings struct { + // AdPosition: The position of the ads relative to the feed entries. + AdPosition string `json:"adPosition,omitempty"` + + // Frequency: The frequency at which ads should appear in the feed (i.e. + // every N entries). + Frequency int64 `json:"frequency,omitempty"` + + // MinimumWordCount: The minimum length an entry should be in order to + // have attached ads. + MinimumWordCount int64 `json:"minimumWordCount,omitempty"` + + // Type: The type of ads which should appear. + Type string `json:"type,omitempty"` +} + +type AdUnitMobileContentAdsSettings struct { + // MarkupLanguage: The markup language to use for this ad unit. + MarkupLanguage string `json:"markupLanguage,omitempty"` + + // ScriptingLanguage: The scripting language to use for this ad unit. + ScriptingLanguage string `json:"scriptingLanguage,omitempty"` + + // Size: Size of this ad unit. + Size string `json:"size,omitempty"` + + // Type: Type of this ad unit. + Type string `json:"type,omitempty"` +} + +type AdUnits struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The ad units returned in this list response. + Items []*AdUnit `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#adUnits. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad units. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AdsenseReportsGenerateResponse struct { + // Averages: The averages of the report. This is the same length as any + // other row in the report; cells corresponding to dimension columns are + // empty. + Averages []string `json:"averages,omitempty"` + + // EndDate: The requested end date in yyyy-mm-dd format. + EndDate string `json:"endDate,omitempty"` + + // Headers: 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. + Headers []*AdsenseReportsGenerateResponseHeaders `json:"headers,omitempty"` + + // Kind: Kind this is, in this case adsense#report. + Kind string `json:"kind,omitempty"` + + // Rows: 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. + Rows [][]string `json:"rows,omitempty"` + + // StartDate: The requested start date in yyyy-mm-dd format. + StartDate string `json:"startDate,omitempty"` + + // TotalMatchedRows: 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. + TotalMatchedRows int64 `json:"totalMatchedRows,omitempty,string"` + + // Totals: The totals of the report. This is the same length as any + // other row in the report; cells corresponding to dimension columns are + // empty. + Totals []string `json:"totals,omitempty"` + + // Warnings: Any warnings associated with generation of the report. + Warnings []string `json:"warnings,omitempty"` +} + +type AdsenseReportsGenerateResponseHeaders struct { + // Currency: The currency of this column. Only present if the header + // type is METRIC_CURRENCY. + Currency string `json:"currency,omitempty"` + + // Name: The name of the header. + Name string `json:"name,omitempty"` + + // Type: The type of the header; one of DIMENSION, METRIC_TALLY, + // METRIC_RATIO, or METRIC_CURRENCY. + Type string `json:"type,omitempty"` +} + +type Alert struct { + // Id: Unique identifier of this alert. This should be considered an + // opaque identifier; it is not safe to rely on it being in any + // particular format. + Id string `json:"id,omitempty"` + + // IsDismissible: Whether this alert can be dismissed. + IsDismissible bool `json:"isDismissible,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#alert. + Kind string `json:"kind,omitempty"` + + // Message: The localized alert message. + Message string `json:"message,omitempty"` + + // Severity: Severity of this alert. Possible values: INFO, WARNING, + // SEVERE. + Severity string `json:"severity,omitempty"` + + // Type: Type of this alert. Possible values: SELF_HOLD, + // MIGRATED_TO_BILLING3, ADDRESS_PIN_VERIFICATION, + // PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, GRAYLISTED_PUBLISHER, + // API_HOLD. + Type string `json:"type,omitempty"` +} + +type Alerts struct { + // Items: The alerts returned in this list response. + Items []*Alert `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#alerts. + Kind string `json:"kind,omitempty"` +} + +type CustomChannel struct { + // Code: Code of this custom channel, not necessarily unique across ad + // clients. + Code string `json:"code,omitempty"` + + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#customChannel. + Kind string `json:"kind,omitempty"` + + // Name: Name of this custom channel. + Name string `json:"name,omitempty"` + + // TargetingInfo: The targeting information of this custom channel, if + // activated. + TargetingInfo *CustomChannelTargetingInfo `json:"targetingInfo,omitempty"` +} + +type CustomChannelTargetingInfo struct { + // AdsAppearOn: The name used to describe this channel externally. + AdsAppearOn string `json:"adsAppearOn,omitempty"` + + // Description: The external description of the channel. + Description string `json:"description,omitempty"` + + // Location: 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. + Location string `json:"location,omitempty"` + + // SiteLanguage: The language of the sites ads will be displayed on. + SiteLanguage string `json:"siteLanguage,omitempty"` +} + +type CustomChannels struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The custom channels returned in this list response. + Items []*CustomChannel `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#customChannels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through custom + // channels. To retrieve the next page of results, set the next + // request's "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Metadata struct { + Items []*ReportingMetadataEntry `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#metadata. + Kind string `json:"kind,omitempty"` +} + +type Payment struct { + // Id: Unique identifier of this Payment. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#payment. + Kind string `json:"kind,omitempty"` + + // PaymentAmount: The amount to be paid. + PaymentAmount string `json:"paymentAmount,omitempty"` + + // PaymentAmountCurrencyCode: The currency code for the amount to be + // paid. + PaymentAmountCurrencyCode string `json:"paymentAmountCurrencyCode,omitempty"` + + // PaymentDate: The date this payment was/will be credited to the user, + // or none if the payment threshold has not been met. + PaymentDate string `json:"paymentDate,omitempty"` +} + +type Payments struct { + // Items: The list of Payments for the account. One or both of a) the + // account's most recent payment; and b) the account's upcoming payment. + Items []*Payment `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#payments. + Kind string `json:"kind,omitempty"` +} + +type ReportingMetadataEntry struct { + // CompatibleDimensions: For metrics this is a list of dimension IDs + // which the metric is compatible with, for dimensions it is a list of + // compatibility groups the dimension belongs to. + CompatibleDimensions []string `json:"compatibleDimensions,omitempty"` + + // CompatibleMetrics: The names of the metrics the dimension or metric + // this reporting metadata entry describes is compatible with. + CompatibleMetrics []string `json:"compatibleMetrics,omitempty"` + + // Id: Unique identifier of this reporting metadata entry, corresponding + // to the name of the appropriate dimension or metric. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case + // adsense#reportingMetadataEntry. + Kind string `json:"kind,omitempty"` + + // RequiredDimensions: The names of the dimensions which the dimension + // or metric this reporting metadata entry describes requires to also be + // present in order for the report to be valid. Omitting these will not + // cause an error or warning, but may result in data which cannot be + // correctly interpreted. + RequiredDimensions []string `json:"requiredDimensions,omitempty"` + + // RequiredMetrics: The names of the metrics which the dimension or + // metric this reporting metadata entry describes requires to also be + // present in order for the report to be valid. Omitting these will not + // cause an error or warning, but may result in data which cannot be + // correctly interpreted. + RequiredMetrics []string `json:"requiredMetrics,omitempty"` + + // SupportedProducts: The codes of the projects supported by the + // dimension or metric this reporting metadata entry describes. + SupportedProducts []string `json:"supportedProducts,omitempty"` +} + +type SavedAdStyle struct { + // AdStyle: The AdStyle itself. + AdStyle *AdStyle `json:"adStyle,omitempty"` + + // Id: Unique identifier of this saved ad style. This should be + // considered an opaque identifier; it is not safe to rely on it being + // in any particular format. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#savedAdStyle. + Kind string `json:"kind,omitempty"` + + // Name: The user selected name of this SavedAdStyle. + Name string `json:"name,omitempty"` +} + +type SavedAdStyles struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The saved ad styles returned in this list response. + Items []*SavedAdStyle `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#savedAdStyles. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad units. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type SavedReport struct { + // Id: Unique identifier of this saved report. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#savedReport. + Kind string `json:"kind,omitempty"` + + // Name: This saved report's name. + Name string `json:"name,omitempty"` +} + +type SavedReports struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The saved reports returned in this list response. + Items []*SavedReport `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#savedReports. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through saved reports. + // To retrieve the next page of results, set the next request's + // "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type UrlChannel struct { + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#urlChannel. + Kind string `json:"kind,omitempty"` + + // UrlPattern: URL Pattern of this URL channel. Does not include + // "http://" or "https://". Example: www.example.com/home + UrlPattern string `json:"urlPattern,omitempty"` +} + +type UrlChannels struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The URL channels returned in this list response. + Items []*UrlChannel `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#urlChannels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through URL channels. + // To retrieve the next page of results, set the next request's + // "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +// method id "adsense.accounts.get": + +type AccountsGetCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// Get: Get information about the selected AdSense account. +func (r *AccountsService) Get(accountId string) *AccountsGetCall { + c := &AccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// Tree sets the optional parameter "tree": Whether the tree of sub +// accounts should be returned. +func (c *AccountsGetCall) Tree(tree bool) *AccountsGetCall { + c.opt_["tree"] = tree + return c +} + +func (c *AccountsGetCall) Do() (*Account, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["tree"]; ok { + params.Set("tree", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get information about the selected AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.get", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to get information about.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tree": { + // "description": "Whether the tree of sub accounts should be returned.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "accounts/{accountId}", + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.list": + +type AccountsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all accounts available to this AdSense account. +func (r *AccountsService) List() *AccountsListCall { + c := &AccountsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of accounts to include in the response, used for paging. +func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token, used to page through accounts. To retrieve the next page, set +// this parameter to the value of "nextPageToken" from the previous +// response. +func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsListCall) Do() (*Accounts, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Accounts) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all accounts available to this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of accounts to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "accounts", + // "response": { + // "$ref": "Accounts" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.adclients.list": + +type AccountsAdclientsListCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// List: List all ad clients in the specified account. +func (r *AccountsAdclientsService) List(accountId string) *AccountsAdclientsListCall { + c := &AccountsAdclientsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad clients to include in the response, used for paging. +func (c *AccountsAdclientsListCall) MaxResults(maxResults int64) *AccountsAdclientsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsAdclientsListCall) PageToken(pageToken string) *AccountsAdclientsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsAdclientsListCall) Do() (*AdClients, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdClients) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad clients in the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.adclients.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account for which to list ad clients.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of ad clients to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients", + // "response": { + // "$ref": "AdClients" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.adunits.get": + +type AccountsAdunitsGetCall struct { + s *Service + accountId string + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// Get: Gets the specified ad unit in the specified ad client for the +// specified account. +func (r *AccountsAdunitsService) Get(accountId string, adClientId string, adUnitId string) *AccountsAdunitsGetCall { + c := &AccountsAdunitsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +func (c *AccountsAdunitsGetCall) Do() (*AdUnit, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified ad unit in the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.adunits.get", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to get the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}", + // "response": { + // "$ref": "AdUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.adunits.getAdCode": + +type AccountsAdunitsGetAdCodeCall struct { + s *Service + accountId string + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// GetAdCode: Get ad code for the specified ad unit. +func (r *AccountsAdunitsService) GetAdCode(accountId string, adClientId string, adUnitId string) *AccountsAdunitsGetAdCodeCall { + c := &AccountsAdunitsGetAdCodeCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +func (c *AccountsAdunitsGetAdCodeCall) Do() (*AdCode, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdCode) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get ad code for the specified ad unit.", + // "httpMethod": "GET", + // "id": "adsense.accounts.adunits.getAdCode", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account which contains the ad client.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client with contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit to get the code for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode", + // "response": { + // "$ref": "AdCode" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.adunits.list": + +type AccountsAdunitsListCall struct { + s *Service + accountId string + adClientId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified ad client for the specified +// account. +func (r *AccountsAdunitsService) List(accountId string, adClientId string) *AccountsAdunitsListCall { + c := &AccountsAdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *AccountsAdunitsListCall) IncludeInactive(includeInactive bool) *AccountsAdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *AccountsAdunitsListCall) MaxResults(maxResults int64) *AccountsAdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsAdunitsListCall) PageToken(pageToken string) *AccountsAdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsAdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.adunits.list", + // "parameterOrder": [ + // "accountId", + // "adClientId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.adunits.customchannels.list": + +type AccountsAdunitsCustomchannelsListCall struct { + s *Service + accountId string + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// List: List all custom channels which the specified ad unit belongs +// to. +func (r *AccountsAdunitsCustomchannelsService) List(accountId string, adClientId string, adUnitId string) *AccountsAdunitsCustomchannelsListCall { + c := &AccountsAdunitsCustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *AccountsAdunitsCustomchannelsListCall) MaxResults(maxResults int64) *AccountsAdunitsCustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsAdunitsCustomchannelsListCall) PageToken(pageToken string) *AccountsAdunitsCustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsAdunitsCustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels which the specified ad unit belongs to.", + // "httpMethod": "GET", + // "id": "adsense.accounts.adunits.customchannels.list", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client which contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.alerts.delete": + +type AccountsAlertsDeleteCall struct { + s *Service + accountId string + alertId string + opt_ map[string]interface{} +} + +// Delete: Dismiss (delete) the specified alert from the specified +// publisher AdSense account. +func (r *AccountsAlertsService) Delete(accountId string, alertId string) *AccountsAlertsDeleteCall { + c := &AccountsAlertsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.alertId = alertId + return c +} + +func (c *AccountsAlertsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/alerts/{alertId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{alertId}", url.QueryEscape(c.alertId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Dismiss (delete) the specified alert from the specified publisher AdSense account.", + // "httpMethod": "DELETE", + // "id": "adsense.accounts.alerts.delete", + // "parameterOrder": [ + // "accountId", + // "alertId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account which contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "alertId": { + // "description": "Alert to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/alerts/{alertId}", + // "scopes": [ + // "https://www.googleapis.com/auth/adsense" + // ] + // } + +} + +// method id "adsense.accounts.alerts.list": + +type AccountsAlertsListCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// List: List the alerts for the specified AdSense account. +func (r *AccountsAlertsService) List(accountId string) *AccountsAlertsListCall { + c := &AccountsAlertsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// Locale sets the optional parameter "locale": The locale to use for +// translating alert messages. The account locale will be used if this +// is not supplied. The AdSense default (English) will be used if the +// supplied locale is invalid or unsupported. +func (c *AccountsAlertsListCall) Locale(locale string) *AccountsAlertsListCall { + c.opt_["locale"] = locale + return c +} + +func (c *AccountsAlertsListCall) Do() (*Alerts, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/alerts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Alerts) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the alerts for the specified AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.alerts.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account for which to retrieve the alerts.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "locale": { + // "description": "The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/alerts", + // "response": { + // "$ref": "Alerts" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.customchannels.get": + +type AccountsCustomchannelsGetCall struct { + s *Service + accountId string + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// Get: Get the specified custom channel from the specified ad client +// for the specified account. +func (r *AccountsCustomchannelsService) Get(accountId string, adClientId string, customChannelId string) *AccountsCustomchannelsGetCall { + c := &AccountsCustomchannelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +func (c *AccountsCustomchannelsGetCall) Do() (*CustomChannel, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the specified custom channel from the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.customchannels.get", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}", + // "response": { + // "$ref": "CustomChannel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.customchannels.list": + +type AccountsCustomchannelsListCall struct { + s *Service + accountId string + adClientId string + opt_ map[string]interface{} +} + +// List: List all custom channels in the specified ad client for the +// specified account. +func (r *AccountsCustomchannelsService) List(accountId string, adClientId string) *AccountsCustomchannelsListCall { + c := &AccountsCustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *AccountsCustomchannelsListCall) MaxResults(maxResults int64) *AccountsCustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsCustomchannelsListCall) PageToken(pageToken string) *AccountsCustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsCustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels in the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.customchannels.list", + // "parameterOrder": [ + // "accountId", + // "adClientId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.customchannels.adunits.list": + +type AccountsCustomchannelsAdunitsListCall struct { + s *Service + accountId string + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified custom channel. +func (r *AccountsCustomchannelsAdunitsService) List(accountId string, adClientId string, customChannelId string) *AccountsCustomchannelsAdunitsListCall { + c := &AccountsCustomchannelsAdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *AccountsCustomchannelsAdunitsListCall) IncludeInactive(includeInactive bool) *AccountsCustomchannelsAdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *AccountsCustomchannelsAdunitsListCall) MaxResults(maxResults int64) *AccountsCustomchannelsAdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsCustomchannelsAdunitsListCall) PageToken(pageToken string) *AccountsCustomchannelsAdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsCustomchannelsAdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified custom channel.", + // "httpMethod": "GET", + // "id": "adsense.accounts.customchannels.adunits.list", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.payments.list": + +type AccountsPaymentsListCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// List: List the payments for the specified AdSense account. +func (r *AccountsPaymentsService) List(accountId string) *AccountsPaymentsListCall { + c := &AccountsPaymentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +func (c *AccountsPaymentsListCall) Do() (*Payments, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/payments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Payments) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the payments for the specified AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.payments.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account for which to retrieve the payments.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/payments", + // "response": { + // "$ref": "Payments" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.reports.generate": + +type AccountsReportsGenerateCall struct { + s *Service + accountId string + startDate string + endDate string + opt_ map[string]interface{} +} + +// Generate: Generate an AdSense 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. +func (r *AccountsReportsService) Generate(accountId string, startDate string, endDate string) *AccountsReportsGenerateCall { + c := &AccountsReportsGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.startDate = startDate + c.endDate = endDate + return c +} + +// Currency sets the optional parameter "currency": Optional currency to +// use when reporting on monetary metrics. Defaults to the account's +// currency if not set. +func (c *AccountsReportsGenerateCall) Currency(currency string) *AccountsReportsGenerateCall { + c.opt_["currency"] = currency + return c +} + +// Dimension sets the optional parameter "dimension": Dimensions to base +// the report on. +func (c *AccountsReportsGenerateCall) Dimension(dimension string) *AccountsReportsGenerateCall { + c.opt_["dimension"] = dimension + return c +} + +// Filter sets the optional parameter "filter": Filters to be run on the +// report. +func (c *AccountsReportsGenerateCall) Filter(filter string) *AccountsReportsGenerateCall { + c.opt_["filter"] = filter + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *AccountsReportsGenerateCall) Locale(locale string) *AccountsReportsGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *AccountsReportsGenerateCall) MaxResults(maxResults int64) *AccountsReportsGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Metric sets the optional parameter "metric": Numeric columns to +// include in the report. +func (c *AccountsReportsGenerateCall) Metric(metric string) *AccountsReportsGenerateCall { + c.opt_["metric"] = metric + return c +} + +// Sort sets the optional parameter "sort": 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. +func (c *AccountsReportsGenerateCall) Sort(sort string) *AccountsReportsGenerateCall { + c.opt_["sort"] = sort + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *AccountsReportsGenerateCall) StartIndex(startIndex int64) *AccountsReportsGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +// UseTimezoneReporting sets the optional parameter +// "useTimezoneReporting": Whether the report should be generated in the +// AdSense account's local timezone. If false default PST/PDT timezone +// will be used. +func (c *AccountsReportsGenerateCall) UseTimezoneReporting(useTimezoneReporting bool) *AccountsReportsGenerateCall { + c.opt_["useTimezoneReporting"] = useTimezoneReporting + return c +} + +func (c *AccountsReportsGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("endDate", fmt.Sprintf("%v", c.endDate)) + params.Set("startDate", fmt.Sprintf("%v", c.startDate)) + if v, ok := c.opt_["currency"]; ok { + params.Set("currency", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dimension"]; ok { + params.Set("dimension", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["metric"]; ok { + params.Set("metric", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["useTimezoneReporting"]; ok { + params.Set("useTimezoneReporting", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdsenseReportsGenerateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an AdSense 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.", + // "httpMethod": "GET", + // "id": "adsense.accounts.reports.generate", + // "parameterOrder": [ + // "accountId", + // "startDate", + // "endDate" + // ], + // "parameters": { + // "accountId": { + // "description": "Account upon which to report.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "currency": { + // "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.", + // "location": "query", + // "pattern": "[a-zA-Z]+", + // "type": "string" + // }, + // "dimension": { + // "description": "Dimensions to base the report on.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "endDate": { + // "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)|(latest-(\\d{2})-(\\d{2})(-\\d+y)?)|(latest-latest-(\\d{2})(-\\d+m)?)", + // "required": true, + // "type": "string" + // }, + // "filter": { + // "description": "Filters to be run on the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+(==|=@).+", + // "repeated": true, + // "type": "string" + // }, + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "metric": { + // "description": "Numeric columns to include in the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "sort": { + // "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.", + // "location": "query", + // "pattern": "(\\+|-)?[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "startDate": { + // "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)|(latest-(\\d{2})-(\\d{2})(-\\d+y)?)|(latest-latest-(\\d{2})(-\\d+m)?)", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // }, + // "useTimezoneReporting": { + // "description": "Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "accounts/{accountId}/reports", + // "response": { + // "$ref": "AdsenseReportsGenerateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "adsense.accounts.reports.saved.generate": + +type AccountsReportsSavedGenerateCall struct { + s *Service + accountId string + savedReportId string + opt_ map[string]interface{} +} + +// Generate: Generate an AdSense report based on the saved report ID +// sent in the query parameters. +func (r *AccountsReportsSavedService) Generate(accountId string, savedReportId string) *AccountsReportsSavedGenerateCall { + c := &AccountsReportsSavedGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.savedReportId = savedReportId + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *AccountsReportsSavedGenerateCall) Locale(locale string) *AccountsReportsSavedGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *AccountsReportsSavedGenerateCall) MaxResults(maxResults int64) *AccountsReportsSavedGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *AccountsReportsSavedGenerateCall) StartIndex(startIndex int64) *AccountsReportsSavedGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *AccountsReportsSavedGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/{savedReportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{savedReportId}", url.QueryEscape(c.savedReportId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdsenseReportsGenerateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an AdSense report based on the saved report ID sent in the query parameters.", + // "httpMethod": "GET", + // "id": "adsense.accounts.reports.saved.generate", + // "parameterOrder": [ + // "accountId", + // "savedReportId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the saved reports belong.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "savedReportId": { + // "description": "The saved report to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "accounts/{accountId}/reports/{savedReportId}", + // "response": { + // "$ref": "AdsenseReportsGenerateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.reports.saved.list": + +type AccountsReportsSavedListCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// List: List all saved reports in the specified AdSense account. +func (r *AccountsReportsSavedService) List(accountId string) *AccountsReportsSavedListCall { + c := &AccountsReportsSavedListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of saved reports to include in the response, used for paging. +func (c *AccountsReportsSavedListCall) MaxResults(maxResults int64) *AccountsReportsSavedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsReportsSavedListCall) PageToken(pageToken string) *AccountsReportsSavedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsReportsSavedListCall) Do() (*SavedReports, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/saved") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedReports) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all saved reports in the specified AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.reports.saved.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the saved reports belong.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of saved reports to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/reports/saved", + // "response": { + // "$ref": "SavedReports" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.savedadstyles.get": + +type AccountsSavedadstylesGetCall struct { + s *Service + accountId string + savedAdStyleId string + opt_ map[string]interface{} +} + +// Get: List a specific saved ad style for the specified account. +func (r *AccountsSavedadstylesService) Get(accountId string, savedAdStyleId string) *AccountsSavedadstylesGetCall { + c := &AccountsSavedadstylesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.savedAdStyleId = savedAdStyleId + return c +} + +func (c *AccountsSavedadstylesGetCall) Do() (*SavedAdStyle, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/savedadstyles/{savedAdStyleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{savedAdStyleId}", url.QueryEscape(c.savedAdStyleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedAdStyle) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List a specific saved ad style for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.savedadstyles.get", + // "parameterOrder": [ + // "accountId", + // "savedAdStyleId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account for which to get the saved ad style.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "savedAdStyleId": { + // "description": "Saved ad style to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/savedadstyles/{savedAdStyleId}", + // "response": { + // "$ref": "SavedAdStyle" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.savedadstyles.list": + +type AccountsSavedadstylesListCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// List: List all saved ad styles in the specified account. +func (r *AccountsSavedadstylesService) List(accountId string) *AccountsSavedadstylesListCall { + c := &AccountsSavedadstylesListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of saved ad styles to include in the response, used for +// paging. +func (c *AccountsSavedadstylesListCall) MaxResults(maxResults int64) *AccountsSavedadstylesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token, used to page through saved ad styles. To retrieve the next +// page, set this parameter to the value of "nextPageToken" from the +// previous response. +func (c *AccountsSavedadstylesListCall) PageToken(pageToken string) *AccountsSavedadstylesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsSavedadstylesListCall) Do() (*SavedAdStyles, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/savedadstyles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedAdStyles) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all saved ad styles in the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.savedadstyles.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account for which to list saved ad styles.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of saved ad styles to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/savedadstyles", + // "response": { + // "$ref": "SavedAdStyles" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.accounts.urlchannels.list": + +type AccountsUrlchannelsListCall struct { + s *Service + accountId string + adClientId string + opt_ map[string]interface{} +} + +// List: List all URL channels in the specified ad client for the +// specified account. +func (r *AccountsUrlchannelsService) List(accountId string, adClientId string) *AccountsUrlchannelsListCall { + c := &AccountsUrlchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of URL channels to include in the response, used for paging. +func (c *AccountsUrlchannelsListCall) MaxResults(maxResults int64) *AccountsUrlchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsUrlchannelsListCall) PageToken(pageToken string) *AccountsUrlchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsUrlchannelsListCall) Do() (*UrlChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UrlChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all URL channels in the specified ad client for the specified account.", + // "httpMethod": "GET", + // "id": "adsense.accounts.urlchannels.list", + // "parameterOrder": [ + // "accountId", + // "adClientId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to list URL channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of URL channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/urlchannels", + // "response": { + // "$ref": "UrlChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adclients.list": + +type AdclientsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all ad clients in this AdSense account. +func (r *AdclientsService) List() *AdclientsListCall { + c := &AdclientsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad clients to include in the response, used for paging. +func (c *AdclientsListCall) MaxResults(maxResults int64) *AdclientsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdclientsListCall) PageToken(pageToken string) *AdclientsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdclientsListCall) Do() (*AdClients, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdClients) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad clients in this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.adclients.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of ad clients to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "adclients", + // "response": { + // "$ref": "AdClients" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adunits.get": + +type AdunitsGetCall struct { + s *Service + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// Get: Gets the specified ad unit in the specified ad client. +func (r *AdunitsService) Get(adClientId string, adUnitId string) *AdunitsGetCall { + c := &AdunitsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +func (c *AdunitsGetCall) Do() (*AdUnit, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified ad unit in the specified ad client.", + // "httpMethod": "GET", + // "id": "adsense.adunits.get", + // "parameterOrder": [ + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to get the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits/{adUnitId}", + // "response": { + // "$ref": "AdUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adunits.getAdCode": + +type AdunitsGetAdCodeCall struct { + s *Service + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// GetAdCode: Get ad code for the specified ad unit. +func (r *AdunitsService) GetAdCode(adClientId string, adUnitId string) *AdunitsGetAdCodeCall { + c := &AdunitsGetAdCodeCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +func (c *AdunitsGetAdCodeCall) Do() (*AdCode, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/adcode") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdCode) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get ad code for the specified ad unit.", + // "httpMethod": "GET", + // "id": "adsense.adunits.getAdCode", + // "parameterOrder": [ + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client with contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit to get the code for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits/{adUnitId}/adcode", + // "response": { + // "$ref": "AdCode" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adunits.list": + +type AdunitsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified ad client for this AdSense +// account. +func (r *AdunitsService) List(adClientId string) *AdunitsListCall { + c := &AdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *AdunitsListCall) IncludeInactive(includeInactive bool) *AdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *AdunitsListCall) MaxResults(maxResults int64) *AdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdunitsListCall) PageToken(pageToken string) *AdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified ad client for this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.adunits.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adunits.customchannels.list": + +type AdunitsCustomchannelsListCall struct { + s *Service + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// List: List all custom channels which the specified ad unit belongs +// to. +func (r *AdunitsCustomchannelsService) List(adClientId string, adUnitId string) *AdunitsCustomchannelsListCall { + c := &AdunitsCustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *AdunitsCustomchannelsListCall) MaxResults(maxResults int64) *AdunitsCustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdunitsCustomchannelsListCall) PageToken(pageToken string) *AdunitsCustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdunitsCustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels which the specified ad unit belongs to.", + // "httpMethod": "GET", + // "id": "adsense.adunits.customchannels.list", + // "parameterOrder": [ + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client which contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits/{adUnitId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.alerts.delete": + +type AlertsDeleteCall struct { + s *Service + alertId string + opt_ map[string]interface{} +} + +// Delete: Dismiss (delete) the specified alert from the publisher's +// AdSense account. +func (r *AlertsService) Delete(alertId string) *AlertsDeleteCall { + c := &AlertsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.alertId = alertId + return c +} + +func (c *AlertsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "alerts/{alertId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{alertId}", url.QueryEscape(c.alertId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Dismiss (delete) the specified alert from the publisher's AdSense account.", + // "httpMethod": "DELETE", + // "id": "adsense.alerts.delete", + // "parameterOrder": [ + // "alertId" + // ], + // "parameters": { + // "alertId": { + // "description": "Alert to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "alerts/{alertId}", + // "scopes": [ + // "https://www.googleapis.com/auth/adsense" + // ] + // } + +} + +// method id "adsense.alerts.list": + +type AlertsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List the alerts for this AdSense account. +func (r *AlertsService) List() *AlertsListCall { + c := &AlertsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Locale sets the optional parameter "locale": The locale to use for +// translating alert messages. The account locale will be used if this +// is not supplied. The AdSense default (English) will be used if the +// supplied locale is invalid or unsupported. +func (c *AlertsListCall) Locale(locale string) *AlertsListCall { + c.opt_["locale"] = locale + return c +} + +func (c *AlertsListCall) Do() (*Alerts, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "alerts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Alerts) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the alerts for this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.alerts.list", + // "parameters": { + // "locale": { + // "description": "The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "alerts", + // "response": { + // "$ref": "Alerts" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.customchannels.get": + +type CustomchannelsGetCall struct { + s *Service + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// Get: Get the specified custom channel from the specified ad client. +func (r *CustomchannelsService) Get(adClientId string, customChannelId string) *CustomchannelsGetCall { + c := &CustomchannelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +func (c *CustomchannelsGetCall) Do() (*CustomChannel, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the specified custom channel from the specified ad client.", + // "httpMethod": "GET", + // "id": "adsense.customchannels.get", + // "parameterOrder": [ + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels/{customChannelId}", + // "response": { + // "$ref": "CustomChannel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.customchannels.list": + +type CustomchannelsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all custom channels in the specified ad client for this +// AdSense account. +func (r *CustomchannelsService) List(adClientId string) *CustomchannelsListCall { + c := &CustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *CustomchannelsListCall) MaxResults(maxResults int64) *CustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *CustomchannelsListCall) PageToken(pageToken string) *CustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels in the specified ad client for this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.customchannels.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.customchannels.adunits.list": + +type CustomchannelsAdunitsListCall struct { + s *Service + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified custom channel. +func (r *CustomchannelsAdunitsService) List(adClientId string, customChannelId string) *CustomchannelsAdunitsListCall { + c := &CustomchannelsAdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *CustomchannelsAdunitsListCall) IncludeInactive(includeInactive bool) *CustomchannelsAdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *CustomchannelsAdunitsListCall) MaxResults(maxResults int64) *CustomchannelsAdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *CustomchannelsAdunitsListCall) PageToken(pageToken string) *CustomchannelsAdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CustomchannelsAdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified custom channel.", + // "httpMethod": "GET", + // "id": "adsense.customchannels.adunits.list", + // "parameterOrder": [ + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client which contains the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels/{customChannelId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.metadata.dimensions.list": + +type MetadataDimensionsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List the metadata for the dimensions available to this AdSense +// account. +func (r *MetadataDimensionsService) List() *MetadataDimensionsListCall { + c := &MetadataDimensionsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *MetadataDimensionsListCall) Do() (*Metadata, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/dimensions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Metadata) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the metadata for the dimensions available to this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.metadata.dimensions.list", + // "path": "metadata/dimensions", + // "response": { + // "$ref": "Metadata" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.metadata.metrics.list": + +type MetadataMetricsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List the metadata for the metrics available to this AdSense +// account. +func (r *MetadataMetricsService) List() *MetadataMetricsListCall { + c := &MetadataMetricsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *MetadataMetricsListCall) Do() (*Metadata, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/metrics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Metadata) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the metadata for the metrics available to this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.metadata.metrics.list", + // "path": "metadata/metrics", + // "response": { + // "$ref": "Metadata" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.payments.list": + +type PaymentsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List the payments for this AdSense account. +func (r *PaymentsService) List() *PaymentsListCall { + c := &PaymentsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *PaymentsListCall) Do() (*Payments, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "payments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Payments) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the payments for this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.payments.list", + // "path": "payments", + // "response": { + // "$ref": "Payments" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.reports.generate": + +type ReportsGenerateCall struct { + s *Service + startDate string + endDate string + opt_ map[string]interface{} +} + +// Generate: Generate an AdSense 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. +func (r *ReportsService) Generate(startDate string, endDate string) *ReportsGenerateCall { + c := &ReportsGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.startDate = startDate + c.endDate = endDate + return c +} + +// AccountId sets the optional parameter "accountId": Accounts upon +// which to report. +func (c *ReportsGenerateCall) AccountId(accountId string) *ReportsGenerateCall { + c.opt_["accountId"] = accountId + return c +} + +// Currency sets the optional parameter "currency": Optional currency to +// use when reporting on monetary metrics. Defaults to the account's +// currency if not set. +func (c *ReportsGenerateCall) Currency(currency string) *ReportsGenerateCall { + c.opt_["currency"] = currency + return c +} + +// Dimension sets the optional parameter "dimension": Dimensions to base +// the report on. +func (c *ReportsGenerateCall) Dimension(dimension string) *ReportsGenerateCall { + c.opt_["dimension"] = dimension + return c +} + +// Filter sets the optional parameter "filter": Filters to be run on the +// report. +func (c *ReportsGenerateCall) Filter(filter string) *ReportsGenerateCall { + c.opt_["filter"] = filter + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *ReportsGenerateCall) Locale(locale string) *ReportsGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *ReportsGenerateCall) MaxResults(maxResults int64) *ReportsGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Metric sets the optional parameter "metric": Numeric columns to +// include in the report. +func (c *ReportsGenerateCall) Metric(metric string) *ReportsGenerateCall { + c.opt_["metric"] = metric + return c +} + +// Sort sets the optional parameter "sort": 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. +func (c *ReportsGenerateCall) Sort(sort string) *ReportsGenerateCall { + c.opt_["sort"] = sort + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *ReportsGenerateCall) StartIndex(startIndex int64) *ReportsGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +// UseTimezoneReporting sets the optional parameter +// "useTimezoneReporting": Whether the report should be generated in the +// AdSense account's local timezone. If false default PST/PDT timezone +// will be used. +func (c *ReportsGenerateCall) UseTimezoneReporting(useTimezoneReporting bool) *ReportsGenerateCall { + c.opt_["useTimezoneReporting"] = useTimezoneReporting + return c +} + +func (c *ReportsGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("endDate", fmt.Sprintf("%v", c.endDate)) + params.Set("startDate", fmt.Sprintf("%v", c.startDate)) + if v, ok := c.opt_["accountId"]; ok { + params.Set("accountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["currency"]; ok { + params.Set("currency", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dimension"]; ok { + params.Set("dimension", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["metric"]; ok { + params.Set("metric", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["useTimezoneReporting"]; ok { + params.Set("useTimezoneReporting", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdsenseReportsGenerateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an AdSense 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.", + // "httpMethod": "GET", + // "id": "adsense.reports.generate", + // "parameterOrder": [ + // "startDate", + // "endDate" + // ], + // "parameters": { + // "accountId": { + // "description": "Accounts upon which to report.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "currency": { + // "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.", + // "location": "query", + // "pattern": "[a-zA-Z]+", + // "type": "string" + // }, + // "dimension": { + // "description": "Dimensions to base the report on.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "endDate": { + // "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)|(latest-(\\d{2})-(\\d{2})(-\\d+y)?)|(latest-latest-(\\d{2})(-\\d+m)?)", + // "required": true, + // "type": "string" + // }, + // "filter": { + // "description": "Filters to be run on the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+(==|=@).+", + // "repeated": true, + // "type": "string" + // }, + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "metric": { + // "description": "Numeric columns to include in the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "sort": { + // "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.", + // "location": "query", + // "pattern": "(\\+|-)?[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "startDate": { + // "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)|(latest-(\\d{2})-(\\d{2})(-\\d+y)?)|(latest-latest-(\\d{2})(-\\d+m)?)", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // }, + // "useTimezoneReporting": { + // "description": "Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "reports", + // "response": { + // "$ref": "AdsenseReportsGenerateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "adsense.reports.saved.generate": + +type ReportsSavedGenerateCall struct { + s *Service + savedReportId string + opt_ map[string]interface{} +} + +// Generate: Generate an AdSense report based on the saved report ID +// sent in the query parameters. +func (r *ReportsSavedService) Generate(savedReportId string) *ReportsSavedGenerateCall { + c := &ReportsSavedGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.savedReportId = savedReportId + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *ReportsSavedGenerateCall) Locale(locale string) *ReportsSavedGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *ReportsSavedGenerateCall) MaxResults(maxResults int64) *ReportsSavedGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *ReportsSavedGenerateCall) StartIndex(startIndex int64) *ReportsSavedGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *ReportsSavedGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{savedReportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{savedReportId}", url.QueryEscape(c.savedReportId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdsenseReportsGenerateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an AdSense report based on the saved report ID sent in the query parameters.", + // "httpMethod": "GET", + // "id": "adsense.reports.saved.generate", + // "parameterOrder": [ + // "savedReportId" + // ], + // "parameters": { + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "savedReportId": { + // "description": "The saved report to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "reports/{savedReportId}", + // "response": { + // "$ref": "AdsenseReportsGenerateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.reports.saved.list": + +type ReportsSavedListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all saved reports in this AdSense account. +func (r *ReportsSavedService) List() *ReportsSavedListCall { + c := &ReportsSavedListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of saved reports to include in the response, used for paging. +func (c *ReportsSavedListCall) MaxResults(maxResults int64) *ReportsSavedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *ReportsSavedListCall) PageToken(pageToken string) *ReportsSavedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ReportsSavedListCall) Do() (*SavedReports, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/saved") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedReports) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all saved reports in this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.reports.saved.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of saved reports to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "reports/saved", + // "response": { + // "$ref": "SavedReports" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.savedadstyles.get": + +type SavedadstylesGetCall struct { + s *Service + savedAdStyleId string + opt_ map[string]interface{} +} + +// Get: Get a specific saved ad style from the user's account. +func (r *SavedadstylesService) Get(savedAdStyleId string) *SavedadstylesGetCall { + c := &SavedadstylesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.savedAdStyleId = savedAdStyleId + return c +} + +func (c *SavedadstylesGetCall) Do() (*SavedAdStyle, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "savedadstyles/{savedAdStyleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{savedAdStyleId}", url.QueryEscape(c.savedAdStyleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedAdStyle) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a specific saved ad style from the user's account.", + // "httpMethod": "GET", + // "id": "adsense.savedadstyles.get", + // "parameterOrder": [ + // "savedAdStyleId" + // ], + // "parameters": { + // "savedAdStyleId": { + // "description": "Saved ad style to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "savedadstyles/{savedAdStyleId}", + // "response": { + // "$ref": "SavedAdStyle" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.savedadstyles.list": + +type SavedadstylesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all saved ad styles in the user's account. +func (r *SavedadstylesService) List() *SavedadstylesListCall { + c := &SavedadstylesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of saved ad styles to include in the response, used for +// paging. +func (c *SavedadstylesListCall) MaxResults(maxResults int64) *SavedadstylesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token, used to page through saved ad styles. To retrieve the next +// page, set this parameter to the value of "nextPageToken" from the +// previous response. +func (c *SavedadstylesListCall) PageToken(pageToken string) *SavedadstylesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *SavedadstylesListCall) Do() (*SavedAdStyles, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "savedadstyles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SavedAdStyles) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all saved ad styles in the user's account.", + // "httpMethod": "GET", + // "id": "adsense.savedadstyles.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of saved ad styles to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "savedadstyles", + // "response": { + // "$ref": "SavedAdStyles" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.urlchannels.list": + +type UrlchannelsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all URL channels in the specified ad client for this +// AdSense account. +func (r *UrlchannelsService) List(adClientId string) *UrlchannelsListCall { + c := &UrlchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of URL channels to include in the response, used for paging. +func (c *UrlchannelsListCall) MaxResults(maxResults int64) *UrlchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *UrlchannelsListCall) PageToken(pageToken string) *UrlchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *UrlchannelsListCall) Do() (*UrlChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UrlChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all URL channels in the specified ad client for this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.urlchannels.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list URL channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of URL channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/urlchannels", + // "response": { + // "$ref": "UrlChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adsense/v1/adsense-api.json b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1/adsense-api.json new file mode 100644 index 0000000000000..a49d835699563 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1/adsense-api.json @@ -0,0 +1,605 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"BgGnx7p-6wsAbOn4St99QhtBGbA/dDvqGV6BmrzgyC9htm-_zFD2_ME\"", + "discoveryVersion": "v1", + "id": "adsense:v1", + "name": "adsense", + "canonicalName": "AdSense", + "version": "v1", + "revision": "20130712", + "title": "AdSense Management API", + "description": "Gives AdSense publishers access to their inventory and the ability to generate reports", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/adsense-16.png", + "x32": "http://www.google.com/images/icons/product/adsense-32.png" + }, + "documentationLink": "https://developers.google.com/adsense/management/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/adsense/v1/", + "basePath": "/adsense/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "adsense/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/adsense": { + "description": "View and manage your AdSense data" + }, + "https://www.googleapis.com/auth/adsense.readonly": { + "description": "View your AdSense data" + } + } + } + }, + "schemas": { + "AdClient": { + "id": "AdClient", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of this ad client." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adsense#adClient.", + "default": "adsense#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 adsense#adClients.", + "default": "adsense#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 adsense#adUnit.", + "default": "adsense#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 adsense#adUnits.", + "default": "adsense#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." + } + } + }, + "AdsenseReportsGenerateResponse": { + "id": "AdsenseReportsGenerateResponse", + "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 adsense#report.", + "default": "adsense#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" + } + } + } + }, + "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 adsense#customChannel.", + "default": "adsense#customChannel" + }, + "name": { + "type": "string", + "description": "Name of this custom channel." + } + } + }, + "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 adsense#customChannels.", + "default": "adsense#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." + } + } + }, + "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 adsense#urlChannel.", + "default": "adsense#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 adsense#urlChannels.", + "default": "adsense#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": "adsense.adclients.list", + "path": "adclients", + "httpMethod": "GET", + "description": "List all ad clients in this AdSense account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of ad clients to include in the response, used for paging.", + "format": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "adunits": { + "methods": { + "list": { + "id": "adsense.adunits.list", + "path": "adclients/{adClientId}/adunits", + "httpMethod": "GET", + "description": "List all ad units in the specified ad client for this AdSense 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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "customchannels": { + "methods": { + "list": { + "id": "adsense.customchannels.list", + "path": "adclients/{adClientId}/customchannels", + "httpMethod": "GET", + "description": "List all custom channels in the specified ad client for this AdSense 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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "reports": { + "methods": { + "generate": { + "id": "adsense.reports.generate", + "path": "reports", + "httpMethod": "GET", + "description": "Generate an AdSense 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": { + "currency": { + "type": "string", + "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.", + "pattern": "[a-zA-Z]+", + "location": "query" + }, + "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,2}?)", + "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": "int32", + "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,2}?)", + "location": "query" + }, + "startIndex": { + "type": "integer", + "description": "Index of the first row of report data to return.", + "format": "int32", + "minimum": "0", + "maximum": "5000", + "location": "query" + } + }, + "parameterOrder": [ + "startDate", + "endDate" + ], + "response": { + "$ref": "AdsenseReportsGenerateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + }, + "urlchannels": { + "methods": { + "list": { + "id": "adsense.urlchannels.list", + "path": "adclients/{adClientId}/urlchannels", + "httpMethod": "GET", + "description": "List all URL channels in the specified ad client for this AdSense 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": "int32", + "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/adsense", + "https://www.googleapis.com/auth/adsense.readonly" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adsense/v1/adsense-gen.go b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1/adsense-gen.go new file mode 100644 index 0000000000000..97ad69f9b29f4 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adsense/v1/adsense-gen.go @@ -0,0 +1,934 @@ +// Package adsense provides access to the AdSense Management API. +// +// See https://developers.google.com/adsense/management/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/adsense/v1" +// ... +// adsenseService, err := adsense.New(oauthHttpClient) +package adsense + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "adsense:v1" +const apiName = "adsense" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/adsense/v1/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your AdSense data + AdsenseScope = "https://www.googleapis.com/auth/adsense" + + // View your AdSense data + AdsenseReadonlyScope = "https://www.googleapis.com/auth/adsense.readonly" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client} + s.Adclients = NewAdclientsService(s) + s.Adunits = NewAdunitsService(s) + s.Customchannels = NewCustomchannelsService(s) + s.Reports = NewReportsService(s) + s.Urlchannels = NewUrlchannelsService(s) + return s, nil +} + +type Service struct { + client *http.Client + + Adclients *AdclientsService + + Adunits *AdunitsService + + Customchannels *CustomchannelsService + + Reports *ReportsService + + Urlchannels *UrlchannelsService +} + +func NewAdclientsService(s *Service) *AdclientsService { + rs := &AdclientsService{s: s} + return rs +} + +type AdclientsService struct { + s *Service +} + +func NewAdunitsService(s *Service) *AdunitsService { + rs := &AdunitsService{s: s} + return rs +} + +type AdunitsService struct { + s *Service +} + +func NewCustomchannelsService(s *Service) *CustomchannelsService { + rs := &CustomchannelsService{s: s} + return rs +} + +type CustomchannelsService struct { + s *Service +} + +func NewReportsService(s *Service) *ReportsService { + rs := &ReportsService{s: s} + return rs +} + +type ReportsService struct { + s *Service +} + +func NewUrlchannelsService(s *Service) *UrlchannelsService { + rs := &UrlchannelsService{s: s} + return rs +} + +type UrlchannelsService struct { + s *Service +} + +type AdClient struct { + // Id: Unique identifier of this ad client. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#adClient. + Kind string `json:"kind,omitempty"` + + // ProductCode: This ad client's product code, which corresponds to the + // PRODUCT_CODE report dimension. + ProductCode string `json:"productCode,omitempty"` + + // SupportsReporting: Whether this ad client supports being reported on. + SupportsReporting bool `json:"supportsReporting,omitempty"` +} + +type AdClients struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The ad clients returned in this list response. + Items []*AdClient `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#adClients. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad clients. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AdUnit struct { + // Code: Identity code of this ad unit, not necessarily unique across ad + // clients. + Code string `json:"code,omitempty"` + + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#adUnit. + Kind string `json:"kind,omitempty"` + + // Name: Name of this ad unit. + Name string `json:"name,omitempty"` + + // Status: Status of this ad unit. Possible values are: + // NEW: Indicates + // that the ad unit was created within the last seven days and does not + // yet have any activity associated with it. + // + // ACTIVE: Indicates that + // there has been activity on this ad unit in the last seven + // days. + // + // INACTIVE: Indicates that there has been no activity on this ad + // unit in the last seven days. + Status string `json:"status,omitempty"` +} + +type AdUnits struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The ad units returned in this list response. + Items []*AdUnit `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#adUnits. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad units. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AdsenseReportsGenerateResponse struct { + // Averages: The averages of the report. This is the same length as any + // other row in the report; cells corresponding to dimension columns are + // empty. + Averages []string `json:"averages,omitempty"` + + // Headers: 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. + Headers []*AdsenseReportsGenerateResponseHeaders `json:"headers,omitempty"` + + // Kind: Kind this is, in this case adsense#report. + Kind string `json:"kind,omitempty"` + + // Rows: 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. + Rows [][]string `json:"rows,omitempty"` + + // TotalMatchedRows: 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. + TotalMatchedRows int64 `json:"totalMatchedRows,omitempty,string"` + + // Totals: The totals of the report. This is the same length as any + // other row in the report; cells corresponding to dimension columns are + // empty. + Totals []string `json:"totals,omitempty"` + + // Warnings: Any warnings associated with generation of the report. + Warnings []string `json:"warnings,omitempty"` +} + +type AdsenseReportsGenerateResponseHeaders struct { + // Currency: The currency of this column. Only present if the header + // type is METRIC_CURRENCY. + Currency string `json:"currency,omitempty"` + + // Name: The name of the header. + Name string `json:"name,omitempty"` + + // Type: The type of the header; one of DIMENSION, METRIC_TALLY, + // METRIC_RATIO, or METRIC_CURRENCY. + Type string `json:"type,omitempty"` +} + +type CustomChannel struct { + // Code: Code of this custom channel, not necessarily unique across ad + // clients. + Code string `json:"code,omitempty"` + + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#customChannel. + Kind string `json:"kind,omitempty"` + + // Name: Name of this custom channel. + Name string `json:"name,omitempty"` +} + +type CustomChannels struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The custom channels returned in this list response. + Items []*CustomChannel `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#customChannels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through custom + // channels. To retrieve the next page of results, set the next + // request's "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type UrlChannel struct { + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsense#urlChannel. + Kind string `json:"kind,omitempty"` + + // UrlPattern: URL Pattern of this URL channel. Does not include + // "http://" or "https://". Example: www.example.com/home + UrlPattern string `json:"urlPattern,omitempty"` +} + +type UrlChannels struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The URL channels returned in this list response. + Items []*UrlChannel `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#urlChannels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through URL channels. + // To retrieve the next page of results, set the next request's + // "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +// method id "adsense.adclients.list": + +type AdclientsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all ad clients in this AdSense account. +func (r *AdclientsService) List() *AdclientsListCall { + c := &AdclientsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad clients to include in the response, used for paging. +func (c *AdclientsListCall) MaxResults(maxResults int64) *AdclientsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdclientsListCall) PageToken(pageToken string) *AdclientsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdclientsListCall) Do() (*AdClients, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1/", "adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdClients) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad clients in this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.adclients.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of ad clients to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "adclients", + // "response": { + // "$ref": "AdClients" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.adunits.list": + +type AdunitsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified ad client for this AdSense +// account. +func (r *AdunitsService) List(adClientId string) *AdunitsListCall { + c := &AdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *AdunitsListCall) IncludeInactive(includeInactive bool) *AdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *AdunitsListCall) MaxResults(maxResults int64) *AdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdunitsListCall) PageToken(pageToken string) *AdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1/", "adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified ad client for this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.adunits.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.customchannels.list": + +type CustomchannelsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all custom channels in the specified ad client for this +// AdSense account. +func (r *CustomchannelsService) List(adClientId string) *CustomchannelsListCall { + c := &CustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *CustomchannelsListCall) MaxResults(maxResults int64) *CustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *CustomchannelsListCall) PageToken(pageToken string) *CustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1/", "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels in the specified ad client for this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.customchannels.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.reports.generate": + +type ReportsGenerateCall struct { + s *Service + startDate string + endDate string + opt_ map[string]interface{} +} + +// Generate: Generate an AdSense 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. +func (r *ReportsService) Generate(startDate string, endDate string) *ReportsGenerateCall { + c := &ReportsGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.startDate = startDate + c.endDate = endDate + return c +} + +// Currency sets the optional parameter "currency": Optional currency to +// use when reporting on monetary metrics. Defaults to the account's +// currency if not set. +func (c *ReportsGenerateCall) Currency(currency string) *ReportsGenerateCall { + c.opt_["currency"] = currency + return c +} + +// Dimension sets the optional parameter "dimension": Dimensions to base +// the report on. +func (c *ReportsGenerateCall) Dimension(dimension string) *ReportsGenerateCall { + c.opt_["dimension"] = dimension + return c +} + +// Filter sets the optional parameter "filter": Filters to be run on the +// report. +func (c *ReportsGenerateCall) Filter(filter string) *ReportsGenerateCall { + c.opt_["filter"] = filter + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *ReportsGenerateCall) Locale(locale string) *ReportsGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *ReportsGenerateCall) MaxResults(maxResults int64) *ReportsGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Metric sets the optional parameter "metric": Numeric columns to +// include in the report. +func (c *ReportsGenerateCall) Metric(metric string) *ReportsGenerateCall { + c.opt_["metric"] = metric + return c +} + +// Sort sets the optional parameter "sort": 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. +func (c *ReportsGenerateCall) Sort(sort string) *ReportsGenerateCall { + c.opt_["sort"] = sort + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *ReportsGenerateCall) StartIndex(startIndex int64) *ReportsGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *ReportsGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("endDate", fmt.Sprintf("%v", c.endDate)) + params.Set("startDate", fmt.Sprintf("%v", c.startDate)) + if v, ok := c.opt_["currency"]; ok { + params.Set("currency", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dimension"]; ok { + params.Set("dimension", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["metric"]; ok { + params.Set("metric", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1/", "reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdsenseReportsGenerateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an AdSense 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.", + // "httpMethod": "GET", + // "id": "adsense.reports.generate", + // "parameterOrder": [ + // "startDate", + // "endDate" + // ], + // "parameters": { + // "currency": { + // "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.", + // "location": "query", + // "pattern": "[a-zA-Z]+", + // "type": "string" + // }, + // "dimension": { + // "description": "Dimensions to base the report on.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "endDate": { + // "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,2}?)", + // "required": true, + // "type": "string" + // }, + // "filter": { + // "description": "Filters to be run on the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+(==|=@).+", + // "repeated": true, + // "type": "string" + // }, + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "metric": { + // "description": "Numeric columns to include in the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "sort": { + // "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.", + // "location": "query", + // "pattern": "(\\+|-)?[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "startDate": { + // "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,2}?)", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "reports", + // "response": { + // "$ref": "AdsenseReportsGenerateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} + +// method id "adsense.urlchannels.list": + +type UrlchannelsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all URL channels in the specified ad client for this +// AdSense account. +func (r *UrlchannelsService) List(adClientId string) *UrlchannelsListCall { + c := &UrlchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of URL channels to include in the response, used for paging. +func (c *UrlchannelsListCall) MaxResults(maxResults int64) *UrlchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *UrlchannelsListCall) PageToken(pageToken string) *UrlchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *UrlchannelsListCall) Do() (*UrlChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/adsense/v1/", "adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UrlChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all URL channels in the specified ad client for this AdSense account.", + // "httpMethod": "GET", + // "id": "adsense.urlchannels.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list URL channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of URL channels to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/urlchannels", + // "response": { + // "$ref": "UrlChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsense", + // "https://www.googleapis.com/auth/adsense.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adsensehost/v4.1/adsensehost-api.json b/third_party/src/code.google.com/p/google-api-go-client/adsensehost/v4.1/adsensehost-api.json new file mode 100644 index 0000000000000..556f6c8fdca57 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adsensehost/v4.1/adsensehost-api.json @@ -0,0 +1,1568 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/sg56Xf_5EyNWaO73kOWKtnVtRUE\"", + "discoveryVersion": "v1", + "id": "adsensehost:v4.1", + "name": "adsensehost", + "canonicalName": "AdSense Host", + "version": "v4.1", + "title": "AdSense Host API", + "description": "Gives AdSense Hosts access to report generation, ad code generation, and publisher management capabilities.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/adsense-16.png", + "x32": "http://www.google.com/images/icons/product/adsense-32.png" + }, + "documentationLink": "https://developers.google.com/adsense/host/", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/adsensehost/v4.1/", + "basePath": "/adsensehost/v4.1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "adsensehost/v4.1/", + "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/adsensehost": { + "description": "View and manage your AdSense host data and associated accounts" + } + } + } + }, + "schemas": { + "Account": { + "id": "Account", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of this account." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adsensehost#account.", + "default": "adsensehost#account" + }, + "name": { + "type": "string", + "description": "Name of this account." + }, + "status": { + "type": "string", + "description": "Approval status of this account. One of: PENDING, APPROVED, DISABLED." + } + } + }, + "Accounts": { + "id": "Accounts", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The accounts returned in this list response.", + "items": { + "$ref": "Account" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adsensehost#accounts.", + "default": "adsensehost#accounts" + } + } + }, + "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 adsensehost#adClient.", + "default": "adsensehost#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 adsensehost#adClients.", + "default": "adsensehost#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." + } + } + }, + "AdCode": { + "id": "AdCode", + "type": "object", + "properties": { + "adCode": { + "type": "string", + "description": "The ad code snippet." + }, + "kind": { + "type": "string", + "description": "Kind this is, in this case adsensehost#adCode.", + "default": "adsensehost#adCode" + } + } + }, + "AdStyle": { + "id": "AdStyle", + "type": "object", + "properties": { + "colors": { + "type": "object", + "description": "The colors included in the style. These are represented as six hexadecimal characters, similar to HTML color codes, but without the leading hash.", + "properties": { + "background": { + "type": "string", + "description": "The color of the ad background." + }, + "border": { + "type": "string", + "description": "The color of the ad border." + }, + "text": { + "type": "string", + "description": "The color of the ad text." + }, + "title": { + "type": "string", + "description": "The color of the ad title." + }, + "url": { + "type": "string", + "description": "The color of the ad url." + } + } + }, + "corners": { + "type": "string", + "description": "The style of the corners in the ad. Possible values are SQUARE, SLIGHTLY_ROUNDED and VERY_ROUNDED." + }, + "font": { + "type": "object", + "description": "The font which is included in the style.", + "properties": { + "family": { + "type": "string", + "description": "The family of the font. Possible values are: ACCOUNT_DEFAULT_FAMILY, ADSENSE_DEFAULT_FAMILY, ARIAL, TIMES and VERDANA." + }, + "size": { + "type": "string", + "description": "The size of the font. Possible values are: ACCOUNT_DEFAULT_SIZE, ADSENSE_DEFAULT_SIZE, SMALL, MEDIUM and LARGE." + } + } + }, + "kind": { + "type": "string", + "description": "Kind this is, in this case adsensehost#adStyle.", + "default": "adsensehost#adStyle" + } + } + }, + "AdUnit": { + "id": "AdUnit", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Identity code of this ad unit, not necessarily unique across ad clients." + }, + "contentAdsSettings": { + "type": "object", + "description": "Settings specific to content ads (AFC) and highend mobile content ads (AFMC).", + "properties": { + "backupOption": { + "type": "object", + "description": "The backup option to be used in instances where no ad is available.", + "properties": { + "color": { + "type": "string", + "description": "Color to use when type is set to COLOR. These are represented as six hexadecimal characters, similar to HTML color codes, but without the leading hash." + }, + "type": { + "type": "string", + "description": "Type of the backup option. Possible values are BLANK, COLOR and URL." + }, + "url": { + "type": "string", + "description": "URL to use when type is set to URL." + } + } + }, + "size": { + "type": "string", + "description": "Size of this ad unit. Size values are in the form SIZE_{width}_{height}." + }, + "type": { + "type": "string", + "description": "Type of this ad unit. Possible values are TEXT, TEXT_IMAGE, IMAGE and LINK." + } + } + }, + "customStyle": { + "$ref": "AdStyle", + "description": "Custom style information specific to this ad unit." + }, + "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 adsensehost#adUnit.", + "default": "adsensehost#adUnit" + }, + "mobileContentAdsSettings": { + "type": "object", + "description": "Settings specific to WAP mobile content ads (AFMC).", + "properties": { + "markupLanguage": { + "type": "string", + "description": "The markup language to use for this ad unit." + }, + "scriptingLanguage": { + "type": "string", + "description": "The scripting language to use for this ad unit." + }, + "size": { + "type": "string", + "description": "Size of this ad unit." + }, + "type": { + "type": "string", + "description": "Type of this ad unit." + } + } + }, + "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 adsensehost#adUnits.", + "default": "adsensehost#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." + } + } + }, + "AssociationSession": { + "id": "AssociationSession", + "type": "object", + "properties": { + "accountId": { + "type": "string", + "description": "Hosted account id of the associated publisher after association. Present if status is ACCEPTED." + }, + "id": { + "type": "string", + "description": "Unique identifier of this association session." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adsensehost#associationSession.", + "default": "adsensehost#associationSession" + }, + "productCodes": { + "type": "array", + "description": "The products to associate with the user. Options: AFC, AFF, AFS, AFMC", + "items": { + "type": "string" + } + }, + "redirectUrl": { + "type": "string", + "description": "Redirect URL of this association session. Used to redirect users into the AdSense association flow." + }, + "status": { + "type": "string", + "description": "Status of the completed association, available once the association callback token has been verified. One of ACCEPTED, REJECTED, or ERROR." + }, + "userLocale": { + "type": "string", + "description": "The preferred locale of the user themselves when going through the AdSense association flow." + }, + "websiteLocale": { + "type": "string", + "description": "The locale of the user's hosted website." + }, + "websiteUrl": { + "type": "string", + "description": "The URL of the user's hosted website." + } + } + }, + "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 adsensehost#customChannel.", + "default": "adsensehost#customChannel" + }, + "name": { + "type": "string", + "description": "Name of this custom channel." + } + } + }, + "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 adsensehost#customChannels.", + "default": "adsensehost#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 adsensehost#report.", + "default": "adsensehost#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" + } + } + } + }, + "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 adsensehost#urlChannel.", + "default": "adsensehost#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 adsensehost#urlChannels.", + "default": "adsensehost#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": { + "accounts": { + "methods": { + "get": { + "id": "adsensehost.accounts.get", + "path": "accounts/{accountId}", + "httpMethod": "GET", + "description": "Get information about the selected associated AdSense account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to get information about.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + }, + "list": { + "id": "adsensehost.accounts.list", + "path": "accounts", + "httpMethod": "GET", + "description": "List hosted accounts associated with this AdSense account by ad client id.", + "parameters": { + "filterAdClientId": { + "type": "string", + "description": "Ad clients to list accounts for.", + "required": true, + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "filterAdClientId" + ], + "response": { + "$ref": "Accounts" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + } + }, + "resources": { + "adclients": { + "methods": { + "get": { + "id": "adsensehost.accounts.adclients.get", + "path": "accounts/{accountId}/adclients/{adClientId}", + "httpMethod": "GET", + "description": "Get information about one of the ad clients in the specified publisher's AdSense account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account which contains the ad client.", + "required": true, + "location": "path" + }, + "adClientId": { + "type": "string", + "description": "Ad client to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "adClientId" + ], + "response": { + "$ref": "AdClient" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + }, + "list": { + "id": "adsensehost.accounts.adclients.list", + "path": "accounts/{accountId}/adclients", + "httpMethod": "GET", + "description": "List all hosted ad clients in the specified hosted account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account for which to list ad clients.", + "required": true, + "location": "path" + }, + "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" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "AdClients" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + } + } + }, + "adunits": { + "methods": { + "delete": { + "id": "adsensehost.accounts.adunits.delete", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}", + "httpMethod": "DELETE", + "description": "Delete the specified ad unit from the specified publisher AdSense account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account which contains the ad unit.", + "required": true, + "location": "path" + }, + "adClientId": { + "type": "string", + "description": "Ad client for which to get ad unit.", + "required": true, + "location": "path" + }, + "adUnitId": { + "type": "string", + "description": "Ad unit to delete.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "adClientId", + "adUnitId" + ], + "response": { + "$ref": "AdUnit" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + }, + "get": { + "id": "adsensehost.accounts.adunits.get", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}", + "httpMethod": "GET", + "description": "Get the specified host ad unit in this AdSense account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account which contains the ad unit.", + "required": true, + "location": "path" + }, + "adClientId": { + "type": "string", + "description": "Ad client for which to get ad unit.", + "required": true, + "location": "path" + }, + "adUnitId": { + "type": "string", + "description": "Ad unit to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "adClientId", + "adUnitId" + ], + "response": { + "$ref": "AdUnit" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + }, + "getAdCode": { + "id": "adsensehost.accounts.adunits.getAdCode", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode", + "httpMethod": "GET", + "description": "Get ad code for the specified ad unit, attaching the specified host custom channels.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account which contains the ad client.", + "required": true, + "location": "path" + }, + "adClientId": { + "type": "string", + "description": "Ad client with contains the ad unit.", + "required": true, + "location": "path" + }, + "adUnitId": { + "type": "string", + "description": "Ad unit to get the code for.", + "required": true, + "location": "path" + }, + "hostCustomChannelId": { + "type": "string", + "description": "Host custom channel to attach to the ad code.", + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "accountId", + "adClientId", + "adUnitId" + ], + "response": { + "$ref": "AdCode" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + }, + "insert": { + "id": "adsensehost.accounts.adunits.insert", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits", + "httpMethod": "POST", + "description": "Insert the supplied ad unit into the specified publisher AdSense account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account which will contain the ad unit.", + "required": true, + "location": "path" + }, + "adClientId": { + "type": "string", + "description": "Ad client into which to insert the ad unit.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "adClientId" + ], + "request": { + "$ref": "AdUnit" + }, + "response": { + "$ref": "AdUnit" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + }, + "list": { + "id": "adsensehost.accounts.adunits.list", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits", + "httpMethod": "GET", + "description": "List all ad units in the specified publisher's AdSense account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account which contains the ad client.", + "required": true, + "location": "path" + }, + "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": [ + "accountId", + "adClientId" + ], + "response": { + "$ref": "AdUnits" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + }, + "patch": { + "id": "adsensehost.accounts.adunits.patch", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits", + "httpMethod": "PATCH", + "description": "Update the supplied ad unit in the specified publisher AdSense account. This method supports patch semantics.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account which contains the ad client.", + "required": true, + "location": "path" + }, + "adClientId": { + "type": "string", + "description": "Ad client which contains the ad unit.", + "required": true, + "location": "path" + }, + "adUnitId": { + "type": "string", + "description": "Ad unit to get.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "accountId", + "adClientId", + "adUnitId" + ], + "request": { + "$ref": "AdUnit" + }, + "response": { + "$ref": "AdUnit" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + }, + "update": { + "id": "adsensehost.accounts.adunits.update", + "path": "accounts/{accountId}/adclients/{adClientId}/adunits", + "httpMethod": "PUT", + "description": "Update the supplied ad unit in the specified publisher AdSense account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account which contains the ad client.", + "required": true, + "location": "path" + }, + "adClientId": { + "type": "string", + "description": "Ad client which contains the ad unit.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "adClientId" + ], + "request": { + "$ref": "AdUnit" + }, + "response": { + "$ref": "AdUnit" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + } + } + }, + "reports": { + "methods": { + "generate": { + "id": "adsensehost.accounts.reports.generate", + "path": "accounts/{accountId}/reports", + "httpMethod": "GET", + "description": "Generate an AdSense 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": { + "accountId": { + "type": "string", + "description": "Hosted account upon which to report.", + "required": true, + "location": "path" + }, + "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": [ + "accountId", + "startDate", + "endDate" + ], + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + } + } + } + } + }, + "adclients": { + "methods": { + "get": { + "id": "adsensehost.adclients.get", + "path": "adclients/{adClientId}", + "httpMethod": "GET", + "description": "Get information about one of the ad clients in the Host AdSense account.", + "parameters": { + "adClientId": { + "type": "string", + "description": "Ad client to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "adClientId" + ], + "response": { + "$ref": "AdClient" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + }, + "list": { + "id": "adsensehost.adclients.list", + "path": "adclients", + "httpMethod": "GET", + "description": "List all host ad clients in this AdSense 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/adsensehost" + ] + } + } + }, + "associationsessions": { + "methods": { + "start": { + "id": "adsensehost.associationsessions.start", + "path": "associationsessions/start", + "httpMethod": "GET", + "description": "Create an association session for initiating an association with an AdSense user.", + "parameters": { + "productCode": { + "type": "string", + "description": "Products to associate with the user.", + "required": true, + "enum": [ + "AFC", + "AFG", + "AFMC", + "AFS", + "AFV" + ], + "enumDescriptions": [ + "AdSense For Content", + "AdSense For Games", + "AdSense For Mobile Content", + "AdSense For Search", + "AdSense For Video" + ], + "repeated": true, + "location": "query" + }, + "userLocale": { + "type": "string", + "description": "The preferred locale of the user.", + "location": "query" + }, + "websiteLocale": { + "type": "string", + "description": "The locale of the user's hosted website.", + "location": "query" + }, + "websiteUrl": { + "type": "string", + "description": "The URL of the user's hosted website.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "productCode", + "websiteUrl" + ], + "response": { + "$ref": "AssociationSession" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + }, + "verify": { + "id": "adsensehost.associationsessions.verify", + "path": "associationsessions/verify", + "httpMethod": "GET", + "description": "Verify an association session after the association callback returns from AdSense signup.", + "parameters": { + "token": { + "type": "string", + "description": "The token returned to the association callback URL.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "token" + ], + "response": { + "$ref": "AssociationSession" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + } + } + }, + "customchannels": { + "methods": { + "delete": { + "id": "adsensehost.customchannels.delete", + "path": "adclients/{adClientId}/customchannels/{customChannelId}", + "httpMethod": "DELETE", + "description": "Delete a specific custom channel from the host AdSense account.", + "parameters": { + "adClientId": { + "type": "string", + "description": "Ad client from which to delete the custom channel.", + "required": true, + "location": "path" + }, + "customChannelId": { + "type": "string", + "description": "Custom channel to delete.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "adClientId", + "customChannelId" + ], + "response": { + "$ref": "CustomChannel" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + }, + "get": { + "id": "adsensehost.customchannels.get", + "path": "adclients/{adClientId}/customchannels/{customChannelId}", + "httpMethod": "GET", + "description": "Get a specific custom channel from the host AdSense account.", + "parameters": { + "adClientId": { + "type": "string", + "description": "Ad client from which to get the custom channel.", + "required": true, + "location": "path" + }, + "customChannelId": { + "type": "string", + "description": "Custom channel to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "adClientId", + "customChannelId" + ], + "response": { + "$ref": "CustomChannel" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + }, + "insert": { + "id": "adsensehost.customchannels.insert", + "path": "adclients/{adClientId}/customchannels", + "httpMethod": "POST", + "description": "Add a new custom channel to the host AdSense account.", + "parameters": { + "adClientId": { + "type": "string", + "description": "Ad client to which the new custom channel will be added.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "adClientId" + ], + "request": { + "$ref": "CustomChannel" + }, + "response": { + "$ref": "CustomChannel" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + }, + "list": { + "id": "adsensehost.customchannels.list", + "path": "adclients/{adClientId}/customchannels", + "httpMethod": "GET", + "description": "List all host custom channels in this AdSense 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/adsensehost" + ] + }, + "patch": { + "id": "adsensehost.customchannels.patch", + "path": "adclients/{adClientId}/customchannels", + "httpMethod": "PATCH", + "description": "Update a custom channel in the host AdSense account. This method supports patch semantics.", + "parameters": { + "adClientId": { + "type": "string", + "description": "Ad client in which the custom channel will be updated.", + "required": true, + "location": "path" + }, + "customChannelId": { + "type": "string", + "description": "Custom channel to get.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "adClientId", + "customChannelId" + ], + "request": { + "$ref": "CustomChannel" + }, + "response": { + "$ref": "CustomChannel" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + }, + "update": { + "id": "adsensehost.customchannels.update", + "path": "adclients/{adClientId}/customchannels", + "httpMethod": "PUT", + "description": "Update a custom channel in the host AdSense account.", + "parameters": { + "adClientId": { + "type": "string", + "description": "Ad client in which the custom channel will be updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "adClientId" + ], + "request": { + "$ref": "CustomChannel" + }, + "response": { + "$ref": "CustomChannel" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + } + } + }, + "reports": { + "methods": { + "generate": { + "id": "adsensehost.reports.generate", + "path": "reports", + "httpMethod": "GET", + "description": "Generate an AdSense 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/adsensehost" + ] + } + } + }, + "urlchannels": { + "methods": { + "delete": { + "id": "adsensehost.urlchannels.delete", + "path": "adclients/{adClientId}/urlchannels/{urlChannelId}", + "httpMethod": "DELETE", + "description": "Delete a URL channel from the host AdSense account.", + "parameters": { + "adClientId": { + "type": "string", + "description": "Ad client from which to delete the URL channel.", + "required": true, + "location": "path" + }, + "urlChannelId": { + "type": "string", + "description": "URL channel to delete.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "adClientId", + "urlChannelId" + ], + "response": { + "$ref": "UrlChannel" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + }, + "insert": { + "id": "adsensehost.urlchannels.insert", + "path": "adclients/{adClientId}/urlchannels", + "httpMethod": "POST", + "description": "Add a new URL channel to the host AdSense account.", + "parameters": { + "adClientId": { + "type": "string", + "description": "Ad client to which the new URL channel will be added.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "adClientId" + ], + "request": { + "$ref": "UrlChannel" + }, + "response": { + "$ref": "UrlChannel" + }, + "scopes": [ + "https://www.googleapis.com/auth/adsensehost" + ] + }, + "list": { + "id": "adsensehost.urlchannels.list", + "path": "adclients/{adClientId}/urlchannels", + "httpMethod": "GET", + "description": "List all host URL channels in the host AdSense 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/adsensehost" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/adsensehost/v4.1/adsensehost-gen.go b/third_party/src/code.google.com/p/google-api-go-client/adsensehost/v4.1/adsensehost-gen.go new file mode 100644 index 0000000000000..48a186e04ab50 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/adsensehost/v4.1/adsensehost-gen.go @@ -0,0 +1,2978 @@ +// Package adsensehost provides access to the AdSense Host API. +// +// See https://developers.google.com/adsense/host/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/adsensehost/v4.1" +// ... +// adsensehostService, err := adsensehost.New(oauthHttpClient) +package adsensehost + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "adsensehost:v4.1" +const apiName = "adsensehost" +const apiVersion = "v4.1" +const basePath = "https://www.googleapis.com/adsensehost/v4.1/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your AdSense host data and associated accounts + AdsensehostScope = "https://www.googleapis.com/auth/adsensehost" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + s.Adclients = NewAdclientsService(s) + s.Associationsessions = NewAssociationsessionsService(s) + s.Customchannels = NewCustomchannelsService(s) + s.Reports = NewReportsService(s) + s.Urlchannels = NewUrlchannelsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Accounts *AccountsService + + Adclients *AdclientsService + + Associationsessions *AssociationsessionsService + + Customchannels *CustomchannelsService + + Reports *ReportsService + + Urlchannels *UrlchannelsService +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + rs.Adclients = NewAccountsAdclientsService(s) + rs.Adunits = NewAccountsAdunitsService(s) + rs.Reports = NewAccountsReportsService(s) + return rs +} + +type AccountsService struct { + s *Service + + Adclients *AccountsAdclientsService + + Adunits *AccountsAdunitsService + + Reports *AccountsReportsService +} + +func NewAccountsAdclientsService(s *Service) *AccountsAdclientsService { + rs := &AccountsAdclientsService{s: s} + return rs +} + +type AccountsAdclientsService struct { + s *Service +} + +func NewAccountsAdunitsService(s *Service) *AccountsAdunitsService { + rs := &AccountsAdunitsService{s: s} + return rs +} + +type AccountsAdunitsService struct { + s *Service +} + +func NewAccountsReportsService(s *Service) *AccountsReportsService { + rs := &AccountsReportsService{s: s} + return rs +} + +type AccountsReportsService struct { + s *Service +} + +func NewAdclientsService(s *Service) *AdclientsService { + rs := &AdclientsService{s: s} + return rs +} + +type AdclientsService struct { + s *Service +} + +func NewAssociationsessionsService(s *Service) *AssociationsessionsService { + rs := &AssociationsessionsService{s: s} + return rs +} + +type AssociationsessionsService struct { + s *Service +} + +func NewCustomchannelsService(s *Service) *CustomchannelsService { + rs := &CustomchannelsService{s: s} + return rs +} + +type CustomchannelsService struct { + s *Service +} + +func NewReportsService(s *Service) *ReportsService { + rs := &ReportsService{s: s} + return rs +} + +type ReportsService struct { + s *Service +} + +func NewUrlchannelsService(s *Service) *UrlchannelsService { + rs := &UrlchannelsService{s: s} + return rs +} + +type UrlchannelsService struct { + s *Service +} + +type Account struct { + // Id: Unique identifier of this account. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsensehost#account. + Kind string `json:"kind,omitempty"` + + // Name: Name of this account. + Name string `json:"name,omitempty"` + + // Status: Approval status of this account. One of: PENDING, APPROVED, + // DISABLED. + Status string `json:"status,omitempty"` +} + +type Accounts struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The accounts returned in this list response. + Items []*Account `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsensehost#accounts. + Kind string `json:"kind,omitempty"` +} + +type AdClient struct { + // ArcOptIn: Whether this ad client is opted in to ARC. + ArcOptIn bool `json:"arcOptIn,omitempty"` + + // Id: Unique identifier of this ad client. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsensehost#adClient. + Kind string `json:"kind,omitempty"` + + // ProductCode: This ad client's product code, which corresponds to the + // PRODUCT_CODE report dimension. + ProductCode string `json:"productCode,omitempty"` + + // SupportsReporting: Whether this ad client supports being reported on. + SupportsReporting bool `json:"supportsReporting,omitempty"` +} + +type AdClients struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The ad clients returned in this list response. + Items []*AdClient `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsensehost#adClients. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad clients. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AdCode struct { + // AdCode: The ad code snippet. + AdCode string `json:"adCode,omitempty"` + + // Kind: Kind this is, in this case adsensehost#adCode. + Kind string `json:"kind,omitempty"` +} + +type AdStyle struct { + // Colors: The colors included in the style. These are represented as + // six hexadecimal characters, similar to HTML color codes, but without + // the leading hash. + Colors *AdStyleColors `json:"colors,omitempty"` + + // Corners: The style of the corners in the ad. Possible values are + // SQUARE, SLIGHTLY_ROUNDED and VERY_ROUNDED. + Corners string `json:"corners,omitempty"` + + // Font: The font which is included in the style. + Font *AdStyleFont `json:"font,omitempty"` + + // Kind: Kind this is, in this case adsensehost#adStyle. + Kind string `json:"kind,omitempty"` +} + +type AdStyleColors struct { + // Background: The color of the ad background. + Background string `json:"background,omitempty"` + + // Border: The color of the ad border. + Border string `json:"border,omitempty"` + + // Text: The color of the ad text. + Text string `json:"text,omitempty"` + + // Title: The color of the ad title. + Title string `json:"title,omitempty"` + + // Url: The color of the ad url. + Url string `json:"url,omitempty"` +} + +type AdStyleFont struct { + // Family: The family of the font. Possible values are: + // ACCOUNT_DEFAULT_FAMILY, ADSENSE_DEFAULT_FAMILY, ARIAL, TIMES and + // VERDANA. + Family string `json:"family,omitempty"` + + // Size: The size of the font. Possible values are: + // ACCOUNT_DEFAULT_SIZE, ADSENSE_DEFAULT_SIZE, SMALL, MEDIUM and LARGE. + Size string `json:"size,omitempty"` +} + +type AdUnit struct { + // Code: Identity code of this ad unit, not necessarily unique across ad + // clients. + Code string `json:"code,omitempty"` + + // ContentAdsSettings: Settings specific to content ads (AFC) and + // highend mobile content ads (AFMC). + ContentAdsSettings *AdUnitContentAdsSettings `json:"contentAdsSettings,omitempty"` + + // CustomStyle: Custom style information specific to this ad unit. + CustomStyle *AdStyle `json:"customStyle,omitempty"` + + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsensehost#adUnit. + Kind string `json:"kind,omitempty"` + + // MobileContentAdsSettings: Settings specific to WAP mobile content ads + // (AFMC). + MobileContentAdsSettings *AdUnitMobileContentAdsSettings `json:"mobileContentAdsSettings,omitempty"` + + // Name: Name of this ad unit. + Name string `json:"name,omitempty"` + + // Status: Status of this ad unit. Possible values are: + // NEW: Indicates + // that the ad unit was created within the last seven days and does not + // yet have any activity associated with it. + // + // ACTIVE: Indicates that + // there has been activity on this ad unit in the last seven + // days. + // + // INACTIVE: Indicates that there has been no activity on this ad + // unit in the last seven days. + Status string `json:"status,omitempty"` +} + +type AdUnitContentAdsSettings struct { + // BackupOption: The backup option to be used in instances where no ad + // is available. + BackupOption *AdUnitContentAdsSettingsBackupOption `json:"backupOption,omitempty"` + + // Size: Size of this ad unit. Size values are in the form + // SIZE_{width}_{height}. + Size string `json:"size,omitempty"` + + // Type: Type of this ad unit. Possible values are TEXT, TEXT_IMAGE, + // IMAGE and LINK. + Type string `json:"type,omitempty"` +} + +type AdUnitContentAdsSettingsBackupOption struct { + // Color: Color to use when type is set to COLOR. These are represented + // as six hexadecimal characters, similar to HTML color codes, but + // without the leading hash. + Color string `json:"color,omitempty"` + + // Type: Type of the backup option. Possible values are BLANK, COLOR and + // URL. + Type string `json:"type,omitempty"` + + // Url: URL to use when type is set to URL. + Url string `json:"url,omitempty"` +} + +type AdUnitMobileContentAdsSettings struct { + // MarkupLanguage: The markup language to use for this ad unit. + MarkupLanguage string `json:"markupLanguage,omitempty"` + + // ScriptingLanguage: The scripting language to use for this ad unit. + ScriptingLanguage string `json:"scriptingLanguage,omitempty"` + + // Size: Size of this ad unit. + Size string `json:"size,omitempty"` + + // Type: Type of this ad unit. + Type string `json:"type,omitempty"` +} + +type AdUnits struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The ad units returned in this list response. + Items []*AdUnit `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsensehost#adUnits. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through ad units. To + // retrieve the next page of results, set the next request's "pageToken" + // value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AssociationSession struct { + // AccountId: Hosted account id of the associated publisher after + // association. Present if status is ACCEPTED. + AccountId string `json:"accountId,omitempty"` + + // Id: Unique identifier of this association session. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case + // adsensehost#associationSession. + Kind string `json:"kind,omitempty"` + + // ProductCodes: The products to associate with the user. Options: AFC, + // AFF, AFS, AFMC + ProductCodes []string `json:"productCodes,omitempty"` + + // RedirectUrl: Redirect URL of this association session. Used to + // redirect users into the AdSense association flow. + RedirectUrl string `json:"redirectUrl,omitempty"` + + // Status: Status of the completed association, available once the + // association callback token has been verified. One of ACCEPTED, + // REJECTED, or ERROR. + Status string `json:"status,omitempty"` + + // UserLocale: The preferred locale of the user themselves when going + // through the AdSense association flow. + UserLocale string `json:"userLocale,omitempty"` + + // WebsiteLocale: The locale of the user's hosted website. + WebsiteLocale string `json:"websiteLocale,omitempty"` + + // WebsiteUrl: The URL of the user's hosted website. + WebsiteUrl string `json:"websiteUrl,omitempty"` +} + +type CustomChannel struct { + // Code: Code of this custom channel, not necessarily unique across ad + // clients. + Code string `json:"code,omitempty"` + + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case + // adsensehost#customChannel. + Kind string `json:"kind,omitempty"` + + // Name: Name of this custom channel. + Name string `json:"name,omitempty"` +} + +type CustomChannels struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The custom channels returned in this list response. + Items []*CustomChannel `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsensehost#customChannels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through custom + // channels. To retrieve the next page of results, set the next + // request's "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Report struct { + // Averages: The averages of the report. This is the same length as any + // other row in the report; cells corresponding to dimension columns are + // empty. + Averages []string `json:"averages,omitempty"` + + // Headers: 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. + Headers []*ReportHeaders `json:"headers,omitempty"` + + // Kind: Kind this is, in this case adsensehost#report. + Kind string `json:"kind,omitempty"` + + // Rows: 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. + Rows [][]string `json:"rows,omitempty"` + + // TotalMatchedRows: 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. + TotalMatchedRows int64 `json:"totalMatchedRows,omitempty,string"` + + // Totals: The totals of the report. This is the same length as any + // other row in the report; cells corresponding to dimension columns are + // empty. + Totals []string `json:"totals,omitempty"` + + // Warnings: Any warnings associated with generation of the report. + Warnings []string `json:"warnings,omitempty"` +} + +type ReportHeaders struct { + // Currency: The currency of this column. Only present if the header + // type is METRIC_CURRENCY. + Currency string `json:"currency,omitempty"` + + // Name: The name of the header. + Name string `json:"name,omitempty"` + + // Type: The type of the header; one of DIMENSION, METRIC_TALLY, + // METRIC_RATIO, or METRIC_CURRENCY. + Type string `json:"type,omitempty"` +} + +type UrlChannel struct { + // Id: 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. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case adsensehost#urlChannel. + Kind string `json:"kind,omitempty"` + + // UrlPattern: URL Pattern of this URL channel. Does not include + // "http://" or "https://". Example: www.example.com/home + UrlPattern string `json:"urlPattern,omitempty"` +} + +type UrlChannels struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The URL channels returned in this list response. + Items []*UrlChannel `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsensehost#urlChannels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through URL channels. + // To retrieve the next page of results, set the next request's + // "pageToken" value to this. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +// method id "adsensehost.accounts.get": + +type AccountsGetCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// Get: Get information about the selected associated AdSense account. +func (r *AccountsService) Get(accountId string) *AccountsGetCall { + c := &AccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +func (c *AccountsGetCall) Do() (*Account, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get information about the selected associated AdSense account.", + // "httpMethod": "GET", + // "id": "adsensehost.accounts.get", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to get information about.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}", + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.accounts.list": + +type AccountsListCall struct { + s *Service + filterAdClientId []string + opt_ map[string]interface{} +} + +// List: List hosted accounts associated with this AdSense account by ad +// client id. +func (r *AccountsService) List(filterAdClientId []string) *AccountsListCall { + c := &AccountsListCall{s: r.s, opt_: make(map[string]interface{})} + c.filterAdClientId = filterAdClientId + return c +} + +func (c *AccountsListCall) Do() (*Accounts, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + for _, v := range c.filterAdClientId { + params.Add("filterAdClientId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Accounts) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List hosted accounts associated with this AdSense account by ad client id.", + // "httpMethod": "GET", + // "id": "adsensehost.accounts.list", + // "parameterOrder": [ + // "filterAdClientId" + // ], + // "parameters": { + // "filterAdClientId": { + // "description": "Ad clients to list accounts for.", + // "location": "query", + // "repeated": true, + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts", + // "response": { + // "$ref": "Accounts" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.accounts.adclients.get": + +type AccountsAdclientsGetCall struct { + s *Service + accountId string + adClientId string + opt_ map[string]interface{} +} + +// Get: Get information about one of the ad clients in the specified +// publisher's AdSense account. +func (r *AccountsAdclientsService) Get(accountId string, adClientId string) *AccountsAdclientsGetCall { + c := &AccountsAdclientsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + return c +} + +func (c *AccountsAdclientsGetCall) Do() (*AdClient, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdClient) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get information about one of the ad clients in the specified publisher's AdSense account.", + // "httpMethod": "GET", + // "id": "adsensehost.accounts.adclients.get", + // "parameterOrder": [ + // "accountId", + // "adClientId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account which contains the ad client.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}", + // "response": { + // "$ref": "AdClient" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.accounts.adclients.list": + +type AccountsAdclientsListCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// List: List all hosted ad clients in the specified hosted account. +func (r *AccountsAdclientsService) List(accountId string) *AccountsAdclientsListCall { + c := &AccountsAdclientsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad clients to include in the response, used for paging. +func (c *AccountsAdclientsListCall) MaxResults(maxResults int64) *AccountsAdclientsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsAdclientsListCall) PageToken(pageToken string) *AccountsAdclientsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsAdclientsListCall) Do() (*AdClients, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdClients) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all hosted ad clients in the specified hosted account.", + // "httpMethod": "GET", + // "id": "adsensehost.accounts.adclients.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account for which to list ad clients.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of ad clients to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients", + // "response": { + // "$ref": "AdClients" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.accounts.adunits.delete": + +type AccountsAdunitsDeleteCall struct { + s *Service + accountId string + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// Delete: Delete the specified ad unit from the specified publisher +// AdSense account. +func (r *AccountsAdunitsService) Delete(accountId string, adClientId string, adUnitId string) *AccountsAdunitsDeleteCall { + c := &AccountsAdunitsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +func (c *AccountsAdunitsDeleteCall) Do() (*AdUnit, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Delete the specified ad unit from the specified publisher AdSense account.", + // "httpMethod": "DELETE", + // "id": "adsensehost.accounts.adunits.delete", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account which contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to get ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}", + // "response": { + // "$ref": "AdUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.accounts.adunits.get": + +type AccountsAdunitsGetCall struct { + s *Service + accountId string + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// Get: Get the specified host ad unit in this AdSense account. +func (r *AccountsAdunitsService) Get(accountId string, adClientId string, adUnitId string) *AccountsAdunitsGetCall { + c := &AccountsAdunitsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +func (c *AccountsAdunitsGetCall) Do() (*AdUnit, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the specified host ad unit in this AdSense account.", + // "httpMethod": "GET", + // "id": "adsensehost.accounts.adunits.get", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account which contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to get ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}", + // "response": { + // "$ref": "AdUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.accounts.adunits.getAdCode": + +type AccountsAdunitsGetAdCodeCall struct { + s *Service + accountId string + adClientId string + adUnitId string + opt_ map[string]interface{} +} + +// GetAdCode: Get ad code for the specified ad unit, attaching the +// specified host custom channels. +func (r *AccountsAdunitsService) GetAdCode(accountId string, adClientId string, adUnitId string) *AccountsAdunitsGetAdCodeCall { + c := &AccountsAdunitsGetAdCodeCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.adUnitId = adUnitId + return c +} + +// HostCustomChannelId sets the optional parameter +// "hostCustomChannelId": Host custom channel to attach to the ad code. +func (c *AccountsAdunitsGetAdCodeCall) HostCustomChannelId(hostCustomChannelId string) *AccountsAdunitsGetAdCodeCall { + c.opt_["hostCustomChannelId"] = hostCustomChannelId + return c +} + +func (c *AccountsAdunitsGetAdCodeCall) Do() (*AdCode, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["hostCustomChannelId"]; ok { + params.Set("hostCustomChannelId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adUnitId}", url.QueryEscape(c.adUnitId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdCode) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get ad code for the specified ad unit, attaching the specified host custom channels.", + // "httpMethod": "GET", + // "id": "adsensehost.accounts.adunits.getAdCode", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account which contains the ad client.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client with contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit to get the code for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "hostCustomChannelId": { + // "description": "Host custom channel to attach to the ad code.", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode", + // "response": { + // "$ref": "AdCode" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.accounts.adunits.insert": + +type AccountsAdunitsInsertCall struct { + s *Service + accountId string + adClientId string + adunit *AdUnit + opt_ map[string]interface{} +} + +// Insert: Insert the supplied ad unit into the specified publisher +// AdSense account. +func (r *AccountsAdunitsService) Insert(accountId string, adClientId string, adunit *AdUnit) *AccountsAdunitsInsertCall { + c := &AccountsAdunitsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.adunit = adunit + return c +} + +func (c *AccountsAdunitsInsertCall) Do() (*AdUnit, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.adunit) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Insert the supplied ad unit into the specified publisher AdSense account.", + // "httpMethod": "POST", + // "id": "adsensehost.accounts.adunits.insert", + // "parameterOrder": [ + // "accountId", + // "adClientId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account which will contain the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client into which to insert the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits", + // "request": { + // "$ref": "AdUnit" + // }, + // "response": { + // "$ref": "AdUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.accounts.adunits.list": + +type AccountsAdunitsListCall struct { + s *Service + accountId string + adClientId string + opt_ map[string]interface{} +} + +// List: List all ad units in the specified publisher's AdSense account. +func (r *AccountsAdunitsService) List(accountId string, adClientId string) *AccountsAdunitsListCall { + c := &AccountsAdunitsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": +// Whether to include inactive ad units. Default: true. +func (c *AccountsAdunitsListCall) IncludeInactive(includeInactive bool) *AccountsAdunitsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad units to include in the response, used for paging. +func (c *AccountsAdunitsListCall) MaxResults(maxResults int64) *AccountsAdunitsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AccountsAdunitsListCall) PageToken(pageToken string) *AccountsAdunitsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AccountsAdunitsListCall) Do() (*AdUnits, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnits) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad units in the specified publisher's AdSense account.", + // "httpMethod": "GET", + // "id": "adsensehost.accounts.adunits.list", + // "parameterOrder": [ + // "accountId", + // "adClientId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account which contains the ad client.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client for which to list ad units.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeInactive": { + // "description": "Whether to include inactive ad units. Default: true.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of ad units to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits", + // "response": { + // "$ref": "AdUnits" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.accounts.adunits.patch": + +type AccountsAdunitsPatchCall struct { + s *Service + accountId string + adClientId string + adUnitId string + adunit *AdUnit + opt_ map[string]interface{} +} + +// Patch: Update the supplied ad unit in the specified publisher AdSense +// account. This method supports patch semantics. +func (r *AccountsAdunitsService) Patch(accountId string, adClientId string, adUnitId string, adunit *AdUnit) *AccountsAdunitsPatchCall { + c := &AccountsAdunitsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.adUnitId = adUnitId + c.adunit = adunit + return c +} + +func (c *AccountsAdunitsPatchCall) Do() (*AdUnit, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.adunit) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + params.Set("adUnitId", fmt.Sprintf("%v", c.adUnitId)) + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the supplied ad unit in the specified publisher AdSense account. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "adsensehost.accounts.adunits.patch", + // "parameterOrder": [ + // "accountId", + // "adClientId", + // "adUnitId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account which contains the ad client.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client which contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adUnitId": { + // "description": "Ad unit to get.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits", + // "request": { + // "$ref": "AdUnit" + // }, + // "response": { + // "$ref": "AdUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.accounts.adunits.update": + +type AccountsAdunitsUpdateCall struct { + s *Service + accountId string + adClientId string + adunit *AdUnit + opt_ map[string]interface{} +} + +// Update: Update the supplied ad unit in the specified publisher +// AdSense account. +func (r *AccountsAdunitsService) Update(accountId string, adClientId string, adunit *AdUnit) *AccountsAdunitsUpdateCall { + c := &AccountsAdunitsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.adClientId = adClientId + c.adunit = adunit + return c +} + +func (c *AccountsAdunitsUpdateCall) Do() (*AdUnit, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.adunit) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdUnit) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the supplied ad unit in the specified publisher AdSense account.", + // "httpMethod": "PUT", + // "id": "adsensehost.accounts.adunits.update", + // "parameterOrder": [ + // "accountId", + // "adClientId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account which contains the ad client.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "adClientId": { + // "description": "Ad client which contains the ad unit.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/adclients/{adClientId}/adunits", + // "request": { + // "$ref": "AdUnit" + // }, + // "response": { + // "$ref": "AdUnit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.accounts.reports.generate": + +type AccountsReportsGenerateCall struct { + s *Service + accountId string + startDate string + endDate string + opt_ map[string]interface{} +} + +// Generate: Generate an AdSense 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. +func (r *AccountsReportsService) Generate(accountId string, startDate string, endDate string) *AccountsReportsGenerateCall { + c := &AccountsReportsGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.startDate = startDate + c.endDate = endDate + return c +} + +// Dimension sets the optional parameter "dimension": Dimensions to base +// the report on. +func (c *AccountsReportsGenerateCall) Dimension(dimension string) *AccountsReportsGenerateCall { + c.opt_["dimension"] = dimension + return c +} + +// Filter sets the optional parameter "filter": Filters to be run on the +// report. +func (c *AccountsReportsGenerateCall) Filter(filter string) *AccountsReportsGenerateCall { + c.opt_["filter"] = filter + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *AccountsReportsGenerateCall) Locale(locale string) *AccountsReportsGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *AccountsReportsGenerateCall) MaxResults(maxResults int64) *AccountsReportsGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Metric sets the optional parameter "metric": Numeric columns to +// include in the report. +func (c *AccountsReportsGenerateCall) Metric(metric string) *AccountsReportsGenerateCall { + c.opt_["metric"] = metric + return c +} + +// Sort sets the optional parameter "sort": 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. +func (c *AccountsReportsGenerateCall) Sort(sort string) *AccountsReportsGenerateCall { + c.opt_["sort"] = sort + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *AccountsReportsGenerateCall) StartIndex(startIndex int64) *AccountsReportsGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *AccountsReportsGenerateCall) Do() (*Report, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("endDate", fmt.Sprintf("%v", c.endDate)) + params.Set("startDate", fmt.Sprintf("%v", c.startDate)) + if v, ok := c.opt_["dimension"]; ok { + params.Set("dimension", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["metric"]; ok { + params.Set("metric", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an AdSense 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.", + // "httpMethod": "GET", + // "id": "adsensehost.accounts.reports.generate", + // "parameterOrder": [ + // "accountId", + // "startDate", + // "endDate" + // ], + // "parameters": { + // "accountId": { + // "description": "Hosted account upon which to report.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "dimension": { + // "description": "Dimensions to base the report on.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "endDate": { + // "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)", + // "required": true, + // "type": "string" + // }, + // "filter": { + // "description": "Filters to be run on the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+(==|=@).+", + // "repeated": true, + // "type": "string" + // }, + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "uint32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "metric": { + // "description": "Numeric columns to include in the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "sort": { + // "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.", + // "location": "query", + // "pattern": "(\\+|-)?[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "startDate": { + // "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "uint32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "accounts/{accountId}/reports", + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.adclients.get": + +type AdclientsGetCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// Get: Get information about one of the ad clients in the Host AdSense +// account. +func (r *AdclientsService) Get(adClientId string) *AdclientsGetCall { + c := &AdclientsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +func (c *AdclientsGetCall) Do() (*AdClient, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdClient) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get information about one of the ad clients in the Host AdSense account.", + // "httpMethod": "GET", + // "id": "adsensehost.adclients.get", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}", + // "response": { + // "$ref": "AdClient" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.adclients.list": + +type AdclientsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all host ad clients in this AdSense account. +func (r *AdclientsService) List() *AdclientsListCall { + c := &AdclientsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of ad clients to include in the response, used for paging. +func (c *AdclientsListCall) MaxResults(maxResults int64) *AdclientsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *AdclientsListCall) PageToken(pageToken string) *AdclientsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AdclientsListCall) Do() (*AdClients, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AdClients) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all host ad clients in this AdSense account.", + // "httpMethod": "GET", + // "id": "adsensehost.adclients.list", + // "parameters": { + // "maxResults": { + // "description": "The maximum number of ad clients to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "adclients", + // "response": { + // "$ref": "AdClients" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.associationsessions.start": + +type AssociationsessionsStartCall struct { + s *Service + productCode []string + websiteUrl string + opt_ map[string]interface{} +} + +// Start: Create an association session for initiating an association +// with an AdSense user. +func (r *AssociationsessionsService) Start(productCode []string, websiteUrl string) *AssociationsessionsStartCall { + c := &AssociationsessionsStartCall{s: r.s, opt_: make(map[string]interface{})} + c.productCode = productCode + c.websiteUrl = websiteUrl + return c +} + +// UserLocale sets the optional parameter "userLocale": The preferred +// locale of the user. +func (c *AssociationsessionsStartCall) UserLocale(userLocale string) *AssociationsessionsStartCall { + c.opt_["userLocale"] = userLocale + return c +} + +// WebsiteLocale sets the optional parameter "websiteLocale": The locale +// of the user's hosted website. +func (c *AssociationsessionsStartCall) WebsiteLocale(websiteLocale string) *AssociationsessionsStartCall { + c.opt_["websiteLocale"] = websiteLocale + return c +} + +func (c *AssociationsessionsStartCall) Do() (*AssociationSession, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("websiteUrl", fmt.Sprintf("%v", c.websiteUrl)) + for _, v := range c.productCode { + params.Add("productCode", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["userLocale"]; ok { + params.Set("userLocale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["websiteLocale"]; ok { + params.Set("websiteLocale", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "associationsessions/start") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AssociationSession) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create an association session for initiating an association with an AdSense user.", + // "httpMethod": "GET", + // "id": "adsensehost.associationsessions.start", + // "parameterOrder": [ + // "productCode", + // "websiteUrl" + // ], + // "parameters": { + // "productCode": { + // "description": "Products to associate with the user.", + // "enum": [ + // "AFC", + // "AFG", + // "AFMC", + // "AFS", + // "AFV" + // ], + // "enumDescriptions": [ + // "AdSense For Content", + // "AdSense For Games", + // "AdSense For Mobile Content", + // "AdSense For Search", + // "AdSense For Video" + // ], + // "location": "query", + // "repeated": true, + // "required": true, + // "type": "string" + // }, + // "userLocale": { + // "description": "The preferred locale of the user.", + // "location": "query", + // "type": "string" + // }, + // "websiteLocale": { + // "description": "The locale of the user's hosted website.", + // "location": "query", + // "type": "string" + // }, + // "websiteUrl": { + // "description": "The URL of the user's hosted website.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "associationsessions/start", + // "response": { + // "$ref": "AssociationSession" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.associationsessions.verify": + +type AssociationsessionsVerifyCall struct { + s *Service + token string + opt_ map[string]interface{} +} + +// Verify: Verify an association session after the association callback +// returns from AdSense signup. +func (r *AssociationsessionsService) Verify(token string) *AssociationsessionsVerifyCall { + c := &AssociationsessionsVerifyCall{s: r.s, opt_: make(map[string]interface{})} + c.token = token + return c +} + +func (c *AssociationsessionsVerifyCall) Do() (*AssociationSession, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("token", fmt.Sprintf("%v", c.token)) + urls := googleapi.ResolveRelative(c.s.BasePath, "associationsessions/verify") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AssociationSession) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Verify an association session after the association callback returns from AdSense signup.", + // "httpMethod": "GET", + // "id": "adsensehost.associationsessions.verify", + // "parameterOrder": [ + // "token" + // ], + // "parameters": { + // "token": { + // "description": "The token returned to the association callback URL.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "associationsessions/verify", + // "response": { + // "$ref": "AssociationSession" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.customchannels.delete": + +type CustomchannelsDeleteCall struct { + s *Service + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// Delete: Delete a specific custom channel from the host AdSense +// account. +func (r *CustomchannelsService) Delete(adClientId string, customChannelId string) *CustomchannelsDeleteCall { + c := &CustomchannelsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +func (c *CustomchannelsDeleteCall) Do() (*CustomChannel, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Delete a specific custom channel from the host AdSense account.", + // "httpMethod": "DELETE", + // "id": "adsensehost.customchannels.delete", + // "parameterOrder": [ + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client from which to delete the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels/{customChannelId}", + // "response": { + // "$ref": "CustomChannel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.customchannels.get": + +type CustomchannelsGetCall struct { + s *Service + adClientId string + customChannelId string + opt_ map[string]interface{} +} + +// Get: Get a specific custom channel from the host AdSense account. +func (r *CustomchannelsService) Get(adClientId string, customChannelId string) *CustomchannelsGetCall { + c := &CustomchannelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.customChannelId = customChannelId + return c +} + +func (c *CustomchannelsGetCall) Do() (*CustomChannel, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customChannelId}", url.QueryEscape(c.customChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a specific custom channel from the host AdSense account.", + // "httpMethod": "GET", + // "id": "adsensehost.customchannels.get", + // "parameterOrder": [ + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client from which to get the custom channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels/{customChannelId}", + // "response": { + // "$ref": "CustomChannel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.customchannels.insert": + +type CustomchannelsInsertCall struct { + s *Service + adClientId string + customchannel *CustomChannel + opt_ map[string]interface{} +} + +// Insert: Add a new custom channel to the host AdSense account. +func (r *CustomchannelsService) Insert(adClientId string, customchannel *CustomChannel) *CustomchannelsInsertCall { + c := &CustomchannelsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.customchannel = customchannel + return c +} + +func (c *CustomchannelsInsertCall) Do() (*CustomChannel, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.customchannel) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add a new custom channel to the host AdSense account.", + // "httpMethod": "POST", + // "id": "adsensehost.customchannels.insert", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client to which the new custom channel will be added.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels", + // "request": { + // "$ref": "CustomChannel" + // }, + // "response": { + // "$ref": "CustomChannel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.customchannels.list": + +type CustomchannelsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all host custom channels in this AdSense account. +func (r *CustomchannelsService) List(adClientId string) *CustomchannelsListCall { + c := &CustomchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of custom channels to include in the response, used for +// paging. +func (c *CustomchannelsListCall) MaxResults(maxResults int64) *CustomchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *CustomchannelsListCall) PageToken(pageToken string) *CustomchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CustomchannelsListCall) Do() (*CustomChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all host custom channels in this AdSense account.", + // "httpMethod": "GET", + // "id": "adsensehost.customchannels.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list custom channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of custom channels to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels", + // "response": { + // "$ref": "CustomChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.customchannels.patch": + +type CustomchannelsPatchCall struct { + s *Service + adClientId string + customChannelId string + customchannel *CustomChannel + opt_ map[string]interface{} +} + +// Patch: Update a custom channel in the host AdSense account. This +// method supports patch semantics. +func (r *CustomchannelsService) Patch(adClientId string, customChannelId string, customchannel *CustomChannel) *CustomchannelsPatchCall { + c := &CustomchannelsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.customChannelId = customChannelId + c.customchannel = customchannel + return c +} + +func (c *CustomchannelsPatchCall) Do() (*CustomChannel, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.customchannel) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + params.Set("customChannelId", fmt.Sprintf("%v", c.customChannelId)) + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a custom channel in the host AdSense account. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "adsensehost.customchannels.patch", + // "parameterOrder": [ + // "adClientId", + // "customChannelId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client in which the custom channel will be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customChannelId": { + // "description": "Custom channel to get.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels", + // "request": { + // "$ref": "CustomChannel" + // }, + // "response": { + // "$ref": "CustomChannel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.customchannels.update": + +type CustomchannelsUpdateCall struct { + s *Service + adClientId string + customchannel *CustomChannel + opt_ map[string]interface{} +} + +// Update: Update a custom channel in the host AdSense account. +func (r *CustomchannelsService) Update(adClientId string, customchannel *CustomChannel) *CustomchannelsUpdateCall { + c := &CustomchannelsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.customchannel = customchannel + return c +} + +func (c *CustomchannelsUpdateCall) Do() (*CustomChannel, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.customchannel) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomChannel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a custom channel in the host AdSense account.", + // "httpMethod": "PUT", + // "id": "adsensehost.customchannels.update", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client in which the custom channel will be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/customchannels", + // "request": { + // "$ref": "CustomChannel" + // }, + // "response": { + // "$ref": "CustomChannel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.reports.generate": + +type ReportsGenerateCall struct { + s *Service + startDate string + endDate string + opt_ map[string]interface{} +} + +// Generate: Generate an AdSense 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. +func (r *ReportsService) Generate(startDate string, endDate string) *ReportsGenerateCall { + c := &ReportsGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.startDate = startDate + c.endDate = endDate + return c +} + +// Dimension sets the optional parameter "dimension": Dimensions to base +// the report on. +func (c *ReportsGenerateCall) Dimension(dimension string) *ReportsGenerateCall { + c.opt_["dimension"] = dimension + return c +} + +// Filter sets the optional parameter "filter": Filters to be run on the +// report. +func (c *ReportsGenerateCall) Filter(filter string) *ReportsGenerateCall { + c.opt_["filter"] = filter + return c +} + +// Locale sets the optional parameter "locale": Optional locale to use +// for translating report output to a local language. Defaults to +// "en_US" if not specified. +func (c *ReportsGenerateCall) Locale(locale string) *ReportsGenerateCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rows of report data to return. +func (c *ReportsGenerateCall) MaxResults(maxResults int64) *ReportsGenerateCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Metric sets the optional parameter "metric": Numeric columns to +// include in the report. +func (c *ReportsGenerateCall) Metric(metric string) *ReportsGenerateCall { + c.opt_["metric"] = metric + return c +} + +// Sort sets the optional parameter "sort": 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. +func (c *ReportsGenerateCall) Sort(sort string) *ReportsGenerateCall { + c.opt_["sort"] = sort + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first row of report data to return. +func (c *ReportsGenerateCall) StartIndex(startIndex int64) *ReportsGenerateCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *ReportsGenerateCall) Do() (*Report, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("endDate", fmt.Sprintf("%v", c.endDate)) + params.Set("startDate", fmt.Sprintf("%v", c.startDate)) + if v, ok := c.opt_["dimension"]; ok { + params.Set("dimension", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["metric"]; ok { + params.Set("metric", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an AdSense 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.", + // "httpMethod": "GET", + // "id": "adsensehost.reports.generate", + // "parameterOrder": [ + // "startDate", + // "endDate" + // ], + // "parameters": { + // "dimension": { + // "description": "Dimensions to base the report on.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "endDate": { + // "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)", + // "required": true, + // "type": "string" + // }, + // "filter": { + // "description": "Filters to be run on the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+(==|=@).+", + // "repeated": true, + // "type": "string" + // }, + // "locale": { + // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rows of report data to return.", + // "format": "uint32", + // "location": "query", + // "maximum": "50000", + // "minimum": "0", + // "type": "integer" + // }, + // "metric": { + // "description": "Numeric columns to include in the report.", + // "location": "query", + // "pattern": "[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "sort": { + // "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.", + // "location": "query", + // "pattern": "(\\+|-)?[a-zA-Z_]+", + // "repeated": true, + // "type": "string" + // }, + // "startDate": { + // "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + // "location": "query", + // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first row of report data to return.", + // "format": "uint32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "reports", + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.urlchannels.delete": + +type UrlchannelsDeleteCall struct { + s *Service + adClientId string + urlChannelId string + opt_ map[string]interface{} +} + +// Delete: Delete a URL channel from the host AdSense account. +func (r *UrlchannelsService) Delete(adClientId string, urlChannelId string) *UrlchannelsDeleteCall { + c := &UrlchannelsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.urlChannelId = urlChannelId + return c +} + +func (c *UrlchannelsDeleteCall) Do() (*UrlChannel, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels/{urlChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{urlChannelId}", url.QueryEscape(c.urlChannelId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UrlChannel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Delete a URL channel from the host AdSense account.", + // "httpMethod": "DELETE", + // "id": "adsensehost.urlchannels.delete", + // "parameterOrder": [ + // "adClientId", + // "urlChannelId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client from which to delete the URL channel.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "urlChannelId": { + // "description": "URL channel to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/urlchannels/{urlChannelId}", + // "response": { + // "$ref": "UrlChannel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.urlchannels.insert": + +type UrlchannelsInsertCall struct { + s *Service + adClientId string + urlchannel *UrlChannel + opt_ map[string]interface{} +} + +// Insert: Add a new URL channel to the host AdSense account. +func (r *UrlchannelsService) Insert(adClientId string, urlchannel *UrlChannel) *UrlchannelsInsertCall { + c := &UrlchannelsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + c.urlchannel = urlchannel + return c +} + +func (c *UrlchannelsInsertCall) Do() (*UrlChannel, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlchannel) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UrlChannel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add a new URL channel to the host AdSense account.", + // "httpMethod": "POST", + // "id": "adsensehost.urlchannels.insert", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client to which the new URL channel will be added.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/urlchannels", + // "request": { + // "$ref": "UrlChannel" + // }, + // "response": { + // "$ref": "UrlChannel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} + +// method id "adsensehost.urlchannels.list": + +type UrlchannelsListCall struct { + s *Service + adClientId string + opt_ map[string]interface{} +} + +// List: List all host URL channels in the host AdSense account. +func (r *UrlchannelsService) List(adClientId string) *UrlchannelsListCall { + c := &UrlchannelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.adClientId = adClientId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of URL channels to include in the response, used for paging. +func (c *UrlchannelsListCall) MaxResults(maxResults int64) *UrlchannelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *UrlchannelsListCall) PageToken(pageToken string) *UrlchannelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *UrlchannelsListCall) Do() (*UrlChannels, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{adClientId}", url.QueryEscape(c.adClientId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UrlChannels) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all host URL channels in the host AdSense account.", + // "httpMethod": "GET", + // "id": "adsensehost.urlchannels.list", + // "parameterOrder": [ + // "adClientId" + // ], + // "parameters": { + // "adClientId": { + // "description": "Ad client for which to list URL channels.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of URL channels to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "maximum": "10000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // } + // }, + // "path": "adclients/{adClientId}/urlchannels", + // "response": { + // "$ref": "UrlChannels" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adsensehost" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/analytics/v2.4/analytics-api.json b/third_party/src/code.google.com/p/google-api-go-client/analytics/v2.4/analytics-api.json new file mode 100644 index 0000000000000..8aae151778754 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/analytics/v2.4/analytics-api.json @@ -0,0 +1,365 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/g0dlAqv19pD_cw5NLrQ2z9eB7ig\"", + "discoveryVersion": "v1", + "id": "analytics:v2.4", + "name": "analytics", + "version": "v2.4", + "title": "Google Analytics API", + "description": "View and manage your Google Analytics data", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/analytics-16.png", + "x32": "http://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:visits,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" + ] + } + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/analytics/v2.4/analytics-gen.go b/third_party/src/code.google.com/p/google-api-go-client/analytics/v2.4/analytics-gen.go new file mode 100644 index 0000000000000..8f3834ba8d649 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/analytics/v2.4/analytics-gen.go @@ -0,0 +1,803 @@ +// Package analytics provides access to the Google Analytics API. +// +// See https://developers.google.com/analytics/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/analytics/v2.4" +// ... +// analyticsService, err := analytics.New(oauthHttpClient) +package analytics + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "analytics:v2.4" +const apiName = "analytics" +const apiVersion = "v2.4" +const basePath = "https://www.googleapis.com/analytics/v2.4/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Google Analytics data + AnalyticsScope = "https://www.googleapis.com/auth/analytics" + + // View your Google Analytics data + AnalyticsReadonlyScope = "https://www.googleapis.com/auth/analytics.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.Data = NewDataService(s) + s.Management = NewManagementService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Data *DataService + + Management *ManagementService +} + +func NewDataService(s *Service) *DataService { + rs := &DataService{s: s} + return rs +} + +type DataService struct { + s *Service +} + +func NewManagementService(s *Service) *ManagementService { + rs := &ManagementService{s: s} + rs.Accounts = NewManagementAccountsService(s) + rs.Goals = NewManagementGoalsService(s) + rs.Profiles = NewManagementProfilesService(s) + rs.Segments = NewManagementSegmentsService(s) + rs.Webproperties = NewManagementWebpropertiesService(s) + return rs +} + +type ManagementService struct { + s *Service + + Accounts *ManagementAccountsService + + Goals *ManagementGoalsService + + Profiles *ManagementProfilesService + + Segments *ManagementSegmentsService + + Webproperties *ManagementWebpropertiesService +} + +func NewManagementAccountsService(s *Service) *ManagementAccountsService { + rs := &ManagementAccountsService{s: s} + return rs +} + +type ManagementAccountsService struct { + s *Service +} + +func NewManagementGoalsService(s *Service) *ManagementGoalsService { + rs := &ManagementGoalsService{s: s} + return rs +} + +type ManagementGoalsService struct { + s *Service +} + +func NewManagementProfilesService(s *Service) *ManagementProfilesService { + rs := &ManagementProfilesService{s: s} + return rs +} + +type ManagementProfilesService struct { + s *Service +} + +func NewManagementSegmentsService(s *Service) *ManagementSegmentsService { + rs := &ManagementSegmentsService{s: s} + return rs +} + +type ManagementSegmentsService struct { + s *Service +} + +func NewManagementWebpropertiesService(s *Service) *ManagementWebpropertiesService { + rs := &ManagementWebpropertiesService{s: s} + return rs +} + +type ManagementWebpropertiesService struct { + s *Service +} + +// method id "analytics.data.get": + +type DataGetCall struct { + s *Service + ids string + startDate string + endDate string + metrics string + opt_ map[string]interface{} +} + +// Get: Returns Analytics report data for a view (profile). +func (r *DataService) Get(ids string, startDate string, endDate string, metrics string) *DataGetCall { + c := &DataGetCall{s: r.s, opt_: make(map[string]interface{})} + c.ids = ids + c.startDate = startDate + c.endDate = endDate + c.metrics = metrics + return c +} + +// Dimensions sets the optional parameter "dimensions": A +// comma-separated list of Analytics dimensions. E.g., +// 'ga:browser,ga:city'. +func (c *DataGetCall) Dimensions(dimensions string) *DataGetCall { + c.opt_["dimensions"] = dimensions + return c +} + +// Filters sets the optional parameter "filters": A comma-separated list +// of dimension or metric filters to be applied to the report data. +func (c *DataGetCall) Filters(filters string) *DataGetCall { + c.opt_["filters"] = filters + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of entries to include in this feed. +func (c *DataGetCall) MaxResults(maxResults int64) *DataGetCall { + c.opt_["max-results"] = maxResults + return c +} + +// Segment sets the optional parameter "segment": An Analytics advanced +// segment to be applied to the report data. +func (c *DataGetCall) Segment(segment string) *DataGetCall { + c.opt_["segment"] = segment + return c +} + +// Sort sets the optional parameter "sort": A comma-separated list of +// dimensions or metrics that determine the sort order for the report +// data. +func (c *DataGetCall) Sort(sort string) *DataGetCall { + c.opt_["sort"] = sort + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first entity to retrieve. Use this parameter as a pagination +// mechanism along with the max-results parameter. +func (c *DataGetCall) StartIndex(startIndex int64) *DataGetCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *DataGetCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("end-date", fmt.Sprintf("%v", c.endDate)) + params.Set("ids", fmt.Sprintf("%v", c.ids)) + params.Set("metrics", fmt.Sprintf("%v", c.metrics)) + params.Set("start-date", fmt.Sprintf("%v", c.startDate)) + if v, ok := c.opt_["dimensions"]; ok { + params.Set("dimensions", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filters"]; ok { + params.Set("filters", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["segment"]; ok { + params.Set("segment", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "data") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Returns Analytics report data for a view (profile).", + // "httpMethod": "GET", + // "id": "analytics.data.get", + // "parameterOrder": [ + // "ids", + // "start-date", + // "end-date", + // "metrics" + // ], + // "parameters": { + // "dimensions": { + // "description": "A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'.", + // "location": "query", + // "pattern": "(ga:.+)?", + // "type": "string" + // }, + // "end-date": { + // "description": "End date for fetching report data. All requests should specify an end date formatted as YYYY-MM-DD.", + // "location": "query", + // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}", + // "required": true, + // "type": "string" + // }, + // "filters": { + // "description": "A comma-separated list of dimension or metric filters to be applied to the report data.", + // "location": "query", + // "pattern": "ga:.+", + // "type": "string" + // }, + // "ids": { + // "description": "Unique table ID for retrieving report data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID.", + // "location": "query", + // "pattern": "ga:[0-9]+", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of entries to include in this feed.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "metrics": { + // "description": "A comma-separated list of Analytics metrics. E.g., 'ga:visits,ga:pageviews'. At least one metric must be specified to retrieve a valid Analytics report.", + // "location": "query", + // "pattern": "ga:.+", + // "required": true, + // "type": "string" + // }, + // "segment": { + // "description": "An Analytics advanced segment to be applied to the report data.", + // "location": "query", + // "type": "string" + // }, + // "sort": { + // "description": "A comma-separated list of dimensions or metrics that determine the sort order for the report data.", + // "location": "query", + // "pattern": "(-)?ga:.+", + // "type": "string" + // }, + // "start-date": { + // "description": "Start date for fetching report data. All requests should specify a start date formatted as YYYY-MM-DD.", + // "location": "query", + // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}", + // "required": true, + // "type": "string" + // }, + // "start-index": { + // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // } + // }, + // "path": "data", + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.accounts.list": + +type ManagementAccountsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Lists all accounts to which the user has access. +func (r *ManagementAccountsService) List() *ManagementAccountsListCall { + c := &ManagementAccountsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of accounts to include in this response. +func (c *ManagementAccountsListCall) MaxResults(maxResults int64) *ManagementAccountsListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first account to retrieve. Use this parameter as a pagination +// mechanism along with the max-results parameter. +func (c *ManagementAccountsListCall) StartIndex(startIndex int64) *ManagementAccountsListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ManagementAccountsListCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Lists all accounts to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.accounts.list", + // "parameters": { + // "max-results": { + // "description": "The maximum number of accounts to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "start-index": { + // "description": "An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // } + // }, + // "path": "management/accounts", + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.goals.list": + +type ManagementGoalsListCall struct { + s *Service + accountId string + webPropertyId string + profileId string + opt_ map[string]interface{} +} + +// List: Lists goals to which the user has access. +func (r *ManagementGoalsService) List(accountId string, webPropertyId string, profileId string) *ManagementGoalsListCall { + c := &ManagementGoalsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of goals to include in this response. +func (c *ManagementGoalsListCall) MaxResults(maxResults int64) *ManagementGoalsListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first goal to retrieve. Use this parameter as a pagination mechanism +// along with the max-results parameter. +func (c *ManagementGoalsListCall) StartIndex(startIndex int64) *ManagementGoalsListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ManagementGoalsListCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Lists goals to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.goals.list", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to retrieve goals for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of goals to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "profileId": { + // "description": "View (Profile) ID to retrieve goals for. Can either be a specific view (profile) ID or '~all', which refers to all the views (profiles) that user has access to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "start-index": { + // "description": "An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "webPropertyId": { + // "description": "Web property ID to retrieve goals for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals", + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.profiles.list": + +type ManagementProfilesListCall struct { + s *Service + accountId string + webPropertyId string + opt_ map[string]interface{} +} + +// List: Lists views (profiles) to which the user has access. +func (r *ManagementProfilesService) List(accountId string, webPropertyId string) *ManagementProfilesListCall { + c := &ManagementProfilesListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of views (profiles) to include in this response. +func (c *ManagementProfilesListCall) MaxResults(maxResults int64) *ManagementProfilesListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first entity to retrieve. Use this parameter as a pagination +// mechanism along with the max-results parameter. +func (c *ManagementProfilesListCall) StartIndex(startIndex int64) *ManagementProfilesListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ManagementProfilesListCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Lists views (profiles) to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.profiles.list", + // "parameterOrder": [ + // "accountId", + // "webPropertyId" + // ], + // "parameters": { + // "accountId": { + // "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.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of views (profiles) to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "start-index": { + // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "webPropertyId": { + // "description": "Web property ID 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.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles", + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.segments.list": + +type ManagementSegmentsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Lists advanced segments to which the user has access. +func (r *ManagementSegmentsService) List() *ManagementSegmentsListCall { + c := &ManagementSegmentsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of advanced segments to include in this response. +func (c *ManagementSegmentsListCall) MaxResults(maxResults int64) *ManagementSegmentsListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first advanced segment to retrieve. Use this parameter as a +// pagination mechanism along with the max-results parameter. +func (c *ManagementSegmentsListCall) StartIndex(startIndex int64) *ManagementSegmentsListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ManagementSegmentsListCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/segments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Lists advanced segments to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.segments.list", + // "parameters": { + // "max-results": { + // "description": "The maximum number of advanced segments to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "start-index": { + // "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", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // } + // }, + // "path": "management/segments", + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.webproperties.list": + +type ManagementWebpropertiesListCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// List: Lists web properties to which the user has access. +func (r *ManagementWebpropertiesService) List(accountId string) *ManagementWebpropertiesListCall { + c := &ManagementWebpropertiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of web properties to include in this response. +func (c *ManagementWebpropertiesListCall) MaxResults(maxResults int64) *ManagementWebpropertiesListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first entity to retrieve. Use this parameter as a pagination +// mechanism along with the max-results parameter. +func (c *ManagementWebpropertiesListCall) StartIndex(startIndex int64) *ManagementWebpropertiesListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ManagementWebpropertiesListCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Lists web properties to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.webproperties.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "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.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of web properties to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "start-index": { + // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties", + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/analytics/v3/analytics-api.json b/third_party/src/code.google.com/p/google-api-go-client/analytics/v3/analytics-api.json new file mode 100644 index 0000000000000..7be6702b2aa17 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/analytics/v3/analytics-api.json @@ -0,0 +1,4749 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/nYpof5sWVgQxA1Kf0FAXxMsfkXY\"", + "discoveryVersion": "v1", + "id": "analytics:v3", + "name": "analytics", + "version": "v3", + "title": "Google Analytics API", + "description": "View and manage your Google Analytics data", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/analytics-16.png", + "x32": "http://www.google.com/images/icons/product/analytics-32.png" + }, + "documentationLink": "https://developers.google.com/analytics/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/analytics/v3/", + "basePath": "/analytics/v3/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "analytics/v3/", + "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": "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.edit": { + "description": "Edit Google Analytics management entities" + }, + "https://www.googleapis.com/auth/analytics.manage.users": { + "description": "Manage Google Analytics Account users by email address" + }, + "https://www.googleapis.com/auth/analytics.readonly": { + "description": "View your Google Analytics data" + } + } + } + }, + "schemas": { + "Account": { + "id": "Account", + "type": "object", + "description": "JSON template for Analytics account entry.", + "properties": { + "childLink": { + "type": "object", + "description": "Child link for an account entry. Points to the list of web properties for this account.", + "properties": { + "href": { + "type": "string", + "description": "Link to the list of web properties for this account." + }, + "type": { + "type": "string", + "description": "Type of the child link. Its value is \"analytics#webproperties\".", + "default": "analytics#webproperties" + } + } + }, + "created": { + "type": "string", + "description": "Time the account was created.", + "format": "date-time" + }, + "id": { + "type": "string", + "description": "Account ID." + }, + "kind": { + "type": "string", + "description": "Resource type for Analytics account.", + "default": "analytics#account" + }, + "name": { + "type": "string", + "description": "Account name." + }, + "permissions": { + "type": "object", + "description": "Permissions the user has for this account.", + "properties": { + "effective": { + "type": "array", + "description": "All the permissions that the user has for this account. These include any implied permissions (e.g., EDIT implies VIEW).", + "readOnly": true, + "items": { + "type": "string" + } + } + } + }, + "selfLink": { + "type": "string", + "description": "Link for this account." + }, + "updated": { + "type": "string", + "description": "Time the account was last modified.", + "format": "date-time" + } + } + }, + "AccountRef": { + "id": "AccountRef", + "type": "object", + "description": "JSON template for a linked account.", + "properties": { + "href": { + "type": "string", + "description": "Link for this account." + }, + "id": { + "type": "string", + "description": "Account ID." + }, + "kind": { + "type": "string", + "description": "Analytics account reference.", + "default": "analytics#accountRef" + }, + "name": { + "type": "string", + "description": "Account name." + } + } + }, + "AccountSummaries": { + "id": "AccountSummaries", + "type": "object", + "description": "An AccountSummary collection lists a summary of accounts, properties and views (profiles) to which the user has access. Each resource in the collection corresponds to a single AccountSummary.", + "properties": { + "items": { + "type": "array", + "description": "A list of AccountSummaries.", + "items": { + "$ref": "AccountSummary" + } + }, + "itemsPerPage": { + "type": "integer", + "description": "The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Collection type.", + "default": "analytics#accountSummaries" + }, + "nextLink": { + "type": "string", + "description": "Link to next page for this AccountSummary collection." + }, + "previousLink": { + "type": "string", + "description": "Link to previous page for this AccountSummary collection." + }, + "startIndex": { + "type": "integer", + "description": "The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.", + "format": "int32" + }, + "totalResults": { + "type": "integer", + "description": "The total number of results for the query, regardless of the number of results in the response.", + "format": "int32" + }, + "username": { + "type": "string", + "description": "Email ID of the authenticated user" + } + } + }, + "AccountSummary": { + "id": "AccountSummary", + "type": "object", + "description": "JSON template for an Analytics AccountSummary. An AccountSummary is a lightweight tree comprised of properties/profiles.", + "properties": { + "id": { + "type": "string", + "description": "Account ID." + }, + "kind": { + "type": "string", + "description": "Resource type for Analytics AccountSummary.", + "default": "analytics#accountSummary" + }, + "name": { + "type": "string", + "description": "Account name." + }, + "webProperties": { + "type": "array", + "description": "List of web properties under this account.", + "items": { + "$ref": "WebPropertySummary" + } + } + } + }, + "Accounts": { + "id": "Accounts", + "type": "object", + "description": "An account collection provides a list of Analytics accounts to which a user has access. The account collection is the entry point to all management information. Each resource in the collection corresponds to a single Analytics account.", + "properties": { + "items": { + "type": "array", + "description": "A list of accounts.", + "items": { + "$ref": "Account" + } + }, + "itemsPerPage": { + "type": "integer", + "description": "The maximum number of entries the response can contain, regardless of the actual number of entries returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Collection type.", + "default": "analytics#accounts" + }, + "nextLink": { + "type": "string", + "description": "Next link for this account collection." + }, + "previousLink": { + "type": "string", + "description": "Previous link for this account collection." + }, + "startIndex": { + "type": "integer", + "description": "The starting index of the entries, which is 1 by default or otherwise specified by the start-index query parameter.", + "format": "int32" + }, + "totalResults": { + "type": "integer", + "description": "The total number of results for the query, regardless of the number of results in the response.", + "format": "int32" + }, + "username": { + "type": "string", + "description": "Email ID of the authenticated user" + } + } + }, + "AnalyticsDataimportDeleteUploadDataRequest": { + "id": "AnalyticsDataimportDeleteUploadDataRequest", + "type": "object", + "description": "Request template for the delete upload data request.", + "properties": { + "customDataImportUids": { + "type": "array", + "description": "A list of upload UIDs.", + "items": { + "type": "string" + } + } + } + }, + "Column": { + "id": "Column", + "type": "object", + "description": "JSON template for a metadata column.", + "properties": { + "attributes": { + "type": "object", + "description": "Map of attribute name and value for this column.", + "additionalProperties": { + "type": "string", + "description": "The name of the attribute." + } + }, + "id": { + "type": "string", + "description": "Column id." + }, + "kind": { + "type": "string", + "description": "Resource type for Analytics column.", + "default": "analytics#column" + } + } + }, + "Columns": { + "id": "Columns", + "type": "object", + "description": "Lists columns (dimensions and metrics) for a particular report type.", + "properties": { + "attributeNames": { + "type": "array", + "description": "List of attributes names returned by columns.", + "items": { + "type": "string" + } + }, + "etag": { + "type": "string", + "description": "Etag of collection. This etag can be compared with the last response etag to check if response has changed." + }, + "items": { + "type": "array", + "description": "List of columns for a report type.", + "items": { + "$ref": "Column" + } + }, + "kind": { + "type": "string", + "description": "Collection type.", + "default": "analytics#columns" + }, + "totalResults": { + "type": "integer", + "description": "Total number of columns returned in the response.", + "format": "int32" + } + } + }, + "CustomDataSource": { + "id": "CustomDataSource", + "type": "object", + "description": "JSON template for an Analytics custom data source.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID to which this custom data source belongs." + }, + "childLink": { + "type": "object", + "properties": { + "href": { + "type": "string", + "description": "Link to the list of daily uploads for this custom data source. Link to the list of uploads for this custom data source." + }, + "type": { + "type": "string", + "description": "Value is \"analytics#dailyUploads\". Value is \"analytics#uploads\"." + } + } + }, + "created": { + "type": "string", + "description": "Time this custom data source was created.", + "format": "date-time" + }, + "description": { + "type": "string", + "description": "Description of custom data source." + }, + "id": { + "type": "string", + "description": "Custom data source ID." + }, + "kind": { + "type": "string", + "description": "Resource type for Analytics custom data source.", + "default": "analytics#customDataSource" + }, + "name": { + "type": "string", + "description": "Name of this custom data source." + }, + "parentLink": { + "type": "object", + "description": "Parent link for this custom data source. Points to the web property to which this custom data source belongs.", + "properties": { + "href": { + "type": "string", + "description": "Link to the web property to which this custom data source belongs." + }, + "type": { + "type": "string", + "description": "Value is \"analytics#webproperty\".", + "default": "analytics#webproperty" + } + } + }, + "profilesLinked": { + "type": "array", + "description": "IDs of views (profiles) linked to the custom data source.", + "items": { + "type": "string" + } + }, + "selfLink": { + "type": "string", + "description": "Link for this Analytics custom data source." + }, + "type": { + "type": "string", + "description": "Type of the custom data source." + }, + "updated": { + "type": "string", + "description": "Time this custom data source was last modified.", + "format": "date-time" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID of the form UA-XXXXX-YY to which this custom data source belongs." + } + } + }, + "CustomDataSources": { + "id": "CustomDataSources", + "type": "object", + "description": "Lists Analytics custom data sources to which the user has access. Each resource in the collection corresponds to a single Analytics custom data source.", + "properties": { + "items": { + "type": "array", + "description": "Collection of custom data sources.", + "items": { + "$ref": "CustomDataSource" + } + }, + "itemsPerPage": { + "type": "integer", + "description": "The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Collection type.", + "default": "analytics#customDataSources" + }, + "nextLink": { + "type": "string", + "description": "Link to next page for this custom data source collection." + }, + "previousLink": { + "type": "string", + "description": "Link to previous page for this custom data source collection." + }, + "startIndex": { + "type": "integer", + "description": "The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.", + "format": "int32" + }, + "totalResults": { + "type": "integer", + "description": "The total number of results for the query, regardless of the number of results in the response.", + "format": "int32" + }, + "username": { + "type": "string", + "description": "Email ID of the authenticated user" + } + } + }, + "DailyUpload": { + "id": "DailyUpload", + "type": "object", + "description": "Metadata for daily upload entity.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID to which this daily upload belongs." + }, + "appendCount": { + "type": "integer", + "description": "Number of appends for this date.", + "format": "int32" + }, + "createdTime": { + "type": "string", + "description": "Time this daily upload was created.", + "format": "date-time" + }, + "customDataSourceId": { + "type": "string", + "description": "Custom data source ID to which this daily upload belongs." + }, + "date": { + "type": "string", + "description": "Date associated with daily upload." + }, + "kind": { + "type": "string", + "description": "Resource type for Analytics daily upload.", + "default": "analytics#dailyUpload" + }, + "modifiedTime": { + "type": "string", + "description": "Time this daily upload was last modified.", + "format": "date-time" + }, + "parentLink": { + "type": "object", + "description": "Parent link for a daily upload. Points to the custom data source to which this daily upload belongs.", + "properties": { + "href": { + "type": "string", + "description": "Link to the custom data source to which this daily upload belongs." + }, + "type": { + "type": "string", + "description": "Value is \"analytics#customDataSource\".", + "default": "analytics#customDataSource" + } + } + }, + "recentChanges": { + "type": "array", + "description": "Change log for last 10 changes in chronological order.", + "items": { + "type": "object", + "properties": { + "change": { + "type": "string", + "description": "The type of change: APPEND, RESET, or DELETE." + }, + "time": { + "type": "string", + "description": "The time when the change occurred.", + "format": "date-time" + } + } + } + }, + "selfLink": { + "type": "string", + "description": "Link for this daily upload." + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID of the form UA-XXXXX-YY to which this daily upload belongs." + } + } + }, + "DailyUploadAppend": { + "id": "DailyUploadAppend", + "type": "object", + "description": "Metadata returned for a successful append operation.", + "properties": { + "accountId": { + "type": "string", + "description": "Account Id to which this daily upload append belongs." + }, + "appendNumber": { + "type": "integer", + "description": "Append number.", + "format": "int32" + }, + "customDataSourceId": { + "type": "string", + "description": "Custom data source Id to which this daily upload append belongs." + }, + "date": { + "type": "string", + "description": "Date associated with daily upload append." + }, + "kind": { + "type": "string", + "description": "Resource type for Analytics daily upload append.", + "default": "analytics#dailyUploadAppend" + }, + "nextAppendLink": { + "type": "string" + }, + "webPropertyId": { + "type": "string", + "description": "Web property Id of the form UA-XXXXX-YY to which this daily upload append belongs." + } + } + }, + "DailyUploads": { + "id": "DailyUploads", + "type": "object", + "description": "A daily upload collection lists Analytics daily uploads to which the user has access. Each resource in the collection corresponds to a single Analytics daily upload.", + "properties": { + "items": { + "type": "array", + "description": "A collection of daily uploads.", + "items": { + "$ref": "DailyUpload" + } + }, + "itemsPerPage": { + "type": "integer", + "description": "The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Collection type. Value is analytics#dailyUploads.", + "default": "analytics#dailyUploads" + }, + "nextLink": { + "type": "string", + "description": "Link to next page for this daily upload collection." + }, + "previousLink": { + "type": "string", + "description": "Link to previous page for this daily upload collection." + }, + "startIndex": { + "type": "integer", + "description": "The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.", + "format": "int32" + }, + "totalResults": { + "type": "integer", + "description": "The total number of results for the query, regardless of the number of results in the response.", + "format": "int32" + }, + "username": { + "type": "string", + "description": "Email ID of the authenticated user" + } + } + }, + "EntityUserLink": { + "id": "EntityUserLink", + "type": "object", + "description": "JSON template for an Analytics Entity-User Link. Returns permissions that a user has for an entity.", + "properties": { + "entity": { + "type": "object", + "description": "Entity for this link. It can be an account, a web property, or a view (profile).", + "properties": { + "accountRef": { + "$ref": "AccountRef", + "description": "Account for this link." + }, + "profileRef": { + "$ref": "ProfileRef", + "description": "View (Profile) for this link." + }, + "webPropertyRef": { + "$ref": "WebPropertyRef", + "description": "Web property for this link." + } + } + }, + "id": { + "type": "string", + "description": "Entity user link ID" + }, + "kind": { + "type": "string", + "description": "Resource type for entity user link.", + "default": "analytics#entityUserLink" + }, + "permissions": { + "type": "object", + "description": "Permissions the user has for this entity.", + "properties": { + "effective": { + "type": "array", + "description": "Effective permissions represent all the permissions that a user has for this entity. These include any implied permissions (e.g., EDIT implies VIEW) or inherited permissions from the parent entity. Effective permissions are read-only.", + "readOnly": true, + "items": { + "type": "string" + } + }, + "local": { + "type": "array", + "description": "Permissions that a user has been assigned at this very level. Does not include any implied or inherited permissions. Local permissions are modifiable.", + "items": { + "type": "string" + } + } + } + }, + "selfLink": { + "type": "string", + "description": "Self link for this resource." + }, + "userRef": { + "$ref": "UserRef", + "description": "User reference." + } + } + }, + "EntityUserLinks": { + "id": "EntityUserLinks", + "type": "object", + "description": "An entity user link collection provides a list of Analytics ACL links Each resource in this collection corresponds to a single link.", + "properties": { + "items": { + "type": "array", + "description": "A list of entity user links.", + "items": { + "$ref": "EntityUserLink" + } + }, + "itemsPerPage": { + "type": "integer", + "description": "The maximum number of entries the response can contain, regardless of the actual number of entries returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Collection type.", + "default": "analytics#entityUserLinks" + }, + "nextLink": { + "type": "string", + "description": "Next link for this account collection." + }, + "previousLink": { + "type": "string", + "description": "Previous link for this account collection." + }, + "startIndex": { + "type": "integer", + "description": "The starting index of the entries, which is 1 by default or otherwise specified by the start-index query parameter.", + "format": "int32" + }, + "totalResults": { + "type": "integer", + "description": "The total number of results for the query, regardless of the number of results in the response.", + "format": "int32" + } + } + }, + "Experiment": { + "id": "Experiment", + "type": "object", + "description": "JSON template for Analytics experiment resource.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID to which this experiment belongs. This field is read-only." + }, + "created": { + "type": "string", + "description": "Time the experiment was created. This field is read-only.", + "format": "date-time" + }, + "description": { + "type": "string", + "description": "Notes about this experiment." + }, + "editableInGaUi": { + "type": "boolean", + "description": "If true, the end user will be able to edit the experiment via the Google Analytics user interface." + }, + "endTime": { + "type": "string", + "description": "The ending time of the experiment (the time the status changed from RUNNING to ENDED). This field is present only if the experiment has ended. This field is read-only.", + "format": "date-time" + }, + "equalWeighting": { + "type": "boolean", + "description": "Boolean specifying whether to distribute traffic evenly across all variations. If the value is False, content experiments follows the default behavior of adjusting traffic dynamically based on variation performance. Optional -- defaults to False. This field may not be changed for an experiment whose status is ENDED." + }, + "id": { + "type": "string", + "description": "Experiment ID. Required for patch and update. Disallowed for create.", + "annotations": { + "required": [ + "analytics.management.experiments.patch", + "analytics.management.experiments.update" + ] + } + }, + "internalWebPropertyId": { + "type": "string", + "description": "Internal ID for the web property to which this experiment belongs. This field is read-only." + }, + "kind": { + "type": "string", + "description": "Resource type for an Analytics experiment. This field is read-only.", + "default": "analytics#experiment" + }, + "minimumExperimentLengthInDays": { + "type": "integer", + "description": "Specifies the minimum length of the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED.", + "format": "int32" + }, + "name": { + "type": "string", + "description": "Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment.", + "annotations": { + "required": [ + "analytics.management.experiments.insert", + "analytics.management.experiments.update" + ] + } + }, + "objectiveMetric": { + "type": "string", + "description": "The metric that the experiment is optimizing. Valid values: \"ga:goal(n)Completions\", \"ga:adsenseAdsClicks\", \"ga:adsenseAdsViewed\", \"ga:adsenseRevenue\", \"ga:bounces\", \"ga:pageviews\", \"ga:timeOnSite\", \"ga:transactions\", \"ga:transactionRevenue\". This field is required if status is \"RUNNING\" and servingFramework is one of \"REDIRECT\" or \"API\"." + }, + "optimizationType": { + "type": "string", + "description": "Whether the objectiveMetric should be minimized or maximized. Possible values: \"MAXIMUM\", \"MINIMUM\". Optional--defaults to \"MAXIMUM\". Cannot be specified without objectiveMetric. Cannot be modified when status is \"RUNNING\" or \"ENDED\"." + }, + "parentLink": { + "type": "object", + "description": "Parent link for an experiment. Points to the view (profile) to which this experiment belongs.", + "properties": { + "href": { + "type": "string", + "description": "Link to the view (profile) to which this experiment belongs. This field is read-only." + }, + "type": { + "type": "string", + "description": "Value is \"analytics#profile\". This field is read-only.", + "default": "analytics#profile" + } + } + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to which this experiment belongs. This field is read-only." + }, + "reasonExperimentEnded": { + "type": "string", + "description": "Why the experiment ended. Possible values: \"STOPPED_BY_USER\", \"WINNER_FOUND\", \"EXPERIMENT_EXPIRED\", \"ENDED_WITH_NO_WINNER\", \"GOAL_OBJECTIVE_CHANGED\". \"ENDED_WITH_NO_WINNER\" means that the experiment didn't expire but no winner was projected to be found. If the experiment status is changed via the API to ENDED this field is set to STOPPED_BY_USER. This field is read-only." + }, + "rewriteVariationUrlsAsOriginal": { + "type": "boolean", + "description": "Boolean specifying whether variations URLS are rewritten to match those of the original. This field may not be changed for an experiments whose status is ENDED." + }, + "selfLink": { + "type": "string", + "description": "Link for this experiment. This field is read-only." + }, + "servingFramework": { + "type": "string", + "description": "The framework used to serve the experiment variations and evaluate the results. One of: \n- REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results.\n- API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation.\n- EXTERNAL: The variations will be served externally and the chosen variation reported to Google Analytics. The caller is responsible for serving the selected variation and evaluating the results." + }, + "snippet": { + "type": "string", + "description": "The snippet of code to include on the control page(s). This field is read-only." + }, + "startTime": { + "type": "string", + "description": "The starting time of the experiment (the time the status changed from READY_TO_RUN to RUNNING). This field is present only if the experiment has started. This field is read-only.", + "format": "date-time" + }, + "status": { + "type": "string", + "description": "Experiment status. Possible values: \"DRAFT\", \"READY_TO_RUN\", \"RUNNING\", \"ENDED\". Experiments can be created in the \"DRAFT\", \"READY_TO_RUN\" or \"RUNNING\" state. This field is required when creating an experiment.", + "annotations": { + "required": [ + "analytics.management.experiments.insert", + "analytics.management.experiments.update" + ] + } + }, + "trafficCoverage": { + "type": "number", + "description": "A floating-point number between 0 and 1. Specifies the fraction of the traffic that participates in the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED.", + "format": "double" + }, + "updated": { + "type": "string", + "description": "Time the experiment was last modified. This field is read-only.", + "format": "date-time" + }, + "variations": { + "type": "array", + "description": "Array of variations. The first variation in the array is the original. The number of variations may not change once an experiment is in the RUNNING state. At least two variations are required before status can be set to RUNNING.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED.", + "annotations": { + "required": [ + "analytics.management.experiments.insert", + "analytics.management.experiments.update" + ] + } + }, + "status": { + "type": "string", + "description": "Status of the variation. Possible values: \"ACTIVE\", \"INACTIVE\". INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED." + }, + "url": { + "type": "string", + "description": "The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED." + }, + "weight": { + "type": "number", + "description": "Weight that this variation should receive. Only present if the experiment is running. This field is read-only.", + "format": "double" + }, + "won": { + "type": "boolean", + "description": "True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only." + } + } + } + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only." + }, + "winnerConfidenceLevel": { + "type": "number", + "description": "A floating-point number between 0 and 1. Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose status is ENDED.", + "format": "double" + }, + "winnerFound": { + "type": "boolean", + "description": "Boolean specifying whether a winner has been found for this experiment. This field is read-only." + } + } + }, + "Experiments": { + "id": "Experiments", + "type": "object", + "description": "An experiment collection lists Analytics experiments to which the user has access. Each view (profile) can have a set of experiments. Each resource in the Experiment collection corresponds to a single Analytics experiment.", + "properties": { + "items": { + "type": "array", + "description": "A list of experiments.", + "items": { + "$ref": "Experiment" + } + }, + "itemsPerPage": { + "type": "integer", + "description": "The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Collection type.", + "default": "analytics#experiments" + }, + "nextLink": { + "type": "string", + "description": "Link to next page for this experiment collection." + }, + "previousLink": { + "type": "string", + "description": "Link to previous page for this experiment collection." + }, + "startIndex": { + "type": "integer", + "description": "The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.", + "format": "int32" + }, + "totalResults": { + "type": "integer", + "description": "The total number of results for the query, regardless of the number of resources in the result.", + "format": "int32" + }, + "username": { + "type": "string", + "description": "Email ID of the authenticated user" + } + } + }, + "GaData": { + "id": "GaData", + "type": "object", + "description": "Analytics data for a given view (profile).", + "properties": { + "columnHeaders": { + "type": "array", + "description": "Column headers that list dimension names followed by the metric names. The order of dimensions and metrics is same as specified in the request.", + "items": { + "type": "object", + "properties": { + "columnType": { + "type": "string", + "description": "Column Type. Either DIMENSION or METRIC." + }, + "dataType": { + "type": "string", + "description": "Data type. Dimension column headers have only STRING as the data type. Metric column headers have data types for metric values such as INTEGER, DOUBLE, CURRENCY etc." + }, + "name": { + "type": "string", + "description": "Column name." + } + } + } + }, + "containsSampledData": { + "type": "boolean", + "description": "Determines if Analytics data contains samples." + }, + "dataTable": { + "type": "object", + "properties": { + "cols": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "type": { + "type": "string" + } + } + } + }, + "rows": { + "type": "array", + "items": { + "type": "object", + "properties": { + "c": { + "type": "array", + "items": { + "type": "object", + "properties": { + "v": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "id": { + "type": "string", + "description": "Unique ID for this data response." + }, + "itemsPerPage": { + "type": "integer", + "description": "The maximum number of rows the response can contain, regardless of the actual number of rows returned. Its value ranges from 1 to 10,000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "analytics#gaData" + }, + "nextLink": { + "type": "string", + "description": "Link to next page for this Analytics data query." + }, + "previousLink": { + "type": "string", + "description": "Link to previous page for this Analytics data query." + }, + "profileInfo": { + "type": "object", + "description": "Information for the view (profile), for which the Analytics data was requested.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID to which this view (profile) belongs." + }, + "internalWebPropertyId": { + "type": "string", + "description": "Internal ID for the web property to which this view (profile) belongs." + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID." + }, + "profileName": { + "type": "string", + "description": "View (Profile) name." + }, + "tableId": { + "type": "string", + "description": "Table ID for view (profile)." + }, + "webPropertyId": { + "type": "string", + "description": "Web Property ID to which this view (profile) belongs." + } + } + }, + "query": { + "type": "object", + "description": "Analytics data request query parameters.", + "properties": { + "dimensions": { + "type": "string", + "description": "List of analytics dimensions." + }, + "end-date": { + "type": "string", + "description": "End date." + }, + "filters": { + "type": "string", + "description": "Comma-separated list of dimension or metric filters." + }, + "ids": { + "type": "string", + "description": "Unique table ID." + }, + "max-results": { + "type": "integer", + "description": "Maximum results per page.", + "format": "int32" + }, + "metrics": { + "type": "array", + "description": "List of analytics metrics.", + "items": { + "type": "string" + } + }, + "samplingLevel": { + "type": "string", + "description": "Desired sampling level" + }, + "segment": { + "type": "string", + "description": "Analytics advanced segment." + }, + "sort": { + "type": "array", + "description": "List of dimensions or metrics based on which Analytics data is sorted.", + "items": { + "type": "string" + } + }, + "start-date": { + "type": "string", + "description": "Start date." + }, + "start-index": { + "type": "integer", + "description": "Start index.", + "format": "int32" + } + } + }, + "rows": { + "type": "array", + "description": "Analytics data rows, where each row contains a list of dimension values followed by the metric values. The order of dimensions and metrics is same as specified in the request.", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "sampleSize": { + "type": "string", + "description": "The number of samples used to calculate the result.", + "format": "int64" + }, + "sampleSpace": { + "type": "string", + "description": "Total size of the sample space from which the samples were selected.", + "format": "int64" + }, + "selfLink": { + "type": "string", + "description": "Link to this page." + }, + "totalResults": { + "type": "integer", + "description": "The total number of rows for the query, regardless of the number of rows in the response.", + "format": "int32" + }, + "totalsForAllResults": { + "type": "object", + "description": "Total values for the requested metrics over all the results, not just the results returned in this response. The order of the metric totals is same as the metric order specified in the request.", + "additionalProperties": { + "type": "string", + "description": "Key-value pair for the total value of a metric. Key is the metric name and the value is the total value for that metric." + } + } + } + }, + "Goal": { + "id": "Goal", + "type": "object", + "description": "JSON template for Analytics goal resource.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID to which this goal belongs." + }, + "active": { + "type": "boolean", + "description": "Determines whether this goal is active." + }, + "created": { + "type": "string", + "description": "Time this goal was created.", + "format": "date-time" + }, + "eventDetails": { + "type": "object", + "description": "Details for the goal of the type EVENT.", + "properties": { + "eventConditions": { + "type": "array", + "description": "List of event conditions.", + "items": { + "type": "object", + "properties": { + "comparisonType": { + "type": "string", + "description": "Type of comparison. Possible values are LESS_THAN, GREATER_THAN or EQUAL." + }, + "comparisonValue": { + "type": "string", + "description": "Value used for this comparison.", + "format": "int64" + }, + "expression": { + "type": "string", + "description": "Expression used for this match." + }, + "matchType": { + "type": "string", + "description": "Type of the match to be performed. Possible values are REGEXP, BEGINS_WITH, or EXACT." + }, + "type": { + "type": "string", + "description": "Type of this event condition. Possible values are CATEGORY, ACTION, LABEL, or VALUE." + } + } + } + }, + "useEventValue": { + "type": "boolean", + "description": "Determines if the event value should be used as the value for this goal." + } + } + }, + "id": { + "type": "string", + "description": "Goal ID." + }, + "internalWebPropertyId": { + "type": "string", + "description": "Internal ID for the web property to which this goal belongs." + }, + "kind": { + "type": "string", + "description": "Resource type for an Analytics goal.", + "default": "analytics#goal" + }, + "name": { + "type": "string", + "description": "Goal name." + }, + "parentLink": { + "type": "object", + "description": "Parent link for a goal. Points to the view (profile) to which this goal belongs.", + "properties": { + "href": { + "type": "string", + "description": "Link to the view (profile) to which this goal belongs." + }, + "type": { + "type": "string", + "description": "Value is \"analytics#profile\".", + "default": "analytics#profile" + } + } + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to which this goal belongs." + }, + "selfLink": { + "type": "string", + "description": "Link for this goal." + }, + "type": { + "type": "string", + "description": "Goal type. Possible values are URL_DESTINATION, VISIT_TIME_ON_SITE, VISIT_NUM_PAGES, AND EVENT." + }, + "updated": { + "type": "string", + "description": "Time this goal was last modified.", + "format": "date-time" + }, + "urlDestinationDetails": { + "type": "object", + "description": "Details for the goal of the type URL_DESTINATION.", + "properties": { + "caseSensitive": { + "type": "boolean", + "description": "Determines if the goal URL must exactly match the capitalization of visited URLs." + }, + "firstStepRequired": { + "type": "boolean", + "description": "Determines if the first step in this goal is required." + }, + "matchType": { + "type": "string", + "description": "Match type for the goal URL. Possible values are HEAD, EXACT, or REGEX." + }, + "steps": { + "type": "array", + "description": "List of steps configured for this goal funnel.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Step name." + }, + "number": { + "type": "integer", + "description": "Step number.", + "format": "int32" + }, + "url": { + "type": "string", + "description": "URL for this step." + } + } + } + }, + "url": { + "type": "string", + "description": "URL for this goal." + } + } + }, + "value": { + "type": "number", + "description": "Goal value.", + "format": "float" + }, + "visitNumPagesDetails": { + "type": "object", + "description": "Details for the goal of the type VISIT_NUM_PAGES.", + "properties": { + "comparisonType": { + "type": "string", + "description": "Type of comparison. Possible values are LESS_THAN, GREATER_THAN, or EQUAL." + }, + "comparisonValue": { + "type": "string", + "description": "Value used for this comparison.", + "format": "int64" + } + } + }, + "visitTimeOnSiteDetails": { + "type": "object", + "description": "Details for the goal of the type VISIT_TIME_ON_SITE.", + "properties": { + "comparisonType": { + "type": "string", + "description": "Type of comparison. Possible values are LESS_THAN or GREATER_THAN." + }, + "comparisonValue": { + "type": "string", + "description": "Value used for this comparison.", + "format": "int64" + } + } + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to which this goal belongs. The web property ID is of the form UA-XXXXX-YY." + } + } + }, + "Goals": { + "id": "Goals", + "type": "object", + "description": "A goal collection lists Analytics goals to which the user has access. Each view (profile) can have a set of goals. Each resource in the Goal collection corresponds to a single Analytics goal.", + "properties": { + "items": { + "type": "array", + "description": "A list of goals.", + "items": { + "$ref": "Goal" + } + }, + "itemsPerPage": { + "type": "integer", + "description": "The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Collection type.", + "default": "analytics#goals" + }, + "nextLink": { + "type": "string", + "description": "Link to next page for this goal collection." + }, + "previousLink": { + "type": "string", + "description": "Link to previous page for this goal collection." + }, + "startIndex": { + "type": "integer", + "description": "The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.", + "format": "int32" + }, + "totalResults": { + "type": "integer", + "description": "The total number of results for the query, regardless of the number of resources in the result.", + "format": "int32" + }, + "username": { + "type": "string", + "description": "Email ID of the authenticated user" + } + } + }, + "McfData": { + "id": "McfData", + "type": "object", + "description": "Multi-Channel Funnels data for a given view (profile).", + "properties": { + "columnHeaders": { + "type": "array", + "description": "Column headers that list dimension names followed by the metric names. The order of dimensions and metrics is same as specified in the request.", + "items": { + "type": "object", + "properties": { + "columnType": { + "type": "string", + "description": "Column Type. Either DIMENSION or METRIC." + }, + "dataType": { + "type": "string", + "description": "Data type. Dimension and metric values data types such as INTEGER, DOUBLE, CURRENCY, MCF_SEQUENCE etc." + }, + "name": { + "type": "string", + "description": "Column name." + } + } + } + }, + "containsSampledData": { + "type": "boolean", + "description": "Determines if the Analytics data contains sampled data." + }, + "id": { + "type": "string", + "description": "Unique ID for this data response." + }, + "itemsPerPage": { + "type": "integer", + "description": "The maximum number of rows the response can contain, regardless of the actual number of rows returned. Its value ranges from 1 to 10,000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "analytics#mcfData" + }, + "nextLink": { + "type": "string", + "description": "Link to next page for this Analytics data query." + }, + "previousLink": { + "type": "string", + "description": "Link to previous page for this Analytics data query." + }, + "profileInfo": { + "type": "object", + "description": "Information for the view (profile), for which the Analytics data was requested.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID to which this view (profile) belongs." + }, + "internalWebPropertyId": { + "type": "string", + "description": "Internal ID for the web property to which this view (profile) belongs." + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID." + }, + "profileName": { + "type": "string", + "description": "View (Profile) name." + }, + "tableId": { + "type": "string", + "description": "Table ID for view (profile)." + }, + "webPropertyId": { + "type": "string", + "description": "Web Property ID to which this view (profile) belongs." + } + } + }, + "query": { + "type": "object", + "description": "Analytics data request query parameters.", + "properties": { + "dimensions": { + "type": "string", + "description": "List of analytics dimensions." + }, + "end-date": { + "type": "string", + "description": "End date." + }, + "filters": { + "type": "string", + "description": "Comma-separated list of dimension or metric filters." + }, + "ids": { + "type": "string", + "description": "Unique table ID." + }, + "max-results": { + "type": "integer", + "description": "Maximum results per page.", + "format": "int32" + }, + "metrics": { + "type": "array", + "description": "List of analytics metrics.", + "items": { + "type": "string" + } + }, + "samplingLevel": { + "type": "string", + "description": "Desired sampling level" + }, + "segment": { + "type": "string", + "description": "Analytics advanced segment." + }, + "sort": { + "type": "array", + "description": "List of dimensions or metrics based on which Analytics data is sorted.", + "items": { + "type": "string" + } + }, + "start-date": { + "type": "string", + "description": "Start date." + }, + "start-index": { + "type": "integer", + "description": "Start index.", + "format": "int32" + } + } + }, + "rows": { + "type": "array", + "description": "Analytics data rows, where each row contains a list of dimension values followed by the metric values. The order of dimensions and metrics is same as specified in the request.", + "items": { + "type": "array", + "items": { + "type": "object", + "description": "A union object representing a dimension or metric value. Only one of \"primitiveValue\" or \"conversionPathValue\" attribute will be populated.", + "properties": { + "conversionPathValue": { + "type": "array", + "description": "A conversion path dimension value, containing a list of interactions with their attributes.", + "items": { + "type": "object", + "properties": { + "interactionType": { + "type": "string", + "description": "Type of an interaction on conversion path. Such as CLICK, IMPRESSION etc." + }, + "nodeValue": { + "type": "string", + "description": "Node value of an interaction on conversion path. Such as source, medium etc." + } + } + } + }, + "primitiveValue": { + "type": "string", + "description": "A primitive dimension value. A primitive metric value." + } + } + } + } + }, + "sampleSize": { + "type": "string", + "description": "The number of samples used to calculate the result.", + "format": "int64" + }, + "sampleSpace": { + "type": "string", + "description": "Total size of the sample space from which the samples were selected.", + "format": "int64" + }, + "selfLink": { + "type": "string", + "description": "Link to this page." + }, + "totalResults": { + "type": "integer", + "description": "The total number of rows for the query, regardless of the number of rows in the response.", + "format": "int32" + }, + "totalsForAllResults": { + "type": "object", + "description": "Total values for the requested metrics over all the results, not just the results returned in this response. The order of the metric totals is same as the metric order specified in the request.", + "additionalProperties": { + "type": "string", + "description": "Key-value pair for the total value of a metric. Key is the metric name and the value is the total value for that metric." + } + } + } + }, + "Profile": { + "id": "Profile", + "type": "object", + "description": "JSON template for an Analytics view (profile).", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID to which this view (profile) belongs." + }, + "childLink": { + "type": "object", + "description": "Child link for this view (profile). Points to the list of goals for this view (profile).", + "properties": { + "href": { + "type": "string", + "description": "Link to the list of goals for this view (profile)." + }, + "type": { + "type": "string", + "description": "Value is \"analytics#goals\".", + "default": "analytics#goals" + } + } + }, + "created": { + "type": "string", + "description": "Time this view (profile) was created.", + "format": "date-time", + "readOnly": true + }, + "currency": { + "type": "string", + "description": "The currency type associated with this view (profile). The supported values are:\nARS, AUD, BGN, BRL, CAD, CHF, CNY, CZK, DKK, EUR, GBP, HKD, HUF, IDR, INR, JPY, KRW, LTL, MXN, NOK, NZD, PHP, PLN, RUB, SEK, THB, TRY, TWD, USD, VND, ZAR" + }, + "defaultPage": { + "type": "string", + "description": "Default page for this view (profile)." + }, + "eCommerceTracking": { + "type": "boolean", + "description": "Indicates whether ecommerce tracking is enabled for this view (profile)." + }, + "excludeQueryParameters": { + "type": "string", + "description": "The query parameters that are excluded from this view (profile)." + }, + "id": { + "type": "string", + "description": "View (Profile) ID." + }, + "internalWebPropertyId": { + "type": "string", + "description": "Internal ID for the web property to which this view (profile) belongs.", + "readOnly": true + }, + "kind": { + "type": "string", + "description": "Resource type for Analytics view (profile).", + "default": "analytics#profile", + "readOnly": true + }, + "name": { + "type": "string", + "description": "Name of this view (profile)." + }, + "parentLink": { + "type": "object", + "description": "Parent link for this view (profile). Points to the web property to which this view (profile) belongs.", + "properties": { + "href": { + "type": "string", + "description": "Link to the web property to which this view (profile) belongs." + }, + "type": { + "type": "string", + "description": "Value is \"analytics#webproperty\".", + "default": "analytics#webproperty" + } + } + }, + "permissions": { + "type": "object", + "description": "Permissions the user has for this view (profile).", + "properties": { + "effective": { + "type": "array", + "description": "All the permissions that the user has for this view (profile). These include any implied permissions (e.g., EDIT implies VIEW) or inherited permissions from the parent web property.", + "readOnly": true, + "items": { + "type": "string" + } + } + } + }, + "selfLink": { + "type": "string", + "description": "Link for this view (profile).", + "readOnly": true + }, + "siteSearchCategoryParameters": { + "type": "string", + "description": "Site search category parameters for this view (profile)." + }, + "siteSearchQueryParameters": { + "type": "string", + "description": "The site search query parameters for this view (profile)." + }, + "stripSiteSearchCategoryParameters": { + "type": "boolean", + "description": "Whether or not Analytics will strip search category parameters from the URLs in your reports." + }, + "stripSiteSearchQueryParameters": { + "type": "boolean", + "description": "Whether or not Analytics will strip search query parameters from the URLs in your reports." + }, + "timezone": { + "type": "string", + "description": "Time zone for which this view (profile) has been configured. Time zones are identified by strings from the TZ database." + }, + "type": { + "type": "string", + "description": "View (Profile) type. Supported types: WEB or APP." + }, + "updated": { + "type": "string", + "description": "Time this view (profile) was last modified.", + "format": "date-time", + "readOnly": true + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID of the form UA-XXXXX-YY to which this view (profile) belongs.", + "readOnly": true + }, + "websiteUrl": { + "type": "string", + "description": "Website URL for this view (profile)." + } + } + }, + "ProfileRef": { + "id": "ProfileRef", + "type": "object", + "description": "JSON template for a linked view (profile).", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID to which this view (profile) belongs." + }, + "href": { + "type": "string", + "description": "Link for this view (profile)." + }, + "id": { + "type": "string", + "description": "View (Profile) ID." + }, + "internalWebPropertyId": { + "type": "string", + "description": "Internal ID for the web property to which this view (profile) belongs." + }, + "kind": { + "type": "string", + "description": "Analytics view (profile) reference.", + "default": "analytics#profileRef" + }, + "name": { + "type": "string", + "description": "Name of this view (profile)." + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID of the form UA-XXXXX-YY to which this view (profile) belongs." + } + } + }, + "ProfileSummary": { + "id": "ProfileSummary", + "type": "object", + "description": "JSON template for an Analytics ProfileSummary. ProfileSummary returns basic information (i.e., summary) for a profile.", + "properties": { + "id": { + "type": "string", + "description": "View (profile) ID." + }, + "kind": { + "type": "string", + "description": "Resource type for Analytics ProfileSummary.", + "default": "analytics#profileSummary" + }, + "name": { + "type": "string", + "description": "View (profile) name." + }, + "type": { + "type": "string", + "description": "View (Profile) type. Supported types: WEB or APP." + } + } + }, + "Profiles": { + "id": "Profiles", + "type": "object", + "description": "A view (profile) collection lists Analytics views (profiles) to which the user has access. Each resource in the collection corresponds to a single Analytics view (profile).", + "properties": { + "items": { + "type": "array", + "description": "A list of views (profiles).", + "items": { + "$ref": "Profile" + } + }, + "itemsPerPage": { + "type": "integer", + "description": "The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Collection type.", + "default": "analytics#profiles" + }, + "nextLink": { + "type": "string", + "description": "Link to next page for this view (profile) collection." + }, + "previousLink": { + "type": "string", + "description": "Link to previous page for this view (profile) collection." + }, + "startIndex": { + "type": "integer", + "description": "The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.", + "format": "int32" + }, + "totalResults": { + "type": "integer", + "description": "The total number of results for the query, regardless of the number of results in the response.", + "format": "int32" + }, + "username": { + "type": "string", + "description": "Email ID of the authenticated user" + } + } + }, + "RealtimeData": { + "id": "RealtimeData", + "type": "object", + "description": "Real time data for a given view (profile).", + "properties": { + "columnHeaders": { + "type": "array", + "description": "Column headers that list dimension names followed by the metric names. The order of dimensions and metrics is same as specified in the request.", + "items": { + "type": "object", + "properties": { + "columnType": { + "type": "string", + "description": "Column Type. Either DIMENSION or METRIC." + }, + "dataType": { + "type": "string", + "description": "Data type. Dimension column headers have only STRING as the data type. Metric column headers have data types for metric values such as INTEGER, DOUBLE, CURRENCY etc." + }, + "name": { + "type": "string", + "description": "Column name." + } + } + } + }, + "id": { + "type": "string", + "description": "Unique ID for this data response." + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "analytics#realtimeData" + }, + "profileInfo": { + "type": "object", + "description": "Information for the view (profile), for which the real time data was requested.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID to which this view (profile) belongs." + }, + "internalWebPropertyId": { + "type": "string", + "description": "Internal ID for the web property to which this view (profile) belongs." + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID." + }, + "profileName": { + "type": "string", + "description": "View (Profile) name." + }, + "tableId": { + "type": "string", + "description": "Table ID for view (profile)." + }, + "webPropertyId": { + "type": "string", + "description": "Web Property ID to which this view (profile) belongs." + } + } + }, + "query": { + "type": "object", + "description": "Real time data request query parameters.", + "properties": { + "dimensions": { + "type": "string", + "description": "List of real time dimensions." + }, + "filters": { + "type": "string", + "description": "Comma-separated list of dimension or metric filters." + }, + "ids": { + "type": "string", + "description": "Unique table ID." + }, + "max-results": { + "type": "integer", + "description": "Maximum results per page.", + "format": "int32" + }, + "metrics": { + "type": "array", + "description": "List of real time metrics.", + "items": { + "type": "string" + } + }, + "sort": { + "type": "array", + "description": "List of dimensions or metrics based on which real time data is sorted.", + "items": { + "type": "string" + } + } + } + }, + "rows": { + "type": "array", + "description": "Real time data rows, where each row contains a list of dimension values followed by the metric values. The order of dimensions and metrics is same as specified in the request.", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "selfLink": { + "type": "string", + "description": "Link to this page." + }, + "totalResults": { + "type": "integer", + "description": "The total number of rows for the query, regardless of the number of rows in the response.", + "format": "int32" + }, + "totalsForAllResults": { + "type": "object", + "description": "Total values for the requested metrics over all the results, not just the results returned in this response. The order of the metric totals is same as the metric order specified in the request.", + "additionalProperties": { + "type": "string", + "description": "Key-value pair for the total value of a metric. Key is the metric name and the value is the total value for that metric." + } + } + } + }, + "Segment": { + "id": "Segment", + "type": "object", + "description": "JSON template for an Analytics segment.", + "properties": { + "created": { + "type": "string", + "description": "Time the segment was created.", + "format": "date-time" + }, + "definition": { + "type": "string", + "description": "Segment definition." + }, + "id": { + "type": "string", + "description": "Segment ID." + }, + "kind": { + "type": "string", + "description": "Resource type for Analytics segment.", + "default": "analytics#segment" + }, + "name": { + "type": "string", + "description": "Segment name." + }, + "segmentId": { + "type": "string", + "description": "Segment ID. Can be used with the 'segment' parameter in Core Reporting API." + }, + "selfLink": { + "type": "string", + "description": "Link for this segment." + }, + "type": { + "type": "string", + "description": "Type for a segment. Possible values are \"BUILT_IN\" or \"CUSTOM\"." + }, + "updated": { + "type": "string", + "description": "Time the segment was last modified.", + "format": "date-time" + } + } + }, + "Segments": { + "id": "Segments", + "type": "object", + "description": "An segment collection lists Analytics segments that the user has access to. Each resource in the collection corresponds to a single Analytics segment.", + "properties": { + "items": { + "type": "array", + "description": "A list of segments.", + "items": { + "$ref": "Segment" + } + }, + "itemsPerPage": { + "type": "integer", + "description": "The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Collection type for segments.", + "default": "analytics#segments" + }, + "nextLink": { + "type": "string", + "description": "Link to next page for this segment collection." + }, + "previousLink": { + "type": "string", + "description": "Link to previous page for this segment collection." + }, + "startIndex": { + "type": "integer", + "description": "The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.", + "format": "int32" + }, + "totalResults": { + "type": "integer", + "description": "The total number of results for the query, regardless of the number of results in the response.", + "format": "int32" + }, + "username": { + "type": "string", + "description": "Email ID of the authenticated user" + } + } + }, + "Upload": { + "id": "Upload", + "type": "object", + "description": "Metadata returned for an upload operation.", + "properties": { + "accountId": { + "type": "string", + "description": "Account Id to which this upload belongs.", + "format": "int64" + }, + "customDataSourceId": { + "type": "string", + "description": "Custom data source Id to which this data import belongs." + }, + "errors": { + "type": "array", + "description": "Data import errors collection.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "A unique ID for this upload." + }, + "kind": { + "type": "string", + "description": "Resource type for Analytics upload.", + "default": "analytics#upload" + }, + "status": { + "type": "string", + "description": "Upload status. Possible values: PENDING, COMPLETED, FAILED, DELETING, DELETED." + } + } + }, + "Uploads": { + "id": "Uploads", + "type": "object", + "description": "Upload collection lists Analytics uploads to which the user has access. Each custom data source can have a set of uploads. Each resource in the upload collection corresponds to a single Analytics data upload.", + "properties": { + "items": { + "type": "array", + "description": "A list of uploads.", + "items": { + "$ref": "Upload" + } + }, + "itemsPerPage": { + "type": "integer", + "description": "The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Collection type.", + "default": "analytics#uploads" + }, + "nextLink": { + "type": "string", + "description": "Link to next page for this upload collection." + }, + "previousLink": { + "type": "string", + "description": "Link to previous page for this upload collection." + }, + "startIndex": { + "type": "integer", + "description": "The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.", + "format": "int32" + }, + "totalResults": { + "type": "integer", + "description": "The total number of results for the query, regardless of the number of resources in the result.", + "format": "int32" + } + } + }, + "UserRef": { + "id": "UserRef", + "type": "object", + "description": "JSON template for a user reference.", + "properties": { + "email": { + "type": "string", + "description": "Email ID of this user." + }, + "id": { + "type": "string", + "description": "User ID." + }, + "kind": { + "type": "string", + "default": "analytics#userRef" + } + } + }, + "WebPropertyRef": { + "id": "WebPropertyRef", + "type": "object", + "description": "JSON template for a web property reference.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID to which this web property belongs." + }, + "href": { + "type": "string", + "description": "Link for this web property." + }, + "id": { + "type": "string", + "description": "Web property ID of the form UA-XXXXX-YY." + }, + "internalWebPropertyId": { + "type": "string", + "description": "Internal ID for this web property." + }, + "kind": { + "type": "string", + "description": "Analytics web property reference.", + "default": "analytics#webPropertyRef" + }, + "name": { + "type": "string", + "description": "Name of this web property." + } + } + }, + "WebPropertySummary": { + "id": "WebPropertySummary", + "type": "object", + "description": "JSON template for an Analytics WebPropertySummary. WebPropertySummary returns basic information (i.e., summary) for a web property.", + "properties": { + "id": { + "type": "string", + "description": "Web property ID of the form UA-XXXXX-YY." + }, + "internalWebPropertyId": { + "type": "string", + "description": "Internal ID for this web property." + }, + "kind": { + "type": "string", + "description": "Resource type for Analytics WebPropertySummary.", + "default": "analytics#webPropertySummary" + }, + "level": { + "type": "string", + "description": "Level for this web property. Possible values are STANDARD or PREMIUM." + }, + "name": { + "type": "string", + "description": "Web property name." + }, + "profiles": { + "type": "array", + "description": "List of profiles under this web property.", + "items": { + "$ref": "ProfileSummary" + } + }, + "websiteUrl": { + "type": "string", + "description": "Website url for this web property." + } + } + }, + "Webproperties": { + "id": "Webproperties", + "type": "object", + "description": "A web property collection lists Analytics web properties to which the user has access. Each resource in the collection corresponds to a single Analytics web property.", + "properties": { + "items": { + "type": "array", + "description": "A list of web properties.", + "items": { + "$ref": "Webproperty" + } + }, + "itemsPerPage": { + "type": "integer", + "description": "The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Collection type.", + "default": "analytics#webproperties" + }, + "nextLink": { + "type": "string", + "description": "Link to next page for this web property collection." + }, + "previousLink": { + "type": "string", + "description": "Link to previous page for this web property collection." + }, + "startIndex": { + "type": "integer", + "description": "The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.", + "format": "int32" + }, + "totalResults": { + "type": "integer", + "description": "The total number of results for the query, regardless of the number of results in the response.", + "format": "int32" + }, + "username": { + "type": "string", + "description": "Email ID of the authenticated user" + } + } + }, + "Webproperty": { + "id": "Webproperty", + "type": "object", + "description": "JSON template for an Analytics web property.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID to which this web property belongs." + }, + "childLink": { + "type": "object", + "description": "Child link for this web property. Points to the list of views (profiles) for this web property.", + "properties": { + "href": { + "type": "string", + "description": "Link to the list of views (profiles) for this web property." + }, + "type": { + "type": "string", + "description": "Type of the parent link. Its value is \"analytics#profiles\".", + "default": "analytics#profiles" + } + } + }, + "created": { + "type": "string", + "description": "Time this web property was created.", + "format": "date-time", + "readOnly": true + }, + "defaultProfileId": { + "type": "string", + "description": "Default view (profile) ID.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "Web property ID of the form UA-XXXXX-YY." + }, + "industryVertical": { + "type": "string", + "description": "The industry vertical/category selected for this web property." + }, + "internalWebPropertyId": { + "type": "string", + "description": "Internal ID for this web property.", + "readOnly": true + }, + "kind": { + "type": "string", + "description": "Resource type for Analytics WebProperty.", + "default": "analytics#webproperty", + "readOnly": true + }, + "level": { + "type": "string", + "description": "Level for this web property. Possible values are STANDARD or PREMIUM.", + "readOnly": true + }, + "name": { + "type": "string", + "description": "Name of this web property." + }, + "parentLink": { + "type": "object", + "description": "Parent link for this web property. Points to the account to which this web property belongs.", + "properties": { + "href": { + "type": "string", + "description": "Link to the account for this web property." + }, + "type": { + "type": "string", + "description": "Type of the parent link. Its value is \"analytics#account\".", + "default": "analytics#account" + } + } + }, + "permissions": { + "type": "object", + "description": "Permissions the user has for this web property.", + "properties": { + "effective": { + "type": "array", + "description": "All the permissions that the user has for this web property. These include any implied permissions (e.g., EDIT implies VIEW) or inherited permissions from the parent account.", + "readOnly": true, + "items": { + "type": "string" + } + } + } + }, + "profileCount": { + "type": "integer", + "description": "View (Profile) count for this web property.", + "format": "int32", + "readOnly": true + }, + "selfLink": { + "type": "string", + "description": "Link for this web property.", + "readOnly": true + }, + "updated": { + "type": "string", + "description": "Time this web property was last modified.", + "format": "date-time", + "readOnly": true + }, + "websiteUrl": { + "type": "string", + "description": "Website url for this web property." + } + } + } + }, + "resources": { + "data": { + "resources": { + "ga": { + "methods": { + "get": { + "id": "analytics.data.ga.get", + "path": "data/ga", + "httpMethod": "GET", + "description": "Returns Analytics 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 Analytics data. Request can should specify an end date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is yesterday.", + "required": true, + "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)", + "location": "query" + }, + "filters": { + "type": "string", + "description": "A comma-separated list of dimension or metric filters to be applied to Analytics data.", + "pattern": "ga:.+", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Unique table ID for retrieving Analytics 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:visits,ga:pageviews'. At least one metric must be specified.", + "required": true, + "pattern": "ga:.+", + "location": "query" + }, + "output": { + "type": "string", + "description": "The selected format for the response. Default format is JSON.", + "enum": [ + "dataTable", + "json" + ], + "enumDescriptions": [ + "Returns the response in Google Charts Data Table format. This is useful in creating visualization using Google Charts.", + "Returns the response in standard JSON format." + ], + "location": "query" + }, + "samplingLevel": { + "type": "string", + "description": "The desired sampling level.", + "enum": [ + "DEFAULT", + "FASTER", + "HIGHER_PRECISION" + ], + "enumDescriptions": [ + "Returns response with a sample size that balances speed and accuracy.", + "Returns a fast response with a smaller sample size.", + "Returns a more accurate response using a large sample size, but this may result in the response being slower." + ], + "location": "query" + }, + "segment": { + "type": "string", + "description": "An Analytics segment to be applied to data.", + "location": "query" + }, + "sort": { + "type": "string", + "description": "A comma-separated list of dimensions or metrics that determine the sort order for Analytics data.", + "pattern": "(-)?ga:.+", + "location": "query" + }, + "start-date": { + "type": "string", + "description": "Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo.", + "required": true, + "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)", + "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" + ], + "response": { + "$ref": "GaData" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.readonly" + ] + } + } + }, + "mcf": { + "methods": { + "get": { + "id": "analytics.data.mcf.get", + "path": "data/mcf", + "httpMethod": "GET", + "description": "Returns Analytics Multi-Channel Funnels data for a view (profile).", + "parameters": { + "dimensions": { + "type": "string", + "description": "A comma-separated list of Multi-Channel Funnels dimensions. E.g., 'mcf:source,mcf:medium'.", + "pattern": "(mcf:.+)?", + "location": "query" + }, + "end-date": { + "type": "string", + "description": "End date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo.", + "required": true, + "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)", + "location": "query" + }, + "filters": { + "type": "string", + "description": "A comma-separated list of dimension or metric filters to be applied to the Analytics data.", + "pattern": "mcf:.+", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Unique table ID for retrieving Analytics 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 Multi-Channel Funnels metrics. E.g., 'mcf:totalConversions,mcf:totalConversionValue'. At least one metric must be specified.", + "required": true, + "pattern": "mcf:.+", + "location": "query" + }, + "samplingLevel": { + "type": "string", + "description": "The desired sampling level.", + "enum": [ + "DEFAULT", + "FASTER", + "HIGHER_PRECISION" + ], + "enumDescriptions": [ + "Returns response with a sample size that balances speed and accuracy.", + "Returns a fast response with a smaller sample size.", + "Returns a more accurate response using a large sample size, but this may result in the response being slower." + ], + "location": "query" + }, + "sort": { + "type": "string", + "description": "A comma-separated list of dimensions or metrics that determine the sort order for the Analytics data.", + "pattern": "(-)?mcf:.+", + "location": "query" + }, + "start-date": { + "type": "string", + "description": "Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo.", + "required": true, + "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)", + "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" + ], + "response": { + "$ref": "McfData" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.readonly" + ] + } + } + }, + "realtime": { + "methods": { + "get": { + "id": "analytics.data.realtime.get", + "path": "data/realtime", + "httpMethod": "GET", + "description": "Returns real time data for a view (profile).", + "parameters": { + "dimensions": { + "type": "string", + "description": "A comma-separated list of real time dimensions. E.g., 'rt:medium,rt:city'.", + "pattern": "(ga:.+)|(rt:.+)", + "location": "query" + }, + "filters": { + "type": "string", + "description": "A comma-separated list of dimension or metric filters to be applied to real time data.", + "pattern": "(ga:.+)|(rt:.+)", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Unique table ID for retrieving real time 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 real time metrics. E.g., 'rt:activeVisitors'. At least one metric must be specified.", + "required": true, + "pattern": "(ga:.+)|(rt:.+)", + "location": "query" + }, + "sort": { + "type": "string", + "description": "A comma-separated list of dimensions or metrics that determine the sort order for real time data.", + "pattern": "(-)?((ga:.+)|(rt:.+))", + "location": "query" + } + }, + "parameterOrder": [ + "ids", + "metrics" + ], + "response": { + "$ref": "RealtimeData" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.readonly" + ] + } + } + } + } + }, + "management": { + "resources": { + "accountSummaries": { + "methods": { + "list": { + "id": "analytics.management.accountSummaries.list", + "path": "management/accountSummaries", + "httpMethod": "GET", + "description": "Lists account summaries (lightweight tree comprised of accounts/properties/profiles) to which the user has access.", + "parameters": { + "max-results": { + "type": "integer", + "description": "The maximum number of filters 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" + } + }, + "response": { + "$ref": "AccountSummaries" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + } + } + }, + "accountUserLinks": { + "methods": { + "delete": { + "id": "analytics.management.accountUserLinks.delete", + "path": "management/accounts/{accountId}/entityUserLinks/{linkId}", + "httpMethod": "DELETE", + "description": "Removes a user from the given account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to delete the user link for.", + "required": true, + "location": "path" + }, + "linkId": { + "type": "string", + "description": "Link ID to delete the user link for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "linkId" + ], + "scopes": [ + "https://www.googleapis.com/auth/analytics.manage.users" + ] + }, + "insert": { + "id": "analytics.management.accountUserLinks.insert", + "path": "management/accounts/{accountId}/entityUserLinks", + "httpMethod": "POST", + "description": "Adds a new user to the given account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to create the user link for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "request": { + "$ref": "EntityUserLink" + }, + "response": { + "$ref": "EntityUserLink" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.manage.users" + ] + }, + "list": { + "id": "analytics.management.accountUserLinks.list", + "path": "management/accounts/{accountId}/entityUserLinks", + "httpMethod": "GET", + "description": "Lists account-user links for a given account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to retrieve the user links for.", + "required": true, + "location": "path" + }, + "max-results": { + "type": "integer", + "description": "The maximum number of account-user links to include in this response.", + "format": "int32", + "location": "query" + }, + "start-index": { + "type": "integer", + "description": "An index of the first account-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + "format": "int32", + "minimum": "1", + "location": "query" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "EntityUserLinks" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.manage.users" + ] + }, + "update": { + "id": "analytics.management.accountUserLinks.update", + "path": "management/accounts/{accountId}/entityUserLinks/{linkId}", + "httpMethod": "PUT", + "description": "Updates permissions for an existing user on the given account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to update the account-user link for.", + "required": true, + "location": "path" + }, + "linkId": { + "type": "string", + "description": "Link ID to update the account-user link for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "linkId" + ], + "request": { + "$ref": "EntityUserLink" + }, + "response": { + "$ref": "EntityUserLink" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.manage.users" + ] + } + } + }, + "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" + } + }, + "response": { + "$ref": "Accounts" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + } + } + }, + "customDataSources": { + "methods": { + "list": { + "id": "analytics.management.customDataSources.list", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources", + "httpMethod": "GET", + "description": "List custom data sources to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account Id for the custom data sources to retrieve.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "max-results": { + "type": "integer", + "description": "The maximum number of custom data sources to include in this response.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "start-index": { + "type": "integer", + "description": "A 1-based index of the first custom data source 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 custom data sources to retrieve.", + "required": true, + "pattern": "UA-(\\d+)-(\\d+)", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId" + ], + "response": { + "$ref": "CustomDataSources" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + } + } + }, + "dailyUploads": { + "methods": { + "delete": { + "id": "analytics.management.dailyUploads.delete", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads/{date}", + "httpMethod": "DELETE", + "description": "Delete uploaded data for the given date.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account Id associated with daily upload delete.", + "required": true, + "pattern": "[0-9]+", + "location": "path" + }, + "customDataSourceId": { + "type": "string", + "description": "Custom data source Id associated with daily upload delete.", + "required": true, + "location": "path" + }, + "date": { + "type": "string", + "description": "Date for which data is to be deleted. Date should be formatted as YYYY-MM-DD.", + "required": true, + "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}", + "location": "path" + }, + "type": { + "type": "string", + "description": "Type of data for this delete.", + "required": true, + "enum": [ + "cost" + ], + "enumDescriptions": [ + "Value for specifying cost data upload." + ], + "location": "query" + }, + "webPropertyId": { + "type": "string", + "description": "Web property Id associated with daily upload delete.", + "required": true, + "pattern": "UA-[0-9]+-[0-9]+", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "customDataSourceId", + "date", + "type" + ], + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "list": { + "id": "analytics.management.dailyUploads.list", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads", + "httpMethod": "GET", + "description": "List daily uploads to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account Id for the daily uploads to retrieve.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "customDataSourceId": { + "type": "string", + "description": "Custom data source Id for daily uploads to retrieve.", + "required": true, + "pattern": ".{22}", + "location": "path" + }, + "end-date": { + "type": "string", + "description": "End date of the form YYYY-MM-DD.", + "required": true, + "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}", + "location": "query" + }, + "max-results": { + "type": "integer", + "description": "The maximum number of custom data sources to include in this response.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "start-date": { + "type": "string", + "description": "Start date of the form YYYY-MM-DD.", + "required": true, + "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}", + "location": "query" + }, + "start-index": { + "type": "integer", + "description": "A 1-based index of the first daily upload 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 daily uploads to retrieve.", + "required": true, + "pattern": "UA-(\\d+)-(\\d+)", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "customDataSourceId", + "start-date", + "end-date" + ], + "response": { + "$ref": "DailyUploads" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "upload": { + "id": "analytics.management.dailyUploads.upload", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads/{date}/uploads", + "httpMethod": "POST", + "description": "Update/Overwrite data for a custom data source.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account Id associated with daily upload.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "appendNumber": { + "type": "integer", + "description": "Append number for this upload indexed from 1.", + "required": true, + "format": "int32", + "minimum": "1", + "maximum": "20", + "location": "query" + }, + "customDataSourceId": { + "type": "string", + "description": "Custom data source Id to which the data being uploaded belongs.", + "required": true, + "location": "path" + }, + "date": { + "type": "string", + "description": "Date for which data is uploaded. Date should be formatted as YYYY-MM-DD.", + "required": true, + "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}", + "location": "path" + }, + "reset": { + "type": "boolean", + "description": "Reset/Overwrite all previous appends for this date and start over with this file as the first upload.", + "default": "false", + "location": "query" + }, + "type": { + "type": "string", + "description": "Type of data for this upload.", + "required": true, + "enum": [ + "cost" + ], + "enumDescriptions": [ + "Value for specifying cost data upload." + ], + "location": "query" + }, + "webPropertyId": { + "type": "string", + "description": "Web property Id associated with daily upload.", + "required": true, + "pattern": "UA-\\d+-\\d+", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "customDataSourceId", + "date", + "appendNumber", + "type" + ], + "response": { + "$ref": "DailyUploadAppend" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "application/octet-stream" + ], + "maxSize": "5MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads/{date}/uploads" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads/{date}/uploads" + } + } + } + } + } + }, + "experiments": { + "methods": { + "delete": { + "id": "analytics.management.experiments.delete", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}", + "httpMethod": "DELETE", + "description": "Delete an experiment.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to which the experiment belongs", + "required": true, + "location": "path" + }, + "experimentId": { + "type": "string", + "description": "ID of the experiment to delete", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to which the experiment belongs", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to which the experiment belongs", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId", + "experimentId" + ], + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "get": { + "id": "analytics.management.experiments.get", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}", + "httpMethod": "GET", + "description": "Returns an experiment to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to retrieve the experiment for.", + "required": true, + "location": "path" + }, + "experimentId": { + "type": "string", + "description": "Experiment ID to retrieve the experiment for.", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to retrieve the experiment for.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to retrieve the experiment for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId", + "experimentId" + ], + "response": { + "$ref": "Experiment" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "insert": { + "id": "analytics.management.experiments.insert", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments", + "httpMethod": "POST", + "description": "Create a new experiment.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to create the experiment for.", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to create the experiment for.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to create the experiment for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId" + ], + "request": { + "$ref": "Experiment" + }, + "response": { + "$ref": "Experiment" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "list": { + "id": "analytics.management.experiments.list", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments", + "httpMethod": "GET", + "description": "Lists experiments to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to retrieve experiments for.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "max-results": { + "type": "integer", + "description": "The maximum number of experiments to include in this response.", + "format": "int32", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to retrieve experiments for.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "start-index": { + "type": "integer", + "description": "An index of the first experiment 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 experiments for.", + "required": true, + "pattern": "UA-(\\d+)-(\\d+)", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId" + ], + "response": { + "$ref": "Experiments" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "patch": { + "id": "analytics.management.experiments.patch", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}", + "httpMethod": "PATCH", + "description": "Update an existing experiment. This method supports patch semantics.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID of the experiment to update.", + "required": true, + "location": "path" + }, + "experimentId": { + "type": "string", + "description": "Experiment ID of the experiment to update.", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID of the experiment to update.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID of the experiment to update.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId", + "experimentId" + ], + "request": { + "$ref": "Experiment" + }, + "response": { + "$ref": "Experiment" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "update": { + "id": "analytics.management.experiments.update", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}", + "httpMethod": "PUT", + "description": "Update an existing experiment.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID of the experiment to update.", + "required": true, + "location": "path" + }, + "experimentId": { + "type": "string", + "description": "Experiment ID of the experiment to update.", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID of the experiment to update.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID of the experiment to update.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId", + "experimentId" + ], + "request": { + "$ref": "Experiment" + }, + "response": { + "$ref": "Experiment" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit" + ] + } + } + }, + "goals": { + "methods": { + "get": { + "id": "analytics.management.goals.get", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}", + "httpMethod": "GET", + "description": "Gets a goal to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to retrieve the goal for.", + "required": true, + "location": "path" + }, + "goalId": { + "type": "string", + "description": "Goal ID to retrieve the goal for.", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to retrieve the goal for.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to retrieve the goal for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId", + "goalId" + ], + "response": { + "$ref": "Goal" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "insert": { + "id": "analytics.management.goals.insert", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals", + "httpMethod": "POST", + "description": "Create a new goal.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to create the goal for.", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to create the goal for.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to create the goal for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId" + ], + "request": { + "$ref": "Goal" + }, + "response": { + "$ref": "Goal" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "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" + ], + "response": { + "$ref": "Goals" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "patch": { + "id": "analytics.management.goals.patch", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}", + "httpMethod": "PATCH", + "description": "Updates an existing view (profile). This method supports patch semantics.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to update the goal.", + "required": true, + "location": "path" + }, + "goalId": { + "type": "string", + "description": "Index of the goal to be updated.", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to update the goal.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to update the goal.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId", + "goalId" + ], + "request": { + "$ref": "Goal" + }, + "response": { + "$ref": "Goal" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "update": { + "id": "analytics.management.goals.update", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}", + "httpMethod": "PUT", + "description": "Updates an existing view (profile).", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to update the goal.", + "required": true, + "location": "path" + }, + "goalId": { + "type": "string", + "description": "Index of the goal to be updated.", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to update the goal.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to update the goal.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId", + "goalId" + ], + "request": { + "$ref": "Goal" + }, + "response": { + "$ref": "Goal" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + } + } + }, + "profileUserLinks": { + "methods": { + "delete": { + "id": "analytics.management.profileUserLinks.delete", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}", + "httpMethod": "DELETE", + "description": "Removes a user from the given view (profile).", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to delete the user link for.", + "required": true, + "location": "path" + }, + "linkId": { + "type": "string", + "description": "Link ID to delete the user link for.", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to delete the user link for.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web Property ID to delete the user link for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId", + "linkId" + ], + "scopes": [ + "https://www.googleapis.com/auth/analytics.manage.users" + ] + }, + "insert": { + "id": "analytics.management.profileUserLinks.insert", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks", + "httpMethod": "POST", + "description": "Adds a new user to the given view (profile).", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to create the user link for.", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to create the user link for.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web Property ID to create the user link for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId" + ], + "request": { + "$ref": "EntityUserLink" + }, + "response": { + "$ref": "EntityUserLink" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.manage.users" + ] + }, + "list": { + "id": "analytics.management.profileUserLinks.list", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks", + "httpMethod": "GET", + "description": "Lists profile-user links for a given view (profile).", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID which the given view (profile) belongs to.", + "required": true, + "location": "path" + }, + "max-results": { + "type": "integer", + "description": "The maximum number of profile-user links to include in this response.", + "format": "int32", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to retrieve the profile-user links for", + "required": true, + "location": "path" + }, + "start-index": { + "type": "integer", + "description": "An index of the first profile-user link 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 which the given view (profile) belongs to.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId" + ], + "response": { + "$ref": "EntityUserLinks" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.manage.users" + ] + }, + "update": { + "id": "analytics.management.profileUserLinks.update", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}", + "httpMethod": "PUT", + "description": "Updates permissions for an existing user on the given view (profile).", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to update the user link for.", + "required": true, + "location": "path" + }, + "linkId": { + "type": "string", + "description": "Link ID to update the user link for.", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "View (Profile ID) to update the user link for.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web Property ID to update the user link for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId", + "linkId" + ], + "request": { + "$ref": "EntityUserLink" + }, + "response": { + "$ref": "EntityUserLink" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.manage.users" + ] + } + } + }, + "profiles": { + "methods": { + "delete": { + "id": "analytics.management.profiles.delete", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}", + "httpMethod": "DELETE", + "description": "Deletes a view (profile).", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to delete the view (profile) for.", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "ID of the view (profile) to be deleted.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to delete the view (profile) for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId" + ], + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "get": { + "id": "analytics.management.profiles.get", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}", + "httpMethod": "GET", + "description": "Gets a view (profile) to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to retrieve the goal for.", + "required": true, + "pattern": "[0-9]+", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to retrieve the goal for.", + "required": true, + "pattern": "[0-9]+", + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to retrieve the goal for.", + "required": true, + "pattern": "UA-[0-9]+-[0-9]+", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId" + ], + "response": { + "$ref": "Profile" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "insert": { + "id": "analytics.management.profiles.insert", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles", + "httpMethod": "POST", + "description": "Create a new view (profile).", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to create the view (profile) for.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to create the view (profile) for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId" + ], + "request": { + "$ref": "Profile" + }, + "response": { + "$ref": "Profile" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "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 view (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" + ], + "response": { + "$ref": "Profiles" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "patch": { + "id": "analytics.management.profiles.patch", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}", + "httpMethod": "PATCH", + "description": "Updates an existing view (profile). This method supports patch semantics.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to which the view (profile) belongs", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "ID of the view (profile) to be updated.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to which the view (profile) belongs", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId" + ], + "request": { + "$ref": "Profile" + }, + "response": { + "$ref": "Profile" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "update": { + "id": "analytics.management.profiles.update", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}", + "httpMethod": "PUT", + "description": "Updates an existing view (profile).", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to which the view (profile) belongs", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "ID of the view (profile) to be updated.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to which the view (profile) belongs", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId" + ], + "request": { + "$ref": "Profile" + }, + "response": { + "$ref": "Profile" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + } + } + }, + "segments": { + "methods": { + "list": { + "id": "analytics.management.segments.list", + "path": "management/segments", + "httpMethod": "GET", + "description": "Lists segments to which the user has access.", + "parameters": { + "max-results": { + "type": "integer", + "description": "The maximum number of segments to include in this response.", + "format": "int32", + "location": "query" + }, + "start-index": { + "type": "integer", + "description": "An index of the first segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + "format": "int32", + "minimum": "1", + "location": "query" + } + }, + "response": { + "$ref": "Segments" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + } + } + }, + "uploads": { + "methods": { + "deleteUploadData": { + "id": "analytics.management.uploads.deleteUploadData", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData", + "httpMethod": "POST", + "description": "Delete data associated with a previous upload.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account Id for the uploads to be deleted.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "customDataSourceId": { + "type": "string", + "description": "Custom data source Id for the uploads to be deleted.", + "required": true, + "pattern": ".{22}", + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property Id for the uploads to be deleted.", + "required": true, + "pattern": "UA-(\\d+)-(\\d+)", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "customDataSourceId" + ], + "request": { + "$ref": "AnalyticsDataimportDeleteUploadDataRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "get": { + "id": "analytics.management.uploads.get", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}", + "httpMethod": "GET", + "description": "List uploads to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account Id for the upload to retrieve.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "customDataSourceId": { + "type": "string", + "description": "Custom data source Id for upload to retrieve.", + "required": true, + "pattern": ".{22}", + "location": "path" + }, + "uploadId": { + "type": "string", + "description": "Upload Id to retrieve.", + "required": true, + "pattern": ".{22}", + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property Id for the upload to retrieve.", + "required": true, + "pattern": "UA-(\\d+)-(\\d+)", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "customDataSourceId", + "uploadId" + ], + "response": { + "$ref": "Upload" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "list": { + "id": "analytics.management.uploads.list", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads", + "httpMethod": "GET", + "description": "List uploads to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account Id for the uploads to retrieve.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "customDataSourceId": { + "type": "string", + "description": "Custom data source Id for uploads to retrieve.", + "required": true, + "pattern": ".{22}", + "location": "path" + }, + "max-results": { + "type": "integer", + "description": "The maximum number of uploads to include in this response.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "start-index": { + "type": "integer", + "description": "A 1-based index of the first upload 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 uploads to retrieve.", + "required": true, + "pattern": "UA-(\\d+)-(\\d+)", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "customDataSourceId" + ], + "response": { + "$ref": "Uploads" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "uploadData": { + "id": "analytics.management.uploads.uploadData", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads", + "httpMethod": "POST", + "description": "Upload data for a custom data source.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account Id associated with the upload.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "customDataSourceId": { + "type": "string", + "description": "Custom data source Id to which the data being uploaded belongs.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property UA-string associated with the upload.", + "required": true, + "pattern": "UA-\\d+-\\d+", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "customDataSourceId" + ], + "response": { + "$ref": "Upload" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "application/octet-stream" + ], + "maxSize": "1GB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads" + } + } + } + } + } + }, + "webproperties": { + "methods": { + "get": { + "id": "analytics.management.webproperties.get", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}", + "httpMethod": "GET", + "description": "Gets a web property to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to retrieve the web property for.", + "required": true, + "pattern": "[0-9]+", + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "ID to retrieve the web property for.", + "required": true, + "pattern": "UA-[0-9]+-[0-9]+", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId" + ], + "response": { + "$ref": "Webproperty" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "insert": { + "id": "analytics.management.webproperties.insert", + "path": "management/accounts/{accountId}/webproperties", + "httpMethod": "POST", + "description": "Create a new property if the account has fewer than 20 properties. Web properties are visible in the Google Analytics interface only if they have at least one profile.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to create the web property for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "request": { + "$ref": "Webproperty" + }, + "response": { + "$ref": "Webproperty" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "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" + ], + "response": { + "$ref": "Webproperties" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "patch": { + "id": "analytics.management.webproperties.patch", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}", + "httpMethod": "PATCH", + "description": "Updates an existing web property. This method supports patch semantics.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to which the web property belongs", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId" + ], + "request": { + "$ref": "Webproperty" + }, + "response": { + "$ref": "Webproperty" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "update": { + "id": "analytics.management.webproperties.update", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}", + "httpMethod": "PUT", + "description": "Updates an existing web property.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to which the web property belongs", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId" + ], + "request": { + "$ref": "Webproperty" + }, + "response": { + "$ref": "Webproperty" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + } + } + }, + "webpropertyUserLinks": { + "methods": { + "delete": { + "id": "analytics.management.webpropertyUserLinks.delete", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}", + "httpMethod": "DELETE", + "description": "Removes a user from the given web property.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to delete the user link for.", + "required": true, + "location": "path" + }, + "linkId": { + "type": "string", + "description": "Link ID to delete the user link for.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web Property ID to delete the user link for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "linkId" + ], + "scopes": [ + "https://www.googleapis.com/auth/analytics.manage.users" + ] + }, + "insert": { + "id": "analytics.management.webpropertyUserLinks.insert", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks", + "httpMethod": "POST", + "description": "Adds a new user to the given web property.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to create the user link for.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web Property ID to create the user link for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId" + ], + "request": { + "$ref": "EntityUserLink" + }, + "response": { + "$ref": "EntityUserLink" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.manage.users" + ] + }, + "list": { + "id": "analytics.management.webpropertyUserLinks.list", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks", + "httpMethod": "GET", + "description": "Lists webProperty-user links for a given web property.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID which the given web property belongs to.", + "required": true, + "location": "path" + }, + "max-results": { + "type": "integer", + "description": "The maximum number of webProperty-user Links to include in this response.", + "format": "int32", + "location": "query" + }, + "start-index": { + "type": "integer", + "description": "An index of the first webProperty-user link 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 webProperty-user links to retrieve.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId" + ], + "response": { + "$ref": "EntityUserLinks" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.manage.users" + ] + }, + "update": { + "id": "analytics.management.webpropertyUserLinks.update", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}", + "httpMethod": "PUT", + "description": "Updates permissions for an existing user on the given web property.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to update the account-user link for.", + "required": true, + "location": "path" + }, + "linkId": { + "type": "string", + "description": "Link ID to update the account-user link for.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to update the account-user link for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "linkId" + ], + "request": { + "$ref": "EntityUserLink" + }, + "response": { + "$ref": "EntityUserLink" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.manage.users" + ] + } + } + } + } + }, + "metadata": { + "resources": { + "columns": { + "methods": { + "list": { + "id": "analytics.metadata.columns.list", + "path": "metadata/{reportType}/columns", + "httpMethod": "GET", + "description": "Lists all columns for a report type", + "parameters": { + "reportType": { + "type": "string", + "description": "Report type. Allowed Values: 'ga'. Where 'ga' corresponds to the Core Reporting API", + "required": true, + "pattern": "ga", + "location": "path" + } + }, + "parameterOrder": [ + "reportType" + ], + "response": { + "$ref": "Columns" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + } + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/analytics/v3/analytics-gen.go b/third_party/src/code.google.com/p/google-api-go-client/analytics/v3/analytics-gen.go new file mode 100644 index 0000000000000..887cf13ba6b76 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/analytics/v3/analytics-gen.go @@ -0,0 +1,7113 @@ +// Package analytics provides access to the Google Analytics API. +// +// See https://developers.google.com/analytics/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/analytics/v3" +// ... +// analyticsService, err := analytics.New(oauthHttpClient) +package analytics + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "analytics:v3" +const apiName = "analytics" +const apiVersion = "v3" +const basePath = "https://www.googleapis.com/analytics/v3/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Google Analytics data + AnalyticsScope = "https://www.googleapis.com/auth/analytics" + + // Edit Google Analytics management entities + AnalyticsEditScope = "https://www.googleapis.com/auth/analytics.edit" + + // Manage Google Analytics Account users by email address + AnalyticsManageUsersScope = "https://www.googleapis.com/auth/analytics.manage.users" + + // View your Google Analytics data + AnalyticsReadonlyScope = "https://www.googleapis.com/auth/analytics.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.Data = NewDataService(s) + s.Management = NewManagementService(s) + s.Metadata = NewMetadataService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Data *DataService + + Management *ManagementService + + Metadata *MetadataService +} + +func NewDataService(s *Service) *DataService { + rs := &DataService{s: s} + rs.Ga = NewDataGaService(s) + rs.Mcf = NewDataMcfService(s) + rs.Realtime = NewDataRealtimeService(s) + return rs +} + +type DataService struct { + s *Service + + Ga *DataGaService + + Mcf *DataMcfService + + Realtime *DataRealtimeService +} + +func NewDataGaService(s *Service) *DataGaService { + rs := &DataGaService{s: s} + return rs +} + +type DataGaService struct { + s *Service +} + +func NewDataMcfService(s *Service) *DataMcfService { + rs := &DataMcfService{s: s} + return rs +} + +type DataMcfService struct { + s *Service +} + +func NewDataRealtimeService(s *Service) *DataRealtimeService { + rs := &DataRealtimeService{s: s} + return rs +} + +type DataRealtimeService struct { + s *Service +} + +func NewManagementService(s *Service) *ManagementService { + rs := &ManagementService{s: s} + rs.AccountSummaries = NewManagementAccountSummariesService(s) + rs.AccountUserLinks = NewManagementAccountUserLinksService(s) + rs.Accounts = NewManagementAccountsService(s) + rs.CustomDataSources = NewManagementCustomDataSourcesService(s) + rs.DailyUploads = NewManagementDailyUploadsService(s) + rs.Experiments = NewManagementExperimentsService(s) + rs.Goals = NewManagementGoalsService(s) + rs.ProfileUserLinks = NewManagementProfileUserLinksService(s) + rs.Profiles = NewManagementProfilesService(s) + rs.Segments = NewManagementSegmentsService(s) + rs.Uploads = NewManagementUploadsService(s) + rs.Webproperties = NewManagementWebpropertiesService(s) + rs.WebpropertyUserLinks = NewManagementWebpropertyUserLinksService(s) + return rs +} + +type ManagementService struct { + s *Service + + AccountSummaries *ManagementAccountSummariesService + + AccountUserLinks *ManagementAccountUserLinksService + + Accounts *ManagementAccountsService + + CustomDataSources *ManagementCustomDataSourcesService + + DailyUploads *ManagementDailyUploadsService + + Experiments *ManagementExperimentsService + + Goals *ManagementGoalsService + + ProfileUserLinks *ManagementProfileUserLinksService + + Profiles *ManagementProfilesService + + Segments *ManagementSegmentsService + + Uploads *ManagementUploadsService + + Webproperties *ManagementWebpropertiesService + + WebpropertyUserLinks *ManagementWebpropertyUserLinksService +} + +func NewManagementAccountSummariesService(s *Service) *ManagementAccountSummariesService { + rs := &ManagementAccountSummariesService{s: s} + return rs +} + +type ManagementAccountSummariesService struct { + s *Service +} + +func NewManagementAccountUserLinksService(s *Service) *ManagementAccountUserLinksService { + rs := &ManagementAccountUserLinksService{s: s} + return rs +} + +type ManagementAccountUserLinksService struct { + s *Service +} + +func NewManagementAccountsService(s *Service) *ManagementAccountsService { + rs := &ManagementAccountsService{s: s} + return rs +} + +type ManagementAccountsService struct { + s *Service +} + +func NewManagementCustomDataSourcesService(s *Service) *ManagementCustomDataSourcesService { + rs := &ManagementCustomDataSourcesService{s: s} + return rs +} + +type ManagementCustomDataSourcesService struct { + s *Service +} + +func NewManagementDailyUploadsService(s *Service) *ManagementDailyUploadsService { + rs := &ManagementDailyUploadsService{s: s} + return rs +} + +type ManagementDailyUploadsService struct { + s *Service +} + +func NewManagementExperimentsService(s *Service) *ManagementExperimentsService { + rs := &ManagementExperimentsService{s: s} + return rs +} + +type ManagementExperimentsService struct { + s *Service +} + +func NewManagementGoalsService(s *Service) *ManagementGoalsService { + rs := &ManagementGoalsService{s: s} + return rs +} + +type ManagementGoalsService struct { + s *Service +} + +func NewManagementProfileUserLinksService(s *Service) *ManagementProfileUserLinksService { + rs := &ManagementProfileUserLinksService{s: s} + return rs +} + +type ManagementProfileUserLinksService struct { + s *Service +} + +func NewManagementProfilesService(s *Service) *ManagementProfilesService { + rs := &ManagementProfilesService{s: s} + return rs +} + +type ManagementProfilesService struct { + s *Service +} + +func NewManagementSegmentsService(s *Service) *ManagementSegmentsService { + rs := &ManagementSegmentsService{s: s} + return rs +} + +type ManagementSegmentsService struct { + s *Service +} + +func NewManagementUploadsService(s *Service) *ManagementUploadsService { + rs := &ManagementUploadsService{s: s} + return rs +} + +type ManagementUploadsService struct { + s *Service +} + +func NewManagementWebpropertiesService(s *Service) *ManagementWebpropertiesService { + rs := &ManagementWebpropertiesService{s: s} + return rs +} + +type ManagementWebpropertiesService struct { + s *Service +} + +func NewManagementWebpropertyUserLinksService(s *Service) *ManagementWebpropertyUserLinksService { + rs := &ManagementWebpropertyUserLinksService{s: s} + return rs +} + +type ManagementWebpropertyUserLinksService struct { + s *Service +} + +func NewMetadataService(s *Service) *MetadataService { + rs := &MetadataService{s: s} + rs.Columns = NewMetadataColumnsService(s) + return rs +} + +type MetadataService struct { + s *Service + + Columns *MetadataColumnsService +} + +func NewMetadataColumnsService(s *Service) *MetadataColumnsService { + rs := &MetadataColumnsService{s: s} + return rs +} + +type MetadataColumnsService struct { + s *Service +} + +type Account struct { + // ChildLink: Child link for an account entry. Points to the list of web + // properties for this account. + ChildLink *AccountChildLink `json:"childLink,omitempty"` + + // Created: Time the account was created. + Created string `json:"created,omitempty"` + + // Id: Account ID. + Id string `json:"id,omitempty"` + + // Kind: Resource type for Analytics account. + Kind string `json:"kind,omitempty"` + + // Name: Account name. + Name string `json:"name,omitempty"` + + // Permissions: Permissions the user has for this account. + Permissions *AccountPermissions `json:"permissions,omitempty"` + + // SelfLink: Link for this account. + SelfLink string `json:"selfLink,omitempty"` + + // Updated: Time the account was last modified. + Updated string `json:"updated,omitempty"` +} + +type AccountChildLink struct { + // Href: Link to the list of web properties for this account. + Href string `json:"href,omitempty"` + + // Type: Type of the child link. Its value is "analytics#webproperties". + Type string `json:"type,omitempty"` +} + +type AccountPermissions struct { + // Effective: All the permissions that the user has for this account. + // These include any implied permissions (e.g., EDIT implies VIEW). + Effective []string `json:"effective,omitempty"` +} + +type AccountRef struct { + // Href: Link for this account. + Href string `json:"href,omitempty"` + + // Id: Account ID. + Id string `json:"id,omitempty"` + + // Kind: Analytics account reference. + Kind string `json:"kind,omitempty"` + + // Name: Account name. + Name string `json:"name,omitempty"` +} + +type AccountSummaries struct { + // Items: A list of AccountSummaries. + Items []*AccountSummary `json:"items,omitempty"` + + // ItemsPerPage: The maximum number of resources the response can + // contain, regardless of the actual number of resources returned. Its + // value ranges from 1 to 1000 with a value of 1000 by default, or + // otherwise specified by the max-results query parameter. + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + + // Kind: Collection type. + Kind string `json:"kind,omitempty"` + + // NextLink: Link to next page for this AccountSummary collection. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Link to previous page for this AccountSummary + // collection. + PreviousLink string `json:"previousLink,omitempty"` + + // StartIndex: The starting index of the resources, which is 1 by + // default or otherwise specified by the start-index query parameter. + StartIndex int64 `json:"startIndex,omitempty"` + + // TotalResults: The total number of results for the query, regardless + // of the number of results in the response. + TotalResults int64 `json:"totalResults,omitempty"` + + // Username: Email ID of the authenticated user + Username string `json:"username,omitempty"` +} + +type AccountSummary struct { + // Id: Account ID. + Id string `json:"id,omitempty"` + + // Kind: Resource type for Analytics AccountSummary. + Kind string `json:"kind,omitempty"` + + // Name: Account name. + Name string `json:"name,omitempty"` + + // WebProperties: List of web properties under this account. + WebProperties []*WebPropertySummary `json:"webProperties,omitempty"` +} + +type Accounts struct { + // Items: A list of accounts. + Items []*Account `json:"items,omitempty"` + + // ItemsPerPage: The maximum number of entries the response can contain, + // regardless of the actual number of entries returned. Its value ranges + // from 1 to 1000 with a value of 1000 by default, or otherwise + // specified by the max-results query parameter. + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + + // Kind: Collection type. + Kind string `json:"kind,omitempty"` + + // NextLink: Next link for this account collection. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Previous link for this account collection. + PreviousLink string `json:"previousLink,omitempty"` + + // StartIndex: The starting index of the entries, which is 1 by default + // or otherwise specified by the start-index query parameter. + StartIndex int64 `json:"startIndex,omitempty"` + + // TotalResults: The total number of results for the query, regardless + // of the number of results in the response. + TotalResults int64 `json:"totalResults,omitempty"` + + // Username: Email ID of the authenticated user + Username string `json:"username,omitempty"` +} + +type AnalyticsDataimportDeleteUploadDataRequest struct { + // CustomDataImportUids: A list of upload UIDs. + CustomDataImportUids []string `json:"customDataImportUids,omitempty"` +} + +type Column struct { + // Attributes: Map of attribute name and value for this column. + Attributes map[string]string `json:"attributes,omitempty"` + + // Id: Column id. + Id string `json:"id,omitempty"` + + // Kind: Resource type for Analytics column. + Kind string `json:"kind,omitempty"` +} + +type Columns struct { + // AttributeNames: List of attributes names returned by columns. + AttributeNames []string `json:"attributeNames,omitempty"` + + // Etag: Etag of collection. This etag can be compared with the last + // response etag to check if response has changed. + Etag string `json:"etag,omitempty"` + + // Items: List of columns for a report type. + Items []*Column `json:"items,omitempty"` + + // Kind: Collection type. + Kind string `json:"kind,omitempty"` + + // TotalResults: Total number of columns returned in the response. + TotalResults int64 `json:"totalResults,omitempty"` +} + +type CustomDataSource struct { + // AccountId: Account ID to which this custom data source belongs. + AccountId string `json:"accountId,omitempty"` + + ChildLink *CustomDataSourceChildLink `json:"childLink,omitempty"` + + // Created: Time this custom data source was created. + Created string `json:"created,omitempty"` + + // Description: Description of custom data source. + Description string `json:"description,omitempty"` + + // Id: Custom data source ID. + Id string `json:"id,omitempty"` + + // Kind: Resource type for Analytics custom data source. + Kind string `json:"kind,omitempty"` + + // Name: Name of this custom data source. + Name string `json:"name,omitempty"` + + // ParentLink: Parent link for this custom data source. Points to the + // web property to which this custom data source belongs. + ParentLink *CustomDataSourceParentLink `json:"parentLink,omitempty"` + + // ProfilesLinked: IDs of views (profiles) linked to the custom data + // source. + ProfilesLinked []string `json:"profilesLinked,omitempty"` + + // SelfLink: Link for this Analytics custom data source. + SelfLink string `json:"selfLink,omitempty"` + + // Type: Type of the custom data source. + Type string `json:"type,omitempty"` + + // Updated: Time this custom data source was last modified. + Updated string `json:"updated,omitempty"` + + // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this + // custom data source belongs. + WebPropertyId string `json:"webPropertyId,omitempty"` +} + +type CustomDataSourceChildLink struct { + // Href: Link to the list of daily uploads for this custom data source. + // Link to the list of uploads for this custom data source. + Href string `json:"href,omitempty"` + + // Type: Value is "analytics#dailyUploads". Value is + // "analytics#uploads". + Type string `json:"type,omitempty"` +} + +type CustomDataSourceParentLink struct { + // Href: Link to the web property to which this custom data source + // belongs. + Href string `json:"href,omitempty"` + + // Type: Value is "analytics#webproperty". + Type string `json:"type,omitempty"` +} + +type CustomDataSources struct { + // Items: Collection of custom data sources. + Items []*CustomDataSource `json:"items,omitempty"` + + // ItemsPerPage: The maximum number of resources the response can + // contain, regardless of the actual number of resources returned. Its + // value ranges from 1 to 1000 with a value of 1000 by default, or + // otherwise specified by the max-results query parameter. + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + + // Kind: Collection type. + Kind string `json:"kind,omitempty"` + + // NextLink: Link to next page for this custom data source collection. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Link to previous page for this custom data source + // collection. + PreviousLink string `json:"previousLink,omitempty"` + + // StartIndex: The starting index of the resources, which is 1 by + // default or otherwise specified by the start-index query parameter. + StartIndex int64 `json:"startIndex,omitempty"` + + // TotalResults: The total number of results for the query, regardless + // of the number of results in the response. + TotalResults int64 `json:"totalResults,omitempty"` + + // Username: Email ID of the authenticated user + Username string `json:"username,omitempty"` +} + +type DailyUpload struct { + // AccountId: Account ID to which this daily upload belongs. + AccountId string `json:"accountId,omitempty"` + + // AppendCount: Number of appends for this date. + AppendCount int64 `json:"appendCount,omitempty"` + + // CreatedTime: Time this daily upload was created. + CreatedTime string `json:"createdTime,omitempty"` + + // CustomDataSourceId: Custom data source ID to which this daily upload + // belongs. + CustomDataSourceId string `json:"customDataSourceId,omitempty"` + + // Date: Date associated with daily upload. + Date string `json:"date,omitempty"` + + // Kind: Resource type for Analytics daily upload. + Kind string `json:"kind,omitempty"` + + // ModifiedTime: Time this daily upload was last modified. + ModifiedTime string `json:"modifiedTime,omitempty"` + + // ParentLink: Parent link for a daily upload. Points to the custom data + // source to which this daily upload belongs. + ParentLink *DailyUploadParentLink `json:"parentLink,omitempty"` + + // RecentChanges: Change log for last 10 changes in chronological order. + RecentChanges []*DailyUploadRecentChanges `json:"recentChanges,omitempty"` + + // SelfLink: Link for this daily upload. + SelfLink string `json:"selfLink,omitempty"` + + // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this + // daily upload belongs. + WebPropertyId string `json:"webPropertyId,omitempty"` +} + +type DailyUploadParentLink struct { + // Href: Link to the custom data source to which this daily upload + // belongs. + Href string `json:"href,omitempty"` + + // Type: Value is "analytics#customDataSource". + Type string `json:"type,omitempty"` +} + +type DailyUploadRecentChanges struct { + // Change: The type of change: APPEND, RESET, or DELETE. + Change string `json:"change,omitempty"` + + // Time: The time when the change occurred. + Time string `json:"time,omitempty"` +} + +type DailyUploadAppend struct { + // AccountId: Account Id to which this daily upload append belongs. + AccountId string `json:"accountId,omitempty"` + + // AppendNumber: Append number. + AppendNumber int64 `json:"appendNumber,omitempty"` + + // CustomDataSourceId: Custom data source Id to which this daily upload + // append belongs. + CustomDataSourceId string `json:"customDataSourceId,omitempty"` + + // Date: Date associated with daily upload append. + Date string `json:"date,omitempty"` + + // Kind: Resource type for Analytics daily upload append. + Kind string `json:"kind,omitempty"` + + NextAppendLink string `json:"nextAppendLink,omitempty"` + + // WebPropertyId: Web property Id of the form UA-XXXXX-YY to which this + // daily upload append belongs. + WebPropertyId string `json:"webPropertyId,omitempty"` +} + +type DailyUploads struct { + // Items: A collection of daily uploads. + Items []*DailyUpload `json:"items,omitempty"` + + // ItemsPerPage: The maximum number of resources the response can + // contain, regardless of the actual number of resources returned. Its + // value ranges from 1 to 1000 with a value of 1000 by default, or + // otherwise specified by the max-results query parameter. + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + + // Kind: Collection type. Value is analytics#dailyUploads. + Kind string `json:"kind,omitempty"` + + // NextLink: Link to next page for this daily upload collection. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Link to previous page for this daily upload collection. + PreviousLink string `json:"previousLink,omitempty"` + + // StartIndex: The starting index of the resources, which is 1 by + // default or otherwise specified by the start-index query parameter. + StartIndex int64 `json:"startIndex,omitempty"` + + // TotalResults: The total number of results for the query, regardless + // of the number of results in the response. + TotalResults int64 `json:"totalResults,omitempty"` + + // Username: Email ID of the authenticated user + Username string `json:"username,omitempty"` +} + +type EntityUserLink struct { + // Entity: Entity for this link. It can be an account, a web property, + // or a view (profile). + Entity *EntityUserLinkEntity `json:"entity,omitempty"` + + // Id: Entity user link ID + Id string `json:"id,omitempty"` + + // Kind: Resource type for entity user link. + Kind string `json:"kind,omitempty"` + + // Permissions: Permissions the user has for this entity. + Permissions *EntityUserLinkPermissions `json:"permissions,omitempty"` + + // SelfLink: Self link for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // UserRef: User reference. + UserRef *UserRef `json:"userRef,omitempty"` +} + +type EntityUserLinkEntity struct { + // AccountRef: Account for this link. + AccountRef *AccountRef `json:"accountRef,omitempty"` + + // ProfileRef: View (Profile) for this link. + ProfileRef *ProfileRef `json:"profileRef,omitempty"` + + // WebPropertyRef: Web property for this link. + WebPropertyRef *WebPropertyRef `json:"webPropertyRef,omitempty"` +} + +type EntityUserLinkPermissions struct { + // Effective: Effective permissions represent all the permissions that a + // user has for this entity. These include any implied permissions + // (e.g., EDIT implies VIEW) or inherited permissions from the parent + // entity. Effective permissions are read-only. + Effective []string `json:"effective,omitempty"` + + // Local: Permissions that a user has been assigned at this very level. + // Does not include any implied or inherited permissions. Local + // permissions are modifiable. + Local []string `json:"local,omitempty"` +} + +type EntityUserLinks struct { + // Items: A list of entity user links. + Items []*EntityUserLink `json:"items,omitempty"` + + // ItemsPerPage: The maximum number of entries the response can contain, + // regardless of the actual number of entries returned. Its value ranges + // from 1 to 1000 with a value of 1000 by default, or otherwise + // specified by the max-results query parameter. + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + + // Kind: Collection type. + Kind string `json:"kind,omitempty"` + + // NextLink: Next link for this account collection. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Previous link for this account collection. + PreviousLink string `json:"previousLink,omitempty"` + + // StartIndex: The starting index of the entries, which is 1 by default + // or otherwise specified by the start-index query parameter. + StartIndex int64 `json:"startIndex,omitempty"` + + // TotalResults: The total number of results for the query, regardless + // of the number of results in the response. + TotalResults int64 `json:"totalResults,omitempty"` +} + +type Experiment struct { + // AccountId: Account ID to which this experiment belongs. This field is + // read-only. + AccountId string `json:"accountId,omitempty"` + + // Created: Time the experiment was created. This field is read-only. + Created string `json:"created,omitempty"` + + // Description: Notes about this experiment. + Description string `json:"description,omitempty"` + + // EditableInGaUi: If true, the end user will be able to edit the + // experiment via the Google Analytics user interface. + EditableInGaUi bool `json:"editableInGaUi,omitempty"` + + // EndTime: The ending time of the experiment (the time the status + // changed from RUNNING to ENDED). This field is present only if the + // experiment has ended. This field is read-only. + EndTime string `json:"endTime,omitempty"` + + // EqualWeighting: Boolean specifying whether to distribute traffic + // evenly across all variations. If the value is False, content + // experiments follows the default behavior of adjusting traffic + // dynamically based on variation performance. Optional -- defaults to + // False. This field may not be changed for an experiment whose status + // is ENDED. + EqualWeighting bool `json:"equalWeighting,omitempty"` + + // Id: Experiment ID. Required for patch and update. Disallowed for + // create. + Id string `json:"id,omitempty"` + + // InternalWebPropertyId: Internal ID for the web property to which this + // experiment belongs. This field is read-only. + InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"` + + // Kind: Resource type for an Analytics experiment. This field is + // read-only. + Kind string `json:"kind,omitempty"` + + // MinimumExperimentLengthInDays: Specifies the minimum length of the + // experiment. Can be changed for a running experiment. This field may + // not be changed for an experiments whose status is ENDED. + MinimumExperimentLengthInDays int64 `json:"minimumExperimentLengthInDays,omitempty"` + + // Name: Experiment name. This field may not be changed for an + // experiment whose status is ENDED. This field is required when + // creating an experiment. + Name string `json:"name,omitempty"` + + // ObjectiveMetric: The metric that the experiment is optimizing. Valid + // values: "ga:goal(n)Completions", "ga:adsenseAdsClicks", + // "ga:adsenseAdsViewed", "ga:adsenseRevenue", "ga:bounces", + // "ga:pageviews", "ga:timeOnSite", "ga:transactions", + // "ga:transactionRevenue". This field is required if status is + // "RUNNING" and servingFramework is one of "REDIRECT" or "API". + ObjectiveMetric string `json:"objectiveMetric,omitempty"` + + // OptimizationType: Whether the objectiveMetric should be minimized or + // maximized. Possible values: "MAXIMUM", "MINIMUM". Optional--defaults + // to "MAXIMUM". Cannot be specified without objectiveMetric. Cannot be + // modified when status is "RUNNING" or "ENDED". + OptimizationType string `json:"optimizationType,omitempty"` + + // ParentLink: Parent link for an experiment. Points to the view + // (profile) to which this experiment belongs. + ParentLink *ExperimentParentLink `json:"parentLink,omitempty"` + + // ProfileId: View (Profile) ID to which this experiment belongs. This + // field is read-only. + ProfileId string `json:"profileId,omitempty"` + + // ReasonExperimentEnded: Why the experiment ended. Possible values: + // "STOPPED_BY_USER", "WINNER_FOUND", "EXPERIMENT_EXPIRED", + // "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED". + // "ENDED_WITH_NO_WINNER" means that the experiment didn't expire but no + // winner was projected to be found. If the experiment status is changed + // via the API to ENDED this field is set to STOPPED_BY_USER. This field + // is read-only. + ReasonExperimentEnded string `json:"reasonExperimentEnded,omitempty"` + + // RewriteVariationUrlsAsOriginal: Boolean specifying whether variations + // URLS are rewritten to match those of the original. This field may not + // be changed for an experiments whose status is ENDED. + RewriteVariationUrlsAsOriginal bool `json:"rewriteVariationUrlsAsOriginal,omitempty"` + + // SelfLink: Link for this experiment. This field is read-only. + SelfLink string `json:"selfLink,omitempty"` + + // ServingFramework: The framework used to serve the experiment + // variations and evaluate the results. One of: + // - REDIRECT: Google + // Analytics redirects traffic to different variation pages, reports the + // chosen variation and evaluates the results. + // - API: Google Analytics + // chooses and reports the variation to serve and evaluates the results; + // the caller is responsible for serving the selected variation. + // - + // EXTERNAL: The variations will be served externally and the chosen + // variation reported to Google Analytics. The caller is responsible for + // serving the selected variation and evaluating the results. + ServingFramework string `json:"servingFramework,omitempty"` + + // Snippet: The snippet of code to include on the control page(s). This + // field is read-only. + Snippet string `json:"snippet,omitempty"` + + // StartTime: The starting time of the experiment (the time the status + // changed from READY_TO_RUN to RUNNING). This field is present only if + // the experiment has started. This field is read-only. + StartTime string `json:"startTime,omitempty"` + + // Status: Experiment status. Possible values: "DRAFT", "READY_TO_RUN", + // "RUNNING", "ENDED". Experiments can be created in the "DRAFT", + // "READY_TO_RUN" or "RUNNING" state. This field is required when + // creating an experiment. + Status string `json:"status,omitempty"` + + // TrafficCoverage: A floating-point number between 0 and 1. Specifies + // the fraction of the traffic that participates in the experiment. Can + // be changed for a running experiment. This field may not be changed + // for an experiments whose status is ENDED. + TrafficCoverage float64 `json:"trafficCoverage,omitempty"` + + // Updated: Time the experiment was last modified. This field is + // read-only. + Updated string `json:"updated,omitempty"` + + // Variations: Array of variations. The first variation in the array is + // the original. The number of variations may not change once an + // experiment is in the RUNNING state. At least two variations are + // required before status can be set to RUNNING. + Variations []*ExperimentVariations `json:"variations,omitempty"` + + // WebPropertyId: Web property ID to which this experiment belongs. The + // web property ID is of the form UA-XXXXX-YY. This field is read-only. + WebPropertyId string `json:"webPropertyId,omitempty"` + + // WinnerConfidenceLevel: A floating-point number between 0 and 1. + // Specifies the necessary confidence level to choose a winner. This + // field may not be changed for an experiments whose status is ENDED. + WinnerConfidenceLevel float64 `json:"winnerConfidenceLevel,omitempty"` + + // WinnerFound: Boolean specifying whether a winner has been found for + // this experiment. This field is read-only. + WinnerFound bool `json:"winnerFound,omitempty"` +} + +type ExperimentParentLink struct { + // Href: Link to the view (profile) to which this experiment belongs. + // This field is read-only. + Href string `json:"href,omitempty"` + + // Type: Value is "analytics#profile". This field is read-only. + Type string `json:"type,omitempty"` +} + +type ExperimentVariations struct { + // Name: The name of the variation. This field is required when creating + // an experiment. This field may not be changed for an experiment whose + // status is ENDED. + Name string `json:"name,omitempty"` + + // Status: Status of the variation. Possible values: "ACTIVE", + // "INACTIVE". INACTIVE variations are not served. This field may not be + // changed for an experiment whose status is ENDED. + Status string `json:"status,omitempty"` + + // Url: The URL of the variation. This field may not be changed for an + // experiment whose status is RUNNING or ENDED. + Url string `json:"url,omitempty"` + + // Weight: Weight that this variation should receive. Only present if + // the experiment is running. This field is read-only. + Weight float64 `json:"weight,omitempty"` + + // Won: True if the experiment has ended and this variation performed + // (statistically) significantly better than the original. This field is + // read-only. + Won bool `json:"won,omitempty"` +} + +type Experiments struct { + // Items: A list of experiments. + Items []*Experiment `json:"items,omitempty"` + + // ItemsPerPage: The maximum number of resources the response can + // contain, regardless of the actual number of resources returned. Its + // value ranges from 1 to 1000 with a value of 1000 by default, or + // otherwise specified by the max-results query parameter. + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + + // Kind: Collection type. + Kind string `json:"kind,omitempty"` + + // NextLink: Link to next page for this experiment collection. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Link to previous page for this experiment collection. + PreviousLink string `json:"previousLink,omitempty"` + + // StartIndex: The starting index of the resources, which is 1 by + // default or otherwise specified by the start-index query parameter. + StartIndex int64 `json:"startIndex,omitempty"` + + // TotalResults: The total number of results for the query, regardless + // of the number of resources in the result. + TotalResults int64 `json:"totalResults,omitempty"` + + // Username: Email ID of the authenticated user + Username string `json:"username,omitempty"` +} + +type GaData struct { + // ColumnHeaders: Column headers that list dimension names followed by + // the metric names. The order of dimensions and metrics is same as + // specified in the request. + ColumnHeaders []*GaDataColumnHeaders `json:"columnHeaders,omitempty"` + + // ContainsSampledData: Determines if Analytics data contains samples. + ContainsSampledData bool `json:"containsSampledData,omitempty"` + + DataTable *GaDataDataTable `json:"dataTable,omitempty"` + + // Id: Unique ID for this data response. + Id string `json:"id,omitempty"` + + // ItemsPerPage: The maximum number of rows the response can contain, + // regardless of the actual number of rows returned. Its value ranges + // from 1 to 10,000 with a value of 1000 by default, or otherwise + // specified by the max-results query parameter. + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // NextLink: Link to next page for this Analytics data query. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Link to previous page for this Analytics data query. + PreviousLink string `json:"previousLink,omitempty"` + + // ProfileInfo: Information for the view (profile), for which the + // Analytics data was requested. + ProfileInfo *GaDataProfileInfo `json:"profileInfo,omitempty"` + + // Query: Analytics data request query parameters. + Query *GaDataQuery `json:"query,omitempty"` + + // Rows: Analytics data rows, where each row contains a list of + // dimension values followed by the metric values. The order of + // dimensions and metrics is same as specified in the request. + Rows [][]string `json:"rows,omitempty"` + + // SampleSize: The number of samples used to calculate the result. + SampleSize int64 `json:"sampleSize,omitempty,string"` + + // SampleSpace: Total size of the sample space from which the samples + // were selected. + SampleSpace int64 `json:"sampleSpace,omitempty,string"` + + // SelfLink: Link to this page. + SelfLink string `json:"selfLink,omitempty"` + + // TotalResults: The total number of rows for the query, regardless of + // the number of rows in the response. + TotalResults int64 `json:"totalResults,omitempty"` + + // TotalsForAllResults: Total values for the requested metrics over all + // the results, not just the results returned in this response. The + // order of the metric totals is same as the metric order specified in + // the request. + TotalsForAllResults map[string]string `json:"totalsForAllResults,omitempty"` +} + +type GaDataColumnHeaders struct { + // ColumnType: Column Type. Either DIMENSION or METRIC. + ColumnType string `json:"columnType,omitempty"` + + // DataType: Data type. Dimension column headers have only STRING as the + // data type. Metric column headers have data types for metric values + // such as INTEGER, DOUBLE, CURRENCY etc. + DataType string `json:"dataType,omitempty"` + + // Name: Column name. + Name string `json:"name,omitempty"` +} + +type GaDataDataTable struct { + Cols []*GaDataDataTableCols `json:"cols,omitempty"` + + Rows []*GaDataDataTableRows `json:"rows,omitempty"` +} + +type GaDataDataTableCols struct { + Id string `json:"id,omitempty"` + + Label string `json:"label,omitempty"` + + Type string `json:"type,omitempty"` +} + +type GaDataDataTableRows struct { + C []*GaDataDataTableRowsC `json:"c,omitempty"` +} + +type GaDataDataTableRowsC struct { + V string `json:"v,omitempty"` +} + +type GaDataProfileInfo struct { + // AccountId: Account ID to which this view (profile) belongs. + AccountId string `json:"accountId,omitempty"` + + // InternalWebPropertyId: Internal ID for the web property to which this + // view (profile) belongs. + InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"` + + // ProfileId: View (Profile) ID. + ProfileId string `json:"profileId,omitempty"` + + // ProfileName: View (Profile) name. + ProfileName string `json:"profileName,omitempty"` + + // TableId: Table ID for view (profile). + TableId string `json:"tableId,omitempty"` + + // WebPropertyId: Web Property ID to which this view (profile) belongs. + WebPropertyId string `json:"webPropertyId,omitempty"` +} + +type GaDataQuery struct { + // Dimensions: List of analytics dimensions. + Dimensions string `json:"dimensions,omitempty"` + + // EndDate: End date. + EndDate string `json:"end-date,omitempty"` + + // Filters: Comma-separated list of dimension or metric filters. + Filters string `json:"filters,omitempty"` + + // Ids: Unique table ID. + Ids string `json:"ids,omitempty"` + + // MaxResults: Maximum results per page. + MaxResults int64 `json:"max-results,omitempty"` + + // Metrics: List of analytics metrics. + Metrics []string `json:"metrics,omitempty"` + + // SamplingLevel: Desired sampling level + SamplingLevel string `json:"samplingLevel,omitempty"` + + // Segment: Analytics advanced segment. + Segment string `json:"segment,omitempty"` + + // Sort: List of dimensions or metrics based on which Analytics data is + // sorted. + Sort []string `json:"sort,omitempty"` + + // StartDate: Start date. + StartDate string `json:"start-date,omitempty"` + + // StartIndex: Start index. + StartIndex int64 `json:"start-index,omitempty"` +} + +type Goal struct { + // AccountId: Account ID to which this goal belongs. + AccountId string `json:"accountId,omitempty"` + + // Active: Determines whether this goal is active. + Active bool `json:"active,omitempty"` + + // Created: Time this goal was created. + Created string `json:"created,omitempty"` + + // EventDetails: Details for the goal of the type EVENT. + EventDetails *GoalEventDetails `json:"eventDetails,omitempty"` + + // Id: Goal ID. + Id string `json:"id,omitempty"` + + // InternalWebPropertyId: Internal ID for the web property to which this + // goal belongs. + InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"` + + // Kind: Resource type for an Analytics goal. + Kind string `json:"kind,omitempty"` + + // Name: Goal name. + Name string `json:"name,omitempty"` + + // ParentLink: Parent link for a goal. Points to the view (profile) to + // which this goal belongs. + ParentLink *GoalParentLink `json:"parentLink,omitempty"` + + // ProfileId: View (Profile) ID to which this goal belongs. + ProfileId string `json:"profileId,omitempty"` + + // SelfLink: Link for this goal. + SelfLink string `json:"selfLink,omitempty"` + + // Type: Goal type. Possible values are URL_DESTINATION, + // VISIT_TIME_ON_SITE, VISIT_NUM_PAGES, AND EVENT. + Type string `json:"type,omitempty"` + + // Updated: Time this goal was last modified. + Updated string `json:"updated,omitempty"` + + // UrlDestinationDetails: Details for the goal of the type + // URL_DESTINATION. + UrlDestinationDetails *GoalUrlDestinationDetails `json:"urlDestinationDetails,omitempty"` + + // Value: Goal value. + Value float64 `json:"value,omitempty"` + + // VisitNumPagesDetails: Details for the goal of the type + // VISIT_NUM_PAGES. + VisitNumPagesDetails *GoalVisitNumPagesDetails `json:"visitNumPagesDetails,omitempty"` + + // VisitTimeOnSiteDetails: Details for the goal of the type + // VISIT_TIME_ON_SITE. + VisitTimeOnSiteDetails *GoalVisitTimeOnSiteDetails `json:"visitTimeOnSiteDetails,omitempty"` + + // WebPropertyId: Web property ID to which this goal belongs. The web + // property ID is of the form UA-XXXXX-YY. + WebPropertyId string `json:"webPropertyId,omitempty"` +} + +type GoalEventDetails struct { + // EventConditions: List of event conditions. + EventConditions []*GoalEventDetailsEventConditions `json:"eventConditions,omitempty"` + + // UseEventValue: Determines if the event value should be used as the + // value for this goal. + UseEventValue bool `json:"useEventValue,omitempty"` +} + +type GoalEventDetailsEventConditions struct { + // ComparisonType: Type of comparison. Possible values are LESS_THAN, + // GREATER_THAN or EQUAL. + ComparisonType string `json:"comparisonType,omitempty"` + + // ComparisonValue: Value used for this comparison. + ComparisonValue int64 `json:"comparisonValue,omitempty,string"` + + // Expression: Expression used for this match. + Expression string `json:"expression,omitempty"` + + // MatchType: Type of the match to be performed. Possible values are + // REGEXP, BEGINS_WITH, or EXACT. + MatchType string `json:"matchType,omitempty"` + + // Type: Type of this event condition. Possible values are CATEGORY, + // ACTION, LABEL, or VALUE. + Type string `json:"type,omitempty"` +} + +type GoalParentLink struct { + // Href: Link to the view (profile) to which this goal belongs. + Href string `json:"href,omitempty"` + + // Type: Value is "analytics#profile". + Type string `json:"type,omitempty"` +} + +type GoalUrlDestinationDetails struct { + // CaseSensitive: Determines if the goal URL must exactly match the + // capitalization of visited URLs. + CaseSensitive bool `json:"caseSensitive,omitempty"` + + // FirstStepRequired: Determines if the first step in this goal is + // required. + FirstStepRequired bool `json:"firstStepRequired,omitempty"` + + // MatchType: Match type for the goal URL. Possible values are HEAD, + // EXACT, or REGEX. + MatchType string `json:"matchType,omitempty"` + + // Steps: List of steps configured for this goal funnel. + Steps []*GoalUrlDestinationDetailsSteps `json:"steps,omitempty"` + + // Url: URL for this goal. + Url string `json:"url,omitempty"` +} + +type GoalUrlDestinationDetailsSteps struct { + // Name: Step name. + Name string `json:"name,omitempty"` + + // Number: Step number. + Number int64 `json:"number,omitempty"` + + // Url: URL for this step. + Url string `json:"url,omitempty"` +} + +type GoalVisitNumPagesDetails struct { + // ComparisonType: Type of comparison. Possible values are LESS_THAN, + // GREATER_THAN, or EQUAL. + ComparisonType string `json:"comparisonType,omitempty"` + + // ComparisonValue: Value used for this comparison. + ComparisonValue int64 `json:"comparisonValue,omitempty,string"` +} + +type GoalVisitTimeOnSiteDetails struct { + // ComparisonType: Type of comparison. Possible values are LESS_THAN or + // GREATER_THAN. + ComparisonType string `json:"comparisonType,omitempty"` + + // ComparisonValue: Value used for this comparison. + ComparisonValue int64 `json:"comparisonValue,omitempty,string"` +} + +type Goals struct { + // Items: A list of goals. + Items []*Goal `json:"items,omitempty"` + + // ItemsPerPage: The maximum number of resources the response can + // contain, regardless of the actual number of resources returned. Its + // value ranges from 1 to 1000 with a value of 1000 by default, or + // otherwise specified by the max-results query parameter. + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + + // Kind: Collection type. + Kind string `json:"kind,omitempty"` + + // NextLink: Link to next page for this goal collection. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Link to previous page for this goal collection. + PreviousLink string `json:"previousLink,omitempty"` + + // StartIndex: The starting index of the resources, which is 1 by + // default or otherwise specified by the start-index query parameter. + StartIndex int64 `json:"startIndex,omitempty"` + + // TotalResults: The total number of results for the query, regardless + // of the number of resources in the result. + TotalResults int64 `json:"totalResults,omitempty"` + + // Username: Email ID of the authenticated user + Username string `json:"username,omitempty"` +} + +type McfData struct { + // ColumnHeaders: Column headers that list dimension names followed by + // the metric names. The order of dimensions and metrics is same as + // specified in the request. + ColumnHeaders []*McfDataColumnHeaders `json:"columnHeaders,omitempty"` + + // ContainsSampledData: Determines if the Analytics data contains + // sampled data. + ContainsSampledData bool `json:"containsSampledData,omitempty"` + + // Id: Unique ID for this data response. + Id string `json:"id,omitempty"` + + // ItemsPerPage: The maximum number of rows the response can contain, + // regardless of the actual number of rows returned. Its value ranges + // from 1 to 10,000 with a value of 1000 by default, or otherwise + // specified by the max-results query parameter. + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // NextLink: Link to next page for this Analytics data query. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Link to previous page for this Analytics data query. + PreviousLink string `json:"previousLink,omitempty"` + + // ProfileInfo: Information for the view (profile), for which the + // Analytics data was requested. + ProfileInfo *McfDataProfileInfo `json:"profileInfo,omitempty"` + + // Query: Analytics data request query parameters. + Query *McfDataQuery `json:"query,omitempty"` + + // Rows: Analytics data rows, where each row contains a list of + // dimension values followed by the metric values. The order of + // dimensions and metrics is same as specified in the request. + Rows [][]*McfDataRowsItem `json:"rows,omitempty"` + + // SampleSize: The number of samples used to calculate the result. + SampleSize int64 `json:"sampleSize,omitempty,string"` + + // SampleSpace: Total size of the sample space from which the samples + // were selected. + SampleSpace int64 `json:"sampleSpace,omitempty,string"` + + // SelfLink: Link to this page. + SelfLink string `json:"selfLink,omitempty"` + + // TotalResults: The total number of rows for the query, regardless of + // the number of rows in the response. + TotalResults int64 `json:"totalResults,omitempty"` + + // TotalsForAllResults: Total values for the requested metrics over all + // the results, not just the results returned in this response. The + // order of the metric totals is same as the metric order specified in + // the request. + TotalsForAllResults map[string]string `json:"totalsForAllResults,omitempty"` +} + +type McfDataColumnHeaders struct { + // ColumnType: Column Type. Either DIMENSION or METRIC. + ColumnType string `json:"columnType,omitempty"` + + // DataType: Data type. Dimension and metric values data types such as + // INTEGER, DOUBLE, CURRENCY, MCF_SEQUENCE etc. + DataType string `json:"dataType,omitempty"` + + // Name: Column name. + Name string `json:"name,omitempty"` +} + +type McfDataProfileInfo struct { + // AccountId: Account ID to which this view (profile) belongs. + AccountId string `json:"accountId,omitempty"` + + // InternalWebPropertyId: Internal ID for the web property to which this + // view (profile) belongs. + InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"` + + // ProfileId: View (Profile) ID. + ProfileId string `json:"profileId,omitempty"` + + // ProfileName: View (Profile) name. + ProfileName string `json:"profileName,omitempty"` + + // TableId: Table ID for view (profile). + TableId string `json:"tableId,omitempty"` + + // WebPropertyId: Web Property ID to which this view (profile) belongs. + WebPropertyId string `json:"webPropertyId,omitempty"` +} + +type McfDataQuery struct { + // Dimensions: List of analytics dimensions. + Dimensions string `json:"dimensions,omitempty"` + + // EndDate: End date. + EndDate string `json:"end-date,omitempty"` + + // Filters: Comma-separated list of dimension or metric filters. + Filters string `json:"filters,omitempty"` + + // Ids: Unique table ID. + Ids string `json:"ids,omitempty"` + + // MaxResults: Maximum results per page. + MaxResults int64 `json:"max-results,omitempty"` + + // Metrics: List of analytics metrics. + Metrics []string `json:"metrics,omitempty"` + + // SamplingLevel: Desired sampling level + SamplingLevel string `json:"samplingLevel,omitempty"` + + // Segment: Analytics advanced segment. + Segment string `json:"segment,omitempty"` + + // Sort: List of dimensions or metrics based on which Analytics data is + // sorted. + Sort []string `json:"sort,omitempty"` + + // StartDate: Start date. + StartDate string `json:"start-date,omitempty"` + + // StartIndex: Start index. + StartIndex int64 `json:"start-index,omitempty"` +} + +type McfDataRowsItem struct { + // ConversionPathValue: A conversion path dimension value, containing a + // list of interactions with their attributes. + ConversionPathValue []*McfDataRowsItemConversionPathValue `json:"conversionPathValue,omitempty"` + + // PrimitiveValue: A primitive dimension value. A primitive metric + // value. + PrimitiveValue string `json:"primitiveValue,omitempty"` +} + +type McfDataRowsItemConversionPathValue struct { + // InteractionType: Type of an interaction on conversion path. Such as + // CLICK, IMPRESSION etc. + InteractionType string `json:"interactionType,omitempty"` + + // NodeValue: Node value of an interaction on conversion path. Such as + // source, medium etc. + NodeValue string `json:"nodeValue,omitempty"` +} + +type Profile struct { + // AccountId: Account ID to which this view (profile) belongs. + AccountId string `json:"accountId,omitempty"` + + // ChildLink: Child link for this view (profile). Points to the list of + // goals for this view (profile). + ChildLink *ProfileChildLink `json:"childLink,omitempty"` + + // Created: Time this view (profile) was created. + Created string `json:"created,omitempty"` + + // Currency: The currency type associated with this view (profile). The + // supported values are: + // ARS, AUD, BGN, BRL, CAD, CHF, CNY, CZK, DKK, + // EUR, GBP, HKD, HUF, IDR, INR, JPY, KRW, LTL, MXN, NOK, NZD, PHP, PLN, + // RUB, SEK, THB, TRY, TWD, USD, VND, ZAR + Currency string `json:"currency,omitempty"` + + // DefaultPage: Default page for this view (profile). + DefaultPage string `json:"defaultPage,omitempty"` + + // ECommerceTracking: Indicates whether ecommerce tracking is enabled + // for this view (profile). + ECommerceTracking bool `json:"eCommerceTracking,omitempty"` + + // ExcludeQueryParameters: The query parameters that are excluded from + // this view (profile). + ExcludeQueryParameters string `json:"excludeQueryParameters,omitempty"` + + // Id: View (Profile) ID. + Id string `json:"id,omitempty"` + + // InternalWebPropertyId: Internal ID for the web property to which this + // view (profile) belongs. + InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"` + + // Kind: Resource type for Analytics view (profile). + Kind string `json:"kind,omitempty"` + + // Name: Name of this view (profile). + Name string `json:"name,omitempty"` + + // ParentLink: Parent link for this view (profile). Points to the web + // property to which this view (profile) belongs. + ParentLink *ProfileParentLink `json:"parentLink,omitempty"` + + // Permissions: Permissions the user has for this view (profile). + Permissions *ProfilePermissions `json:"permissions,omitempty"` + + // SelfLink: Link for this view (profile). + SelfLink string `json:"selfLink,omitempty"` + + // SiteSearchCategoryParameters: Site search category parameters for + // this view (profile). + SiteSearchCategoryParameters string `json:"siteSearchCategoryParameters,omitempty"` + + // SiteSearchQueryParameters: The site search query parameters for this + // view (profile). + SiteSearchQueryParameters string `json:"siteSearchQueryParameters,omitempty"` + + // StripSiteSearchCategoryParameters: Whether or not Analytics will + // strip search category parameters from the URLs in your reports. + StripSiteSearchCategoryParameters bool `json:"stripSiteSearchCategoryParameters,omitempty"` + + // StripSiteSearchQueryParameters: Whether or not Analytics will strip + // search query parameters from the URLs in your reports. + StripSiteSearchQueryParameters bool `json:"stripSiteSearchQueryParameters,omitempty"` + + // Timezone: Time zone for which this view (profile) has been + // configured. Time zones are identified by strings from the TZ + // database. + Timezone string `json:"timezone,omitempty"` + + // Type: View (Profile) type. Supported types: WEB or APP. + Type string `json:"type,omitempty"` + + // Updated: Time this view (profile) was last modified. + Updated string `json:"updated,omitempty"` + + // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this + // view (profile) belongs. + WebPropertyId string `json:"webPropertyId,omitempty"` + + // WebsiteUrl: Website URL for this view (profile). + WebsiteUrl string `json:"websiteUrl,omitempty"` +} + +type ProfileChildLink struct { + // Href: Link to the list of goals for this view (profile). + Href string `json:"href,omitempty"` + + // Type: Value is "analytics#goals". + Type string `json:"type,omitempty"` +} + +type ProfileParentLink struct { + // Href: Link to the web property to which this view (profile) belongs. + Href string `json:"href,omitempty"` + + // Type: Value is "analytics#webproperty". + Type string `json:"type,omitempty"` +} + +type ProfilePermissions struct { + // Effective: All the permissions that the user has for this view + // (profile). These include any implied permissions (e.g., EDIT implies + // VIEW) or inherited permissions from the parent web property. + Effective []string `json:"effective,omitempty"` +} + +type ProfileRef struct { + // AccountId: Account ID to which this view (profile) belongs. + AccountId string `json:"accountId,omitempty"` + + // Href: Link for this view (profile). + Href string `json:"href,omitempty"` + + // Id: View (Profile) ID. + Id string `json:"id,omitempty"` + + // InternalWebPropertyId: Internal ID for the web property to which this + // view (profile) belongs. + InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"` + + // Kind: Analytics view (profile) reference. + Kind string `json:"kind,omitempty"` + + // Name: Name of this view (profile). + Name string `json:"name,omitempty"` + + // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this + // view (profile) belongs. + WebPropertyId string `json:"webPropertyId,omitempty"` +} + +type ProfileSummary struct { + // Id: View (profile) ID. + Id string `json:"id,omitempty"` + + // Kind: Resource type for Analytics ProfileSummary. + Kind string `json:"kind,omitempty"` + + // Name: View (profile) name. + Name string `json:"name,omitempty"` + + // Type: View (Profile) type. Supported types: WEB or APP. + Type string `json:"type,omitempty"` +} + +type Profiles struct { + // Items: A list of views (profiles). + Items []*Profile `json:"items,omitempty"` + + // ItemsPerPage: The maximum number of resources the response can + // contain, regardless of the actual number of resources returned. Its + // value ranges from 1 to 1000 with a value of 1000 by default, or + // otherwise specified by the max-results query parameter. + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + + // Kind: Collection type. + Kind string `json:"kind,omitempty"` + + // NextLink: Link to next page for this view (profile) collection. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Link to previous page for this view (profile) + // collection. + PreviousLink string `json:"previousLink,omitempty"` + + // StartIndex: The starting index of the resources, which is 1 by + // default or otherwise specified by the start-index query parameter. + StartIndex int64 `json:"startIndex,omitempty"` + + // TotalResults: The total number of results for the query, regardless + // of the number of results in the response. + TotalResults int64 `json:"totalResults,omitempty"` + + // Username: Email ID of the authenticated user + Username string `json:"username,omitempty"` +} + +type RealtimeData struct { + // ColumnHeaders: Column headers that list dimension names followed by + // the metric names. The order of dimensions and metrics is same as + // specified in the request. + ColumnHeaders []*RealtimeDataColumnHeaders `json:"columnHeaders,omitempty"` + + // Id: Unique ID for this data response. + Id string `json:"id,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ProfileInfo: Information for the view (profile), for which the real + // time data was requested. + ProfileInfo *RealtimeDataProfileInfo `json:"profileInfo,omitempty"` + + // Query: Real time data request query parameters. + Query *RealtimeDataQuery `json:"query,omitempty"` + + // Rows: Real time data rows, where each row contains a list of + // dimension values followed by the metric values. The order of + // dimensions and metrics is same as specified in the request. + Rows [][]string `json:"rows,omitempty"` + + // SelfLink: Link to this page. + SelfLink string `json:"selfLink,omitempty"` + + // TotalResults: The total number of rows for the query, regardless of + // the number of rows in the response. + TotalResults int64 `json:"totalResults,omitempty"` + + // TotalsForAllResults: Total values for the requested metrics over all + // the results, not just the results returned in this response. The + // order of the metric totals is same as the metric order specified in + // the request. + TotalsForAllResults map[string]string `json:"totalsForAllResults,omitempty"` +} + +type RealtimeDataColumnHeaders struct { + // ColumnType: Column Type. Either DIMENSION or METRIC. + ColumnType string `json:"columnType,omitempty"` + + // DataType: Data type. Dimension column headers have only STRING as the + // data type. Metric column headers have data types for metric values + // such as INTEGER, DOUBLE, CURRENCY etc. + DataType string `json:"dataType,omitempty"` + + // Name: Column name. + Name string `json:"name,omitempty"` +} + +type RealtimeDataProfileInfo struct { + // AccountId: Account ID to which this view (profile) belongs. + AccountId string `json:"accountId,omitempty"` + + // InternalWebPropertyId: Internal ID for the web property to which this + // view (profile) belongs. + InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"` + + // ProfileId: View (Profile) ID. + ProfileId string `json:"profileId,omitempty"` + + // ProfileName: View (Profile) name. + ProfileName string `json:"profileName,omitempty"` + + // TableId: Table ID for view (profile). + TableId string `json:"tableId,omitempty"` + + // WebPropertyId: Web Property ID to which this view (profile) belongs. + WebPropertyId string `json:"webPropertyId,omitempty"` +} + +type RealtimeDataQuery struct { + // Dimensions: List of real time dimensions. + Dimensions string `json:"dimensions,omitempty"` + + // Filters: Comma-separated list of dimension or metric filters. + Filters string `json:"filters,omitempty"` + + // Ids: Unique table ID. + Ids string `json:"ids,omitempty"` + + // MaxResults: Maximum results per page. + MaxResults int64 `json:"max-results,omitempty"` + + // Metrics: List of real time metrics. + Metrics []string `json:"metrics,omitempty"` + + // Sort: List of dimensions or metrics based on which real time data is + // sorted. + Sort []string `json:"sort,omitempty"` +} + +type Segment struct { + // Created: Time the segment was created. + Created string `json:"created,omitempty"` + + // Definition: Segment definition. + Definition string `json:"definition,omitempty"` + + // Id: Segment ID. + Id string `json:"id,omitempty"` + + // Kind: Resource type for Analytics segment. + Kind string `json:"kind,omitempty"` + + // Name: Segment name. + Name string `json:"name,omitempty"` + + // SegmentId: Segment ID. Can be used with the 'segment' parameter in + // Core Reporting API. + SegmentId string `json:"segmentId,omitempty"` + + // SelfLink: Link for this segment. + SelfLink string `json:"selfLink,omitempty"` + + // Type: Type for a segment. Possible values are "BUILT_IN" or "CUSTOM". + Type string `json:"type,omitempty"` + + // Updated: Time the segment was last modified. + Updated string `json:"updated,omitempty"` +} + +type Segments struct { + // Items: A list of segments. + Items []*Segment `json:"items,omitempty"` + + // ItemsPerPage: The maximum number of resources the response can + // contain, regardless of the actual number of resources returned. Its + // value ranges from 1 to 1000 with a value of 1000 by default, or + // otherwise specified by the max-results query parameter. + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + + // Kind: Collection type for segments. + Kind string `json:"kind,omitempty"` + + // NextLink: Link to next page for this segment collection. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Link to previous page for this segment collection. + PreviousLink string `json:"previousLink,omitempty"` + + // StartIndex: The starting index of the resources, which is 1 by + // default or otherwise specified by the start-index query parameter. + StartIndex int64 `json:"startIndex,omitempty"` + + // TotalResults: The total number of results for the query, regardless + // of the number of results in the response. + TotalResults int64 `json:"totalResults,omitempty"` + + // Username: Email ID of the authenticated user + Username string `json:"username,omitempty"` +} + +type Upload struct { + // AccountId: Account Id to which this upload belongs. + AccountId int64 `json:"accountId,omitempty,string"` + + // CustomDataSourceId: Custom data source Id to which this data import + // belongs. + CustomDataSourceId string `json:"customDataSourceId,omitempty"` + + // Errors: Data import errors collection. + Errors []string `json:"errors,omitempty"` + + // Id: A unique ID for this upload. + Id string `json:"id,omitempty"` + + // Kind: Resource type for Analytics upload. + Kind string `json:"kind,omitempty"` + + // Status: Upload status. Possible values: PENDING, COMPLETED, FAILED, + // DELETING, DELETED. + Status string `json:"status,omitempty"` +} + +type Uploads struct { + // Items: A list of uploads. + Items []*Upload `json:"items,omitempty"` + + // ItemsPerPage: The maximum number of resources the response can + // contain, regardless of the actual number of resources returned. Its + // value ranges from 1 to 1000 with a value of 1000 by default, or + // otherwise specified by the max-results query parameter. + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + + // Kind: Collection type. + Kind string `json:"kind,omitempty"` + + // NextLink: Link to next page for this upload collection. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Link to previous page for this upload collection. + PreviousLink string `json:"previousLink,omitempty"` + + // StartIndex: The starting index of the resources, which is 1 by + // default or otherwise specified by the start-index query parameter. + StartIndex int64 `json:"startIndex,omitempty"` + + // TotalResults: The total number of results for the query, regardless + // of the number of resources in the result. + TotalResults int64 `json:"totalResults,omitempty"` +} + +type UserRef struct { + // Email: Email ID of this user. + Email string `json:"email,omitempty"` + + // Id: User ID. + Id string `json:"id,omitempty"` + + Kind string `json:"kind,omitempty"` +} + +type WebPropertyRef struct { + // AccountId: Account ID to which this web property belongs. + AccountId string `json:"accountId,omitempty"` + + // Href: Link for this web property. + Href string `json:"href,omitempty"` + + // Id: Web property ID of the form UA-XXXXX-YY. + Id string `json:"id,omitempty"` + + // InternalWebPropertyId: Internal ID for this web property. + InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"` + + // Kind: Analytics web property reference. + Kind string `json:"kind,omitempty"` + + // Name: Name of this web property. + Name string `json:"name,omitempty"` +} + +type WebPropertySummary struct { + // Id: Web property ID of the form UA-XXXXX-YY. + Id string `json:"id,omitempty"` + + // InternalWebPropertyId: Internal ID for this web property. + InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"` + + // Kind: Resource type for Analytics WebPropertySummary. + Kind string `json:"kind,omitempty"` + + // Level: Level for this web property. Possible values are STANDARD or + // PREMIUM. + Level string `json:"level,omitempty"` + + // Name: Web property name. + Name string `json:"name,omitempty"` + + // Profiles: List of profiles under this web property. + Profiles []*ProfileSummary `json:"profiles,omitempty"` + + // WebsiteUrl: Website url for this web property. + WebsiteUrl string `json:"websiteUrl,omitempty"` +} + +type Webproperties struct { + // Items: A list of web properties. + Items []*Webproperty `json:"items,omitempty"` + + // ItemsPerPage: The maximum number of resources the response can + // contain, regardless of the actual number of resources returned. Its + // value ranges from 1 to 1000 with a value of 1000 by default, or + // otherwise specified by the max-results query parameter. + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + + // Kind: Collection type. + Kind string `json:"kind,omitempty"` + + // NextLink: Link to next page for this web property collection. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Link to previous page for this web property collection. + PreviousLink string `json:"previousLink,omitempty"` + + // StartIndex: The starting index of the resources, which is 1 by + // default or otherwise specified by the start-index query parameter. + StartIndex int64 `json:"startIndex,omitempty"` + + // TotalResults: The total number of results for the query, regardless + // of the number of results in the response. + TotalResults int64 `json:"totalResults,omitempty"` + + // Username: Email ID of the authenticated user + Username string `json:"username,omitempty"` +} + +type Webproperty struct { + // AccountId: Account ID to which this web property belongs. + AccountId string `json:"accountId,omitempty"` + + // ChildLink: Child link for this web property. Points to the list of + // views (profiles) for this web property. + ChildLink *WebpropertyChildLink `json:"childLink,omitempty"` + + // Created: Time this web property was created. + Created string `json:"created,omitempty"` + + // DefaultProfileId: Default view (profile) ID. + DefaultProfileId int64 `json:"defaultProfileId,omitempty,string"` + + // Id: Web property ID of the form UA-XXXXX-YY. + Id string `json:"id,omitempty"` + + // IndustryVertical: The industry vertical/category selected for this + // web property. + IndustryVertical string `json:"industryVertical,omitempty"` + + // InternalWebPropertyId: Internal ID for this web property. + InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"` + + // Kind: Resource type for Analytics WebProperty. + Kind string `json:"kind,omitempty"` + + // Level: Level for this web property. Possible values are STANDARD or + // PREMIUM. + Level string `json:"level,omitempty"` + + // Name: Name of this web property. + Name string `json:"name,omitempty"` + + // ParentLink: Parent link for this web property. Points to the account + // to which this web property belongs. + ParentLink *WebpropertyParentLink `json:"parentLink,omitempty"` + + // Permissions: Permissions the user has for this web property. + Permissions *WebpropertyPermissions `json:"permissions,omitempty"` + + // ProfileCount: View (Profile) count for this web property. + ProfileCount int64 `json:"profileCount,omitempty"` + + // SelfLink: Link for this web property. + SelfLink string `json:"selfLink,omitempty"` + + // Updated: Time this web property was last modified. + Updated string `json:"updated,omitempty"` + + // WebsiteUrl: Website url for this web property. + WebsiteUrl string `json:"websiteUrl,omitempty"` +} + +type WebpropertyChildLink struct { + // Href: Link to the list of views (profiles) for this web property. + Href string `json:"href,omitempty"` + + // Type: Type of the parent link. Its value is "analytics#profiles". + Type string `json:"type,omitempty"` +} + +type WebpropertyParentLink struct { + // Href: Link to the account for this web property. + Href string `json:"href,omitempty"` + + // Type: Type of the parent link. Its value is "analytics#account". + Type string `json:"type,omitempty"` +} + +type WebpropertyPermissions struct { + // Effective: All the permissions that the user has for this web + // property. These include any implied permissions (e.g., EDIT implies + // VIEW) or inherited permissions from the parent account. + Effective []string `json:"effective,omitempty"` +} + +// method id "analytics.data.ga.get": + +type DataGaGetCall struct { + s *Service + ids string + startDate string + endDate string + metrics string + opt_ map[string]interface{} +} + +// Get: Returns Analytics data for a view (profile). +func (r *DataGaService) Get(ids string, startDate string, endDate string, metrics string) *DataGaGetCall { + c := &DataGaGetCall{s: r.s, opt_: make(map[string]interface{})} + c.ids = ids + c.startDate = startDate + c.endDate = endDate + c.metrics = metrics + return c +} + +// Dimensions sets the optional parameter "dimensions": A +// comma-separated list of Analytics dimensions. E.g., +// 'ga:browser,ga:city'. +func (c *DataGaGetCall) Dimensions(dimensions string) *DataGaGetCall { + c.opt_["dimensions"] = dimensions + return c +} + +// Filters sets the optional parameter "filters": A comma-separated list +// of dimension or metric filters to be applied to Analytics data. +func (c *DataGaGetCall) Filters(filters string) *DataGaGetCall { + c.opt_["filters"] = filters + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of entries to include in this feed. +func (c *DataGaGetCall) MaxResults(maxResults int64) *DataGaGetCall { + c.opt_["max-results"] = maxResults + return c +} + +// Output sets the optional parameter "output": The selected format for +// the response. Default format is JSON. +func (c *DataGaGetCall) Output(output string) *DataGaGetCall { + c.opt_["output"] = output + return c +} + +// SamplingLevel sets the optional parameter "samplingLevel": The +// desired sampling level. +func (c *DataGaGetCall) SamplingLevel(samplingLevel string) *DataGaGetCall { + c.opt_["samplingLevel"] = samplingLevel + return c +} + +// Segment sets the optional parameter "segment": An Analytics segment +// to be applied to data. +func (c *DataGaGetCall) Segment(segment string) *DataGaGetCall { + c.opt_["segment"] = segment + return c +} + +// Sort sets the optional parameter "sort": A comma-separated list of +// dimensions or metrics that determine the sort order for Analytics +// data. +func (c *DataGaGetCall) Sort(sort string) *DataGaGetCall { + c.opt_["sort"] = sort + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first entity to retrieve. Use this parameter as a pagination +// mechanism along with the max-results parameter. +func (c *DataGaGetCall) StartIndex(startIndex int64) *DataGaGetCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *DataGaGetCall) Do() (*GaData, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("end-date", fmt.Sprintf("%v", c.endDate)) + params.Set("ids", fmt.Sprintf("%v", c.ids)) + params.Set("metrics", fmt.Sprintf("%v", c.metrics)) + params.Set("start-date", fmt.Sprintf("%v", c.startDate)) + if v, ok := c.opt_["dimensions"]; ok { + params.Set("dimensions", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filters"]; ok { + params.Set("filters", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["output"]; ok { + params.Set("output", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["samplingLevel"]; ok { + params.Set("samplingLevel", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["segment"]; ok { + params.Set("segment", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "data/ga") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(GaData) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns Analytics data for a view (profile).", + // "httpMethod": "GET", + // "id": "analytics.data.ga.get", + // "parameterOrder": [ + // "ids", + // "start-date", + // "end-date", + // "metrics" + // ], + // "parameters": { + // "dimensions": { + // "description": "A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'.", + // "location": "query", + // "pattern": "(ga:.+)?", + // "type": "string" + // }, + // "end-date": { + // "description": "End date for fetching Analytics data. Request can should specify an end date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is yesterday.", + // "location": "query", + // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)", + // "required": true, + // "type": "string" + // }, + // "filters": { + // "description": "A comma-separated list of dimension or metric filters to be applied to Analytics data.", + // "location": "query", + // "pattern": "ga:.+", + // "type": "string" + // }, + // "ids": { + // "description": "Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID.", + // "location": "query", + // "pattern": "ga:[0-9]+", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of entries to include in this feed.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "metrics": { + // "description": "A comma-separated list of Analytics metrics. E.g., 'ga:visits,ga:pageviews'. At least one metric must be specified.", + // "location": "query", + // "pattern": "ga:.+", + // "required": true, + // "type": "string" + // }, + // "output": { + // "description": "The selected format for the response. Default format is JSON.", + // "enum": [ + // "dataTable", + // "json" + // ], + // "enumDescriptions": [ + // "Returns the response in Google Charts Data Table format. This is useful in creating visualization using Google Charts.", + // "Returns the response in standard JSON format." + // ], + // "location": "query", + // "type": "string" + // }, + // "samplingLevel": { + // "description": "The desired sampling level.", + // "enum": [ + // "DEFAULT", + // "FASTER", + // "HIGHER_PRECISION" + // ], + // "enumDescriptions": [ + // "Returns response with a sample size that balances speed and accuracy.", + // "Returns a fast response with a smaller sample size.", + // "Returns a more accurate response using a large sample size, but this may result in the response being slower." + // ], + // "location": "query", + // "type": "string" + // }, + // "segment": { + // "description": "An Analytics segment to be applied to data.", + // "location": "query", + // "type": "string" + // }, + // "sort": { + // "description": "A comma-separated list of dimensions or metrics that determine the sort order for Analytics data.", + // "location": "query", + // "pattern": "(-)?ga:.+", + // "type": "string" + // }, + // "start-date": { + // "description": "Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo.", + // "location": "query", + // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)", + // "required": true, + // "type": "string" + // }, + // "start-index": { + // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // } + // }, + // "path": "data/ga", + // "response": { + // "$ref": "GaData" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.data.mcf.get": + +type DataMcfGetCall struct { + s *Service + ids string + startDate string + endDate string + metrics string + opt_ map[string]interface{} +} + +// Get: Returns Analytics Multi-Channel Funnels data for a view +// (profile). +func (r *DataMcfService) Get(ids string, startDate string, endDate string, metrics string) *DataMcfGetCall { + c := &DataMcfGetCall{s: r.s, opt_: make(map[string]interface{})} + c.ids = ids + c.startDate = startDate + c.endDate = endDate + c.metrics = metrics + return c +} + +// Dimensions sets the optional parameter "dimensions": A +// comma-separated list of Multi-Channel Funnels dimensions. E.g., +// 'mcf:source,mcf:medium'. +func (c *DataMcfGetCall) Dimensions(dimensions string) *DataMcfGetCall { + c.opt_["dimensions"] = dimensions + return c +} + +// Filters sets the optional parameter "filters": A comma-separated list +// of dimension or metric filters to be applied to the Analytics data. +func (c *DataMcfGetCall) Filters(filters string) *DataMcfGetCall { + c.opt_["filters"] = filters + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of entries to include in this feed. +func (c *DataMcfGetCall) MaxResults(maxResults int64) *DataMcfGetCall { + c.opt_["max-results"] = maxResults + return c +} + +// SamplingLevel sets the optional parameter "samplingLevel": The +// desired sampling level. +func (c *DataMcfGetCall) SamplingLevel(samplingLevel string) *DataMcfGetCall { + c.opt_["samplingLevel"] = samplingLevel + return c +} + +// Sort sets the optional parameter "sort": A comma-separated list of +// dimensions or metrics that determine the sort order for the Analytics +// data. +func (c *DataMcfGetCall) Sort(sort string) *DataMcfGetCall { + c.opt_["sort"] = sort + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first entity to retrieve. Use this parameter as a pagination +// mechanism along with the max-results parameter. +func (c *DataMcfGetCall) StartIndex(startIndex int64) *DataMcfGetCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *DataMcfGetCall) Do() (*McfData, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("end-date", fmt.Sprintf("%v", c.endDate)) + params.Set("ids", fmt.Sprintf("%v", c.ids)) + params.Set("metrics", fmt.Sprintf("%v", c.metrics)) + params.Set("start-date", fmt.Sprintf("%v", c.startDate)) + if v, ok := c.opt_["dimensions"]; ok { + params.Set("dimensions", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filters"]; ok { + params.Set("filters", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["samplingLevel"]; ok { + params.Set("samplingLevel", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "data/mcf") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(McfData) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns Analytics Multi-Channel Funnels data for a view (profile).", + // "httpMethod": "GET", + // "id": "analytics.data.mcf.get", + // "parameterOrder": [ + // "ids", + // "start-date", + // "end-date", + // "metrics" + // ], + // "parameters": { + // "dimensions": { + // "description": "A comma-separated list of Multi-Channel Funnels dimensions. E.g., 'mcf:source,mcf:medium'.", + // "location": "query", + // "pattern": "(mcf:.+)?", + // "type": "string" + // }, + // "end-date": { + // "description": "End date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo.", + // "location": "query", + // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)", + // "required": true, + // "type": "string" + // }, + // "filters": { + // "description": "A comma-separated list of dimension or metric filters to be applied to the Analytics data.", + // "location": "query", + // "pattern": "mcf:.+", + // "type": "string" + // }, + // "ids": { + // "description": "Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID.", + // "location": "query", + // "pattern": "ga:[0-9]+", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of entries to include in this feed.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "metrics": { + // "description": "A comma-separated list of Multi-Channel Funnels metrics. E.g., 'mcf:totalConversions,mcf:totalConversionValue'. At least one metric must be specified.", + // "location": "query", + // "pattern": "mcf:.+", + // "required": true, + // "type": "string" + // }, + // "samplingLevel": { + // "description": "The desired sampling level.", + // "enum": [ + // "DEFAULT", + // "FASTER", + // "HIGHER_PRECISION" + // ], + // "enumDescriptions": [ + // "Returns response with a sample size that balances speed and accuracy.", + // "Returns a fast response with a smaller sample size.", + // "Returns a more accurate response using a large sample size, but this may result in the response being slower." + // ], + // "location": "query", + // "type": "string" + // }, + // "sort": { + // "description": "A comma-separated list of dimensions or metrics that determine the sort order for the Analytics data.", + // "location": "query", + // "pattern": "(-)?mcf:.+", + // "type": "string" + // }, + // "start-date": { + // "description": "Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo.", + // "location": "query", + // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)", + // "required": true, + // "type": "string" + // }, + // "start-index": { + // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // } + // }, + // "path": "data/mcf", + // "response": { + // "$ref": "McfData" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.data.realtime.get": + +type DataRealtimeGetCall struct { + s *Service + ids string + metrics string + opt_ map[string]interface{} +} + +// Get: Returns real time data for a view (profile). +func (r *DataRealtimeService) Get(ids string, metrics string) *DataRealtimeGetCall { + c := &DataRealtimeGetCall{s: r.s, opt_: make(map[string]interface{})} + c.ids = ids + c.metrics = metrics + return c +} + +// Dimensions sets the optional parameter "dimensions": A +// comma-separated list of real time dimensions. E.g., +// 'rt:medium,rt:city'. +func (c *DataRealtimeGetCall) Dimensions(dimensions string) *DataRealtimeGetCall { + c.opt_["dimensions"] = dimensions + return c +} + +// Filters sets the optional parameter "filters": A comma-separated list +// of dimension or metric filters to be applied to real time data. +func (c *DataRealtimeGetCall) Filters(filters string) *DataRealtimeGetCall { + c.opt_["filters"] = filters + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of entries to include in this feed. +func (c *DataRealtimeGetCall) MaxResults(maxResults int64) *DataRealtimeGetCall { + c.opt_["max-results"] = maxResults + return c +} + +// Sort sets the optional parameter "sort": A comma-separated list of +// dimensions or metrics that determine the sort order for real time +// data. +func (c *DataRealtimeGetCall) Sort(sort string) *DataRealtimeGetCall { + c.opt_["sort"] = sort + return c +} + +func (c *DataRealtimeGetCall) Do() (*RealtimeData, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("ids", fmt.Sprintf("%v", c.ids)) + params.Set("metrics", fmt.Sprintf("%v", c.metrics)) + if v, ok := c.opt_["dimensions"]; ok { + params.Set("dimensions", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filters"]; ok { + params.Set("filters", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "data/realtime") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RealtimeData) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns real time data for a view (profile).", + // "httpMethod": "GET", + // "id": "analytics.data.realtime.get", + // "parameterOrder": [ + // "ids", + // "metrics" + // ], + // "parameters": { + // "dimensions": { + // "description": "A comma-separated list of real time dimensions. E.g., 'rt:medium,rt:city'.", + // "location": "query", + // "pattern": "(ga:.+)|(rt:.+)", + // "type": "string" + // }, + // "filters": { + // "description": "A comma-separated list of dimension or metric filters to be applied to real time data.", + // "location": "query", + // "pattern": "(ga:.+)|(rt:.+)", + // "type": "string" + // }, + // "ids": { + // "description": "Unique table ID for retrieving real time data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID.", + // "location": "query", + // "pattern": "ga:[0-9]+", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of entries to include in this feed.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "metrics": { + // "description": "A comma-separated list of real time metrics. E.g., 'rt:activeVisitors'. At least one metric must be specified.", + // "location": "query", + // "pattern": "(ga:.+)|(rt:.+)", + // "required": true, + // "type": "string" + // }, + // "sort": { + // "description": "A comma-separated list of dimensions or metrics that determine the sort order for real time data.", + // "location": "query", + // "pattern": "(-)?((ga:.+)|(rt:.+))", + // "type": "string" + // } + // }, + // "path": "data/realtime", + // "response": { + // "$ref": "RealtimeData" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.accountSummaries.list": + +type ManagementAccountSummariesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Lists account summaries (lightweight tree comprised of +// accounts/properties/profiles) to which the user has access. +func (r *ManagementAccountSummariesService) List() *ManagementAccountSummariesListCall { + c := &ManagementAccountSummariesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of filters to include in this response. +func (c *ManagementAccountSummariesListCall) MaxResults(maxResults int64) *ManagementAccountSummariesListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first entity to retrieve. Use this parameter as a pagination +// mechanism along with the max-results parameter. +func (c *ManagementAccountSummariesListCall) StartIndex(startIndex int64) *ManagementAccountSummariesListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ManagementAccountSummariesListCall) Do() (*AccountSummaries, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accountSummaries") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AccountSummaries) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists account summaries (lightweight tree comprised of accounts/properties/profiles) to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.accountSummaries.list", + // "parameters": { + // "max-results": { + // "description": "The maximum number of filters to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "start-index": { + // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // } + // }, + // "path": "management/accountSummaries", + // "response": { + // "$ref": "AccountSummaries" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.accountUserLinks.delete": + +type ManagementAccountUserLinksDeleteCall struct { + s *Service + accountId string + linkId string + opt_ map[string]interface{} +} + +// Delete: Removes a user from the given account. +func (r *ManagementAccountUserLinksService) Delete(accountId string, linkId string) *ManagementAccountUserLinksDeleteCall { + c := &ManagementAccountUserLinksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.linkId = linkId + return c +} + +func (c *ManagementAccountUserLinksDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks/{linkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{linkId}", url.QueryEscape(c.linkId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Removes a user from the given account.", + // "httpMethod": "DELETE", + // "id": "analytics.management.accountUserLinks.delete", + // "parameterOrder": [ + // "accountId", + // "linkId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to delete the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "linkId": { + // "description": "Link ID to delete the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/entityUserLinks/{linkId}", + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.manage.users" + // ] + // } + +} + +// method id "analytics.management.accountUserLinks.insert": + +type ManagementAccountUserLinksInsertCall struct { + s *Service + accountId string + entityuserlink *EntityUserLink + opt_ map[string]interface{} +} + +// Insert: Adds a new user to the given account. +func (r *ManagementAccountUserLinksService) Insert(accountId string, entityuserlink *EntityUserLink) *ManagementAccountUserLinksInsertCall { + c := &ManagementAccountUserLinksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.entityuserlink = entityuserlink + return c +} + +func (c *ManagementAccountUserLinksInsertCall) Do() (*EntityUserLink, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(EntityUserLink) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a new user to the given account.", + // "httpMethod": "POST", + // "id": "analytics.management.accountUserLinks.insert", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to create the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/entityUserLinks", + // "request": { + // "$ref": "EntityUserLink" + // }, + // "response": { + // "$ref": "EntityUserLink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.manage.users" + // ] + // } + +} + +// method id "analytics.management.accountUserLinks.list": + +type ManagementAccountUserLinksListCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// List: Lists account-user links for a given account. +func (r *ManagementAccountUserLinksService) List(accountId string) *ManagementAccountUserLinksListCall { + c := &ManagementAccountUserLinksListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of account-user links to include in this response. +func (c *ManagementAccountUserLinksListCall) MaxResults(maxResults int64) *ManagementAccountUserLinksListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first account-user link to retrieve. Use this parameter as a +// pagination mechanism along with the max-results parameter. +func (c *ManagementAccountUserLinksListCall) StartIndex(startIndex int64) *ManagementAccountUserLinksListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ManagementAccountUserLinksListCall) Do() (*EntityUserLinks, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(EntityUserLinks) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists account-user links for a given account.", + // "httpMethod": "GET", + // "id": "analytics.management.accountUserLinks.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to retrieve the user links for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of account-user links to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "start-index": { + // "description": "An index of the first account-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // } + // }, + // "path": "management/accounts/{accountId}/entityUserLinks", + // "response": { + // "$ref": "EntityUserLinks" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.manage.users" + // ] + // } + +} + +// method id "analytics.management.accountUserLinks.update": + +type ManagementAccountUserLinksUpdateCall struct { + s *Service + accountId string + linkId string + entityuserlink *EntityUserLink + opt_ map[string]interface{} +} + +// Update: Updates permissions for an existing user on the given +// account. +func (r *ManagementAccountUserLinksService) Update(accountId string, linkId string, entityuserlink *EntityUserLink) *ManagementAccountUserLinksUpdateCall { + c := &ManagementAccountUserLinksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.linkId = linkId + c.entityuserlink = entityuserlink + return c +} + +func (c *ManagementAccountUserLinksUpdateCall) Do() (*EntityUserLink, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks/{linkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{linkId}", url.QueryEscape(c.linkId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(EntityUserLink) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates permissions for an existing user on the given account.", + // "httpMethod": "PUT", + // "id": "analytics.management.accountUserLinks.update", + // "parameterOrder": [ + // "accountId", + // "linkId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to update the account-user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "linkId": { + // "description": "Link ID to update the account-user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/entityUserLinks/{linkId}", + // "request": { + // "$ref": "EntityUserLink" + // }, + // "response": { + // "$ref": "EntityUserLink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.manage.users" + // ] + // } + +} + +// method id "analytics.management.accounts.list": + +type ManagementAccountsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Lists all accounts to which the user has access. +func (r *ManagementAccountsService) List() *ManagementAccountsListCall { + c := &ManagementAccountsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of accounts to include in this response. +func (c *ManagementAccountsListCall) MaxResults(maxResults int64) *ManagementAccountsListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first account to retrieve. Use this parameter as a pagination +// mechanism along with the max-results parameter. +func (c *ManagementAccountsListCall) StartIndex(startIndex int64) *ManagementAccountsListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ManagementAccountsListCall) Do() (*Accounts, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Accounts) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all accounts to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.accounts.list", + // "parameters": { + // "max-results": { + // "description": "The maximum number of accounts to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "start-index": { + // "description": "An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // } + // }, + // "path": "management/accounts", + // "response": { + // "$ref": "Accounts" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.customDataSources.list": + +type ManagementCustomDataSourcesListCall struct { + s *Service + accountId string + webPropertyId string + opt_ map[string]interface{} +} + +// List: List custom data sources to which the user has access. +func (r *ManagementCustomDataSourcesService) List(accountId string, webPropertyId string) *ManagementCustomDataSourcesListCall { + c := &ManagementCustomDataSourcesListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of custom data sources to include in this response. +func (c *ManagementCustomDataSourcesListCall) MaxResults(maxResults int64) *ManagementCustomDataSourcesListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": A 1-based index +// of the first custom data source to retrieve. Use this parameter as a +// pagination mechanism along with the max-results parameter. +func (c *ManagementCustomDataSourcesListCall) StartIndex(startIndex int64) *ManagementCustomDataSourcesListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ManagementCustomDataSourcesListCall) Do() (*CustomDataSources, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomDataSources) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List custom data sources to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.customDataSources.list", + // "parameterOrder": [ + // "accountId", + // "webPropertyId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account Id for the custom data sources to retrieve.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of custom data sources to include in this response.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "start-index": { + // "description": "A 1-based index of the first custom data source to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "webPropertyId": { + // "description": "Web property Id for the custom data sources to retrieve.", + // "location": "path", + // "pattern": "UA-(\\d+)-(\\d+)", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources", + // "response": { + // "$ref": "CustomDataSources" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.dailyUploads.delete": + +type ManagementDailyUploadsDeleteCall struct { + s *Service + accountId string + webPropertyId string + customDataSourceId string + date string + type_ string + opt_ map[string]interface{} +} + +// Delete: Delete uploaded data for the given date. +func (r *ManagementDailyUploadsService) Delete(accountId string, webPropertyId string, customDataSourceId string, date string, type_ string) *ManagementDailyUploadsDeleteCall { + c := &ManagementDailyUploadsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.customDataSourceId = customDataSourceId + c.date = date + c.type_ = type_ + return c +} + +func (c *ManagementDailyUploadsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("type", fmt.Sprintf("%v", c.type_)) + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads/{date}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customDataSourceId}", url.QueryEscape(c.customDataSourceId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{date}", url.QueryEscape(c.date), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete uploaded data for the given date.", + // "httpMethod": "DELETE", + // "id": "analytics.management.dailyUploads.delete", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "customDataSourceId", + // "date", + // "type" + // ], + // "parameters": { + // "accountId": { + // "description": "Account Id associated with daily upload delete.", + // "location": "path", + // "pattern": "[0-9]+", + // "required": true, + // "type": "string" + // }, + // "customDataSourceId": { + // "description": "Custom data source Id associated with daily upload delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "date": { + // "description": "Date for which data is to be deleted. Date should be formatted as YYYY-MM-DD.", + // "location": "path", + // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}", + // "required": true, + // "type": "string" + // }, + // "type": { + // "description": "Type of data for this delete.", + // "enum": [ + // "cost" + // ], + // "enumDescriptions": [ + // "Value for specifying cost data upload." + // ], + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property Id associated with daily upload delete.", + // "location": "path", + // "pattern": "UA-[0-9]+-[0-9]+", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads/{date}", + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.dailyUploads.list": + +type ManagementDailyUploadsListCall struct { + s *Service + accountId string + webPropertyId string + customDataSourceId string + startDate string + endDate string + opt_ map[string]interface{} +} + +// List: List daily uploads to which the user has access. +func (r *ManagementDailyUploadsService) List(accountId string, webPropertyId string, customDataSourceId string, startDate string, endDate string) *ManagementDailyUploadsListCall { + c := &ManagementDailyUploadsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.customDataSourceId = customDataSourceId + c.startDate = startDate + c.endDate = endDate + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of custom data sources to include in this response. +func (c *ManagementDailyUploadsListCall) MaxResults(maxResults int64) *ManagementDailyUploadsListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": A 1-based index +// of the first daily upload to retrieve. Use this parameter as a +// pagination mechanism along with the max-results parameter. +func (c *ManagementDailyUploadsListCall) StartIndex(startIndex int64) *ManagementDailyUploadsListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ManagementDailyUploadsListCall) Do() (*DailyUploads, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("end-date", fmt.Sprintf("%v", c.endDate)) + params.Set("start-date", fmt.Sprintf("%v", c.startDate)) + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customDataSourceId}", url.QueryEscape(c.customDataSourceId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DailyUploads) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List daily uploads to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.dailyUploads.list", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "customDataSourceId", + // "start-date", + // "end-date" + // ], + // "parameters": { + // "accountId": { + // "description": "Account Id for the daily uploads to retrieve.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "customDataSourceId": { + // "description": "Custom data source Id for daily uploads to retrieve.", + // "location": "path", + // "pattern": ".{22}", + // "required": true, + // "type": "string" + // }, + // "end-date": { + // "description": "End date of the form YYYY-MM-DD.", + // "location": "query", + // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of custom data sources to include in this response.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "start-date": { + // "description": "Start date of the form YYYY-MM-DD.", + // "location": "query", + // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}", + // "required": true, + // "type": "string" + // }, + // "start-index": { + // "description": "A 1-based index of the first daily upload to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "webPropertyId": { + // "description": "Web property Id for the daily uploads to retrieve.", + // "location": "path", + // "pattern": "UA-(\\d+)-(\\d+)", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads", + // "response": { + // "$ref": "DailyUploads" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.dailyUploads.upload": + +type ManagementDailyUploadsUploadCall struct { + s *Service + accountId string + webPropertyId string + customDataSourceId string + date string + appendNumber int64 + type_ string + opt_ map[string]interface{} + media_ io.Reader +} + +// Upload: Update/Overwrite data for a custom data source. +func (r *ManagementDailyUploadsService) Upload(accountId string, webPropertyId string, customDataSourceId string, date string, appendNumber int64, type_ string) *ManagementDailyUploadsUploadCall { + c := &ManagementDailyUploadsUploadCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.customDataSourceId = customDataSourceId + c.date = date + c.appendNumber = appendNumber + c.type_ = type_ + return c +} + +// Reset sets the optional parameter "reset": Reset/Overwrite all +// previous appends for this date and start over with this file as the +// first upload. +func (c *ManagementDailyUploadsUploadCall) Reset(reset bool) *ManagementDailyUploadsUploadCall { + c.opt_["reset"] = reset + return c +} +func (c *ManagementDailyUploadsUploadCall) Media(r io.Reader) *ManagementDailyUploadsUploadCall { + c.media_ = r + return c +} + +func (c *ManagementDailyUploadsUploadCall) Do() (*DailyUploadAppend, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("appendNumber", fmt.Sprintf("%v", c.appendNumber)) + params.Set("type", fmt.Sprintf("%v", c.type_)) + if v, ok := c.opt_["reset"]; ok { + params.Set("reset", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads/{date}/uploads") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customDataSourceId}", url.QueryEscape(c.customDataSourceId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{date}", url.QueryEscape(c.date), 1) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DailyUploadAppend) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update/Overwrite data for a custom data source.", + // "httpMethod": "POST", + // "id": "analytics.management.dailyUploads.upload", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream" + // ], + // "maxSize": "5MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads/{date}/uploads" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads/{date}/uploads" + // } + // } + // }, + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "customDataSourceId", + // "date", + // "appendNumber", + // "type" + // ], + // "parameters": { + // "accountId": { + // "description": "Account Id associated with daily upload.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "appendNumber": { + // "description": "Append number for this upload indexed from 1.", + // "format": "int32", + // "location": "query", + // "maximum": "20", + // "minimum": "1", + // "required": true, + // "type": "integer" + // }, + // "customDataSourceId": { + // "description": "Custom data source Id to which the data being uploaded belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "date": { + // "description": "Date for which data is uploaded. Date should be formatted as YYYY-MM-DD.", + // "location": "path", + // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}", + // "required": true, + // "type": "string" + // }, + // "reset": { + // "default": "false", + // "description": "Reset/Overwrite all previous appends for this date and start over with this file as the first upload.", + // "location": "query", + // "type": "boolean" + // }, + // "type": { + // "description": "Type of data for this upload.", + // "enum": [ + // "cost" + // ], + // "enumDescriptions": [ + // "Value for specifying cost data upload." + // ], + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property Id associated with daily upload.", + // "location": "path", + // "pattern": "UA-\\d+-\\d+", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/dailyUploads/{date}/uploads", + // "response": { + // "$ref": "DailyUploadAppend" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "analytics.management.experiments.delete": + +type ManagementExperimentsDeleteCall struct { + s *Service + accountId string + webPropertyId string + profileId string + experimentId string + opt_ map[string]interface{} +} + +// Delete: Delete an experiment. +func (r *ManagementExperimentsService) Delete(accountId string, webPropertyId string, profileId string, experimentId string) *ManagementExperimentsDeleteCall { + c := &ManagementExperimentsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.experimentId = experimentId + return c +} + +func (c *ManagementExperimentsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{experimentId}", url.QueryEscape(c.experimentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete an experiment.", + // "httpMethod": "DELETE", + // "id": "analytics.management.experiments.delete", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId", + // "experimentId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to which the experiment belongs", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "experimentId": { + // "description": "ID of the experiment to delete", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "View (Profile) ID to which the experiment belongs", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to which the experiment belongs", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}", + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.experiments.get": + +type ManagementExperimentsGetCall struct { + s *Service + accountId string + webPropertyId string + profileId string + experimentId string + opt_ map[string]interface{} +} + +// Get: Returns an experiment to which the user has access. +func (r *ManagementExperimentsService) Get(accountId string, webPropertyId string, profileId string, experimentId string) *ManagementExperimentsGetCall { + c := &ManagementExperimentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.experimentId = experimentId + return c +} + +func (c *ManagementExperimentsGetCall) Do() (*Experiment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{experimentId}", url.QueryEscape(c.experimentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Experiment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns an experiment to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.experiments.get", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId", + // "experimentId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to retrieve the experiment for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "experimentId": { + // "description": "Experiment ID to retrieve the experiment for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "View (Profile) ID to retrieve the experiment for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to retrieve the experiment for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}", + // "response": { + // "$ref": "Experiment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.experiments.insert": + +type ManagementExperimentsInsertCall struct { + s *Service + accountId string + webPropertyId string + profileId string + experiment *Experiment + opt_ map[string]interface{} +} + +// Insert: Create a new experiment. +func (r *ManagementExperimentsService) Insert(accountId string, webPropertyId string, profileId string, experiment *Experiment) *ManagementExperimentsInsertCall { + c := &ManagementExperimentsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.experiment = experiment + return c +} + +func (c *ManagementExperimentsInsertCall) Do() (*Experiment, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.experiment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Experiment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a new experiment.", + // "httpMethod": "POST", + // "id": "analytics.management.experiments.insert", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to create the experiment for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "View (Profile) ID to create the experiment for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to create the experiment for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments", + // "request": { + // "$ref": "Experiment" + // }, + // "response": { + // "$ref": "Experiment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.experiments.list": + +type ManagementExperimentsListCall struct { + s *Service + accountId string + webPropertyId string + profileId string + opt_ map[string]interface{} +} + +// List: Lists experiments to which the user has access. +func (r *ManagementExperimentsService) List(accountId string, webPropertyId string, profileId string) *ManagementExperimentsListCall { + c := &ManagementExperimentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of experiments to include in this response. +func (c *ManagementExperimentsListCall) MaxResults(maxResults int64) *ManagementExperimentsListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first experiment to retrieve. Use this parameter as a pagination +// mechanism along with the max-results parameter. +func (c *ManagementExperimentsListCall) StartIndex(startIndex int64) *ManagementExperimentsListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ManagementExperimentsListCall) Do() (*Experiments, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Experiments) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists experiments to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.experiments.list", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to retrieve experiments for.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of experiments to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "profileId": { + // "description": "View (Profile) ID to retrieve experiments for.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "start-index": { + // "description": "An index of the first experiment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "webPropertyId": { + // "description": "Web property ID to retrieve experiments for.", + // "location": "path", + // "pattern": "UA-(\\d+)-(\\d+)", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments", + // "response": { + // "$ref": "Experiments" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.experiments.patch": + +type ManagementExperimentsPatchCall struct { + s *Service + accountId string + webPropertyId string + profileId string + experimentId string + experiment *Experiment + opt_ map[string]interface{} +} + +// Patch: Update an existing experiment. This method supports patch +// semantics. +func (r *ManagementExperimentsService) Patch(accountId string, webPropertyId string, profileId string, experimentId string, experiment *Experiment) *ManagementExperimentsPatchCall { + c := &ManagementExperimentsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.experimentId = experimentId + c.experiment = experiment + return c +} + +func (c *ManagementExperimentsPatchCall) Do() (*Experiment, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.experiment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{experimentId}", url.QueryEscape(c.experimentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Experiment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update an existing experiment. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "analytics.management.experiments.patch", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId", + // "experimentId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID of the experiment to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "experimentId": { + // "description": "Experiment ID of the experiment to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "View (Profile) ID of the experiment to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID of the experiment to update.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}", + // "request": { + // "$ref": "Experiment" + // }, + // "response": { + // "$ref": "Experiment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.experiments.update": + +type ManagementExperimentsUpdateCall struct { + s *Service + accountId string + webPropertyId string + profileId string + experimentId string + experiment *Experiment + opt_ map[string]interface{} +} + +// Update: Update an existing experiment. +func (r *ManagementExperimentsService) Update(accountId string, webPropertyId string, profileId string, experimentId string, experiment *Experiment) *ManagementExperimentsUpdateCall { + c := &ManagementExperimentsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.experimentId = experimentId + c.experiment = experiment + return c +} + +func (c *ManagementExperimentsUpdateCall) Do() (*Experiment, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.experiment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{experimentId}", url.QueryEscape(c.experimentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Experiment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update an existing experiment.", + // "httpMethod": "PUT", + // "id": "analytics.management.experiments.update", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId", + // "experimentId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID of the experiment to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "experimentId": { + // "description": "Experiment ID of the experiment to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "View (Profile) ID of the experiment to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID of the experiment to update.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}", + // "request": { + // "$ref": "Experiment" + // }, + // "response": { + // "$ref": "Experiment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.goals.get": + +type ManagementGoalsGetCall struct { + s *Service + accountId string + webPropertyId string + profileId string + goalId string + opt_ map[string]interface{} +} + +// Get: Gets a goal to which the user has access. +func (r *ManagementGoalsService) Get(accountId string, webPropertyId string, profileId string, goalId string) *ManagementGoalsGetCall { + c := &ManagementGoalsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.goalId = goalId + return c +} + +func (c *ManagementGoalsGetCall) Do() (*Goal, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{goalId}", url.QueryEscape(c.goalId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Goal) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a goal to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.goals.get", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId", + // "goalId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to retrieve the goal for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "goalId": { + // "description": "Goal ID to retrieve the goal for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "View (Profile) ID to retrieve the goal for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to retrieve the goal for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}", + // "response": { + // "$ref": "Goal" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.goals.insert": + +type ManagementGoalsInsertCall struct { + s *Service + accountId string + webPropertyId string + profileId string + goal *Goal + opt_ map[string]interface{} +} + +// Insert: Create a new goal. +func (r *ManagementGoalsService) Insert(accountId string, webPropertyId string, profileId string, goal *Goal) *ManagementGoalsInsertCall { + c := &ManagementGoalsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.goal = goal + return c +} + +func (c *ManagementGoalsInsertCall) Do() (*Goal, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.goal) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Goal) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a new goal.", + // "httpMethod": "POST", + // "id": "analytics.management.goals.insert", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to create the goal for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "View (Profile) ID to create the goal for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to create the goal for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals", + // "request": { + // "$ref": "Goal" + // }, + // "response": { + // "$ref": "Goal" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.goals.list": + +type ManagementGoalsListCall struct { + s *Service + accountId string + webPropertyId string + profileId string + opt_ map[string]interface{} +} + +// List: Lists goals to which the user has access. +func (r *ManagementGoalsService) List(accountId string, webPropertyId string, profileId string) *ManagementGoalsListCall { + c := &ManagementGoalsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of goals to include in this response. +func (c *ManagementGoalsListCall) MaxResults(maxResults int64) *ManagementGoalsListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first goal to retrieve. Use this parameter as a pagination mechanism +// along with the max-results parameter. +func (c *ManagementGoalsListCall) StartIndex(startIndex int64) *ManagementGoalsListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ManagementGoalsListCall) Do() (*Goals, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Goals) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists goals to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.goals.list", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to retrieve goals for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of goals to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "profileId": { + // "description": "View (Profile) ID to retrieve goals for. Can either be a specific view (profile) ID or '~all', which refers to all the views (profiles) that user has access to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "start-index": { + // "description": "An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "webPropertyId": { + // "description": "Web property ID to retrieve goals for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals", + // "response": { + // "$ref": "Goals" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.goals.patch": + +type ManagementGoalsPatchCall struct { + s *Service + accountId string + webPropertyId string + profileId string + goalId string + goal *Goal + opt_ map[string]interface{} +} + +// Patch: Updates an existing view (profile). This method supports patch +// semantics. +func (r *ManagementGoalsService) Patch(accountId string, webPropertyId string, profileId string, goalId string, goal *Goal) *ManagementGoalsPatchCall { + c := &ManagementGoalsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.goalId = goalId + c.goal = goal + return c +} + +func (c *ManagementGoalsPatchCall) Do() (*Goal, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.goal) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{goalId}", url.QueryEscape(c.goalId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Goal) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing view (profile). This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "analytics.management.goals.patch", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId", + // "goalId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to update the goal.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "goalId": { + // "description": "Index of the goal to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "View (Profile) ID to update the goal.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to update the goal.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}", + // "request": { + // "$ref": "Goal" + // }, + // "response": { + // "$ref": "Goal" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.goals.update": + +type ManagementGoalsUpdateCall struct { + s *Service + accountId string + webPropertyId string + profileId string + goalId string + goal *Goal + opt_ map[string]interface{} +} + +// Update: Updates an existing view (profile). +func (r *ManagementGoalsService) Update(accountId string, webPropertyId string, profileId string, goalId string, goal *Goal) *ManagementGoalsUpdateCall { + c := &ManagementGoalsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.goalId = goalId + c.goal = goal + return c +} + +func (c *ManagementGoalsUpdateCall) Do() (*Goal, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.goal) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{goalId}", url.QueryEscape(c.goalId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Goal) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing view (profile).", + // "httpMethod": "PUT", + // "id": "analytics.management.goals.update", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId", + // "goalId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to update the goal.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "goalId": { + // "description": "Index of the goal to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "View (Profile) ID to update the goal.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to update the goal.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}", + // "request": { + // "$ref": "Goal" + // }, + // "response": { + // "$ref": "Goal" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.profileUserLinks.delete": + +type ManagementProfileUserLinksDeleteCall struct { + s *Service + accountId string + webPropertyId string + profileId string + linkId string + opt_ map[string]interface{} +} + +// Delete: Removes a user from the given view (profile). +func (r *ManagementProfileUserLinksService) Delete(accountId string, webPropertyId string, profileId string, linkId string) *ManagementProfileUserLinksDeleteCall { + c := &ManagementProfileUserLinksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.linkId = linkId + return c +} + +func (c *ManagementProfileUserLinksDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{linkId}", url.QueryEscape(c.linkId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Removes a user from the given view (profile).", + // "httpMethod": "DELETE", + // "id": "analytics.management.profileUserLinks.delete", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId", + // "linkId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to delete the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "linkId": { + // "description": "Link ID to delete the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "View (Profile) ID to delete the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web Property ID to delete the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}", + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.manage.users" + // ] + // } + +} + +// method id "analytics.management.profileUserLinks.insert": + +type ManagementProfileUserLinksInsertCall struct { + s *Service + accountId string + webPropertyId string + profileId string + entityuserlink *EntityUserLink + opt_ map[string]interface{} +} + +// Insert: Adds a new user to the given view (profile). +func (r *ManagementProfileUserLinksService) Insert(accountId string, webPropertyId string, profileId string, entityuserlink *EntityUserLink) *ManagementProfileUserLinksInsertCall { + c := &ManagementProfileUserLinksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.entityuserlink = entityuserlink + return c +} + +func (c *ManagementProfileUserLinksInsertCall) Do() (*EntityUserLink, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(EntityUserLink) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a new user to the given view (profile).", + // "httpMethod": "POST", + // "id": "analytics.management.profileUserLinks.insert", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to create the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "View (Profile) ID to create the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web Property ID to create the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks", + // "request": { + // "$ref": "EntityUserLink" + // }, + // "response": { + // "$ref": "EntityUserLink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.manage.users" + // ] + // } + +} + +// method id "analytics.management.profileUserLinks.list": + +type ManagementProfileUserLinksListCall struct { + s *Service + accountId string + webPropertyId string + profileId string + opt_ map[string]interface{} +} + +// List: Lists profile-user links for a given view (profile). +func (r *ManagementProfileUserLinksService) List(accountId string, webPropertyId string, profileId string) *ManagementProfileUserLinksListCall { + c := &ManagementProfileUserLinksListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of profile-user links to include in this response. +func (c *ManagementProfileUserLinksListCall) MaxResults(maxResults int64) *ManagementProfileUserLinksListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first profile-user link to retrieve. Use this parameter as a +// pagination mechanism along with the max-results parameter. +func (c *ManagementProfileUserLinksListCall) StartIndex(startIndex int64) *ManagementProfileUserLinksListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ManagementProfileUserLinksListCall) Do() (*EntityUserLinks, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(EntityUserLinks) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists profile-user links for a given view (profile).", + // "httpMethod": "GET", + // "id": "analytics.management.profileUserLinks.list", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID which the given view (profile) belongs to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of profile-user links to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "profileId": { + // "description": "View (Profile) ID to retrieve the profile-user links for", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "start-index": { + // "description": "An index of the first profile-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "webPropertyId": { + // "description": "Web Property ID which the given view (profile) belongs to.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks", + // "response": { + // "$ref": "EntityUserLinks" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.manage.users" + // ] + // } + +} + +// method id "analytics.management.profileUserLinks.update": + +type ManagementProfileUserLinksUpdateCall struct { + s *Service + accountId string + webPropertyId string + profileId string + linkId string + entityuserlink *EntityUserLink + opt_ map[string]interface{} +} + +// Update: Updates permissions for an existing user on the given view +// (profile). +func (r *ManagementProfileUserLinksService) Update(accountId string, webPropertyId string, profileId string, linkId string, entityuserlink *EntityUserLink) *ManagementProfileUserLinksUpdateCall { + c := &ManagementProfileUserLinksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.linkId = linkId + c.entityuserlink = entityuserlink + return c +} + +func (c *ManagementProfileUserLinksUpdateCall) Do() (*EntityUserLink, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{linkId}", url.QueryEscape(c.linkId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(EntityUserLink) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates permissions for an existing user on the given view (profile).", + // "httpMethod": "PUT", + // "id": "analytics.management.profileUserLinks.update", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId", + // "linkId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to update the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "linkId": { + // "description": "Link ID to update the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "View (Profile ID) to update the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web Property ID to update the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}", + // "request": { + // "$ref": "EntityUserLink" + // }, + // "response": { + // "$ref": "EntityUserLink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.manage.users" + // ] + // } + +} + +// method id "analytics.management.profiles.delete": + +type ManagementProfilesDeleteCall struct { + s *Service + accountId string + webPropertyId string + profileId string + opt_ map[string]interface{} +} + +// Delete: Deletes a view (profile). +func (r *ManagementProfilesService) Delete(accountId string, webPropertyId string, profileId string) *ManagementProfilesDeleteCall { + c := &ManagementProfilesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + return c +} + +func (c *ManagementProfilesDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a view (profile).", + // "httpMethod": "DELETE", + // "id": "analytics.management.profiles.delete", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to delete the view (profile) for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "ID of the view (profile) to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to delete the view (profile) for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}", + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.profiles.get": + +type ManagementProfilesGetCall struct { + s *Service + accountId string + webPropertyId string + profileId string + opt_ map[string]interface{} +} + +// Get: Gets a view (profile) to which the user has access. +func (r *ManagementProfilesService) Get(accountId string, webPropertyId string, profileId string) *ManagementProfilesGetCall { + c := &ManagementProfilesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + return c +} + +func (c *ManagementProfilesGetCall) Do() (*Profile, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Profile) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a view (profile) to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.profiles.get", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to retrieve the goal for.", + // "location": "path", + // "pattern": "[0-9]+", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "View (Profile) ID to retrieve the goal for.", + // "location": "path", + // "pattern": "[0-9]+", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to retrieve the goal for.", + // "location": "path", + // "pattern": "UA-[0-9]+-[0-9]+", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}", + // "response": { + // "$ref": "Profile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.profiles.insert": + +type ManagementProfilesInsertCall struct { + s *Service + accountId string + webPropertyId string + profile *Profile + opt_ map[string]interface{} +} + +// Insert: Create a new view (profile). +func (r *ManagementProfilesService) Insert(accountId string, webPropertyId string, profile *Profile) *ManagementProfilesInsertCall { + c := &ManagementProfilesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profile = profile + return c +} + +func (c *ManagementProfilesInsertCall) Do() (*Profile, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Profile) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a new view (profile).", + // "httpMethod": "POST", + // "id": "analytics.management.profiles.insert", + // "parameterOrder": [ + // "accountId", + // "webPropertyId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to create the view (profile) for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to create the view (profile) for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles", + // "request": { + // "$ref": "Profile" + // }, + // "response": { + // "$ref": "Profile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.profiles.list": + +type ManagementProfilesListCall struct { + s *Service + accountId string + webPropertyId string + opt_ map[string]interface{} +} + +// List: Lists views (profiles) to which the user has access. +func (r *ManagementProfilesService) List(accountId string, webPropertyId string) *ManagementProfilesListCall { + c := &ManagementProfilesListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of views (profiles) to include in this response. +func (c *ManagementProfilesListCall) MaxResults(maxResults int64) *ManagementProfilesListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first entity to retrieve. Use this parameter as a pagination +// mechanism along with the max-results parameter. +func (c *ManagementProfilesListCall) StartIndex(startIndex int64) *ManagementProfilesListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ManagementProfilesListCall) Do() (*Profiles, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Profiles) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists views (profiles) to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.profiles.list", + // "parameterOrder": [ + // "accountId", + // "webPropertyId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID for the view (profiles) to retrieve. Can either be a specific account ID or '~all', which refers to all the accounts to which the user has access.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of views (profiles) to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "start-index": { + // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "webPropertyId": { + // "description": "Web property ID 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.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles", + // "response": { + // "$ref": "Profiles" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.profiles.patch": + +type ManagementProfilesPatchCall struct { + s *Service + accountId string + webPropertyId string + profileId string + profile *Profile + opt_ map[string]interface{} +} + +// Patch: Updates an existing view (profile). This method supports patch +// semantics. +func (r *ManagementProfilesService) Patch(accountId string, webPropertyId string, profileId string, profile *Profile) *ManagementProfilesPatchCall { + c := &ManagementProfilesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.profile = profile + return c +} + +func (c *ManagementProfilesPatchCall) Do() (*Profile, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Profile) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing view (profile). This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "analytics.management.profiles.patch", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to which the view (profile) belongs", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "ID of the view (profile) to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to which the view (profile) belongs", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}", + // "request": { + // "$ref": "Profile" + // }, + // "response": { + // "$ref": "Profile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.profiles.update": + +type ManagementProfilesUpdateCall struct { + s *Service + accountId string + webPropertyId string + profileId string + profile *Profile + opt_ map[string]interface{} +} + +// Update: Updates an existing view (profile). +func (r *ManagementProfilesService) Update(accountId string, webPropertyId string, profileId string, profile *Profile) *ManagementProfilesUpdateCall { + c := &ManagementProfilesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.profile = profile + return c +} + +func (c *ManagementProfilesUpdateCall) Do() (*Profile, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", url.QueryEscape(c.profileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Profile) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing view (profile).", + // "httpMethod": "PUT", + // "id": "analytics.management.profiles.update", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to which the view (profile) belongs", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "ID of the view (profile) to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to which the view (profile) belongs", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}", + // "request": { + // "$ref": "Profile" + // }, + // "response": { + // "$ref": "Profile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.segments.list": + +type ManagementSegmentsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Lists segments to which the user has access. +func (r *ManagementSegmentsService) List() *ManagementSegmentsListCall { + c := &ManagementSegmentsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of segments to include in this response. +func (c *ManagementSegmentsListCall) MaxResults(maxResults int64) *ManagementSegmentsListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first segment to retrieve. Use this parameter as a pagination +// mechanism along with the max-results parameter. +func (c *ManagementSegmentsListCall) StartIndex(startIndex int64) *ManagementSegmentsListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ManagementSegmentsListCall) Do() (*Segments, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/segments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Segments) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists segments to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.segments.list", + // "parameters": { + // "max-results": { + // "description": "The maximum number of segments to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "start-index": { + // "description": "An index of the first segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // } + // }, + // "path": "management/segments", + // "response": { + // "$ref": "Segments" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.uploads.deleteUploadData": + +type ManagementUploadsDeleteUploadDataCall struct { + s *Service + accountId string + webPropertyId string + customDataSourceId string + analyticsdataimportdeleteuploaddatarequest *AnalyticsDataimportDeleteUploadDataRequest + opt_ map[string]interface{} +} + +// DeleteUploadData: Delete data associated with a previous upload. +func (r *ManagementUploadsService) DeleteUploadData(accountId string, webPropertyId string, customDataSourceId string, analyticsdataimportdeleteuploaddatarequest *AnalyticsDataimportDeleteUploadDataRequest) *ManagementUploadsDeleteUploadDataCall { + c := &ManagementUploadsDeleteUploadDataCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.customDataSourceId = customDataSourceId + c.analyticsdataimportdeleteuploaddatarequest = analyticsdataimportdeleteuploaddatarequest + return c +} + +func (c *ManagementUploadsDeleteUploadDataCall) Do() error { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyticsdataimportdeleteuploaddatarequest) + if err != nil { + return err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customDataSourceId}", url.QueryEscape(c.customDataSourceId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete data associated with a previous upload.", + // "httpMethod": "POST", + // "id": "analytics.management.uploads.deleteUploadData", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "customDataSourceId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account Id for the uploads to be deleted.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "customDataSourceId": { + // "description": "Custom data source Id for the uploads to be deleted.", + // "location": "path", + // "pattern": ".{22}", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property Id for the uploads to be deleted.", + // "location": "path", + // "pattern": "UA-(\\d+)-(\\d+)", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData", + // "request": { + // "$ref": "AnalyticsDataimportDeleteUploadDataRequest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.uploads.get": + +type ManagementUploadsGetCall struct { + s *Service + accountId string + webPropertyId string + customDataSourceId string + uploadId string + opt_ map[string]interface{} +} + +// Get: List uploads to which the user has access. +func (r *ManagementUploadsService) Get(accountId string, webPropertyId string, customDataSourceId string, uploadId string) *ManagementUploadsGetCall { + c := &ManagementUploadsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.customDataSourceId = customDataSourceId + c.uploadId = uploadId + return c +} + +func (c *ManagementUploadsGetCall) Do() (*Upload, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customDataSourceId}", url.QueryEscape(c.customDataSourceId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{uploadId}", url.QueryEscape(c.uploadId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Upload) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List uploads to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.uploads.get", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "customDataSourceId", + // "uploadId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account Id for the upload to retrieve.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "customDataSourceId": { + // "description": "Custom data source Id for upload to retrieve.", + // "location": "path", + // "pattern": ".{22}", + // "required": true, + // "type": "string" + // }, + // "uploadId": { + // "description": "Upload Id to retrieve.", + // "location": "path", + // "pattern": ".{22}", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property Id for the upload to retrieve.", + // "location": "path", + // "pattern": "UA-(\\d+)-(\\d+)", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}", + // "response": { + // "$ref": "Upload" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.uploads.list": + +type ManagementUploadsListCall struct { + s *Service + accountId string + webPropertyId string + customDataSourceId string + opt_ map[string]interface{} +} + +// List: List uploads to which the user has access. +func (r *ManagementUploadsService) List(accountId string, webPropertyId string, customDataSourceId string) *ManagementUploadsListCall { + c := &ManagementUploadsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.customDataSourceId = customDataSourceId + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of uploads to include in this response. +func (c *ManagementUploadsListCall) MaxResults(maxResults int64) *ManagementUploadsListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": A 1-based index +// of the first upload to retrieve. Use this parameter as a pagination +// mechanism along with the max-results parameter. +func (c *ManagementUploadsListCall) StartIndex(startIndex int64) *ManagementUploadsListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ManagementUploadsListCall) Do() (*Uploads, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customDataSourceId}", url.QueryEscape(c.customDataSourceId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Uploads) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List uploads to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.uploads.list", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "customDataSourceId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account Id for the uploads to retrieve.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "customDataSourceId": { + // "description": "Custom data source Id for uploads to retrieve.", + // "location": "path", + // "pattern": ".{22}", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of uploads to include in this response.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "start-index": { + // "description": "A 1-based index of the first upload to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "webPropertyId": { + // "description": "Web property Id for the uploads to retrieve.", + // "location": "path", + // "pattern": "UA-(\\d+)-(\\d+)", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads", + // "response": { + // "$ref": "Uploads" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.uploads.uploadData": + +type ManagementUploadsUploadDataCall struct { + s *Service + accountId string + webPropertyId string + customDataSourceId string + opt_ map[string]interface{} + media_ io.Reader +} + +// UploadData: Upload data for a custom data source. +func (r *ManagementUploadsService) UploadData(accountId string, webPropertyId string, customDataSourceId string) *ManagementUploadsUploadDataCall { + c := &ManagementUploadsUploadDataCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.customDataSourceId = customDataSourceId + return c +} +func (c *ManagementUploadsUploadDataCall) Media(r io.Reader) *ManagementUploadsUploadDataCall { + c.media_ = r + return c +} + +func (c *ManagementUploadsUploadDataCall) Do() (*Upload, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{customDataSourceId}", url.QueryEscape(c.customDataSourceId), 1) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Upload) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Upload data for a custom data source.", + // "httpMethod": "POST", + // "id": "analytics.management.uploads.uploadData", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream" + // ], + // "maxSize": "1GB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads" + // } + // } + // }, + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "customDataSourceId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account Id associated with the upload.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "customDataSourceId": { + // "description": "Custom data source Id to which the data being uploaded belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property UA-string associated with the upload.", + // "location": "path", + // "pattern": "UA-\\d+-\\d+", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads", + // "response": { + // "$ref": "Upload" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "analytics.management.webproperties.get": + +type ManagementWebpropertiesGetCall struct { + s *Service + accountId string + webPropertyId string + opt_ map[string]interface{} +} + +// Get: Gets a web property to which the user has access. +func (r *ManagementWebpropertiesService) Get(accountId string, webPropertyId string) *ManagementWebpropertiesGetCall { + c := &ManagementWebpropertiesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + return c +} + +func (c *ManagementWebpropertiesGetCall) Do() (*Webproperty, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Webproperty) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a web property to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.webproperties.get", + // "parameterOrder": [ + // "accountId", + // "webPropertyId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to retrieve the web property for.", + // "location": "path", + // "pattern": "[0-9]+", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "ID to retrieve the web property for.", + // "location": "path", + // "pattern": "UA-[0-9]+-[0-9]+", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}", + // "response": { + // "$ref": "Webproperty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.webproperties.insert": + +type ManagementWebpropertiesInsertCall struct { + s *Service + accountId string + webproperty *Webproperty + opt_ map[string]interface{} +} + +// Insert: Create a new property if the account has fewer than 20 +// properties. Web properties are visible in the Google Analytics +// interface only if they have at least one profile. +func (r *ManagementWebpropertiesService) Insert(accountId string, webproperty *Webproperty) *ManagementWebpropertiesInsertCall { + c := &ManagementWebpropertiesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webproperty = webproperty + return c +} + +func (c *ManagementWebpropertiesInsertCall) Do() (*Webproperty, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.webproperty) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Webproperty) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a new property if the account has fewer than 20 properties. Web properties are visible in the Google Analytics interface only if they have at least one profile.", + // "httpMethod": "POST", + // "id": "analytics.management.webproperties.insert", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to create the web property for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties", + // "request": { + // "$ref": "Webproperty" + // }, + // "response": { + // "$ref": "Webproperty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.webproperties.list": + +type ManagementWebpropertiesListCall struct { + s *Service + accountId string + opt_ map[string]interface{} +} + +// List: Lists web properties to which the user has access. +func (r *ManagementWebpropertiesService) List(accountId string) *ManagementWebpropertiesListCall { + c := &ManagementWebpropertiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of web properties to include in this response. +func (c *ManagementWebpropertiesListCall) MaxResults(maxResults int64) *ManagementWebpropertiesListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first entity to retrieve. Use this parameter as a pagination +// mechanism along with the max-results parameter. +func (c *ManagementWebpropertiesListCall) StartIndex(startIndex int64) *ManagementWebpropertiesListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ManagementWebpropertiesListCall) Do() (*Webproperties, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Webproperties) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists web properties to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.webproperties.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "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.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of web properties to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "start-index": { + // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties", + // "response": { + // "$ref": "Webproperties" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.webproperties.patch": + +type ManagementWebpropertiesPatchCall struct { + s *Service + accountId string + webPropertyId string + webproperty *Webproperty + opt_ map[string]interface{} +} + +// Patch: Updates an existing web property. This method supports patch +// semantics. +func (r *ManagementWebpropertiesService) Patch(accountId string, webPropertyId string, webproperty *Webproperty) *ManagementWebpropertiesPatchCall { + c := &ManagementWebpropertiesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.webproperty = webproperty + return c +} + +func (c *ManagementWebpropertiesPatchCall) Do() (*Webproperty, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.webproperty) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Webproperty) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing web property. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "analytics.management.webproperties.patch", + // "parameterOrder": [ + // "accountId", + // "webPropertyId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to which the web property belongs", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}", + // "request": { + // "$ref": "Webproperty" + // }, + // "response": { + // "$ref": "Webproperty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.webproperties.update": + +type ManagementWebpropertiesUpdateCall struct { + s *Service + accountId string + webPropertyId string + webproperty *Webproperty + opt_ map[string]interface{} +} + +// Update: Updates an existing web property. +func (r *ManagementWebpropertiesService) Update(accountId string, webPropertyId string, webproperty *Webproperty) *ManagementWebpropertiesUpdateCall { + c := &ManagementWebpropertiesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.webproperty = webproperty + return c +} + +func (c *ManagementWebpropertiesUpdateCall) Do() (*Webproperty, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.webproperty) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Webproperty) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing web property.", + // "httpMethod": "PUT", + // "id": "analytics.management.webproperties.update", + // "parameterOrder": [ + // "accountId", + // "webPropertyId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to which the web property belongs", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}", + // "request": { + // "$ref": "Webproperty" + // }, + // "response": { + // "$ref": "Webproperty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.webpropertyUserLinks.delete": + +type ManagementWebpropertyUserLinksDeleteCall struct { + s *Service + accountId string + webPropertyId string + linkId string + opt_ map[string]interface{} +} + +// Delete: Removes a user from the given web property. +func (r *ManagementWebpropertyUserLinksService) Delete(accountId string, webPropertyId string, linkId string) *ManagementWebpropertyUserLinksDeleteCall { + c := &ManagementWebpropertyUserLinksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.linkId = linkId + return c +} + +func (c *ManagementWebpropertyUserLinksDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{linkId}", url.QueryEscape(c.linkId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Removes a user from the given web property.", + // "httpMethod": "DELETE", + // "id": "analytics.management.webpropertyUserLinks.delete", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "linkId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to delete the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "linkId": { + // "description": "Link ID to delete the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web Property ID to delete the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}", + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.manage.users" + // ] + // } + +} + +// method id "analytics.management.webpropertyUserLinks.insert": + +type ManagementWebpropertyUserLinksInsertCall struct { + s *Service + accountId string + webPropertyId string + entityuserlink *EntityUserLink + opt_ map[string]interface{} +} + +// Insert: Adds a new user to the given web property. +func (r *ManagementWebpropertyUserLinksService) Insert(accountId string, webPropertyId string, entityuserlink *EntityUserLink) *ManagementWebpropertyUserLinksInsertCall { + c := &ManagementWebpropertyUserLinksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.entityuserlink = entityuserlink + return c +} + +func (c *ManagementWebpropertyUserLinksInsertCall) Do() (*EntityUserLink, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(EntityUserLink) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a new user to the given web property.", + // "httpMethod": "POST", + // "id": "analytics.management.webpropertyUserLinks.insert", + // "parameterOrder": [ + // "accountId", + // "webPropertyId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to create the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web Property ID to create the user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks", + // "request": { + // "$ref": "EntityUserLink" + // }, + // "response": { + // "$ref": "EntityUserLink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.manage.users" + // ] + // } + +} + +// method id "analytics.management.webpropertyUserLinks.list": + +type ManagementWebpropertyUserLinksListCall struct { + s *Service + accountId string + webPropertyId string + opt_ map[string]interface{} +} + +// List: Lists webProperty-user links for a given web property. +func (r *ManagementWebpropertyUserLinksService) List(accountId string, webPropertyId string) *ManagementWebpropertyUserLinksListCall { + c := &ManagementWebpropertyUserLinksListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of webProperty-user Links to include in this response. +func (c *ManagementWebpropertyUserLinksListCall) MaxResults(maxResults int64) *ManagementWebpropertyUserLinksListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first webProperty-user link to retrieve. Use this parameter as a +// pagination mechanism along with the max-results parameter. +func (c *ManagementWebpropertyUserLinksListCall) StartIndex(startIndex int64) *ManagementWebpropertyUserLinksListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ManagementWebpropertyUserLinksListCall) Do() (*EntityUserLinks, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(EntityUserLinks) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists webProperty-user links for a given web property.", + // "httpMethod": "GET", + // "id": "analytics.management.webpropertyUserLinks.list", + // "parameterOrder": [ + // "accountId", + // "webPropertyId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID which the given web property belongs to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of webProperty-user Links to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "start-index": { + // "description": "An index of the first webProperty-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "webPropertyId": { + // "description": "Web Property ID for the webProperty-user links to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks", + // "response": { + // "$ref": "EntityUserLinks" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.manage.users" + // ] + // } + +} + +// method id "analytics.management.webpropertyUserLinks.update": + +type ManagementWebpropertyUserLinksUpdateCall struct { + s *Service + accountId string + webPropertyId string + linkId string + entityuserlink *EntityUserLink + opt_ map[string]interface{} +} + +// Update: Updates permissions for an existing user on the given web +// property. +func (r *ManagementWebpropertyUserLinksService) Update(accountId string, webPropertyId string, linkId string, entityuserlink *EntityUserLink) *ManagementWebpropertyUserLinksUpdateCall { + c := &ManagementWebpropertyUserLinksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.linkId = linkId + c.entityuserlink = entityuserlink + return c +} + +func (c *ManagementWebpropertyUserLinksUpdateCall) Do() (*EntityUserLink, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", url.QueryEscape(c.accountId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{webPropertyId}", url.QueryEscape(c.webPropertyId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{linkId}", url.QueryEscape(c.linkId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(EntityUserLink) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates permissions for an existing user on the given web property.", + // "httpMethod": "PUT", + // "id": "analytics.management.webpropertyUserLinks.update", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "linkId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to update the account-user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "linkId": { + // "description": "Link ID to update the account-user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to update the account-user link for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}", + // "request": { + // "$ref": "EntityUserLink" + // }, + // "response": { + // "$ref": "EntityUserLink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.manage.users" + // ] + // } + +} + +// method id "analytics.metadata.columns.list": + +type MetadataColumnsListCall struct { + s *Service + reportType string + opt_ map[string]interface{} +} + +// List: Lists all columns for a report type +func (r *MetadataColumnsService) List(reportType string) *MetadataColumnsListCall { + c := &MetadataColumnsListCall{s: r.s, opt_: make(map[string]interface{})} + c.reportType = reportType + return c +} + +func (c *MetadataColumnsListCall) Do() (*Columns, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/{reportType}/columns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{reportType}", url.QueryEscape(c.reportType), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Columns) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all columns for a report type", + // "httpMethod": "GET", + // "id": "analytics.metadata.columns.list", + // "parameterOrder": [ + // "reportType" + // ], + // "parameters": { + // "reportType": { + // "description": "Report type. Allowed Values: 'ga'. Where 'ga' corresponds to the Core Reporting API", + // "location": "path", + // "pattern": "ga", + // "required": true, + // "type": "string" + // } + // }, + // "path": "metadata/{reportType}/columns", + // "response": { + // "$ref": "Columns" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/androidpublisher/v1.1/androidpublisher-api.json b/third_party/src/code.google.com/p/google-api-go-client/androidpublisher/v1.1/androidpublisher-api.json new file mode 100644 index 0000000000000..7884dace88803 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/androidpublisher/v1.1/androidpublisher-api.json @@ -0,0 +1,255 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/i7ndXglQkcB7KPR_-HCYBmUKBRE\"", + "discoveryVersion": "v1", + "id": "androidpublisher:v1.1", + "name": "androidpublisher", + "canonicalName": "Android Publisher", + "version": "v1.1", + "title": "Google Play Android Developer API", + "description": "Lets Android application developers access their Google Play accounts.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/android-16.png", + "x32": "http://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 Android Developer account" + } + } + } + }, + "schemas": { + "InappPurchase": { + "id": "InappPurchase", + "type": "object", + "description": "A Purchase resource indicates the status of a user's subscription 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 a 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 Purchase 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" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/androidpublisher/v1.1/androidpublisher-gen.go b/third_party/src/code.google.com/p/google-api-go-client/androidpublisher/v1.1/androidpublisher-gen.go new file mode 100644 index 0000000000000..e9740b165addb --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/androidpublisher/v1.1/androidpublisher-gen.go @@ -0,0 +1,374 @@ +// Package androidpublisher provides access to the Google Play Android Developer API. +// +// See https://developers.google.com/android-publisher +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/androidpublisher/v1.1" +// ... +// androidpublisherService, err := androidpublisher.New(oauthHttpClient) +package androidpublisher + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +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 Android 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 + + Inapppurchases *InapppurchasesService + + Purchases *PurchasesService +} + +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 +} + +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 a 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"` +} + +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"` +} + +// method id "androidpublisher.inapppurchases.get": + +type InapppurchasesGetCall struct { + s *Service + packageName string + productId string + token string + opt_ map[string]interface{} +} + +// 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 +} + +func (c *InapppurchasesGetCall) Do() (*InappPurchase, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inapp/{productId}/purchases/{token}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{packageName}", url.QueryEscape(c.packageName), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{productId}", url.QueryEscape(c.productId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{token}", url.QueryEscape(c.token), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InappPurchase) + 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{} +} + +// 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 +} + +func (c *PurchasesCancelCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{packageName}", url.QueryEscape(c.packageName), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{subscriptionId}", url.QueryEscape(c.subscriptionId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{token}", url.QueryEscape(c.token), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} +} + +// 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 +} + +func (c *PurchasesGetCall) Do() (*SubscriptionPurchase, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/subscriptions/{subscriptionId}/purchases/{token}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{packageName}", url.QueryEscape(c.packageName), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{subscriptionId}", url.QueryEscape(c.subscriptionId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{token}", url.QueryEscape(c.token), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SubscriptionPurchase) + 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" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/androidpublisher/v1/androidpublisher-api.json b/third_party/src/code.google.com/p/google-api-go-client/androidpublisher/v1/androidpublisher-api.json new file mode 100644 index 0000000000000..9bbc5077b9157 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/androidpublisher/v1/androidpublisher-api.json @@ -0,0 +1,183 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/7feCcsSBHiSVKUXs7gmA_Rg25gw\"", + "discoveryVersion": "v1", + "id": "androidpublisher:v1", + "name": "androidpublisher", + "canonicalName": "Android Publisher", + "version": "v1", + "title": "Google Play Android Developer API", + "description": "Lets Android application developers access their Google Play accounts.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/android-16.png", + "x32": "http://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 Android Developer account" + } + } + } + }, + "schemas": { + "SubscriptionPurchase": { + "id": "SubscriptionPurchase", + "type": "object", + "description": "A Purchase 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" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/androidpublisher/v1/androidpublisher-gen.go b/third_party/src/code.google.com/p/google-api-go-client/androidpublisher/v1/androidpublisher-gen.go new file mode 100644 index 0000000000000..3d412c6f89bf1 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/androidpublisher/v1/androidpublisher-gen.go @@ -0,0 +1,252 @@ +// Package androidpublisher provides access to the Google Play Android Developer API. +// +// See https://developers.google.com/android-publisher +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/androidpublisher/v1" +// ... +// androidpublisherService, err := androidpublisher.New(oauthHttpClient) +package androidpublisher + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +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 Android 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 + + Purchases *PurchasesService +} + +func NewPurchasesService(s *Service) *PurchasesService { + rs := &PurchasesService{s: s} + return rs +} + +type PurchasesService struct { + s *Service +} + +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"` +} + +// method id "androidpublisher.purchases.cancel": + +type PurchasesCancelCall struct { + s *Service + packageName string + subscriptionId string + token string + opt_ map[string]interface{} +} + +// 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 +} + +func (c *PurchasesCancelCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{packageName}", url.QueryEscape(c.packageName), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{subscriptionId}", url.QueryEscape(c.subscriptionId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{token}", url.QueryEscape(c.token), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} +} + +// 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 +} + +func (c *PurchasesGetCall) Do() (*SubscriptionPurchase, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/subscriptions/{subscriptionId}/purchases/{token}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{packageName}", url.QueryEscape(c.packageName), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{subscriptionId}", url.QueryEscape(c.subscriptionId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{token}", url.QueryEscape(c.token), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SubscriptionPurchase) + 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" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/appstate/v1/appstate-api.json b/third_party/src/code.google.com/p/google-api-go-client/appstate/v1/appstate-api.json new file mode 100644 index 0000000000000..378887c87f1b6 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/appstate/v1/appstate-api.json @@ -0,0 +1,306 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"5M1WkxnZyJhziV-cW1kdtwscs8E/EnSZa1SHLGZEekBcq4ZvbeJLWQE\"", + "discoveryVersion": "v1", + "id": "appstate:v1", + "name": "appstate", + "canonicalName": "App State", + "version": "v1", + "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" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/appstate/v1/appstate-gen.go b/third_party/src/code.google.com/p/google-api-go-client/appstate/v1/appstate-gen.go new file mode 100644 index 0000000000000..af4494b37bb51 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/appstate/v1/appstate-gen.go @@ -0,0 +1,507 @@ +// Package appstate provides access to the Google App State API. +// +// See https://developers.google.com/games/services/web/api/states +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/appstate/v1" +// ... +// appstateService, err := appstate.New(oauthHttpClient) +package appstate + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +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 + + States *StatesService +} + +func NewStatesService(s *Service) *StatesService { + rs := &StatesService{s: s} + return rs +} + +type StatesService struct { + s *Service +} + +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"` +} + +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"` +} + +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"` +} + +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"` +} + +// method id "appstate.states.clear": + +type StatesClearCall struct { + s *Service + stateKey int64 + opt_ map[string]interface{} +} + +// 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 +} + +func (c *StatesClearCall) Do() (*WriteResult, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["currentDataVersion"]; ok { + params.Set("currentDataVersion", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "states/{stateKey}/clear") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{stateKey}", strconv.FormatInt(c.stateKey, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(WriteResult) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Clears (sets to empty) the data for the passed key if and only if the passed version matches the currently stored version. This method results in a conflict error on version mismatch.", + // "httpMethod": "POST", + // "id": "appstate.states.clear", + // "parameterOrder": [ + // "stateKey" + // ], + // "parameters": { + // "currentDataVersion": { + // "description": "The version of the data to be cleared. Version strings are returned by the server.", + // "location": "query", + // "type": "string" + // }, + // "stateKey": { + // "description": "The key for the data to be retrieved.", + // "format": "int32", + // "location": "path", + // "maximum": "3", + // "minimum": "0", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "states/{stateKey}/clear", + // "response": { + // "$ref": "WriteResult" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/appstate" + // ] + // } + +} + +// method id "appstate.states.delete": + +type StatesDeleteCall struct { + s *Service + stateKey int64 + opt_ map[string]interface{} +} + +// 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 +} + +func (c *StatesDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "states/{stateKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{stateKey}", strconv.FormatInt(c.stateKey, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return 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{} +} + +// 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 +} + +func (c *StatesGetCall) Do() (*GetResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "states/{stateKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{stateKey}", strconv.FormatInt(c.stateKey, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(GetResponse) + 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{} +} + +// 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 +} + +func (c *StatesListCall) Do() (*ListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeData"]; ok { + params.Set("includeData", 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", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ListResponse) + 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{} +} + +// 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 +} + +func (c *StatesUpdateCall) Do() (*WriteResult, 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", "json") + if v, ok := c.opt_["currentStateVersion"]; ok { + params.Set("currentStateVersion", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "states/{stateKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{stateKey}", strconv.FormatInt(c.stateKey, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(WriteResult) + 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" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/audit/v1/audit-api.json b/third_party/src/code.google.com/p/google-api-go-client/audit/v1/audit-api.json new file mode 100644 index 0000000000000..fe976a0cfe65f --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/audit/v1/audit-api.json @@ -0,0 +1,287 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/FnodQzLqRh_xHIkICK4PBBoHaLA\"", + "discoveryVersion": "v1", + "id": "audit:v1", + "name": "audit", + "version": "v1", + "title": "Enterprise Audit API", + "description": "Lets you access user activities in your enterprise made through various 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://developers.google.com/google-apps/admin-audit/get_started", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/apps/reporting/audit/v1/", + "basePath": "/apps/reporting/audit/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "apps/reporting/audit/v1/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "atom", + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/atom+xml", + "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" + } + }, + "schemas": { + "Activities": { + "id": "Activities", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "Each record in read response.", + "items": { + "$ref": "Activity" + } + }, + "kind": { + "type": "string", + "description": "Kind of list response this is.", + "default": "audit#activities" + }, + "next": { + "type": "string", + "description": "Next page URL." + } + } + }, + "Activity": { + "id": "Activity", + "type": "object", + "properties": { + "actor": { + "type": "object", + "description": "User doing the action.", + "properties": { + "applicationId": { + "type": "string", + "description": "ID of application which interacted on behalf of the user.", + "format": "int64" + }, + "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." + } + } + }, + "events": { + "type": "array", + "description": "Activity events.", + "items": { + "type": "object", + "properties": { + "eventType": { + "type": "string", + "description": "Type of event." + }, + "name": { + "type": "string", + "description": "Name of event." + }, + "parameters": { + "type": "array", + "description": "Event parameters.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the parameter." + }, + "value": { + "type": "string", + "description": "Value of the parameter." + } + } + } + } + } + } + }, + "id": { + "type": "object", + "description": "Unique identifier for each activity record.", + "properties": { + "applicationId": { + "type": "string", + "description": "Application ID of the source application.", + "format": "int64" + }, + "customerId": { + "type": "string", + "description": "Obfuscated customer ID of the source customer." + }, + "time": { + "type": "string", + "description": "Time of occurrence of the activity.", + "format": "date-time" + }, + "uniqQualifier": { + "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": "audit#activity" + }, + "ownerDomain": { + "type": "string", + "description": "Domain of source customer." + } + } + } + }, + "resources": { + "activities": { + "methods": { + "list": { + "id": "audit.activities.list", + "path": "{customerId}/{applicationId}", + "httpMethod": "GET", + "description": "Retrieves a list of activities for a specific customer and application.", + "parameters": { + "actorApplicationId": { + "type": "string", + "description": "Application ID of the application which interacted on behalf of the user while performing the event.", + "format": "int64", + "location": "query" + }, + "actorEmail": { + "type": "string", + "description": "Email address of the user who performed the action.", + "location": "query" + }, + "actorIpAddress": { + "type": "string", + "description": "IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses.", + "location": "query" + }, + "applicationId": { + "type": "string", + "description": "Application ID of the application on which the event was performed.", + "required": true, + "format": "int64", + "location": "path" + }, + "caller": { + "type": "string", + "description": "Type of the caller.", + "enum": [ + "application_owner", + "customer" + ], + "enumDescriptions": [ + "Caller is an application owner.", + "Caller is a customer." + ], + "location": "query" + }, + "continuationToken": { + "type": "string", + "description": "Next page URL.", + "location": "query" + }, + "customerId": { + "type": "string", + "description": "Represents the customer who is the owner of target object on which action was performed.", + "required": true, + "pattern": "C.+", + "location": "path" + }, + "endTime": { + "type": "string", + "description": "Return events which occured at or before this time.", + "location": "query" + }, + "eventName": { + "type": "string", + "description": "Name of the event being queried.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Number of activity records to be shown in each page.", + "format": "int32", + "minimum": "1", + "maximum": "1000", + "location": "query" + }, + "startTime": { + "type": "string", + "description": "Return events which occured at or after this time.", + "location": "query" + } + }, + "parameterOrder": [ + "customerId", + "applicationId" + ], + "response": { + "$ref": "Activities" + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/audit/v1/audit-gen.go b/third_party/src/code.google.com/p/google-api-go-client/audit/v1/audit-gen.go new file mode 100644 index 0000000000000..f6dd55e24f993 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/audit/v1/audit-gen.go @@ -0,0 +1,367 @@ +// Package audit provides access to the Enterprise Audit API. +// +// See https://developers.google.com/google-apps/admin-audit/get_started +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/audit/v1" +// ... +// auditService, err := audit.New(oauthHttpClient) +package audit + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "audit:v1" +const apiName = "audit" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/apps/reporting/audit/v1/" + +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 + + Activities *ActivitiesService +} + +func NewActivitiesService(s *Service) *ActivitiesService { + rs := &ActivitiesService{s: s} + return rs +} + +type ActivitiesService struct { + s *Service +} + +type Activities struct { + // Items: Each record in read response. + Items []*Activity `json:"items,omitempty"` + + // Kind: Kind of list response this is. + Kind string `json:"kind,omitempty"` + + // Next: Next page URL. + Next string `json:"next,omitempty"` +} + +type Activity struct { + // Actor: User doing the action. + Actor *ActivityActor `json:"actor,omitempty"` + + // Events: Activity events. + Events []*ActivityEvents `json:"events,omitempty"` + + // Id: Unique identifier for each activity record. + Id *ActivityId `json:"id,omitempty"` + + // IpAddress: IP Address of the user doing the action. + IpAddress string `json:"ipAddress,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // OwnerDomain: Domain of source customer. + OwnerDomain string `json:"ownerDomain,omitempty"` +} + +type ActivityActor struct { + // ApplicationId: ID of application which interacted on behalf of the + // user. + ApplicationId int64 `json:"applicationId,omitempty,string"` + + // CallerType: User or OAuth 2LO request. + CallerType string `json:"callerType,omitempty"` + + // Email: Email address of the user. + Email string `json:"email,omitempty"` + + // Key: For OAuth 2LO API requests, consumer_key of the requestor. + Key string `json:"key,omitempty"` +} + +type ActivityEvents struct { + // EventType: Type of event. + EventType string `json:"eventType,omitempty"` + + // Name: Name of event. + Name string `json:"name,omitempty"` + + // Parameters: Event parameters. + Parameters []*ActivityEventsParameters `json:"parameters,omitempty"` +} + +type ActivityEventsParameters struct { + // Name: Name of the parameter. + Name string `json:"name,omitempty"` + + // Value: Value of the parameter. + Value string `json:"value,omitempty"` +} + +type ActivityId struct { + // ApplicationId: Application ID of the source application. + ApplicationId int64 `json:"applicationId,omitempty,string"` + + // CustomerId: Obfuscated customer ID of the source customer. + CustomerId string `json:"customerId,omitempty"` + + // Time: Time of occurrence of the activity. + Time string `json:"time,omitempty"` + + // UniqQualifier: Unique qualifier if multiple events have the same + // time. + UniqQualifier int64 `json:"uniqQualifier,omitempty,string"` +} + +// method id "audit.activities.list": + +type ActivitiesListCall struct { + s *Service + customerId string + applicationId int64 + opt_ map[string]interface{} +} + +// List: Retrieves a list of activities for a specific customer and +// application. +func (r *ActivitiesService) List(customerId string, applicationId int64) *ActivitiesListCall { + c := &ActivitiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.applicationId = applicationId + return c +} + +// ActorApplicationId sets the optional parameter "actorApplicationId": +// Application ID of the application which interacted on behalf of the +// user while performing the event. +func (c *ActivitiesListCall) ActorApplicationId(actorApplicationId int64) *ActivitiesListCall { + c.opt_["actorApplicationId"] = actorApplicationId + return c +} + +// ActorEmail sets the optional parameter "actorEmail": Email address of +// the user who performed the action. +func (c *ActivitiesListCall) ActorEmail(actorEmail string) *ActivitiesListCall { + c.opt_["actorEmail"] = actorEmail + return c +} + +// ActorIpAddress sets the optional parameter "actorIpAddress": IP +// Address of host where the event was performed. Supports both IPv4 and +// IPv6 addresses. +func (c *ActivitiesListCall) ActorIpAddress(actorIpAddress string) *ActivitiesListCall { + c.opt_["actorIpAddress"] = actorIpAddress + return c +} + +// Caller sets the optional parameter "caller": Type of the caller. +func (c *ActivitiesListCall) Caller(caller string) *ActivitiesListCall { + c.opt_["caller"] = caller + return c +} + +// ContinuationToken sets the optional parameter "continuationToken": +// Next page URL. +func (c *ActivitiesListCall) ContinuationToken(continuationToken string) *ActivitiesListCall { + c.opt_["continuationToken"] = continuationToken + return c +} + +// EndTime sets the optional parameter "endTime": Return events which +// occured at or before this time. +func (c *ActivitiesListCall) EndTime(endTime string) *ActivitiesListCall { + c.opt_["endTime"] = endTime + return c +} + +// EventName sets the optional parameter "eventName": Name of the event +// being queried. +func (c *ActivitiesListCall) EventName(eventName string) *ActivitiesListCall { + c.opt_["eventName"] = eventName + return c +} + +// MaxResults sets the optional parameter "maxResults": Number of +// activity records to be shown in each page. +func (c *ActivitiesListCall) MaxResults(maxResults int64) *ActivitiesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// StartTime sets the optional parameter "startTime": Return events +// which occured at or after this time. +func (c *ActivitiesListCall) StartTime(startTime string) *ActivitiesListCall { + c.opt_["startTime"] = startTime + return c +} + +func (c *ActivitiesListCall) Do() (*Activities, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["actorApplicationId"]; ok { + params.Set("actorApplicationId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["actorEmail"]; ok { + params.Set("actorEmail", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["actorIpAddress"]; ok { + params.Set("actorIpAddress", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["caller"]; ok { + params.Set("caller", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["continuationToken"]; ok { + params.Set("continuationToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["endTime"]; ok { + params.Set("endTime", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["eventName"]; ok { + params.Set("eventName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startTime"]; ok { + params.Set("startTime", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{customerId}/{applicationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{applicationId}", strconv.FormatInt(c.applicationId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Activities) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of activities for a specific customer and application.", + // "httpMethod": "GET", + // "id": "audit.activities.list", + // "parameterOrder": [ + // "customerId", + // "applicationId" + // ], + // "parameters": { + // "actorApplicationId": { + // "description": "Application ID of the application which interacted on behalf of the user while performing the event.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "actorEmail": { + // "description": "Email address of the user who performed the action.", + // "location": "query", + // "type": "string" + // }, + // "actorIpAddress": { + // "description": "IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses.", + // "location": "query", + // "type": "string" + // }, + // "applicationId": { + // "description": "Application ID of the application on which the event was performed.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "caller": { + // "description": "Type of the caller.", + // "enum": [ + // "application_owner", + // "customer" + // ], + // "enumDescriptions": [ + // "Caller is an application owner.", + // "Caller is a customer." + // ], + // "location": "query", + // "type": "string" + // }, + // "continuationToken": { + // "description": "Next page URL.", + // "location": "query", + // "type": "string" + // }, + // "customerId": { + // "description": "Represents the customer who is the owner of target object on which action was performed.", + // "location": "path", + // "pattern": "C.+", + // "required": true, + // "type": "string" + // }, + // "endTime": { + // "description": "Return events which occured at or before this time.", + // "location": "query", + // "type": "string" + // }, + // "eventName": { + // "description": "Name of the event being queried.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Number of activity records to be shown in each page.", + // "format": "int32", + // "location": "query", + // "maximum": "1000", + // "minimum": "1", + // "type": "integer" + // }, + // "startTime": { + // "description": "Return events which occured at or after this time.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{customerId}/{applicationId}", + // "response": { + // "$ref": "Activities" + // } + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/bigquery/v2/bigquery-api.json b/third_party/src/code.google.com/p/google-api-go-client/bigquery/v2/bigquery-api.json new file mode 100644 index 0000000000000..9ca2658c1d24d --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/bigquery/v2/bigquery-api.json @@ -0,0 +1,2058 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/Q_buGY2JsMDrpm6SMTOf_s_Obbo\"", + "discoveryVersion": "v1", + "id": "bigquery:v2", + "name": "bigquery", + "version": "v2", + "title": "BigQuery API", + "description": "A data platform for customers to create, manage, share and query 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://developers.google.com/bigquery/docs/overview", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/bigquery/v2/", + "basePath": "/bigquery/v2/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "bigquery/v2/", + "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/bigquery": { + "description": "View and manage your data in Google BigQuery" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/devstorage.full_control": { + "description": "Manage your data and permissions in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" + } + } + } + }, + "schemas": { + "Dataset": { + "id": "Dataset", + "type": "object", + "properties": { + "access": { + "type": "array", + "description": "[Optional] An array of objects that define dataset access for one or more entities. You can set this property when inserting or updating a dataset in order to control who is allowed to access the data. If unspecified at dataset creation time, BigQuery adds default dataset access for the following entities: access.specialGroup: projectReaders; access.role: READER; access.specialGroup: projectWriters; access.role: WRITER; access.specialGroup: projectOwners; access.role: OWNER; access.userByEmail: [dataset creator email]; access.role: OWNER;", + "items": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "[Pick one] A domain to grant access to. Any users signed in with the domain specified will be granted the specified access. Example: \"example.com\"." + }, + "groupByEmail": { + "type": "string", + "description": "[Pick one] An email address of a Google Group to grant access to." + }, + "role": { + "type": "string", + "description": "[Required] Describes the rights granted to the user specified by the other member of the access object. The following string values are supported: READER, WRITER, OWNER." + }, + "specialGroup": { + "type": "string", + "description": "[Pick one] A special group to grant access to. Possible values include: projectOwners: Owners of the enclosing project. projectReaders: Readers of the enclosing project. projectWriters: Writers of the enclosing project. allAuthenticatedUsers: All authenticated BigQuery users." + }, + "userByEmail": { + "type": "string", + "description": "[Pick one] An email address of a user to grant access to. For example: fred@example.com." + } + } + } + }, + "creationTime": { + "type": "string", + "description": "[Output-only] The time when this dataset was created, in milliseconds since the epoch.", + "format": "int64" + }, + "datasetReference": { + "$ref": "DatasetReference", + "description": "[Required] A reference that identifies the dataset." + }, + "description": { + "type": "string", + "description": "[Optional] A user-friendly description of the dataset." + }, + "etag": { + "type": "string", + "description": "[Output-only] A hash of the resource." + }, + "friendlyName": { + "type": "string", + "description": "[Optional] A descriptive name for the dataset." + }, + "id": { + "type": "string", + "description": "[Output-only] The fully-qualified unique name of the dataset in the format projectId:datasetId. The dataset name without the project name is given in the datasetId field. When creating a new dataset, leave this field blank, and instead specify the datasetId field." + }, + "kind": { + "type": "string", + "description": "[Output-only] The resource type.", + "default": "bigquery#dataset" + }, + "lastModifiedTime": { + "type": "string", + "description": "[Output-only] The date when this dataset or any of its tables was last modified, in milliseconds since the epoch.", + "format": "int64" + }, + "selfLink": { + "type": "string", + "description": "[Output-only] A URL that can be used to access the resource again. You can use this URL in Get or Update requests to the resource." + } + } + }, + "DatasetList": { + "id": "DatasetList", + "type": "object", + "properties": { + "datasets": { + "type": "array", + "description": "An array of the dataset resources in the project. Each resource contains basic information. For full information about a particular dataset resource, use the Datasets: get method. This property is omitted when there are no datasets in the project.", + "items": { + "type": "object", + "properties": { + "datasetReference": { + "$ref": "DatasetReference", + "description": "The dataset reference. Use this property to access specific parts of the dataset's ID, such as project ID or dataset ID." + }, + "friendlyName": { + "type": "string", + "description": "A descriptive name for the dataset, if one exists." + }, + "id": { + "type": "string", + "description": "The fully-qualified, unique, opaque ID of the dataset." + }, + "kind": { + "type": "string", + "description": "The resource type. This property always returns the value \"bigquery#dataset\".", + "default": "bigquery#dataset" + } + } + } + }, + "etag": { + "type": "string", + "description": "A hash value of the results page. You can use this property to determine if the page has changed since the last request." + }, + "kind": { + "type": "string", + "description": "The list type. This property always returns the value \"bigquery#datasetList\".", + "default": "bigquery#datasetList" + }, + "nextPageToken": { + "type": "string", + "description": "A token that can be used to request the next results page. This property is omitted on the final results page." + } + } + }, + "DatasetReference": { + "id": "DatasetReference", + "type": "object", + "properties": { + "datasetId": { + "type": "string", + "description": "[Required] A unique ID for this dataset, without the project name.", + "annotations": { + "required": [ + "bigquery.datasets.update" + ] + } + }, + "projectId": { + "type": "string", + "description": "[Optional] The ID of the container project.", + "annotations": { + "required": [ + "bigquery.datasets.update" + ] + } + } + } + }, + "ErrorProto": { + "id": "ErrorProto", + "type": "object", + "properties": { + "debugInfo": { + "type": "string", + "description": "Debugging information. This property is internal to Google and should not be used." + }, + "location": { + "type": "string", + "description": "Specifies where the error occurred, if present." + }, + "message": { + "type": "string", + "description": "A human-readable description of the error." + }, + "reason": { + "type": "string", + "description": "A short error code that summarizes the error." + } + } + }, + "GetQueryResultsResponse": { + "id": "GetQueryResultsResponse", + "type": "object", + "properties": { + "cacheHit": { + "type": "boolean", + "description": "Whether the query result was fetched from the query cache." + }, + "etag": { + "type": "string", + "description": "A hash of this response." + }, + "jobComplete": { + "type": "boolean", + "description": "Whether the query has completed or not. If rows or totalRows are present, this will always be true. If this is false, totalRows will not be available." + }, + "jobReference": { + "$ref": "JobReference", + "description": "Reference to the BigQuery Job that was created to run the query. This field will be present even if the original request timed out, in which case GetQueryResults can be used to read the results once the query has completed. Since this API only returns the first page of results, subsequent pages can be fetched via the same mechanism (GetQueryResults)." + }, + "kind": { + "type": "string", + "description": "The resource type of the response.", + "default": "bigquery#getQueryResultsResponse" + }, + "pageToken": { + "type": "string", + "description": "A token used for paging results." + }, + "rows": { + "type": "array", + "description": "An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults and specify the jobReference returned above. Present only when the query completes successfully.", + "items": { + "$ref": "TableRow" + } + }, + "schema": { + "$ref": "TableSchema", + "description": "The schema of the results. Present only when the query completes successfully." + }, + "totalRows": { + "type": "string", + "description": "The total number of rows in the complete query result set, which can be more than the number of rows in this single page of results. Present only when the query completes successfully.", + "format": "uint64" + } + } + }, + "Job": { + "id": "Job", + "type": "object", + "properties": { + "configuration": { + "$ref": "JobConfiguration", + "description": "[Required] Describes the job configuration." + }, + "etag": { + "type": "string", + "description": "[Output-only] A hash of this resource." + }, + "id": { + "type": "string", + "description": "[Output-only] Opaque ID field of the job" + }, + "jobReference": { + "$ref": "JobReference", + "description": "[Optional] Reference describing the unique-per-user name of the job." + }, + "kind": { + "type": "string", + "description": "[Output-only] The type of the resource.", + "default": "bigquery#job" + }, + "selfLink": { + "type": "string", + "description": "[Output-only] A URL that can be used to access this resource again." + }, + "statistics": { + "$ref": "JobStatistics", + "description": "[Output-only] Information about the job, including starting time and ending time of the job." + }, + "status": { + "$ref": "JobStatus", + "description": "[Output-only] The status of this job. Examine this value when polling an asynchronous job to see if the job is complete." + } + } + }, + "JobConfiguration": { + "id": "JobConfiguration", + "type": "object", + "properties": { + "copy": { + "$ref": "JobConfigurationTableCopy", + "description": "[Pick one] Copies a table." + }, + "dryRun": { + "type": "boolean", + "description": "[Optional] If set, don't actually run this job. A valid query will return a mostly empty response with some processing statistics, while an invalid query will return the same error it would if it wasn't a dry run. Behavior of non-query jobs is undefined." + }, + "extract": { + "$ref": "JobConfigurationExtract", + "description": "[Pick one] Configures an extract job." + }, + "link": { + "$ref": "JobConfigurationLink", + "description": "[Pick one] Configures a link job." + }, + "load": { + "$ref": "JobConfigurationLoad", + "description": "[Pick one] Configures a load job." + }, + "query": { + "$ref": "JobConfigurationQuery", + "description": "[Pick one] Configures a query job." + } + } + }, + "JobConfigurationExtract": { + "id": "JobConfigurationExtract", + "type": "object", + "properties": { + "destinationFormat": { + "type": "string", + "description": "[Experimental] Optional and defaults to CSV. Format with which files should be exported. To export to CSV, specify \"CSV\". Tables with nested or repeated fields cannot be exported as CSV. To export to newline-delimited JSON, specify \"NEWLINE_DELIMITED_JSON\"." + }, + "destinationUri": { + "type": "string", + "description": "[Pick one] DEPRECATED: Use destinationUris instead, passing only one URI as necessary. The fully-qualified Google Cloud Storage URI where the extracted table should be written." + }, + "destinationUris": { + "type": "array", + "description": "[Pick one] A list of fully-qualified Google Cloud Storage URIs where the extracted table should be written.", + "items": { + "type": "string" + } + }, + "fieldDelimiter": { + "type": "string", + "description": "[Optional] Delimiter to use between fields in the exported data. Default is ','" + }, + "printHeader": { + "type": "boolean", + "description": "[Optional] Whether to print out a header row in the results. Default is true." + }, + "sourceTable": { + "$ref": "TableReference", + "description": "[Required] A reference to the table being exported." + } + } + }, + "JobConfigurationLink": { + "id": "JobConfigurationLink", + "type": "object", + "properties": { + "createDisposition": { + "type": "string", + "description": "[Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion." + }, + "destinationTable": { + "$ref": "TableReference", + "description": "[Required] The destination table of the link job." + }, + "sourceUri": { + "type": "array", + "description": "[Required] URI of source table to link.", + "items": { + "type": "string" + } + }, + "writeDisposition": { + "type": "string", + "description": "[Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion." + } + } + }, + "JobConfigurationLoad": { + "id": "JobConfigurationLoad", + "type": "object", + "properties": { + "allowJaggedRows": { + "type": "boolean", + "description": "[Optional] Accept rows that are missing trailing optional columns. The missing values are treated as nulls. Default is false which treats short rows as errors. Only applicable to CSV, ignored for other formats." + }, + "allowQuotedNewlines": { + "type": "boolean", + "description": "Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false." + }, + "createDisposition": { + "type": "string", + "description": "[Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion." + }, + "destinationTable": { + "$ref": "TableReference", + "description": "[Required] The destination table to load the data into." + }, + "encoding": { + "type": "string", + "description": "[Optional] The character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split using the values of the quote and fieldDelimiter properties." + }, + "fieldDelimiter": { + "type": "string", + "description": "[Optional] The separator for fields in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. BigQuery also supports the escape sequence \"\\t\" to specify a tab separator. The default value is a comma (',')." + }, + "ignoreUnknownValues": { + "type": "boolean", + "description": "[Optional] Accept rows that contain values that do not match the schema. The unknown values are ignored. Default is false which treats unknown values as errors. For CSV this ignores extra values at the end of a line. For JSON this ignores named values that do not match any column name." + }, + "maxBadRecords": { + "type": "integer", + "description": "[Optional] The maximum number of bad records that BigQuery can ignore when running the job. If the number of bad records exceeds this value, an 'invalid' error is returned in the job result and the job fails. The default value is 0, which requires that all records are valid.", + "format": "int32" + }, + "quote": { + "type": "string", + "description": "[Optional] The value that is used to quote data sections in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. The default value is a double-quote ('\"'). If your data does not contain quoted sections, set the property value to an empty string. If your data contains quoted newline characters, you must also set the allowQuotedNewlines property to true." + }, + "schema": { + "$ref": "TableSchema", + "description": "[Optional] The schema for the destination table. The schema can be omitted if the destination table already exists or if the schema can be inferred from the loaded data." + }, + "schemaInline": { + "type": "string", + "description": "[Deprecated] The inline schema. For CSV schemas, specify as \"Field1:Type1[,Field2:Type2]*\". For example, \"foo:STRING, bar:INTEGER, baz:FLOAT\"." + }, + "schemaInlineFormat": { + "type": "string", + "description": "[Deprecated] The format of the schemaInline property." + }, + "skipLeadingRows": { + "type": "integer", + "description": "[Optional] The number of rows at the top of a CSV file that BigQuery will skip when loading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped.", + "format": "int32" + }, + "sourceFormat": { + "type": "string", + "description": "[Optional] The format of the data files. For CSV files, specify \"CSV\". For datastore backups, specify \"DATASTORE_BACKUP\". For newline-delimited JSON, specify \"NEWLINE_DELIMITED_JSON\". The default value is CSV." + }, + "sourceUris": { + "type": "array", + "description": "[Required] The fully-qualified URIs that point to your data on Google Cloud Storage.", + "items": { + "type": "string" + } + }, + "writeDisposition": { + "type": "string", + "description": "[Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion." + } + } + }, + "JobConfigurationQuery": { + "id": "JobConfigurationQuery", + "type": "object", + "properties": { + "allowLargeResults": { + "type": "boolean", + "description": "If true, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destination_table to be set." + }, + "createDisposition": { + "type": "string", + "description": "[Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion." + }, + "defaultDataset": { + "$ref": "DatasetReference", + "description": "[Optional] Specifies the default dataset to use for unqualified table names in the query." + }, + "destinationTable": { + "$ref": "TableReference", + "description": "[Optional] Describes the table where the query results should be stored. If not present, a new table will be created to store the results." + }, + "preserveNulls": { + "type": "boolean", + "description": "[Deprecated] This property is deprecated." + }, + "priority": { + "type": "string", + "description": "[Optional] Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE." + }, + "query": { + "type": "string", + "description": "[Required] BigQuery SQL query to execute." + }, + "useQueryCache": { + "type": "boolean", + "description": "[Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. Moreover, the query cache is only available when a query does not have a destination table specified." + }, + "writeDisposition": { + "type": "string", + "description": "[Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion." + } + } + }, + "JobConfigurationTableCopy": { + "id": "JobConfigurationTableCopy", + "type": "object", + "properties": { + "createDisposition": { + "type": "string", + "description": "[Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion." + }, + "destinationTable": { + "$ref": "TableReference", + "description": "[Required] The destination table" + }, + "sourceTable": { + "$ref": "TableReference", + "description": "[Required] Source table to copy." + }, + "writeDisposition": { + "type": "string", + "description": "[Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion." + } + } + }, + "JobList": { + "id": "JobList", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "A hash of this page of results." + }, + "jobs": { + "type": "array", + "description": "List of jobs that were requested.", + "items": { + "type": "object", + "properties": { + "configuration": { + "$ref": "JobConfiguration", + "description": "[Full-projection-only] Specifies the job configuration." + }, + "errorResult": { + "$ref": "ErrorProto", + "description": "A result object that will be present only if the job has failed." + }, + "id": { + "type": "string", + "description": "Unique opaque ID of the job." + }, + "jobReference": { + "$ref": "JobReference", + "description": "Job reference uniquely identifying the job." + }, + "kind": { + "type": "string", + "description": "The resource type.", + "default": "bigquery#job" + }, + "state": { + "type": "string", + "description": "Running state of the job. When the state is DONE, errorResult can be checked to determine whether the job succeeded or failed." + }, + "statistics": { + "$ref": "JobStatistics", + "description": "[Output-only] Information about the job, including starting time and ending time of the job." + }, + "status": { + "$ref": "JobStatus", + "description": "[Full-projection-only] Describes the state of the job." + }, + "user_email": { + "type": "string", + "description": "[Full-projection-only] User who ran the job." + } + } + } + }, + "kind": { + "type": "string", + "description": "The resource type of the response.", + "default": "bigquery#jobList" + }, + "nextPageToken": { + "type": "string", + "description": "A token to request the next page of results." + }, + "totalItems": { + "type": "integer", + "description": "Total number of jobs in this collection.", + "format": "int32" + } + } + }, + "JobReference": { + "id": "JobReference", + "type": "object", + "properties": { + "jobId": { + "type": "string", + "description": "[Required] ID of the job.", + "annotations": { + "required": [ + "bigquery.jobs.getQueryResults" + ] + } + }, + "projectId": { + "type": "string", + "description": "[Required] Project ID being billed for the job.", + "annotations": { + "required": [ + "bigquery.jobs.getQueryResults" + ] + } + } + } + }, + "JobStatistics": { + "id": "JobStatistics", + "type": "object", + "properties": { + "creationTime": { + "type": "string", + "description": "[Output-only] Creation time of this job, in milliseconds since the epoch. This field will be present on all jobs.", + "format": "int64" + }, + "endTime": { + "type": "string", + "description": "[Output-only] End time of this job, in milliseconds since the epoch. This field will be present whenever a job is in the DONE state.", + "format": "int64" + }, + "load": { + "$ref": "JobStatistics3", + "description": "[Output-only] Statistics for a load job." + }, + "query": { + "$ref": "JobStatistics2", + "description": "[Output-only] Statistics for a query job." + }, + "startTime": { + "type": "string", + "description": "[Output-only] Start time of this job, in milliseconds since the epoch. This field will be present when the job transitions from the PENDING state to either RUNNING or DONE.", + "format": "int64" + }, + "totalBytesProcessed": { + "type": "string", + "description": "[Output-only] [Deprecated] Use the bytes processed in the query statistics instead.", + "format": "int64" + } + } + }, + "JobStatistics2": { + "id": "JobStatistics2", + "type": "object", + "properties": { + "cacheHit": { + "type": "boolean", + "description": "[Output-only] Whether the query result was fetched from the query cache." + }, + "totalBytesProcessed": { + "type": "string", + "description": "[Output-only] Total bytes processed for this job.", + "format": "int64" + } + } + }, + "JobStatistics3": { + "id": "JobStatistics3", + "type": "object", + "properties": { + "inputFileBytes": { + "type": "string", + "description": "[Output-only] Number of bytes of source data in a joad job.", + "format": "int64" + }, + "inputFiles": { + "type": "string", + "description": "[Output-only] Number of source files in a load job.", + "format": "int64" + }, + "outputBytes": { + "type": "string", + "description": "[Output-only] Size of the loaded data in bytes. Note that while an import job is in the running state, this value may change.", + "format": "int64" + }, + "outputRows": { + "type": "string", + "description": "[Output-only] Number of rows imported in a load job. Note that while an import job is in the running state, this value may change.", + "format": "int64" + } + } + }, + "JobStatus": { + "id": "JobStatus", + "type": "object", + "properties": { + "errorResult": { + "$ref": "ErrorProto", + "description": "[Output-only] Final error result of the job. If present, indicates that the job has completed and was unsuccessful." + }, + "errors": { + "type": "array", + "description": "[Output-only] All errors encountered during the running of the job. Errors here do not necessarily mean that the job has completed or was unsuccessful.", + "items": { + "$ref": "ErrorProto" + } + }, + "state": { + "type": "string", + "description": "[Output-only] Running state of the job." + } + } + }, + "JsonObject": { + "id": "JsonObject", + "type": "object", + "description": "Represents a single JSON object.", + "additionalProperties": { + "$ref": "JsonValue" + } + }, + "JsonValue": { + "id": "JsonValue", + "type": "any" + }, + "ProjectList": { + "id": "ProjectList", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "A hash of the page of results" + }, + "kind": { + "type": "string", + "description": "The type of list.", + "default": "bigquery#projectList" + }, + "nextPageToken": { + "type": "string", + "description": "A token to request the next page of results." + }, + "projects": { + "type": "array", + "description": "Projects to which you have at least READ access.", + "items": { + "type": "object", + "properties": { + "friendlyName": { + "type": "string", + "description": "A descriptive name for this project." + }, + "id": { + "type": "string", + "description": "An opaque ID of this project." + }, + "kind": { + "type": "string", + "description": "The resource type.", + "default": "bigquery#project" + }, + "numericId": { + "type": "string", + "description": "The numeric ID of this project.", + "format": "uint64" + }, + "projectReference": { + "$ref": "ProjectReference", + "description": "A unique reference to this project." + } + } + } + }, + "totalItems": { + "type": "integer", + "description": "The total number of projects in the list.", + "format": "int32" + } + } + }, + "ProjectReference": { + "id": "ProjectReference", + "type": "object", + "properties": { + "projectId": { + "type": "string", + "description": "[Required] ID of the project. Can be either the numeric ID or the assigned ID of the project." + } + } + }, + "QueryRequest": { + "id": "QueryRequest", + "type": "object", + "properties": { + "defaultDataset": { + "$ref": "DatasetReference", + "description": "[Optional] Specifies the default datasetId and projectId to assume for any unqualified table names in the query. If not set, all table names in the query string must be qualified in the format 'datasetId.tableId'." + }, + "dryRun": { + "type": "boolean", + "description": "[Optional] If set, don't actually run the query. A valid query will return an empty response, while an invalid query will return the same error it would if it wasn't a dry run. The default value is false." + }, + "kind": { + "type": "string", + "description": "The resource type of the request.", + "default": "bigquery#queryRequest" + }, + "maxResults": { + "type": "integer", + "description": "[Optional] The maximum number of rows of data to return per page of results. Setting this flag to a small value such as 1000 and then paging through results might improve reliability when the query result set is large. In addition to this limit, responses are also limited to 10 MB. By default, there is no maximum row count, and only the byte limit applies.", + "format": "uint32" + }, + "preserveNulls": { + "type": "boolean", + "description": "[Deprecated] If set to false, maps null values in the query response to the column's default value. Only specify if you have older code that can not handle null values in the query response. The default value is true. This flag is deprecated and will be ignored in a future version of BigQuery." + }, + "query": { + "type": "string", + "description": "[Required] A query string, following the BigQuery query syntax, of the query to execute. Example: \"SELECT count(f1) FROM [myProjectId:myDatasetId.myTableId]\".", + "annotations": { + "required": [ + "bigquery.jobs.query" + ] + } + }, + "timeoutMs": { + "type": "integer", + "description": "[Optional] How long to wait for the query to complete, in milliseconds, before the request times out and returns. Note that this is only a timeout for the request, not the query. If the query takes longer to run than the timeout value, the call returns without any results and with the 'jobComplete' flag set to false. You can call GetQueryResults() to wait for the query to complete and read the results. The default value is 10000 milliseconds (10 seconds).", + "format": "uint32" + }, + "useQueryCache": { + "type": "boolean", + "description": "[Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. The default value is true." + } + } + }, + "QueryResponse": { + "id": "QueryResponse", + "type": "object", + "properties": { + "cacheHit": { + "type": "boolean", + "description": "Whether the query result was fetched from the query cache." + }, + "jobComplete": { + "type": "boolean", + "description": "Whether the query has completed or not. If rows or totalRows are present, this will always be true. If this is false, totalRows will not be available." + }, + "jobReference": { + "$ref": "JobReference", + "description": "Reference to the Job that was created to run the query. This field will be present even if the original request timed out, in which case GetQueryResults can be used to read the results once the query has completed. Since this API only returns the first page of results, subsequent pages can be fetched via the same mechanism (GetQueryResults)." + }, + "kind": { + "type": "string", + "description": "The resource type.", + "default": "bigquery#queryResponse" + }, + "pageToken": { + "type": "string", + "description": "A token used for paging results." + }, + "rows": { + "type": "array", + "description": "An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults and specify the jobReference returned above.", + "items": { + "$ref": "TableRow" + } + }, + "schema": { + "$ref": "TableSchema", + "description": "The schema of the results. Present only when the query completes successfully." + }, + "totalBytesProcessed": { + "type": "string", + "description": "The total number of bytes processed for this query. If this query was a dry run, this is the number of bytes that would be processed if the query were run.", + "format": "int64" + }, + "totalRows": { + "type": "string", + "description": "The total number of rows in the complete query result set, which can be more than the number of rows in this single page of results.", + "format": "uint64" + } + } + }, + "Table": { + "id": "Table", + "type": "object", + "properties": { + "creationTime": { + "type": "string", + "description": "[Output-only] The time when this table was created, in milliseconds since the epoch.", + "format": "int64" + }, + "description": { + "type": "string", + "description": "[Optional] A user-friendly description of this table." + }, + "etag": { + "type": "string", + "description": "[Output-only] A hash of this resource." + }, + "expirationTime": { + "type": "string", + "description": "[Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.", + "format": "int64" + }, + "friendlyName": { + "type": "string", + "description": "[Optional] A descriptive name for this table." + }, + "id": { + "type": "string", + "description": "[Output-only] An opaque ID uniquely identifying the table." + }, + "kind": { + "type": "string", + "description": "[Output-only] The type of the resource.", + "default": "bigquery#table" + }, + "lastModifiedTime": { + "type": "string", + "description": "[Output-only] The time when this table was last modified, in milliseconds since the epoch.", + "format": "int64" + }, + "numBytes": { + "type": "string", + "description": "[Output-only] The size of the table in bytes.", + "format": "int64" + }, + "numRows": { + "type": "string", + "description": "[Output-only] The number of rows of data in this table.", + "format": "uint64" + }, + "schema": { + "$ref": "TableSchema", + "description": "[Optional] Describes the schema of this table." + }, + "selfLink": { + "type": "string", + "description": "[Output-only] A URL that can be used to access this resource again." + }, + "tableReference": { + "$ref": "TableReference", + "description": "[Required] Reference describing the ID of this table." + }, + "type": { + "type": "string", + "description": "[Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL query. The default value is TABLE." + }, + "view": { + "$ref": "ViewDefinition", + "description": "[Optional] The view definition." + } + } + }, + "TableCell": { + "id": "TableCell", + "type": "object", + "description": "Represents a single cell in the result set. Users of the java client can detect whether their value result is null by calling 'com.google.api.client.util.Data.isNull(cell.getV())'.", + "properties": { + "v": { + "type": "any" + } + } + }, + "TableDataInsertAllRequest": { + "id": "TableDataInsertAllRequest", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "The resource type of the response.", + "default": "bigquery#tableDataInsertAllRequest" + }, + "rows": { + "type": "array", + "description": "The rows to insert.", + "items": { + "type": "object", + "properties": { + "insertId": { + "type": "string", + "description": "[Optional] A unique ID for each row. BigQuery uses this property to detect duplicate insertion requests on a best-effort basis." + }, + "json": { + "$ref": "JsonObject", + "description": "[Required] A JSON object that contains a row of data. The object's properties and values must match the destination table's schema." + } + } + } + } + } + }, + "TableDataInsertAllResponse": { + "id": "TableDataInsertAllResponse", + "type": "object", + "properties": { + "insertErrors": { + "type": "array", + "description": "An array of errors for rows that were not inserted.", + "items": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "description": "Error information for the row indicated by the index property.", + "items": { + "$ref": "ErrorProto" + } + }, + "index": { + "type": "integer", + "description": "The index of the row that error applies to.", + "format": "uint32" + } + } + } + }, + "kind": { + "type": "string", + "description": "The resource type of the response.", + "default": "bigquery#tableDataInsertAllResponse" + } + } + }, + "TableDataList": { + "id": "TableDataList", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "A hash of this page of results." + }, + "kind": { + "type": "string", + "description": "The resource type of the response.", + "default": "bigquery#tableDataList" + }, + "pageToken": { + "type": "string", + "description": "A token used for paging results. Providing this token instead of the startIndex parameter can help you retrieve stable results when an underlying table is changing." + }, + "rows": { + "type": "array", + "description": "Rows of results.", + "items": { + "$ref": "TableRow" + } + }, + "totalRows": { + "type": "string", + "description": "The total number of rows in the complete table.", + "format": "int64" + } + } + }, + "TableFieldSchema": { + "id": "TableFieldSchema", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "[Optional] The field description." + }, + "fields": { + "type": "array", + "description": "[Optional] Describes the nested schema fields if the type property is set to RECORD.", + "items": { + "$ref": "TableFieldSchema" + } + }, + "mode": { + "type": "string", + "description": "[Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE." + }, + "name": { + "type": "string", + "description": "[Required] The field name." + }, + "type": { + "type": "string", + "description": "[Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema)." + } + } + }, + "TableList": { + "id": "TableList", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "A hash of this page of results." + }, + "kind": { + "type": "string", + "description": "The type of list.", + "default": "bigquery#tableList" + }, + "nextPageToken": { + "type": "string", + "description": "A token to request the next page of results." + }, + "tables": { + "type": "array", + "description": "Tables in the requested dataset.", + "items": { + "type": "object", + "properties": { + "friendlyName": { + "type": "string", + "description": "The user-friendly name for this table." + }, + "id": { + "type": "string", + "description": "An opaque ID of the table" + }, + "kind": { + "type": "string", + "description": "The resource type.", + "default": "bigquery#table" + }, + "tableReference": { + "$ref": "TableReference", + "description": "A reference uniquely identifying the table." + }, + "type": { + "type": "string", + "description": "The type of table. Possible values are: TABLE, VIEW." + } + } + } + }, + "totalItems": { + "type": "integer", + "description": "The total number of tables in the dataset.", + "format": "int32" + } + } + }, + "TableReference": { + "id": "TableReference", + "type": "object", + "properties": { + "datasetId": { + "type": "string", + "description": "[Required] ID of the dataset containing the table.", + "annotations": { + "required": [ + "bigquery.tables.update" + ] + } + }, + "projectId": { + "type": "string", + "description": "[Required] ID of the project billed for storage of the table.", + "annotations": { + "required": [ + "bigquery.tables.update" + ] + } + }, + "tableId": { + "type": "string", + "description": "[Required] ID of the table.", + "annotations": { + "required": [ + "bigquery.tables.update" + ] + } + } + } + }, + "TableRow": { + "id": "TableRow", + "type": "object", + "description": "Represents a single row in the result set, consisting of one or more fields.", + "properties": { + "f": { + "type": "array", + "items": { + "$ref": "TableCell" + } + } + } + }, + "TableSchema": { + "id": "TableSchema", + "type": "object", + "properties": { + "fields": { + "type": "array", + "description": "Describes the fields in a table.", + "items": { + "$ref": "TableFieldSchema" + } + } + } + }, + "ViewDefinition": { + "id": "ViewDefinition", + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "[Required] A query that BigQuery executes when the view is referenced." + } + } + } + }, + "resources": { + "datasets": { + "methods": { + "delete": { + "id": "bigquery.datasets.delete", + "path": "projects/{projectId}/datasets/{datasetId}", + "httpMethod": "DELETE", + "description": "Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Dataset ID of dataset being deleted", + "required": true, + "location": "path" + }, + "deleteContents": { + "type": "boolean", + "description": "If True, delete all the tables in the dataset. If False and the dataset contains tables, the request will fail. Default is False", + "location": "query" + }, + "projectId": { + "type": "string", + "description": "Project ID of the dataset being deleted", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId" + ], + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "id": "bigquery.datasets.get", + "path": "projects/{projectId}/datasets/{datasetId}", + "httpMethod": "GET", + "description": "Returns the dataset specified by datasetID.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Dataset ID of the requested dataset", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID of the requested dataset", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId" + ], + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "insert": { + "id": "bigquery.datasets.insert", + "path": "projects/{projectId}/datasets", + "httpMethod": "POST", + "description": "Creates a new empty dataset.", + "parameters": { + "projectId": { + "type": "string", + "description": "Project ID of the new dataset", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "request": { + "$ref": "Dataset" + }, + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "id": "bigquery.datasets.list", + "path": "projects/{projectId}/datasets", + "httpMethod": "GET", + "description": "Lists all the datasets in the specified project to which the caller has read access; however, a project owner can list (but not necessarily get) all datasets in his project.", + "parameters": { + "all": { + "type": "boolean", + "description": "Whether to list all datasets, including hidden ones", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results to return", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Page token, returned by a previous call, to request the next page of results", + "location": "query" + }, + "projectId": { + "type": "string", + "description": "Project ID of the datasets to be listed", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "DatasetList" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "id": "bigquery.datasets.patch", + "path": "projects/{projectId}/datasets/{datasetId}", + "httpMethod": "PATCH", + "description": "Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. This method supports patch semantics.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Dataset ID of the dataset being updated", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID of the dataset being updated", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId" + ], + "request": { + "$ref": "Dataset" + }, + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "update": { + "id": "bigquery.datasets.update", + "path": "projects/{projectId}/datasets/{datasetId}", + "httpMethod": "PUT", + "description": "Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Dataset ID of the dataset being updated", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID of the dataset being updated", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId" + ], + "request": { + "$ref": "Dataset" + }, + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "jobs": { + "methods": { + "get": { + "id": "bigquery.jobs.get", + "path": "projects/{projectId}/jobs/{jobId}", + "httpMethod": "GET", + "description": "Retrieves the specified job by ID.", + "parameters": { + "jobId": { + "type": "string", + "description": "Job ID of the requested job", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID of the requested job", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "response": { + "$ref": "Job" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "getQueryResults": { + "id": "bigquery.jobs.getQueryResults", + "path": "projects/{projectId}/queries/{jobId}", + "httpMethod": "GET", + "description": "Retrieves the results of a query job.", + "parameters": { + "jobId": { + "type": "string", + "description": "Job ID of the query job", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to read", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Page token, returned by a previous call, to request the next page of results", + "location": "query" + }, + "projectId": { + "type": "string", + "description": "Project ID of the query job", + "required": true, + "location": "path" + }, + "startIndex": { + "type": "string", + "description": "Zero-based index of the starting row", + "format": "uint64", + "location": "query" + }, + "timeoutMs": { + "type": "integer", + "description": "How long to wait for the query to complete, in milliseconds, before returning. Default is to return immediately. If the timeout passes before the job completes, the request will fail with a TIMEOUT error", + "format": "uint32", + "location": "query" + } + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "response": { + "$ref": "GetQueryResultsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "insert": { + "id": "bigquery.jobs.insert", + "path": "projects/{projectId}/jobs", + "httpMethod": "POST", + "description": "Starts a new asynchronous job.", + "parameters": { + "projectId": { + "type": "string", + "description": "Project ID of the project that will be billed for the job", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "request": { + "$ref": "Job" + }, + "response": { + "$ref": "Job" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/bigquery/v2/projects/{projectId}/jobs" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/bigquery/v2/projects/{projectId}/jobs" + } + } + } + }, + "list": { + "id": "bigquery.jobs.list", + "path": "projects/{projectId}/jobs", + "httpMethod": "GET", + "description": "Lists all the Jobs in the specified project that were started by the user.", + "parameters": { + "allUsers": { + "type": "boolean", + "description": "Whether to display jobs owned by all users in the project. Default false", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Page token, returned by a previous call, to request the next page of results", + "location": "query" + }, + "projectId": { + "type": "string", + "description": "Project ID of the jobs to list", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "Restrict information returned to a set of selected fields", + "enum": [ + "full", + "minimal" + ], + "enumDescriptions": [ + "Includes all job data", + "Does not include the job configuration" + ], + "location": "query" + }, + "stateFilter": { + "type": "string", + "description": "Filter for job state", + "enum": [ + "done", + "pending", + "running" + ], + "enumDescriptions": [ + "Finished jobs", + "Pending jobs", + "Running jobs" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "JobList" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "query": { + "id": "bigquery.jobs.query", + "path": "projects/{projectId}/queries", + "httpMethod": "POST", + "description": "Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout.", + "parameters": { + "projectId": { + "type": "string", + "description": "Project ID of the project billed for the query", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "request": { + "$ref": "QueryRequest" + }, + "response": { + "$ref": "QueryResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "projects": { + "methods": { + "list": { + "id": "bigquery.projects.list", + "path": "projects", + "httpMethod": "GET", + "description": "Lists the projects to which you have at least read access.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Page token, returned by a previous call, to request the next page of results", + "location": "query" + } + }, + "response": { + "$ref": "ProjectList" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "tabledata": { + "methods": { + "insertAll": { + "id": "bigquery.tabledata.insertAll", + "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/insertAll", + "httpMethod": "POST", + "description": "Inserts the supplied rows into the table.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Dataset ID of the destination table.", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID of the destination table.", + "required": true, + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table ID of the destination table.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId", + "tableId" + ], + "request": { + "$ref": "TableDataInsertAllRequest" + }, + "response": { + "$ref": "TableDataInsertAllResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "id": "bigquery.tabledata.list", + "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data", + "httpMethod": "GET", + "description": "Retrieves table data from a specified set of rows.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Dataset ID of the table to read", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Page token, returned by a previous call, identifying the result set", + "location": "query" + }, + "projectId": { + "type": "string", + "description": "Project ID of the table to read", + "required": true, + "location": "path" + }, + "startIndex": { + "type": "string", + "description": "Zero-based index of the starting row to read", + "format": "uint64", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "Table ID of the table to read", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId", + "tableId" + ], + "response": { + "$ref": "TableDataList" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "tables": { + "methods": { + "delete": { + "id": "bigquery.tables.delete", + "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", + "httpMethod": "DELETE", + "description": "Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Dataset ID of the table to delete", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID of the table to delete", + "required": true, + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table ID of the table to delete", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId", + "tableId" + ], + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "id": "bigquery.tables.get", + "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", + "httpMethod": "GET", + "description": "Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Dataset ID of the requested table", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID of the requested table", + "required": true, + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table ID of the requested table", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId", + "tableId" + ], + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "insert": { + "id": "bigquery.tables.insert", + "path": "projects/{projectId}/datasets/{datasetId}/tables", + "httpMethod": "POST", + "description": "Creates a new, empty table in the dataset.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Dataset ID of the new table", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID of the new table", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId" + ], + "request": { + "$ref": "Table" + }, + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "id": "bigquery.tables.list", + "path": "projects/{projectId}/datasets/{datasetId}/tables", + "httpMethod": "GET", + "description": "Lists all tables in the specified dataset.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Dataset ID of the tables to list", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Page token, returned by a previous call, to request the next page of results", + "location": "query" + }, + "projectId": { + "type": "string", + "description": "Project ID of the tables to list", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId" + ], + "response": { + "$ref": "TableList" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "id": "bigquery.tables.patch", + "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", + "httpMethod": "PATCH", + "description": "Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports patch semantics.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Dataset ID of the table to update", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID of the table to update", + "required": true, + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table ID of the table to update", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId", + "tableId" + ], + "request": { + "$ref": "Table" + }, + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "update": { + "id": "bigquery.tables.update", + "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", + "httpMethod": "PUT", + "description": "Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Dataset ID of the table to update", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID of the table to update", + "required": true, + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table ID of the table to update", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId", + "tableId" + ], + "request": { + "$ref": "Table" + }, + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/bigquery/v2/bigquery-gen.go b/third_party/src/code.google.com/p/google-api-go-client/bigquery/v2/bigquery-gen.go new file mode 100644 index 0000000000000..9e15158bf6520 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/bigquery/v2/bigquery-gen.go @@ -0,0 +1,3023 @@ +// Package bigquery provides access to the BigQuery API. +// +// See https://developers.google.com/bigquery/docs/overview +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/bigquery/v2" +// ... +// bigqueryService, err := bigquery.New(oauthHttpClient) +package bigquery + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "bigquery:v2" +const apiName = "bigquery" +const apiVersion = "v2" +const basePath = "https://www.googleapis.com/bigquery/v2/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your data in Google BigQuery + BigqueryScope = "https://www.googleapis.com/auth/bigquery" + + // View and manage your data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" + + // Manage your data and permissions in Google Cloud Storage + DevstorageFull_controlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageRead_onlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageRead_writeScope = "https://www.googleapis.com/auth/devstorage.read_write" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Datasets = NewDatasetsService(s) + s.Jobs = NewJobsService(s) + s.Projects = NewProjectsService(s) + s.Tabledata = NewTabledataService(s) + s.Tables = NewTablesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Datasets *DatasetsService + + Jobs *JobsService + + Projects *ProjectsService + + Tabledata *TabledataService + + Tables *TablesService +} + +func NewDatasetsService(s *Service) *DatasetsService { + rs := &DatasetsService{s: s} + return rs +} + +type DatasetsService struct { + s *Service +} + +func NewJobsService(s *Service) *JobsService { + rs := &JobsService{s: s} + return rs +} + +type JobsService struct { + s *Service +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + return rs +} + +type ProjectsService struct { + s *Service +} + +func NewTabledataService(s *Service) *TabledataService { + rs := &TabledataService{s: s} + return rs +} + +type TabledataService struct { + s *Service +} + +func NewTablesService(s *Service) *TablesService { + rs := &TablesService{s: s} + return rs +} + +type TablesService struct { + s *Service +} + +type Dataset struct { + // Access: [Optional] An array of objects that define dataset access for + // one or more entities. You can set this property when inserting or + // updating a dataset in order to control who is allowed to access the + // data. If unspecified at dataset creation time, BigQuery adds default + // dataset access for the following entities: access.specialGroup: + // projectReaders; access.role: READER; access.specialGroup: + // projectWriters; access.role: WRITER; access.specialGroup: + // projectOwners; access.role: OWNER; access.userByEmail: [dataset + // creator email]; access.role: OWNER; + Access []*DatasetAccess `json:"access,omitempty"` + + // CreationTime: [Output-only] The time when this dataset was created, + // in milliseconds since the epoch. + CreationTime int64 `json:"creationTime,omitempty,string"` + + // DatasetReference: [Required] A reference that identifies the dataset. + DatasetReference *DatasetReference `json:"datasetReference,omitempty"` + + // Description: [Optional] A user-friendly description of the dataset. + Description string `json:"description,omitempty"` + + // Etag: [Output-only] A hash of the resource. + Etag string `json:"etag,omitempty"` + + // FriendlyName: [Optional] A descriptive name for the dataset. + FriendlyName string `json:"friendlyName,omitempty"` + + // Id: [Output-only] The fully-qualified unique name of the dataset in + // the format projectId:datasetId. The dataset name without the project + // name is given in the datasetId field. When creating a new dataset, + // leave this field blank, and instead specify the datasetId field. + Id string `json:"id,omitempty"` + + // Kind: [Output-only] The resource type. + Kind string `json:"kind,omitempty"` + + // LastModifiedTime: [Output-only] The date when this dataset or any of + // its tables was last modified, in milliseconds since the epoch. + LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"` + + // SelfLink: [Output-only] A URL that can be used to access the resource + // again. You can use this URL in Get or Update requests to the + // resource. + SelfLink string `json:"selfLink,omitempty"` +} + +type DatasetAccess struct { + // Domain: [Pick one] A domain to grant access to. Any users signed in + // with the domain specified will be granted the specified access. + // Example: "example.com". + Domain string `json:"domain,omitempty"` + + // GroupByEmail: [Pick one] An email address of a Google Group to grant + // access to. + GroupByEmail string `json:"groupByEmail,omitempty"` + + // Role: [Required] Describes the rights granted to the user specified + // by the other member of the access object. The following string values + // are supported: READER, WRITER, OWNER. + Role string `json:"role,omitempty"` + + // SpecialGroup: [Pick one] A special group to grant access to. Possible + // values include: projectOwners: Owners of the enclosing project. + // projectReaders: Readers of the enclosing project. projectWriters: + // Writers of the enclosing project. allAuthenticatedUsers: All + // authenticated BigQuery users. + SpecialGroup string `json:"specialGroup,omitempty"` + + // UserByEmail: [Pick one] An email address of a user to grant access + // to. For example: fred@example.com. + UserByEmail string `json:"userByEmail,omitempty"` +} + +type DatasetList struct { + // Datasets: An array of the dataset resources in the project. Each + // resource contains basic information. For full information about a + // particular dataset resource, use the Datasets: get method. This + // property is omitted when there are no datasets in the project. + Datasets []*DatasetListDatasets `json:"datasets,omitempty"` + + // Etag: A hash value of the results page. You can use this property to + // determine if the page has changed since the last request. + Etag string `json:"etag,omitempty"` + + // Kind: The list type. This property always returns the value + // "bigquery#datasetList". + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token that can be used to request the next results + // page. This property is omitted on the final results page. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type DatasetListDatasets struct { + // DatasetReference: The dataset reference. Use this property to access + // specific parts of the dataset's ID, such as project ID or dataset ID. + DatasetReference *DatasetReference `json:"datasetReference,omitempty"` + + // FriendlyName: A descriptive name for the dataset, if one exists. + FriendlyName string `json:"friendlyName,omitempty"` + + // Id: The fully-qualified, unique, opaque ID of the dataset. + Id string `json:"id,omitempty"` + + // Kind: The resource type. This property always returns the value + // "bigquery#dataset". + Kind string `json:"kind,omitempty"` +} + +type DatasetReference struct { + // DatasetId: [Required] A unique ID for this dataset, without the + // project name. + DatasetId string `json:"datasetId,omitempty"` + + // ProjectId: [Optional] The ID of the container project. + ProjectId string `json:"projectId,omitempty"` +} + +type ErrorProto struct { + // DebugInfo: Debugging information. This property is internal to Google + // and should not be used. + DebugInfo string `json:"debugInfo,omitempty"` + + // Location: Specifies where the error occurred, if present. + Location string `json:"location,omitempty"` + + // Message: A human-readable description of the error. + Message string `json:"message,omitempty"` + + // Reason: A short error code that summarizes the error. + Reason string `json:"reason,omitempty"` +} + +type GetQueryResultsResponse struct { + // CacheHit: Whether the query result was fetched from the query cache. + CacheHit bool `json:"cacheHit,omitempty"` + + // Etag: A hash of this response. + Etag string `json:"etag,omitempty"` + + // JobComplete: Whether the query has completed or not. If rows or + // totalRows are present, this will always be true. If this is false, + // totalRows will not be available. + JobComplete bool `json:"jobComplete,omitempty"` + + // JobReference: Reference to the BigQuery Job that was created to run + // the query. This field will be present even if the original request + // timed out, in which case GetQueryResults can be used to read the + // results once the query has completed. Since this API only returns the + // first page of results, subsequent pages can be fetched via the same + // mechanism (GetQueryResults). + JobReference *JobReference `json:"jobReference,omitempty"` + + // Kind: The resource type of the response. + Kind string `json:"kind,omitempty"` + + // PageToken: A token used for paging results. + PageToken string `json:"pageToken,omitempty"` + + // Rows: An object with as many results as can be contained within the + // maximum permitted reply size. To get any additional rows, you can + // call GetQueryResults and specify the jobReference returned above. + // Present only when the query completes successfully. + Rows []*TableRow `json:"rows,omitempty"` + + // Schema: The schema of the results. Present only when the query + // completes successfully. + Schema *TableSchema `json:"schema,omitempty"` + + // TotalRows: The total number of rows in the complete query result set, + // which can be more than the number of rows in this single page of + // results. Present only when the query completes successfully. + TotalRows uint64 `json:"totalRows,omitempty,string"` +} + +type Job struct { + // Configuration: [Required] Describes the job configuration. + Configuration *JobConfiguration `json:"configuration,omitempty"` + + // Etag: [Output-only] A hash of this resource. + Etag string `json:"etag,omitempty"` + + // Id: [Output-only] Opaque ID field of the job + Id string `json:"id,omitempty"` + + // JobReference: [Optional] Reference describing the unique-per-user + // name of the job. + JobReference *JobReference `json:"jobReference,omitempty"` + + // Kind: [Output-only] The type of the resource. + Kind string `json:"kind,omitempty"` + + // SelfLink: [Output-only] A URL that can be used to access this + // resource again. + SelfLink string `json:"selfLink,omitempty"` + + // Statistics: [Output-only] Information about the job, including + // starting time and ending time of the job. + Statistics *JobStatistics `json:"statistics,omitempty"` + + // Status: [Output-only] The status of this job. Examine this value when + // polling an asynchronous job to see if the job is complete. + Status *JobStatus `json:"status,omitempty"` +} + +type JobConfiguration struct { + // Copy: [Pick one] Copies a table. + Copy *JobConfigurationTableCopy `json:"copy,omitempty"` + + // DryRun: [Optional] If set, don't actually run this job. A valid query + // will return a mostly empty response with some processing statistics, + // while an invalid query will return the same error it would if it + // wasn't a dry run. Behavior of non-query jobs is undefined. + DryRun bool `json:"dryRun,omitempty"` + + // Extract: [Pick one] Configures an extract job. + Extract *JobConfigurationExtract `json:"extract,omitempty"` + + // Link: [Pick one] Configures a link job. + Link *JobConfigurationLink `json:"link,omitempty"` + + // Load: [Pick one] Configures a load job. + Load *JobConfigurationLoad `json:"load,omitempty"` + + // Query: [Pick one] Configures a query job. + Query *JobConfigurationQuery `json:"query,omitempty"` +} + +type JobConfigurationExtract struct { + // DestinationFormat: [Experimental] Optional and defaults to CSV. + // Format with which files should be exported. To export to CSV, specify + // "CSV". Tables with nested or repeated fields cannot be exported as + // CSV. To export to newline-delimited JSON, specify + // "NEWLINE_DELIMITED_JSON". + DestinationFormat string `json:"destinationFormat,omitempty"` + + // DestinationUri: [Pick one] DEPRECATED: Use destinationUris instead, + // passing only one URI as necessary. The fully-qualified Google Cloud + // Storage URI where the extracted table should be written. + DestinationUri string `json:"destinationUri,omitempty"` + + // DestinationUris: [Pick one] A list of fully-qualified Google Cloud + // Storage URIs where the extracted table should be written. + DestinationUris []string `json:"destinationUris,omitempty"` + + // FieldDelimiter: [Optional] Delimiter to use between fields in the + // exported data. Default is ',' + FieldDelimiter string `json:"fieldDelimiter,omitempty"` + + // PrintHeader: [Optional] Whether to print out a header row in the + // results. Default is true. + PrintHeader bool `json:"printHeader,omitempty"` + + // SourceTable: [Required] A reference to the table being exported. + SourceTable *TableReference `json:"sourceTable,omitempty"` +} + +type JobConfigurationLink struct { + // CreateDisposition: [Optional] Specifies whether the job is allowed to + // create new tables. The following values are supported: + // CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the + // table. CREATE_NEVER: The table must already exist. If it does not, a + // 'notFound' error is returned in the job result. The default value is + // CREATE_IF_NEEDED. Creation, truncation and append actions occur as + // one atomic update upon job completion. + CreateDisposition string `json:"createDisposition,omitempty"` + + // DestinationTable: [Required] The destination table of the link job. + DestinationTable *TableReference `json:"destinationTable,omitempty"` + + // SourceUri: [Required] URI of source table to link. + SourceUri []string `json:"sourceUri,omitempty"` + + // WriteDisposition: [Optional] Specifies the action that occurs if the + // destination table already exists. The following values are supported: + // WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the + // table data. WRITE_APPEND: If the table already exists, BigQuery + // appends the data to the table. WRITE_EMPTY: If the table already + // exists and contains data, a 'duplicate' error is returned in the job + // result. The default value is WRITE_EMPTY. Each action is atomic and + // only occurs if BigQuery is able to complete the job successfully. + // Creation, truncation and append actions occur as one atomic update + // upon job completion. + WriteDisposition string `json:"writeDisposition,omitempty"` +} + +type JobConfigurationLoad struct { + // AllowJaggedRows: [Optional] Accept rows that are missing trailing + // optional columns. The missing values are treated as nulls. Default is + // false which treats short rows as errors. Only applicable to CSV, + // ignored for other formats. + AllowJaggedRows bool `json:"allowJaggedRows,omitempty"` + + // AllowQuotedNewlines: Indicates if BigQuery should allow quoted data + // sections that contain newline characters in a CSV file. The default + // value is false. + AllowQuotedNewlines bool `json:"allowQuotedNewlines,omitempty"` + + // CreateDisposition: [Optional] Specifies whether the job is allowed to + // create new tables. The following values are supported: + // CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the + // table. CREATE_NEVER: The table must already exist. If it does not, a + // 'notFound' error is returned in the job result. The default value is + // CREATE_IF_NEEDED. Creation, truncation and append actions occur as + // one atomic update upon job completion. + CreateDisposition string `json:"createDisposition,omitempty"` + + // DestinationTable: [Required] The destination table to load the data + // into. + DestinationTable *TableReference `json:"destinationTable,omitempty"` + + // Encoding: [Optional] The character encoding of the data. The + // supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. + // BigQuery decodes the data after the raw, binary data has been split + // using the values of the quote and fieldDelimiter properties. + Encoding string `json:"encoding,omitempty"` + + // FieldDelimiter: [Optional] The separator for fields in a CSV file. + // BigQuery converts the string to ISO-8859-1 encoding, and then uses + // the first byte of the encoded string to split the data in its raw, + // binary state. BigQuery also supports the escape sequence "\t" to + // specify a tab separator. The default value is a comma (','). + FieldDelimiter string `json:"fieldDelimiter,omitempty"` + + // IgnoreUnknownValues: [Optional] Accept rows that contain values that + // do not match the schema. The unknown values are ignored. Default is + // false which treats unknown values as errors. For CSV this ignores + // extra values at the end of a line. For JSON this ignores named values + // that do not match any column name. + IgnoreUnknownValues bool `json:"ignoreUnknownValues,omitempty"` + + // MaxBadRecords: [Optional] The maximum number of bad records that + // BigQuery can ignore when running the job. If the number of bad + // records exceeds this value, an 'invalid' error is returned in the job + // result and the job fails. The default value is 0, which requires that + // all records are valid. + MaxBadRecords int64 `json:"maxBadRecords,omitempty"` + + // Quote: [Optional] The value that is used to quote data sections in a + // CSV file. BigQuery converts the string to ISO-8859-1 encoding, and + // then uses the first byte of the encoded string to split the data in + // its raw, binary state. The default value is a double-quote ('"'). If + // your data does not contain quoted sections, set the property value to + // an empty string. If your data contains quoted newline characters, you + // must also set the allowQuotedNewlines property to true. + Quote string `json:"quote,omitempty"` + + // Schema: [Optional] The schema for the destination table. The schema + // can be omitted if the destination table already exists or if the + // schema can be inferred from the loaded data. + Schema *TableSchema `json:"schema,omitempty"` + + // SchemaInline: [Deprecated] The inline schema. For CSV schemas, + // specify as "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, + // bar:INTEGER, baz:FLOAT". + SchemaInline string `json:"schemaInline,omitempty"` + + // SchemaInlineFormat: [Deprecated] The format of the schemaInline + // property. + SchemaInlineFormat string `json:"schemaInlineFormat,omitempty"` + + // SkipLeadingRows: [Optional] The number of rows at the top of a CSV + // file that BigQuery will skip when loading the data. The default value + // is 0. This property is useful if you have header rows in the file + // that should be skipped. + SkipLeadingRows int64 `json:"skipLeadingRows,omitempty"` + + // SourceFormat: [Optional] The format of the data files. For CSV files, + // specify "CSV". For datastore backups, specify "DATASTORE_BACKUP". For + // newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". The default + // value is CSV. + SourceFormat string `json:"sourceFormat,omitempty"` + + // SourceUris: [Required] The fully-qualified URIs that point to your + // data on Google Cloud Storage. + SourceUris []string `json:"sourceUris,omitempty"` + + // WriteDisposition: [Optional] Specifies the action that occurs if the + // destination table already exists. The following values are supported: + // WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the + // table data. WRITE_APPEND: If the table already exists, BigQuery + // appends the data to the table. WRITE_EMPTY: If the table already + // exists and contains data, a 'duplicate' error is returned in the job + // result. The default value is WRITE_EMPTY. Each action is atomic and + // only occurs if BigQuery is able to complete the job successfully. + // Creation, truncation and append actions occur as one atomic update + // upon job completion. + WriteDisposition string `json:"writeDisposition,omitempty"` +} + +type JobConfigurationQuery struct { + // AllowLargeResults: If true, allows the query to produce arbitrarily + // large result tables at a slight cost in performance. Requires + // destination_table to be set. + AllowLargeResults bool `json:"allowLargeResults,omitempty"` + + // CreateDisposition: [Optional] Specifies whether the job is allowed to + // create new tables. The following values are supported: + // CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the + // table. CREATE_NEVER: The table must already exist. If it does not, a + // 'notFound' error is returned in the job result. The default value is + // CREATE_IF_NEEDED. Creation, truncation and append actions occur as + // one atomic update upon job completion. + CreateDisposition string `json:"createDisposition,omitempty"` + + // DefaultDataset: [Optional] Specifies the default dataset to use for + // unqualified table names in the query. + DefaultDataset *DatasetReference `json:"defaultDataset,omitempty"` + + // DestinationTable: [Optional] Describes the table where the query + // results should be stored. If not present, a new table will be created + // to store the results. + DestinationTable *TableReference `json:"destinationTable,omitempty"` + + // PreserveNulls: [Deprecated] This property is deprecated. + PreserveNulls bool `json:"preserveNulls,omitempty"` + + // Priority: [Optional] Specifies a priority for the query. Possible + // values include INTERACTIVE and BATCH. The default value is + // INTERACTIVE. + Priority string `json:"priority,omitempty"` + + // Query: [Required] BigQuery SQL query to execute. + Query string `json:"query,omitempty"` + + // UseQueryCache: [Optional] Whether to look for the result in the query + // cache. The query cache is a best-effort cache that will be flushed + // whenever tables in the query are modified. Moreover, the query cache + // is only available when a query does not have a destination table + // specified. + UseQueryCache bool `json:"useQueryCache,omitempty"` + + // WriteDisposition: [Optional] Specifies the action that occurs if the + // destination table already exists. The following values are supported: + // WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the + // table data. WRITE_APPEND: If the table already exists, BigQuery + // appends the data to the table. WRITE_EMPTY: If the table already + // exists and contains data, a 'duplicate' error is returned in the job + // result. The default value is WRITE_EMPTY. Each action is atomic and + // only occurs if BigQuery is able to complete the job successfully. + // Creation, truncation and append actions occur as one atomic update + // upon job completion. + WriteDisposition string `json:"writeDisposition,omitempty"` +} + +type JobConfigurationTableCopy struct { + // CreateDisposition: [Optional] Specifies whether the job is allowed to + // create new tables. The following values are supported: + // CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the + // table. CREATE_NEVER: The table must already exist. If it does not, a + // 'notFound' error is returned in the job result. The default value is + // CREATE_IF_NEEDED. Creation, truncation and append actions occur as + // one atomic update upon job completion. + CreateDisposition string `json:"createDisposition,omitempty"` + + // DestinationTable: [Required] The destination table + DestinationTable *TableReference `json:"destinationTable,omitempty"` + + // SourceTable: [Required] Source table to copy. + SourceTable *TableReference `json:"sourceTable,omitempty"` + + // WriteDisposition: [Optional] Specifies the action that occurs if the + // destination table already exists. The following values are supported: + // WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the + // table data. WRITE_APPEND: If the table already exists, BigQuery + // appends the data to the table. WRITE_EMPTY: If the table already + // exists and contains data, a 'duplicate' error is returned in the job + // result. The default value is WRITE_EMPTY. Each action is atomic and + // only occurs if BigQuery is able to complete the job successfully. + // Creation, truncation and append actions occur as one atomic update + // upon job completion. + WriteDisposition string `json:"writeDisposition,omitempty"` +} + +type JobList struct { + // Etag: A hash of this page of results. + Etag string `json:"etag,omitempty"` + + // Jobs: List of jobs that were requested. + Jobs []*JobListJobs `json:"jobs,omitempty"` + + // Kind: The resource type of the response. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token to request the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TotalItems: Total number of jobs in this collection. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type JobListJobs struct { + // Configuration: [Full-projection-only] Specifies the job + // configuration. + Configuration *JobConfiguration `json:"configuration,omitempty"` + + // ErrorResult: A result object that will be present only if the job has + // failed. + ErrorResult *ErrorProto `json:"errorResult,omitempty"` + + // Id: Unique opaque ID of the job. + Id string `json:"id,omitempty"` + + // JobReference: Job reference uniquely identifying the job. + JobReference *JobReference `json:"jobReference,omitempty"` + + // Kind: The resource type. + Kind string `json:"kind,omitempty"` + + // State: Running state of the job. When the state is DONE, errorResult + // can be checked to determine whether the job succeeded or failed. + State string `json:"state,omitempty"` + + // Statistics: [Output-only] Information about the job, including + // starting time and ending time of the job. + Statistics *JobStatistics `json:"statistics,omitempty"` + + // Status: [Full-projection-only] Describes the state of the job. + Status *JobStatus `json:"status,omitempty"` + + // User_email: [Full-projection-only] User who ran the job. + User_email string `json:"user_email,omitempty"` +} + +type JobReference struct { + // JobId: [Required] ID of the job. + JobId string `json:"jobId,omitempty"` + + // ProjectId: [Required] Project ID being billed for the job. + ProjectId string `json:"projectId,omitempty"` +} + +type JobStatistics struct { + // CreationTime: [Output-only] Creation time of this job, in + // milliseconds since the epoch. This field will be present on all jobs. + CreationTime int64 `json:"creationTime,omitempty,string"` + + // EndTime: [Output-only] End time of this job, in milliseconds since + // the epoch. This field will be present whenever a job is in the DONE + // state. + EndTime int64 `json:"endTime,omitempty,string"` + + // Load: [Output-only] Statistics for a load job. + Load *JobStatistics3 `json:"load,omitempty"` + + // Query: [Output-only] Statistics for a query job. + Query *JobStatistics2 `json:"query,omitempty"` + + // StartTime: [Output-only] Start time of this job, in milliseconds + // since the epoch. This field will be present when the job transitions + // from the PENDING state to either RUNNING or DONE. + StartTime int64 `json:"startTime,omitempty,string"` + + // TotalBytesProcessed: [Output-only] [Deprecated] Use the bytes + // processed in the query statistics instead. + TotalBytesProcessed int64 `json:"totalBytesProcessed,omitempty,string"` +} + +type JobStatistics2 struct { + // CacheHit: [Output-only] Whether the query result was fetched from the + // query cache. + CacheHit bool `json:"cacheHit,omitempty"` + + // TotalBytesProcessed: [Output-only] Total bytes processed for this + // job. + TotalBytesProcessed int64 `json:"totalBytesProcessed,omitempty,string"` +} + +type JobStatistics3 struct { + // InputFileBytes: [Output-only] Number of bytes of source data in a + // joad job. + InputFileBytes int64 `json:"inputFileBytes,omitempty,string"` + + // InputFiles: [Output-only] Number of source files in a load job. + InputFiles int64 `json:"inputFiles,omitempty,string"` + + // OutputBytes: [Output-only] Size of the loaded data in bytes. Note + // that while an import job is in the running state, this value may + // change. + OutputBytes int64 `json:"outputBytes,omitempty,string"` + + // OutputRows: [Output-only] Number of rows imported in a load job. Note + // that while an import job is in the running state, this value may + // change. + OutputRows int64 `json:"outputRows,omitempty,string"` +} + +type JobStatus struct { + // ErrorResult: [Output-only] Final error result of the job. If present, + // indicates that the job has completed and was unsuccessful. + ErrorResult *ErrorProto `json:"errorResult,omitempty"` + + // Errors: [Output-only] All errors encountered during the running of + // the job. Errors here do not necessarily mean that the job has + // completed or was unsuccessful. + Errors []*ErrorProto `json:"errors,omitempty"` + + // State: [Output-only] Running state of the job. + State string `json:"state,omitempty"` +} + +type JsonObject struct { +} + +type ProjectList struct { + // Etag: A hash of the page of results + Etag string `json:"etag,omitempty"` + + // Kind: The type of list. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token to request the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Projects: Projects to which you have at least READ access. + Projects []*ProjectListProjects `json:"projects,omitempty"` + + // TotalItems: The total number of projects in the list. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type ProjectListProjects struct { + // FriendlyName: A descriptive name for this project. + FriendlyName string `json:"friendlyName,omitempty"` + + // Id: An opaque ID of this project. + Id string `json:"id,omitempty"` + + // Kind: The resource type. + Kind string `json:"kind,omitempty"` + + // NumericId: The numeric ID of this project. + NumericId uint64 `json:"numericId,omitempty,string"` + + // ProjectReference: A unique reference to this project. + ProjectReference *ProjectReference `json:"projectReference,omitempty"` +} + +type ProjectReference struct { + // ProjectId: [Required] ID of the project. Can be either the numeric ID + // or the assigned ID of the project. + ProjectId string `json:"projectId,omitempty"` +} + +type QueryRequest struct { + // DefaultDataset: [Optional] Specifies the default datasetId and + // projectId to assume for any unqualified table names in the query. If + // not set, all table names in the query string must be qualified in the + // format 'datasetId.tableId'. + DefaultDataset *DatasetReference `json:"defaultDataset,omitempty"` + + // DryRun: [Optional] If set, don't actually run the query. A valid + // query will return an empty response, while an invalid query will + // return the same error it would if it wasn't a dry run. The default + // value is false. + DryRun bool `json:"dryRun,omitempty"` + + // Kind: The resource type of the request. + Kind string `json:"kind,omitempty"` + + // MaxResults: [Optional] The maximum number of rows of data to return + // per page of results. Setting this flag to a small value such as 1000 + // and then paging through results might improve reliability when the + // query result set is large. In addition to this limit, responses are + // also limited to 10 MB. By default, there is no maximum row count, and + // only the byte limit applies. + MaxResults int64 `json:"maxResults,omitempty"` + + // PreserveNulls: [Deprecated] If set to false, maps null values in the + // query response to the column's default value. Only specify if you + // have older code that can not handle null values in the query + // response. The default value is true. This flag is deprecated and will + // be ignored in a future version of BigQuery. + PreserveNulls bool `json:"preserveNulls,omitempty"` + + // Query: [Required] A query string, following the BigQuery query + // syntax, of the query to execute. Example: "SELECT count(f1) FROM + // [myProjectId:myDatasetId.myTableId]". + Query string `json:"query,omitempty"` + + // TimeoutMs: [Optional] How long to wait for the query to complete, in + // milliseconds, before the request times out and returns. Note that + // this is only a timeout for the request, not the query. If the query + // takes longer to run than the timeout value, the call returns without + // any results and with the 'jobComplete' flag set to false. You can + // call GetQueryResults() to wait for the query to complete and read the + // results. The default value is 10000 milliseconds (10 seconds). + TimeoutMs int64 `json:"timeoutMs,omitempty"` + + // UseQueryCache: [Optional] Whether to look for the result in the query + // cache. The query cache is a best-effort cache that will be flushed + // whenever tables in the query are modified. The default value is true. + UseQueryCache bool `json:"useQueryCache,omitempty"` +} + +type QueryResponse struct { + // CacheHit: Whether the query result was fetched from the query cache. + CacheHit bool `json:"cacheHit,omitempty"` + + // JobComplete: Whether the query has completed or not. If rows or + // totalRows are present, this will always be true. If this is false, + // totalRows will not be available. + JobComplete bool `json:"jobComplete,omitempty"` + + // JobReference: Reference to the Job that was created to run the query. + // This field will be present even if the original request timed out, in + // which case GetQueryResults can be used to read the results once the + // query has completed. Since this API only returns the first page of + // results, subsequent pages can be fetched via the same mechanism + // (GetQueryResults). + JobReference *JobReference `json:"jobReference,omitempty"` + + // Kind: The resource type. + Kind string `json:"kind,omitempty"` + + // PageToken: A token used for paging results. + PageToken string `json:"pageToken,omitempty"` + + // Rows: An object with as many results as can be contained within the + // maximum permitted reply size. To get any additional rows, you can + // call GetQueryResults and specify the jobReference returned above. + Rows []*TableRow `json:"rows,omitempty"` + + // Schema: The schema of the results. Present only when the query + // completes successfully. + Schema *TableSchema `json:"schema,omitempty"` + + // TotalBytesProcessed: The total number of bytes processed for this + // query. If this query was a dry run, this is the number of bytes that + // would be processed if the query were run. + TotalBytesProcessed int64 `json:"totalBytesProcessed,omitempty,string"` + + // TotalRows: The total number of rows in the complete query result set, + // which can be more than the number of rows in this single page of + // results. + TotalRows uint64 `json:"totalRows,omitempty,string"` +} + +type Table struct { + // CreationTime: [Output-only] The time when this table was created, in + // milliseconds since the epoch. + CreationTime int64 `json:"creationTime,omitempty,string"` + + // Description: [Optional] A user-friendly description of this table. + Description string `json:"description,omitempty"` + + // Etag: [Output-only] A hash of this resource. + Etag string `json:"etag,omitempty"` + + // ExpirationTime: [Optional] The time when this table expires, in + // milliseconds since the epoch. If not present, the table will persist + // indefinitely. Expired tables will be deleted and their storage + // reclaimed. + ExpirationTime int64 `json:"expirationTime,omitempty,string"` + + // FriendlyName: [Optional] A descriptive name for this table. + FriendlyName string `json:"friendlyName,omitempty"` + + // Id: [Output-only] An opaque ID uniquely identifying the table. + Id string `json:"id,omitempty"` + + // Kind: [Output-only] The type of the resource. + Kind string `json:"kind,omitempty"` + + // LastModifiedTime: [Output-only] The time when this table was last + // modified, in milliseconds since the epoch. + LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"` + + // NumBytes: [Output-only] The size of the table in bytes. + NumBytes int64 `json:"numBytes,omitempty,string"` + + // NumRows: [Output-only] The number of rows of data in this table. + NumRows uint64 `json:"numRows,omitempty,string"` + + // Schema: [Optional] Describes the schema of this table. + Schema *TableSchema `json:"schema,omitempty"` + + // SelfLink: [Output-only] A URL that can be used to access this + // resource again. + SelfLink string `json:"selfLink,omitempty"` + + // TableReference: [Required] Reference describing the ID of this table. + TableReference *TableReference `json:"tableReference,omitempty"` + + // Type: [Output-only] Describes the table type. The following values + // are supported: TABLE: A normal BigQuery table. VIEW: A virtual table + // defined by a SQL query. The default value is TABLE. + Type string `json:"type,omitempty"` + + // View: [Optional] The view definition. + View *ViewDefinition `json:"view,omitempty"` +} + +type TableCell struct { + V interface{} `json:"v,omitempty"` +} + +type TableDataInsertAllRequest struct { + // Kind: The resource type of the response. + Kind string `json:"kind,omitempty"` + + // Rows: The rows to insert. + Rows []*TableDataInsertAllRequestRows `json:"rows,omitempty"` +} + +type TableDataInsertAllRequestRows struct { + // InsertId: [Optional] A unique ID for each row. BigQuery uses this + // property to detect duplicate insertion requests on a best-effort + // basis. + InsertId string `json:"insertId,omitempty"` + + // Json: [Required] A JSON object that contains a row of data. The + // object's properties and values must match the destination table's + // schema. + Json *JsonObject `json:"json,omitempty"` +} + +type TableDataInsertAllResponse struct { + // InsertErrors: An array of errors for rows that were not inserted. + InsertErrors []*TableDataInsertAllResponseInsertErrors `json:"insertErrors,omitempty"` + + // Kind: The resource type of the response. + Kind string `json:"kind,omitempty"` +} + +type TableDataInsertAllResponseInsertErrors struct { + // Errors: Error information for the row indicated by the index + // property. + Errors []*ErrorProto `json:"errors,omitempty"` + + // Index: The index of the row that error applies to. + Index int64 `json:"index,omitempty"` +} + +type TableDataList struct { + // Etag: A hash of this page of results. + Etag string `json:"etag,omitempty"` + + // Kind: The resource type of the response. + Kind string `json:"kind,omitempty"` + + // PageToken: A token used for paging results. Providing this token + // instead of the startIndex parameter can help you retrieve stable + // results when an underlying table is changing. + PageToken string `json:"pageToken,omitempty"` + + // Rows: Rows of results. + Rows []*TableRow `json:"rows,omitempty"` + + // TotalRows: The total number of rows in the complete table. + TotalRows int64 `json:"totalRows,omitempty,string"` +} + +type TableFieldSchema struct { + // Description: [Optional] The field description. + Description string `json:"description,omitempty"` + + // Fields: [Optional] Describes the nested schema fields if the type + // property is set to RECORD. + Fields []*TableFieldSchema `json:"fields,omitempty"` + + // Mode: [Optional] The field mode. Possible values include NULLABLE, + // REQUIRED and REPEATED. The default value is NULLABLE. + Mode string `json:"mode,omitempty"` + + // Name: [Required] The field name. + Name string `json:"name,omitempty"` + + // Type: [Required] The field data type. Possible values include STRING, + // INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates + // that the field contains a nested schema). + Type string `json:"type,omitempty"` +} + +type TableList struct { + // Etag: A hash of this page of results. + Etag string `json:"etag,omitempty"` + + // Kind: The type of list. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token to request the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Tables: Tables in the requested dataset. + Tables []*TableListTables `json:"tables,omitempty"` + + // TotalItems: The total number of tables in the dataset. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type TableListTables struct { + // FriendlyName: The user-friendly name for this table. + FriendlyName string `json:"friendlyName,omitempty"` + + // Id: An opaque ID of the table + Id string `json:"id,omitempty"` + + // Kind: The resource type. + Kind string `json:"kind,omitempty"` + + // TableReference: A reference uniquely identifying the table. + TableReference *TableReference `json:"tableReference,omitempty"` + + // Type: The type of table. Possible values are: TABLE, VIEW. + Type string `json:"type,omitempty"` +} + +type TableReference struct { + // DatasetId: [Required] ID of the dataset containing the table. + DatasetId string `json:"datasetId,omitempty"` + + // ProjectId: [Required] ID of the project billed for storage of the + // table. + ProjectId string `json:"projectId,omitempty"` + + // TableId: [Required] ID of the table. + TableId string `json:"tableId,omitempty"` +} + +type TableRow struct { + F []*TableCell `json:"f,omitempty"` +} + +type TableSchema struct { + // Fields: Describes the fields in a table. + Fields []*TableFieldSchema `json:"fields,omitempty"` +} + +type ViewDefinition struct { + // Query: [Required] A query that BigQuery executes when the view is + // referenced. + Query string `json:"query,omitempty"` +} + +// method id "bigquery.datasets.delete": + +type DatasetsDeleteCall struct { + s *Service + projectId string + datasetId string + opt_ map[string]interface{} +} + +// Delete: Deletes the dataset specified by the datasetId value. Before +// you can delete a dataset, you must delete all its tables, either +// manually or by specifying deleteContents. Immediately after deletion, +// you can create another dataset with the same name. +func (r *DatasetsService) Delete(projectId string, datasetId string) *DatasetsDeleteCall { + c := &DatasetsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + return c +} + +// DeleteContents sets the optional parameter "deleteContents": If True, +// delete all the tables in the dataset. If False and the dataset +// contains tables, the request will fail. Default is False +func (c *DatasetsDeleteCall) DeleteContents(deleteContents bool) *DatasetsDeleteCall { + c.opt_["deleteContents"] = deleteContents + return c +} + +func (c *DatasetsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["deleteContents"]; ok { + params.Set("deleteContents", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name.", + // "httpMethod": "DELETE", + // "id": "bigquery.datasets.delete", + // "parameterOrder": [ + // "projectId", + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Dataset ID of dataset being deleted", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "deleteContents": { + // "description": "If True, delete all the tables in the dataset. If False and the dataset contains tables, the request will fail. Default is False", + // "location": "query", + // "type": "boolean" + // }, + // "projectId": { + // "description": "Project ID of the dataset being deleted", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}", + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquery.datasets.get": + +type DatasetsGetCall struct { + s *Service + projectId string + datasetId string + opt_ map[string]interface{} +} + +// Get: Returns the dataset specified by datasetID. +func (r *DatasetsService) Get(projectId string, datasetId string) *DatasetsGetCall { + c := &DatasetsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + return c +} + +func (c *DatasetsGetCall) Do() (*Dataset, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Dataset) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the dataset specified by datasetID.", + // "httpMethod": "GET", + // "id": "bigquery.datasets.get", + // "parameterOrder": [ + // "projectId", + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Dataset ID of the requested dataset", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID of the requested dataset", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}", + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquery.datasets.insert": + +type DatasetsInsertCall struct { + s *Service + projectId string + dataset *Dataset + opt_ map[string]interface{} +} + +// Insert: Creates a new empty dataset. +func (r *DatasetsService) Insert(projectId string, dataset *Dataset) *DatasetsInsertCall { + c := &DatasetsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.dataset = dataset + return c +} + +func (c *DatasetsInsertCall) Do() (*Dataset, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Dataset) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new empty dataset.", + // "httpMethod": "POST", + // "id": "bigquery.datasets.insert", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "projectId": { + // "description": "Project ID of the new dataset", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets", + // "request": { + // "$ref": "Dataset" + // }, + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquery.datasets.list": + +type DatasetsListCall struct { + s *Service + projectId string + opt_ map[string]interface{} +} + +// List: Lists all the datasets in the specified project to which the +// caller has read access; however, a project owner can list (but not +// necessarily get) all datasets in his project. +func (r *DatasetsService) List(projectId string) *DatasetsListCall { + c := &DatasetsListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + return c +} + +// All sets the optional parameter "all": Whether to list all datasets, +// including hidden ones +func (c *DatasetsListCall) All(all bool) *DatasetsListCall { + c.opt_["all"] = all + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of results to return +func (c *DatasetsListCall) MaxResults(maxResults int64) *DatasetsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Page token, +// returned by a previous call, to request the next page of results +func (c *DatasetsListCall) PageToken(pageToken string) *DatasetsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *DatasetsListCall) Do() (*DatasetList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["all"]; ok { + params.Set("all", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DatasetList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all the datasets in the specified project to which the caller has read access; however, a project owner can list (but not necessarily get) all datasets in his project.", + // "httpMethod": "GET", + // "id": "bigquery.datasets.list", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "all": { + // "description": "Whether to list all datasets, including hidden ones", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of results to return", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Page token, returned by a previous call, to request the next page of results", + // "location": "query", + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID of the datasets to be listed", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets", + // "response": { + // "$ref": "DatasetList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquery.datasets.patch": + +type DatasetsPatchCall struct { + s *Service + projectId string + datasetId string + dataset *Dataset + opt_ map[string]interface{} +} + +// Patch: Updates information in an existing dataset. The update method +// replaces the entire dataset resource, whereas the patch method only +// replaces fields that are provided in the submitted dataset resource. +// This method supports patch semantics. +func (r *DatasetsService) Patch(projectId string, datasetId string, dataset *Dataset) *DatasetsPatchCall { + c := &DatasetsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + c.dataset = dataset + return c +} + +func (c *DatasetsPatchCall) Do() (*Dataset, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Dataset) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "bigquery.datasets.patch", + // "parameterOrder": [ + // "projectId", + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Dataset ID of the dataset being updated", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID of the dataset being updated", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}", + // "request": { + // "$ref": "Dataset" + // }, + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquery.datasets.update": + +type DatasetsUpdateCall struct { + s *Service + projectId string + datasetId string + dataset *Dataset + opt_ map[string]interface{} +} + +// Update: Updates information in an existing dataset. The update method +// replaces the entire dataset resource, whereas the patch method only +// replaces fields that are provided in the submitted dataset resource. +func (r *DatasetsService) Update(projectId string, datasetId string, dataset *Dataset) *DatasetsUpdateCall { + c := &DatasetsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + c.dataset = dataset + return c +} + +func (c *DatasetsUpdateCall) Do() (*Dataset, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Dataset) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource.", + // "httpMethod": "PUT", + // "id": "bigquery.datasets.update", + // "parameterOrder": [ + // "projectId", + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Dataset ID of the dataset being updated", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID of the dataset being updated", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}", + // "request": { + // "$ref": "Dataset" + // }, + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquery.jobs.get": + +type JobsGetCall struct { + s *Service + projectId string + jobId string + opt_ map[string]interface{} +} + +// Get: Retrieves the specified job by ID. +func (r *JobsService) Get(projectId string, jobId string) *JobsGetCall { + c := &JobsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.jobId = jobId + return c +} + +func (c *JobsGetCall) Do() (*Job, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/jobs/{jobId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{jobId}", url.QueryEscape(c.jobId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Job) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified job by ID.", + // "httpMethod": "GET", + // "id": "bigquery.jobs.get", + // "parameterOrder": [ + // "projectId", + // "jobId" + // ], + // "parameters": { + // "jobId": { + // "description": "Job ID of the requested job", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID of the requested job", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/jobs/{jobId}", + // "response": { + // "$ref": "Job" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquery.jobs.getQueryResults": + +type JobsGetQueryResultsCall struct { + s *Service + projectId string + jobId string + opt_ map[string]interface{} +} + +// GetQueryResults: Retrieves the results of a query job. +func (r *JobsService) GetQueryResults(projectId string, jobId string) *JobsGetQueryResultsCall { + c := &JobsGetQueryResultsCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.jobId = jobId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to read +func (c *JobsGetQueryResultsCall) MaxResults(maxResults int64) *JobsGetQueryResultsCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Page token, +// returned by a previous call, to request the next page of results +func (c *JobsGetQueryResultsCall) PageToken(pageToken string) *JobsGetQueryResultsCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartIndex sets the optional parameter "startIndex": Zero-based index +// of the starting row +func (c *JobsGetQueryResultsCall) StartIndex(startIndex uint64) *JobsGetQueryResultsCall { + c.opt_["startIndex"] = startIndex + return c +} + +// TimeoutMs sets the optional parameter "timeoutMs": How long to wait +// for the query to complete, in milliseconds, before returning. Default +// is to return immediately. If the timeout passes before the job +// completes, the request will fail with a TIMEOUT error +func (c *JobsGetQueryResultsCall) TimeoutMs(timeoutMs int64) *JobsGetQueryResultsCall { + c.opt_["timeoutMs"] = timeoutMs + return c +} + +func (c *JobsGetQueryResultsCall) Do() (*GetQueryResultsResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timeoutMs"]; ok { + params.Set("timeoutMs", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/queries/{jobId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{jobId}", url.QueryEscape(c.jobId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(GetQueryResultsResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the results of a query job.", + // "httpMethod": "GET", + // "id": "bigquery.jobs.getQueryResults", + // "parameterOrder": [ + // "projectId", + // "jobId" + // ], + // "parameters": { + // "jobId": { + // "description": "Job ID of the query job", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to read", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Page token, returned by a previous call, to request the next page of results", + // "location": "query", + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID of the query job", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Zero-based index of the starting row", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "timeoutMs": { + // "description": "How long to wait for the query to complete, in milliseconds, before returning. Default is to return immediately. If the timeout passes before the job completes, the request will fail with a TIMEOUT error", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // } + // }, + // "path": "projects/{projectId}/queries/{jobId}", + // "response": { + // "$ref": "GetQueryResultsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquery.jobs.insert": + +type JobsInsertCall struct { + s *Service + projectId string + job *Job + opt_ map[string]interface{} + media_ io.Reader +} + +// Insert: Starts a new asynchronous job. +func (r *JobsService) Insert(projectId string, job *Job) *JobsInsertCall { + c := &JobsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.job = job + return c +} +func (c *JobsInsertCall) Media(r io.Reader) *JobsInsertCall { + c.media_ = r + return c +} + +func (c *JobsInsertCall) Do() (*Job, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/jobs") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Job) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Starts a new asynchronous job.", + // "httpMethod": "POST", + // "id": "bigquery.jobs.insert", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/bigquery/v2/projects/{projectId}/jobs" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/bigquery/v2/projects/{projectId}/jobs" + // } + // } + // }, + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "projectId": { + // "description": "Project ID of the project that will be billed for the job", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/jobs", + // "request": { + // "$ref": "Job" + // }, + // "response": { + // "$ref": "Job" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "bigquery.jobs.list": + +type JobsListCall struct { + s *Service + projectId string + opt_ map[string]interface{} +} + +// List: Lists all the Jobs in the specified project that were started +// by the user. +func (r *JobsService) List(projectId string) *JobsListCall { + c := &JobsListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + return c +} + +// AllUsers sets the optional parameter "allUsers": Whether to display +// jobs owned by all users in the project. Default false +func (c *JobsListCall) AllUsers(allUsers bool) *JobsListCall { + c.opt_["allUsers"] = allUsers + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return +func (c *JobsListCall) MaxResults(maxResults int64) *JobsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Page token, +// returned by a previous call, to request the next page of results +func (c *JobsListCall) PageToken(pageToken string) *JobsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Projection sets the optional parameter "projection": Restrict +// information returned to a set of selected fields +func (c *JobsListCall) Projection(projection string) *JobsListCall { + c.opt_["projection"] = projection + return c +} + +// StateFilter sets the optional parameter "stateFilter": Filter for job +// state +func (c *JobsListCall) StateFilter(stateFilter string) *JobsListCall { + c.opt_["stateFilter"] = stateFilter + return c +} + +func (c *JobsListCall) Do() (*JobList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["allUsers"]; ok { + params.Set("allUsers", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["stateFilter"]; ok { + params.Set("stateFilter", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/jobs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(JobList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all the Jobs in the specified project that were started by the user.", + // "httpMethod": "GET", + // "id": "bigquery.jobs.list", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "allUsers": { + // "description": "Whether to display jobs owned by all users in the project. Default false", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "Maximum number of results to return", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Page token, returned by a previous call, to request the next page of results", + // "location": "query", + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID of the jobs to list", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "Restrict information returned to a set of selected fields", + // "enum": [ + // "full", + // "minimal" + // ], + // "enumDescriptions": [ + // "Includes all job data", + // "Does not include the job configuration" + // ], + // "location": "query", + // "type": "string" + // }, + // "stateFilter": { + // "description": "Filter for job state", + // "enum": [ + // "done", + // "pending", + // "running" + // ], + // "enumDescriptions": [ + // "Finished jobs", + // "Pending jobs", + // "Running jobs" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/jobs", + // "response": { + // "$ref": "JobList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquery.jobs.query": + +type JobsQueryCall struct { + s *Service + projectId string + queryrequest *QueryRequest + opt_ map[string]interface{} +} + +// Query: Runs a BigQuery SQL query synchronously and returns query +// results if the query completes within a specified timeout. +func (r *JobsService) Query(projectId string, queryrequest *QueryRequest) *JobsQueryCall { + c := &JobsQueryCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.queryrequest = queryrequest + return c +} + +func (c *JobsQueryCall) Do() (*QueryResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.queryrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/queries") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(QueryResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout.", + // "httpMethod": "POST", + // "id": "bigquery.jobs.query", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "projectId": { + // "description": "Project ID of the project billed for the query", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/queries", + // "request": { + // "$ref": "QueryRequest" + // }, + // "response": { + // "$ref": "QueryResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquery.projects.list": + +type ProjectsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Lists the projects to which you have at least read access. +func (r *ProjectsService) List() *ProjectsListCall { + c := &ProjectsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return +func (c *ProjectsListCall) MaxResults(maxResults int64) *ProjectsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Page token, +// returned by a previous call, to request the next page of results +func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ProjectsListCall) Do() (*ProjectList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ProjectList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the projects to which you have at least read access.", + // "httpMethod": "GET", + // "id": "bigquery.projects.list", + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Page token, returned by a previous call, to request the next page of results", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "projects", + // "response": { + // "$ref": "ProjectList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquery.tabledata.insertAll": + +type TabledataInsertAllCall struct { + s *Service + projectId string + datasetId string + tableId string + tabledatainsertallrequest *TableDataInsertAllRequest + opt_ map[string]interface{} +} + +// InsertAll: Inserts the supplied rows into the table. +func (r *TabledataService) InsertAll(projectId string, datasetId string, tableId string, tabledatainsertallrequest *TableDataInsertAllRequest) *TabledataInsertAllCall { + c := &TabledataInsertAllCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + c.tableId = tableId + c.tabledatainsertallrequest = tabledatainsertallrequest + return c +} + +func (c *TabledataInsertAllCall) Do() (*TableDataInsertAllResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.tabledatainsertallrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/insertAll") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{tableId}", url.QueryEscape(c.tableId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TableDataInsertAllResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts the supplied rows into the table.", + // "httpMethod": "POST", + // "id": "bigquery.tabledata.insertAll", + // "parameterOrder": [ + // "projectId", + // "datasetId", + // "tableId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Dataset ID of the destination table.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID of the destination table.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tableId": { + // "description": "Table ID of the destination table.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/insertAll", + // "request": { + // "$ref": "TableDataInsertAllRequest" + // }, + // "response": { + // "$ref": "TableDataInsertAllResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquery.tabledata.list": + +type TabledataListCall struct { + s *Service + projectId string + datasetId string + tableId string + opt_ map[string]interface{} +} + +// List: Retrieves table data from a specified set of rows. +func (r *TabledataService) List(projectId string, datasetId string, tableId string) *TabledataListCall { + c := &TabledataListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + c.tableId = tableId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return +func (c *TabledataListCall) MaxResults(maxResults int64) *TabledataListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Page token, +// returned by a previous call, identifying the result set +func (c *TabledataListCall) PageToken(pageToken string) *TabledataListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartIndex sets the optional parameter "startIndex": Zero-based index +// of the starting row to read +func (c *TabledataListCall) StartIndex(startIndex uint64) *TabledataListCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *TabledataListCall) Do() (*TableDataList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{tableId}", url.QueryEscape(c.tableId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TableDataList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves table data from a specified set of rows.", + // "httpMethod": "GET", + // "id": "bigquery.tabledata.list", + // "parameterOrder": [ + // "projectId", + // "datasetId", + // "tableId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Dataset ID of the table to read", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Page token, returned by a previous call, identifying the result set", + // "location": "query", + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID of the table to read", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "description": "Zero-based index of the starting row to read", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "tableId": { + // "description": "Table ID of the table to read", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data", + // "response": { + // "$ref": "TableDataList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquery.tables.delete": + +type TablesDeleteCall struct { + s *Service + projectId string + datasetId string + tableId string + opt_ map[string]interface{} +} + +// Delete: Deletes the table specified by tableId from the dataset. If +// the table contains data, all the data will be deleted. +func (r *TablesService) Delete(projectId string, datasetId string, tableId string) *TablesDeleteCall { + c := &TablesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + c.tableId = tableId + return c +} + +func (c *TablesDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables/{tableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{tableId}", url.QueryEscape(c.tableId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted.", + // "httpMethod": "DELETE", + // "id": "bigquery.tables.delete", + // "parameterOrder": [ + // "projectId", + // "datasetId", + // "tableId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Dataset ID of the table to delete", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID of the table to delete", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tableId": { + // "description": "Table ID of the table to delete", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquery.tables.get": + +type TablesGetCall struct { + s *Service + projectId string + datasetId string + tableId string + opt_ map[string]interface{} +} + +// Get: Gets the specified table resource by table ID. This method does +// not return the data in the table, it only returns the table resource, +// which describes the structure of this table. +func (r *TablesService) Get(projectId string, datasetId string, tableId string) *TablesGetCall { + c := &TablesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + c.tableId = tableId + return c +} + +func (c *TablesGetCall) Do() (*Table, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables/{tableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{tableId}", url.QueryEscape(c.tableId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Table) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.", + // "httpMethod": "GET", + // "id": "bigquery.tables.get", + // "parameterOrder": [ + // "projectId", + // "datasetId", + // "tableId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Dataset ID of the requested table", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID of the requested table", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tableId": { + // "description": "Table ID of the requested table", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquery.tables.insert": + +type TablesInsertCall struct { + s *Service + projectId string + datasetId string + table *Table + opt_ map[string]interface{} +} + +// Insert: Creates a new, empty table in the dataset. +func (r *TablesService) Insert(projectId string, datasetId string, table *Table) *TablesInsertCall { + c := &TablesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + c.table = table + return c +} + +func (c *TablesInsertCall) Do() (*Table, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.table) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Table) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new, empty table in the dataset.", + // "httpMethod": "POST", + // "id": "bigquery.tables.insert", + // "parameterOrder": [ + // "projectId", + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Dataset ID of the new table", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID of the new table", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}/tables", + // "request": { + // "$ref": "Table" + // }, + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquery.tables.list": + +type TablesListCall struct { + s *Service + projectId string + datasetId string + opt_ map[string]interface{} +} + +// List: Lists all tables in the specified dataset. +func (r *TablesService) List(projectId string, datasetId string) *TablesListCall { + c := &TablesListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return +func (c *TablesListCall) MaxResults(maxResults int64) *TablesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Page token, +// returned by a previous call, to request the next page of results +func (c *TablesListCall) PageToken(pageToken string) *TablesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *TablesListCall) Do() (*TableList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TableList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all tables in the specified dataset.", + // "httpMethod": "GET", + // "id": "bigquery.tables.list", + // "parameterOrder": [ + // "projectId", + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Dataset ID of the tables to list", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Page token, returned by a previous call, to request the next page of results", + // "location": "query", + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID of the tables to list", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}/tables", + // "response": { + // "$ref": "TableList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquery.tables.patch": + +type TablesPatchCall struct { + s *Service + projectId string + datasetId string + tableId string + table *Table + opt_ map[string]interface{} +} + +// Patch: Updates information in an existing table. The update method +// replaces the entire table resource, whereas the patch method only +// replaces fields that are provided in the submitted table resource. +// This method supports patch semantics. +func (r *TablesService) Patch(projectId string, datasetId string, tableId string, table *Table) *TablesPatchCall { + c := &TablesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + c.tableId = tableId + c.table = table + return c +} + +func (c *TablesPatchCall) Do() (*Table, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.table) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables/{tableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{tableId}", url.QueryEscape(c.tableId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Table) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "bigquery.tables.patch", + // "parameterOrder": [ + // "projectId", + // "datasetId", + // "tableId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Dataset ID of the table to update", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID of the table to update", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tableId": { + // "description": "Table ID of the table to update", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", + // "request": { + // "$ref": "Table" + // }, + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "bigquery.tables.update": + +type TablesUpdateCall struct { + s *Service + projectId string + datasetId string + tableId string + table *Table + opt_ map[string]interface{} +} + +// Update: Updates information in an existing table. The update method +// replaces the entire table resource, whereas the patch method only +// replaces fields that are provided in the submitted table resource. +func (r *TablesService) Update(projectId string, datasetId string, tableId string, table *Table) *TablesUpdateCall { + c := &TablesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + c.tableId = tableId + c.table = table + return c +} + +func (c *TablesUpdateCall) Do() (*Table, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.table) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables/{tableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{projectId}", url.QueryEscape(c.projectId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{tableId}", url.QueryEscape(c.tableId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Table) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource.", + // "httpMethod": "PUT", + // "id": "bigquery.tables.update", + // "parameterOrder": [ + // "projectId", + // "datasetId", + // "tableId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Dataset ID of the table to update", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID of the table to update", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tableId": { + // "description": "Table ID of the table to update", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", + // "request": { + // "$ref": "Table" + // }, + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/bigquery/v2beta1/bigquery-api.json b/third_party/src/code.google.com/p/google-api-go-client/bigquery/v2beta1/bigquery-api.json new file mode 100644 index 0000000000000..a8ede46af53a1 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/bigquery/v2beta1/bigquery-api.json @@ -0,0 +1,1466 @@ +{ + "kind": "discovery#restDescription", + "discoveryVersion": "v1", + "id": "bigquery:v2beta1", + "name": "bigquery", + "version": "v2beta1", + "revision": "20120507", + "title": "BigQuery API", + "description": "A data platform for customers to create, manage, share and query data.", + "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://code.google.com/apis/bigquery/docs/v2/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/bigquery/v2beta1/", + "basePath": "/bigquery/v2beta1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "bigquery/v2beta1/", + "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/bigquery": { + "description": "View and manage your data in Google BigQuery" + } + } + } + }, + "schemas": { + "Bigqueryfield": { + "id": "Bigqueryfield", + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "$ref": "Bigqueryfield" + } + }, + "mode": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "Bigqueryschema": { + "id": "Bigqueryschema", + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "$ref": "Bigqueryfield" + } + } + } + }, + "Dataset": { + "id": "Dataset", + "type": "object", + "properties": { + "access": { + "type": "array", + "description": "[Optional] Describes users' rights on the dataset. You can assign the same role to multiple users, and assign multiple roles to the same user.\nDefault values assigned to a new dataset are as follows: OWNER - Project owners, dataset creator READ - Project readers WRITE - Project writers\nSee ACLs and Rights for a description of these rights. If you specify any of these roles when creating a dataset, the assigned roles will overwrite the defaults listed above.\nTo revoke rights to a dataset, call datasets.update() and omit the names of anyone whose rights you wish to revoke. However, every dataset must have at least one entity granted OWNER role.\nEach access object can have only one of the following members: userByEmail, groupByEmail, domain, or allAuthenticatedUsers.", + "items": { + "type": "object", + "properties": { + "allAuthenticatedUsers": { + "type": "string", + "description": "[Pick one] If True, any authenticated user is granted the assigned role." + }, + "domain": { + "type": "string", + "description": "[Pick one] A domain to grant access to. Any users signed in with the domain specified will be granted the specified access. Example: \"example.com\"." + }, + "groupByEmail": { + "type": "string", + "description": "[Pick one] A fully-qualified email address of a mailing list to grant access to. This must be either a Google Groups mailing list (ends in @googlegroups.com) or a group managed by an enterprise version of Google Groups." + }, + "role": { + "type": "string", + "description": "[Required] Describes the rights granted to the user specified by the other member of the access object. The following string values are supported: READ - User can call any list() or get() method on any collection or resource. WRITE - User can call any method on any collection except for datasets, on which they can call list() and get(). OWNER - User can call any method. The dataset creator is granted this role by default." + }, + "specialGroup": { + "type": "string", + "description": "[Pick one] A special group to grant access to. The valid values are: projectOwners: Owners of the enclosing project. projectReaders: Readers of the enclosing project. projectWriters: Writers of the enclosing project." + }, + "userByEmail": { + "type": "string", + "description": "[Pick one] A fully qualified email address of a user to grant access to. For example: fred@example.com." + } + } + } + }, + "creationTime": { + "type": "string", + "description": "[Output only] The date when this dataset was created, in milliseconds since the epoch.", + "format": "int64" + }, + "datasetId": { + "type": "string", + "description": "[Deprecated -- overlaps with datasetRef] A unique ID for this dataset. Must a string of 1-1024 characters satisfying the regular expression [A-Za-z0-9_]." + }, + "datasetReference": { + "$ref": "Datasetreference", + "description": "[Required] Reference identifying dataset." + }, + "description": { + "type": "string", + "description": "[Optional] An arbitrary string description for the dataset. This might be shown in BigQuery UI for browsing the dataset." + }, + "friendlyName": { + "type": "string", + "description": "[Optional] A descriptive name for this dataset, which might be shown in any BigQuery user interfaces for browsing the dataset. Use datasetId for making API calls." + }, + "id": { + "type": "string", + "description": "[Output only] The fully-qualified unique name of this dataset in the format projectId:datasetId. The dataset name without the project name is given in the datasetId field. When creating a new dataset, leave this field blank, and instead specify the datasetId field." + }, + "kind": { + "type": "string", + "description": "[Output only] The resource type.", + "default": "bigquery#dataset" + }, + "lastModifiedTime": { + "type": "string", + "description": "[Output only] The date when this dataset or any of its tables was last modified, in milliseconds since the epoch.", + "format": "int64" + }, + "projectId": { + "type": "string", + "description": "[Deprecated -- overlaps with datasetRef]." + }, + "selfLink": { + "type": "string", + "description": "[Output only] An URL that can be used to access this resource again. You can use this URL in Get or Update requests to this resource. Not used as an input to helix." + } + } + }, + "DatasetList": { + "id": "DatasetList", + "type": "object", + "properties": { + "datasets": { + "type": "array", + "description": "An array of one or more summarized dataset resources. Absent when there are no datasets in the specified project.", + "items": { + "type": "object", + "properties": { + "datasetId": { + "type": "string", + "description": "[Deprecated] A unique ID for this dataset; this is the id values without the project name." + }, + "datasetReference": { + "$ref": "Datasetreference", + "description": "Reference identifying dataset." + }, + "friendlyName": { + "type": "string", + "description": "A descriptive name for this dataset, if one exists." + }, + "id": { + "type": "string", + "description": "The fully-qualified unique name of this dataset in the format projectId:datasetId." + }, + "projectId": { + "type": "string", + "description": "[Deprecated] The ID of the container project." + } + } + } + }, + "etag": { + "type": "string", + "description": "A hash of this page of results. See Paging Through Results in the developer's guide." + }, + "kind": { + "type": "string", + "description": "The resource type.", + "default": "bigquery#datasetList" + }, + "nextPageToken": { + "type": "string", + "description": "A token to request the next page of results. Present only when there is more than one page of results.* See Paging Through Results in the developer's guide." + } + } + }, + "Datasetreference": { + "id": "Datasetreference", + "type": "object", + "properties": { + "datasetId": { + "type": "string", + "description": "[Required] A unique ID for this dataset, without the project name." + }, + "projectId": { + "type": "string", + "description": "[Optional] The ID of the container project." + } + } + }, + "ErrorProto": { + "id": "ErrorProto", + "type": "object", + "properties": { + "arguments": { + "type": "array", + "items": { + "type": "string" + } + }, + "code": { + "type": "string" + }, + "debugInfo": { + "type": "string" + }, + "domain": { + "type": "string" + }, + "errorMessage": { + "type": "string" + }, + "location": { + "type": "string" + }, + "locationType": { + "type": "string" + } + } + }, + "Job": { + "id": "Job", + "type": "object", + "properties": { + "configuration": { + "$ref": "Jobconfiguration" + }, + "id": { + "type": "string" + }, + "jobId": { + "type": "string" + }, + "jobReference": { + "$ref": "Jobreference" + }, + "kind": { + "type": "string", + "default": "bigquery#job" + }, + "projectId": { + "type": "string" + }, + "selfLink": { + "type": "string" + }, + "statistics": { + "$ref": "Jobstatistics" + }, + "status": { + "$ref": "Jobstatus" + } + } + }, + "JobList": { + "id": "JobList", + "type": "object", + "properties": { + "etag": { + "type": "string" + }, + "jobs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "configuration": { + "$ref": "Jobconfiguration" + }, + "endTime": { + "type": "string", + "format": "int64" + }, + "errorResult": { + "$ref": "ErrorProto" + }, + "id": { + "type": "string" + }, + "jobId": { + "type": "string" + }, + "jobReference": { + "$ref": "Jobreference" + }, + "projectId": { + "type": "string" + }, + "startTime": { + "type": "string", + "format": "int64" + }, + "state": { + "type": "string" + }, + "statistics": { + "$ref": "Jobstatistics" + }, + "status": { + "$ref": "Jobstatus" + } + } + } + }, + "kind": { + "type": "string", + "default": "bigquery#jobList" + }, + "nextPageToken": { + "type": "string" + }, + "totalItems": { + "type": "integer", + "format": "int32" + } + } + }, + "JobQueryRequest": { + "id": "JobQueryRequest", + "type": "object", + "properties": { + "defaultDataset": { + "$ref": "Datasetreference", + "description": "[Optional] Specifies the default datasetId and projectId to assume for any unqualified table names in the query. If not set, all table names in the query string must be fully-qualified in the format projectId:datasetId.tableid." + }, + "destinationTable": { + "$ref": "Tablereference", + "description": "[Optional] Specifies the table the query results should be written to. The table will be created if it does not exist." + }, + "kind": { + "type": "string", + "default": "bigquery#jobQueryRequest" + }, + "maxResults": { + "type": "integer", + "description": "[Optional] The maximum number of results to return per page of results. If the response list exceeds the maximum response size for a single response, you will have to page through the results. Default is to return the maximum response size.", + "format": "uint32" + }, + "query": { + "type": "string", + "description": "[Required] A query string, following the BigQuery query syntax of the query to execute. Table names should be qualified by dataset name in the format projectId:datasetId.tableId unless you specify the defaultDataset value. If the table is in the same project as the job, you can omit the project ID. Example: SELECT f1 FROM myProjectId:myDatasetId.myTableId." + } + } + }, + "JobStopResponse": { + "id": "JobStopResponse", + "type": "object", + "properties": { + "job": { + "type": "any" + }, + "kind": { + "type": "string", + "default": "bigquery#jobStopResponse" + } + } + }, + "Jobconfiguration": { + "id": "Jobconfiguration", + "type": "object", + "properties": { + "extract": { + "$ref": "Jobconfigurationextract" + }, + "link": { + "$ref": "Jobconfigurationlink" + }, + "load": { + "$ref": "Jobconfigurationload" + }, + "properties": { + "$ref": "Jobconfigurationproperties" + }, + "query": { + "$ref": "Jobconfigurationquery" + } + } + }, + "Jobconfigurationextract": { + "id": "Jobconfigurationextract", + "type": "object", + "properties": { + "destinationUri": { + "type": "string" + }, + "sourceTable": { + "$ref": "Tablereference" + } + } + }, + "Jobconfigurationlink": { + "id": "Jobconfigurationlink", + "type": "object", + "properties": { + "createDisposition": { + "type": "string" + }, + "destinationTable": { + "$ref": "Tablereference" + }, + "sourceUri": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Jobconfigurationload": { + "id": "Jobconfigurationload", + "type": "object", + "properties": { + "createDisposition": { + "type": "string" + }, + "destinationTable": { + "$ref": "Tablereference" + }, + "fieldDelimiter": { + "type": "string" + }, + "schema": { + "$ref": "Bigqueryschema" + }, + "skipLeadingRows": { + "type": "integer", + "format": "int32" + }, + "sourceUris": { + "type": "array", + "items": { + "type": "string" + } + }, + "writeDisposition": { + "type": "string" + } + } + }, + "Jobconfigurationproperties": { + "id": "Jobconfigurationproperties", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Jobconfigurationquery": { + "id": "Jobconfigurationquery", + "type": "object", + "properties": { + "createDisposition": { + "type": "string" + }, + "defaultDataset": { + "$ref": "Datasetreference" + }, + "destinationTable": { + "$ref": "Tablereference" + }, + "query": { + "type": "string" + }, + "writeDisposition": { + "type": "string" + } + } + }, + "Jobreference": { + "id": "Jobreference", + "type": "object", + "properties": { + "jobId": { + "type": "string" + }, + "projectId": { + "type": "string" + } + } + }, + "Jobstatistics": { + "id": "Jobstatistics", + "type": "object", + "properties": { + "endTime": { + "type": "string", + "format": "int64" + }, + "startTime": { + "type": "string", + "format": "int64" + } + } + }, + "Jobstatus": { + "id": "Jobstatus", + "type": "object", + "properties": { + "errorResult": { + "$ref": "ErrorProto" + }, + "errors": { + "type": "array", + "items": { + "$ref": "ErrorProto" + } + }, + "state": { + "type": "string" + } + } + }, + "ProjectList": { + "id": "ProjectList", + "type": "object", + "properties": { + "etag": { + "type": "string" + }, + "kind": { + "type": "string", + "default": "bigquery#projectList" + }, + "nextPageToken": { + "type": "string" + }, + "projects": { + "type": "array", + "items": { + "type": "object", + "properties": { + "friendlyName": { + "type": "string" + }, + "id": { + "type": "string" + }, + "projectReference": { + "$ref": "Projectreference" + } + } + } + }, + "totalItems": { + "type": "integer", + "format": "int32" + } + } + }, + "Projectreference": { + "id": "Projectreference", + "type": "object", + "properties": { + "projectId": { + "type": "string" + } + } + }, + "QueryResults": { + "id": "QueryResults", + "type": "object", + "properties": { + "job": { + "$ref": "Job" + }, + "kind": { + "type": "string", + "default": "bigquery#queryResults" + }, + "rows": { + "type": "array", + "items": { + "type": "object", + "properties": { + "f": { + "type": "array", + "items": { + "type": "object", + "properties": { + "v": { + "type": "any" + } + } + } + } + } + } + }, + "schema": { + "$ref": "Bigqueryschema" + }, + "totalRows": { + "type": "string", + "format": "uint64" + } + } + }, + "Table": { + "id": "Table", + "type": "object", + "properties": { + "creationTime": { + "type": "string", + "format": "int64" + }, + "datasetId": { + "type": "string" + }, + "description": { + "type": "string" + }, + "friendlyName": { + "type": "string" + }, + "id": { + "type": "string" + }, + "kind": { + "type": "string", + "default": "bigquery#table" + }, + "lastModifiedTime": { + "type": "string", + "format": "int64" + }, + "projectId": { + "type": "string" + }, + "schema": { + "$ref": "Bigqueryschema" + }, + "selfLink": { + "type": "string" + }, + "tableId": { + "type": "string" + }, + "tableReference": { + "$ref": "Tablereference" + } + } + }, + "TableDataList": { + "id": "TableDataList", + "type": "object", + "properties": { + "kind": { + "type": "string", + "default": "bigquery#tableDataList" + }, + "rows": { + "type": "array", + "items": { + "type": "object", + "properties": { + "f": { + "type": "array", + "items": { + "type": "object", + "properties": { + "v": { + "type": "any" + } + } + } + } + } + } + }, + "totalRows": { + "type": "string", + "format": "int64" + } + } + }, + "TableList": { + "id": "TableList", + "type": "object", + "properties": { + "etag": { + "type": "string" + }, + "kind": { + "type": "string", + "default": "bigquery#tableList" + }, + "nextPageToken": { + "type": "string" + }, + "tables": { + "type": "array", + "items": { + "type": "object", + "properties": { + "datasetId": { + "type": "string" + }, + "friendlyName": { + "type": "string" + }, + "id": { + "type": "string" + }, + "projectId": { + "type": "string" + }, + "tableId": { + "type": "string" + }, + "tableReference": { + "$ref": "Tablereference" + } + } + } + }, + "totalItems": { + "type": "integer", + "format": "int32" + } + } + }, + "Tablereference": { + "id": "Tablereference", + "type": "object", + "properties": { + "datasetId": { + "type": "string" + }, + "projectId": { + "type": "string" + }, + "tableId": { + "type": "string" + } + } + } + }, + "resources": { + "datasets": { + "methods": { + "delete": { + "id": "bigquery.datasets.delete", + "path": "projects/{projectId}/datasets/{datasetId}", + "httpMethod": "DELETE", + "description": "Deletes the dataset specified by datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Dataset identifier of dataset being deleted.", + "required": true, + "location": "path" + }, + "deleteContents": { + "type": "boolean", + "description": "[Optional] If True, delete all the tables in the dataset. If False and the dataset contains tables, the request will fail. Default is False.", + "location": "query" + }, + "projectId": { + "type": "string", + "description": "Project identifier of dataset being deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId" + ], + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ] + }, + "get": { + "id": "bigquery.datasets.get", + "path": "projects/{projectId}/datasets/{datasetId}", + "httpMethod": "GET", + "description": "Returns the dataset specified by datasetID.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Dataset identifier of the dataset requested.", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project identifier containing dataset requested.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId" + ], + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ] + }, + "insert": { + "id": "bigquery.datasets.insert", + "path": "projects/{projectId}/datasets", + "httpMethod": "POST", + "description": "Creates a new empty dataset.", + "parameters": { + "projectId": { + "type": "string", + "description": "Project identifier that will contain dataset being created.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "request": { + "$ref": "Dataset" + }, + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ] + }, + "list": { + "id": "bigquery.datasets.list", + "path": "projects/{projectId}/datasets", + "httpMethod": "GET", + "description": "Lists all the datasets in the specified project to which the caller has read access; however, a project owner can list (but not necessarily get) all datasets in his project.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "[Optional] The maximum number of rows to return. If not specified, it will return up to the maximum amount of data that will fit in a reply.", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "[Optional] A page token used when requesting a specific page in a set of paged results.", + "location": "query" + }, + "projectId": { + "type": "string", + "description": "Project identifier containing datasets to be listed.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "DatasetList" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ] + }, + "patch": { + "id": "bigquery.datasets.patch", + "path": "projects/{projectId}/datasets/{datasetId}", + "httpMethod": "PATCH", + "description": "Updates information in an existing dataset, specified by datasetId. Properties not included in the submitted resource will not be changed. If you include the access property without any values assigned, the request will fail as you must specify at least one owner for a dataset. This method supports patch semantics.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Dataset identifier containing dataset being updated.", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project identifier containing dataset being updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId" + ], + "request": { + "$ref": "Dataset" + }, + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ] + }, + "update": { + "id": "bigquery.datasets.update", + "path": "projects/{projectId}/datasets/{datasetId}", + "httpMethod": "PUT", + "description": "Updates information in an existing dataset, specified by datasetId. Properties not included in the submitted resource will not be changed. If you include the access property without any values assigned, the request will fail as you must specify at least one owner for a dataset.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Dataset identifier containing dataset being updated.", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project identifier containing dataset being updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId" + ], + "request": { + "$ref": "Dataset" + }, + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ] + } + } + }, + "jobs": { + "methods": { + "get": { + "id": "bigquery.jobs.get", + "path": "projects/{projectId}/jobs/{jobId}", + "httpMethod": "GET", + "parameters": { + "jobId": { + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "response": { + "$ref": "Job" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ] + }, + "insert": { + "id": "bigquery.jobs.insert", + "path": "projects/{projectId}/jobs", + "httpMethod": "POST", + "parameters": { + "projectId": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "request": { + "$ref": "Job" + }, + "response": { + "$ref": "Job" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ], + "mediaUpload": { + "accept": [ + "application/octet-stream" + ], + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/bigquery/v2beta1/projects/{projectId}/jobs" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/bigquery/v2beta1/projects/{projectId}/jobs" + } + } + } + }, + "list": { + "id": "bigquery.jobs.list", + "path": "projects/{projectId}/jobs", + "httpMethod": "GET", + "parameters": { + "allUsers": { + "type": "boolean", + "description": "Whether to display jobs owned by all users in the project", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "maximum number of results to return", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "location": "query" + }, + "projectId": { + "type": "string", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "Restrict information returned to a set of selected fields.", + "enum": [ + "full", + "minimal" + ], + "enumDescriptions": [ + "Includes all job data.", + "Does not include the job configuration." + ], + "location": "query" + }, + "startIndex": { + "type": "integer", + "description": "start index for paginated results", + "format": "uint32", + "location": "query" + }, + "stateFilter": { + "type": "string", + "description": "filter for job state", + "enum": [ + "done", + "pending", + "running" + ], + "enumDescriptions": [ + "finished jobs", + "pending jobs", + "running jobs" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "JobList" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ] + }, + "query": { + "id": "bigquery.jobs.query", + "path": "projects/{projectId}/queries", + "httpMethod": "POST", + "parameters": { + "projectId": { + "type": "string", + "description": "project name billed for the query", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "request": { + "$ref": "JobQueryRequest" + }, + "response": { + "$ref": "QueryResults" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ] + }, + "stop": { + "id": "bigquery.jobs.stop", + "path": "project/{projectId}/jobs/{jobId}/stop", + "httpMethod": "POST", + "parameters": { + "jobId": { + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "response": { + "$ref": "JobStopResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ] + } + } + }, + "projects": { + "methods": { + "list": { + "id": "bigquery.projects.list", + "path": "projects", + "httpMethod": "GET", + "parameters": { + "maxResults": { + "type": "integer", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "location": "query" + } + }, + "response": { + "$ref": "ProjectList" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ] + } + } + }, + "tabledata": { + "methods": { + "list": { + "id": "bigquery.tabledata.list", + "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data", + "httpMethod": "GET", + "parameters": { + "datasetId": { + "type": "string", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "format": "uint32", + "location": "query" + }, + "projectId": { + "type": "string", + "required": true, + "location": "path" + }, + "startIndex": { + "type": "string", + "format": "uint64", + "location": "query" + }, + "tableId": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId", + "tableId" + ], + "response": { + "$ref": "TableDataList" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ] + } + } + }, + "tables": { + "methods": { + "delete": { + "id": "bigquery.tables.delete", + "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", + "httpMethod": "DELETE", + "parameters": { + "datasetId": { + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "required": true, + "location": "path" + }, + "tableId": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId", + "tableId" + ], + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ] + }, + "get": { + "id": "bigquery.tables.get", + "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", + "httpMethod": "GET", + "parameters": { + "datasetId": { + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "required": true, + "location": "path" + }, + "tableId": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId", + "tableId" + ], + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ] + }, + "insert": { + "id": "bigquery.tables.insert", + "path": "projects/{projectId}/datasets/{datasetId}/tables", + "httpMethod": "POST", + "parameters": { + "datasetId": { + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId" + ], + "request": { + "$ref": "Table" + }, + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ] + }, + "list": { + "id": "bigquery.tables.list", + "path": "projects/{projectId}/datasets/{datasetId}/tables", + "httpMethod": "GET", + "parameters": { + "datasetId": { + "type": "string", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "location": "query" + }, + "projectId": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId" + ], + "response": { + "$ref": "TableList" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ] + }, + "patch": { + "id": "bigquery.tables.patch", + "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", + "httpMethod": "PATCH", + "parameters": { + "datasetId": { + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "required": true, + "location": "path" + }, + "tableId": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId", + "tableId" + ], + "request": { + "$ref": "Table" + }, + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ] + }, + "update": { + "id": "bigquery.tables.update", + "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", + "httpMethod": "PUT", + "parameters": { + "datasetId": { + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "required": true, + "location": "path" + }, + "tableId": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "datasetId", + "tableId" + ], + "request": { + "$ref": "Table" + }, + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/bigquery/v2beta1/bigquery-gen.go b/third_party/src/code.google.com/p/google-api-go-client/bigquery/v2beta1/bigquery-gen.go new file mode 100644 index 0000000000000..8431456534b91 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/bigquery/v2beta1/bigquery-gen.go @@ -0,0 +1,2223 @@ +// Package bigquery provides access to the BigQuery API. +// +// See https://code.google.com/apis/bigquery/docs/v2/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/bigquery/v2beta1" +// ... +// bigqueryService, err := bigquery.New(oauthHttpClient) +package bigquery + +import ( + "bytes" + "fmt" + "net/http" + "io" + "encoding/json" + "errors" + "strings" + "strconv" + "net/url" + "code.google.com/p/google-api-go-client/googleapi" +) + +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New + +const apiId = "bigquery:v2beta1" +const apiName = "bigquery" +const apiVersion = "v2beta1" +const basePath = "https://www.googleapis.com/bigquery/v2beta1/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your data in Google BigQuery + BigqueryScope = "https://www.googleapis.com/auth/bigquery" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client} + s.Datasets = &DatasetsService{s: s} + s.Jobs = &JobsService{s: s} + s.Projects = &ProjectsService{s: s} + s.Tabledata = &TabledataService{s: s} + s.Tables = &TablesService{s: s} + return s, nil +} + +type Service struct { + client *http.Client + + Datasets *DatasetsService + + Jobs *JobsService + + Projects *ProjectsService + + Tabledata *TabledataService + + Tables *TablesService +} + +type DatasetsService struct { + s *Service +} + +type JobsService struct { + s *Service +} + +type ProjectsService struct { + s *Service +} + +type TabledataService struct { + s *Service +} + +type TablesService struct { + s *Service +} + +type Bigqueryfield struct { + Fields []*Bigqueryfield `json:"fields,omitempty"` + + Mode string `json:"mode,omitempty"` + + Name string `json:"name,omitempty"` + + Type string `json:"type,omitempty"` +} + +type Bigqueryschema struct { + Fields []*Bigqueryfield `json:"fields,omitempty"` +} + +type Dataset struct { + // Access: [Optional] Describes users' rights on the dataset. You can + // assign the same role to multiple users, and assign multiple roles to + // the same user. + // Default values assigned to a new dataset are as + // follows: OWNER - Project owners, dataset creator READ - Project + // readers WRITE - Project writers + // See ACLs and Rights for a description + // of these rights. If you specify any of these roles when creating a + // dataset, the assigned roles will overwrite the defaults listed + // above. + // To revoke rights to a dataset, call datasets.update() and omit + // the names of anyone whose rights you wish to revoke. However, every + // dataset must have at least one entity granted OWNER role. + // Each access + // object can have only one of the following members: userByEmail, + // groupByEmail, domain, or allAuthenticatedUsers. + Access []*DatasetAccess `json:"access,omitempty"` + + // CreationTime: [Output only] The date when this dataset was created, + // in milliseconds since the epoch. + CreationTime int64 `json:"creationTime,omitempty,string"` + + // DatasetId: [Deprecated -- overlaps with datasetRef] A unique ID for + // this dataset. Must a string of 1-1024 characters satisfying the + // regular expression [A-Za-z0-9_]. + DatasetId string `json:"datasetId,omitempty"` + + // DatasetReference: [Required] Reference identifying dataset. + DatasetReference *Datasetreference `json:"datasetReference,omitempty"` + + // Description: [Optional] An arbitrary string description for the + // dataset. This might be shown in BigQuery UI for browsing the dataset. + Description string `json:"description,omitempty"` + + // FriendlyName: [Optional] A descriptive name for this dataset, which + // might be shown in any BigQuery user interfaces for browsing the + // dataset. Use datasetId for making API calls. + FriendlyName string `json:"friendlyName,omitempty"` + + // Id: [Output only] The fully-qualified unique name of this dataset in + // the format projectId:datasetId. The dataset name without the project + // name is given in the datasetId field. When creating a new dataset, + // leave this field blank, and instead specify the datasetId field. + Id string `json:"id,omitempty"` + + // Kind: [Output only] The resource type. + Kind string `json:"kind,omitempty"` + + // LastModifiedTime: [Output only] The date when this dataset or any of + // its tables was last modified, in milliseconds since the epoch. + LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"` + + // ProjectId: [Deprecated -- overlaps with datasetRef]. + ProjectId string `json:"projectId,omitempty"` + + // SelfLink: [Output only] An URL that can be used to access this + // resource again. You can use this URL in Get or Update requests to + // this resource. Not used as an input to helix. + SelfLink string `json:"selfLink,omitempty"` +} + +type DatasetAccess struct { + // AllAuthenticatedUsers: [Pick one] If True, any authenticated user is + // granted the assigned role. + AllAuthenticatedUsers string `json:"allAuthenticatedUsers,omitempty"` + + // Domain: [Pick one] A domain to grant access to. Any users signed in + // with the domain specified will be granted the specified access. + // Example: "example.com". + Domain string `json:"domain,omitempty"` + + // GroupByEmail: [Pick one] A fully-qualified email address of a mailing + // list to grant access to. This must be either a Google Groups mailing + // list (ends in @googlegroups.com) or a group managed by an enterprise + // version of Google Groups. + GroupByEmail string `json:"groupByEmail,omitempty"` + + // Role: [Required] Describes the rights granted to the user specified + // by the other member of the access object. The following string values + // are supported: READ - User can call any list() or get() method on any + // collection or resource. WRITE - User can call any method on any + // collection except for datasets, on which they can call list() and + // get(). OWNER - User can call any method. The dataset creator is + // granted this role by default. + Role string `json:"role,omitempty"` + + // SpecialGroup: [Pick one] A special group to grant access to. The + // valid values are: projectOwners: Owners of the enclosing project. + // projectReaders: Readers of the enclosing project. projectWriters: + // Writers of the enclosing project. + SpecialGroup string `json:"specialGroup,omitempty"` + + // UserByEmail: [Pick one] A fully qualified email address of a user to + // grant access to. For example: fred@example.com. + UserByEmail string `json:"userByEmail,omitempty"` +} + +type DatasetList struct { + // Datasets: An array of one or more summarized dataset resources. + // Absent when there are no datasets in the specified project. + Datasets []*DatasetListDatasets `json:"datasets,omitempty"` + + // Etag: A hash of this page of results. See Paging Through Results in + // the developer's guide. + Etag string `json:"etag,omitempty"` + + // Kind: The resource type. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token to request the next page of results. Present + // only when there is more than one page of results.* See Paging Through + // Results in the developer's guide. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type DatasetListDatasets struct { + // DatasetId: [Deprecated] A unique ID for this dataset; this is the id + // values without the project name. + DatasetId string `json:"datasetId,omitempty"` + + // DatasetReference: Reference identifying dataset. + DatasetReference *Datasetreference `json:"datasetReference,omitempty"` + + // FriendlyName: A descriptive name for this dataset, if one exists. + FriendlyName string `json:"friendlyName,omitempty"` + + // Id: The fully-qualified unique name of this dataset in the format + // projectId:datasetId. + Id string `json:"id,omitempty"` + + // ProjectId: [Deprecated] The ID of the container project. + ProjectId string `json:"projectId,omitempty"` +} + +type Datasetreference struct { + // DatasetId: [Required] A unique ID for this dataset, without the + // project name. + DatasetId string `json:"datasetId,omitempty"` + + // ProjectId: [Optional] The ID of the container project. + ProjectId string `json:"projectId,omitempty"` +} + +type ErrorProto struct { + Arguments []string `json:"arguments,omitempty"` + + Code string `json:"code,omitempty"` + + DebugInfo string `json:"debugInfo,omitempty"` + + Domain string `json:"domain,omitempty"` + + ErrorMessage string `json:"errorMessage,omitempty"` + + Location string `json:"location,omitempty"` + + LocationType string `json:"locationType,omitempty"` +} + +type Job struct { + Configuration *Jobconfiguration `json:"configuration,omitempty"` + + Id string `json:"id,omitempty"` + + JobId string `json:"jobId,omitempty"` + + JobReference *Jobreference `json:"jobReference,omitempty"` + + Kind string `json:"kind,omitempty"` + + ProjectId string `json:"projectId,omitempty"` + + SelfLink string `json:"selfLink,omitempty"` + + Statistics *Jobstatistics `json:"statistics,omitempty"` + + Status *Jobstatus `json:"status,omitempty"` +} + +type JobList struct { + Etag string `json:"etag,omitempty"` + + Jobs []*JobListJobs `json:"jobs,omitempty"` + + Kind string `json:"kind,omitempty"` + + NextPageToken string `json:"nextPageToken,omitempty"` + + TotalItems int64 `json:"totalItems,omitempty"` +} + +type JobListJobs struct { + Configuration *Jobconfiguration `json:"configuration,omitempty"` + + EndTime int64 `json:"endTime,omitempty,string"` + + ErrorResult *ErrorProto `json:"errorResult,omitempty"` + + Id string `json:"id,omitempty"` + + JobId string `json:"jobId,omitempty"` + + JobReference *Jobreference `json:"jobReference,omitempty"` + + ProjectId string `json:"projectId,omitempty"` + + StartTime int64 `json:"startTime,omitempty,string"` + + State string `json:"state,omitempty"` + + Statistics *Jobstatistics `json:"statistics,omitempty"` + + Status *Jobstatus `json:"status,omitempty"` +} + +type JobQueryRequest struct { + // DefaultDataset: [Optional] Specifies the default datasetId and + // projectId to assume for any unqualified table names in the query. If + // not set, all table names in the query string must be fully-qualified + // in the format projectId:datasetId.tableid. + DefaultDataset *Datasetreference `json:"defaultDataset,omitempty"` + + // DestinationTable: [Optional] Specifies the table the query results + // should be written to. The table will be created if it does not exist. + DestinationTable *Tablereference `json:"destinationTable,omitempty"` + + Kind string `json:"kind,omitempty"` + + // MaxResults: [Optional] The maximum number of results to return per + // page of results. If the response list exceeds the maximum response + // size for a single response, you will have to page through the + // results. Default is to return the maximum response size. + MaxResults int64 `json:"maxResults,omitempty"` + + // Query: [Required] A query string, following the BigQuery query syntax + // of the query to execute. Table names should be qualified by dataset + // name in the format projectId:datasetId.tableId unless you specify the + // defaultDataset value. If the table is in the same project as the job, + // you can omit the project ID. Example: SELECT f1 FROM + // myProjectId:myDatasetId.myTableId. + Query string `json:"query,omitempty"` +} + +type JobStopResponse struct { + Job interface{} `json:"job,omitempty"` + + Kind string `json:"kind,omitempty"` +} + +type Jobconfiguration struct { + Extract *Jobconfigurationextract `json:"extract,omitempty"` + + Link *Jobconfigurationlink `json:"link,omitempty"` + + Load *Jobconfigurationload `json:"load,omitempty"` + + Properties *Jobconfigurationproperties `json:"properties,omitempty"` + + Query *Jobconfigurationquery `json:"query,omitempty"` +} + +type Jobconfigurationextract struct { + DestinationUri string `json:"destinationUri,omitempty"` + + SourceTable *Tablereference `json:"sourceTable,omitempty"` +} + +type Jobconfigurationlink struct { + CreateDisposition string `json:"createDisposition,omitempty"` + + DestinationTable *Tablereference `json:"destinationTable,omitempty"` + + SourceUri []string `json:"sourceUri,omitempty"` +} + +type Jobconfigurationload struct { + CreateDisposition string `json:"createDisposition,omitempty"` + + DestinationTable *Tablereference `json:"destinationTable,omitempty"` + + FieldDelimiter string `json:"fieldDelimiter,omitempty"` + + Schema *Bigqueryschema `json:"schema,omitempty"` + + SkipLeadingRows int64 `json:"skipLeadingRows,omitempty"` + + SourceUris []string `json:"sourceUris,omitempty"` + + WriteDisposition string `json:"writeDisposition,omitempty"` +} + +type Jobconfigurationproperties struct { +} + +type Jobconfigurationquery struct { + CreateDisposition string `json:"createDisposition,omitempty"` + + DefaultDataset *Datasetreference `json:"defaultDataset,omitempty"` + + DestinationTable *Tablereference `json:"destinationTable,omitempty"` + + Query string `json:"query,omitempty"` + + WriteDisposition string `json:"writeDisposition,omitempty"` +} + +type Jobreference struct { + JobId string `json:"jobId,omitempty"` + + ProjectId string `json:"projectId,omitempty"` +} + +type Jobstatistics struct { + EndTime int64 `json:"endTime,omitempty,string"` + + StartTime int64 `json:"startTime,omitempty,string"` +} + +type Jobstatus struct { + ErrorResult *ErrorProto `json:"errorResult,omitempty"` + + Errors []*ErrorProto `json:"errors,omitempty"` + + State string `json:"state,omitempty"` +} + +type ProjectList struct { + Etag string `json:"etag,omitempty"` + + Kind string `json:"kind,omitempty"` + + NextPageToken string `json:"nextPageToken,omitempty"` + + Projects []*ProjectListProjects `json:"projects,omitempty"` + + TotalItems int64 `json:"totalItems,omitempty"` +} + +type ProjectListProjects struct { + FriendlyName string `json:"friendlyName,omitempty"` + + Id string `json:"id,omitempty"` + + ProjectReference *Projectreference `json:"projectReference,omitempty"` +} + +type Projectreference struct { + ProjectId string `json:"projectId,omitempty"` +} + +type QueryResults struct { + Job *Job `json:"job,omitempty"` + + Kind string `json:"kind,omitempty"` + + Rows []*QueryResultsRows `json:"rows,omitempty"` + + Schema *Bigqueryschema `json:"schema,omitempty"` + + TotalRows uint64 `json:"totalRows,omitempty,string"` +} + +type QueryResultsRows struct { + F []*QueryResultsRowsF `json:"f,omitempty"` +} + +type QueryResultsRowsF struct { + V interface{} `json:"v,omitempty"` +} + +type Table struct { + CreationTime int64 `json:"creationTime,omitempty,string"` + + DatasetId string `json:"datasetId,omitempty"` + + Description string `json:"description,omitempty"` + + FriendlyName string `json:"friendlyName,omitempty"` + + Id string `json:"id,omitempty"` + + Kind string `json:"kind,omitempty"` + + LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"` + + ProjectId string `json:"projectId,omitempty"` + + Schema *Bigqueryschema `json:"schema,omitempty"` + + SelfLink string `json:"selfLink,omitempty"` + + TableId string `json:"tableId,omitempty"` + + TableReference *Tablereference `json:"tableReference,omitempty"` +} + +type TableDataList struct { + Kind string `json:"kind,omitempty"` + + Rows []*TableDataListRows `json:"rows,omitempty"` + + TotalRows int64 `json:"totalRows,omitempty,string"` +} + +type TableDataListRows struct { + F []*TableDataListRowsF `json:"f,omitempty"` +} + +type TableDataListRowsF struct { + V interface{} `json:"v,omitempty"` +} + +type TableList struct { + Etag string `json:"etag,omitempty"` + + Kind string `json:"kind,omitempty"` + + NextPageToken string `json:"nextPageToken,omitempty"` + + Tables []*TableListTables `json:"tables,omitempty"` + + TotalItems int64 `json:"totalItems,omitempty"` +} + +type TableListTables struct { + DatasetId string `json:"datasetId,omitempty"` + + FriendlyName string `json:"friendlyName,omitempty"` + + Id string `json:"id,omitempty"` + + ProjectId string `json:"projectId,omitempty"` + + TableId string `json:"tableId,omitempty"` + + TableReference *Tablereference `json:"tableReference,omitempty"` +} + +type Tablereference struct { + DatasetId string `json:"datasetId,omitempty"` + + ProjectId string `json:"projectId,omitempty"` + + TableId string `json:"tableId,omitempty"` +} + +// method id "bigquery.datasets.delete": + +type DatasetsDeleteCall struct { + s *Service + projectId string + datasetId string + opt_ map[string]interface{} +} + +// Delete: Deletes the dataset specified by datasetId value. Before you +// can delete a dataset, you must delete all its tables, either manually +// or by specifying deleteContents. Immediately after deletion, you can +// create another dataset with the same name. +func (r *DatasetsService) Delete(projectId string, datasetId string) *DatasetsDeleteCall { + c := &DatasetsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + return c +} + +// DeleteContents sets the optional parameter "deleteContents": +// [Optional] If True, delete all the tables in the dataset. If False +// and the dataset contains tables, the request will fail. Default is +// False. +func (c *DatasetsDeleteCall) DeleteContents(deleteContents bool) *DatasetsDeleteCall { + c.opt_["deleteContents"] = deleteContents + return c +} + +func (c *DatasetsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["deleteContents"]; ok { + params.Set("deleteContents", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "projects/{projectId}/datasets/{datasetId}") + urls = strings.Replace(urls, "{projectId}", cleanPathString(c.projectId), 1) + urls = strings.Replace(urls, "{datasetId}", cleanPathString(c.datasetId), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the dataset specified by datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name.", + // "httpMethod": "DELETE", + // "id": "bigquery.datasets.delete", + // "parameterOrder": [ + // "projectId", + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Dataset identifier of dataset being deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "deleteContents": { + // "description": "[Optional] If True, delete all the tables in the dataset. If False and the dataset contains tables, the request will fail. Default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "projectId": { + // "description": "Project identifier of dataset being deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}", + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +// method id "bigquery.datasets.get": + +type DatasetsGetCall struct { + s *Service + projectId string + datasetId string + opt_ map[string]interface{} +} + +// Get: Returns the dataset specified by datasetID. +func (r *DatasetsService) Get(projectId string, datasetId string) *DatasetsGetCall { + c := &DatasetsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + return c +} + +func (c *DatasetsGetCall) Do() (*Dataset, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "projects/{projectId}/datasets/{datasetId}") + urls = strings.Replace(urls, "{projectId}", cleanPathString(c.projectId), 1) + urls = strings.Replace(urls, "{datasetId}", cleanPathString(c.datasetId), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Dataset) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the dataset specified by datasetID.", + // "httpMethod": "GET", + // "id": "bigquery.datasets.get", + // "parameterOrder": [ + // "projectId", + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Dataset identifier of the dataset requested.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project identifier containing dataset requested.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}", + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +// method id "bigquery.datasets.insert": + +type DatasetsInsertCall struct { + s *Service + projectId string + dataset *Dataset + opt_ map[string]interface{} +} + +// Insert: Creates a new empty dataset. +func (r *DatasetsService) Insert(projectId string, dataset *Dataset) *DatasetsInsertCall { + c := &DatasetsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.dataset = dataset + return c +} + +func (c *DatasetsInsertCall) Do() (*Dataset, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "projects/{projectId}/datasets") + urls = strings.Replace(urls, "{projectId}", cleanPathString(c.projectId), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Dataset) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new empty dataset.", + // "httpMethod": "POST", + // "id": "bigquery.datasets.insert", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "projectId": { + // "description": "Project identifier that will contain dataset being created.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets", + // "request": { + // "$ref": "Dataset" + // }, + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +// method id "bigquery.datasets.list": + +type DatasetsListCall struct { + s *Service + projectId string + opt_ map[string]interface{} +} + +// List: Lists all the datasets in the specified project to which the +// caller has read access; however, a project owner can list (but not +// necessarily get) all datasets in his project. +func (r *DatasetsService) List(projectId string) *DatasetsListCall { + c := &DatasetsListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + return c +} + +// MaxResults sets the optional parameter "maxResults": [Optional] The +// maximum number of rows to return. If not specified, it will return up +// to the maximum amount of data that will fit in a reply. +func (c *DatasetsListCall) MaxResults(maxResults int64) *DatasetsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": [Optional] A page +// token used when requesting a specific page in a set of paged results. +func (c *DatasetsListCall) PageToken(pageToken string) *DatasetsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *DatasetsListCall) Do() (*DatasetList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "projects/{projectId}/datasets") + urls = strings.Replace(urls, "{projectId}", cleanPathString(c.projectId), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DatasetList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all the datasets in the specified project to which the caller has read access; however, a project owner can list (but not necessarily get) all datasets in his project.", + // "httpMethod": "GET", + // "id": "bigquery.datasets.list", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "maxResults": { + // "description": "[Optional] The maximum number of rows to return. If not specified, it will return up to the maximum amount of data that will fit in a reply.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "[Optional] A page token used when requesting a specific page in a set of paged results.", + // "location": "query", + // "type": "string" + // }, + // "projectId": { + // "description": "Project identifier containing datasets to be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets", + // "response": { + // "$ref": "DatasetList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +// method id "bigquery.datasets.patch": + +type DatasetsPatchCall struct { + s *Service + projectId string + datasetId string + dataset *Dataset + opt_ map[string]interface{} +} + +// Patch: Updates information in an existing dataset, specified by +// datasetId. Properties not included in the submitted resource will not +// be changed. If you include the access property without any values +// assigned, the request will fail as you must specify at least one +// owner for a dataset. This method supports patch semantics. +func (r *DatasetsService) Patch(projectId string, datasetId string, dataset *Dataset) *DatasetsPatchCall { + c := &DatasetsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + c.dataset = dataset + return c +} + +func (c *DatasetsPatchCall) Do() (*Dataset, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "projects/{projectId}/datasets/{datasetId}") + urls = strings.Replace(urls, "{projectId}", cleanPathString(c.projectId), 1) + urls = strings.Replace(urls, "{datasetId}", cleanPathString(c.datasetId), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Dataset) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates information in an existing dataset, specified by datasetId. Properties not included in the submitted resource will not be changed. If you include the access property without any values assigned, the request will fail as you must specify at least one owner for a dataset. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "bigquery.datasets.patch", + // "parameterOrder": [ + // "projectId", + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Dataset identifier containing dataset being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project identifier containing dataset being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}", + // "request": { + // "$ref": "Dataset" + // }, + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +// method id "bigquery.datasets.update": + +type DatasetsUpdateCall struct { + s *Service + projectId string + datasetId string + dataset *Dataset + opt_ map[string]interface{} +} + +// Update: Updates information in an existing dataset, specified by +// datasetId. Properties not included in the submitted resource will not +// be changed. If you include the access property without any values +// assigned, the request will fail as you must specify at least one +// owner for a dataset. +func (r *DatasetsService) Update(projectId string, datasetId string, dataset *Dataset) *DatasetsUpdateCall { + c := &DatasetsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + c.dataset = dataset + return c +} + +func (c *DatasetsUpdateCall) Do() (*Dataset, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "projects/{projectId}/datasets/{datasetId}") + urls = strings.Replace(urls, "{projectId}", cleanPathString(c.projectId), 1) + urls = strings.Replace(urls, "{datasetId}", cleanPathString(c.datasetId), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Dataset) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates information in an existing dataset, specified by datasetId. Properties not included in the submitted resource will not be changed. If you include the access property without any values assigned, the request will fail as you must specify at least one owner for a dataset.", + // "httpMethod": "PUT", + // "id": "bigquery.datasets.update", + // "parameterOrder": [ + // "projectId", + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Dataset identifier containing dataset being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project identifier containing dataset being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}", + // "request": { + // "$ref": "Dataset" + // }, + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +// method id "bigquery.jobs.get": + +type JobsGetCall struct { + s *Service + projectId string + jobId string + opt_ map[string]interface{} +} + +// Get: +func (r *JobsService) Get(projectId string, jobId string) *JobsGetCall { + c := &JobsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.jobId = jobId + return c +} + +func (c *JobsGetCall) Do() (*Job, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "projects/{projectId}/jobs/{jobId}") + urls = strings.Replace(urls, "{projectId}", cleanPathString(c.projectId), 1) + urls = strings.Replace(urls, "{jobId}", cleanPathString(c.jobId), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Job) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "bigquery.jobs.get", + // "parameterOrder": [ + // "projectId", + // "jobId" + // ], + // "parameters": { + // "jobId": { + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/jobs/{jobId}", + // "response": { + // "$ref": "Job" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +// method id "bigquery.jobs.insert": + +type JobsInsertCall struct { + s *Service + projectId string + job *Job + opt_ map[string]interface{} + media_ io.Reader +} + +// Insert: +func (r *JobsService) Insert(projectId string, job *Job) *JobsInsertCall { + c := &JobsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.job = job + return c +} +func (c *JobsInsertCall) Media(r io.Reader) *JobsInsertCall { + c.media_ = r + return c +} + +func (c *JobsInsertCall) Do() (*Job, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "projects/{projectId}/jobs") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls = strings.Replace(urls, "{projectId}", cleanPathString(c.projectId), 1) + urls += "?" + params.Encode() + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("POST", urls, body) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Job) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "POST", + // "id": "bigquery.jobs.insert", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream" + // ], + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/bigquery/v2beta1/projects/{projectId}/jobs" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/bigquery/v2beta1/projects/{projectId}/jobs" + // } + // } + // }, + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "projectId": { + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/jobs", + // "request": { + // "$ref": "Job" + // }, + // "response": { + // "$ref": "Job" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +// method id "bigquery.jobs.list": + +type JobsListCall struct { + s *Service + projectId string + opt_ map[string]interface{} +} + +// List: +func (r *JobsService) List(projectId string) *JobsListCall { + c := &JobsListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + return c +} + +// AllUsers sets the optional parameter "allUsers": Whether to display +// jobs owned by all users in the project +func (c *JobsListCall) AllUsers(allUsers bool) *JobsListCall { + c.opt_["allUsers"] = allUsers + return c +} + +// MaxResults sets the optional parameter "maxResults": maximum number +// of results to return +func (c *JobsListCall) MaxResults(maxResults int64) *JobsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": +func (c *JobsListCall) PageToken(pageToken string) *JobsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Projection sets the optional parameter "projection": Restrict +// information returned to a set of selected fields. +func (c *JobsListCall) Projection(projection string) *JobsListCall { + c.opt_["projection"] = projection + return c +} + +// StartIndex sets the optional parameter "startIndex": start index for +// paginated results +func (c *JobsListCall) StartIndex(startIndex int64) *JobsListCall { + c.opt_["startIndex"] = startIndex + return c +} + +// StateFilter sets the optional parameter "stateFilter": filter for job +// state +func (c *JobsListCall) StateFilter(stateFilter string) *JobsListCall { + c.opt_["stateFilter"] = stateFilter + return c +} + +func (c *JobsListCall) Do() (*JobList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["allUsers"]; ok { + params.Set("allUsers", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["stateFilter"]; ok { + params.Set("stateFilter", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "projects/{projectId}/jobs") + urls = strings.Replace(urls, "{projectId}", cleanPathString(c.projectId), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(JobList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "bigquery.jobs.list", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "allUsers": { + // "description": "Whether to display jobs owned by all users in the project", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "maximum number of results to return", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "location": "query", + // "type": "string" + // }, + // "projectId": { + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "Restrict information returned to a set of selected fields.", + // "enum": [ + // "full", + // "minimal" + // ], + // "enumDescriptions": [ + // "Includes all job data.", + // "Does not include the job configuration." + // ], + // "location": "query", + // "type": "string" + // }, + // "startIndex": { + // "description": "start index for paginated results", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "stateFilter": { + // "description": "filter for job state", + // "enum": [ + // "done", + // "pending", + // "running" + // ], + // "enumDescriptions": [ + // "finished jobs", + // "pending jobs", + // "running jobs" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/jobs", + // "response": { + // "$ref": "JobList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +// method id "bigquery.jobs.query": + +type JobsQueryCall struct { + s *Service + projectId string + jobqueryrequest *JobQueryRequest + opt_ map[string]interface{} +} + +// Query: +func (r *JobsService) Query(projectId string, jobqueryrequest *JobQueryRequest) *JobsQueryCall { + c := &JobsQueryCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.jobqueryrequest = jobqueryrequest + return c +} + +func (c *JobsQueryCall) Do() (*QueryResults, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.jobqueryrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "projects/{projectId}/queries") + urls = strings.Replace(urls, "{projectId}", cleanPathString(c.projectId), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(QueryResults) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "POST", + // "id": "bigquery.jobs.query", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "projectId": { + // "description": "project name billed for the query", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/queries", + // "request": { + // "$ref": "JobQueryRequest" + // }, + // "response": { + // "$ref": "QueryResults" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +// method id "bigquery.jobs.stop": + +type JobsStopCall struct { + s *Service + projectId string + jobId string + opt_ map[string]interface{} +} + +// Stop: +func (r *JobsService) Stop(projectId string, jobId string) *JobsStopCall { + c := &JobsStopCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.jobId = jobId + return c +} + +func (c *JobsStopCall) Do() (*JobStopResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "project/{projectId}/jobs/{jobId}/stop") + urls = strings.Replace(urls, "{projectId}", cleanPathString(c.projectId), 1) + urls = strings.Replace(urls, "{jobId}", cleanPathString(c.jobId), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(JobStopResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "POST", + // "id": "bigquery.jobs.stop", + // "parameterOrder": [ + // "projectId", + // "jobId" + // ], + // "parameters": { + // "jobId": { + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "project/{projectId}/jobs/{jobId}/stop", + // "response": { + // "$ref": "JobStopResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +// method id "bigquery.projects.list": + +type ProjectsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: +func (r *ProjectsService) List() *ProjectsListCall { + c := &ProjectsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": +func (c *ProjectsListCall) MaxResults(maxResults int64) *ProjectsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": +func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ProjectsListCall) Do() (*ProjectList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "projects") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ProjectList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "bigquery.projects.list", + // "parameters": { + // "maxResults": { + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "location": "query", + // "type": "string" + // } + // }, + // "path": "projects", + // "response": { + // "$ref": "ProjectList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +// method id "bigquery.tabledata.list": + +type TabledataListCall struct { + s *Service + projectId string + datasetId string + tableId string + opt_ map[string]interface{} +} + +// List: +func (r *TabledataService) List(projectId string, datasetId string, tableId string) *TabledataListCall { + c := &TabledataListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + c.tableId = tableId + return c +} + +// MaxResults sets the optional parameter "maxResults": +func (c *TabledataListCall) MaxResults(maxResults int64) *TabledataListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// StartIndex sets the optional parameter "startIndex": +func (c *TabledataListCall) StartIndex(startIndex uint64) *TabledataListCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *TabledataListCall) Do() (*TableDataList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data") + urls = strings.Replace(urls, "{projectId}", cleanPathString(c.projectId), 1) + urls = strings.Replace(urls, "{datasetId}", cleanPathString(c.datasetId), 1) + urls = strings.Replace(urls, "{tableId}", cleanPathString(c.tableId), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TableDataList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "bigquery.tabledata.list", + // "parameterOrder": [ + // "projectId", + // "datasetId", + // "tableId" + // ], + // "parameters": { + // "datasetId": { + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "projectId": { + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "tableId": { + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data", + // "response": { + // "$ref": "TableDataList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +// method id "bigquery.tables.delete": + +type TablesDeleteCall struct { + s *Service + projectId string + datasetId string + tableId string + opt_ map[string]interface{} +} + +// Delete: +func (r *TablesService) Delete(projectId string, datasetId string, tableId string) *TablesDeleteCall { + c := &TablesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + c.tableId = tableId + return c +} + +func (c *TablesDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "projects/{projectId}/datasets/{datasetId}/tables/{tableId}") + urls = strings.Replace(urls, "{projectId}", cleanPathString(c.projectId), 1) + urls = strings.Replace(urls, "{datasetId}", cleanPathString(c.datasetId), 1) + urls = strings.Replace(urls, "{tableId}", cleanPathString(c.tableId), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "httpMethod": "DELETE", + // "id": "bigquery.tables.delete", + // "parameterOrder": [ + // "projectId", + // "datasetId", + // "tableId" + // ], + // "parameters": { + // "datasetId": { + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tableId": { + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +// method id "bigquery.tables.get": + +type TablesGetCall struct { + s *Service + projectId string + datasetId string + tableId string + opt_ map[string]interface{} +} + +// Get: +func (r *TablesService) Get(projectId string, datasetId string, tableId string) *TablesGetCall { + c := &TablesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + c.tableId = tableId + return c +} + +func (c *TablesGetCall) Do() (*Table, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "projects/{projectId}/datasets/{datasetId}/tables/{tableId}") + urls = strings.Replace(urls, "{projectId}", cleanPathString(c.projectId), 1) + urls = strings.Replace(urls, "{datasetId}", cleanPathString(c.datasetId), 1) + urls = strings.Replace(urls, "{tableId}", cleanPathString(c.tableId), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Table) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "bigquery.tables.get", + // "parameterOrder": [ + // "projectId", + // "datasetId", + // "tableId" + // ], + // "parameters": { + // "datasetId": { + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tableId": { + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +// method id "bigquery.tables.insert": + +type TablesInsertCall struct { + s *Service + projectId string + datasetId string + table *Table + opt_ map[string]interface{} +} + +// Insert: +func (r *TablesService) Insert(projectId string, datasetId string, table *Table) *TablesInsertCall { + c := &TablesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + c.table = table + return c +} + +func (c *TablesInsertCall) Do() (*Table, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.table) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "projects/{projectId}/datasets/{datasetId}/tables") + urls = strings.Replace(urls, "{projectId}", cleanPathString(c.projectId), 1) + urls = strings.Replace(urls, "{datasetId}", cleanPathString(c.datasetId), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Table) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "POST", + // "id": "bigquery.tables.insert", + // "parameterOrder": [ + // "projectId", + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}/tables", + // "request": { + // "$ref": "Table" + // }, + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +// method id "bigquery.tables.list": + +type TablesListCall struct { + s *Service + projectId string + datasetId string + opt_ map[string]interface{} +} + +// List: +func (r *TablesService) List(projectId string, datasetId string) *TablesListCall { + c := &TablesListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + return c +} + +// MaxResults sets the optional parameter "maxResults": +func (c *TablesListCall) MaxResults(maxResults int64) *TablesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": +func (c *TablesListCall) PageToken(pageToken string) *TablesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *TablesListCall) Do() (*TableList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "projects/{projectId}/datasets/{datasetId}/tables") + urls = strings.Replace(urls, "{projectId}", cleanPathString(c.projectId), 1) + urls = strings.Replace(urls, "{datasetId}", cleanPathString(c.datasetId), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TableList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "bigquery.tables.list", + // "parameterOrder": [ + // "projectId", + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "location": "query", + // "type": "string" + // }, + // "projectId": { + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}/tables", + // "response": { + // "$ref": "TableList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +// method id "bigquery.tables.patch": + +type TablesPatchCall struct { + s *Service + projectId string + datasetId string + tableId string + table *Table + opt_ map[string]interface{} +} + +// Patch: +func (r *TablesService) Patch(projectId string, datasetId string, tableId string, table *Table) *TablesPatchCall { + c := &TablesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + c.tableId = tableId + c.table = table + return c +} + +func (c *TablesPatchCall) Do() (*Table, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.table) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "projects/{projectId}/datasets/{datasetId}/tables/{tableId}") + urls = strings.Replace(urls, "{projectId}", cleanPathString(c.projectId), 1) + urls = strings.Replace(urls, "{datasetId}", cleanPathString(c.datasetId), 1) + urls = strings.Replace(urls, "{tableId}", cleanPathString(c.tableId), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Table) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "PATCH", + // "id": "bigquery.tables.patch", + // "parameterOrder": [ + // "projectId", + // "datasetId", + // "tableId" + // ], + // "parameters": { + // "datasetId": { + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tableId": { + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", + // "request": { + // "$ref": "Table" + // }, + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +// method id "bigquery.tables.update": + +type TablesUpdateCall struct { + s *Service + projectId string + datasetId string + tableId string + table *Table + opt_ map[string]interface{} +} + +// Update: +func (r *TablesService) Update(projectId string, datasetId string, tableId string, table *Table) *TablesUpdateCall { + c := &TablesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.datasetId = datasetId + c.tableId = tableId + c.table = table + return c +} + +func (c *TablesUpdateCall) Do() (*Table, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.table) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/bigquery/v2beta1/", "projects/{projectId}/datasets/{datasetId}/tables/{tableId}") + urls = strings.Replace(urls, "{projectId}", cleanPathString(c.projectId), 1) + urls = strings.Replace(urls, "{datasetId}", cleanPathString(c.datasetId), 1) + urls = strings.Replace(urls, "{tableId}", cleanPathString(c.tableId), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Table) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "PUT", + // "id": "bigquery.tables.update", + // "parameterOrder": [ + // "projectId", + // "datasetId", + // "tableId" + // ], + // "parameters": { + // "datasetId": { + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tableId": { + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", + // "request": { + // "$ref": "Table" + // }, + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery" + // ] + // } + +} + +func cleanPathString(s string) string { + return strings.Map(func(r rune) rune { + if r >= 0x30 && r <= 0x7a { + return r + } + return -1 + }, s) +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/blogger/v2/blogger-api.json b/third_party/src/code.google.com/p/google-api-go-client/blogger/v2/blogger-api.json new file mode 100644 index 0000000000000..1a1359412d87a --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/blogger/v2/blogger-api.json @@ -0,0 +1,922 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/7OUX8PWQu-_Ueqls9RjxxnFExMI\"", + "discoveryVersion": "v1", + "id": "blogger:v2", + "name": "blogger", + "version": "v2", + "title": "Blogger API", + "description": "API for access to the data within Blogger.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/blogger-16.png", + "x32": "http://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" + ] + } + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/blogger/v2/blogger-gen.go b/third_party/src/code.google.com/p/google-api-go-client/blogger/v2/blogger-gen.go new file mode 100644 index 0000000000000..da91e8027d5b4 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/blogger/v2/blogger-gen.go @@ -0,0 +1,1247 @@ +// Package blogger provides access to the Blogger API. +// +// See https://developers.google.com/blogger/docs/2.0/json/getting_started +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/blogger/v2" +// ... +// bloggerService, err := blogger.New(oauthHttpClient) +package blogger + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "blogger:v2" +const apiName = "blogger" +const apiVersion = "v2" +const basePath = "https://www.googleapis.com/blogger/v2/" + +// OAuth2 scopes used by this API. +const ( + // Manage your Blogger account + BloggerScope = "https://www.googleapis.com/auth/blogger" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Blogs = NewBlogsService(s) + s.Comments = NewCommentsService(s) + s.Pages = NewPagesService(s) + s.Posts = NewPostsService(s) + s.Users = NewUsersService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Blogs *BlogsService + + Comments *CommentsService + + Pages *PagesService + + Posts *PostsService + + Users *UsersService +} + +func NewBlogsService(s *Service) *BlogsService { + rs := &BlogsService{s: s} + return rs +} + +type BlogsService struct { + s *Service +} + +func NewCommentsService(s *Service) *CommentsService { + rs := &CommentsService{s: s} + return rs +} + +type CommentsService struct { + s *Service +} + +func NewPagesService(s *Service) *PagesService { + rs := &PagesService{s: s} + return rs +} + +type PagesService struct { + s *Service +} + +func NewPostsService(s *Service) *PostsService { + rs := &PostsService{s: s} + return rs +} + +type PostsService struct { + s *Service +} + +func NewUsersService(s *Service) *UsersService { + rs := &UsersService{s: s} + rs.Blogs = NewUsersBlogsService(s) + return rs +} + +type UsersService struct { + s *Service + + Blogs *UsersBlogsService +} + +func NewUsersBlogsService(s *Service) *UsersBlogsService { + rs := &UsersBlogsService{s: s} + return rs +} + +type UsersBlogsService struct { + s *Service +} + +type Blog struct { + // Description: The description of this blog. This is displayed + // underneath the title. + Description string `json:"description,omitempty"` + + // Id: The identifier for this resource. + Id int64 `json:"id,omitempty,string"` + + // Kind: The kind of this entry. Always blogger#blog + Kind string `json:"kind,omitempty"` + + // Locale: The locale this Blog is set to. + Locale *BlogLocale `json:"locale,omitempty"` + + // Name: The name of this blog. This is displayed as the title. + Name string `json:"name,omitempty"` + + // Pages: The container of pages in this blog. + Pages *BlogPages `json:"pages,omitempty"` + + // Posts: The container of posts in this blog. + Posts *BlogPosts `json:"posts,omitempty"` + + // Published: RFC 3339 date-time when this blog was published. + Published string `json:"published,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Updated: RFC 3339 date-time when this blog was last updated. + Updated string `json:"updated,omitempty"` + + // Url: The URL where this blog is published. + Url string `json:"url,omitempty"` +} + +type BlogLocale struct { + // Country: The country this blog's locale is set to. + Country string `json:"country,omitempty"` + + // Language: The language this blog is authored in. + Language string `json:"language,omitempty"` + + // Variant: The language variant this blog is authored in. + Variant string `json:"variant,omitempty"` +} + +type BlogPages struct { + // SelfLink: The URL of the container for pages in this blog. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: The count of pages in this blog. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type BlogPosts struct { + // SelfLink: The URL of the container for posts in this blog. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: The count of posts in this blog. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type BlogList struct { + // Items: The list of Blogs this user has Authorship or Admin rights + // over. + Items []*Blog `json:"items,omitempty"` + + // Kind: The kind of this entity. Always blogger#blogList + Kind string `json:"kind,omitempty"` +} + +type Comment struct { + // Author: The author of this Comment. + Author *CommentAuthor `json:"author,omitempty"` + + // Blog: Data about the blog containing this comment. + Blog *CommentBlog `json:"blog,omitempty"` + + // Content: The actual content of the comment. May include HTML markup. + Content string `json:"content,omitempty"` + + // Id: The identifier for this resource. + Id int64 `json:"id,omitempty,string"` + + // InReplyTo: Data about the comment this is in reply to. + InReplyTo *CommentInReplyTo `json:"inReplyTo,omitempty"` + + // Kind: The kind of this entry. Always blogger#comment + Kind string `json:"kind,omitempty"` + + // Post: Data about the post containing this comment. + Post *CommentPost `json:"post,omitempty"` + + // Published: RFC 3339 date-time when this comment was published. + Published string `json:"published,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Updated: RFC 3339 date-time when this comment was last updated. + Updated string `json:"updated,omitempty"` +} + +type CommentAuthor struct { + // DisplayName: The display name. + DisplayName string `json:"displayName,omitempty"` + + // Id: The identifier of the Comment creator. + Id string `json:"id,omitempty"` + + // Image: The comment creator's avatar. + Image *CommentAuthorImage `json:"image,omitempty"` + + // Url: The URL of the Comment creator's Profile page. + Url string `json:"url,omitempty"` +} + +type CommentAuthorImage struct { + // Url: The comment creator's avatar URL. + Url string `json:"url,omitempty"` +} + +type CommentBlog struct { + // Id: The identifier of the blog containing this comment. + Id int64 `json:"id,omitempty,string"` +} + +type CommentInReplyTo struct { + // Id: The identified of the parent of this comment. + Id int64 `json:"id,omitempty,string"` +} + +type CommentPost struct { + // Id: The identifier of the post containing this comment. + Id int64 `json:"id,omitempty,string"` +} + +type CommentList struct { + // Items: The List of Comments for a Post. + Items []*Comment `json:"items,omitempty"` + + // Kind: The kind of this entry. Always blogger#commentList + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to fetch the next page, if one + // exists. + NextPageToken string `json:"nextPageToken,omitempty"` + + // PrevPageToken: Pagination token to fetch the previous page, if one + // exists. + PrevPageToken string `json:"prevPageToken,omitempty"` +} + +type Page struct { + // Author: The author of this Page. + Author *PageAuthor `json:"author,omitempty"` + + // Blog: Data about the blog containing this Page. + Blog *PageBlog `json:"blog,omitempty"` + + // Content: The body content of this Page, in HTML. + Content string `json:"content,omitempty"` + + // Id: The identifier for this resource. + Id int64 `json:"id,omitempty,string"` + + // Kind: The kind of this entity. Always blogger#page + Kind string `json:"kind,omitempty"` + + // Published: RFC 3339 date-time when this Page was published. + Published string `json:"published,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Title: The title of this entity. This is the name displayed in the + // Admin user interface. + Title string `json:"title,omitempty"` + + // Updated: RFC 3339 date-time when this Page was last updated. + Updated string `json:"updated,omitempty"` + + // Url: The URL that this Page is displayed at. + Url string `json:"url,omitempty"` +} + +type PageAuthor struct { + // DisplayName: The display name. + DisplayName string `json:"displayName,omitempty"` + + // Id: The identifier of the Page creator. + Id string `json:"id,omitempty"` + + // Image: The page author's avatar. + Image *PageAuthorImage `json:"image,omitempty"` + + // Url: The URL of the Page creator's Profile page. + Url string `json:"url,omitempty"` +} + +type PageAuthorImage struct { + // Url: The page author's avatar URL. + Url string `json:"url,omitempty"` +} + +type PageBlog struct { + // Id: The identifier of the blog containing this page. + Id int64 `json:"id,omitempty,string"` +} + +type PageList struct { + // Items: The list of Pages for a Blog. + Items []*Page `json:"items,omitempty"` + + // Kind: The kind of this entity. Always blogger#pageList + Kind string `json:"kind,omitempty"` +} + +type Post struct { + // Author: The author of this Post. + Author *PostAuthor `json:"author,omitempty"` + + // Blog: Data about the blog containing this Post. + Blog *PostBlog `json:"blog,omitempty"` + + // Content: The content of the Post. May contain HTML markup. + Content string `json:"content,omitempty"` + + // Id: The identifier of this Post. + Id int64 `json:"id,omitempty,string"` + + // Kind: The kind of this entity. Always blogger#post + Kind string `json:"kind,omitempty"` + + // Labels: The list of labels this Post was tagged with. + Labels []string `json:"labels,omitempty"` + + // Published: RFC 3339 date-time when this Post was published. + Published string `json:"published,omitempty"` + + // Replies: The container of comments on this Post. + Replies *PostReplies `json:"replies,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Title: The title of the Post. + Title string `json:"title,omitempty"` + + // Updated: RFC 3339 date-time when this Post was last updated. + Updated string `json:"updated,omitempty"` + + // Url: The URL where this Post is displayed. + Url string `json:"url,omitempty"` +} + +type PostAuthor struct { + // DisplayName: The display name. + DisplayName string `json:"displayName,omitempty"` + + // Id: The identifier of the Post creator. + Id string `json:"id,omitempty"` + + // Image: The Post author's avatar. + Image *PostAuthorImage `json:"image,omitempty"` + + // Url: The URL of the Post creator's Profile page. + Url string `json:"url,omitempty"` +} + +type PostAuthorImage struct { + // Url: The Post author's avatar URL. + Url string `json:"url,omitempty"` +} + +type PostBlog struct { + // Id: The identifier of the Blog that contains this Post. + Id int64 `json:"id,omitempty,string"` +} + +type PostReplies struct { + // SelfLink: The URL of the comments on this post. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: The count of comments on this post. + TotalItems int64 `json:"totalItems,omitempty,string"` +} + +type PostList struct { + // Items: The list of Posts for this Blog. + Items []*Post `json:"items,omitempty"` + + // Kind: The kind of this entity. Always blogger#postList + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to fetch the next page, if one + // exists. + NextPageToken string `json:"nextPageToken,omitempty"` + + // PrevPageToken: Pagination token to fetch the previous page, if one + // exists. + PrevPageToken string `json:"prevPageToken,omitempty"` +} + +type User struct { + // About: Profile summary information. + About string `json:"about,omitempty"` + + // Blogs: The container of blogs for this user. + Blogs *UserBlogs `json:"blogs,omitempty"` + + // Created: The timestamp of when this profile was created, in seconds + // since epoch. + Created string `json:"created,omitempty"` + + // DisplayName: The display name. + DisplayName string `json:"displayName,omitempty"` + + // Id: The identifier for this User. + Id string `json:"id,omitempty"` + + // Kind: The kind of this entity. Always blogger#user + Kind string `json:"kind,omitempty"` + + // Locale: This user's locale + Locale *UserLocale `json:"locale,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Url: The user's profile page. + Url string `json:"url,omitempty"` +} + +type UserBlogs struct { + // SelfLink: The URL of the Blogs for this user. + SelfLink string `json:"selfLink,omitempty"` +} + +type UserLocale struct { + // Country: The user's country setting. + Country string `json:"country,omitempty"` + + // Language: The user's language setting. + Language string `json:"language,omitempty"` + + // Variant: The user's language variant setting. + Variant string `json:"variant,omitempty"` +} + +// method id "blogger.blogs.get": + +type BlogsGetCall struct { + s *Service + blogId string + opt_ map[string]interface{} +} + +// Get: Gets one blog by id. +func (r *BlogsService) Get(blogId string) *BlogsGetCall { + c := &BlogsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + return c +} + +func (c *BlogsGetCall) Do() (*Blog, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Blog) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one blog by id.", + // "httpMethod": "GET", + // "id": "blogger.blogs.get", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the blog to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}", + // "response": { + // "$ref": "Blog" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.comments.get": + +type CommentsGetCall struct { + s *Service + blogId string + postId string + commentId string + opt_ map[string]interface{} +} + +// Get: Gets one comment by id. +func (r *CommentsService) Get(blogId string, postId string, commentId string) *CommentsGetCall { + c := &CommentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.commentId = commentId + return c +} + +func (c *CommentsGetCall) Do() (*Comment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one comment by id.", + // "httpMethod": "GET", + // "id": "blogger.comments.get", + // "parameterOrder": [ + // "blogId", + // "postId", + // "commentId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to containing the comment.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "commentId": { + // "description": "The ID of the comment to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "ID of the post to fetch posts from.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}", + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.comments.list": + +type CommentsListCall struct { + s *Service + blogId string + postId string + opt_ map[string]interface{} +} + +// List: Retrieves the comments for a blog, possibly filtered. +func (r *CommentsService) List(blogId string, postId string) *CommentsListCall { + c := &CommentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether the +// body content of the comments is included. +func (c *CommentsListCall) FetchBodies(fetchBodies bool) *CommentsListCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of comments to include in the result. +func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// if request is paged. +func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartDate sets the optional parameter "startDate": Earliest date of +// comment to fetch, a date-time with RFC 3339 formatting. +func (c *CommentsListCall) StartDate(startDate string) *CommentsListCall { + c.opt_["startDate"] = startDate + return c +} + +func (c *CommentsListCall) Do() (*CommentList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startDate"]; ok { + params.Set("startDate", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommentList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the comments for a blog, possibly filtered.", + // "httpMethod": "GET", + // "id": "blogger.comments.list", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch comments from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fetchBodies": { + // "description": "Whether the body content of the comments is included.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "Maximum number of comments to include in the result.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token if request is paged.", + // "location": "query", + // "type": "string" + // }, + // "postId": { + // "description": "ID of the post to fetch posts from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startDate": { + // "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments", + // "response": { + // "$ref": "CommentList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pages.get": + +type PagesGetCall struct { + s *Service + blogId string + pageId string + opt_ map[string]interface{} +} + +// Get: Gets one blog page by id. +func (r *PagesService) Get(blogId string, pageId string) *PagesGetCall { + c := &PagesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.pageId = pageId + return c +} + +func (c *PagesGetCall) Do() (*Page, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{pageId}", url.QueryEscape(c.pageId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Page) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one blog page by id.", + // "httpMethod": "GET", + // "id": "blogger.pages.get", + // "parameterOrder": [ + // "blogId", + // "pageId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog containing the page.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageId": { + // "description": "The ID of the page to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages/{pageId}", + // "response": { + // "$ref": "Page" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pages.list": + +type PagesListCall struct { + s *Service + blogId string + opt_ map[string]interface{} +} + +// List: Retrieves pages for a blog, possibly filtered. +func (r *PagesService) List(blogId string) *PagesListCall { + c := &PagesListCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether to +// retrieve the Page bodies. +func (c *PagesListCall) FetchBodies(fetchBodies bool) *PagesListCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +func (c *PagesListCall) Do() (*PageList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PageList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves pages for a blog, possibly filtered.", + // "httpMethod": "GET", + // "id": "blogger.pages.list", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch pages from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fetchBodies": { + // "description": "Whether to retrieve the Page bodies.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "blogs/{blogId}/pages", + // "response": { + // "$ref": "PageList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.posts.get": + +type PostsGetCall struct { + s *Service + blogId string + postId string + opt_ map[string]interface{} +} + +// Get: Get a post by id. +func (r *PostsService) Get(blogId string, postId string) *PostsGetCall { + c := &PostsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + return c +} + +func (c *PostsGetCall) Do() (*Post, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a post by id.", + // "httpMethod": "GET", + // "id": "blogger.posts.get", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch the post from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the post", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}", + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.posts.list": + +type PostsListCall struct { + s *Service + blogId string + opt_ map[string]interface{} +} + +// List: Retrieves a list of posts, possibly filtered. +func (r *PostsService) List(blogId string) *PostsListCall { + c := &PostsListCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether the +// body content of posts is included. +func (c *PostsListCall) FetchBodies(fetchBodies bool) *PostsListCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of posts to fetch. +func (c *PostsListCall) MaxResults(maxResults int64) *PostsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// if the request is paged. +func (c *PostsListCall) PageToken(pageToken string) *PostsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartDate sets the optional parameter "startDate": Earliest post date +// to fetch, a date-time with RFC 3339 formatting. +func (c *PostsListCall) StartDate(startDate string) *PostsListCall { + c.opt_["startDate"] = startDate + return c +} + +func (c *PostsListCall) Do() (*PostList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startDate"]; ok { + params.Set("startDate", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PostList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of posts, possibly filtered.", + // "httpMethod": "GET", + // "id": "blogger.posts.list", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch posts from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fetchBodies": { + // "description": "Whether the body content of posts is included.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "Maximum number of posts to fetch.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token if the request is paged.", + // "location": "query", + // "type": "string" + // }, + // "startDate": { + // "description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts", + // "response": { + // "$ref": "PostList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.users.get": + +type UsersGetCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// Get: Gets one user by id. +func (r *UsersService) Get(userId string) *UsersGetCall { + c := &UsersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +func (c *UsersGetCall) Do() (*User, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(User) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one user by id.", + // "httpMethod": "GET", + // "id": "blogger.users.get", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "description": "The ID of the user to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userId}", + // "response": { + // "$ref": "User" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.users.blogs.list": + +type UsersBlogsListCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// List: Retrieves a list of blogs, possibly filtered. +func (r *UsersBlogsService) List(userId string) *UsersBlogsListCall { + c := &UsersBlogsListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +func (c *UsersBlogsListCall) Do() (*BlogList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BlogList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of blogs, possibly filtered.", + // "httpMethod": "GET", + // "id": "blogger.users.blogs.list", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "description": "ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userId}/blogs", + // "response": { + // "$ref": "BlogList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/blogger/v3/blogger-api.json b/third_party/src/code.google.com/p/google-api-go-client/blogger/v3/blogger-api.json new file mode 100644 index 0000000000000..97a0de69c831d --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/blogger/v3/blogger-api.json @@ -0,0 +1,2347 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/TO0nvlGiFkC4eBcMUbWL9BiW0xc\"", + "discoveryVersion": "v1", + "id": "blogger:v3", + "name": "blogger", + "version": "v3", + "title": "Blogger API", + "description": "API for access to the data within Blogger.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/blogger-16.png", + "x32": "http://www.google.com/images/icons/product/blogger-32.png" + }, + "documentationLink": "https://developers.google.com/blogger/docs/3.0/getting_started", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/blogger/v3/", + "basePath": "/blogger/v3/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "blogger/v3/", + "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" + }, + "https://www.googleapis.com/auth/blogger.readonly": { + "description": "View your Blogger account" + } + } + } + }, + "schemas": { + "Blog": { + "id": "Blog", + "type": "object", + "properties": { + "customMetaData": { + "type": "string", + "description": "The JSON custom meta-data for the Blog" + }, + "description": { + "type": "string", + "description": "The description of this blog. This is displayed underneath the title." + }, + "id": { + "type": "string", + "description": "The identifier for this resource." + }, + "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": { + "items": { + "type": "array", + "description": "The List of Posts for this Blog.", + "items": { + "$ref": "Post" + } + }, + "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": { + "blogUserInfos": { + "type": "array", + "description": "Admin level list of blog per-user information", + "items": { + "$ref": "BlogUserInfo" + } + }, + "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" + } + } + }, + "BlogPerUserInfo": { + "id": "BlogPerUserInfo", + "type": "object", + "properties": { + "blogId": { + "type": "string", + "description": "ID of the Blog resource" + }, + "hasAdminAccess": { + "type": "boolean", + "description": "True if the user has Admin level access to the blog." + }, + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#blogPerUserInfo", + "default": "blogger#blogPerUserInfo" + }, + "photosAlbumKey": { + "type": "string", + "description": "The Photo Album Key for the user when adding photos to the blog" + }, + "role": { + "type": "string", + "description": "Access permissions that the user has for the blog (ADMIN, AUTHOR, or READER)." + }, + "userId": { + "type": "string", + "description": "ID of the User" + } + } + }, + "BlogUserInfo": { + "id": "BlogUserInfo", + "type": "object", + "properties": { + "blog": { + "$ref": "Blog", + "description": "The Blog resource." + }, + "blog_user_info": { + "$ref": "BlogPerUserInfo", + "description": "Information about a User for the Blog." + }, + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#blogUserInfo", + "default": "blogger#blogUserInfo" + } + } + }, + "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." + } + } + }, + "content": { + "type": "string", + "description": "The actual content of the comment. May include HTML markup." + }, + "id": { + "type": "string", + "description": "The identifier for this resource." + }, + "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." + } + } + }, + "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." + } + } + }, + "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." + }, + "status": { + "type": "string", + "description": "The status of the comment (only populated for admin users)" + }, + "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." + } + } + }, + "content": { + "type": "string", + "description": "The body content of this Page, in HTML." + }, + "id": { + "type": "string", + "description": "The identifier for this resource." + }, + "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." + }, + "status": { + "type": "string", + "description": "The status of the page for admin resources (either LIVE or DRAFT)." + }, + "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" + } + } + }, + "Pageviews": { + "id": "Pageviews", + "type": "object", + "properties": { + "blogId": { + "type": "string", + "description": "Blog Id", + "format": "int64" + }, + "counts": { + "type": "array", + "description": "The container of posts in this blog.", + "items": { + "type": "object", + "properties": { + "count": { + "type": "string", + "description": "Count of page views for the given time range", + "format": "int64" + }, + "timeRange": { + "type": "string", + "description": "Time range the given count applies to" + } + } + } + }, + "kind": { + "type": "string", + "description": "The kind of this entry. Always blogger#page_views", + "default": "blogger#page_views" + } + } + }, + "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." + } + } + }, + "content": { + "type": "string", + "description": "The content of the Post. May contain HTML markup." + }, + "customMetaData": { + "type": "string", + "description": "The JSON meta-data for the Post." + }, + "id": { + "type": "string", + "description": "The identifier of this Post." + }, + "images": { + "type": "array", + "description": "Display image for the Post.", + "items": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + } + } + }, + "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" + } + }, + "location": { + "type": "object", + "description": "The location for geotagged posts.", + "properties": { + "lat": { + "type": "number", + "description": "Location's latitude.", + "format": "double" + }, + "lng": { + "type": "number", + "description": "Location's longitude.", + "format": "double" + }, + "name": { + "type": "string", + "description": "Location name." + }, + "span": { + "type": "string", + "description": "Location's viewport span. Can be used when rendering a map preview." + } + } + }, + "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": { + "items": { + "type": "array", + "description": "The List of Comments for this Post.", + "items": { + "$ref": "Comment" + } + }, + "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." + }, + "status": { + "type": "string", + "description": "Status of the post. Only set for admin-level requests" + }, + "title": { + "type": "string", + "description": "The title of the Post." + }, + "titleLink": { + "type": "string", + "description": "The title link URL, similar to atom's related link." + }, + "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." + } + } + }, + "PostPerUserInfo": { + "id": "PostPerUserInfo", + "type": "object", + "properties": { + "blogId": { + "type": "string", + "description": "ID of the Blog that the post resource belongs to." + }, + "hasEditAccess": { + "type": "boolean", + "description": "True if the user has Author level access to the post." + }, + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#postPerUserInfo", + "default": "blogger#postPerUserInfo" + }, + "postId": { + "type": "string", + "description": "ID of the Post resource." + }, + "userId": { + "type": "string", + "description": "ID of the User." + } + } + }, + "PostUserInfo": { + "id": "PostUserInfo", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#postUserInfo", + "default": "blogger#postUserInfo" + }, + "post": { + "$ref": "Post", + "description": "The Post resource." + }, + "post_user_info": { + "$ref": "PostPerUserInfo", + "description": "Information about a User for the Post." + } + } + }, + "PostUserInfosList": { + "id": "PostUserInfosList", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The list of Posts with User information for the post, for this Blog.", + "items": { + "$ref": "PostUserInfo" + } + }, + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#postList", + "default": "blogger#postUserInfosList" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to fetch the next 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": { + "blogUserInfos": { + "methods": { + "get": { + "id": "blogger.blogUserInfos.get", + "path": "users/{userId}/blogs/{blogId}", + "httpMethod": "GET", + "description": "Gets one blog and user info pair by blogId and userId.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the blog to get.", + "required": true, + "location": "path" + }, + "maxPosts": { + "type": "integer", + "description": "Maximum number of posts to pull back with the blog.", + "format": "uint32", + "location": "query" + }, + "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", + "blogId" + ], + "response": { + "$ref": "BlogUserInfo" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + } + } + }, + "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" + }, + "maxPosts": { + "type": "integer", + "description": "Maximum number of posts to pull back with the blog.", + "format": "uint32", + "location": "query" + }, + "view": { + "type": "string", + "description": "Access level with which to view the blogs. Note that some fields require elevated access.", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Reader level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "response": { + "$ref": "Blog" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "getByUrl": { + "id": "blogger.blogs.getByUrl", + "path": "blogs/byurl", + "httpMethod": "GET", + "description": "Retrieve a Blog by URL.", + "parameters": { + "url": { + "type": "string", + "description": "The URL of the blog to retrieve.", + "required": true, + "location": "query" + }, + "view": { + "type": "string", + "description": "Access level with which to view the blogs. Note that some fields require elevated access.", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Reader level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "url" + ], + "response": { + "$ref": "Blog" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "listByUser": { + "id": "blogger.blogs.listByUser", + "path": "users/{userId}/blogs", + "httpMethod": "GET", + "description": "Retrieves a list of blogs, possibly filtered.", + "parameters": { + "fetchUserInfo": { + "type": "boolean", + "description": "Whether the response is a list of blogs with per-user information instead of just blogs.", + "location": "query" + }, + "role": { + "type": "string", + "description": "User access types for blogs to include in the results, e.g. AUTHOR will return blogs where the user has author level access. If no roles are specified, defaults to ADMIN and AUTHOR roles.", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin role - User has Admin level access.", + "Author role - User has Author level access.", + "Reader role - User has Reader level access." + ], + "repeated": true, + "location": "query" + }, + "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" + }, + "view": { + "type": "string", + "description": "Access level with which to view the blogs. Note that some fields require elevated access.", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Reader level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "BlogList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + } + } + }, + "comments": { + "methods": { + "approve": { + "id": "blogger.comments.approve", + "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve", + "httpMethod": "POST", + "description": "Marks a comment as not spam.", + "parameters": { + "blogId": { + "type": "string", + "description": "The Id of the Blog.", + "required": true, + "location": "path" + }, + "commentId": { + "type": "string", + "description": "The ID of the comment to mark as not spam.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId", + "commentId" + ], + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "delete": { + "id": "blogger.comments.delete", + "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}", + "httpMethod": "DELETE", + "description": "Delete a comment by id.", + "parameters": { + "blogId": { + "type": "string", + "description": "The Id of the Blog.", + "required": true, + "location": "path" + }, + "commentId": { + "type": "string", + "description": "The ID of the comment to delete.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId", + "commentId" + ], + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "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" + }, + "view": { + "type": "string", + "description": "Access level for the requested comment (default: READER). Note that some comments will require elevated permissions, for example comments where the parent posts which is in a draft state, or comments that are pending moderation.", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Admin level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "postId", + "commentId" + ], + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "list": { + "id": "blogger.comments.list", + "path": "blogs/{blogId}/posts/{postId}/comments", + "httpMethod": "GET", + "description": "Retrieves the comments for a post, possibly filtered.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch comments from.", + "required": true, + "location": "path" + }, + "endDate": { + "type": "string", + "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.", + "format": "date-time", + "location": "query" + }, + "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" + }, + "status": { + "type": "string", + "enum": [ + "emptied", + "live", + "pending", + "spam" + ], + "enumDescriptions": [ + "Comments that have had their content removed", + "Comments that are publicly visible", + "Comments that are awaiting administrator approval", + "Comments marked as spam by the administrator" + ], + "repeated": true, + "location": "query" + }, + "view": { + "type": "string", + "description": "Access level with which to view the returned result. Note that some fields require elevated access.", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Reader level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "response": { + "$ref": "CommentList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "listByBlog": { + "id": "blogger.comments.listByBlog", + "path": "blogs/{blogId}/comments", + "httpMethod": "GET", + "description": "Retrieves the comments for a blog, across all posts, possibly filtered.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch comments from.", + "required": true, + "location": "path" + }, + "endDate": { + "type": "string", + "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.", + "format": "date-time", + "location": "query" + }, + "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" + }, + "startDate": { + "type": "string", + "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.", + "format": "date-time", + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "response": { + "$ref": "CommentList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "markAsSpam": { + "id": "blogger.comments.markAsSpam", + "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam", + "httpMethod": "POST", + "description": "Marks a comment as spam.", + "parameters": { + "blogId": { + "type": "string", + "description": "The Id of the Blog.", + "required": true, + "location": "path" + }, + "commentId": { + "type": "string", + "description": "The ID of the comment to mark as spam.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId", + "commentId" + ], + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "removeContent": { + "id": "blogger.comments.removeContent", + "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent", + "httpMethod": "POST", + "description": "Removes the content of a comment.", + "parameters": { + "blogId": { + "type": "string", + "description": "The Id of the Blog.", + "required": true, + "location": "path" + }, + "commentId": { + "type": "string", + "description": "The ID of the comment to delete content from.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId", + "commentId" + ], + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + } + } + }, + "pageViews": { + "methods": { + "get": { + "id": "blogger.pageViews.get", + "path": "blogs/{blogId}/pageviews", + "httpMethod": "GET", + "description": "Retrieve pageview stats for a Blog.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the blog to get.", + "required": true, + "location": "path" + }, + "range": { + "type": "string", + "enum": [ + "30DAYS", + "7DAYS", + "all" + ], + "enumDescriptions": [ + "Page view counts from the last thirty days.", + "Page view counts from the last seven days.", + "Total page view counts from all time." + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "response": { + "$ref": "Pageviews" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + } + } + }, + "pages": { + "methods": { + "delete": { + "id": "blogger.pages.delete", + "path": "blogs/{blogId}/pages/{pageId}", + "httpMethod": "DELETE", + "description": "Delete a page by id.", + "parameters": { + "blogId": { + "type": "string", + "description": "The Id of the Blog.", + "required": true, + "location": "path" + }, + "pageId": { + "type": "string", + "description": "The ID of the Page.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "pageId" + ], + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "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" + }, + "view": { + "type": "string", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Reader level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "pageId" + ], + "response": { + "$ref": "Page" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "insert": { + "id": "blogger.pages.insert", + "path": "blogs/{blogId}/pages", + "httpMethod": "POST", + "description": "Add a page.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to add the page to.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId" + ], + "request": { + "$ref": "Page" + }, + "response": { + "$ref": "Page" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "list": { + "id": "blogger.pages.list", + "path": "blogs/{blogId}/pages", + "httpMethod": "GET", + "description": "Retrieves the pages for a blog, optionally including non-LIVE statuses.", + "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" + }, + "status": { + "type": "string", + "enum": [ + "draft", + "live" + ], + "enumDescriptions": [ + "Draft (unpublished) Pages", + "Pages that are publicly visible" + ], + "repeated": true, + "location": "query" + }, + "view": { + "type": "string", + "description": "Access level with which to view the returned result. Note that some fields require elevated access.", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Reader level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "response": { + "$ref": "PageList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "patch": { + "id": "blogger.pages.patch", + "path": "blogs/{blogId}/pages/{pageId}", + "httpMethod": "PATCH", + "description": "Update a page. This method supports patch semantics.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the Blog.", + "required": true, + "location": "path" + }, + "pageId": { + "type": "string", + "description": "The ID of the Page.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "pageId" + ], + "request": { + "$ref": "Page" + }, + "response": { + "$ref": "Page" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "update": { + "id": "blogger.pages.update", + "path": "blogs/{blogId}/pages/{pageId}", + "httpMethod": "PUT", + "description": "Update a page.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the Blog.", + "required": true, + "location": "path" + }, + "pageId": { + "type": "string", + "description": "The ID of the Page.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "pageId" + ], + "request": { + "$ref": "Page" + }, + "response": { + "$ref": "Page" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + } + } + }, + "postUserInfos": { + "methods": { + "get": { + "id": "blogger.postUserInfos.get", + "path": "users/{userId}/blogs/{blogId}/posts/{postId}", + "httpMethod": "GET", + "description": "Gets one post and user info pair, by post id and user id. The post user info contains per-user information about the post, such as access rights, specific to the user.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the blog.", + "required": true, + "location": "path" + }, + "maxComments": { + "type": "integer", + "description": "Maximum number of comments to pull back on a post.", + "format": "uint32", + "location": "query" + }, + "postId": { + "type": "string", + "description": "The ID of the post to get.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "blogId", + "postId" + ], + "response": { + "$ref": "PostUserInfo" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "list": { + "id": "blogger.postUserInfos.list", + "path": "users/{userId}/blogs/{blogId}/posts", + "httpMethod": "GET", + "description": "Retrieves a list of post and post user info pairs, possibly filtered. The post user info contains per-user information about the post, such as access rights, specific to the user.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch posts from.", + "required": true, + "location": "path" + }, + "endDate": { + "type": "string", + "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.", + "format": "date-time", + "location": "query" + }, + "fetchBodies": { + "type": "boolean", + "description": "Whether the body content of posts is included. Default is false.", + "default": "false", + "location": "query" + }, + "labels": { + "type": "string", + "description": "Comma-separated list of labels to search for.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of posts to fetch.", + "format": "uint32", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sort order applied to search results. Default is published.", + "default": "PUBLISHED", + "enum": [ + "published", + "updated" + ], + "enumDescriptions": [ + "Order by the date the post was published", + "Order by the date the post was last updated" + ], + "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" + }, + "status": { + "type": "string", + "enum": [ + "draft", + "live", + "scheduled" + ], + "enumDescriptions": [ + "Draft posts", + "Published posts", + "Posts that are scheduled to publish in future." + ], + "repeated": true, + "location": "query" + }, + "userId": { + "type": "string", + "description": "ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + "required": true, + "location": "path" + }, + "view": { + "type": "string", + "description": "Access level with which to view the returned result. Note that some fields require elevated access.", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Reader level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "userId", + "blogId" + ], + "response": { + "$ref": "PostUserInfosList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + } + } + }, + "posts": { + "methods": { + "delete": { + "id": "blogger.posts.delete", + "path": "blogs/{blogId}/posts/{postId}", + "httpMethod": "DELETE", + "description": "Delete a post by id.", + "parameters": { + "blogId": { + "type": "string", + "description": "The Id of the Blog.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "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" + }, + "fetchBody": { + "type": "boolean", + "description": "Whether the body content of the post is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.", + "default": "true", + "location": "query" + }, + "fetchImages": { + "type": "boolean", + "description": "Whether image URL metadata for each post is included (default: false).", + "location": "query" + }, + "maxComments": { + "type": "integer", + "description": "Maximum number of comments to pull back on a post.", + "format": "uint32", + "location": "query" + }, + "postId": { + "type": "string", + "description": "The ID of the post", + "required": true, + "location": "path" + }, + "view": { + "type": "string", + "description": "Access level with which to view the returned result. Note that some fields require elevated access.", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Reader level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "response": { + "$ref": "Post" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "getByPath": { + "id": "blogger.posts.getByPath", + "path": "blogs/{blogId}/posts/bypath", + "httpMethod": "GET", + "description": "Retrieve a Post by Path.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch the post from.", + "required": true, + "location": "path" + }, + "maxComments": { + "type": "integer", + "description": "Maximum number of comments to pull back on a post.", + "format": "uint32", + "location": "query" + }, + "path": { + "type": "string", + "description": "Path of the Post to retrieve.", + "required": true, + "location": "query" + }, + "view": { + "type": "string", + "description": "Access level with which to view the returned result. Note that some fields require elevated access.", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Reader level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "path" + ], + "response": { + "$ref": "Post" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "insert": { + "id": "blogger.posts.insert", + "path": "blogs/{blogId}/posts", + "httpMethod": "POST", + "description": "Add a post.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to add the post to.", + "required": true, + "location": "path" + }, + "fetchBody": { + "type": "boolean", + "description": "Whether the body content of the post is included with the result (default: true).", + "default": "true", + "location": "query" + }, + "fetchImages": { + "type": "boolean", + "description": "Whether image URL metadata for each post is included in the returned result (default: false).", + "location": "query" + }, + "isDraft": { + "type": "boolean", + "description": "Whether to create the post as a draft (default: false).", + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "request": { + "$ref": "Post" + }, + "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" + }, + "endDate": { + "type": "string", + "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.", + "format": "date-time", + "location": "query" + }, + "fetchBodies": { + "type": "boolean", + "description": "Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.", + "default": "true", + "location": "query" + }, + "fetchImages": { + "type": "boolean", + "description": "Whether image URL metadata for each post is included.", + "location": "query" + }, + "labels": { + "type": "string", + "description": "Comma-separated list of labels to search for.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of posts to fetch.", + "format": "uint32", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sort search results", + "default": "PUBLISHED", + "enum": [ + "published", + "updated" + ], + "enumDescriptions": [ + "Order by the date the post was published", + "Order by the date the post was last updated" + ], + "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" + }, + "status": { + "type": "string", + "description": "Statuses to include in the results.", + "enum": [ + "draft", + "live", + "scheduled" + ], + "enumDescriptions": [ + "Draft (non-published) posts.", + "Published posts", + "Posts that are scheduled to publish in the future." + ], + "repeated": true, + "location": "query" + }, + "view": { + "type": "string", + "description": "Access level with which to view the returned result. Note that some fields require escalated access.", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Reader level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "response": { + "$ref": "PostList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "patch": { + "id": "blogger.posts.patch", + "path": "blogs/{blogId}/posts/{postId}", + "httpMethod": "PATCH", + "description": "Update a post. This method supports patch semantics.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the Blog.", + "required": true, + "location": "path" + }, + "fetchBody": { + "type": "boolean", + "description": "Whether the body content of the post is included with the result (default: true).", + "default": "true", + "location": "query" + }, + "fetchImages": { + "type": "boolean", + "description": "Whether image URL metadata for each post is included in the returned result (default: false).", + "location": "query" + }, + "maxComments": { + "type": "integer", + "description": "Maximum number of comments to retrieve with the returned post.", + "format": "uint32", + "location": "query" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + }, + "publish": { + "type": "boolean", + "description": "Whether a publish action should be performed when the post is updated (default: false).", + "location": "query" + }, + "revert": { + "type": "boolean", + "description": "Whether a revert action should be performed when the post is updated (default: false).", + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "request": { + "$ref": "Post" + }, + "response": { + "$ref": "Post" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "publish": { + "id": "blogger.posts.publish", + "path": "blogs/{blogId}/posts/{postId}/publish", + "httpMethod": "POST", + "description": "Publish a draft post.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the Blog.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + }, + "publishDate": { + "type": "string", + "description": "The date and time to schedule the publishing of the Blog.", + "format": "date-time", + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "response": { + "$ref": "Post" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "revert": { + "id": "blogger.posts.revert", + "path": "blogs/{blogId}/posts/{postId}/revert", + "httpMethod": "POST", + "description": "Revert a published or scheduled post to draft state.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the Blog.", + "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" + ] + }, + "search": { + "id": "blogger.posts.search", + "path": "blogs/{blogId}/posts/search", + "httpMethod": "GET", + "description": "Search for a post.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch the post from.", + "required": true, + "location": "path" + }, + "fetchBodies": { + "type": "boolean", + "description": "Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.", + "default": "true", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sort search results", + "default": "PUBLISHED", + "enum": [ + "published", + "updated" + ], + "enumDescriptions": [ + "Order by the date the post was published", + "Order by the date the post was last updated" + ], + "location": "query" + }, + "q": { + "type": "string", + "description": "Query terms to search this blog for matching posts.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "q" + ], + "response": { + "$ref": "PostList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "update": { + "id": "blogger.posts.update", + "path": "blogs/{blogId}/posts/{postId}", + "httpMethod": "PUT", + "description": "Update a post.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the Blog.", + "required": true, + "location": "path" + }, + "fetchBody": { + "type": "boolean", + "description": "Whether the body content of the post is included with the result (default: true).", + "default": "true", + "location": "query" + }, + "fetchImages": { + "type": "boolean", + "description": "Whether image URL metadata for each post is included in the returned result (default: false).", + "location": "query" + }, + "maxComments": { + "type": "integer", + "description": "Maximum number of comments to retrieve with the returned post.", + "format": "uint32", + "location": "query" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + }, + "publish": { + "type": "boolean", + "description": "Whether a publish action should be performed when the post is updated (default: false).", + "location": "query" + }, + "revert": { + "type": "boolean", + "description": "Whether a revert action should be performed when the post is updated (default: false).", + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "request": { + "$ref": "Post" + }, + "response": { + "$ref": "Post" + }, + "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", + "https://www.googleapis.com/auth/blogger.readonly" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/blogger/v3/blogger-gen.go b/third_party/src/code.google.com/p/google-api-go-client/blogger/v3/blogger-gen.go new file mode 100644 index 0000000000000..34dc61631522e --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/blogger/v3/blogger-gen.go @@ -0,0 +1,4216 @@ +// Package blogger provides access to the Blogger API. +// +// See https://developers.google.com/blogger/docs/3.0/getting_started +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/blogger/v3" +// ... +// bloggerService, err := blogger.New(oauthHttpClient) +package blogger + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "blogger:v3" +const apiName = "blogger" +const apiVersion = "v3" +const basePath = "https://www.googleapis.com/blogger/v3/" + +// OAuth2 scopes used by this API. +const ( + // Manage your Blogger account + BloggerScope = "https://www.googleapis.com/auth/blogger" + + // View your Blogger account + BloggerReadonlyScope = "https://www.googleapis.com/auth/blogger.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.BlogUserInfos = NewBlogUserInfosService(s) + s.Blogs = NewBlogsService(s) + s.Comments = NewCommentsService(s) + s.PageViews = NewPageViewsService(s) + s.Pages = NewPagesService(s) + s.PostUserInfos = NewPostUserInfosService(s) + s.Posts = NewPostsService(s) + s.Users = NewUsersService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + BlogUserInfos *BlogUserInfosService + + Blogs *BlogsService + + Comments *CommentsService + + PageViews *PageViewsService + + Pages *PagesService + + PostUserInfos *PostUserInfosService + + Posts *PostsService + + Users *UsersService +} + +func NewBlogUserInfosService(s *Service) *BlogUserInfosService { + rs := &BlogUserInfosService{s: s} + return rs +} + +type BlogUserInfosService struct { + s *Service +} + +func NewBlogsService(s *Service) *BlogsService { + rs := &BlogsService{s: s} + return rs +} + +type BlogsService struct { + s *Service +} + +func NewCommentsService(s *Service) *CommentsService { + rs := &CommentsService{s: s} + return rs +} + +type CommentsService struct { + s *Service +} + +func NewPageViewsService(s *Service) *PageViewsService { + rs := &PageViewsService{s: s} + return rs +} + +type PageViewsService struct { + s *Service +} + +func NewPagesService(s *Service) *PagesService { + rs := &PagesService{s: s} + return rs +} + +type PagesService struct { + s *Service +} + +func NewPostUserInfosService(s *Service) *PostUserInfosService { + rs := &PostUserInfosService{s: s} + return rs +} + +type PostUserInfosService struct { + s *Service +} + +func NewPostsService(s *Service) *PostsService { + rs := &PostsService{s: s} + return rs +} + +type PostsService struct { + s *Service +} + +func NewUsersService(s *Service) *UsersService { + rs := &UsersService{s: s} + return rs +} + +type UsersService struct { + s *Service +} + +type Blog struct { + // CustomMetaData: The JSON custom meta-data for the Blog + CustomMetaData string `json:"customMetaData,omitempty"` + + // Description: The description of this blog. This is displayed + // underneath the title. + Description string `json:"description,omitempty"` + + // Id: The identifier for this resource. + Id string `json:"id,omitempty"` + + // Kind: The kind of this entry. Always blogger#blog + Kind string `json:"kind,omitempty"` + + // Locale: The locale this Blog is set to. + Locale *BlogLocale `json:"locale,omitempty"` + + // Name: The name of this blog. This is displayed as the title. + Name string `json:"name,omitempty"` + + // Pages: The container of pages in this blog. + Pages *BlogPages `json:"pages,omitempty"` + + // Posts: The container of posts in this blog. + Posts *BlogPosts `json:"posts,omitempty"` + + // Published: RFC 3339 date-time when this blog was published. + Published string `json:"published,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Updated: RFC 3339 date-time when this blog was last updated. + Updated string `json:"updated,omitempty"` + + // Url: The URL where this blog is published. + Url string `json:"url,omitempty"` +} + +type BlogLocale struct { + // Country: The country this blog's locale is set to. + Country string `json:"country,omitempty"` + + // Language: The language this blog is authored in. + Language string `json:"language,omitempty"` + + // Variant: The language variant this blog is authored in. + Variant string `json:"variant,omitempty"` +} + +type BlogPages struct { + // SelfLink: The URL of the container for pages in this blog. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: The count of pages in this blog. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type BlogPosts struct { + // Items: The List of Posts for this Blog. + Items []*Post `json:"items,omitempty"` + + // SelfLink: The URL of the container for posts in this blog. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: The count of posts in this blog. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type BlogList struct { + // BlogUserInfos: Admin level list of blog per-user information + BlogUserInfos []*BlogUserInfo `json:"blogUserInfos,omitempty"` + + // Items: The list of Blogs this user has Authorship or Admin rights + // over. + Items []*Blog `json:"items,omitempty"` + + // Kind: The kind of this entity. Always blogger#blogList + Kind string `json:"kind,omitempty"` +} + +type BlogPerUserInfo struct { + // BlogId: ID of the Blog resource + BlogId string `json:"blogId,omitempty"` + + // HasAdminAccess: True if the user has Admin level access to the blog. + HasAdminAccess bool `json:"hasAdminAccess,omitempty"` + + // Kind: The kind of this entity. Always blogger#blogPerUserInfo + Kind string `json:"kind,omitempty"` + + // PhotosAlbumKey: The Photo Album Key for the user when adding photos + // to the blog + PhotosAlbumKey string `json:"photosAlbumKey,omitempty"` + + // Role: Access permissions that the user has for the blog (ADMIN, + // AUTHOR, or READER). + Role string `json:"role,omitempty"` + + // UserId: ID of the User + UserId string `json:"userId,omitempty"` +} + +type BlogUserInfo struct { + // Blog: The Blog resource. + Blog *Blog `json:"blog,omitempty"` + + // Blog_user_info: Information about a User for the Blog. + Blog_user_info *BlogPerUserInfo `json:"blog_user_info,omitempty"` + + // Kind: The kind of this entity. Always blogger#blogUserInfo + Kind string `json:"kind,omitempty"` +} + +type Comment struct { + // Author: The author of this Comment. + Author *CommentAuthor `json:"author,omitempty"` + + // Blog: Data about the blog containing this comment. + Blog *CommentBlog `json:"blog,omitempty"` + + // Content: The actual content of the comment. May include HTML markup. + Content string `json:"content,omitempty"` + + // Id: The identifier for this resource. + Id string `json:"id,omitempty"` + + // InReplyTo: Data about the comment this is in reply to. + InReplyTo *CommentInReplyTo `json:"inReplyTo,omitempty"` + + // Kind: The kind of this entry. Always blogger#comment + Kind string `json:"kind,omitempty"` + + // Post: Data about the post containing this comment. + Post *CommentPost `json:"post,omitempty"` + + // Published: RFC 3339 date-time when this comment was published. + Published string `json:"published,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Status: The status of the comment (only populated for admin users) + Status string `json:"status,omitempty"` + + // Updated: RFC 3339 date-time when this comment was last updated. + Updated string `json:"updated,omitempty"` +} + +type CommentAuthor struct { + // DisplayName: The display name. + DisplayName string `json:"displayName,omitempty"` + + // Id: The identifier of the Comment creator. + Id string `json:"id,omitempty"` + + // Image: The comment creator's avatar. + Image *CommentAuthorImage `json:"image,omitempty"` + + // Url: The URL of the Comment creator's Profile page. + Url string `json:"url,omitempty"` +} + +type CommentAuthorImage struct { + // Url: The comment creator's avatar URL. + Url string `json:"url,omitempty"` +} + +type CommentBlog struct { + // Id: The identifier of the blog containing this comment. + Id string `json:"id,omitempty"` +} + +type CommentInReplyTo struct { + // Id: The identified of the parent of this comment. + Id string `json:"id,omitempty"` +} + +type CommentPost struct { + // Id: The identifier of the post containing this comment. + Id string `json:"id,omitempty"` +} + +type CommentList struct { + // Items: The List of Comments for a Post. + Items []*Comment `json:"items,omitempty"` + + // Kind: The kind of this entry. Always blogger#commentList + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to fetch the next page, if one + // exists. + NextPageToken string `json:"nextPageToken,omitempty"` + + // PrevPageToken: Pagination token to fetch the previous page, if one + // exists. + PrevPageToken string `json:"prevPageToken,omitempty"` +} + +type Page struct { + // Author: The author of this Page. + Author *PageAuthor `json:"author,omitempty"` + + // Blog: Data about the blog containing this Page. + Blog *PageBlog `json:"blog,omitempty"` + + // Content: The body content of this Page, in HTML. + Content string `json:"content,omitempty"` + + // Id: The identifier for this resource. + Id string `json:"id,omitempty"` + + // Kind: The kind of this entity. Always blogger#page + Kind string `json:"kind,omitempty"` + + // Published: RFC 3339 date-time when this Page was published. + Published string `json:"published,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Status: The status of the page for admin resources (either LIVE or + // DRAFT). + Status string `json:"status,omitempty"` + + // Title: The title of this entity. This is the name displayed in the + // Admin user interface. + Title string `json:"title,omitempty"` + + // Updated: RFC 3339 date-time when this Page was last updated. + Updated string `json:"updated,omitempty"` + + // Url: The URL that this Page is displayed at. + Url string `json:"url,omitempty"` +} + +type PageAuthor struct { + // DisplayName: The display name. + DisplayName string `json:"displayName,omitempty"` + + // Id: The identifier of the Page creator. + Id string `json:"id,omitempty"` + + // Image: The page author's avatar. + Image *PageAuthorImage `json:"image,omitempty"` + + // Url: The URL of the Page creator's Profile page. + Url string `json:"url,omitempty"` +} + +type PageAuthorImage struct { + // Url: The page author's avatar URL. + Url string `json:"url,omitempty"` +} + +type PageBlog struct { + // Id: The identifier of the blog containing this page. + Id string `json:"id,omitempty"` +} + +type PageList struct { + // Items: The list of Pages for a Blog. + Items []*Page `json:"items,omitempty"` + + // Kind: The kind of this entity. Always blogger#pageList + Kind string `json:"kind,omitempty"` +} + +type Pageviews struct { + // BlogId: Blog Id + BlogId int64 `json:"blogId,omitempty,string"` + + // Counts: The container of posts in this blog. + Counts []*PageviewsCounts `json:"counts,omitempty"` + + // Kind: The kind of this entry. Always blogger#page_views + Kind string `json:"kind,omitempty"` +} + +type PageviewsCounts struct { + // Count: Count of page views for the given time range + Count int64 `json:"count,omitempty,string"` + + // TimeRange: Time range the given count applies to + TimeRange string `json:"timeRange,omitempty"` +} + +type Post struct { + // Author: The author of this Post. + Author *PostAuthor `json:"author,omitempty"` + + // Blog: Data about the blog containing this Post. + Blog *PostBlog `json:"blog,omitempty"` + + // Content: The content of the Post. May contain HTML markup. + Content string `json:"content,omitempty"` + + // CustomMetaData: The JSON meta-data for the Post. + CustomMetaData string `json:"customMetaData,omitempty"` + + // Id: The identifier of this Post. + Id string `json:"id,omitempty"` + + // Images: Display image for the Post. + Images []*PostImages `json:"images,omitempty"` + + // Kind: The kind of this entity. Always blogger#post + Kind string `json:"kind,omitempty"` + + // Labels: The list of labels this Post was tagged with. + Labels []string `json:"labels,omitempty"` + + // Location: The location for geotagged posts. + Location *PostLocation `json:"location,omitempty"` + + // Published: RFC 3339 date-time when this Post was published. + Published string `json:"published,omitempty"` + + // Replies: The container of comments on this Post. + Replies *PostReplies `json:"replies,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Status: Status of the post. Only set for admin-level requests + Status string `json:"status,omitempty"` + + // Title: The title of the Post. + Title string `json:"title,omitempty"` + + // TitleLink: The title link URL, similar to atom's related link. + TitleLink string `json:"titleLink,omitempty"` + + // Updated: RFC 3339 date-time when this Post was last updated. + Updated string `json:"updated,omitempty"` + + // Url: The URL where this Post is displayed. + Url string `json:"url,omitempty"` +} + +type PostAuthor struct { + // DisplayName: The display name. + DisplayName string `json:"displayName,omitempty"` + + // Id: The identifier of the Post creator. + Id string `json:"id,omitempty"` + + // Image: The Post author's avatar. + Image *PostAuthorImage `json:"image,omitempty"` + + // Url: The URL of the Post creator's Profile page. + Url string `json:"url,omitempty"` +} + +type PostAuthorImage struct { + // Url: The Post author's avatar URL. + Url string `json:"url,omitempty"` +} + +type PostBlog struct { + // Id: The identifier of the Blog that contains this Post. + Id string `json:"id,omitempty"` +} + +type PostImages struct { + Url string `json:"url,omitempty"` +} + +type PostLocation struct { + // Lat: Location's latitude. + Lat float64 `json:"lat,omitempty"` + + // Lng: Location's longitude. + Lng float64 `json:"lng,omitempty"` + + // Name: Location name. + Name string `json:"name,omitempty"` + + // Span: Location's viewport span. Can be used when rendering a map + // preview. + Span string `json:"span,omitempty"` +} + +type PostReplies struct { + // Items: The List of Comments for this Post. + Items []*Comment `json:"items,omitempty"` + + // SelfLink: The URL of the comments on this post. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: The count of comments on this post. + TotalItems int64 `json:"totalItems,omitempty,string"` +} + +type PostList struct { + // Items: The list of Posts for this Blog. + Items []*Post `json:"items,omitempty"` + + // Kind: The kind of this entity. Always blogger#postList + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to fetch the next page, if one + // exists. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type PostPerUserInfo struct { + // BlogId: ID of the Blog that the post resource belongs to. + BlogId string `json:"blogId,omitempty"` + + // HasEditAccess: True if the user has Author level access to the post. + HasEditAccess bool `json:"hasEditAccess,omitempty"` + + // Kind: The kind of this entity. Always blogger#postPerUserInfo + Kind string `json:"kind,omitempty"` + + // PostId: ID of the Post resource. + PostId string `json:"postId,omitempty"` + + // UserId: ID of the User. + UserId string `json:"userId,omitempty"` +} + +type PostUserInfo struct { + // Kind: The kind of this entity. Always blogger#postUserInfo + Kind string `json:"kind,omitempty"` + + // Post: The Post resource. + Post *Post `json:"post,omitempty"` + + // Post_user_info: Information about a User for the Post. + Post_user_info *PostPerUserInfo `json:"post_user_info,omitempty"` +} + +type PostUserInfosList struct { + // Items: The list of Posts with User information for the post, for this + // Blog. + Items []*PostUserInfo `json:"items,omitempty"` + + // Kind: The kind of this entity. Always blogger#postList + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to fetch the next page, if one + // exists. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type User struct { + // About: Profile summary information. + About string `json:"about,omitempty"` + + // Blogs: The container of blogs for this user. + Blogs *UserBlogs `json:"blogs,omitempty"` + + // Created: The timestamp of when this profile was created, in seconds + // since epoch. + Created string `json:"created,omitempty"` + + // DisplayName: The display name. + DisplayName string `json:"displayName,omitempty"` + + // Id: The identifier for this User. + Id string `json:"id,omitempty"` + + // Kind: The kind of this entity. Always blogger#user + Kind string `json:"kind,omitempty"` + + // Locale: This user's locale + Locale *UserLocale `json:"locale,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Url: The user's profile page. + Url string `json:"url,omitempty"` +} + +type UserBlogs struct { + // SelfLink: The URL of the Blogs for this user. + SelfLink string `json:"selfLink,omitempty"` +} + +type UserLocale struct { + // Country: The user's country setting. + Country string `json:"country,omitempty"` + + // Language: The user's language setting. + Language string `json:"language,omitempty"` + + // Variant: The user's language variant setting. + Variant string `json:"variant,omitempty"` +} + +// method id "blogger.blogUserInfos.get": + +type BlogUserInfosGetCall struct { + s *Service + userId string + blogId string + opt_ map[string]interface{} +} + +// Get: Gets one blog and user info pair by blogId and userId. +func (r *BlogUserInfosService) Get(userId string, blogId string) *BlogUserInfosGetCall { + c := &BlogUserInfosGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.blogId = blogId + return c +} + +// MaxPosts sets the optional parameter "maxPosts": Maximum number of +// posts to pull back with the blog. +func (c *BlogUserInfosGetCall) MaxPosts(maxPosts int64) *BlogUserInfosGetCall { + c.opt_["maxPosts"] = maxPosts + return c +} + +func (c *BlogUserInfosGetCall) Do() (*BlogUserInfo, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxPosts"]; ok { + params.Set("maxPosts", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BlogUserInfo) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one blog and user info pair by blogId and userId.", + // "httpMethod": "GET", + // "id": "blogger.blogUserInfos.get", + // "parameterOrder": [ + // "userId", + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the blog to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxPosts": { + // "description": "Maximum number of posts to pull back with the blog.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "userId": { + // "description": "ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userId}/blogs/{blogId}", + // "response": { + // "$ref": "BlogUserInfo" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.blogs.get": + +type BlogsGetCall struct { + s *Service + blogId string + opt_ map[string]interface{} +} + +// Get: Gets one blog by id. +func (r *BlogsService) Get(blogId string) *BlogsGetCall { + c := &BlogsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + return c +} + +// MaxPosts sets the optional parameter "maxPosts": Maximum number of +// posts to pull back with the blog. +func (c *BlogsGetCall) MaxPosts(maxPosts int64) *BlogsGetCall { + c.opt_["maxPosts"] = maxPosts + return c +} + +// View sets the optional parameter "view": Access level with which to +// view the blogs. Note that some fields require elevated access. +func (c *BlogsGetCall) View(view string) *BlogsGetCall { + c.opt_["view"] = view + return c +} + +func (c *BlogsGetCall) Do() (*Blog, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxPosts"]; ok { + params.Set("maxPosts", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Blog) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one blog by id.", + // "httpMethod": "GET", + // "id": "blogger.blogs.get", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the blog to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxPosts": { + // "description": "Maximum number of posts to pull back with the blog.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "view": { + // "description": "Access level with which to view the blogs. Note that some fields require elevated access.", + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Reader level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}", + // "response": { + // "$ref": "Blog" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.blogs.getByUrl": + +type BlogsGetByUrlCall struct { + s *Service + url string + opt_ map[string]interface{} +} + +// GetByUrl: Retrieve a Blog by URL. +func (r *BlogsService) GetByUrl(url string) *BlogsGetByUrlCall { + c := &BlogsGetByUrlCall{s: r.s, opt_: make(map[string]interface{})} + c.url = url + return c +} + +// View sets the optional parameter "view": Access level with which to +// view the blogs. Note that some fields require elevated access. +func (c *BlogsGetByUrlCall) View(view string) *BlogsGetByUrlCall { + c.opt_["view"] = view + return c +} + +func (c *BlogsGetByUrlCall) Do() (*Blog, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("url", fmt.Sprintf("%v", c.url)) + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/byurl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Blog) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve a Blog by URL.", + // "httpMethod": "GET", + // "id": "blogger.blogs.getByUrl", + // "parameterOrder": [ + // "url" + // ], + // "parameters": { + // "url": { + // "description": "The URL of the blog to retrieve.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "view": { + // "description": "Access level with which to view the blogs. Note that some fields require elevated access.", + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Reader level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/byurl", + // "response": { + // "$ref": "Blog" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.blogs.listByUser": + +type BlogsListByUserCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// ListByUser: Retrieves a list of blogs, possibly filtered. +func (r *BlogsService) ListByUser(userId string) *BlogsListByUserCall { + c := &BlogsListByUserCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// FetchUserInfo sets the optional parameter "fetchUserInfo": Whether +// the response is a list of blogs with per-user information instead of +// just blogs. +func (c *BlogsListByUserCall) FetchUserInfo(fetchUserInfo bool) *BlogsListByUserCall { + c.opt_["fetchUserInfo"] = fetchUserInfo + return c +} + +// Role sets the optional parameter "role": User access types for blogs +// to include in the results, e.g. AUTHOR will return blogs where the +// user has author level access. If no roles are specified, defaults to +// ADMIN and AUTHOR roles. +func (c *BlogsListByUserCall) Role(role string) *BlogsListByUserCall { + c.opt_["role"] = role + return c +} + +// View sets the optional parameter "view": Access level with which to +// view the blogs. Note that some fields require elevated access. +func (c *BlogsListByUserCall) View(view string) *BlogsListByUserCall { + c.opt_["view"] = view + return c +} + +func (c *BlogsListByUserCall) Do() (*BlogList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["fetchUserInfo"]; ok { + params.Set("fetchUserInfo", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["role"]; ok { + params.Set("role", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BlogList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of blogs, possibly filtered.", + // "httpMethod": "GET", + // "id": "blogger.blogs.listByUser", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "fetchUserInfo": { + // "description": "Whether the response is a list of blogs with per-user information instead of just blogs.", + // "location": "query", + // "type": "boolean" + // }, + // "role": { + // "description": "User access types for blogs to include in the results, e.g. AUTHOR will return blogs where the user has author level access. If no roles are specified, defaults to ADMIN and AUTHOR roles.", + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin role - User has Admin level access.", + // "Author role - User has Author level access.", + // "Reader role - User has Reader level access." + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "userId": { + // "description": "ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "view": { + // "description": "Access level with which to view the blogs. Note that some fields require elevated access.", + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Reader level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "users/{userId}/blogs", + // "response": { + // "$ref": "BlogList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.comments.approve": + +type CommentsApproveCall struct { + s *Service + blogId string + postId string + commentId string + opt_ map[string]interface{} +} + +// Approve: Marks a comment as not spam. +func (r *CommentsService) Approve(blogId string, postId string, commentId string) *CommentsApproveCall { + c := &CommentsApproveCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.commentId = commentId + return c +} + +func (c *CommentsApproveCall) Do() (*Comment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Marks a comment as not spam.", + // "httpMethod": "POST", + // "id": "blogger.comments.approve", + // "parameterOrder": [ + // "blogId", + // "postId", + // "commentId" + // ], + // "parameters": { + // "blogId": { + // "description": "The Id of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "commentId": { + // "description": "The ID of the comment to mark as not spam.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve", + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.comments.delete": + +type CommentsDeleteCall struct { + s *Service + blogId string + postId string + commentId string + opt_ map[string]interface{} +} + +// Delete: Delete a comment by id. +func (r *CommentsService) Delete(blogId string, postId string, commentId string) *CommentsDeleteCall { + c := &CommentsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.commentId = commentId + return c +} + +func (c *CommentsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a comment by id.", + // "httpMethod": "DELETE", + // "id": "blogger.comments.delete", + // "parameterOrder": [ + // "blogId", + // "postId", + // "commentId" + // ], + // "parameters": { + // "blogId": { + // "description": "The Id of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "commentId": { + // "description": "The ID of the comment to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}", + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.comments.get": + +type CommentsGetCall struct { + s *Service + blogId string + postId string + commentId string + opt_ map[string]interface{} +} + +// Get: Gets one comment by id. +func (r *CommentsService) Get(blogId string, postId string, commentId string) *CommentsGetCall { + c := &CommentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.commentId = commentId + return c +} + +// View sets the optional parameter "view": Access level for the +// requested comment (default: READER). Note that some comments will +// require elevated permissions, for example comments where the parent +// posts which is in a draft state, or comments that are pending +// moderation. +func (c *CommentsGetCall) View(view string) *CommentsGetCall { + c.opt_["view"] = view + return c +} + +func (c *CommentsGetCall) Do() (*Comment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one comment by id.", + // "httpMethod": "GET", + // "id": "blogger.comments.get", + // "parameterOrder": [ + // "blogId", + // "postId", + // "commentId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to containing the comment.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "commentId": { + // "description": "The ID of the comment to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "ID of the post to fetch posts from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "view": { + // "description": "Access level for the requested comment (default: READER). Note that some comments will require elevated permissions, for example comments where the parent posts which is in a draft state, or comments that are pending moderation.", + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Admin level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}", + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.comments.list": + +type CommentsListCall struct { + s *Service + blogId string + postId string + opt_ map[string]interface{} +} + +// List: Retrieves the comments for a post, possibly filtered. +func (r *CommentsService) List(blogId string, postId string) *CommentsListCall { + c := &CommentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + return c +} + +// EndDate sets the optional parameter "endDate": Latest date of comment +// to fetch, a date-time with RFC 3339 formatting. +func (c *CommentsListCall) EndDate(endDate string) *CommentsListCall { + c.opt_["endDate"] = endDate + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether the +// body content of the comments is included. +func (c *CommentsListCall) FetchBodies(fetchBodies bool) *CommentsListCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of comments to include in the result. +func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// if request is paged. +func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartDate sets the optional parameter "startDate": Earliest date of +// comment to fetch, a date-time with RFC 3339 formatting. +func (c *CommentsListCall) StartDate(startDate string) *CommentsListCall { + c.opt_["startDate"] = startDate + return c +} + +// Status sets the optional parameter "status": +func (c *CommentsListCall) Status(status string) *CommentsListCall { + c.opt_["status"] = status + return c +} + +// View sets the optional parameter "view": Access level with which to +// view the returned result. Note that some fields require elevated +// access. +func (c *CommentsListCall) View(view string) *CommentsListCall { + c.opt_["view"] = view + return c +} + +func (c *CommentsListCall) Do() (*CommentList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["endDate"]; ok { + params.Set("endDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startDate"]; ok { + params.Set("startDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["status"]; ok { + params.Set("status", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommentList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the comments for a post, possibly filtered.", + // "httpMethod": "GET", + // "id": "blogger.comments.list", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch comments from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "endDate": { + // "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "fetchBodies": { + // "description": "Whether the body content of the comments is included.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "Maximum number of comments to include in the result.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token if request is paged.", + // "location": "query", + // "type": "string" + // }, + // "postId": { + // "description": "ID of the post to fetch posts from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startDate": { + // "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "status": { + // "enum": [ + // "emptied", + // "live", + // "pending", + // "spam" + // ], + // "enumDescriptions": [ + // "Comments that have had their content removed", + // "Comments that are publicly visible", + // "Comments that are awaiting administrator approval", + // "Comments marked as spam by the administrator" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "view": { + // "description": "Access level with which to view the returned result. Note that some fields require elevated access.", + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Reader level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments", + // "response": { + // "$ref": "CommentList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.comments.listByBlog": + +type CommentsListByBlogCall struct { + s *Service + blogId string + opt_ map[string]interface{} +} + +// ListByBlog: Retrieves the comments for a blog, across all posts, +// possibly filtered. +func (r *CommentsService) ListByBlog(blogId string) *CommentsListByBlogCall { + c := &CommentsListByBlogCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + return c +} + +// EndDate sets the optional parameter "endDate": Latest date of comment +// to fetch, a date-time with RFC 3339 formatting. +func (c *CommentsListByBlogCall) EndDate(endDate string) *CommentsListByBlogCall { + c.opt_["endDate"] = endDate + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether the +// body content of the comments is included. +func (c *CommentsListByBlogCall) FetchBodies(fetchBodies bool) *CommentsListByBlogCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of comments to include in the result. +func (c *CommentsListByBlogCall) MaxResults(maxResults int64) *CommentsListByBlogCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// if request is paged. +func (c *CommentsListByBlogCall) PageToken(pageToken string) *CommentsListByBlogCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartDate sets the optional parameter "startDate": Earliest date of +// comment to fetch, a date-time with RFC 3339 formatting. +func (c *CommentsListByBlogCall) StartDate(startDate string) *CommentsListByBlogCall { + c.opt_["startDate"] = startDate + return c +} + +func (c *CommentsListByBlogCall) Do() (*CommentList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["endDate"]; ok { + params.Set("endDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startDate"]; ok { + params.Set("startDate", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommentList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the comments for a blog, across all posts, possibly filtered.", + // "httpMethod": "GET", + // "id": "blogger.comments.listByBlog", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch comments from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "endDate": { + // "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "fetchBodies": { + // "description": "Whether the body content of the comments is included.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "Maximum number of comments to include in the result.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token if request is paged.", + // "location": "query", + // "type": "string" + // }, + // "startDate": { + // "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/comments", + // "response": { + // "$ref": "CommentList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.comments.markAsSpam": + +type CommentsMarkAsSpamCall struct { + s *Service + blogId string + postId string + commentId string + opt_ map[string]interface{} +} + +// MarkAsSpam: Marks a comment as spam. +func (r *CommentsService) MarkAsSpam(blogId string, postId string, commentId string) *CommentsMarkAsSpamCall { + c := &CommentsMarkAsSpamCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.commentId = commentId + return c +} + +func (c *CommentsMarkAsSpamCall) Do() (*Comment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Marks a comment as spam.", + // "httpMethod": "POST", + // "id": "blogger.comments.markAsSpam", + // "parameterOrder": [ + // "blogId", + // "postId", + // "commentId" + // ], + // "parameters": { + // "blogId": { + // "description": "The Id of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "commentId": { + // "description": "The ID of the comment to mark as spam.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam", + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.comments.removeContent": + +type CommentsRemoveContentCall struct { + s *Service + blogId string + postId string + commentId string + opt_ map[string]interface{} +} + +// RemoveContent: Removes the content of a comment. +func (r *CommentsService) RemoveContent(blogId string, postId string, commentId string) *CommentsRemoveContentCall { + c := &CommentsRemoveContentCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.commentId = commentId + return c +} + +func (c *CommentsRemoveContentCall) Do() (*Comment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes the content of a comment.", + // "httpMethod": "POST", + // "id": "blogger.comments.removeContent", + // "parameterOrder": [ + // "blogId", + // "postId", + // "commentId" + // ], + // "parameters": { + // "blogId": { + // "description": "The Id of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "commentId": { + // "description": "The ID of the comment to delete content from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent", + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pageViews.get": + +type PageViewsGetCall struct { + s *Service + blogId string + opt_ map[string]interface{} +} + +// Get: Retrieve pageview stats for a Blog. +func (r *PageViewsService) Get(blogId string) *PageViewsGetCall { + c := &PageViewsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + return c +} + +// Range sets the optional parameter "range": +func (c *PageViewsGetCall) Range(range_ string) *PageViewsGetCall { + c.opt_["range"] = range_ + return c +} + +func (c *PageViewsGetCall) Do() (*Pageviews, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["range"]; ok { + params.Set("range", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pageviews") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Pageviews) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve pageview stats for a Blog.", + // "httpMethod": "GET", + // "id": "blogger.pageViews.get", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the blog to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "range": { + // "enum": [ + // "30DAYS", + // "7DAYS", + // "all" + // ], + // "enumDescriptions": [ + // "Page view counts from the last thirty days.", + // "Page view counts from the last seven days.", + // "Total page view counts from all time." + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pageviews", + // "response": { + // "$ref": "Pageviews" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pages.delete": + +type PagesDeleteCall struct { + s *Service + blogId string + pageId string + opt_ map[string]interface{} +} + +// Delete: Delete a page by id. +func (r *PagesService) Delete(blogId string, pageId string) *PagesDeleteCall { + c := &PagesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.pageId = pageId + return c +} + +func (c *PagesDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{pageId}", url.QueryEscape(c.pageId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a page by id.", + // "httpMethod": "DELETE", + // "id": "blogger.pages.delete", + // "parameterOrder": [ + // "blogId", + // "pageId" + // ], + // "parameters": { + // "blogId": { + // "description": "The Id of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageId": { + // "description": "The ID of the Page.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages/{pageId}", + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pages.get": + +type PagesGetCall struct { + s *Service + blogId string + pageId string + opt_ map[string]interface{} +} + +// Get: Gets one blog page by id. +func (r *PagesService) Get(blogId string, pageId string) *PagesGetCall { + c := &PagesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.pageId = pageId + return c +} + +// View sets the optional parameter "view": +func (c *PagesGetCall) View(view string) *PagesGetCall { + c.opt_["view"] = view + return c +} + +func (c *PagesGetCall) Do() (*Page, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{pageId}", url.QueryEscape(c.pageId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Page) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one blog page by id.", + // "httpMethod": "GET", + // "id": "blogger.pages.get", + // "parameterOrder": [ + // "blogId", + // "pageId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog containing the page.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageId": { + // "description": "The ID of the page to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "view": { + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Reader level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages/{pageId}", + // "response": { + // "$ref": "Page" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.pages.insert": + +type PagesInsertCall struct { + s *Service + blogId string + page *Page + opt_ map[string]interface{} +} + +// Insert: Add a page. +func (r *PagesService) Insert(blogId string, page *Page) *PagesInsertCall { + c := &PagesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.page = page + return c +} + +func (c *PagesInsertCall) Do() (*Page, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Page) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add a page.", + // "httpMethod": "POST", + // "id": "blogger.pages.insert", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to add the page to.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages", + // "request": { + // "$ref": "Page" + // }, + // "response": { + // "$ref": "Page" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pages.list": + +type PagesListCall struct { + s *Service + blogId string + opt_ map[string]interface{} +} + +// List: Retrieves the pages for a blog, optionally including non-LIVE +// statuses. +func (r *PagesService) List(blogId string) *PagesListCall { + c := &PagesListCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether to +// retrieve the Page bodies. +func (c *PagesListCall) FetchBodies(fetchBodies bool) *PagesListCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// Status sets the optional parameter "status": +func (c *PagesListCall) Status(status string) *PagesListCall { + c.opt_["status"] = status + return c +} + +// View sets the optional parameter "view": Access level with which to +// view the returned result. Note that some fields require elevated +// access. +func (c *PagesListCall) View(view string) *PagesListCall { + c.opt_["view"] = view + return c +} + +func (c *PagesListCall) Do() (*PageList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["status"]; ok { + params.Set("status", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PageList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the pages for a blog, optionally including non-LIVE statuses.", + // "httpMethod": "GET", + // "id": "blogger.pages.list", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch pages from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fetchBodies": { + // "description": "Whether to retrieve the Page bodies.", + // "location": "query", + // "type": "boolean" + // }, + // "status": { + // "enum": [ + // "draft", + // "live" + // ], + // "enumDescriptions": [ + // "Draft (unpublished) Pages", + // "Pages that are publicly visible" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "view": { + // "description": "Access level with which to view the returned result. Note that some fields require elevated access.", + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Reader level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages", + // "response": { + // "$ref": "PageList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.pages.patch": + +type PagesPatchCall struct { + s *Service + blogId string + pageId string + page *Page + opt_ map[string]interface{} +} + +// Patch: Update a page. This method supports patch semantics. +func (r *PagesService) Patch(blogId string, pageId string, page *Page) *PagesPatchCall { + c := &PagesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.pageId = pageId + c.page = page + return c +} + +func (c *PagesPatchCall) Do() (*Page, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{pageId}", url.QueryEscape(c.pageId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Page) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a page. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "blogger.pages.patch", + // "parameterOrder": [ + // "blogId", + // "pageId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageId": { + // "description": "The ID of the Page.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages/{pageId}", + // "request": { + // "$ref": "Page" + // }, + // "response": { + // "$ref": "Page" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pages.update": + +type PagesUpdateCall struct { + s *Service + blogId string + pageId string + page *Page + opt_ map[string]interface{} +} + +// Update: Update a page. +func (r *PagesService) Update(blogId string, pageId string, page *Page) *PagesUpdateCall { + c := &PagesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.pageId = pageId + c.page = page + return c +} + +func (c *PagesUpdateCall) Do() (*Page, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{pageId}", url.QueryEscape(c.pageId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Page) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a page.", + // "httpMethod": "PUT", + // "id": "blogger.pages.update", + // "parameterOrder": [ + // "blogId", + // "pageId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageId": { + // "description": "The ID of the Page.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages/{pageId}", + // "request": { + // "$ref": "Page" + // }, + // "response": { + // "$ref": "Page" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.postUserInfos.get": + +type PostUserInfosGetCall struct { + s *Service + userId string + blogId string + postId string + opt_ map[string]interface{} +} + +// Get: Gets one post and user info pair, by post id and user id. The +// post user info contains per-user information about the post, such as +// access rights, specific to the user. +func (r *PostUserInfosService) Get(userId string, blogId string, postId string) *PostUserInfosGetCall { + c := &PostUserInfosGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.blogId = blogId + c.postId = postId + return c +} + +// MaxComments sets the optional parameter "maxComments": Maximum number +// of comments to pull back on a post. +func (c *PostUserInfosGetCall) MaxComments(maxComments int64) *PostUserInfosGetCall { + c.opt_["maxComments"] = maxComments + return c +} + +func (c *PostUserInfosGetCall) Do() (*PostUserInfo, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxComments"]; ok { + params.Set("maxComments", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PostUserInfo) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one post and user info pair, by post id and user id. The post user info contains per-user information about the post, such as access rights, specific to the user.", + // "httpMethod": "GET", + // "id": "blogger.postUserInfos.get", + // "parameterOrder": [ + // "userId", + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxComments": { + // "description": "Maximum number of comments to pull back on a post.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "postId": { + // "description": "The ID of the post to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userId}/blogs/{blogId}/posts/{postId}", + // "response": { + // "$ref": "PostUserInfo" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.postUserInfos.list": + +type PostUserInfosListCall struct { + s *Service + userId string + blogId string + opt_ map[string]interface{} +} + +// List: Retrieves a list of post and post user info pairs, possibly +// filtered. The post user info contains per-user information about the +// post, such as access rights, specific to the user. +func (r *PostUserInfosService) List(userId string, blogId string) *PostUserInfosListCall { + c := &PostUserInfosListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.blogId = blogId + return c +} + +// EndDate sets the optional parameter "endDate": Latest post date to +// fetch, a date-time with RFC 3339 formatting. +func (c *PostUserInfosListCall) EndDate(endDate string) *PostUserInfosListCall { + c.opt_["endDate"] = endDate + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether the +// body content of posts is included. Default is false. +func (c *PostUserInfosListCall) FetchBodies(fetchBodies bool) *PostUserInfosListCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// Labels sets the optional parameter "labels": Comma-separated list of +// labels to search for. +func (c *PostUserInfosListCall) Labels(labels string) *PostUserInfosListCall { + c.opt_["labels"] = labels + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of posts to fetch. +func (c *PostUserInfosListCall) MaxResults(maxResults int64) *PostUserInfosListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sort order applied to +// search results. Default is published. +func (c *PostUserInfosListCall) OrderBy(orderBy string) *PostUserInfosListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// if the request is paged. +func (c *PostUserInfosListCall) PageToken(pageToken string) *PostUserInfosListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartDate sets the optional parameter "startDate": Earliest post date +// to fetch, a date-time with RFC 3339 formatting. +func (c *PostUserInfosListCall) StartDate(startDate string) *PostUserInfosListCall { + c.opt_["startDate"] = startDate + return c +} + +// Status sets the optional parameter "status": +func (c *PostUserInfosListCall) Status(status string) *PostUserInfosListCall { + c.opt_["status"] = status + return c +} + +// View sets the optional parameter "view": Access level with which to +// view the returned result. Note that some fields require elevated +// access. +func (c *PostUserInfosListCall) View(view string) *PostUserInfosListCall { + c.opt_["view"] = view + return c +} + +func (c *PostUserInfosListCall) Do() (*PostUserInfosList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["endDate"]; ok { + params.Set("endDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["labels"]; ok { + params.Set("labels", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startDate"]; ok { + params.Set("startDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["status"]; ok { + params.Set("status", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PostUserInfosList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of post and post user info pairs, possibly filtered. The post user info contains per-user information about the post, such as access rights, specific to the user.", + // "httpMethod": "GET", + // "id": "blogger.postUserInfos.list", + // "parameterOrder": [ + // "userId", + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch posts from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "endDate": { + // "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "fetchBodies": { + // "default": "false", + // "description": "Whether the body content of posts is included. Default is false.", + // "location": "query", + // "type": "boolean" + // }, + // "labels": { + // "description": "Comma-separated list of labels to search for.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of posts to fetch.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "orderBy": { + // "default": "PUBLISHED", + // "description": "Sort order applied to search results. Default is published.", + // "enum": [ + // "published", + // "updated" + // ], + // "enumDescriptions": [ + // "Order by the date the post was published", + // "Order by the date the post was last updated" + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Continuation token if the request is paged.", + // "location": "query", + // "type": "string" + // }, + // "startDate": { + // "description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "status": { + // "enum": [ + // "draft", + // "live", + // "scheduled" + // ], + // "enumDescriptions": [ + // "Draft posts", + // "Published posts", + // "Posts that are scheduled to publish in future." + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "userId": { + // "description": "ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "view": { + // "description": "Access level with which to view the returned result. Note that some fields require elevated access.", + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Reader level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "users/{userId}/blogs/{blogId}/posts", + // "response": { + // "$ref": "PostUserInfosList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.posts.delete": + +type PostsDeleteCall struct { + s *Service + blogId string + postId string + opt_ map[string]interface{} +} + +// Delete: Delete a post by id. +func (r *PostsService) Delete(blogId string, postId string) *PostsDeleteCall { + c := &PostsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + return c +} + +func (c *PostsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a post by id.", + // "httpMethod": "DELETE", + // "id": "blogger.posts.delete", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "The Id of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}", + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.posts.get": + +type PostsGetCall struct { + s *Service + blogId string + postId string + opt_ map[string]interface{} +} + +// Get: Get a post by id. +func (r *PostsService) Get(blogId string, postId string) *PostsGetCall { + c := &PostsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + return c +} + +// FetchBody sets the optional parameter "fetchBody": Whether the body +// content of the post is included (default: true). This should be set +// to false when the post bodies are not required, to help minimize +// traffic. +func (c *PostsGetCall) FetchBody(fetchBody bool) *PostsGetCall { + c.opt_["fetchBody"] = fetchBody + return c +} + +// FetchImages sets the optional parameter "fetchImages": Whether image +// URL metadata for each post is included (default: false). +func (c *PostsGetCall) FetchImages(fetchImages bool) *PostsGetCall { + c.opt_["fetchImages"] = fetchImages + return c +} + +// MaxComments sets the optional parameter "maxComments": Maximum number +// of comments to pull back on a post. +func (c *PostsGetCall) MaxComments(maxComments int64) *PostsGetCall { + c.opt_["maxComments"] = maxComments + return c +} + +// View sets the optional parameter "view": Access level with which to +// view the returned result. Note that some fields require elevated +// access. +func (c *PostsGetCall) View(view string) *PostsGetCall { + c.opt_["view"] = view + return c +} + +func (c *PostsGetCall) Do() (*Post, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["fetchBody"]; ok { + params.Set("fetchBody", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchImages"]; ok { + params.Set("fetchImages", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxComments"]; ok { + params.Set("maxComments", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a post by id.", + // "httpMethod": "GET", + // "id": "blogger.posts.get", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch the post from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fetchBody": { + // "default": "true", + // "description": "Whether the body content of the post is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.", + // "location": "query", + // "type": "boolean" + // }, + // "fetchImages": { + // "description": "Whether image URL metadata for each post is included (default: false).", + // "location": "query", + // "type": "boolean" + // }, + // "maxComments": { + // "description": "Maximum number of comments to pull back on a post.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "postId": { + // "description": "The ID of the post", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "view": { + // "description": "Access level with which to view the returned result. Note that some fields require elevated access.", + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Reader level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}", + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.posts.getByPath": + +type PostsGetByPathCall struct { + s *Service + blogId string + path string + opt_ map[string]interface{} +} + +// GetByPath: Retrieve a Post by Path. +func (r *PostsService) GetByPath(blogId string, path string) *PostsGetByPathCall { + c := &PostsGetByPathCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.path = path + return c +} + +// MaxComments sets the optional parameter "maxComments": Maximum number +// of comments to pull back on a post. +func (c *PostsGetByPathCall) MaxComments(maxComments int64) *PostsGetByPathCall { + c.opt_["maxComments"] = maxComments + return c +} + +// View sets the optional parameter "view": Access level with which to +// view the returned result. Note that some fields require elevated +// access. +func (c *PostsGetByPathCall) View(view string) *PostsGetByPathCall { + c.opt_["view"] = view + return c +} + +func (c *PostsGetByPathCall) Do() (*Post, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("path", fmt.Sprintf("%v", c.path)) + if v, ok := c.opt_["maxComments"]; ok { + params.Set("maxComments", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/bypath") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve a Post by Path.", + // "httpMethod": "GET", + // "id": "blogger.posts.getByPath", + // "parameterOrder": [ + // "blogId", + // "path" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch the post from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxComments": { + // "description": "Maximum number of comments to pull back on a post.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "path": { + // "description": "Path of the Post to retrieve.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "view": { + // "description": "Access level with which to view the returned result. Note that some fields require elevated access.", + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Reader level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/bypath", + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.posts.insert": + +type PostsInsertCall struct { + s *Service + blogId string + post *Post + opt_ map[string]interface{} +} + +// Insert: Add a post. +func (r *PostsService) Insert(blogId string, post *Post) *PostsInsertCall { + c := &PostsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.post = post + return c +} + +// FetchBody sets the optional parameter "fetchBody": Whether the body +// content of the post is included with the result (default: true). +func (c *PostsInsertCall) FetchBody(fetchBody bool) *PostsInsertCall { + c.opt_["fetchBody"] = fetchBody + return c +} + +// FetchImages sets the optional parameter "fetchImages": Whether image +// URL metadata for each post is included in the returned result +// (default: false). +func (c *PostsInsertCall) FetchImages(fetchImages bool) *PostsInsertCall { + c.opt_["fetchImages"] = fetchImages + return c +} + +// IsDraft sets the optional parameter "isDraft": Whether to create the +// post as a draft (default: false). +func (c *PostsInsertCall) IsDraft(isDraft bool) *PostsInsertCall { + c.opt_["isDraft"] = isDraft + return c +} + +func (c *PostsInsertCall) Do() (*Post, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["fetchBody"]; ok { + params.Set("fetchBody", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchImages"]; ok { + params.Set("fetchImages", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["isDraft"]; ok { + params.Set("isDraft", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add a post.", + // "httpMethod": "POST", + // "id": "blogger.posts.insert", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to add the post to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fetchBody": { + // "default": "true", + // "description": "Whether the body content of the post is included with the result (default: true).", + // "location": "query", + // "type": "boolean" + // }, + // "fetchImages": { + // "description": "Whether image URL metadata for each post is included in the returned result (default: false).", + // "location": "query", + // "type": "boolean" + // }, + // "isDraft": { + // "description": "Whether to create the post as a draft (default: false).", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "blogs/{blogId}/posts", + // "request": { + // "$ref": "Post" + // }, + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.posts.list": + +type PostsListCall struct { + s *Service + blogId string + opt_ map[string]interface{} +} + +// List: Retrieves a list of posts, possibly filtered. +func (r *PostsService) List(blogId string) *PostsListCall { + c := &PostsListCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + return c +} + +// EndDate sets the optional parameter "endDate": Latest post date to +// fetch, a date-time with RFC 3339 formatting. +func (c *PostsListCall) EndDate(endDate string) *PostsListCall { + c.opt_["endDate"] = endDate + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether the +// body content of posts is included (default: true). This should be set +// to false when the post bodies are not required, to help minimize +// traffic. +func (c *PostsListCall) FetchBodies(fetchBodies bool) *PostsListCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// FetchImages sets the optional parameter "fetchImages": Whether image +// URL metadata for each post is included. +func (c *PostsListCall) FetchImages(fetchImages bool) *PostsListCall { + c.opt_["fetchImages"] = fetchImages + return c +} + +// Labels sets the optional parameter "labels": Comma-separated list of +// labels to search for. +func (c *PostsListCall) Labels(labels string) *PostsListCall { + c.opt_["labels"] = labels + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of posts to fetch. +func (c *PostsListCall) MaxResults(maxResults int64) *PostsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sort search results +func (c *PostsListCall) OrderBy(orderBy string) *PostsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// if the request is paged. +func (c *PostsListCall) PageToken(pageToken string) *PostsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartDate sets the optional parameter "startDate": Earliest post date +// to fetch, a date-time with RFC 3339 formatting. +func (c *PostsListCall) StartDate(startDate string) *PostsListCall { + c.opt_["startDate"] = startDate + return c +} + +// Status sets the optional parameter "status": Statuses to include in +// the results. +func (c *PostsListCall) Status(status string) *PostsListCall { + c.opt_["status"] = status + return c +} + +// View sets the optional parameter "view": Access level with which to +// view the returned result. Note that some fields require escalated +// access. +func (c *PostsListCall) View(view string) *PostsListCall { + c.opt_["view"] = view + return c +} + +func (c *PostsListCall) Do() (*PostList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["endDate"]; ok { + params.Set("endDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchImages"]; ok { + params.Set("fetchImages", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["labels"]; ok { + params.Set("labels", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startDate"]; ok { + params.Set("startDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["status"]; ok { + params.Set("status", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PostList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of posts, possibly filtered.", + // "httpMethod": "GET", + // "id": "blogger.posts.list", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch posts from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "endDate": { + // "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "fetchBodies": { + // "default": "true", + // "description": "Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.", + // "location": "query", + // "type": "boolean" + // }, + // "fetchImages": { + // "description": "Whether image URL metadata for each post is included.", + // "location": "query", + // "type": "boolean" + // }, + // "labels": { + // "description": "Comma-separated list of labels to search for.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of posts to fetch.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "orderBy": { + // "default": "PUBLISHED", + // "description": "Sort search results", + // "enum": [ + // "published", + // "updated" + // ], + // "enumDescriptions": [ + // "Order by the date the post was published", + // "Order by the date the post was last updated" + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Continuation token if the request is paged.", + // "location": "query", + // "type": "string" + // }, + // "startDate": { + // "description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "status": { + // "description": "Statuses to include in the results.", + // "enum": [ + // "draft", + // "live", + // "scheduled" + // ], + // "enumDescriptions": [ + // "Draft (non-published) posts.", + // "Published posts", + // "Posts that are scheduled to publish in the future." + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "view": { + // "description": "Access level with which to view the returned result. Note that some fields require escalated access.", + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Reader level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts", + // "response": { + // "$ref": "PostList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.posts.patch": + +type PostsPatchCall struct { + s *Service + blogId string + postId string + post *Post + opt_ map[string]interface{} +} + +// Patch: Update a post. This method supports patch semantics. +func (r *PostsService) Patch(blogId string, postId string, post *Post) *PostsPatchCall { + c := &PostsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.post = post + return c +} + +// FetchBody sets the optional parameter "fetchBody": Whether the body +// content of the post is included with the result (default: true). +func (c *PostsPatchCall) FetchBody(fetchBody bool) *PostsPatchCall { + c.opt_["fetchBody"] = fetchBody + return c +} + +// FetchImages sets the optional parameter "fetchImages": Whether image +// URL metadata for each post is included in the returned result +// (default: false). +func (c *PostsPatchCall) FetchImages(fetchImages bool) *PostsPatchCall { + c.opt_["fetchImages"] = fetchImages + return c +} + +// MaxComments sets the optional parameter "maxComments": Maximum number +// of comments to retrieve with the returned post. +func (c *PostsPatchCall) MaxComments(maxComments int64) *PostsPatchCall { + c.opt_["maxComments"] = maxComments + return c +} + +// Publish sets the optional parameter "publish": Whether a publish +// action should be performed when the post is updated (default: false). +func (c *PostsPatchCall) Publish(publish bool) *PostsPatchCall { + c.opt_["publish"] = publish + return c +} + +// Revert sets the optional parameter "revert": Whether a revert action +// should be performed when the post is updated (default: false). +func (c *PostsPatchCall) Revert(revert bool) *PostsPatchCall { + c.opt_["revert"] = revert + return c +} + +func (c *PostsPatchCall) Do() (*Post, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["fetchBody"]; ok { + params.Set("fetchBody", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchImages"]; ok { + params.Set("fetchImages", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxComments"]; ok { + params.Set("maxComments", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["publish"]; ok { + params.Set("publish", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["revert"]; ok { + params.Set("revert", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a post. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "blogger.posts.patch", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fetchBody": { + // "default": "true", + // "description": "Whether the body content of the post is included with the result (default: true).", + // "location": "query", + // "type": "boolean" + // }, + // "fetchImages": { + // "description": "Whether image URL metadata for each post is included in the returned result (default: false).", + // "location": "query", + // "type": "boolean" + // }, + // "maxComments": { + // "description": "Maximum number of comments to retrieve with the returned post.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "publish": { + // "description": "Whether a publish action should be performed when the post is updated (default: false).", + // "location": "query", + // "type": "boolean" + // }, + // "revert": { + // "description": "Whether a revert action should be performed when the post is updated (default: false).", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}", + // "request": { + // "$ref": "Post" + // }, + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.posts.publish": + +type PostsPublishCall struct { + s *Service + blogId string + postId string + opt_ map[string]interface{} +} + +// Publish: Publish a draft post. +func (r *PostsService) Publish(blogId string, postId string) *PostsPublishCall { + c := &PostsPublishCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + return c +} + +// PublishDate sets the optional parameter "publishDate": The date and +// time to schedule the publishing of the Blog. +func (c *PostsPublishCall) PublishDate(publishDate string) *PostsPublishCall { + c.opt_["publishDate"] = publishDate + return c +} + +func (c *PostsPublishCall) Do() (*Post, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["publishDate"]; ok { + params.Set("publishDate", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/publish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Publish a draft post.", + // "httpMethod": "POST", + // "id": "blogger.posts.publish", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "publishDate": { + // "description": "The date and time to schedule the publishing of the Blog.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/publish", + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.posts.revert": + +type PostsRevertCall struct { + s *Service + blogId string + postId string + opt_ map[string]interface{} +} + +// Revert: Revert a published or scheduled post to draft state. +func (r *PostsService) Revert(blogId string, postId string) *PostsRevertCall { + c := &PostsRevertCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + return c +} + +func (c *PostsRevertCall) Do() (*Post, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/revert") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Revert a published or scheduled post to draft state.", + // "httpMethod": "POST", + // "id": "blogger.posts.revert", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/revert", + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.posts.search": + +type PostsSearchCall struct { + s *Service + blogId string + q string + opt_ map[string]interface{} +} + +// Search: Search for a post. +func (r *PostsService) Search(blogId string, q string) *PostsSearchCall { + c := &PostsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.q = q + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether the +// body content of posts is included (default: true). This should be set +// to false when the post bodies are not required, to help minimize +// traffic. +func (c *PostsSearchCall) FetchBodies(fetchBodies bool) *PostsSearchCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// OrderBy sets the optional parameter "orderBy": Sort search results +func (c *PostsSearchCall) OrderBy(orderBy string) *PostsSearchCall { + c.opt_["orderBy"] = orderBy + return c +} + +func (c *PostsSearchCall) Do() (*PostList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("q", fmt.Sprintf("%v", c.q)) + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/search") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PostList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Search for a post.", + // "httpMethod": "GET", + // "id": "blogger.posts.search", + // "parameterOrder": [ + // "blogId", + // "q" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch the post from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fetchBodies": { + // "default": "true", + // "description": "Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.", + // "location": "query", + // "type": "boolean" + // }, + // "orderBy": { + // "default": "PUBLISHED", + // "description": "Sort search results", + // "enum": [ + // "published", + // "updated" + // ], + // "enumDescriptions": [ + // "Order by the date the post was published", + // "Order by the date the post was last updated" + // ], + // "location": "query", + // "type": "string" + // }, + // "q": { + // "description": "Query terms to search this blog for matching posts.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/search", + // "response": { + // "$ref": "PostList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.posts.update": + +type PostsUpdateCall struct { + s *Service + blogId string + postId string + post *Post + opt_ map[string]interface{} +} + +// Update: Update a post. +func (r *PostsService) Update(blogId string, postId string, post *Post) *PostsUpdateCall { + c := &PostsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.post = post + return c +} + +// FetchBody sets the optional parameter "fetchBody": Whether the body +// content of the post is included with the result (default: true). +func (c *PostsUpdateCall) FetchBody(fetchBody bool) *PostsUpdateCall { + c.opt_["fetchBody"] = fetchBody + return c +} + +// FetchImages sets the optional parameter "fetchImages": Whether image +// URL metadata for each post is included in the returned result +// (default: false). +func (c *PostsUpdateCall) FetchImages(fetchImages bool) *PostsUpdateCall { + c.opt_["fetchImages"] = fetchImages + return c +} + +// MaxComments sets the optional parameter "maxComments": Maximum number +// of comments to retrieve with the returned post. +func (c *PostsUpdateCall) MaxComments(maxComments int64) *PostsUpdateCall { + c.opt_["maxComments"] = maxComments + return c +} + +// Publish sets the optional parameter "publish": Whether a publish +// action should be performed when the post is updated (default: false). +func (c *PostsUpdateCall) Publish(publish bool) *PostsUpdateCall { + c.opt_["publish"] = publish + return c +} + +// Revert sets the optional parameter "revert": Whether a revert action +// should be performed when the post is updated (default: false). +func (c *PostsUpdateCall) Revert(revert bool) *PostsUpdateCall { + c.opt_["revert"] = revert + return c +} + +func (c *PostsUpdateCall) Do() (*Post, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["fetchBody"]; ok { + params.Set("fetchBody", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchImages"]; ok { + params.Set("fetchImages", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxComments"]; ok { + params.Set("maxComments", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["publish"]; ok { + params.Set("publish", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["revert"]; ok { + params.Set("revert", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a post.", + // "httpMethod": "PUT", + // "id": "blogger.posts.update", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fetchBody": { + // "default": "true", + // "description": "Whether the body content of the post is included with the result (default: true).", + // "location": "query", + // "type": "boolean" + // }, + // "fetchImages": { + // "description": "Whether image URL metadata for each post is included in the returned result (default: false).", + // "location": "query", + // "type": "boolean" + // }, + // "maxComments": { + // "description": "Maximum number of comments to retrieve with the returned post.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "publish": { + // "description": "Whether a publish action should be performed when the post is updated (default: false).", + // "location": "query", + // "type": "boolean" + // }, + // "revert": { + // "description": "Whether a revert action should be performed when the post is updated (default: false).", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}", + // "request": { + // "$ref": "Post" + // }, + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.users.get": + +type UsersGetCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// Get: Gets one user by id. +func (r *UsersService) Get(userId string) *UsersGetCall { + c := &UsersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +func (c *UsersGetCall) Do() (*User, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(User) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one user by id.", + // "httpMethod": "GET", + // "id": "blogger.users.get", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "description": "The ID of the user to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userId}", + // "response": { + // "$ref": "User" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/books/v1/books-api.json b/third_party/src/code.google.com/p/google-api-go-client/books/v1/books-api.json new file mode 100644 index 0000000000000..97285d4bbc274 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/books/v1/books-api.json @@ -0,0 +1,3623 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/XBSlG6TmG-jHEwOVRN7HZMHldrk\"", + "discoveryVersion": "v1", + "id": "books:v1", + "name": "books", + "version": "v1", + "title": "Books API", + "description": "Lets you search for books and manage your Google Books library.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/ebooks-16.png", + "x32": "http://www.google.com/images/icons/product/ebooks-32.png" + }, + "documentationLink": "https://developers.google.com/books/docs/v1/getting_started", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/books/v1/", + "basePath": "/books/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "books/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/books": { + "description": "Manage your books" + } + } + } + }, + "schemas": { + "Annotation": { + "id": "Annotation", + "type": "object", + "properties": { + "afterSelectedText": { + "type": "string", + "description": "Anchor text after excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty." + }, + "beforeSelectedText": { + "type": "string", + "description": "Anchor text before excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty." + }, + "clientVersionRanges": { + "type": "object", + "description": "Selection ranges sent from the client.", + "properties": { + "cfiRange": { + "$ref": "BooksAnnotationsRange", + "description": "Range in CFI format for this annotation sent by client." + }, + "contentVersion": { + "type": "string", + "description": "Content version the client sent in." + }, + "gbImageRange": { + "$ref": "BooksAnnotationsRange", + "description": "Range in GB image format for this annotation sent by client." + }, + "gbTextRange": { + "$ref": "BooksAnnotationsRange", + "description": "Range in GB text format for this annotation sent by client." + }, + "imageCfiRange": { + "$ref": "BooksAnnotationsRange", + "description": "Range in image CFI format for this annotation sent by client." + } + } + }, + "created": { + "type": "string", + "description": "Timestamp for the created time of this annotation.", + "format": "date-time" + }, + "currentVersionRanges": { + "type": "object", + "description": "Selection ranges for the most recent content version.", + "properties": { + "cfiRange": { + "$ref": "BooksAnnotationsRange", + "description": "Range in CFI format for this annotation for version above." + }, + "contentVersion": { + "type": "string", + "description": "Content version applicable to ranges below." + }, + "gbImageRange": { + "$ref": "BooksAnnotationsRange", + "description": "Range in GB image format for this annotation for version above." + }, + "gbTextRange": { + "$ref": "BooksAnnotationsRange", + "description": "Range in GB text format for this annotation for version above." + }, + "imageCfiRange": { + "$ref": "BooksAnnotationsRange", + "description": "Range in image CFI format for this annotation for version above." + } + } + }, + "data": { + "type": "string", + "description": "User-created data for this annotation." + }, + "deleted": { + "type": "boolean", + "description": "Indicates that this annotation is deleted." + }, + "highlightStyle": { + "type": "string", + "description": "The highlight style for this annotation." + }, + "id": { + "type": "string", + "description": "Id of this annotation, in the form of a GUID." + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "books#annotation" + }, + "layerId": { + "type": "string", + "description": "The layer this annotation is for." + }, + "layerSummary": { + "type": "object", + "properties": { + "allowedCharacterCount": { + "type": "integer", + "description": "Maximum allowed characters on this layer, especially for the \"copy\" layer.", + "format": "int32" + }, + "limitType": { + "type": "string", + "description": "Type of limitation on this layer. \"limited\" or \"unlimited\" for the \"copy\" layer." + }, + "remainingCharacterCount": { + "type": "integer", + "description": "Remaining allowed characters on this layer, especially for the \"copy\" layer.", + "format": "int32" + } + } + }, + "pageIds": { + "type": "array", + "description": "Pages that this annotation spans.", + "items": { + "type": "string" + } + }, + "selectedText": { + "type": "string", + "description": "Excerpt from the volume." + }, + "selfLink": { + "type": "string", + "description": "URL to this resource." + }, + "updated": { + "type": "string", + "description": "Timestamp for the last time this annotation was modified.", + "format": "date-time" + }, + "volumeId": { + "type": "string", + "description": "The volume that this annotation belongs to." + } + } + }, + "Annotationdata": { + "id": "Annotationdata", + "type": "object", + "properties": { + "annotationType": { + "type": "string", + "description": "The type of annotation this data is for." + }, + "data": { + "type": "any" + }, + "encoded_data": { + "type": "string", + "description": "Base64 encoded data for this annotation data.", + "format": "byte" + }, + "id": { + "type": "string", + "description": "Unique id for this annotation data." + }, + "kind": { + "type": "string", + "description": "Resource Type", + "default": "books#annotationdata" + }, + "layerId": { + "type": "string", + "description": "The Layer id for this data. *" + }, + "selfLink": { + "type": "string", + "description": "URL for this resource. *" + }, + "updated": { + "type": "string", + "description": "Timestamp for the last time this data was updated. (RFC 3339 UTC date-time format).", + "format": "date-time" + }, + "volumeId": { + "type": "string", + "description": "The volume id for this data. *" + } + } + }, + "Annotations": { + "id": "Annotations", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "A list of annotations.", + "items": { + "$ref": "Annotation" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "books#annotations" + }, + "nextPageToken": { + "type": "string", + "description": "Token to pass in for pagination for the next page. This will not be present if this request does not have more results." + }, + "totalItems": { + "type": "integer", + "description": "Total number of annotations found. This may be greater than the number of notes returned in this response if results have been paginated.", + "format": "int32" + } + } + }, + "AnnotationsSummary": { + "id": "AnnotationsSummary", + "type": "object", + "properties": { + "kind": { + "type": "string", + "default": "books#annotationsSummary" + }, + "layers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "allowedCharacterCount": { + "type": "integer", + "format": "int32" + }, + "layerId": { + "type": "string" + }, + "limitType": { + "type": "string" + }, + "remainingCharacterCount": { + "type": "integer", + "format": "int32" + }, + "updated": { + "type": "string", + "format": "date-time" + } + } + } + } + } + }, + "Annotationsdata": { + "id": "Annotationsdata", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "A list of Annotation Data.", + "items": { + "$ref": "Annotationdata" + } + }, + "kind": { + "type": "string", + "description": "Resource type", + "default": "books#annotationsdata" + }, + "nextPageToken": { + "type": "string", + "description": "Token to pass in for pagination for the next page. This will not be present if this request does not have more results." + }, + "totalItems": { + "type": "integer", + "description": "The total number of volume annotations found.", + "format": "int32" + } + } + }, + "BooksAnnotationsRange": { + "id": "BooksAnnotationsRange", + "type": "object", + "properties": { + "endOffset": { + "type": "string", + "description": "The offset from the ending position." + }, + "endPosition": { + "type": "string", + "description": "The ending position for the range." + }, + "startOffset": { + "type": "string", + "description": "The offset from the starting position." + }, + "startPosition": { + "type": "string", + "description": "The starting position for the range." + } + } + }, + "BooksCloudloadingResource": { + "id": "BooksCloudloadingResource", + "type": "object", + "properties": { + "author": { + "type": "string" + }, + "processingState": { + "type": "string" + }, + "title": { + "type": "string" + }, + "volumeId": { + "type": "string" + } + } + }, + "BooksVolumesRecommendedRateResponse": { + "id": "BooksVolumesRecommendedRateResponse", + "type": "object", + "properties": { + "consistency_token": { + "type": "string" + } + } + }, + "Bookshelf": { + "id": "Bookshelf", + "type": "object", + "properties": { + "access": { + "type": "string", + "description": "Whether this bookshelf is PUBLIC or PRIVATE." + }, + "created": { + "type": "string", + "description": "Created time for this bookshelf (formatted UTC timestamp with millisecond resolution).", + "format": "date-time" + }, + "description": { + "type": "string", + "description": "Description of this bookshelf." + }, + "id": { + "type": "integer", + "description": "Id of this bookshelf, only unique by user.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Resource type for bookshelf metadata.", + "default": "books#bookshelf" + }, + "selfLink": { + "type": "string", + "description": "URL to this resource." + }, + "title": { + "type": "string", + "description": "Title of this bookshelf." + }, + "updated": { + "type": "string", + "description": "Last modified time of this bookshelf (formatted UTC timestamp with millisecond resolution).", + "format": "date-time" + }, + "volumeCount": { + "type": "integer", + "description": "Number of volumes in this bookshelf.", + "format": "int32" + }, + "volumesLastUpdated": { + "type": "string", + "description": "Last time a volume was added or removed from this bookshelf (formatted UTC timestamp with millisecond resolution).", + "format": "date-time" + } + } + }, + "Bookshelves": { + "id": "Bookshelves", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "A list of bookshelves.", + "items": { + "$ref": "Bookshelf" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "books#bookshelves" + } + } + }, + "ConcurrentAccessRestriction": { + "id": "ConcurrentAccessRestriction", + "type": "object", + "properties": { + "deviceAllowed": { + "type": "boolean", + "description": "Whether access is granted for this (user, device, volume)." + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "books#concurrentAccessRestriction" + }, + "maxConcurrentDevices": { + "type": "integer", + "description": "The maximum number of concurrent access licenses for this volume.", + "format": "int32" + }, + "message": { + "type": "string", + "description": "Error/warning message." + }, + "nonce": { + "type": "string", + "description": "Client nonce for verification. Download access and client-validation only." + }, + "reasonCode": { + "type": "string", + "description": "Error/warning reason code." + }, + "restricted": { + "type": "boolean", + "description": "Whether this volume has any concurrent access restrictions." + }, + "signature": { + "type": "string", + "description": "Response signature." + }, + "source": { + "type": "string", + "description": "Client app identifier for verification. Download access and client-validation only." + }, + "timeWindowSeconds": { + "type": "integer", + "description": "Time in seconds for license auto-expiration.", + "format": "int32" + }, + "volumeId": { + "type": "string", + "description": "Identifies the volume for which this entry applies." + } + } + }, + "Dictlayerdata": { + "id": "Dictlayerdata", + "type": "object", + "properties": { + "common": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "The display title and localized canonical name to use when searching for this entity on Google search." + } + } + }, + "dict": { + "type": "object", + "properties": { + "source": { + "type": "object", + "description": "The source, url and attribution for this dictionary data.", + "properties": { + "attribution": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "words": { + "type": "array", + "items": { + "type": "object", + "properties": { + "derivatives": { + "type": "array", + "items": { + "type": "object", + "properties": { + "source": { + "type": "object", + "properties": { + "attribution": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "text": { + "type": "string" + } + } + } + }, + "examples": { + "type": "array", + "items": { + "type": "object", + "properties": { + "source": { + "type": "object", + "properties": { + "attribution": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "text": { + "type": "string" + } + } + } + }, + "senses": { + "type": "array", + "items": { + "type": "object", + "properties": { + "conjugations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "definitions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "definition": { + "type": "string" + }, + "examples": { + "type": "array", + "items": { + "type": "object", + "properties": { + "source": { + "type": "object", + "properties": { + "attribution": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "text": { + "type": "string" + } + } + } + } + } + } + }, + "partOfSpeech": { + "type": "string" + }, + "pronunciation": { + "type": "string" + }, + "pronunciationUrl": { + "type": "string" + }, + "source": { + "type": "object", + "properties": { + "attribution": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "syllabification": { + "type": "string" + }, + "synonyms": { + "type": "array", + "items": { + "type": "object", + "properties": { + "source": { + "type": "object", + "properties": { + "attribution": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "text": { + "type": "string" + } + } + } + } + } + } + }, + "source": { + "type": "object", + "description": "The words with different meanings but not related words, e.g. \"go\" (game) and \"go\" (verb).", + "properties": { + "attribution": { + "type": "string" + }, + "url": { + "type": "string" + } + } + } + } + } + } + } + }, + "kind": { + "type": "string", + "default": "books#dictlayerdata" + } + } + }, + "DownloadAccessRestriction": { + "id": "DownloadAccessRestriction", + "type": "object", + "properties": { + "deviceAllowed": { + "type": "boolean", + "description": "If restricted, whether access is granted for this (user, device, volume)." + }, + "downloadsAcquired": { + "type": "integer", + "description": "If restricted, the number of content download licenses already acquired (including the requesting client, if licensed).", + "format": "int32" + }, + "justAcquired": { + "type": "boolean", + "description": "If deviceAllowed, whether access was just acquired with this request." + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "books#downloadAccessRestriction" + }, + "maxDownloadDevices": { + "type": "integer", + "description": "If restricted, the maximum number of content download licenses for this volume.", + "format": "int32" + }, + "message": { + "type": "string", + "description": "Error/warning message." + }, + "nonce": { + "type": "string", + "description": "Client nonce for verification. Download access and client-validation only." + }, + "reasonCode": { + "type": "string", + "description": "Error/warning reason code. Additional codes may be added in the future. 0 OK 100 ACCESS_DENIED_PUBLISHER_LIMIT 101 ACCESS_DENIED_LIMIT 200 WARNING_USED_LAST_ACCESS" + }, + "restricted": { + "type": "boolean", + "description": "Whether this volume has any download access restrictions." + }, + "signature": { + "type": "string", + "description": "Response signature." + }, + "source": { + "type": "string", + "description": "Client app identifier for verification. Download access and client-validation only." + }, + "volumeId": { + "type": "string", + "description": "Identifies the volume for which this entry applies." + } + } + }, + "DownloadAccesses": { + "id": "DownloadAccesses", + "type": "object", + "properties": { + "downloadAccessList": { + "type": "array", + "description": "A list of download access responses.", + "items": { + "$ref": "DownloadAccessRestriction" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "books#downloadAccesses" + } + } + }, + "Geolayerdata": { + "id": "Geolayerdata", + "type": "object", + "properties": { + "common": { + "type": "object", + "properties": { + "lang": { + "type": "string", + "description": "The language of the information url and description." + }, + "previewImageUrl": { + "type": "string", + "description": "The URL for the preview image information." + }, + "snippet": { + "type": "string", + "description": "The description for this location." + }, + "snippetUrl": { + "type": "string", + "description": "The URL for information for this location. Ex: wikipedia link." + }, + "title": { + "type": "string", + "description": "The display title and localized canonical name to use when searching for this entity on Google search." + } + } + }, + "geo": { + "type": "object", + "properties": { + "boundary": { + "type": "array", + "description": "The boundary of the location as a set of loops containing pairs of latitude, longitude coordinates.", + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "latitude": { + "type": "integer", + "format": "uint32" + }, + "longitude": { + "type": "integer", + "format": "uint32" + } + } + } + } + }, + "cachePolicy": { + "type": "string", + "description": "The cache policy active for this data. EX: UNRESTRICTED, RESTRICTED, NEVER" + }, + "countryCode": { + "type": "string", + "description": "The country code of the location." + }, + "latitude": { + "type": "number", + "description": "The latitude of the location.", + "format": "double" + }, + "longitude": { + "type": "number", + "description": "The longitude of the location.", + "format": "double" + }, + "mapType": { + "type": "string", + "description": "The type of map that should be used for this location. EX: HYBRID, ROADMAP, SATELLITE, TERRAIN" + }, + "viewport": { + "type": "object", + "description": "The viewport for showing this location. This is a latitude, longitude rectangle.", + "properties": { + "hi": { + "type": "object", + "properties": { + "latitude": { + "type": "number", + "format": "double" + }, + "longitude": { + "type": "number", + "format": "double" + } + } + }, + "lo": { + "type": "object", + "properties": { + "latitude": { + "type": "number", + "format": "double" + }, + "longitude": { + "type": "number", + "format": "double" + } + } + } + } + }, + "zoom": { + "type": "integer", + "description": "The Zoom level to use for the map. Zoom levels between 0 (the lowest zoom level, in which the entire world can be seen on one map) to 21+ (down to individual buildings). See: https://developers.google.com/maps/documentation/staticmaps/#Zoomlevels", + "format": "int32" + } + } + }, + "kind": { + "type": "string", + "default": "books#geolayerdata" + } + } + }, + "Layersummaries": { + "id": "Layersummaries", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "A list of layer summary items.", + "items": { + "$ref": "Layersummary" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "books#layersummaries" + }, + "totalItems": { + "type": "integer", + "description": "The total number of layer summaries found.", + "format": "int32" + } + } + }, + "Layersummary": { + "id": "Layersummary", + "type": "object", + "properties": { + "annotationCount": { + "type": "integer", + "description": "The number of annotations for this layer.", + "format": "int32" + }, + "annotationTypes": { + "type": "array", + "description": "The list of annotation types contained for this layer.", + "items": { + "type": "string" + } + }, + "annotationsDataLink": { + "type": "string", + "description": "Link to get data for this annotation." + }, + "annotationsLink": { + "type": "string", + "description": "The link to get the annotations for this layer." + }, + "contentVersion": { + "type": "string", + "description": "The content version this resource is for." + }, + "dataCount": { + "type": "integer", + "description": "The number of data items for this layer.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "Unique id of this layer summary." + }, + "kind": { + "type": "string", + "description": "Resource Type", + "default": "books#layersummary" + }, + "layerId": { + "type": "string", + "description": "The layer id for this summary." + }, + "selfLink": { + "type": "string", + "description": "URL to this resource." + }, + "updated": { + "type": "string", + "description": "Timestamp for the last time an item in this layer was updated. (RFC 3339 UTC date-time format).", + "format": "date-time" + }, + "volumeAnnotationsVersion": { + "type": "string", + "description": "The current version of this layer's volume annotations. Note that this version applies only to the data in the books.layers.volumeAnnotations.* responses. The actual annotation data is versioned separately." + }, + "volumeId": { + "type": "string", + "description": "The volume id this resource is for." + } + } + }, + "ReadingPosition": { + "id": "ReadingPosition", + "type": "object", + "properties": { + "epubCfiPosition": { + "type": "string", + "description": "Position in an EPUB as a CFI." + }, + "gbImagePosition": { + "type": "string", + "description": "Position in a volume for image-based content." + }, + "gbTextPosition": { + "type": "string", + "description": "Position in a volume for text-based content." + }, + "kind": { + "type": "string", + "description": "Resource type for a reading position.", + "default": "books#readingPosition" + }, + "pdfPosition": { + "type": "string", + "description": "Position in a PDF file." + }, + "updated": { + "type": "string", + "description": "Timestamp when this reading position was last updated (formatted UTC timestamp with millisecond resolution).", + "format": "date-time" + }, + "volumeId": { + "type": "string", + "description": "Volume id associated with this reading position." + } + } + }, + "RequestAccess": { + "id": "RequestAccess", + "type": "object", + "properties": { + "concurrentAccess": { + "$ref": "ConcurrentAccessRestriction", + "description": "A concurrent access response." + }, + "downloadAccess": { + "$ref": "DownloadAccessRestriction", + "description": "A download access response." + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "books#requestAccess" + } + } + }, + "Review": { + "id": "Review", + "type": "object", + "properties": { + "author": { + "type": "object", + "description": "Author of this review.", + "properties": { + "displayName": { + "type": "string", + "description": "Name of this person." + } + } + }, + "content": { + "type": "string", + "description": "Review text." + }, + "date": { + "type": "string", + "description": "Date of this review." + }, + "fullTextUrl": { + "type": "string", + "description": "URL for the full review text, for reviews gathered from the web." + }, + "kind": { + "type": "string", + "description": "Resource type for a review.", + "default": "books#review" + }, + "rating": { + "type": "string", + "description": "Star rating for this review. Possible values are ONE, TWO, THREE, FOUR, FIVE or NOT_RATED." + }, + "source": { + "type": "object", + "description": "Information regarding the source of this review, when the review is not from a Google Books user.", + "properties": { + "description": { + "type": "string", + "description": "Name of the source." + }, + "extraDescription": { + "type": "string", + "description": "Extra text about the source of the review." + }, + "url": { + "type": "string", + "description": "URL of the source of the review." + } + } + }, + "title": { + "type": "string", + "description": "Title for this review." + }, + "type": { + "type": "string", + "description": "Source type for this review. Possible values are EDITORIAL, WEB_USER or GOOGLE_USER." + }, + "volumeId": { + "type": "string", + "description": "Volume that this review is for." + } + } + }, + "Volume": { + "id": "Volume", + "type": "object", + "properties": { + "accessInfo": { + "type": "object", + "description": "Any information about a volume related to reading or obtaining that volume text. This information can depend on country (books may be public domain in one country but not in another, e.g.).", + "properties": { + "accessViewStatus": { + "type": "string", + "description": "Combines the access and viewability of this volume into a single status field for this user. Values can be FULL_PURCHASED, FULL_PUBLIC_DOMAIN, SAMPLE or NONE. (In LITE projection.)" + }, + "country": { + "type": "string", + "description": "The two-letter ISO_3166-1 country code for which this access information is valid. (In LITE projection.)" + }, + "downloadAccess": { + "$ref": "DownloadAccessRestriction", + "description": "Information about a volume's download license access restrictions." + }, + "driveImportedContentLink": { + "type": "string", + "description": "URL to the Google Drive viewer if this volume is uploaded by the user by selecting the file from Google Drive." + }, + "embeddable": { + "type": "boolean", + "description": "Whether this volume can be embedded in a viewport using the Embedded Viewer API." + }, + "epub": { + "type": "object", + "description": "Information about epub content. (In LITE projection.)", + "properties": { + "acsTokenLink": { + "type": "string", + "description": "URL to retrieve ACS token for epub download. (In LITE projection.)" + }, + "downloadLink": { + "type": "string", + "description": "URL to download epub. (In LITE projection.)" + }, + "isAvailable": { + "type": "boolean", + "description": "Is a flowing text epub available either as public domain or for purchase. (In LITE projection.)" + } + } + }, + "explicitOfflineLicenseManagement": { + "type": "boolean", + "description": "Whether this volume requires that the client explicitly request offline download license rather than have it done automatically when loading the content, if the client supports it." + }, + "pdf": { + "type": "object", + "description": "Information about pdf content. (In LITE projection.)", + "properties": { + "acsTokenLink": { + "type": "string", + "description": "URL to retrieve ACS token for pdf download. (In LITE projection.)" + }, + "downloadLink": { + "type": "string", + "description": "URL to download pdf. (In LITE projection.)" + }, + "isAvailable": { + "type": "boolean", + "description": "Is a scanned image pdf available either as public domain or for purchase. (In LITE projection.)" + } + } + }, + "publicDomain": { + "type": "boolean", + "description": "Whether or not this book is public domain in the country listed above." + }, + "quoteSharingAllowed": { + "type": "boolean", + "description": "Whether quote sharing is allowed for this volume." + }, + "textToSpeechPermission": { + "type": "string", + "description": "Whether text-to-speech is permitted for this volume. Values can be ALLOWED, ALLOWED_FOR_ACCESSIBILITY, or NOT_ALLOWED." + }, + "viewOrderUrl": { + "type": "string", + "description": "For ordered but not yet processed orders, we give a URL that can be used to go to the appropriate Google Wallet page." + }, + "viewability": { + "type": "string", + "description": "The read access of a volume. Possible values are PARTIAL, ALL_PAGES, NO_PAGES or UNKNOWN. This value depends on the country listed above. A value of PARTIAL means that the publisher has allowed some portion of the volume to be viewed publicly, without purchase. This can apply to eBooks as well as non-eBooks. Public domain books will always have a value of ALL_PAGES." + }, + "webReaderLink": { + "type": "string", + "description": "URL to read this volume on the Google Books site. Link will not allow users to read non-viewable volumes." + } + } + }, + "etag": { + "type": "string", + "description": "Opaque identifier for a specific version of a volume resource. (In LITE projection)" + }, + "id": { + "type": "string", + "description": "Unique identifier for a volume. (In LITE projection.)" + }, + "kind": { + "type": "string", + "description": "Resource type for a volume. (In LITE projection.)", + "default": "books#volume" + }, + "layerInfo": { + "type": "object", + "description": "What layers exist in this volume and high level information about them.", + "properties": { + "layers": { + "type": "array", + "description": "A layer should appear here if and only if the layer exists for this book.", + "items": { + "type": "object", + "properties": { + "layerId": { + "type": "string", + "description": "The layer id of this layer (e.g. \"geo\")." + }, + "volumeAnnotationsVersion": { + "type": "string", + "description": "The current version of this layer's volume annotations. Note that this version applies only to the data in the books.layers.volumeAnnotations.* responses. The actual annotation data is versioned separately." + } + } + } + } + } + }, + "recommendedInfo": { + "type": "object", + "description": "Recommendation related information for this volume.", + "properties": { + "explanation": { + "type": "string", + "description": "A text explaining why this volume is recommended." + } + } + }, + "saleInfo": { + "type": "object", + "description": "Any information about a volume related to the eBookstore and/or purchaseability. This information can depend on the country where the request originates from (i.e. books may not be for sale in certain countries).", + "properties": { + "buyLink": { + "type": "string", + "description": "URL to purchase this volume on the Google Books site. (In LITE projection)" + }, + "country": { + "type": "string", + "description": "The two-letter ISO_3166-1 country code for which this sale information is valid. (In LITE projection.)" + }, + "isEbook": { + "type": "boolean", + "description": "Whether or not this volume is an eBook (can be added to the My eBooks shelf)." + }, + "listPrice": { + "type": "object", + "description": "Suggested retail price. (In LITE projection.)", + "properties": { + "amount": { + "type": "number", + "description": "Amount in the currency listed below. (In LITE projection.)", + "format": "double" + }, + "currencyCode": { + "type": "string", + "description": "An ISO 4217, three-letter currency code. (In LITE projection.)" + } + } + }, + "offers": { + "type": "array", + "description": "Offers available for this volume (sales and rentals).", + "items": { + "type": "object", + "properties": { + "finskyOfferType": { + "type": "integer", + "description": "The finsky offer type (e.g., PURCHASE=0 RENTAL=3)", + "format": "int32" + }, + "listPrice": { + "type": "object", + "description": "Offer list (=undiscounted) price in Micros.", + "properties": { + "amountInMicros": { + "type": "number", + "format": "double" + }, + "currencyCode": { + "type": "string" + } + } + }, + "rentalDuration": { + "type": "object", + "description": "The rental duration (for rental offers only).", + "properties": { + "count": { + "type": "number", + "format": "double" + }, + "unit": { + "type": "string" + } + } + }, + "retailPrice": { + "type": "object", + "description": "Offer retail (=discounted) price in Micros", + "properties": { + "amountInMicros": { + "type": "number", + "format": "double" + }, + "currencyCode": { + "type": "string" + } + } + } + } + } + }, + "onSaleDate": { + "type": "string", + "description": "The date on which this book is available for sale.", + "format": "date-time" + }, + "retailPrice": { + "type": "object", + "description": "The actual selling price of the book. This is the same as the suggested retail or list price unless there are offers or discounts on this volume. (In LITE projection.)", + "properties": { + "amount": { + "type": "number", + "description": "Amount in the currency listed below. (In LITE projection.)", + "format": "double" + }, + "currencyCode": { + "type": "string", + "description": "An ISO 4217, three-letter currency code. (In LITE projection.)" + } + } + }, + "saleability": { + "type": "string", + "description": "Whether or not this book is available for sale or offered for free in the Google eBookstore for the country listed above. Possible values are FOR_SALE, FOR_RENTAL_ONLY, FOR_SALE_AND_RENTAL, FREE, NOT_FOR_SALE, or FOR_PREORDER." + } + } + }, + "searchInfo": { + "type": "object", + "description": "Search result information related to this volume.", + "properties": { + "textSnippet": { + "type": "string", + "description": "A text snippet containing the search query." + } + } + }, + "selfLink": { + "type": "string", + "description": "URL to this resource. (In LITE projection.)" + }, + "userInfo": { + "type": "object", + "description": "User specific information related to this volume. (e.g. page this user last read or whether they purchased this book)", + "properties": { + "copy": { + "type": "object", + "description": "Copy/Paste accounting information.", + "properties": { + "allowedCharacterCount": { + "type": "integer", + "format": "int32" + }, + "limitType": { + "type": "string" + }, + "remainingCharacterCount": { + "type": "integer", + "format": "int32" + }, + "updated": { + "type": "string", + "format": "date-time" + } + } + }, + "isInMyBooks": { + "type": "boolean", + "description": "Whether or not this volume is currently in \"my books.\"" + }, + "isPreordered": { + "type": "boolean", + "description": "Whether or not this volume was pre-ordered by the authenticated user making the request. (In LITE projection.)" + }, + "isPurchased": { + "type": "boolean", + "description": "Whether or not this volume was purchased by the authenticated user making the request. (In LITE projection.)" + }, + "isUploaded": { + "type": "boolean", + "description": "Whether or not this volume was user uploaded." + }, + "readingPosition": { + "$ref": "ReadingPosition", + "description": "The user's current reading position in the volume, if one is available. (In LITE projection.)" + }, + "rentalPeriod": { + "type": "object", + "description": "Period during this book is/was a valid rental.", + "properties": { + "endUtcSec": { + "type": "string", + "format": "int64" + }, + "startUtcSec": { + "type": "string", + "format": "int64" + } + } + }, + "rentalState": { + "type": "string", + "description": "Whether this book is an active or an expired rental." + }, + "review": { + "$ref": "Review", + "description": "This user's review of this volume, if one exists." + }, + "updated": { + "type": "string", + "description": "Timestamp when this volume was last modified by a user action, such as a reading position update, volume purchase or writing a review. (RFC 3339 UTC date-time format).", + "format": "date-time" + }, + "userUploadedVolumeInfo": { + "type": "object", + "properties": { + "processingState": { + "type": "string" + } + } + } + } + }, + "volumeInfo": { + "type": "object", + "description": "General volume information.", + "properties": { + "authors": { + "type": "array", + "description": "The names of the authors and/or editors for this volume. (In LITE projection)", + "items": { + "type": "string" + } + }, + "averageRating": { + "type": "number", + "description": "The mean review rating for this volume. (min = 1.0, max = 5.0)", + "format": "double" + }, + "canonicalVolumeLink": { + "type": "string", + "description": "Canonical URL for a volume. (In LITE projection.)" + }, + "categories": { + "type": "array", + "description": "A list of subject categories, such as \"Fiction\", \"Suspense\", etc.", + "items": { + "type": "string" + } + }, + "contentVersion": { + "type": "string", + "description": "An identifier for the version of the volume content (text & images). (In LITE projection)" + }, + "description": { + "type": "string", + "description": "A synopsis of the volume. The text of the description is formatted in HTML and includes simple formatting elements, such as b, i, and br tags. (In LITE projection.)" + }, + "dimensions": { + "type": "object", + "description": "Physical dimensions of this volume.", + "properties": { + "height": { + "type": "string", + "description": "Height or length of this volume (in cm)." + }, + "thickness": { + "type": "string", + "description": "Thickness of this volume (in cm)." + }, + "width": { + "type": "string", + "description": "Width of this volume (in cm)." + } + } + }, + "imageLinks": { + "type": "object", + "description": "A list of image links for all the sizes that are available. (In LITE projection.)", + "properties": { + "extraLarge": { + "type": "string", + "description": "Image link for extra large size (width of ~1280 pixels). (In LITE projection)" + }, + "large": { + "type": "string", + "description": "Image link for large size (width of ~800 pixels). (In LITE projection)" + }, + "medium": { + "type": "string", + "description": "Image link for medium size (width of ~575 pixels). (In LITE projection)" + }, + "small": { + "type": "string", + "description": "Image link for small size (width of ~300 pixels). (In LITE projection)" + }, + "smallThumbnail": { + "type": "string", + "description": "Image link for small thumbnail size (width of ~80 pixels). (In LITE projection)" + }, + "thumbnail": { + "type": "string", + "description": "Image link for thumbnail size (width of ~128 pixels). (In LITE projection)" + } + } + }, + "industryIdentifiers": { + "type": "array", + "description": "Industry standard identifiers for this volume.", + "items": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "Industry specific volume identifier." + }, + "type": { + "type": "string", + "description": "Identifier type. Possible values are ISBN_10, ISBN_13, ISSN and OTHER." + } + } + } + }, + "infoLink": { + "type": "string", + "description": "URL to view information about this volume on the Google Books site. (In LITE projection)" + }, + "language": { + "type": "string", + "description": "Best language for this volume (based on content). It is the two-letter ISO 639-1 code such as 'fr', 'en', etc." + }, + "mainCategory": { + "type": "string", + "description": "The main category to which this volume belongs. It will be the category from the categories list returned below that has the highest weight." + }, + "pageCount": { + "type": "integer", + "description": "Total number of pages as per publisher metadata.", + "format": "int32" + }, + "previewLink": { + "type": "string", + "description": "URL to preview this volume on the Google Books site." + }, + "printType": { + "type": "string", + "description": "Type of publication of this volume. Possible values are BOOK or MAGAZINE." + }, + "printedPageCount": { + "type": "integer", + "description": "Total number of printed pages in generated pdf representation.", + "format": "int32" + }, + "publishedDate": { + "type": "string", + "description": "Date of publication. (In LITE projection.)" + }, + "publisher": { + "type": "string", + "description": "Publisher of this volume. (In LITE projection.)" + }, + "ratingsCount": { + "type": "integer", + "description": "The number of review ratings for this volume.", + "format": "int32" + }, + "subtitle": { + "type": "string", + "description": "Volume subtitle. (In LITE projection.)" + }, + "title": { + "type": "string", + "description": "Volume title. (In LITE projection.)" + } + } + } + } + }, + "Volumeannotation": { + "id": "Volumeannotation", + "type": "object", + "properties": { + "annotationDataId": { + "type": "string", + "description": "The annotation data id for this volume annotation." + }, + "annotationDataLink": { + "type": "string", + "description": "Link to get data for this annotation." + }, + "annotationType": { + "type": "string", + "description": "The type of annotation this is." + }, + "contentRanges": { + "type": "object", + "description": "The content ranges to identify the selected text.", + "properties": { + "cfiRange": { + "$ref": "BooksAnnotationsRange", + "description": "Range in CFI format for this annotation for version above." + }, + "contentVersion": { + "type": "string", + "description": "Content version applicable to ranges below." + }, + "gbImageRange": { + "$ref": "BooksAnnotationsRange", + "description": "Range in GB image format for this annotation for version above." + }, + "gbTextRange": { + "$ref": "BooksAnnotationsRange", + "description": "Range in GB text format for this annotation for version above." + } + } + }, + "data": { + "type": "string", + "description": "Data for this annotation." + }, + "deleted": { + "type": "boolean", + "description": "Indicates that this annotation is deleted." + }, + "id": { + "type": "string", + "description": "Unique id of this volume annotation." + }, + "kind": { + "type": "string", + "description": "Resource Type", + "default": "books#volumeannotation" + }, + "layerId": { + "type": "string", + "description": "The Layer this annotation is for." + }, + "pageIds": { + "type": "array", + "description": "Pages the annotation spans.", + "items": { + "type": "string" + } + }, + "selectedText": { + "type": "string", + "description": "Excerpt from the volume." + }, + "selfLink": { + "type": "string", + "description": "URL to this resource." + }, + "updated": { + "type": "string", + "description": "Timestamp for the last time this anntoation was updated. (RFC 3339 UTC date-time format).", + "format": "date-time" + }, + "volumeId": { + "type": "string", + "description": "The Volume this annotation is for." + } + } + }, + "Volumeannotations": { + "id": "Volumeannotations", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "A list of volume annotations.", + "items": { + "$ref": "Volumeannotation" + } + }, + "kind": { + "type": "string", + "description": "Resource type", + "default": "books#volumeannotations" + }, + "nextPageToken": { + "type": "string", + "description": "Token to pass in for pagination for the next page. This will not be present if this request does not have more results." + }, + "totalItems": { + "type": "integer", + "description": "The total number of volume annotations found.", + "format": "int32" + }, + "version": { + "type": "string", + "description": "The version string for all of the volume annotations in this layer (not just the ones in this response). Note: the version string doesn't apply to the annotation data, just the information in this response (e.g. the location of annotations in the book)." + } + } + }, + "Volumes": { + "id": "Volumes", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "A list of volumes.", + "items": { + "$ref": "Volume" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "books#volumes" + }, + "totalItems": { + "type": "integer", + "description": "Total number of volumes found. This might be greater than the number of volumes returned in this response if results have been paginated.", + "format": "int32" + } + } + } + }, + "resources": { + "bookshelves": { + "methods": { + "get": { + "id": "books.bookshelves.get", + "path": "users/{userId}/bookshelves/{shelf}", + "httpMethod": "GET", + "description": "Retrieves metadata for a specific bookshelf for the specified user.", + "parameters": { + "shelf": { + "type": "string", + "description": "ID of bookshelf to retrieve.", + "required": true, + "location": "path" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "ID of user for whom to retrieve bookshelves.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "shelf" + ], + "response": { + "$ref": "Bookshelf" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "list": { + "id": "books.bookshelves.list", + "path": "users/{userId}/bookshelves", + "httpMethod": "GET", + "description": "Retrieves a list of public bookshelves for the specified user.", + "parameters": { + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "ID of user for whom to retrieve bookshelves.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "Bookshelves" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + }, + "resources": { + "volumes": { + "methods": { + "list": { + "id": "books.bookshelves.volumes.list", + "path": "users/{userId}/bookshelves/{shelf}/volumes", + "httpMethod": "GET", + "description": "Retrieves volumes in a specific bookshelf for the specified user.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "shelf": { + "type": "string", + "description": "ID of bookshelf to retrieve volumes.", + "required": true, + "location": "path" + }, + "showPreorders": { + "type": "boolean", + "description": "Set to true to show pre-ordered books. Defaults to false.", + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "startIndex": { + "type": "integer", + "description": "Index of the first element to return (starts at 0)", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "userId": { + "type": "string", + "description": "ID of user for whom to retrieve bookshelf volumes.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "shelf" + ], + "response": { + "$ref": "Volumes" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + } + } + } + }, + "cloudloading": { + "methods": { + "addBook": { + "id": "books.cloudloading.addBook", + "path": "cloudloading/addBook", + "httpMethod": "POST", + "description": "", + "parameters": { + "drive_document_id": { + "type": "string", + "description": "A drive document id. The upload_client_token must not be set.", + "location": "query" + }, + "mime_type": { + "type": "string", + "description": "The document MIME type. It can be set only if the drive_document_id is set.", + "location": "query" + }, + "name": { + "type": "string", + "description": "The document name. It can be set only if the drive_document_id is set.", + "location": "query" + }, + "upload_client_token": { + "type": "string", + "location": "query" + } + }, + "response": { + "$ref": "BooksCloudloadingResource" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "deleteBook": { + "id": "books.cloudloading.deleteBook", + "path": "cloudloading/deleteBook", + "httpMethod": "POST", + "description": "Remove the book and its contents", + "parameters": { + "volumeId": { + "type": "string", + "description": "The id of the book to be removed.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "volumeId" + ], + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "updateBook": { + "id": "books.cloudloading.updateBook", + "path": "cloudloading/updateBook", + "httpMethod": "POST", + "description": "", + "request": { + "$ref": "BooksCloudloadingResource" + }, + "response": { + "$ref": "BooksCloudloadingResource" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + } + }, + "layers": { + "methods": { + "get": { + "id": "books.layers.get", + "path": "volumes/{volumeId}/layersummary/{summaryId}", + "httpMethod": "GET", + "description": "Gets the layer summary for a volume.", + "parameters": { + "contentVersion": { + "type": "string", + "description": "The content version for the requested volume.", + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "summaryId": { + "type": "string", + "description": "The ID for the layer to get the summary for.", + "required": true, + "location": "path" + }, + "volumeId": { + "type": "string", + "description": "The volume to retrieve layers for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "volumeId", + "summaryId" + ], + "response": { + "$ref": "Layersummary" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "list": { + "id": "books.layers.list", + "path": "volumes/{volumeId}/layersummary", + "httpMethod": "GET", + "description": "List the layer summaries for a volume.", + "parameters": { + "contentVersion": { + "type": "string", + "description": "The content version for the requested volume.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return", + "format": "uint32", + "minimum": "0", + "maximum": "200", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous page.", + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "volumeId": { + "type": "string", + "description": "The volume to retrieve layers for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "volumeId" + ], + "response": { + "$ref": "Layersummaries" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + }, + "resources": { + "annotationData": { + "methods": { + "get": { + "id": "books.layers.annotationData.get", + "path": "volumes/{volumeId}/layers/{layerId}/data/{annotationDataId}", + "httpMethod": "GET", + "description": "Gets the annotation data.", + "parameters": { + "allowWebDefinitions": { + "type": "boolean", + "description": "For the dictionary layer. Whether or not to allow web definitions.", + "location": "query" + }, + "annotationDataId": { + "type": "string", + "description": "The ID of the annotation data to retrieve.", + "required": true, + "location": "path" + }, + "contentVersion": { + "type": "string", + "description": "The content version for the volume you are trying to retrieve.", + "required": true, + "location": "query" + }, + "h": { + "type": "integer", + "description": "The requested pixel height for any images. If height is provided width must also be provided.", + "format": "int32", + "location": "query" + }, + "layerId": { + "type": "string", + "description": "The ID for the layer to get the annotations.", + "required": true, + "location": "path" + }, + "locale": { + "type": "string", + "description": "The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'.", + "location": "query" + }, + "scale": { + "type": "integer", + "description": "The requested scale for the image.", + "format": "int32", + "minimum": "0", + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "volumeId": { + "type": "string", + "description": "The volume to retrieve annotations for.", + "required": true, + "location": "path" + }, + "w": { + "type": "integer", + "description": "The requested pixel width for any images. If width is provided height must also be provided.", + "format": "int32", + "location": "query" + } + }, + "parameterOrder": [ + "volumeId", + "layerId", + "annotationDataId", + "contentVersion" + ], + "response": { + "$ref": "Annotationdata" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "list": { + "id": "books.layers.annotationData.list", + "path": "volumes/{volumeId}/layers/{layerId}/data", + "httpMethod": "GET", + "description": "Gets the annotation data for a volume and layer.", + "parameters": { + "annotationDataId": { + "type": "string", + "description": "The list of Annotation Data Ids to retrieve. Pagination is ignored if this is set.", + "repeated": true, + "location": "query" + }, + "contentVersion": { + "type": "string", + "description": "The content version for the requested volume.", + "required": true, + "location": "query" + }, + "h": { + "type": "integer", + "description": "The requested pixel height for any images. If height is provided width must also be provided.", + "format": "int32", + "location": "query" + }, + "layerId": { + "type": "string", + "description": "The ID for the layer to get the annotation data.", + "required": true, + "location": "path" + }, + "locale": { + "type": "string", + "description": "The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return", + "format": "uint32", + "minimum": "0", + "maximum": "200", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous page.", + "location": "query" + }, + "scale": { + "type": "integer", + "description": "The requested scale for the image.", + "format": "int32", + "minimum": "0", + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "updatedMax": { + "type": "string", + "description": "RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive).", + "location": "query" + }, + "updatedMin": { + "type": "string", + "description": "RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive).", + "location": "query" + }, + "volumeId": { + "type": "string", + "description": "The volume to retrieve annotation data for.", + "required": true, + "location": "path" + }, + "w": { + "type": "integer", + "description": "The requested pixel width for any images. If width is provided height must also be provided.", + "format": "int32", + "location": "query" + } + }, + "parameterOrder": [ + "volumeId", + "layerId", + "contentVersion" + ], + "response": { + "$ref": "Annotationsdata" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + } + }, + "volumeAnnotations": { + "methods": { + "get": { + "id": "books.layers.volumeAnnotations.get", + "path": "volumes/{volumeId}/layers/{layerId}/annotations/{annotationId}", + "httpMethod": "GET", + "description": "Gets the volume annotation.", + "parameters": { + "annotationId": { + "type": "string", + "description": "The ID of the volume annotation to retrieve.", + "required": true, + "location": "path" + }, + "layerId": { + "type": "string", + "description": "The ID for the layer to get the annotations.", + "required": true, + "location": "path" + }, + "locale": { + "type": "string", + "description": "The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'.", + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "volumeId": { + "type": "string", + "description": "The volume to retrieve annotations for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "volumeId", + "layerId", + "annotationId" + ], + "response": { + "$ref": "Volumeannotation" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "list": { + "id": "books.layers.volumeAnnotations.list", + "path": "volumes/{volumeId}/layers/{layerId}", + "httpMethod": "GET", + "description": "Gets the volume annotations for a volume and layer.", + "parameters": { + "contentVersion": { + "type": "string", + "description": "The content version for the requested volume.", + "required": true, + "location": "query" + }, + "endOffset": { + "type": "string", + "description": "The end offset to end retrieving data from.", + "location": "query" + }, + "endPosition": { + "type": "string", + "description": "The end position to end retrieving data from.", + "location": "query" + }, + "layerId": { + "type": "string", + "description": "The ID for the layer to get the annotations.", + "required": true, + "location": "path" + }, + "locale": { + "type": "string", + "description": "The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return", + "format": "uint32", + "minimum": "0", + "maximum": "200", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous page.", + "location": "query" + }, + "showDeleted": { + "type": "boolean", + "description": "Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false.", + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "startOffset": { + "type": "string", + "description": "The start offset to start retrieving data from.", + "location": "query" + }, + "startPosition": { + "type": "string", + "description": "The start position to start retrieving data from.", + "location": "query" + }, + "updatedMax": { + "type": "string", + "description": "RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive).", + "location": "query" + }, + "updatedMin": { + "type": "string", + "description": "RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive).", + "location": "query" + }, + "volumeAnnotationsVersion": { + "type": "string", + "description": "The version of the volume annotations that you are requesting.", + "location": "query" + }, + "volumeId": { + "type": "string", + "description": "The volume to retrieve annotations for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "volumeId", + "layerId", + "contentVersion" + ], + "response": { + "$ref": "Volumeannotations" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + } + } + } + }, + "myconfig": { + "methods": { + "releaseDownloadAccess": { + "id": "books.myconfig.releaseDownloadAccess", + "path": "myconfig/releaseDownloadAccess", + "httpMethod": "POST", + "description": "Release downloaded content access restriction.", + "parameters": { + "cpksver": { + "type": "string", + "description": "The device/version ID from which to release the restriction.", + "required": true, + "location": "query" + }, + "locale": { + "type": "string", + "description": "ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US.", + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "volumeIds": { + "type": "string", + "description": "The volume(s) to release restrictions for.", + "required": true, + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "volumeIds", + "cpksver" + ], + "response": { + "$ref": "DownloadAccesses" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "requestAccess": { + "id": "books.myconfig.requestAccess", + "path": "myconfig/requestAccess", + "httpMethod": "POST", + "description": "Request concurrent and download access restrictions.", + "parameters": { + "cpksver": { + "type": "string", + "description": "The device/version ID from which to request the restrictions.", + "required": true, + "location": "query" + }, + "licenseTypes": { + "type": "string", + "description": "The type of access license to request. If not specified, the default is BOTH.", + "enum": [ + "BOTH", + "CONCURRENT", + "DOWNLOAD" + ], + "enumDescriptions": [ + "Both concurrent and download licenses.", + "Concurrent access license.", + "Offline download access license." + ], + "location": "query" + }, + "locale": { + "type": "string", + "description": "ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US.", + "location": "query" + }, + "nonce": { + "type": "string", + "description": "The client nonce value.", + "required": true, + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "required": true, + "location": "query" + }, + "volumeId": { + "type": "string", + "description": "The volume to request concurrent/download restrictions for.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "source", + "volumeId", + "nonce", + "cpksver" + ], + "response": { + "$ref": "RequestAccess" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "syncVolumeLicenses": { + "id": "books.myconfig.syncVolumeLicenses", + "path": "myconfig/syncVolumeLicenses", + "httpMethod": "POST", + "description": "Request downloaded content access for specified volumes on the My eBooks shelf.", + "parameters": { + "cpksver": { + "type": "string", + "description": "The device/version ID from which to release the restriction.", + "required": true, + "location": "query" + }, + "features": { + "type": "string", + "description": "List of features supported by the client, i.e., 'RENTALS'", + "enum": [ + "RENTALS" + ], + "enumDescriptions": [ + "Client supports rentals." + ], + "repeated": true, + "location": "query" + }, + "locale": { + "type": "string", + "description": "ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US.", + "location": "query" + }, + "nonce": { + "type": "string", + "description": "The client nonce value.", + "required": true, + "location": "query" + }, + "showPreorders": { + "type": "boolean", + "description": "Set to true to show pre-ordered books. Defaults to false.", + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "required": true, + "location": "query" + }, + "volumeIds": { + "type": "string", + "description": "The volume(s) to request download restrictions for.", + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "source", + "nonce", + "cpksver" + ], + "response": { + "$ref": "Volumes" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + } + }, + "mylibrary": { + "resources": { + "annotations": { + "methods": { + "delete": { + "id": "books.mylibrary.annotations.delete", + "path": "mylibrary/annotations/{annotationId}", + "httpMethod": "DELETE", + "description": "Deletes an annotation.", + "parameters": { + "annotationId": { + "type": "string", + "description": "The ID for the annotation to delete.", + "required": true, + "location": "path" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + } + }, + "parameterOrder": [ + "annotationId" + ], + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "get": { + "id": "books.mylibrary.annotations.get", + "path": "mylibrary/annotations/{annotationId}", + "httpMethod": "GET", + "description": "Gets an annotation by its ID.", + "parameters": { + "annotationId": { + "type": "string", + "description": "The ID for the annotation to retrieve.", + "required": true, + "location": "path" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + } + }, + "parameterOrder": [ + "annotationId" + ], + "response": { + "$ref": "Annotation" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "insert": { + "id": "books.mylibrary.annotations.insert", + "path": "mylibrary/annotations", + "httpMethod": "POST", + "description": "Inserts a new annotation.", + "parameters": { + "showOnlySummaryInResponse": { + "type": "boolean", + "description": "Requests that only the summary of the specified layer be provided in the response.", + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + } + }, + "request": { + "$ref": "Annotation" + }, + "response": { + "$ref": "Annotation" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "list": { + "id": "books.mylibrary.annotations.list", + "path": "mylibrary/annotations", + "httpMethod": "GET", + "description": "Retrieves a list of annotations, possibly filtered.", + "parameters": { + "contentVersion": { + "type": "string", + "description": "The content version for the requested volume.", + "location": "query" + }, + "layerId": { + "type": "string", + "description": "The layer ID to limit annotation by.", + "location": "query" + }, + "layerIds": { + "type": "string", + "description": "The layer ID(s) to limit annotation by.", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return", + "format": "uint32", + "minimum": "0", + "maximum": "40", + "location": "query" + }, + "pageIds": { + "type": "string", + "description": "The page ID(s) for the volume that is being queried.", + "repeated": true, + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous page.", + "location": "query" + }, + "showDeleted": { + "type": "boolean", + "description": "Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false.", + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "updatedMax": { + "type": "string", + "description": "RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive).", + "location": "query" + }, + "updatedMin": { + "type": "string", + "description": "RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive).", + "location": "query" + }, + "volumeId": { + "type": "string", + "description": "The volume to restrict annotations to.", + "location": "query" + } + }, + "response": { + "$ref": "Annotations" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "summary": { + "id": "books.mylibrary.annotations.summary", + "path": "mylibrary/annotations/summary", + "httpMethod": "POST", + "description": "Gets the summary of specified layers.", + "parameters": { + "layerIds": { + "type": "string", + "description": "Array of layer IDs to get the summary for.", + "required": true, + "repeated": true, + "location": "query" + }, + "volumeId": { + "type": "string", + "description": "Volume id to get the summary for.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "layerIds", + "volumeId" + ], + "response": { + "$ref": "AnnotationsSummary" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "update": { + "id": "books.mylibrary.annotations.update", + "path": "mylibrary/annotations/{annotationId}", + "httpMethod": "PUT", + "description": "Updates an existing annotation.", + "parameters": { + "annotationId": { + "type": "string", + "description": "The ID for the annotation to update.", + "required": true, + "location": "path" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + } + }, + "parameterOrder": [ + "annotationId" + ], + "request": { + "$ref": "Annotation" + }, + "response": { + "$ref": "Annotation" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + } + }, + "bookshelves": { + "methods": { + "addVolume": { + "id": "books.mylibrary.bookshelves.addVolume", + "path": "mylibrary/bookshelves/{shelf}/addVolume", + "httpMethod": "POST", + "description": "Adds a volume to a bookshelf.", + "parameters": { + "shelf": { + "type": "string", + "description": "ID of bookshelf to which to add a volume.", + "required": true, + "location": "path" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "volumeId": { + "type": "string", + "description": "ID of volume to add.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "shelf", + "volumeId" + ], + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "clearVolumes": { + "id": "books.mylibrary.bookshelves.clearVolumes", + "path": "mylibrary/bookshelves/{shelf}/clearVolumes", + "httpMethod": "POST", + "description": "Clears all volumes from a bookshelf.", + "parameters": { + "shelf": { + "type": "string", + "description": "ID of bookshelf from which to remove a volume.", + "required": true, + "location": "path" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + } + }, + "parameterOrder": [ + "shelf" + ], + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "get": { + "id": "books.mylibrary.bookshelves.get", + "path": "mylibrary/bookshelves/{shelf}", + "httpMethod": "GET", + "description": "Retrieves metadata for a specific bookshelf belonging to the authenticated user.", + "parameters": { + "shelf": { + "type": "string", + "description": "ID of bookshelf to retrieve.", + "required": true, + "location": "path" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + } + }, + "parameterOrder": [ + "shelf" + ], + "response": { + "$ref": "Bookshelf" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "list": { + "id": "books.mylibrary.bookshelves.list", + "path": "mylibrary/bookshelves", + "httpMethod": "GET", + "description": "Retrieves a list of bookshelves belonging to the authenticated user.", + "parameters": { + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + } + }, + "response": { + "$ref": "Bookshelves" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "moveVolume": { + "id": "books.mylibrary.bookshelves.moveVolume", + "path": "mylibrary/bookshelves/{shelf}/moveVolume", + "httpMethod": "POST", + "description": "Moves a volume within a bookshelf.", + "parameters": { + "shelf": { + "type": "string", + "description": "ID of bookshelf with the volume.", + "required": true, + "location": "path" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "volumeId": { + "type": "string", + "description": "ID of volume to move.", + "required": true, + "location": "query" + }, + "volumePosition": { + "type": "integer", + "description": "Position on shelf to move the item (0 puts the item before the current first item, 1 puts it between the first and the second and so on.)", + "required": true, + "format": "int32", + "location": "query" + } + }, + "parameterOrder": [ + "shelf", + "volumeId", + "volumePosition" + ], + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "removeVolume": { + "id": "books.mylibrary.bookshelves.removeVolume", + "path": "mylibrary/bookshelves/{shelf}/removeVolume", + "httpMethod": "POST", + "description": "Removes a volume from a bookshelf.", + "parameters": { + "shelf": { + "type": "string", + "description": "ID of bookshelf from which to remove a volume.", + "required": true, + "location": "path" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "volumeId": { + "type": "string", + "description": "ID of volume to remove.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "shelf", + "volumeId" + ], + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + }, + "resources": { + "volumes": { + "methods": { + "list": { + "id": "books.mylibrary.bookshelves.volumes.list", + "path": "mylibrary/bookshelves/{shelf}/volumes", + "httpMethod": "GET", + "description": "Gets volume information for volumes on a bookshelf.", + "parameters": { + "country": { + "type": "string", + "description": "ISO-3166-1 code to override the IP-based location.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Restrict information returned to a set of selected fields.", + "enum": [ + "full", + "lite" + ], + "enumDescriptions": [ + "Includes all volume data.", + "Includes a subset of fields in volumeInfo and accessInfo." + ], + "location": "query" + }, + "q": { + "type": "string", + "description": "Full-text search query string in this bookshelf.", + "location": "query" + }, + "shelf": { + "type": "string", + "description": "The bookshelf ID or name retrieve volumes for.", + "required": true, + "location": "path" + }, + "showPreorders": { + "type": "boolean", + "description": "Set to true to show pre-ordered books. Defaults to false.", + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "startIndex": { + "type": "integer", + "description": "Index of the first element to return (starts at 0)", + "format": "uint32", + "minimum": "0", + "location": "query" + } + }, + "parameterOrder": [ + "shelf" + ], + "response": { + "$ref": "Volumes" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + } + } + } + }, + "readingpositions": { + "methods": { + "get": { + "id": "books.mylibrary.readingpositions.get", + "path": "mylibrary/readingpositions/{volumeId}", + "httpMethod": "GET", + "description": "Retrieves my reading position information for a volume.", + "parameters": { + "contentVersion": { + "type": "string", + "description": "Volume content version for which this reading position is requested.", + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "volumeId": { + "type": "string", + "description": "ID of volume for which to retrieve a reading position.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "volumeId" + ], + "response": { + "$ref": "ReadingPosition" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "setPosition": { + "id": "books.mylibrary.readingpositions.setPosition", + "path": "mylibrary/readingpositions/{volumeId}/setPosition", + "httpMethod": "POST", + "description": "Sets my reading position information for a volume.", + "parameters": { + "action": { + "type": "string", + "description": "Action that caused this reading position to be set.", + "enum": [ + "bookmark", + "chapter", + "next-page", + "prev-page", + "scroll", + "search" + ], + "enumDescriptions": [ + "User chose bookmark within volume.", + "User selected chapter from list.", + "Next page event.", + "Previous page event.", + "User navigated to page.", + "User chose search results within volume." + ], + "location": "query" + }, + "contentVersion": { + "type": "string", + "description": "Volume content version for which this reading position applies.", + "location": "query" + }, + "deviceCookie": { + "type": "string", + "description": "Random persistent device cookie optional on set position.", + "location": "query" + }, + "position": { + "type": "string", + "description": "Position string for the new volume reading position.", + "required": true, + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "timestamp": { + "type": "string", + "description": "RFC 3339 UTC format timestamp associated with this reading position.", + "required": true, + "location": "query" + }, + "volumeId": { + "type": "string", + "description": "ID of volume for which to update the reading position.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "volumeId", + "timestamp", + "position" + ], + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + } + } + } + }, + "volumes": { + "methods": { + "get": { + "id": "books.volumes.get", + "path": "volumes/{volumeId}", + "httpMethod": "GET", + "description": "Gets volume information for a single volume.", + "parameters": { + "country": { + "type": "string", + "description": "ISO-3166-1 code to override the IP-based location.", + "location": "query" + }, + "partner": { + "type": "string", + "description": "Brand results for partner ID.", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Restrict information returned to a set of selected fields.", + "enum": [ + "full", + "lite" + ], + "enumDescriptions": [ + "Includes all volume data.", + "Includes a subset of fields in volumeInfo and accessInfo." + ], + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "volumeId": { + "type": "string", + "description": "ID of volume to retrieve.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "volumeId" + ], + "response": { + "$ref": "Volume" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "list": { + "id": "books.volumes.list", + "path": "volumes", + "httpMethod": "GET", + "description": "Performs a book search.", + "parameters": { + "download": { + "type": "string", + "description": "Restrict to volumes by download availability.", + "enum": [ + "epub" + ], + "enumDescriptions": [ + "All volumes with epub." + ], + "location": "query" + }, + "filter": { + "type": "string", + "description": "Filter search results.", + "enum": [ + "ebooks", + "free-ebooks", + "full", + "paid-ebooks", + "partial" + ], + "enumDescriptions": [ + "All Google eBooks.", + "Google eBook with full volume text viewability.", + "Public can view entire volume text.", + "Google eBook with a price.", + "Public able to see parts of text." + ], + "location": "query" + }, + "langRestrict": { + "type": "string", + "description": "Restrict results to books with this language code.", + "location": "query" + }, + "libraryRestrict": { + "type": "string", + "description": "Restrict search to this user's library.", + "enum": [ + "my-library", + "no-restrict" + ], + "enumDescriptions": [ + "Restrict to the user's library, any shelf.", + "Do not restrict based on user's library." + ], + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "uint32", + "minimum": "0", + "maximum": "40", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sort search results.", + "enum": [ + "newest", + "relevance" + ], + "enumDescriptions": [ + "Most recently published.", + "Relevance to search terms." + ], + "location": "query" + }, + "partner": { + "type": "string", + "description": "Restrict and brand results for partner ID.", + "location": "query" + }, + "printType": { + "type": "string", + "description": "Restrict to books or magazines.", + "enum": [ + "all", + "books", + "magazines" + ], + "enumDescriptions": [ + "All volume content types.", + "Just books.", + "Just magazines." + ], + "location": "query" + }, + "projection": { + "type": "string", + "description": "Restrict information returned to a set of selected fields.", + "enum": [ + "full", + "lite" + ], + "enumDescriptions": [ + "Includes all volume data.", + "Includes a subset of fields in volumeInfo and accessInfo." + ], + "location": "query" + }, + "q": { + "type": "string", + "description": "Full-text search query string.", + "required": true, + "location": "query" + }, + "showPreorders": { + "type": "boolean", + "description": "Set to true to show books available for preorder. Defaults to false.", + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "startIndex": { + "type": "integer", + "description": "Index of the first result to return (starts at 0)", + "format": "uint32", + "minimum": "0", + "location": "query" + } + }, + "parameterOrder": [ + "q" + ], + "response": { + "$ref": "Volumes" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + }, + "resources": { + "associated": { + "methods": { + "list": { + "id": "books.volumes.associated.list", + "path": "volumes/{volumeId}/associated", + "httpMethod": "GET", + "description": "Return a list of associated books.", + "parameters": { + "association": { + "type": "string", + "description": "Association type.", + "enum": [ + "end-of-sample", + "end-of-volume" + ], + "enumDescriptions": [ + "Recommendations for display end-of-sample.", + "Recommendations for display end-of-volume." + ], + "location": "query" + }, + "locale": { + "type": "string", + "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations.", + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "volumeId": { + "type": "string", + "description": "ID of the source volume.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "volumeId" + ], + "response": { + "$ref": "Volumes" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + } + }, + "mybooks": { + "methods": { + "list": { + "id": "books.volumes.mybooks.list", + "path": "volumes/mybooks", + "httpMethod": "GET", + "description": "Return a list of books in My Library.", + "parameters": { + "acquireMethod": { + "type": "string", + "description": "How the book was aquired", + "enum": [ + "PREORDERED", + "PREVIOUSLY_RENTED", + "PUBLIC_DOMAIN", + "PURCHASED", + "RENTED", + "SAMPLE", + "UPLOADED" + ], + "enumDescriptions": [ + "Preordered books (not yet available)", + "User-rented books past their expiration time", + "Public domain books", + "Purchased books", + "User-rented books", + "Sample books", + "User uploaded books" + ], + "repeated": true, + "location": "query" + }, + "locale": { + "type": "string", + "description": "ISO-639-1 language and ISO-3166-1 country code. Ex:'en_US'. Used for generating recommendations.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "processingState": { + "type": "string", + "description": "The processing state of the user uploaded volumes to be returned. Applicable only if the UPLOADED is specified in the acquireMethod.", + "enum": [ + "COMPLETED_FAILED", + "COMPLETED_SUCCESS", + "RUNNING" + ], + "enumDescriptions": [ + "The volume processing hase failed.", + "The volume processing was completed.", + "The volume processing is not completed." + ], + "repeated": true, + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "startIndex": { + "type": "integer", + "description": "Index of the first result to return (starts at 0)", + "format": "uint32", + "minimum": "0", + "location": "query" + } + }, + "response": { + "$ref": "Volumes" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + } + }, + "recommended": { + "methods": { + "list": { + "id": "books.volumes.recommended.list", + "path": "volumes/recommended", + "httpMethod": "GET", + "description": "Return a list of recommended books for the current user.", + "parameters": { + "locale": { + "type": "string", + "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations.", + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + } + }, + "response": { + "$ref": "Volumes" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "rate": { + "id": "books.volumes.recommended.rate", + "path": "volumes/recommended/rate", + "httpMethod": "POST", + "description": "Rate a recommended book for the current user.", + "parameters": { + "locale": { + "type": "string", + "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations.", + "location": "query" + }, + "rating": { + "type": "string", + "description": "Rating to be given to the volume.", + "required": true, + "enum": [ + "HAVE_IT", + "NOT_INTERESTED" + ], + "enumDescriptions": [ + "Rating indicating a dismissal due to ownership.", + "Rating indicating a negative dismissal of a volume." + ], + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "volumeId": { + "type": "string", + "description": "ID of the source volume.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "rating", + "volumeId" + ], + "response": { + "$ref": "BooksVolumesRecommendedRateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + } + }, + "useruploaded": { + "methods": { + "list": { + "id": "books.volumes.useruploaded.list", + "path": "volumes/useruploaded", + "httpMethod": "GET", + "description": "Return a list of books uploaded by the current user.", + "parameters": { + "locale": { + "type": "string", + "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "uint32", + "minimum": "0", + "maximum": "40", + "location": "query" + }, + "processingState": { + "type": "string", + "description": "The processing state of the user uploaded volumes to be returned.", + "enum": [ + "COMPLETED_FAILED", + "COMPLETED_SUCCESS", + "RUNNING" + ], + "enumDescriptions": [ + "The volume processing hase failed.", + "The volume processing was completed.", + "The volume processing is not completed." + ], + "repeated": true, + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + }, + "startIndex": { + "type": "integer", + "description": "Index of the first result to return (starts at 0)", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "volumeId": { + "type": "string", + "description": "The ids of the volumes to be returned. If not specified all that match the processingState are returned.", + "repeated": true, + "location": "query" + } + }, + "response": { + "$ref": "Volumes" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/books/v1/books-gen.go b/third_party/src/code.google.com/p/google-api-go-client/books/v1/books-gen.go new file mode 100644 index 0000000000000..ca2fa7ec28b64 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/books/v1/books-gen.go @@ -0,0 +1,6116 @@ +// Package books provides access to the Books API. +// +// See https://developers.google.com/books/docs/v1/getting_started +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/books/v1" +// ... +// booksService, err := books.New(oauthHttpClient) +package books + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "books:v1" +const apiName = "books" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/books/v1/" + +// OAuth2 scopes used by this API. +const ( + // Manage your books + BooksScope = "https://www.googleapis.com/auth/books" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Bookshelves = NewBookshelvesService(s) + s.Cloudloading = NewCloudloadingService(s) + s.Layers = NewLayersService(s) + s.Myconfig = NewMyconfigService(s) + s.Mylibrary = NewMylibraryService(s) + s.Volumes = NewVolumesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Bookshelves *BookshelvesService + + Cloudloading *CloudloadingService + + Layers *LayersService + + Myconfig *MyconfigService + + Mylibrary *MylibraryService + + Volumes *VolumesService +} + +func NewBookshelvesService(s *Service) *BookshelvesService { + rs := &BookshelvesService{s: s} + rs.Volumes = NewBookshelvesVolumesService(s) + return rs +} + +type BookshelvesService struct { + s *Service + + Volumes *BookshelvesVolumesService +} + +func NewBookshelvesVolumesService(s *Service) *BookshelvesVolumesService { + rs := &BookshelvesVolumesService{s: s} + return rs +} + +type BookshelvesVolumesService struct { + s *Service +} + +func NewCloudloadingService(s *Service) *CloudloadingService { + rs := &CloudloadingService{s: s} + return rs +} + +type CloudloadingService struct { + s *Service +} + +func NewLayersService(s *Service) *LayersService { + rs := &LayersService{s: s} + rs.AnnotationData = NewLayersAnnotationDataService(s) + rs.VolumeAnnotations = NewLayersVolumeAnnotationsService(s) + return rs +} + +type LayersService struct { + s *Service + + AnnotationData *LayersAnnotationDataService + + VolumeAnnotations *LayersVolumeAnnotationsService +} + +func NewLayersAnnotationDataService(s *Service) *LayersAnnotationDataService { + rs := &LayersAnnotationDataService{s: s} + return rs +} + +type LayersAnnotationDataService struct { + s *Service +} + +func NewLayersVolumeAnnotationsService(s *Service) *LayersVolumeAnnotationsService { + rs := &LayersVolumeAnnotationsService{s: s} + return rs +} + +type LayersVolumeAnnotationsService struct { + s *Service +} + +func NewMyconfigService(s *Service) *MyconfigService { + rs := &MyconfigService{s: s} + return rs +} + +type MyconfigService struct { + s *Service +} + +func NewMylibraryService(s *Service) *MylibraryService { + rs := &MylibraryService{s: s} + rs.Annotations = NewMylibraryAnnotationsService(s) + rs.Bookshelves = NewMylibraryBookshelvesService(s) + rs.Readingpositions = NewMylibraryReadingpositionsService(s) + return rs +} + +type MylibraryService struct { + s *Service + + Annotations *MylibraryAnnotationsService + + Bookshelves *MylibraryBookshelvesService + + Readingpositions *MylibraryReadingpositionsService +} + +func NewMylibraryAnnotationsService(s *Service) *MylibraryAnnotationsService { + rs := &MylibraryAnnotationsService{s: s} + return rs +} + +type MylibraryAnnotationsService struct { + s *Service +} + +func NewMylibraryBookshelvesService(s *Service) *MylibraryBookshelvesService { + rs := &MylibraryBookshelvesService{s: s} + rs.Volumes = NewMylibraryBookshelvesVolumesService(s) + return rs +} + +type MylibraryBookshelvesService struct { + s *Service + + Volumes *MylibraryBookshelvesVolumesService +} + +func NewMylibraryBookshelvesVolumesService(s *Service) *MylibraryBookshelvesVolumesService { + rs := &MylibraryBookshelvesVolumesService{s: s} + return rs +} + +type MylibraryBookshelvesVolumesService struct { + s *Service +} + +func NewMylibraryReadingpositionsService(s *Service) *MylibraryReadingpositionsService { + rs := &MylibraryReadingpositionsService{s: s} + return rs +} + +type MylibraryReadingpositionsService struct { + s *Service +} + +func NewVolumesService(s *Service) *VolumesService { + rs := &VolumesService{s: s} + rs.Associated = NewVolumesAssociatedService(s) + rs.Mybooks = NewVolumesMybooksService(s) + rs.Recommended = NewVolumesRecommendedService(s) + rs.Useruploaded = NewVolumesUseruploadedService(s) + return rs +} + +type VolumesService struct { + s *Service + + Associated *VolumesAssociatedService + + Mybooks *VolumesMybooksService + + Recommended *VolumesRecommendedService + + Useruploaded *VolumesUseruploadedService +} + +func NewVolumesAssociatedService(s *Service) *VolumesAssociatedService { + rs := &VolumesAssociatedService{s: s} + return rs +} + +type VolumesAssociatedService struct { + s *Service +} + +func NewVolumesMybooksService(s *Service) *VolumesMybooksService { + rs := &VolumesMybooksService{s: s} + return rs +} + +type VolumesMybooksService struct { + s *Service +} + +func NewVolumesRecommendedService(s *Service) *VolumesRecommendedService { + rs := &VolumesRecommendedService{s: s} + return rs +} + +type VolumesRecommendedService struct { + s *Service +} + +func NewVolumesUseruploadedService(s *Service) *VolumesUseruploadedService { + rs := &VolumesUseruploadedService{s: s} + return rs +} + +type VolumesUseruploadedService struct { + s *Service +} + +type Annotation struct { + // AfterSelectedText: Anchor text after excerpt. For requests, if the + // user bookmarked a screen that has no flowing text on it, then this + // field should be empty. + AfterSelectedText string `json:"afterSelectedText,omitempty"` + + // BeforeSelectedText: Anchor text before excerpt. For requests, if the + // user bookmarked a screen that has no flowing text on it, then this + // field should be empty. + BeforeSelectedText string `json:"beforeSelectedText,omitempty"` + + // ClientVersionRanges: Selection ranges sent from the client. + ClientVersionRanges *AnnotationClientVersionRanges `json:"clientVersionRanges,omitempty"` + + // Created: Timestamp for the created time of this annotation. + Created string `json:"created,omitempty"` + + // CurrentVersionRanges: Selection ranges for the most recent content + // version. + CurrentVersionRanges *AnnotationCurrentVersionRanges `json:"currentVersionRanges,omitempty"` + + // Data: User-created data for this annotation. + Data string `json:"data,omitempty"` + + // Deleted: Indicates that this annotation is deleted. + Deleted bool `json:"deleted,omitempty"` + + // HighlightStyle: The highlight style for this annotation. + HighlightStyle string `json:"highlightStyle,omitempty"` + + // Id: Id of this annotation, in the form of a GUID. + Id string `json:"id,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // LayerId: The layer this annotation is for. + LayerId string `json:"layerId,omitempty"` + + LayerSummary *AnnotationLayerSummary `json:"layerSummary,omitempty"` + + // PageIds: Pages that this annotation spans. + PageIds []string `json:"pageIds,omitempty"` + + // SelectedText: Excerpt from the volume. + SelectedText string `json:"selectedText,omitempty"` + + // SelfLink: URL to this resource. + SelfLink string `json:"selfLink,omitempty"` + + // Updated: Timestamp for the last time this annotation was modified. + Updated string `json:"updated,omitempty"` + + // VolumeId: The volume that this annotation belongs to. + VolumeId string `json:"volumeId,omitempty"` +} + +type AnnotationClientVersionRanges struct { + // CfiRange: Range in CFI format for this annotation sent by client. + CfiRange *BooksAnnotationsRange `json:"cfiRange,omitempty"` + + // ContentVersion: Content version the client sent in. + ContentVersion string `json:"contentVersion,omitempty"` + + // GbImageRange: Range in GB image format for this annotation sent by + // client. + GbImageRange *BooksAnnotationsRange `json:"gbImageRange,omitempty"` + + // GbTextRange: Range in GB text format for this annotation sent by + // client. + GbTextRange *BooksAnnotationsRange `json:"gbTextRange,omitempty"` + + // ImageCfiRange: Range in image CFI format for this annotation sent by + // client. + ImageCfiRange *BooksAnnotationsRange `json:"imageCfiRange,omitempty"` +} + +type AnnotationCurrentVersionRanges struct { + // CfiRange: Range in CFI format for this annotation for version above. + CfiRange *BooksAnnotationsRange `json:"cfiRange,omitempty"` + + // ContentVersion: Content version applicable to ranges below. + ContentVersion string `json:"contentVersion,omitempty"` + + // GbImageRange: Range in GB image format for this annotation for + // version above. + GbImageRange *BooksAnnotationsRange `json:"gbImageRange,omitempty"` + + // GbTextRange: Range in GB text format for this annotation for version + // above. + GbTextRange *BooksAnnotationsRange `json:"gbTextRange,omitempty"` + + // ImageCfiRange: Range in image CFI format for this annotation for + // version above. + ImageCfiRange *BooksAnnotationsRange `json:"imageCfiRange,omitempty"` +} + +type AnnotationLayerSummary struct { + // AllowedCharacterCount: Maximum allowed characters on this layer, + // especially for the "copy" layer. + AllowedCharacterCount int64 `json:"allowedCharacterCount,omitempty"` + + // LimitType: Type of limitation on this layer. "limited" or "unlimited" + // for the "copy" layer. + LimitType string `json:"limitType,omitempty"` + + // RemainingCharacterCount: Remaining allowed characters on this layer, + // especially for the "copy" layer. + RemainingCharacterCount int64 `json:"remainingCharacterCount,omitempty"` +} + +type Annotationdata struct { + // AnnotationType: The type of annotation this data is for. + AnnotationType string `json:"annotationType,omitempty"` + + Data interface{} `json:"data,omitempty"` + + // Encoded_data: Base64 encoded data for this annotation data. + Encoded_data string `json:"encoded_data,omitempty"` + + // Id: Unique id for this annotation data. + Id string `json:"id,omitempty"` + + // Kind: Resource Type + Kind string `json:"kind,omitempty"` + + // LayerId: The Layer id for this data. * + LayerId string `json:"layerId,omitempty"` + + // SelfLink: URL for this resource. * + SelfLink string `json:"selfLink,omitempty"` + + // Updated: Timestamp for the last time this data was updated. (RFC 3339 + // UTC date-time format). + Updated string `json:"updated,omitempty"` + + // VolumeId: The volume id for this data. * + VolumeId string `json:"volumeId,omitempty"` +} + +type Annotations struct { + // Items: A list of annotations. + Items []*Annotation `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token to pass in for pagination for the next page. + // This will not be present if this request does not have more results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TotalItems: Total number of annotations found. This may be greater + // than the number of notes returned in this response if results have + // been paginated. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type AnnotationsSummary struct { + Kind string `json:"kind,omitempty"` + + Layers []*AnnotationsSummaryLayers `json:"layers,omitempty"` +} + +type AnnotationsSummaryLayers struct { + AllowedCharacterCount int64 `json:"allowedCharacterCount,omitempty"` + + LayerId string `json:"layerId,omitempty"` + + LimitType string `json:"limitType,omitempty"` + + RemainingCharacterCount int64 `json:"remainingCharacterCount,omitempty"` + + Updated string `json:"updated,omitempty"` +} + +type Annotationsdata struct { + // Items: A list of Annotation Data. + Items []*Annotationdata `json:"items,omitempty"` + + // Kind: Resource type + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token to pass in for pagination for the next page. + // This will not be present if this request does not have more results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TotalItems: The total number of volume annotations found. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type BooksAnnotationsRange struct { + // EndOffset: The offset from the ending position. + EndOffset string `json:"endOffset,omitempty"` + + // EndPosition: The ending position for the range. + EndPosition string `json:"endPosition,omitempty"` + + // StartOffset: The offset from the starting position. + StartOffset string `json:"startOffset,omitempty"` + + // StartPosition: The starting position for the range. + StartPosition string `json:"startPosition,omitempty"` +} + +type BooksCloudloadingResource struct { + Author string `json:"author,omitempty"` + + ProcessingState string `json:"processingState,omitempty"` + + Title string `json:"title,omitempty"` + + VolumeId string `json:"volumeId,omitempty"` +} + +type BooksVolumesRecommendedRateResponse struct { + Consistency_token string `json:"consistency_token,omitempty"` +} + +type Bookshelf struct { + // Access: Whether this bookshelf is PUBLIC or PRIVATE. + Access string `json:"access,omitempty"` + + // Created: Created time for this bookshelf (formatted UTC timestamp + // with millisecond resolution). + Created string `json:"created,omitempty"` + + // Description: Description of this bookshelf. + Description string `json:"description,omitempty"` + + // Id: Id of this bookshelf, only unique by user. + Id int64 `json:"id,omitempty"` + + // Kind: Resource type for bookshelf metadata. + Kind string `json:"kind,omitempty"` + + // SelfLink: URL to this resource. + SelfLink string `json:"selfLink,omitempty"` + + // Title: Title of this bookshelf. + Title string `json:"title,omitempty"` + + // Updated: Last modified time of this bookshelf (formatted UTC + // timestamp with millisecond resolution). + Updated string `json:"updated,omitempty"` + + // VolumeCount: Number of volumes in this bookshelf. + VolumeCount int64 `json:"volumeCount,omitempty"` + + // VolumesLastUpdated: Last time a volume was added or removed from this + // bookshelf (formatted UTC timestamp with millisecond resolution). + VolumesLastUpdated string `json:"volumesLastUpdated,omitempty"` +} + +type Bookshelves struct { + // Items: A list of bookshelves. + Items []*Bookshelf `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` +} + +type ConcurrentAccessRestriction struct { + // DeviceAllowed: Whether access is granted for this (user, device, + // volume). + DeviceAllowed bool `json:"deviceAllowed,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // MaxConcurrentDevices: The maximum number of concurrent access + // licenses for this volume. + MaxConcurrentDevices int64 `json:"maxConcurrentDevices,omitempty"` + + // Message: Error/warning message. + Message string `json:"message,omitempty"` + + // Nonce: Client nonce for verification. Download access and + // client-validation only. + Nonce string `json:"nonce,omitempty"` + + // ReasonCode: Error/warning reason code. + ReasonCode string `json:"reasonCode,omitempty"` + + // Restricted: Whether this volume has any concurrent access + // restrictions. + Restricted bool `json:"restricted,omitempty"` + + // Signature: Response signature. + Signature string `json:"signature,omitempty"` + + // Source: Client app identifier for verification. Download access and + // client-validation only. + Source string `json:"source,omitempty"` + + // TimeWindowSeconds: Time in seconds for license auto-expiration. + TimeWindowSeconds int64 `json:"timeWindowSeconds,omitempty"` + + // VolumeId: Identifies the volume for which this entry applies. + VolumeId string `json:"volumeId,omitempty"` +} + +type Dictlayerdata struct { + Common *DictlayerdataCommon `json:"common,omitempty"` + + Dict *DictlayerdataDict `json:"dict,omitempty"` + + Kind string `json:"kind,omitempty"` +} + +type DictlayerdataCommon struct { + // Title: The display title and localized canonical name to use when + // searching for this entity on Google search. + Title string `json:"title,omitempty"` +} + +type DictlayerdataDict struct { + // Source: The source, url and attribution for this dictionary data. + Source *DictlayerdataDictSource `json:"source,omitempty"` + + Words []*DictlayerdataDictWords `json:"words,omitempty"` +} + +type DictlayerdataDictSource struct { + Attribution string `json:"attribution,omitempty"` + + Url string `json:"url,omitempty"` +} + +type DictlayerdataDictWords struct { + Derivatives []*DictlayerdataDictWordsDerivatives `json:"derivatives,omitempty"` + + Examples []*DictlayerdataDictWordsExamples `json:"examples,omitempty"` + + Senses []*DictlayerdataDictWordsSenses `json:"senses,omitempty"` + + // Source: The words with different meanings but not related words, e.g. + // "go" (game) and "go" (verb). + Source *DictlayerdataDictWordsSource `json:"source,omitempty"` +} + +type DictlayerdataDictWordsDerivatives struct { + Source *DictlayerdataDictWordsDerivativesSource `json:"source,omitempty"` + + Text string `json:"text,omitempty"` +} + +type DictlayerdataDictWordsDerivativesSource struct { + Attribution string `json:"attribution,omitempty"` + + Url string `json:"url,omitempty"` +} + +type DictlayerdataDictWordsExamples struct { + Source *DictlayerdataDictWordsExamplesSource `json:"source,omitempty"` + + Text string `json:"text,omitempty"` +} + +type DictlayerdataDictWordsExamplesSource struct { + Attribution string `json:"attribution,omitempty"` + + Url string `json:"url,omitempty"` +} + +type DictlayerdataDictWordsSenses struct { + Conjugations []*DictlayerdataDictWordsSensesConjugations `json:"conjugations,omitempty"` + + Definitions []*DictlayerdataDictWordsSensesDefinitions `json:"definitions,omitempty"` + + PartOfSpeech string `json:"partOfSpeech,omitempty"` + + Pronunciation string `json:"pronunciation,omitempty"` + + PronunciationUrl string `json:"pronunciationUrl,omitempty"` + + Source *DictlayerdataDictWordsSensesSource `json:"source,omitempty"` + + Syllabification string `json:"syllabification,omitempty"` + + Synonyms []*DictlayerdataDictWordsSensesSynonyms `json:"synonyms,omitempty"` +} + +type DictlayerdataDictWordsSensesConjugations struct { + Type string `json:"type,omitempty"` + + Value string `json:"value,omitempty"` +} + +type DictlayerdataDictWordsSensesDefinitions struct { + Definition string `json:"definition,omitempty"` + + Examples []*DictlayerdataDictWordsSensesDefinitionsExamples `json:"examples,omitempty"` +} + +type DictlayerdataDictWordsSensesDefinitionsExamples struct { + Source *DictlayerdataDictWordsSensesDefinitionsExamplesSource `json:"source,omitempty"` + + Text string `json:"text,omitempty"` +} + +type DictlayerdataDictWordsSensesDefinitionsExamplesSource struct { + Attribution string `json:"attribution,omitempty"` + + Url string `json:"url,omitempty"` +} + +type DictlayerdataDictWordsSensesSource struct { + Attribution string `json:"attribution,omitempty"` + + Url string `json:"url,omitempty"` +} + +type DictlayerdataDictWordsSensesSynonyms struct { + Source *DictlayerdataDictWordsSensesSynonymsSource `json:"source,omitempty"` + + Text string `json:"text,omitempty"` +} + +type DictlayerdataDictWordsSensesSynonymsSource struct { + Attribution string `json:"attribution,omitempty"` + + Url string `json:"url,omitempty"` +} + +type DictlayerdataDictWordsSource struct { + Attribution string `json:"attribution,omitempty"` + + Url string `json:"url,omitempty"` +} + +type DownloadAccessRestriction struct { + // DeviceAllowed: If restricted, whether access is granted for this + // (user, device, volume). + DeviceAllowed bool `json:"deviceAllowed,omitempty"` + + // DownloadsAcquired: If restricted, the number of content download + // licenses already acquired (including the requesting client, if + // licensed). + DownloadsAcquired int64 `json:"downloadsAcquired,omitempty"` + + // JustAcquired: If deviceAllowed, whether access was just acquired with + // this request. + JustAcquired bool `json:"justAcquired,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // MaxDownloadDevices: If restricted, the maximum number of content + // download licenses for this volume. + MaxDownloadDevices int64 `json:"maxDownloadDevices,omitempty"` + + // Message: Error/warning message. + Message string `json:"message,omitempty"` + + // Nonce: Client nonce for verification. Download access and + // client-validation only. + Nonce string `json:"nonce,omitempty"` + + // ReasonCode: Error/warning reason code. Additional codes may be added + // in the future. 0 OK 100 ACCESS_DENIED_PUBLISHER_LIMIT 101 + // ACCESS_DENIED_LIMIT 200 WARNING_USED_LAST_ACCESS + ReasonCode string `json:"reasonCode,omitempty"` + + // Restricted: Whether this volume has any download access restrictions. + Restricted bool `json:"restricted,omitempty"` + + // Signature: Response signature. + Signature string `json:"signature,omitempty"` + + // Source: Client app identifier for verification. Download access and + // client-validation only. + Source string `json:"source,omitempty"` + + // VolumeId: Identifies the volume for which this entry applies. + VolumeId string `json:"volumeId,omitempty"` +} + +type DownloadAccesses struct { + // DownloadAccessList: A list of download access responses. + DownloadAccessList []*DownloadAccessRestriction `json:"downloadAccessList,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` +} + +type Geolayerdata struct { + Common *GeolayerdataCommon `json:"common,omitempty"` + + Geo *GeolayerdataGeo `json:"geo,omitempty"` + + Kind string `json:"kind,omitempty"` +} + +type GeolayerdataCommon struct { + // Lang: The language of the information url and description. + Lang string `json:"lang,omitempty"` + + // PreviewImageUrl: The URL for the preview image information. + PreviewImageUrl string `json:"previewImageUrl,omitempty"` + + // Snippet: The description for this location. + Snippet string `json:"snippet,omitempty"` + + // SnippetUrl: The URL for information for this location. Ex: wikipedia + // link. + SnippetUrl string `json:"snippetUrl,omitempty"` + + // Title: The display title and localized canonical name to use when + // searching for this entity on Google search. + Title string `json:"title,omitempty"` +} + +type GeolayerdataGeo struct { + // Boundary: The boundary of the location as a set of loops containing + // pairs of latitude, longitude coordinates. + Boundary [][]*GeolayerdataGeoBoundaryItem `json:"boundary,omitempty"` + + // CachePolicy: The cache policy active for this data. EX: UNRESTRICTED, + // RESTRICTED, NEVER + CachePolicy string `json:"cachePolicy,omitempty"` + + // CountryCode: The country code of the location. + CountryCode string `json:"countryCode,omitempty"` + + // Latitude: The latitude of the location. + Latitude float64 `json:"latitude,omitempty"` + + // Longitude: The longitude of the location. + Longitude float64 `json:"longitude,omitempty"` + + // MapType: The type of map that should be used for this location. EX: + // HYBRID, ROADMAP, SATELLITE, TERRAIN + MapType string `json:"mapType,omitempty"` + + // Viewport: The viewport for showing this location. This is a latitude, + // longitude rectangle. + Viewport *GeolayerdataGeoViewport `json:"viewport,omitempty"` + + // Zoom: The Zoom level to use for the map. Zoom levels between 0 (the + // lowest zoom level, in which the entire world can be seen on one map) + // to 21+ (down to individual buildings). See: + // https://developers.google.com/maps/documentation/staticmaps/#Zoomlevel + // s + Zoom int64 `json:"zoom,omitempty"` +} + +type GeolayerdataGeoBoundaryItem struct { + Latitude int64 `json:"latitude,omitempty"` + + Longitude int64 `json:"longitude,omitempty"` +} + +type GeolayerdataGeoViewport struct { + Hi *GeolayerdataGeoViewportHi `json:"hi,omitempty"` + + Lo *GeolayerdataGeoViewportLo `json:"lo,omitempty"` +} + +type GeolayerdataGeoViewportHi struct { + Latitude float64 `json:"latitude,omitempty"` + + Longitude float64 `json:"longitude,omitempty"` +} + +type GeolayerdataGeoViewportLo struct { + Latitude float64 `json:"latitude,omitempty"` + + Longitude float64 `json:"longitude,omitempty"` +} + +type Layersummaries struct { + // Items: A list of layer summary items. + Items []*Layersummary `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // TotalItems: The total number of layer summaries found. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type Layersummary struct { + // AnnotationCount: The number of annotations for this layer. + AnnotationCount int64 `json:"annotationCount,omitempty"` + + // AnnotationTypes: The list of annotation types contained for this + // layer. + AnnotationTypes []string `json:"annotationTypes,omitempty"` + + // AnnotationsDataLink: Link to get data for this annotation. + AnnotationsDataLink string `json:"annotationsDataLink,omitempty"` + + // AnnotationsLink: The link to get the annotations for this layer. + AnnotationsLink string `json:"annotationsLink,omitempty"` + + // ContentVersion: The content version this resource is for. + ContentVersion string `json:"contentVersion,omitempty"` + + // DataCount: The number of data items for this layer. + DataCount int64 `json:"dataCount,omitempty"` + + // Id: Unique id of this layer summary. + Id string `json:"id,omitempty"` + + // Kind: Resource Type + Kind string `json:"kind,omitempty"` + + // LayerId: The layer id for this summary. + LayerId string `json:"layerId,omitempty"` + + // SelfLink: URL to this resource. + SelfLink string `json:"selfLink,omitempty"` + + // Updated: Timestamp for the last time an item in this layer was + // updated. (RFC 3339 UTC date-time format). + Updated string `json:"updated,omitempty"` + + // VolumeAnnotationsVersion: The current version of this layer's volume + // annotations. Note that this version applies only to the data in the + // books.layers.volumeAnnotations.* responses. The actual annotation + // data is versioned separately. + VolumeAnnotationsVersion string `json:"volumeAnnotationsVersion,omitempty"` + + // VolumeId: The volume id this resource is for. + VolumeId string `json:"volumeId,omitempty"` +} + +type ReadingPosition struct { + // EpubCfiPosition: Position in an EPUB as a CFI. + EpubCfiPosition string `json:"epubCfiPosition,omitempty"` + + // GbImagePosition: Position in a volume for image-based content. + GbImagePosition string `json:"gbImagePosition,omitempty"` + + // GbTextPosition: Position in a volume for text-based content. + GbTextPosition string `json:"gbTextPosition,omitempty"` + + // Kind: Resource type for a reading position. + Kind string `json:"kind,omitempty"` + + // PdfPosition: Position in a PDF file. + PdfPosition string `json:"pdfPosition,omitempty"` + + // Updated: Timestamp when this reading position was last updated + // (formatted UTC timestamp with millisecond resolution). + Updated string `json:"updated,omitempty"` + + // VolumeId: Volume id associated with this reading position. + VolumeId string `json:"volumeId,omitempty"` +} + +type RequestAccess struct { + // ConcurrentAccess: A concurrent access response. + ConcurrentAccess *ConcurrentAccessRestriction `json:"concurrentAccess,omitempty"` + + // DownloadAccess: A download access response. + DownloadAccess *DownloadAccessRestriction `json:"downloadAccess,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` +} + +type Review struct { + // Author: Author of this review. + Author *ReviewAuthor `json:"author,omitempty"` + + // Content: Review text. + Content string `json:"content,omitempty"` + + // Date: Date of this review. + Date string `json:"date,omitempty"` + + // FullTextUrl: URL for the full review text, for reviews gathered from + // the web. + FullTextUrl string `json:"fullTextUrl,omitempty"` + + // Kind: Resource type for a review. + Kind string `json:"kind,omitempty"` + + // Rating: Star rating for this review. Possible values are ONE, TWO, + // THREE, FOUR, FIVE or NOT_RATED. + Rating string `json:"rating,omitempty"` + + // Source: Information regarding the source of this review, when the + // review is not from a Google Books user. + Source *ReviewSource `json:"source,omitempty"` + + // Title: Title for this review. + Title string `json:"title,omitempty"` + + // Type: Source type for this review. Possible values are EDITORIAL, + // WEB_USER or GOOGLE_USER. + Type string `json:"type,omitempty"` + + // VolumeId: Volume that this review is for. + VolumeId string `json:"volumeId,omitempty"` +} + +type ReviewAuthor struct { + // DisplayName: Name of this person. + DisplayName string `json:"displayName,omitempty"` +} + +type ReviewSource struct { + // Description: Name of the source. + Description string `json:"description,omitempty"` + + // ExtraDescription: Extra text about the source of the review. + ExtraDescription string `json:"extraDescription,omitempty"` + + // Url: URL of the source of the review. + Url string `json:"url,omitempty"` +} + +type Volume struct { + // AccessInfo: Any information about a volume related to reading or + // obtaining that volume text. This information can depend on country + // (books may be public domain in one country but not in another, e.g.). + AccessInfo *VolumeAccessInfo `json:"accessInfo,omitempty"` + + // Etag: Opaque identifier for a specific version of a volume resource. + // (In LITE projection) + Etag string `json:"etag,omitempty"` + + // Id: Unique identifier for a volume. (In LITE projection.) + Id string `json:"id,omitempty"` + + // Kind: Resource type for a volume. (In LITE projection.) + Kind string `json:"kind,omitempty"` + + // LayerInfo: What layers exist in this volume and high level + // information about them. + LayerInfo *VolumeLayerInfo `json:"layerInfo,omitempty"` + + // RecommendedInfo: Recommendation related information for this volume. + RecommendedInfo *VolumeRecommendedInfo `json:"recommendedInfo,omitempty"` + + // SaleInfo: Any information about a volume related to the eBookstore + // and/or purchaseability. This information can depend on the country + // where the request originates from (i.e. books may not be for sale in + // certain countries). + SaleInfo *VolumeSaleInfo `json:"saleInfo,omitempty"` + + // SearchInfo: Search result information related to this volume. + SearchInfo *VolumeSearchInfo `json:"searchInfo,omitempty"` + + // SelfLink: URL to this resource. (In LITE projection.) + SelfLink string `json:"selfLink,omitempty"` + + // UserInfo: User specific information related to this volume. (e.g. + // page this user last read or whether they purchased this book) + UserInfo *VolumeUserInfo `json:"userInfo,omitempty"` + + // VolumeInfo: General volume information. + VolumeInfo *VolumeVolumeInfo `json:"volumeInfo,omitempty"` +} + +type VolumeAccessInfo struct { + // AccessViewStatus: Combines the access and viewability of this volume + // into a single status field for this user. Values can be + // FULL_PURCHASED, FULL_PUBLIC_DOMAIN, SAMPLE or NONE. (In LITE + // projection.) + AccessViewStatus string `json:"accessViewStatus,omitempty"` + + // Country: The two-letter ISO_3166-1 country code for which this access + // information is valid. (In LITE projection.) + Country string `json:"country,omitempty"` + + // DownloadAccess: Information about a volume's download license access + // restrictions. + DownloadAccess *DownloadAccessRestriction `json:"downloadAccess,omitempty"` + + // DriveImportedContentLink: URL to the Google Drive viewer if this + // volume is uploaded by the user by selecting the file from Google + // Drive. + DriveImportedContentLink string `json:"driveImportedContentLink,omitempty"` + + // Embeddable: Whether this volume can be embedded in a viewport using + // the Embedded Viewer API. + Embeddable bool `json:"embeddable,omitempty"` + + // Epub: Information about epub content. (In LITE projection.) + Epub *VolumeAccessInfoEpub `json:"epub,omitempty"` + + // ExplicitOfflineLicenseManagement: Whether this volume requires that + // the client explicitly request offline download license rather than + // have it done automatically when loading the content, if the client + // supports it. + ExplicitOfflineLicenseManagement bool `json:"explicitOfflineLicenseManagement,omitempty"` + + // Pdf: Information about pdf content. (In LITE projection.) + Pdf *VolumeAccessInfoPdf `json:"pdf,omitempty"` + + // PublicDomain: Whether or not this book is public domain in the + // country listed above. + PublicDomain bool `json:"publicDomain,omitempty"` + + // QuoteSharingAllowed: Whether quote sharing is allowed for this + // volume. + QuoteSharingAllowed bool `json:"quoteSharingAllowed,omitempty"` + + // TextToSpeechPermission: Whether text-to-speech is permitted for this + // volume. Values can be ALLOWED, ALLOWED_FOR_ACCESSIBILITY, or + // NOT_ALLOWED. + TextToSpeechPermission string `json:"textToSpeechPermission,omitempty"` + + // ViewOrderUrl: For ordered but not yet processed orders, we give a URL + // that can be used to go to the appropriate Google Wallet page. + ViewOrderUrl string `json:"viewOrderUrl,omitempty"` + + // Viewability: The read access of a volume. Possible values are + // PARTIAL, ALL_PAGES, NO_PAGES or UNKNOWN. This value depends on the + // country listed above. A value of PARTIAL means that the publisher has + // allowed some portion of the volume to be viewed publicly, without + // purchase. This can apply to eBooks as well as non-eBooks. Public + // domain books will always have a value of ALL_PAGES. + Viewability string `json:"viewability,omitempty"` + + // WebReaderLink: URL to read this volume on the Google Books site. Link + // will not allow users to read non-viewable volumes. + WebReaderLink string `json:"webReaderLink,omitempty"` +} + +type VolumeAccessInfoEpub struct { + // AcsTokenLink: URL to retrieve ACS token for epub download. (In LITE + // projection.) + AcsTokenLink string `json:"acsTokenLink,omitempty"` + + // DownloadLink: URL to download epub. (In LITE projection.) + DownloadLink string `json:"downloadLink,omitempty"` + + // IsAvailable: Is a flowing text epub available either as public domain + // or for purchase. (In LITE projection.) + IsAvailable bool `json:"isAvailable,omitempty"` +} + +type VolumeAccessInfoPdf struct { + // AcsTokenLink: URL to retrieve ACS token for pdf download. (In LITE + // projection.) + AcsTokenLink string `json:"acsTokenLink,omitempty"` + + // DownloadLink: URL to download pdf. (In LITE projection.) + DownloadLink string `json:"downloadLink,omitempty"` + + // IsAvailable: Is a scanned image pdf available either as public domain + // or for purchase. (In LITE projection.) + IsAvailable bool `json:"isAvailable,omitempty"` +} + +type VolumeLayerInfo struct { + // Layers: A layer should appear here if and only if the layer exists + // for this book. + Layers []*VolumeLayerInfoLayers `json:"layers,omitempty"` +} + +type VolumeLayerInfoLayers struct { + // LayerId: The layer id of this layer (e.g. "geo"). + LayerId string `json:"layerId,omitempty"` + + // VolumeAnnotationsVersion: The current version of this layer's volume + // annotations. Note that this version applies only to the data in the + // books.layers.volumeAnnotations.* responses. The actual annotation + // data is versioned separately. + VolumeAnnotationsVersion string `json:"volumeAnnotationsVersion,omitempty"` +} + +type VolumeRecommendedInfo struct { + // Explanation: A text explaining why this volume is recommended. + Explanation string `json:"explanation,omitempty"` +} + +type VolumeSaleInfo struct { + // BuyLink: URL to purchase this volume on the Google Books site. (In + // LITE projection) + BuyLink string `json:"buyLink,omitempty"` + + // Country: The two-letter ISO_3166-1 country code for which this sale + // information is valid. (In LITE projection.) + Country string `json:"country,omitempty"` + + // IsEbook: Whether or not this volume is an eBook (can be added to the + // My eBooks shelf). + IsEbook bool `json:"isEbook,omitempty"` + + // ListPrice: Suggested retail price. (In LITE projection.) + ListPrice *VolumeSaleInfoListPrice `json:"listPrice,omitempty"` + + // Offers: Offers available for this volume (sales and rentals). + Offers []*VolumeSaleInfoOffers `json:"offers,omitempty"` + + // OnSaleDate: The date on which this book is available for sale. + OnSaleDate string `json:"onSaleDate,omitempty"` + + // RetailPrice: The actual selling price of the book. This is the same + // as the suggested retail or list price unless there are offers or + // discounts on this volume. (In LITE projection.) + RetailPrice *VolumeSaleInfoRetailPrice `json:"retailPrice,omitempty"` + + // Saleability: Whether or not this book is available for sale or + // offered for free in the Google eBookstore for the country listed + // above. Possible values are FOR_SALE, FOR_RENTAL_ONLY, + // FOR_SALE_AND_RENTAL, FREE, NOT_FOR_SALE, or FOR_PREORDER. + Saleability string `json:"saleability,omitempty"` +} + +type VolumeSaleInfoListPrice struct { + // Amount: Amount in the currency listed below. (In LITE projection.) + Amount float64 `json:"amount,omitempty"` + + // CurrencyCode: An ISO 4217, three-letter currency code. (In LITE + // projection.) + CurrencyCode string `json:"currencyCode,omitempty"` +} + +type VolumeSaleInfoOffers struct { + // FinskyOfferType: The finsky offer type (e.g., PURCHASE=0 RENTAL=3) + FinskyOfferType int64 `json:"finskyOfferType,omitempty"` + + // ListPrice: Offer list (=undiscounted) price in Micros. + ListPrice *VolumeSaleInfoOffersListPrice `json:"listPrice,omitempty"` + + // RentalDuration: The rental duration (for rental offers only). + RentalDuration *VolumeSaleInfoOffersRentalDuration `json:"rentalDuration,omitempty"` + + // RetailPrice: Offer retail (=discounted) price in Micros + RetailPrice *VolumeSaleInfoOffersRetailPrice `json:"retailPrice,omitempty"` +} + +type VolumeSaleInfoOffersListPrice struct { + AmountInMicros float64 `json:"amountInMicros,omitempty"` + + CurrencyCode string `json:"currencyCode,omitempty"` +} + +type VolumeSaleInfoOffersRentalDuration struct { + Count float64 `json:"count,omitempty"` + + Unit string `json:"unit,omitempty"` +} + +type VolumeSaleInfoOffersRetailPrice struct { + AmountInMicros float64 `json:"amountInMicros,omitempty"` + + CurrencyCode string `json:"currencyCode,omitempty"` +} + +type VolumeSaleInfoRetailPrice struct { + // Amount: Amount in the currency listed below. (In LITE projection.) + Amount float64 `json:"amount,omitempty"` + + // CurrencyCode: An ISO 4217, three-letter currency code. (In LITE + // projection.) + CurrencyCode string `json:"currencyCode,omitempty"` +} + +type VolumeSearchInfo struct { + // TextSnippet: A text snippet containing the search query. + TextSnippet string `json:"textSnippet,omitempty"` +} + +type VolumeUserInfo struct { + // Copy: Copy/Paste accounting information. + Copy *VolumeUserInfoCopy `json:"copy,omitempty"` + + // IsInMyBooks: Whether or not this volume is currently in "my books." + IsInMyBooks bool `json:"isInMyBooks,omitempty"` + + // IsPreordered: Whether or not this volume was pre-ordered by the + // authenticated user making the request. (In LITE projection.) + IsPreordered bool `json:"isPreordered,omitempty"` + + // IsPurchased: Whether or not this volume was purchased by the + // authenticated user making the request. (In LITE projection.) + IsPurchased bool `json:"isPurchased,omitempty"` + + // IsUploaded: Whether or not this volume was user uploaded. + IsUploaded bool `json:"isUploaded,omitempty"` + + // ReadingPosition: The user's current reading position in the volume, + // if one is available. (In LITE projection.) + ReadingPosition *ReadingPosition `json:"readingPosition,omitempty"` + + // RentalPeriod: Period during this book is/was a valid rental. + RentalPeriod *VolumeUserInfoRentalPeriod `json:"rentalPeriod,omitempty"` + + // RentalState: Whether this book is an active or an expired rental. + RentalState string `json:"rentalState,omitempty"` + + // Review: This user's review of this volume, if one exists. + Review *Review `json:"review,omitempty"` + + // Updated: Timestamp when this volume was last modified by a user + // action, such as a reading position update, volume purchase or writing + // a review. (RFC 3339 UTC date-time format). + Updated string `json:"updated,omitempty"` + + UserUploadedVolumeInfo *VolumeUserInfoUserUploadedVolumeInfo `json:"userUploadedVolumeInfo,omitempty"` +} + +type VolumeUserInfoCopy struct { + AllowedCharacterCount int64 `json:"allowedCharacterCount,omitempty"` + + LimitType string `json:"limitType,omitempty"` + + RemainingCharacterCount int64 `json:"remainingCharacterCount,omitempty"` + + Updated string `json:"updated,omitempty"` +} + +type VolumeUserInfoRentalPeriod struct { + EndUtcSec int64 `json:"endUtcSec,omitempty,string"` + + StartUtcSec int64 `json:"startUtcSec,omitempty,string"` +} + +type VolumeUserInfoUserUploadedVolumeInfo struct { + ProcessingState string `json:"processingState,omitempty"` +} + +type VolumeVolumeInfo struct { + // Authors: The names of the authors and/or editors for this volume. (In + // LITE projection) + Authors []string `json:"authors,omitempty"` + + // AverageRating: The mean review rating for this volume. (min = 1.0, + // max = 5.0) + AverageRating float64 `json:"averageRating,omitempty"` + + // CanonicalVolumeLink: Canonical URL for a volume. (In LITE + // projection.) + CanonicalVolumeLink string `json:"canonicalVolumeLink,omitempty"` + + // Categories: A list of subject categories, such as "Fiction", + // "Suspense", etc. + Categories []string `json:"categories,omitempty"` + + // ContentVersion: An identifier for the version of the volume content + // (text & images). (In LITE projection) + ContentVersion string `json:"contentVersion,omitempty"` + + // Description: A synopsis of the volume. The text of the description is + // formatted in HTML and includes simple formatting elements, such as b, + // i, and br tags. (In LITE projection.) + Description string `json:"description,omitempty"` + + // Dimensions: Physical dimensions of this volume. + Dimensions *VolumeVolumeInfoDimensions `json:"dimensions,omitempty"` + + // ImageLinks: A list of image links for all the sizes that are + // available. (In LITE projection.) + ImageLinks *VolumeVolumeInfoImageLinks `json:"imageLinks,omitempty"` + + // IndustryIdentifiers: Industry standard identifiers for this volume. + IndustryIdentifiers []*VolumeVolumeInfoIndustryIdentifiers `json:"industryIdentifiers,omitempty"` + + // InfoLink: URL to view information about this volume on the Google + // Books site. (In LITE projection) + InfoLink string `json:"infoLink,omitempty"` + + // Language: Best language for this volume (based on content). It is the + // two-letter ISO 639-1 code such as 'fr', 'en', etc. + Language string `json:"language,omitempty"` + + // MainCategory: The main category to which this volume belongs. It will + // be the category from the categories list returned below that has the + // highest weight. + MainCategory string `json:"mainCategory,omitempty"` + + // PageCount: Total number of pages as per publisher metadata. + PageCount int64 `json:"pageCount,omitempty"` + + // PreviewLink: URL to preview this volume on the Google Books site. + PreviewLink string `json:"previewLink,omitempty"` + + // PrintType: Type of publication of this volume. Possible values are + // BOOK or MAGAZINE. + PrintType string `json:"printType,omitempty"` + + // PrintedPageCount: Total number of printed pages in generated pdf + // representation. + PrintedPageCount int64 `json:"printedPageCount,omitempty"` + + // PublishedDate: Date of publication. (In LITE projection.) + PublishedDate string `json:"publishedDate,omitempty"` + + // Publisher: Publisher of this volume. (In LITE projection.) + Publisher string `json:"publisher,omitempty"` + + // RatingsCount: The number of review ratings for this volume. + RatingsCount int64 `json:"ratingsCount,omitempty"` + + // Subtitle: Volume subtitle. (In LITE projection.) + Subtitle string `json:"subtitle,omitempty"` + + // Title: Volume title. (In LITE projection.) + Title string `json:"title,omitempty"` +} + +type VolumeVolumeInfoDimensions struct { + // Height: Height or length of this volume (in cm). + Height string `json:"height,omitempty"` + + // Thickness: Thickness of this volume (in cm). + Thickness string `json:"thickness,omitempty"` + + // Width: Width of this volume (in cm). + Width string `json:"width,omitempty"` +} + +type VolumeVolumeInfoImageLinks struct { + // ExtraLarge: Image link for extra large size (width of ~1280 pixels). + // (In LITE projection) + ExtraLarge string `json:"extraLarge,omitempty"` + + // Large: Image link for large size (width of ~800 pixels). (In LITE + // projection) + Large string `json:"large,omitempty"` + + // Medium: Image link for medium size (width of ~575 pixels). (In LITE + // projection) + Medium string `json:"medium,omitempty"` + + // Small: Image link for small size (width of ~300 pixels). (In LITE + // projection) + Small string `json:"small,omitempty"` + + // SmallThumbnail: Image link for small thumbnail size (width of ~80 + // pixels). (In LITE projection) + SmallThumbnail string `json:"smallThumbnail,omitempty"` + + // Thumbnail: Image link for thumbnail size (width of ~128 pixels). (In + // LITE projection) + Thumbnail string `json:"thumbnail,omitempty"` +} + +type VolumeVolumeInfoIndustryIdentifiers struct { + // Identifier: Industry specific volume identifier. + Identifier string `json:"identifier,omitempty"` + + // Type: Identifier type. Possible values are ISBN_10, ISBN_13, ISSN and + // OTHER. + Type string `json:"type,omitempty"` +} + +type Volumeannotation struct { + // AnnotationDataId: The annotation data id for this volume annotation. + AnnotationDataId string `json:"annotationDataId,omitempty"` + + // AnnotationDataLink: Link to get data for this annotation. + AnnotationDataLink string `json:"annotationDataLink,omitempty"` + + // AnnotationType: The type of annotation this is. + AnnotationType string `json:"annotationType,omitempty"` + + // ContentRanges: The content ranges to identify the selected text. + ContentRanges *VolumeannotationContentRanges `json:"contentRanges,omitempty"` + + // Data: Data for this annotation. + Data string `json:"data,omitempty"` + + // Deleted: Indicates that this annotation is deleted. + Deleted bool `json:"deleted,omitempty"` + + // Id: Unique id of this volume annotation. + Id string `json:"id,omitempty"` + + // Kind: Resource Type + Kind string `json:"kind,omitempty"` + + // LayerId: The Layer this annotation is for. + LayerId string `json:"layerId,omitempty"` + + // PageIds: Pages the annotation spans. + PageIds []string `json:"pageIds,omitempty"` + + // SelectedText: Excerpt from the volume. + SelectedText string `json:"selectedText,omitempty"` + + // SelfLink: URL to this resource. + SelfLink string `json:"selfLink,omitempty"` + + // Updated: Timestamp for the last time this anntoation was updated. + // (RFC 3339 UTC date-time format). + Updated string `json:"updated,omitempty"` + + // VolumeId: The Volume this annotation is for. + VolumeId string `json:"volumeId,omitempty"` +} + +type VolumeannotationContentRanges struct { + // CfiRange: Range in CFI format for this annotation for version above. + CfiRange *BooksAnnotationsRange `json:"cfiRange,omitempty"` + + // ContentVersion: Content version applicable to ranges below. + ContentVersion string `json:"contentVersion,omitempty"` + + // GbImageRange: Range in GB image format for this annotation for + // version above. + GbImageRange *BooksAnnotationsRange `json:"gbImageRange,omitempty"` + + // GbTextRange: Range in GB text format for this annotation for version + // above. + GbTextRange *BooksAnnotationsRange `json:"gbTextRange,omitempty"` +} + +type Volumeannotations struct { + // Items: A list of volume annotations. + Items []*Volumeannotation `json:"items,omitempty"` + + // Kind: Resource type + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token to pass in for pagination for the next page. + // This will not be present if this request does not have more results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TotalItems: The total number of volume annotations found. + TotalItems int64 `json:"totalItems,omitempty"` + + // Version: The version string for all of the volume annotations in this + // layer (not just the ones in this response). Note: the version string + // doesn't apply to the annotation data, just the information in this + // response (e.g. the location of annotations in the book). + Version string `json:"version,omitempty"` +} + +type Volumes struct { + // Items: A list of volumes. + Items []*Volume `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // TotalItems: Total number of volumes found. This might be greater than + // the number of volumes returned in this response if results have been + // paginated. + TotalItems int64 `json:"totalItems,omitempty"` +} + +// method id "books.bookshelves.get": + +type BookshelvesGetCall struct { + s *Service + userId string + shelf string + opt_ map[string]interface{} +} + +// Get: Retrieves metadata for a specific bookshelf for the specified +// user. +func (r *BookshelvesService) Get(userId string, shelf string) *BookshelvesGetCall { + c := &BookshelvesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.shelf = shelf + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *BookshelvesGetCall) Source(source string) *BookshelvesGetCall { + c.opt_["source"] = source + return c +} + +func (c *BookshelvesGetCall) Do() (*Bookshelf, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/bookshelves/{shelf}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{shelf}", url.QueryEscape(c.shelf), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Bookshelf) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves metadata for a specific bookshelf for the specified user.", + // "httpMethod": "GET", + // "id": "books.bookshelves.get", + // "parameterOrder": [ + // "userId", + // "shelf" + // ], + // "parameters": { + // "shelf": { + // "description": "ID of bookshelf to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "ID of user for whom to retrieve bookshelves.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userId}/bookshelves/{shelf}", + // "response": { + // "$ref": "Bookshelf" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.bookshelves.list": + +type BookshelvesListCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// List: Retrieves a list of public bookshelves for the specified user. +func (r *BookshelvesService) List(userId string) *BookshelvesListCall { + c := &BookshelvesListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *BookshelvesListCall) Source(source string) *BookshelvesListCall { + c.opt_["source"] = source + return c +} + +func (c *BookshelvesListCall) Do() (*Bookshelves, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/bookshelves") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Bookshelves) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of public bookshelves for the specified user.", + // "httpMethod": "GET", + // "id": "books.bookshelves.list", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "ID of user for whom to retrieve bookshelves.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userId}/bookshelves", + // "response": { + // "$ref": "Bookshelves" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.bookshelves.volumes.list": + +type BookshelvesVolumesListCall struct { + s *Service + userId string + shelf string + opt_ map[string]interface{} +} + +// List: Retrieves volumes in a specific bookshelf for the specified +// user. +func (r *BookshelvesVolumesService) List(userId string, shelf string) *BookshelvesVolumesListCall { + c := &BookshelvesVolumesListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.shelf = shelf + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return +func (c *BookshelvesVolumesListCall) MaxResults(maxResults int64) *BookshelvesVolumesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// ShowPreorders sets the optional parameter "showPreorders": Set to +// true to show pre-ordered books. Defaults to false. +func (c *BookshelvesVolumesListCall) ShowPreorders(showPreorders bool) *BookshelvesVolumesListCall { + c.opt_["showPreorders"] = showPreorders + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *BookshelvesVolumesListCall) Source(source string) *BookshelvesVolumesListCall { + c.opt_["source"] = source + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first element to return (starts at 0) +func (c *BookshelvesVolumesListCall) StartIndex(startIndex int64) *BookshelvesVolumesListCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *BookshelvesVolumesListCall) Do() (*Volumes, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["showPreorders"]; ok { + params.Set("showPreorders", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/bookshelves/{shelf}/volumes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{shelf}", url.QueryEscape(c.shelf), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Volumes) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves volumes in a specific bookshelf for the specified user.", + // "httpMethod": "GET", + // "id": "books.bookshelves.volumes.list", + // "parameterOrder": [ + // "userId", + // "shelf" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "shelf": { + // "description": "ID of bookshelf to retrieve volumes.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "showPreorders": { + // "description": "Set to true to show pre-ordered books. Defaults to false.", + // "location": "query", + // "type": "boolean" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first element to return (starts at 0)", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "userId": { + // "description": "ID of user for whom to retrieve bookshelf volumes.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userId}/bookshelves/{shelf}/volumes", + // "response": { + // "$ref": "Volumes" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.cloudloading.addBook": + +type CloudloadingAddBookCall struct { + s *Service + opt_ map[string]interface{} +} + +// AddBook: +func (r *CloudloadingService) AddBook() *CloudloadingAddBookCall { + c := &CloudloadingAddBookCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Drive_document_id sets the optional parameter "drive_document_id": A +// drive document id. The upload_client_token must not be set. +func (c *CloudloadingAddBookCall) Drive_document_id(drive_document_id string) *CloudloadingAddBookCall { + c.opt_["drive_document_id"] = drive_document_id + return c +} + +// Mime_type sets the optional parameter "mime_type": The document MIME +// type. It can be set only if the drive_document_id is set. +func (c *CloudloadingAddBookCall) Mime_type(mime_type string) *CloudloadingAddBookCall { + c.opt_["mime_type"] = mime_type + return c +} + +// Name sets the optional parameter "name": The document name. It can be +// set only if the drive_document_id is set. +func (c *CloudloadingAddBookCall) Name(name string) *CloudloadingAddBookCall { + c.opt_["name"] = name + return c +} + +// Upload_client_token sets the optional parameter +// "upload_client_token": +func (c *CloudloadingAddBookCall) Upload_client_token(upload_client_token string) *CloudloadingAddBookCall { + c.opt_["upload_client_token"] = upload_client_token + return c +} + +func (c *CloudloadingAddBookCall) Do() (*BooksCloudloadingResource, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["drive_document_id"]; ok { + params.Set("drive_document_id", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["mime_type"]; ok { + params.Set("mime_type", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["name"]; ok { + params.Set("name", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["upload_client_token"]; ok { + params.Set("upload_client_token", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "cloudloading/addBook") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BooksCloudloadingResource) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "", + // "httpMethod": "POST", + // "id": "books.cloudloading.addBook", + // "parameters": { + // "drive_document_id": { + // "description": "A drive document id. The upload_client_token must not be set.", + // "location": "query", + // "type": "string" + // }, + // "mime_type": { + // "description": "The document MIME type. It can be set only if the drive_document_id is set.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The document name. It can be set only if the drive_document_id is set.", + // "location": "query", + // "type": "string" + // }, + // "upload_client_token": { + // "location": "query", + // "type": "string" + // } + // }, + // "path": "cloudloading/addBook", + // "response": { + // "$ref": "BooksCloudloadingResource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.cloudloading.deleteBook": + +type CloudloadingDeleteBookCall struct { + s *Service + volumeId string + opt_ map[string]interface{} +} + +// DeleteBook: Remove the book and its contents +func (r *CloudloadingService) DeleteBook(volumeId string) *CloudloadingDeleteBookCall { + c := &CloudloadingDeleteBookCall{s: r.s, opt_: make(map[string]interface{})} + c.volumeId = volumeId + return c +} + +func (c *CloudloadingDeleteBookCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("volumeId", fmt.Sprintf("%v", c.volumeId)) + urls := googleapi.ResolveRelative(c.s.BasePath, "cloudloading/deleteBook") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Remove the book and its contents", + // "httpMethod": "POST", + // "id": "books.cloudloading.deleteBook", + // "parameterOrder": [ + // "volumeId" + // ], + // "parameters": { + // "volumeId": { + // "description": "The id of the book to be removed.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "cloudloading/deleteBook", + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.cloudloading.updateBook": + +type CloudloadingUpdateBookCall struct { + s *Service + bookscloudloadingresource *BooksCloudloadingResource + opt_ map[string]interface{} +} + +// UpdateBook: +func (r *CloudloadingService) UpdateBook(bookscloudloadingresource *BooksCloudloadingResource) *CloudloadingUpdateBookCall { + c := &CloudloadingUpdateBookCall{s: r.s, opt_: make(map[string]interface{})} + c.bookscloudloadingresource = bookscloudloadingresource + return c +} + +func (c *CloudloadingUpdateBookCall) Do() (*BooksCloudloadingResource, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bookscloudloadingresource) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "cloudloading/updateBook") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BooksCloudloadingResource) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "", + // "httpMethod": "POST", + // "id": "books.cloudloading.updateBook", + // "path": "cloudloading/updateBook", + // "request": { + // "$ref": "BooksCloudloadingResource" + // }, + // "response": { + // "$ref": "BooksCloudloadingResource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.layers.get": + +type LayersGetCall struct { + s *Service + volumeId string + summaryId string + opt_ map[string]interface{} +} + +// Get: Gets the layer summary for a volume. +func (r *LayersService) Get(volumeId string, summaryId string) *LayersGetCall { + c := &LayersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.volumeId = volumeId + c.summaryId = summaryId + return c +} + +// ContentVersion sets the optional parameter "contentVersion": The +// content version for the requested volume. +func (c *LayersGetCall) ContentVersion(contentVersion string) *LayersGetCall { + c.opt_["contentVersion"] = contentVersion + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *LayersGetCall) Source(source string) *LayersGetCall { + c.opt_["source"] = source + return c +} + +func (c *LayersGetCall) Do() (*Layersummary, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["contentVersion"]; ok { + params.Set("contentVersion", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/layersummary/{summaryId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{volumeId}", url.QueryEscape(c.volumeId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{summaryId}", url.QueryEscape(c.summaryId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Layersummary) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the layer summary for a volume.", + // "httpMethod": "GET", + // "id": "books.layers.get", + // "parameterOrder": [ + // "volumeId", + // "summaryId" + // ], + // "parameters": { + // "contentVersion": { + // "description": "The content version for the requested volume.", + // "location": "query", + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "summaryId": { + // "description": "The ID for the layer to get the summary for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "volumeId": { + // "description": "The volume to retrieve layers for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "volumes/{volumeId}/layersummary/{summaryId}", + // "response": { + // "$ref": "Layersummary" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.layers.list": + +type LayersListCall struct { + s *Service + volumeId string + opt_ map[string]interface{} +} + +// List: List the layer summaries for a volume. +func (r *LayersService) List(volumeId string) *LayersListCall { + c := &LayersListCall{s: r.s, opt_: make(map[string]interface{})} + c.volumeId = volumeId + return c +} + +// ContentVersion sets the optional parameter "contentVersion": The +// content version for the requested volume. +func (c *LayersListCall) ContentVersion(contentVersion string) *LayersListCall { + c.opt_["contentVersion"] = contentVersion + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return +func (c *LayersListCall) MaxResults(maxResults int64) *LayersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous page. +func (c *LayersListCall) PageToken(pageToken string) *LayersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *LayersListCall) Source(source string) *LayersListCall { + c.opt_["source"] = source + return c +} + +func (c *LayersListCall) Do() (*Layersummaries, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["contentVersion"]; ok { + params.Set("contentVersion", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/layersummary") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{volumeId}", url.QueryEscape(c.volumeId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Layersummaries) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the layer summaries for a volume.", + // "httpMethod": "GET", + // "id": "books.layers.list", + // "parameterOrder": [ + // "volumeId" + // ], + // "parameters": { + // "contentVersion": { + // "description": "The content version for the requested volume.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return", + // "format": "uint32", + // "location": "query", + // "maximum": "200", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous page.", + // "location": "query", + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "volumeId": { + // "description": "The volume to retrieve layers for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "volumes/{volumeId}/layersummary", + // "response": { + // "$ref": "Layersummaries" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.layers.annotationData.get": + +type LayersAnnotationDataGetCall struct { + s *Service + volumeId string + layerId string + annotationDataId string + contentVersion string + opt_ map[string]interface{} +} + +// Get: Gets the annotation data. +func (r *LayersAnnotationDataService) Get(volumeId string, layerId string, annotationDataId string, contentVersion string) *LayersAnnotationDataGetCall { + c := &LayersAnnotationDataGetCall{s: r.s, opt_: make(map[string]interface{})} + c.volumeId = volumeId + c.layerId = layerId + c.annotationDataId = annotationDataId + c.contentVersion = contentVersion + return c +} + +// AllowWebDefinitions sets the optional parameter +// "allowWebDefinitions": For the dictionary layer. Whether or not to +// allow web definitions. +func (c *LayersAnnotationDataGetCall) AllowWebDefinitions(allowWebDefinitions bool) *LayersAnnotationDataGetCall { + c.opt_["allowWebDefinitions"] = allowWebDefinitions + return c +} + +// H sets the optional parameter "h": The requested pixel height for any +// images. If height is provided width must also be provided. +func (c *LayersAnnotationDataGetCall) H(h int64) *LayersAnnotationDataGetCall { + c.opt_["h"] = h + return c +} + +// Locale sets the optional parameter "locale": The locale information +// for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: +// 'en_US'. +func (c *LayersAnnotationDataGetCall) Locale(locale string) *LayersAnnotationDataGetCall { + c.opt_["locale"] = locale + return c +} + +// Scale sets the optional parameter "scale": The requested scale for +// the image. +func (c *LayersAnnotationDataGetCall) Scale(scale int64) *LayersAnnotationDataGetCall { + c.opt_["scale"] = scale + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *LayersAnnotationDataGetCall) Source(source string) *LayersAnnotationDataGetCall { + c.opt_["source"] = source + return c +} + +// W sets the optional parameter "w": The requested pixel width for any +// images. If width is provided height must also be provided. +func (c *LayersAnnotationDataGetCall) W(w int64) *LayersAnnotationDataGetCall { + c.opt_["w"] = w + return c +} + +func (c *LayersAnnotationDataGetCall) Do() (*Annotationdata, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("contentVersion", fmt.Sprintf("%v", c.contentVersion)) + if v, ok := c.opt_["allowWebDefinitions"]; ok { + params.Set("allowWebDefinitions", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["h"]; ok { + params.Set("h", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["scale"]; ok { + params.Set("scale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["w"]; ok { + params.Set("w", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/layers/{layerId}/data/{annotationDataId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{volumeId}", url.QueryEscape(c.volumeId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{layerId}", url.QueryEscape(c.layerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{annotationDataId}", url.QueryEscape(c.annotationDataId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Annotationdata) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the annotation data.", + // "httpMethod": "GET", + // "id": "books.layers.annotationData.get", + // "parameterOrder": [ + // "volumeId", + // "layerId", + // "annotationDataId", + // "contentVersion" + // ], + // "parameters": { + // "allowWebDefinitions": { + // "description": "For the dictionary layer. Whether or not to allow web definitions.", + // "location": "query", + // "type": "boolean" + // }, + // "annotationDataId": { + // "description": "The ID of the annotation data to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "contentVersion": { + // "description": "The content version for the volume you are trying to retrieve.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "h": { + // "description": "The requested pixel height for any images. If height is provided width must also be provided.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "layerId": { + // "description": "The ID for the layer to get the annotations.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "locale": { + // "description": "The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'.", + // "location": "query", + // "type": "string" + // }, + // "scale": { + // "description": "The requested scale for the image.", + // "format": "int32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "volumeId": { + // "description": "The volume to retrieve annotations for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "w": { + // "description": "The requested pixel width for any images. If width is provided height must also be provided.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // } + // }, + // "path": "volumes/{volumeId}/layers/{layerId}/data/{annotationDataId}", + // "response": { + // "$ref": "Annotationdata" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.layers.annotationData.list": + +type LayersAnnotationDataListCall struct { + s *Service + volumeId string + layerId string + contentVersion string + opt_ map[string]interface{} +} + +// List: Gets the annotation data for a volume and layer. +func (r *LayersAnnotationDataService) List(volumeId string, layerId string, contentVersion string) *LayersAnnotationDataListCall { + c := &LayersAnnotationDataListCall{s: r.s, opt_: make(map[string]interface{})} + c.volumeId = volumeId + c.layerId = layerId + c.contentVersion = contentVersion + return c +} + +// AnnotationDataId sets the optional parameter "annotationDataId": The +// list of Annotation Data Ids to retrieve. Pagination is ignored if +// this is set. +func (c *LayersAnnotationDataListCall) AnnotationDataId(annotationDataId string) *LayersAnnotationDataListCall { + c.opt_["annotationDataId"] = annotationDataId + return c +} + +// H sets the optional parameter "h": The requested pixel height for any +// images. If height is provided width must also be provided. +func (c *LayersAnnotationDataListCall) H(h int64) *LayersAnnotationDataListCall { + c.opt_["h"] = h + return c +} + +// Locale sets the optional parameter "locale": The locale information +// for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: +// 'en_US'. +func (c *LayersAnnotationDataListCall) Locale(locale string) *LayersAnnotationDataListCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return +func (c *LayersAnnotationDataListCall) MaxResults(maxResults int64) *LayersAnnotationDataListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous page. +func (c *LayersAnnotationDataListCall) PageToken(pageToken string) *LayersAnnotationDataListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Scale sets the optional parameter "scale": The requested scale for +// the image. +func (c *LayersAnnotationDataListCall) Scale(scale int64) *LayersAnnotationDataListCall { + c.opt_["scale"] = scale + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *LayersAnnotationDataListCall) Source(source string) *LayersAnnotationDataListCall { + c.opt_["source"] = source + return c +} + +// UpdatedMax sets the optional parameter "updatedMax": RFC 3339 +// timestamp to restrict to items updated prior to this timestamp +// (exclusive). +func (c *LayersAnnotationDataListCall) UpdatedMax(updatedMax string) *LayersAnnotationDataListCall { + c.opt_["updatedMax"] = updatedMax + return c +} + +// UpdatedMin sets the optional parameter "updatedMin": RFC 3339 +// timestamp to restrict to items updated since this timestamp +// (inclusive). +func (c *LayersAnnotationDataListCall) UpdatedMin(updatedMin string) *LayersAnnotationDataListCall { + c.opt_["updatedMin"] = updatedMin + return c +} + +// W sets the optional parameter "w": The requested pixel width for any +// images. If width is provided height must also be provided. +func (c *LayersAnnotationDataListCall) W(w int64) *LayersAnnotationDataListCall { + c.opt_["w"] = w + return c +} + +func (c *LayersAnnotationDataListCall) Do() (*Annotationsdata, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("contentVersion", fmt.Sprintf("%v", c.contentVersion)) + if v, ok := c.opt_["annotationDataId"]; ok { + params.Set("annotationDataId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["h"]; ok { + params.Set("h", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["scale"]; ok { + params.Set("scale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updatedMax"]; ok { + params.Set("updatedMax", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updatedMin"]; ok { + params.Set("updatedMin", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["w"]; ok { + params.Set("w", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/layers/{layerId}/data") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{volumeId}", url.QueryEscape(c.volumeId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{layerId}", url.QueryEscape(c.layerId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Annotationsdata) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the annotation data for a volume and layer.", + // "httpMethod": "GET", + // "id": "books.layers.annotationData.list", + // "parameterOrder": [ + // "volumeId", + // "layerId", + // "contentVersion" + // ], + // "parameters": { + // "annotationDataId": { + // "description": "The list of Annotation Data Ids to retrieve. Pagination is ignored if this is set.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "contentVersion": { + // "description": "The content version for the requested volume.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "h": { + // "description": "The requested pixel height for any images. If height is provided width must also be provided.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "layerId": { + // "description": "The ID for the layer to get the annotation data.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "locale": { + // "description": "The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return", + // "format": "uint32", + // "location": "query", + // "maximum": "200", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous page.", + // "location": "query", + // "type": "string" + // }, + // "scale": { + // "description": "The requested scale for the image.", + // "format": "int32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "updatedMax": { + // "description": "RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive).", + // "location": "query", + // "type": "string" + // }, + // "updatedMin": { + // "description": "RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive).", + // "location": "query", + // "type": "string" + // }, + // "volumeId": { + // "description": "The volume to retrieve annotation data for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "w": { + // "description": "The requested pixel width for any images. If width is provided height must also be provided.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // } + // }, + // "path": "volumes/{volumeId}/layers/{layerId}/data", + // "response": { + // "$ref": "Annotationsdata" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.layers.volumeAnnotations.get": + +type LayersVolumeAnnotationsGetCall struct { + s *Service + volumeId string + layerId string + annotationId string + opt_ map[string]interface{} +} + +// Get: Gets the volume annotation. +func (r *LayersVolumeAnnotationsService) Get(volumeId string, layerId string, annotationId string) *LayersVolumeAnnotationsGetCall { + c := &LayersVolumeAnnotationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.volumeId = volumeId + c.layerId = layerId + c.annotationId = annotationId + return c +} + +// Locale sets the optional parameter "locale": The locale information +// for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: +// 'en_US'. +func (c *LayersVolumeAnnotationsGetCall) Locale(locale string) *LayersVolumeAnnotationsGetCall { + c.opt_["locale"] = locale + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *LayersVolumeAnnotationsGetCall) Source(source string) *LayersVolumeAnnotationsGetCall { + c.opt_["source"] = source + return c +} + +func (c *LayersVolumeAnnotationsGetCall) Do() (*Volumeannotation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/layers/{layerId}/annotations/{annotationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{volumeId}", url.QueryEscape(c.volumeId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{layerId}", url.QueryEscape(c.layerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{annotationId}", url.QueryEscape(c.annotationId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Volumeannotation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the volume annotation.", + // "httpMethod": "GET", + // "id": "books.layers.volumeAnnotations.get", + // "parameterOrder": [ + // "volumeId", + // "layerId", + // "annotationId" + // ], + // "parameters": { + // "annotationId": { + // "description": "The ID of the volume annotation to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "layerId": { + // "description": "The ID for the layer to get the annotations.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "locale": { + // "description": "The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'.", + // "location": "query", + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "volumeId": { + // "description": "The volume to retrieve annotations for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "volumes/{volumeId}/layers/{layerId}/annotations/{annotationId}", + // "response": { + // "$ref": "Volumeannotation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.layers.volumeAnnotations.list": + +type LayersVolumeAnnotationsListCall struct { + s *Service + volumeId string + layerId string + contentVersion string + opt_ map[string]interface{} +} + +// List: Gets the volume annotations for a volume and layer. +func (r *LayersVolumeAnnotationsService) List(volumeId string, layerId string, contentVersion string) *LayersVolumeAnnotationsListCall { + c := &LayersVolumeAnnotationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.volumeId = volumeId + c.layerId = layerId + c.contentVersion = contentVersion + return c +} + +// EndOffset sets the optional parameter "endOffset": The end offset to +// end retrieving data from. +func (c *LayersVolumeAnnotationsListCall) EndOffset(endOffset string) *LayersVolumeAnnotationsListCall { + c.opt_["endOffset"] = endOffset + return c +} + +// EndPosition sets the optional parameter "endPosition": The end +// position to end retrieving data from. +func (c *LayersVolumeAnnotationsListCall) EndPosition(endPosition string) *LayersVolumeAnnotationsListCall { + c.opt_["endPosition"] = endPosition + return c +} + +// Locale sets the optional parameter "locale": The locale information +// for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: +// 'en_US'. +func (c *LayersVolumeAnnotationsListCall) Locale(locale string) *LayersVolumeAnnotationsListCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return +func (c *LayersVolumeAnnotationsListCall) MaxResults(maxResults int64) *LayersVolumeAnnotationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous page. +func (c *LayersVolumeAnnotationsListCall) PageToken(pageToken string) *LayersVolumeAnnotationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ShowDeleted sets the optional parameter "showDeleted": Set to true to +// return deleted annotations. updatedMin must be in the request to use +// this. Defaults to false. +func (c *LayersVolumeAnnotationsListCall) ShowDeleted(showDeleted bool) *LayersVolumeAnnotationsListCall { + c.opt_["showDeleted"] = showDeleted + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *LayersVolumeAnnotationsListCall) Source(source string) *LayersVolumeAnnotationsListCall { + c.opt_["source"] = source + return c +} + +// StartOffset sets the optional parameter "startOffset": The start +// offset to start retrieving data from. +func (c *LayersVolumeAnnotationsListCall) StartOffset(startOffset string) *LayersVolumeAnnotationsListCall { + c.opt_["startOffset"] = startOffset + return c +} + +// StartPosition sets the optional parameter "startPosition": The start +// position to start retrieving data from. +func (c *LayersVolumeAnnotationsListCall) StartPosition(startPosition string) *LayersVolumeAnnotationsListCall { + c.opt_["startPosition"] = startPosition + return c +} + +// UpdatedMax sets the optional parameter "updatedMax": RFC 3339 +// timestamp to restrict to items updated prior to this timestamp +// (exclusive). +func (c *LayersVolumeAnnotationsListCall) UpdatedMax(updatedMax string) *LayersVolumeAnnotationsListCall { + c.opt_["updatedMax"] = updatedMax + return c +} + +// UpdatedMin sets the optional parameter "updatedMin": RFC 3339 +// timestamp to restrict to items updated since this timestamp +// (inclusive). +func (c *LayersVolumeAnnotationsListCall) UpdatedMin(updatedMin string) *LayersVolumeAnnotationsListCall { + c.opt_["updatedMin"] = updatedMin + return c +} + +// VolumeAnnotationsVersion sets the optional parameter +// "volumeAnnotationsVersion": The version of the volume annotations +// that you are requesting. +func (c *LayersVolumeAnnotationsListCall) VolumeAnnotationsVersion(volumeAnnotationsVersion string) *LayersVolumeAnnotationsListCall { + c.opt_["volumeAnnotationsVersion"] = volumeAnnotationsVersion + return c +} + +func (c *LayersVolumeAnnotationsListCall) Do() (*Volumeannotations, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("contentVersion", fmt.Sprintf("%v", c.contentVersion)) + if v, ok := c.opt_["endOffset"]; ok { + params.Set("endOffset", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["endPosition"]; ok { + params.Set("endPosition", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["showDeleted"]; ok { + params.Set("showDeleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startOffset"]; ok { + params.Set("startOffset", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startPosition"]; ok { + params.Set("startPosition", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updatedMax"]; ok { + params.Set("updatedMax", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updatedMin"]; ok { + params.Set("updatedMin", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["volumeAnnotationsVersion"]; ok { + params.Set("volumeAnnotationsVersion", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/layers/{layerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{volumeId}", url.QueryEscape(c.volumeId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{layerId}", url.QueryEscape(c.layerId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Volumeannotations) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the volume annotations for a volume and layer.", + // "httpMethod": "GET", + // "id": "books.layers.volumeAnnotations.list", + // "parameterOrder": [ + // "volumeId", + // "layerId", + // "contentVersion" + // ], + // "parameters": { + // "contentVersion": { + // "description": "The content version for the requested volume.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "endOffset": { + // "description": "The end offset to end retrieving data from.", + // "location": "query", + // "type": "string" + // }, + // "endPosition": { + // "description": "The end position to end retrieving data from.", + // "location": "query", + // "type": "string" + // }, + // "layerId": { + // "description": "The ID for the layer to get the annotations.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "locale": { + // "description": "The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return", + // "format": "uint32", + // "location": "query", + // "maximum": "200", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous page.", + // "location": "query", + // "type": "string" + // }, + // "showDeleted": { + // "description": "Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false.", + // "location": "query", + // "type": "boolean" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "startOffset": { + // "description": "The start offset to start retrieving data from.", + // "location": "query", + // "type": "string" + // }, + // "startPosition": { + // "description": "The start position to start retrieving data from.", + // "location": "query", + // "type": "string" + // }, + // "updatedMax": { + // "description": "RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive).", + // "location": "query", + // "type": "string" + // }, + // "updatedMin": { + // "description": "RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive).", + // "location": "query", + // "type": "string" + // }, + // "volumeAnnotationsVersion": { + // "description": "The version of the volume annotations that you are requesting.", + // "location": "query", + // "type": "string" + // }, + // "volumeId": { + // "description": "The volume to retrieve annotations for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "volumes/{volumeId}/layers/{layerId}", + // "response": { + // "$ref": "Volumeannotations" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.myconfig.releaseDownloadAccess": + +type MyconfigReleaseDownloadAccessCall struct { + s *Service + volumeIds []string + cpksver string + opt_ map[string]interface{} +} + +// ReleaseDownloadAccess: Release downloaded content access restriction. +func (r *MyconfigService) ReleaseDownloadAccess(volumeIds []string, cpksver string) *MyconfigReleaseDownloadAccessCall { + c := &MyconfigReleaseDownloadAccessCall{s: r.s, opt_: make(map[string]interface{})} + c.volumeIds = volumeIds + c.cpksver = cpksver + return c +} + +// Locale sets the optional parameter "locale": ISO-639-1, ISO-3166-1 +// codes for message localization, i.e. en_US. +func (c *MyconfigReleaseDownloadAccessCall) Locale(locale string) *MyconfigReleaseDownloadAccessCall { + c.opt_["locale"] = locale + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *MyconfigReleaseDownloadAccessCall) Source(source string) *MyconfigReleaseDownloadAccessCall { + c.opt_["source"] = source + return c +} + +func (c *MyconfigReleaseDownloadAccessCall) Do() (*DownloadAccesses, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("cpksver", fmt.Sprintf("%v", c.cpksver)) + for _, v := range c.volumeIds { + params.Add("volumeIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "myconfig/releaseDownloadAccess") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DownloadAccesses) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Release downloaded content access restriction.", + // "httpMethod": "POST", + // "id": "books.myconfig.releaseDownloadAccess", + // "parameterOrder": [ + // "volumeIds", + // "cpksver" + // ], + // "parameters": { + // "cpksver": { + // "description": "The device/version ID from which to release the restriction.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "locale": { + // "description": "ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US.", + // "location": "query", + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "volumeIds": { + // "description": "The volume(s) to release restrictions for.", + // "location": "query", + // "repeated": true, + // "required": true, + // "type": "string" + // } + // }, + // "path": "myconfig/releaseDownloadAccess", + // "response": { + // "$ref": "DownloadAccesses" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.myconfig.requestAccess": + +type MyconfigRequestAccessCall struct { + s *Service + source string + volumeId string + nonce string + cpksver string + opt_ map[string]interface{} +} + +// RequestAccess: Request concurrent and download access restrictions. +func (r *MyconfigService) RequestAccess(source string, volumeId string, nonce string, cpksver string) *MyconfigRequestAccessCall { + c := &MyconfigRequestAccessCall{s: r.s, opt_: make(map[string]interface{})} + c.source = source + c.volumeId = volumeId + c.nonce = nonce + c.cpksver = cpksver + return c +} + +// LicenseTypes sets the optional parameter "licenseTypes": The type of +// access license to request. If not specified, the default is BOTH. +func (c *MyconfigRequestAccessCall) LicenseTypes(licenseTypes string) *MyconfigRequestAccessCall { + c.opt_["licenseTypes"] = licenseTypes + return c +} + +// Locale sets the optional parameter "locale": ISO-639-1, ISO-3166-1 +// codes for message localization, i.e. en_US. +func (c *MyconfigRequestAccessCall) Locale(locale string) *MyconfigRequestAccessCall { + c.opt_["locale"] = locale + return c +} + +func (c *MyconfigRequestAccessCall) Do() (*RequestAccess, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("cpksver", fmt.Sprintf("%v", c.cpksver)) + params.Set("nonce", fmt.Sprintf("%v", c.nonce)) + params.Set("source", fmt.Sprintf("%v", c.source)) + params.Set("volumeId", fmt.Sprintf("%v", c.volumeId)) + if v, ok := c.opt_["licenseTypes"]; ok { + params.Set("licenseTypes", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "myconfig/requestAccess") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RequestAccess) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Request concurrent and download access restrictions.", + // "httpMethod": "POST", + // "id": "books.myconfig.requestAccess", + // "parameterOrder": [ + // "source", + // "volumeId", + // "nonce", + // "cpksver" + // ], + // "parameters": { + // "cpksver": { + // "description": "The device/version ID from which to request the restrictions.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "licenseTypes": { + // "description": "The type of access license to request. If not specified, the default is BOTH.", + // "enum": [ + // "BOTH", + // "CONCURRENT", + // "DOWNLOAD" + // ], + // "enumDescriptions": [ + // "Both concurrent and download licenses.", + // "Concurrent access license.", + // "Offline download access license." + // ], + // "location": "query", + // "type": "string" + // }, + // "locale": { + // "description": "ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US.", + // "location": "query", + // "type": "string" + // }, + // "nonce": { + // "description": "The client nonce value.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "volumeId": { + // "description": "The volume to request concurrent/download restrictions for.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "myconfig/requestAccess", + // "response": { + // "$ref": "RequestAccess" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.myconfig.syncVolumeLicenses": + +type MyconfigSyncVolumeLicensesCall struct { + s *Service + source string + nonce string + cpksver string + opt_ map[string]interface{} +} + +// SyncVolumeLicenses: Request downloaded content access for specified +// volumes on the My eBooks shelf. +func (r *MyconfigService) SyncVolumeLicenses(source string, nonce string, cpksver string) *MyconfigSyncVolumeLicensesCall { + c := &MyconfigSyncVolumeLicensesCall{s: r.s, opt_: make(map[string]interface{})} + c.source = source + c.nonce = nonce + c.cpksver = cpksver + return c +} + +// Features sets the optional parameter "features": List of features +// supported by the client, i.e., 'RENTALS' +func (c *MyconfigSyncVolumeLicensesCall) Features(features string) *MyconfigSyncVolumeLicensesCall { + c.opt_["features"] = features + return c +} + +// Locale sets the optional parameter "locale": ISO-639-1, ISO-3166-1 +// codes for message localization, i.e. en_US. +func (c *MyconfigSyncVolumeLicensesCall) Locale(locale string) *MyconfigSyncVolumeLicensesCall { + c.opt_["locale"] = locale + return c +} + +// ShowPreorders sets the optional parameter "showPreorders": Set to +// true to show pre-ordered books. Defaults to false. +func (c *MyconfigSyncVolumeLicensesCall) ShowPreorders(showPreorders bool) *MyconfigSyncVolumeLicensesCall { + c.opt_["showPreorders"] = showPreorders + return c +} + +// VolumeIds sets the optional parameter "volumeIds": The volume(s) to +// request download restrictions for. +func (c *MyconfigSyncVolumeLicensesCall) VolumeIds(volumeIds string) *MyconfigSyncVolumeLicensesCall { + c.opt_["volumeIds"] = volumeIds + return c +} + +func (c *MyconfigSyncVolumeLicensesCall) Do() (*Volumes, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("cpksver", fmt.Sprintf("%v", c.cpksver)) + params.Set("nonce", fmt.Sprintf("%v", c.nonce)) + params.Set("source", fmt.Sprintf("%v", c.source)) + if v, ok := c.opt_["features"]; ok { + params.Set("features", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["showPreorders"]; ok { + params.Set("showPreorders", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["volumeIds"]; ok { + params.Set("volumeIds", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "myconfig/syncVolumeLicenses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Volumes) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Request downloaded content access for specified volumes on the My eBooks shelf.", + // "httpMethod": "POST", + // "id": "books.myconfig.syncVolumeLicenses", + // "parameterOrder": [ + // "source", + // "nonce", + // "cpksver" + // ], + // "parameters": { + // "cpksver": { + // "description": "The device/version ID from which to release the restriction.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "features": { + // "description": "List of features supported by the client, i.e., 'RENTALS'", + // "enum": [ + // "RENTALS" + // ], + // "enumDescriptions": [ + // "Client supports rentals." + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "locale": { + // "description": "ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US.", + // "location": "query", + // "type": "string" + // }, + // "nonce": { + // "description": "The client nonce value.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "showPreorders": { + // "description": "Set to true to show pre-ordered books. Defaults to false.", + // "location": "query", + // "type": "boolean" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "volumeIds": { + // "description": "The volume(s) to request download restrictions for.", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "myconfig/syncVolumeLicenses", + // "response": { + // "$ref": "Volumes" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.mylibrary.annotations.delete": + +type MylibraryAnnotationsDeleteCall struct { + s *Service + annotationId string + opt_ map[string]interface{} +} + +// Delete: Deletes an annotation. +func (r *MylibraryAnnotationsService) Delete(annotationId string) *MylibraryAnnotationsDeleteCall { + c := &MylibraryAnnotationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.annotationId = annotationId + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *MylibraryAnnotationsDeleteCall) Source(source string) *MylibraryAnnotationsDeleteCall { + c.opt_["source"] = source + return c +} + +func (c *MylibraryAnnotationsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/annotations/{annotationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{annotationId}", url.QueryEscape(c.annotationId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an annotation.", + // "httpMethod": "DELETE", + // "id": "books.mylibrary.annotations.delete", + // "parameterOrder": [ + // "annotationId" + // ], + // "parameters": { + // "annotationId": { + // "description": "The ID for the annotation to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "mylibrary/annotations/{annotationId}", + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.mylibrary.annotations.get": + +type MylibraryAnnotationsGetCall struct { + s *Service + annotationId string + opt_ map[string]interface{} +} + +// Get: Gets an annotation by its ID. +func (r *MylibraryAnnotationsService) Get(annotationId string) *MylibraryAnnotationsGetCall { + c := &MylibraryAnnotationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.annotationId = annotationId + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *MylibraryAnnotationsGetCall) Source(source string) *MylibraryAnnotationsGetCall { + c.opt_["source"] = source + return c +} + +func (c *MylibraryAnnotationsGetCall) Do() (*Annotation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/annotations/{annotationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{annotationId}", url.QueryEscape(c.annotationId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Annotation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets an annotation by its ID.", + // "httpMethod": "GET", + // "id": "books.mylibrary.annotations.get", + // "parameterOrder": [ + // "annotationId" + // ], + // "parameters": { + // "annotationId": { + // "description": "The ID for the annotation to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "mylibrary/annotations/{annotationId}", + // "response": { + // "$ref": "Annotation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.mylibrary.annotations.insert": + +type MylibraryAnnotationsInsertCall struct { + s *Service + annotation *Annotation + opt_ map[string]interface{} +} + +// Insert: Inserts a new annotation. +func (r *MylibraryAnnotationsService) Insert(annotation *Annotation) *MylibraryAnnotationsInsertCall { + c := &MylibraryAnnotationsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.annotation = annotation + return c +} + +// ShowOnlySummaryInResponse sets the optional parameter +// "showOnlySummaryInResponse": Requests that only the summary of the +// specified layer be provided in the response. +func (c *MylibraryAnnotationsInsertCall) ShowOnlySummaryInResponse(showOnlySummaryInResponse bool) *MylibraryAnnotationsInsertCall { + c.opt_["showOnlySummaryInResponse"] = showOnlySummaryInResponse + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *MylibraryAnnotationsInsertCall) Source(source string) *MylibraryAnnotationsInsertCall { + c.opt_["source"] = source + return c +} + +func (c *MylibraryAnnotationsInsertCall) Do() (*Annotation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotation) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["showOnlySummaryInResponse"]; ok { + params.Set("showOnlySummaryInResponse", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/annotations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Annotation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new annotation.", + // "httpMethod": "POST", + // "id": "books.mylibrary.annotations.insert", + // "parameters": { + // "showOnlySummaryInResponse": { + // "description": "Requests that only the summary of the specified layer be provided in the response.", + // "location": "query", + // "type": "boolean" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "mylibrary/annotations", + // "request": { + // "$ref": "Annotation" + // }, + // "response": { + // "$ref": "Annotation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.mylibrary.annotations.list": + +type MylibraryAnnotationsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves a list of annotations, possibly filtered. +func (r *MylibraryAnnotationsService) List() *MylibraryAnnotationsListCall { + c := &MylibraryAnnotationsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// ContentVersion sets the optional parameter "contentVersion": The +// content version for the requested volume. +func (c *MylibraryAnnotationsListCall) ContentVersion(contentVersion string) *MylibraryAnnotationsListCall { + c.opt_["contentVersion"] = contentVersion + return c +} + +// LayerId sets the optional parameter "layerId": The layer ID to limit +// annotation by. +func (c *MylibraryAnnotationsListCall) LayerId(layerId string) *MylibraryAnnotationsListCall { + c.opt_["layerId"] = layerId + return c +} + +// LayerIds sets the optional parameter "layerIds": The layer ID(s) to +// limit annotation by. +func (c *MylibraryAnnotationsListCall) LayerIds(layerIds string) *MylibraryAnnotationsListCall { + c.opt_["layerIds"] = layerIds + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return +func (c *MylibraryAnnotationsListCall) MaxResults(maxResults int64) *MylibraryAnnotationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageIds sets the optional parameter "pageIds": The page ID(s) for the +// volume that is being queried. +func (c *MylibraryAnnotationsListCall) PageIds(pageIds string) *MylibraryAnnotationsListCall { + c.opt_["pageIds"] = pageIds + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous page. +func (c *MylibraryAnnotationsListCall) PageToken(pageToken string) *MylibraryAnnotationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ShowDeleted sets the optional parameter "showDeleted": Set to true to +// return deleted annotations. updatedMin must be in the request to use +// this. Defaults to false. +func (c *MylibraryAnnotationsListCall) ShowDeleted(showDeleted bool) *MylibraryAnnotationsListCall { + c.opt_["showDeleted"] = showDeleted + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *MylibraryAnnotationsListCall) Source(source string) *MylibraryAnnotationsListCall { + c.opt_["source"] = source + return c +} + +// UpdatedMax sets the optional parameter "updatedMax": RFC 3339 +// timestamp to restrict to items updated prior to this timestamp +// (exclusive). +func (c *MylibraryAnnotationsListCall) UpdatedMax(updatedMax string) *MylibraryAnnotationsListCall { + c.opt_["updatedMax"] = updatedMax + return c +} + +// UpdatedMin sets the optional parameter "updatedMin": RFC 3339 +// timestamp to restrict to items updated since this timestamp +// (inclusive). +func (c *MylibraryAnnotationsListCall) UpdatedMin(updatedMin string) *MylibraryAnnotationsListCall { + c.opt_["updatedMin"] = updatedMin + return c +} + +// VolumeId sets the optional parameter "volumeId": The volume to +// restrict annotations to. +func (c *MylibraryAnnotationsListCall) VolumeId(volumeId string) *MylibraryAnnotationsListCall { + c.opt_["volumeId"] = volumeId + return c +} + +func (c *MylibraryAnnotationsListCall) Do() (*Annotations, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["contentVersion"]; ok { + params.Set("contentVersion", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["layerId"]; ok { + params.Set("layerId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["layerIds"]; ok { + params.Set("layerIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageIds"]; ok { + params.Set("pageIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["showDeleted"]; ok { + params.Set("showDeleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updatedMax"]; ok { + params.Set("updatedMax", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updatedMin"]; ok { + params.Set("updatedMin", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["volumeId"]; ok { + params.Set("volumeId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/annotations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Annotations) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of annotations, possibly filtered.", + // "httpMethod": "GET", + // "id": "books.mylibrary.annotations.list", + // "parameters": { + // "contentVersion": { + // "description": "The content version for the requested volume.", + // "location": "query", + // "type": "string" + // }, + // "layerId": { + // "description": "The layer ID to limit annotation by.", + // "location": "query", + // "type": "string" + // }, + // "layerIds": { + // "description": "The layer ID(s) to limit annotation by.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return", + // "format": "uint32", + // "location": "query", + // "maximum": "40", + // "minimum": "0", + // "type": "integer" + // }, + // "pageIds": { + // "description": "The page ID(s) for the volume that is being queried.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous page.", + // "location": "query", + // "type": "string" + // }, + // "showDeleted": { + // "description": "Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false.", + // "location": "query", + // "type": "boolean" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "updatedMax": { + // "description": "RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive).", + // "location": "query", + // "type": "string" + // }, + // "updatedMin": { + // "description": "RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive).", + // "location": "query", + // "type": "string" + // }, + // "volumeId": { + // "description": "The volume to restrict annotations to.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "mylibrary/annotations", + // "response": { + // "$ref": "Annotations" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.mylibrary.annotations.summary": + +type MylibraryAnnotationsSummaryCall struct { + s *Service + layerIds []string + volumeId string + opt_ map[string]interface{} +} + +// Summary: Gets the summary of specified layers. +func (r *MylibraryAnnotationsService) Summary(layerIds []string, volumeId string) *MylibraryAnnotationsSummaryCall { + c := &MylibraryAnnotationsSummaryCall{s: r.s, opt_: make(map[string]interface{})} + c.layerIds = layerIds + c.volumeId = volumeId + return c +} + +func (c *MylibraryAnnotationsSummaryCall) Do() (*AnnotationsSummary, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("volumeId", fmt.Sprintf("%v", c.volumeId)) + for _, v := range c.layerIds { + params.Add("layerIds", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/annotations/summary") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AnnotationsSummary) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the summary of specified layers.", + // "httpMethod": "POST", + // "id": "books.mylibrary.annotations.summary", + // "parameterOrder": [ + // "layerIds", + // "volumeId" + // ], + // "parameters": { + // "layerIds": { + // "description": "Array of layer IDs to get the summary for.", + // "location": "query", + // "repeated": true, + // "required": true, + // "type": "string" + // }, + // "volumeId": { + // "description": "Volume id to get the summary for.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "mylibrary/annotations/summary", + // "response": { + // "$ref": "AnnotationsSummary" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.mylibrary.annotations.update": + +type MylibraryAnnotationsUpdateCall struct { + s *Service + annotationId string + annotation *Annotation + opt_ map[string]interface{} +} + +// Update: Updates an existing annotation. +func (r *MylibraryAnnotationsService) Update(annotationId string, annotation *Annotation) *MylibraryAnnotationsUpdateCall { + c := &MylibraryAnnotationsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.annotationId = annotationId + c.annotation = annotation + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *MylibraryAnnotationsUpdateCall) Source(source string) *MylibraryAnnotationsUpdateCall { + c.opt_["source"] = source + return c +} + +func (c *MylibraryAnnotationsUpdateCall) Do() (*Annotation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotation) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/annotations/{annotationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{annotationId}", url.QueryEscape(c.annotationId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Annotation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing annotation.", + // "httpMethod": "PUT", + // "id": "books.mylibrary.annotations.update", + // "parameterOrder": [ + // "annotationId" + // ], + // "parameters": { + // "annotationId": { + // "description": "The ID for the annotation to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "mylibrary/annotations/{annotationId}", + // "request": { + // "$ref": "Annotation" + // }, + // "response": { + // "$ref": "Annotation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.mylibrary.bookshelves.addVolume": + +type MylibraryBookshelvesAddVolumeCall struct { + s *Service + shelf string + volumeId string + opt_ map[string]interface{} +} + +// AddVolume: Adds a volume to a bookshelf. +func (r *MylibraryBookshelvesService) AddVolume(shelf string, volumeId string) *MylibraryBookshelvesAddVolumeCall { + c := &MylibraryBookshelvesAddVolumeCall{s: r.s, opt_: make(map[string]interface{})} + c.shelf = shelf + c.volumeId = volumeId + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *MylibraryBookshelvesAddVolumeCall) Source(source string) *MylibraryBookshelvesAddVolumeCall { + c.opt_["source"] = source + return c +} + +func (c *MylibraryBookshelvesAddVolumeCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("volumeId", fmt.Sprintf("%v", c.volumeId)) + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves/{shelf}/addVolume") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{shelf}", url.QueryEscape(c.shelf), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Adds a volume to a bookshelf.", + // "httpMethod": "POST", + // "id": "books.mylibrary.bookshelves.addVolume", + // "parameterOrder": [ + // "shelf", + // "volumeId" + // ], + // "parameters": { + // "shelf": { + // "description": "ID of bookshelf to which to add a volume.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "volumeId": { + // "description": "ID of volume to add.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "mylibrary/bookshelves/{shelf}/addVolume", + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.mylibrary.bookshelves.clearVolumes": + +type MylibraryBookshelvesClearVolumesCall struct { + s *Service + shelf string + opt_ map[string]interface{} +} + +// ClearVolumes: Clears all volumes from a bookshelf. +func (r *MylibraryBookshelvesService) ClearVolumes(shelf string) *MylibraryBookshelvesClearVolumesCall { + c := &MylibraryBookshelvesClearVolumesCall{s: r.s, opt_: make(map[string]interface{})} + c.shelf = shelf + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *MylibraryBookshelvesClearVolumesCall) Source(source string) *MylibraryBookshelvesClearVolumesCall { + c.opt_["source"] = source + return c +} + +func (c *MylibraryBookshelvesClearVolumesCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves/{shelf}/clearVolumes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{shelf}", url.QueryEscape(c.shelf), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Clears all volumes from a bookshelf.", + // "httpMethod": "POST", + // "id": "books.mylibrary.bookshelves.clearVolumes", + // "parameterOrder": [ + // "shelf" + // ], + // "parameters": { + // "shelf": { + // "description": "ID of bookshelf from which to remove a volume.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "mylibrary/bookshelves/{shelf}/clearVolumes", + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.mylibrary.bookshelves.get": + +type MylibraryBookshelvesGetCall struct { + s *Service + shelf string + opt_ map[string]interface{} +} + +// Get: Retrieves metadata for a specific bookshelf belonging to the +// authenticated user. +func (r *MylibraryBookshelvesService) Get(shelf string) *MylibraryBookshelvesGetCall { + c := &MylibraryBookshelvesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.shelf = shelf + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *MylibraryBookshelvesGetCall) Source(source string) *MylibraryBookshelvesGetCall { + c.opt_["source"] = source + return c +} + +func (c *MylibraryBookshelvesGetCall) Do() (*Bookshelf, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves/{shelf}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{shelf}", url.QueryEscape(c.shelf), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Bookshelf) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves metadata for a specific bookshelf belonging to the authenticated user.", + // "httpMethod": "GET", + // "id": "books.mylibrary.bookshelves.get", + // "parameterOrder": [ + // "shelf" + // ], + // "parameters": { + // "shelf": { + // "description": "ID of bookshelf to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "mylibrary/bookshelves/{shelf}", + // "response": { + // "$ref": "Bookshelf" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.mylibrary.bookshelves.list": + +type MylibraryBookshelvesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves a list of bookshelves belonging to the authenticated +// user. +func (r *MylibraryBookshelvesService) List() *MylibraryBookshelvesListCall { + c := &MylibraryBookshelvesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *MylibraryBookshelvesListCall) Source(source string) *MylibraryBookshelvesListCall { + c.opt_["source"] = source + return c +} + +func (c *MylibraryBookshelvesListCall) Do() (*Bookshelves, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Bookshelves) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of bookshelves belonging to the authenticated user.", + // "httpMethod": "GET", + // "id": "books.mylibrary.bookshelves.list", + // "parameters": { + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "mylibrary/bookshelves", + // "response": { + // "$ref": "Bookshelves" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.mylibrary.bookshelves.moveVolume": + +type MylibraryBookshelvesMoveVolumeCall struct { + s *Service + shelf string + volumeId string + volumePosition int64 + opt_ map[string]interface{} +} + +// MoveVolume: Moves a volume within a bookshelf. +func (r *MylibraryBookshelvesService) MoveVolume(shelf string, volumeId string, volumePosition int64) *MylibraryBookshelvesMoveVolumeCall { + c := &MylibraryBookshelvesMoveVolumeCall{s: r.s, opt_: make(map[string]interface{})} + c.shelf = shelf + c.volumeId = volumeId + c.volumePosition = volumePosition + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *MylibraryBookshelvesMoveVolumeCall) Source(source string) *MylibraryBookshelvesMoveVolumeCall { + c.opt_["source"] = source + return c +} + +func (c *MylibraryBookshelvesMoveVolumeCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("volumeId", fmt.Sprintf("%v", c.volumeId)) + params.Set("volumePosition", fmt.Sprintf("%v", c.volumePosition)) + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves/{shelf}/moveVolume") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{shelf}", url.QueryEscape(c.shelf), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Moves a volume within a bookshelf.", + // "httpMethod": "POST", + // "id": "books.mylibrary.bookshelves.moveVolume", + // "parameterOrder": [ + // "shelf", + // "volumeId", + // "volumePosition" + // ], + // "parameters": { + // "shelf": { + // "description": "ID of bookshelf with the volume.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "volumeId": { + // "description": "ID of volume to move.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "volumePosition": { + // "description": "Position on shelf to move the item (0 puts the item before the current first item, 1 puts it between the first and the second and so on.)", + // "format": "int32", + // "location": "query", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "mylibrary/bookshelves/{shelf}/moveVolume", + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.mylibrary.bookshelves.removeVolume": + +type MylibraryBookshelvesRemoveVolumeCall struct { + s *Service + shelf string + volumeId string + opt_ map[string]interface{} +} + +// RemoveVolume: Removes a volume from a bookshelf. +func (r *MylibraryBookshelvesService) RemoveVolume(shelf string, volumeId string) *MylibraryBookshelvesRemoveVolumeCall { + c := &MylibraryBookshelvesRemoveVolumeCall{s: r.s, opt_: make(map[string]interface{})} + c.shelf = shelf + c.volumeId = volumeId + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *MylibraryBookshelvesRemoveVolumeCall) Source(source string) *MylibraryBookshelvesRemoveVolumeCall { + c.opt_["source"] = source + return c +} + +func (c *MylibraryBookshelvesRemoveVolumeCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("volumeId", fmt.Sprintf("%v", c.volumeId)) + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves/{shelf}/removeVolume") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{shelf}", url.QueryEscape(c.shelf), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Removes a volume from a bookshelf.", + // "httpMethod": "POST", + // "id": "books.mylibrary.bookshelves.removeVolume", + // "parameterOrder": [ + // "shelf", + // "volumeId" + // ], + // "parameters": { + // "shelf": { + // "description": "ID of bookshelf from which to remove a volume.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "volumeId": { + // "description": "ID of volume to remove.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "mylibrary/bookshelves/{shelf}/removeVolume", + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.mylibrary.bookshelves.volumes.list": + +type MylibraryBookshelvesVolumesListCall struct { + s *Service + shelf string + opt_ map[string]interface{} +} + +// List: Gets volume information for volumes on a bookshelf. +func (r *MylibraryBookshelvesVolumesService) List(shelf string) *MylibraryBookshelvesVolumesListCall { + c := &MylibraryBookshelvesVolumesListCall{s: r.s, opt_: make(map[string]interface{})} + c.shelf = shelf + return c +} + +// Country sets the optional parameter "country": ISO-3166-1 code to +// override the IP-based location. +func (c *MylibraryBookshelvesVolumesListCall) Country(country string) *MylibraryBookshelvesVolumesListCall { + c.opt_["country"] = country + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return +func (c *MylibraryBookshelvesVolumesListCall) MaxResults(maxResults int64) *MylibraryBookshelvesVolumesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Projection sets the optional parameter "projection": Restrict +// information returned to a set of selected fields. +func (c *MylibraryBookshelvesVolumesListCall) Projection(projection string) *MylibraryBookshelvesVolumesListCall { + c.opt_["projection"] = projection + return c +} + +// Q sets the optional parameter "q": Full-text search query string in +// this bookshelf. +func (c *MylibraryBookshelvesVolumesListCall) Q(q string) *MylibraryBookshelvesVolumesListCall { + c.opt_["q"] = q + return c +} + +// ShowPreorders sets the optional parameter "showPreorders": Set to +// true to show pre-ordered books. Defaults to false. +func (c *MylibraryBookshelvesVolumesListCall) ShowPreorders(showPreorders bool) *MylibraryBookshelvesVolumesListCall { + c.opt_["showPreorders"] = showPreorders + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *MylibraryBookshelvesVolumesListCall) Source(source string) *MylibraryBookshelvesVolumesListCall { + c.opt_["source"] = source + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first element to return (starts at 0) +func (c *MylibraryBookshelvesVolumesListCall) StartIndex(startIndex int64) *MylibraryBookshelvesVolumesListCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *MylibraryBookshelvesVolumesListCall) Do() (*Volumes, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["country"]; ok { + params.Set("country", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["q"]; ok { + params.Set("q", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["showPreorders"]; ok { + params.Set("showPreorders", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves/{shelf}/volumes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{shelf}", url.QueryEscape(c.shelf), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Volumes) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets volume information for volumes on a bookshelf.", + // "httpMethod": "GET", + // "id": "books.mylibrary.bookshelves.volumes.list", + // "parameterOrder": [ + // "shelf" + // ], + // "parameters": { + // "country": { + // "description": "ISO-3166-1 code to override the IP-based location.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "projection": { + // "description": "Restrict information returned to a set of selected fields.", + // "enum": [ + // "full", + // "lite" + // ], + // "enumDescriptions": [ + // "Includes all volume data.", + // "Includes a subset of fields in volumeInfo and accessInfo." + // ], + // "location": "query", + // "type": "string" + // }, + // "q": { + // "description": "Full-text search query string in this bookshelf.", + // "location": "query", + // "type": "string" + // }, + // "shelf": { + // "description": "The bookshelf ID or name retrieve volumes for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "showPreorders": { + // "description": "Set to true to show pre-ordered books. Defaults to false.", + // "location": "query", + // "type": "boolean" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first element to return (starts at 0)", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "mylibrary/bookshelves/{shelf}/volumes", + // "response": { + // "$ref": "Volumes" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.mylibrary.readingpositions.get": + +type MylibraryReadingpositionsGetCall struct { + s *Service + volumeId string + opt_ map[string]interface{} +} + +// Get: Retrieves my reading position information for a volume. +func (r *MylibraryReadingpositionsService) Get(volumeId string) *MylibraryReadingpositionsGetCall { + c := &MylibraryReadingpositionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.volumeId = volumeId + return c +} + +// ContentVersion sets the optional parameter "contentVersion": Volume +// content version for which this reading position is requested. +func (c *MylibraryReadingpositionsGetCall) ContentVersion(contentVersion string) *MylibraryReadingpositionsGetCall { + c.opt_["contentVersion"] = contentVersion + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *MylibraryReadingpositionsGetCall) Source(source string) *MylibraryReadingpositionsGetCall { + c.opt_["source"] = source + return c +} + +func (c *MylibraryReadingpositionsGetCall) Do() (*ReadingPosition, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["contentVersion"]; ok { + params.Set("contentVersion", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/readingpositions/{volumeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{volumeId}", url.QueryEscape(c.volumeId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ReadingPosition) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves my reading position information for a volume.", + // "httpMethod": "GET", + // "id": "books.mylibrary.readingpositions.get", + // "parameterOrder": [ + // "volumeId" + // ], + // "parameters": { + // "contentVersion": { + // "description": "Volume content version for which this reading position is requested.", + // "location": "query", + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "volumeId": { + // "description": "ID of volume for which to retrieve a reading position.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "mylibrary/readingpositions/{volumeId}", + // "response": { + // "$ref": "ReadingPosition" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.mylibrary.readingpositions.setPosition": + +type MylibraryReadingpositionsSetPositionCall struct { + s *Service + volumeId string + timestamp string + position string + opt_ map[string]interface{} +} + +// SetPosition: Sets my reading position information for a volume. +func (r *MylibraryReadingpositionsService) SetPosition(volumeId string, timestamp string, position string) *MylibraryReadingpositionsSetPositionCall { + c := &MylibraryReadingpositionsSetPositionCall{s: r.s, opt_: make(map[string]interface{})} + c.volumeId = volumeId + c.timestamp = timestamp + c.position = position + return c +} + +// Action sets the optional parameter "action": Action that caused this +// reading position to be set. +func (c *MylibraryReadingpositionsSetPositionCall) Action(action string) *MylibraryReadingpositionsSetPositionCall { + c.opt_["action"] = action + return c +} + +// ContentVersion sets the optional parameter "contentVersion": Volume +// content version for which this reading position applies. +func (c *MylibraryReadingpositionsSetPositionCall) ContentVersion(contentVersion string) *MylibraryReadingpositionsSetPositionCall { + c.opt_["contentVersion"] = contentVersion + return c +} + +// DeviceCookie sets the optional parameter "deviceCookie": Random +// persistent device cookie optional on set position. +func (c *MylibraryReadingpositionsSetPositionCall) DeviceCookie(deviceCookie string) *MylibraryReadingpositionsSetPositionCall { + c.opt_["deviceCookie"] = deviceCookie + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *MylibraryReadingpositionsSetPositionCall) Source(source string) *MylibraryReadingpositionsSetPositionCall { + c.opt_["source"] = source + return c +} + +func (c *MylibraryReadingpositionsSetPositionCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("position", fmt.Sprintf("%v", c.position)) + params.Set("timestamp", fmt.Sprintf("%v", c.timestamp)) + if v, ok := c.opt_["action"]; ok { + params.Set("action", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["contentVersion"]; ok { + params.Set("contentVersion", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["deviceCookie"]; ok { + params.Set("deviceCookie", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/readingpositions/{volumeId}/setPosition") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{volumeId}", url.QueryEscape(c.volumeId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Sets my reading position information for a volume.", + // "httpMethod": "POST", + // "id": "books.mylibrary.readingpositions.setPosition", + // "parameterOrder": [ + // "volumeId", + // "timestamp", + // "position" + // ], + // "parameters": { + // "action": { + // "description": "Action that caused this reading position to be set.", + // "enum": [ + // "bookmark", + // "chapter", + // "next-page", + // "prev-page", + // "scroll", + // "search" + // ], + // "enumDescriptions": [ + // "User chose bookmark within volume.", + // "User selected chapter from list.", + // "Next page event.", + // "Previous page event.", + // "User navigated to page.", + // "User chose search results within volume." + // ], + // "location": "query", + // "type": "string" + // }, + // "contentVersion": { + // "description": "Volume content version for which this reading position applies.", + // "location": "query", + // "type": "string" + // }, + // "deviceCookie": { + // "description": "Random persistent device cookie optional on set position.", + // "location": "query", + // "type": "string" + // }, + // "position": { + // "description": "Position string for the new volume reading position.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "timestamp": { + // "description": "RFC 3339 UTC format timestamp associated with this reading position.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "volumeId": { + // "description": "ID of volume for which to update the reading position.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "mylibrary/readingpositions/{volumeId}/setPosition", + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.volumes.get": + +type VolumesGetCall struct { + s *Service + volumeId string + opt_ map[string]interface{} +} + +// Get: Gets volume information for a single volume. +func (r *VolumesService) Get(volumeId string) *VolumesGetCall { + c := &VolumesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.volumeId = volumeId + return c +} + +// Country sets the optional parameter "country": ISO-3166-1 code to +// override the IP-based location. +func (c *VolumesGetCall) Country(country string) *VolumesGetCall { + c.opt_["country"] = country + return c +} + +// Partner sets the optional parameter "partner": Brand results for +// partner ID. +func (c *VolumesGetCall) Partner(partner string) *VolumesGetCall { + c.opt_["partner"] = partner + return c +} + +// Projection sets the optional parameter "projection": Restrict +// information returned to a set of selected fields. +func (c *VolumesGetCall) Projection(projection string) *VolumesGetCall { + c.opt_["projection"] = projection + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *VolumesGetCall) Source(source string) *VolumesGetCall { + c.opt_["source"] = source + return c +} + +func (c *VolumesGetCall) Do() (*Volume, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["country"]; ok { + params.Set("country", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["partner"]; ok { + params.Set("partner", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{volumeId}", url.QueryEscape(c.volumeId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Volume) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets volume information for a single volume.", + // "httpMethod": "GET", + // "id": "books.volumes.get", + // "parameterOrder": [ + // "volumeId" + // ], + // "parameters": { + // "country": { + // "description": "ISO-3166-1 code to override the IP-based location.", + // "location": "query", + // "type": "string" + // }, + // "partner": { + // "description": "Brand results for partner ID.", + // "location": "query", + // "type": "string" + // }, + // "projection": { + // "description": "Restrict information returned to a set of selected fields.", + // "enum": [ + // "full", + // "lite" + // ], + // "enumDescriptions": [ + // "Includes all volume data.", + // "Includes a subset of fields in volumeInfo and accessInfo." + // ], + // "location": "query", + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "volumeId": { + // "description": "ID of volume to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "volumes/{volumeId}", + // "response": { + // "$ref": "Volume" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.volumes.list": + +type VolumesListCall struct { + s *Service + q string + opt_ map[string]interface{} +} + +// List: Performs a book search. +func (r *VolumesService) List(q string) *VolumesListCall { + c := &VolumesListCall{s: r.s, opt_: make(map[string]interface{})} + c.q = q + return c +} + +// Download sets the optional parameter "download": Restrict to volumes +// by download availability. +func (c *VolumesListCall) Download(download string) *VolumesListCall { + c.opt_["download"] = download + return c +} + +// Filter sets the optional parameter "filter": Filter search results. +func (c *VolumesListCall) Filter(filter string) *VolumesListCall { + c.opt_["filter"] = filter + return c +} + +// LangRestrict sets the optional parameter "langRestrict": Restrict +// results to books with this language code. +func (c *VolumesListCall) LangRestrict(langRestrict string) *VolumesListCall { + c.opt_["langRestrict"] = langRestrict + return c +} + +// LibraryRestrict sets the optional parameter "libraryRestrict": +// Restrict search to this user's library. +func (c *VolumesListCall) LibraryRestrict(libraryRestrict string) *VolumesListCall { + c.opt_["libraryRestrict"] = libraryRestrict + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *VolumesListCall) MaxResults(maxResults int64) *VolumesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sort search results. +func (c *VolumesListCall) OrderBy(orderBy string) *VolumesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// Partner sets the optional parameter "partner": Restrict and brand +// results for partner ID. +func (c *VolumesListCall) Partner(partner string) *VolumesListCall { + c.opt_["partner"] = partner + return c +} + +// PrintType sets the optional parameter "printType": Restrict to books +// or magazines. +func (c *VolumesListCall) PrintType(printType string) *VolumesListCall { + c.opt_["printType"] = printType + return c +} + +// Projection sets the optional parameter "projection": Restrict +// information returned to a set of selected fields. +func (c *VolumesListCall) Projection(projection string) *VolumesListCall { + c.opt_["projection"] = projection + return c +} + +// ShowPreorders sets the optional parameter "showPreorders": Set to +// true to show books available for preorder. Defaults to false. +func (c *VolumesListCall) ShowPreorders(showPreorders bool) *VolumesListCall { + c.opt_["showPreorders"] = showPreorders + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *VolumesListCall) Source(source string) *VolumesListCall { + c.opt_["source"] = source + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first result to return (starts at 0) +func (c *VolumesListCall) StartIndex(startIndex int64) *VolumesListCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *VolumesListCall) Do() (*Volumes, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("q", fmt.Sprintf("%v", c.q)) + if v, ok := c.opt_["download"]; ok { + params.Set("download", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["langRestrict"]; ok { + params.Set("langRestrict", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["libraryRestrict"]; ok { + params.Set("libraryRestrict", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["partner"]; ok { + params.Set("partner", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["printType"]; ok { + params.Set("printType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["showPreorders"]; ok { + params.Set("showPreorders", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Volumes) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Performs a book search.", + // "httpMethod": "GET", + // "id": "books.volumes.list", + // "parameterOrder": [ + // "q" + // ], + // "parameters": { + // "download": { + // "description": "Restrict to volumes by download availability.", + // "enum": [ + // "epub" + // ], + // "enumDescriptions": [ + // "All volumes with epub." + // ], + // "location": "query", + // "type": "string" + // }, + // "filter": { + // "description": "Filter search results.", + // "enum": [ + // "ebooks", + // "free-ebooks", + // "full", + // "paid-ebooks", + // "partial" + // ], + // "enumDescriptions": [ + // "All Google eBooks.", + // "Google eBook with full volume text viewability.", + // "Public can view entire volume text.", + // "Google eBook with a price.", + // "Public able to see parts of text." + // ], + // "location": "query", + // "type": "string" + // }, + // "langRestrict": { + // "description": "Restrict results to books with this language code.", + // "location": "query", + // "type": "string" + // }, + // "libraryRestrict": { + // "description": "Restrict search to this user's library.", + // "enum": [ + // "my-library", + // "no-restrict" + // ], + // "enumDescriptions": [ + // "Restrict to the user's library, any shelf.", + // "Do not restrict based on user's library." + // ], + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "uint32", + // "location": "query", + // "maximum": "40", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sort search results.", + // "enum": [ + // "newest", + // "relevance" + // ], + // "enumDescriptions": [ + // "Most recently published.", + // "Relevance to search terms." + // ], + // "location": "query", + // "type": "string" + // }, + // "partner": { + // "description": "Restrict and brand results for partner ID.", + // "location": "query", + // "type": "string" + // }, + // "printType": { + // "description": "Restrict to books or magazines.", + // "enum": [ + // "all", + // "books", + // "magazines" + // ], + // "enumDescriptions": [ + // "All volume content types.", + // "Just books.", + // "Just magazines." + // ], + // "location": "query", + // "type": "string" + // }, + // "projection": { + // "description": "Restrict information returned to a set of selected fields.", + // "enum": [ + // "full", + // "lite" + // ], + // "enumDescriptions": [ + // "Includes all volume data.", + // "Includes a subset of fields in volumeInfo and accessInfo." + // ], + // "location": "query", + // "type": "string" + // }, + // "q": { + // "description": "Full-text search query string.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "showPreorders": { + // "description": "Set to true to show books available for preorder. Defaults to false.", + // "location": "query", + // "type": "boolean" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first result to return (starts at 0)", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "volumes", + // "response": { + // "$ref": "Volumes" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.volumes.associated.list": + +type VolumesAssociatedListCall struct { + s *Service + volumeId string + opt_ map[string]interface{} +} + +// List: Return a list of associated books. +func (r *VolumesAssociatedService) List(volumeId string) *VolumesAssociatedListCall { + c := &VolumesAssociatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.volumeId = volumeId + return c +} + +// Association sets the optional parameter "association": Association +// type. +func (c *VolumesAssociatedListCall) Association(association string) *VolumesAssociatedListCall { + c.opt_["association"] = association + return c +} + +// Locale sets the optional parameter "locale": ISO-639-1 language and +// ISO-3166-1 country code. Ex: 'en_US'. Used for generating +// recommendations. +func (c *VolumesAssociatedListCall) Locale(locale string) *VolumesAssociatedListCall { + c.opt_["locale"] = locale + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *VolumesAssociatedListCall) Source(source string) *VolumesAssociatedListCall { + c.opt_["source"] = source + return c +} + +func (c *VolumesAssociatedListCall) Do() (*Volumes, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["association"]; ok { + params.Set("association", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/associated") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{volumeId}", url.QueryEscape(c.volumeId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Volumes) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return a list of associated books.", + // "httpMethod": "GET", + // "id": "books.volumes.associated.list", + // "parameterOrder": [ + // "volumeId" + // ], + // "parameters": { + // "association": { + // "description": "Association type.", + // "enum": [ + // "end-of-sample", + // "end-of-volume" + // ], + // "enumDescriptions": [ + // "Recommendations for display end-of-sample.", + // "Recommendations for display end-of-volume." + // ], + // "location": "query", + // "type": "string" + // }, + // "locale": { + // "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations.", + // "location": "query", + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "volumeId": { + // "description": "ID of the source volume.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "volumes/{volumeId}/associated", + // "response": { + // "$ref": "Volumes" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.volumes.mybooks.list": + +type VolumesMybooksListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Return a list of books in My Library. +func (r *VolumesMybooksService) List() *VolumesMybooksListCall { + c := &VolumesMybooksListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// AcquireMethod sets the optional parameter "acquireMethod": How the +// book was aquired +func (c *VolumesMybooksListCall) AcquireMethod(acquireMethod string) *VolumesMybooksListCall { + c.opt_["acquireMethod"] = acquireMethod + return c +} + +// Locale sets the optional parameter "locale": ISO-639-1 language and +// ISO-3166-1 country code. Ex:'en_US'. Used for generating +// recommendations. +func (c *VolumesMybooksListCall) Locale(locale string) *VolumesMybooksListCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *VolumesMybooksListCall) MaxResults(maxResults int64) *VolumesMybooksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// ProcessingState sets the optional parameter "processingState": The +// processing state of the user uploaded volumes to be returned. +// Applicable only if the UPLOADED is specified in the acquireMethod. +func (c *VolumesMybooksListCall) ProcessingState(processingState string) *VolumesMybooksListCall { + c.opt_["processingState"] = processingState + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *VolumesMybooksListCall) Source(source string) *VolumesMybooksListCall { + c.opt_["source"] = source + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first result to return (starts at 0) +func (c *VolumesMybooksListCall) StartIndex(startIndex int64) *VolumesMybooksListCall { + c.opt_["startIndex"] = startIndex + return c +} + +func (c *VolumesMybooksListCall) Do() (*Volumes, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["acquireMethod"]; ok { + params.Set("acquireMethod", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["processingState"]; ok { + params.Set("processingState", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/mybooks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Volumes) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return a list of books in My Library.", + // "httpMethod": "GET", + // "id": "books.volumes.mybooks.list", + // "parameters": { + // "acquireMethod": { + // "description": "How the book was aquired", + // "enum": [ + // "PREORDERED", + // "PREVIOUSLY_RENTED", + // "PUBLIC_DOMAIN", + // "PURCHASED", + // "RENTED", + // "SAMPLE", + // "UPLOADED" + // ], + // "enumDescriptions": [ + // "Preordered books (not yet available)", + // "User-rented books past their expiration time", + // "Public domain books", + // "Purchased books", + // "User-rented books", + // "Sample books", + // "User uploaded books" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "locale": { + // "description": "ISO-639-1 language and ISO-3166-1 country code. Ex:'en_US'. Used for generating recommendations.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "processingState": { + // "description": "The processing state of the user uploaded volumes to be returned. Applicable only if the UPLOADED is specified in the acquireMethod.", + // "enum": [ + // "COMPLETED_FAILED", + // "COMPLETED_SUCCESS", + // "RUNNING" + // ], + // "enumDescriptions": [ + // "The volume processing hase failed.", + // "The volume processing was completed.", + // "The volume processing is not completed." + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first result to return (starts at 0)", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // } + // }, + // "path": "volumes/mybooks", + // "response": { + // "$ref": "Volumes" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.volumes.recommended.list": + +type VolumesRecommendedListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Return a list of recommended books for the current user. +func (r *VolumesRecommendedService) List() *VolumesRecommendedListCall { + c := &VolumesRecommendedListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Locale sets the optional parameter "locale": ISO-639-1 language and +// ISO-3166-1 country code. Ex: 'en_US'. Used for generating +// recommendations. +func (c *VolumesRecommendedListCall) Locale(locale string) *VolumesRecommendedListCall { + c.opt_["locale"] = locale + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *VolumesRecommendedListCall) Source(source string) *VolumesRecommendedListCall { + c.opt_["source"] = source + return c +} + +func (c *VolumesRecommendedListCall) Do() (*Volumes, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/recommended") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Volumes) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return a list of recommended books for the current user.", + // "httpMethod": "GET", + // "id": "books.volumes.recommended.list", + // "parameters": { + // "locale": { + // "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations.", + // "location": "query", + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "volumes/recommended", + // "response": { + // "$ref": "Volumes" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.volumes.recommended.rate": + +type VolumesRecommendedRateCall struct { + s *Service + rating string + volumeId string + opt_ map[string]interface{} +} + +// Rate: Rate a recommended book for the current user. +func (r *VolumesRecommendedService) Rate(rating string, volumeId string) *VolumesRecommendedRateCall { + c := &VolumesRecommendedRateCall{s: r.s, opt_: make(map[string]interface{})} + c.rating = rating + c.volumeId = volumeId + return c +} + +// Locale sets the optional parameter "locale": ISO-639-1 language and +// ISO-3166-1 country code. Ex: 'en_US'. Used for generating +// recommendations. +func (c *VolumesRecommendedRateCall) Locale(locale string) *VolumesRecommendedRateCall { + c.opt_["locale"] = locale + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *VolumesRecommendedRateCall) Source(source string) *VolumesRecommendedRateCall { + c.opt_["source"] = source + return c +} + +func (c *VolumesRecommendedRateCall) Do() (*BooksVolumesRecommendedRateResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("rating", fmt.Sprintf("%v", c.rating)) + params.Set("volumeId", fmt.Sprintf("%v", c.volumeId)) + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/recommended/rate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BooksVolumesRecommendedRateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Rate a recommended book for the current user.", + // "httpMethod": "POST", + // "id": "books.volumes.recommended.rate", + // "parameterOrder": [ + // "rating", + // "volumeId" + // ], + // "parameters": { + // "locale": { + // "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations.", + // "location": "query", + // "type": "string" + // }, + // "rating": { + // "description": "Rating to be given to the volume.", + // "enum": [ + // "HAVE_IT", + // "NOT_INTERESTED" + // ], + // "enumDescriptions": [ + // "Rating indicating a dismissal due to ownership.", + // "Rating indicating a negative dismissal of a volume." + // ], + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "volumeId": { + // "description": "ID of the source volume.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "volumes/recommended/rate", + // "response": { + // "$ref": "BooksVolumesRecommendedRateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.volumes.useruploaded.list": + +type VolumesUseruploadedListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Return a list of books uploaded by the current user. +func (r *VolumesUseruploadedService) List() *VolumesUseruploadedListCall { + c := &VolumesUseruploadedListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Locale sets the optional parameter "locale": ISO-639-1 language and +// ISO-3166-1 country code. Ex: 'en_US'. Used for generating +// recommendations. +func (c *VolumesUseruploadedListCall) Locale(locale string) *VolumesUseruploadedListCall { + c.opt_["locale"] = locale + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *VolumesUseruploadedListCall) MaxResults(maxResults int64) *VolumesUseruploadedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// ProcessingState sets the optional parameter "processingState": The +// processing state of the user uploaded volumes to be returned. +func (c *VolumesUseruploadedListCall) ProcessingState(processingState string) *VolumesUseruploadedListCall { + c.opt_["processingState"] = processingState + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *VolumesUseruploadedListCall) Source(source string) *VolumesUseruploadedListCall { + c.opt_["source"] = source + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first result to return (starts at 0) +func (c *VolumesUseruploadedListCall) StartIndex(startIndex int64) *VolumesUseruploadedListCall { + c.opt_["startIndex"] = startIndex + return c +} + +// VolumeId sets the optional parameter "volumeId": The ids of the +// volumes to be returned. If not specified all that match the +// processingState are returned. +func (c *VolumesUseruploadedListCall) VolumeId(volumeId string) *VolumesUseruploadedListCall { + c.opt_["volumeId"] = volumeId + return c +} + +func (c *VolumesUseruploadedListCall) Do() (*Volumes, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["processingState"]; ok { + params.Set("processingState", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["volumeId"]; ok { + params.Set("volumeId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/useruploaded") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Volumes) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return a list of books uploaded by the current user.", + // "httpMethod": "GET", + // "id": "books.volumes.useruploaded.list", + // "parameters": { + // "locale": { + // "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "uint32", + // "location": "query", + // "maximum": "40", + // "minimum": "0", + // "type": "integer" + // }, + // "processingState": { + // "description": "The processing state of the user uploaded volumes to be returned.", + // "enum": [ + // "COMPLETED_FAILED", + // "COMPLETED_SUCCESS", + // "RUNNING" + // ], + // "enumDescriptions": [ + // "The volume processing hase failed.", + // "The volume processing was completed.", + // "The volume processing is not completed." + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first result to return (starts at 0)", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "volumeId": { + // "description": "The ids of the volumes to be returned. If not specified all that match the processingState are returned.", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "volumes/useruploaded", + // "response": { + // "$ref": "Volumes" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/build-examples.sh b/third_party/src/code.google.com/p/google-api-go-client/build-examples.sh new file mode 100755 index 0000000000000..215fb80d8432f --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/build-examples.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +make -C google-api install +make -C google-api-go-generator install +google-api-go-generator/google-api-go-gen -cache -api=tasks:v1 +google-api-go-generator/google-api-go-gen -cache -api=urlshortener:v1 +make -C tasks/v1 install +make -C urlshortener/v1 install +make -C examples diff --git a/third_party/src/code.google.com/p/google-api-go-client/calendar/v3/calendar-api.json b/third_party/src/code.google.com/p/google-api-go-client/calendar/v3/calendar-api.json new file mode 100644 index 0000000000000..ca4b1c52dce79 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/calendar/v3/calendar-api.json @@ -0,0 +1,2364 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/AvFzDvrMkTggQcj9dKzw6cVhrpQ\"", + "discoveryVersion": "v1", + "id": "calendar:v3", + "name": "calendar", + "version": "v3", + "title": "Calendar API", + "description": "Lets you manipulate events and other calendar data.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/calendar-16.png", + "x32": "http://www.google.com/images/icons/product/calendar-32.png" + }, + "documentationLink": "https://developers.google.com/google-apps/calendar/firstapp", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/calendar/v3/", + "basePath": "/calendar/v3/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "calendar/v3/", + "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/calendar": { + "description": "Manage your calendars" + }, + "https://www.googleapis.com/auth/calendar.readonly": { + "description": "View your calendars" + } + } + } + }, + "schemas": { + "Acl": { + "id": "Acl", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the collection." + }, + "items": { + "type": "array", + "description": "List of rules on the access control list.", + "items": { + "$ref": "AclRule" + } + }, + "kind": { + "type": "string", + "description": "Type of the collection (\"calendar#acl\").", + "default": "calendar#acl" + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access the next page of this result. Omitted if no further results are available." + } + } + }, + "AclRule": { + "id": "AclRule", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "id": { + "type": "string", + "description": "Identifier of the ACL rule." + }, + "kind": { + "type": "string", + "description": "Type of the resource (\"calendar#aclRule\").", + "default": "calendar#aclRule" + }, + "role": { + "type": "string", + "description": "The role assigned to the scope. Possible values are: \n- \"none\" - Provides no access. \n- \"freeBusyReader\" - Provides read access to free/busy information. \n- \"reader\" - Provides read access to the calendar. Private events will appear to users with reader access, but event details will be hidden. \n- \"writer\" - Provides read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible. \n- \"owner\" - Provides ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and manipulate ACLs.", + "annotations": { + "required": [ + "calendar.acl.insert" + ] + } + }, + "scope": { + "type": "object", + "description": "The scope of the rule.", + "properties": { + "type": { + "type": "string", + "description": "The type of the scope. Possible values are: \n- \"default\" - The public scope. This is the default value. \n- \"user\" - Limits the scope to a single user. \n- \"group\" - Limits the scope to a group. \n- \"domain\" - Limits the scope to a domain. Note: The permissions granted to the \"default\", or public, scope apply to any user, authenticated or not.", + "annotations": { + "required": [ + "calendar.acl.insert" + ] + } + }, + "value": { + "type": "string", + "description": "The email address of a user or group, or the name of a domain, depending on the scope type. Omitted for type \"default\"." + } + }, + "annotations": { + "required": [ + "calendar.acl.insert" + ] + } + } + } + }, + "Calendar": { + "id": "Calendar", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Description of the calendar. Optional." + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "id": { + "type": "string", + "description": "Identifier of the calendar." + }, + "kind": { + "type": "string", + "description": "Type of the resource (\"calendar#calendar\").", + "default": "calendar#calendar" + }, + "location": { + "type": "string", + "description": "Geographic location of the calendar as free-form text. Optional." + }, + "summary": { + "type": "string", + "description": "Title of the calendar.", + "annotations": { + "required": [ + "calendar.calendars.insert" + ] + } + }, + "timeZone": { + "type": "string", + "description": "The time zone of the calendar. Optional." + } + } + }, + "CalendarList": { + "id": "CalendarList", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the collection." + }, + "items": { + "type": "array", + "description": "Calendars that are present on the user's calendar list.", + "items": { + "$ref": "CalendarListEntry" + } + }, + "kind": { + "type": "string", + "description": "Type of the collection (\"calendar#calendarList\").", + "default": "calendar#calendarList" + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access the next page of this result." + } + } + }, + "CalendarListEntry": { + "id": "CalendarListEntry", + "type": "object", + "properties": { + "accessRole": { + "type": "string", + "description": "The effective access role that the authenticated user has on the calendar. Read-only. Possible values are: \n- \"freeBusyReader\" - Provides read access to free/busy information. \n- \"reader\" - Provides read access to the calendar. Private events will appear to users with reader access, but event details will be hidden. \n- \"writer\" - Provides read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible. \n- \"owner\" - Provides ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and manipulate ACLs." + }, + "backgroundColor": { + "type": "string", + "description": "The main color of the calendar in the format '#0088aa'. This property supersedes the index-based colorId property. Optional." + }, + "colorId": { + "type": "string", + "description": "The color of the calendar. This is an ID referring to an entry in the \"calendar\" section of the colors definition (see the \"colors\" endpoint). Optional." + }, + "defaultReminders": { + "type": "array", + "description": "The default reminders that the authenticated user has for this calendar.", + "items": { + "$ref": "EventReminder" + } + }, + "description": { + "type": "string", + "description": "Description of the calendar. Optional. Read-only." + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "foregroundColor": { + "type": "string", + "description": "The foreground color of the calendar in the format '#ffffff'. This property supersedes the index-based colorId property. Optional." + }, + "hidden": { + "type": "boolean", + "description": "Whether the calendar has been hidden from the list. Optional. The default is False.", + "default": "false" + }, + "id": { + "type": "string", + "description": "Identifier of the calendar.", + "annotations": { + "required": [ + "calendar.calendarList.insert" + ] + } + }, + "kind": { + "type": "string", + "description": "Type of the resource (\"calendar#calendarListEntry\").", + "default": "calendar#calendarListEntry" + }, + "location": { + "type": "string", + "description": "Geographic location of the calendar as free-form text. Optional. Read-only." + }, + "notificationSettings": { + "type": "object", + "description": "The notifications that the authenticated user is receiving for this calendar.", + "properties": { + "notifications": { + "type": "array", + "description": "The list of notifications set for this calendar.", + "items": { + "$ref": "CalendarNotification" + } + } + } + }, + "primary": { + "type": "boolean", + "description": "Whether the calendar is the primary calendar of the authenticated user. Read-only. Optional. The default is False.", + "default": "false" + }, + "selected": { + "type": "boolean", + "description": "Whether the calendar content shows up in the calendar UI. Optional. The default is False.", + "default": "false" + }, + "summary": { + "type": "string", + "description": "Title of the calendar. Read-only." + }, + "summaryOverride": { + "type": "string", + "description": "The summary that the authenticated user has set for this calendar. Optional." + }, + "timeZone": { + "type": "string", + "description": "The time zone of the calendar. Optional. Read-only." + } + } + }, + "CalendarNotification": { + "id": "CalendarNotification", + "type": "object", + "properties": { + "method": { + "type": "string", + "description": "The method used to deliver the notification. Possible values are: \n- \"email\" - Reminders are sent via email. \n- \"sms\" - Reminders are sent via SMS. This value is read-only and is ignored on inserts and updates.", + "annotations": { + "required": [ + "calendar.calendarList.insert", + "calendar.calendarList.update" + ] + } + }, + "type": { + "type": "string", + "description": "The type of notification. Possible values are: \n- \"eventCreation\" - Notification sent when a new event is put on the calendar. \n- \"eventChange\" - Notification sent when an event is changed. \n- \"eventCancellation\" - Notification sent when an event is cancelled. \n- \"eventResponse\" - Notification sent when an event is changed. \n- \"agenda\" - An agenda with the events of the day (sent out in the morning).", + "annotations": { + "required": [ + "calendar.calendarList.insert", + "calendar.calendarList.update" + ] + } + } + } + }, + "Channel": { + "id": "Channel", + "type": "object", + "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." + } + } + }, + "ColorDefinition": { + "id": "ColorDefinition", + "type": "object", + "properties": { + "background": { + "type": "string", + "description": "The background color associated with this color definition." + }, + "foreground": { + "type": "string", + "description": "The foreground color that can be used to write on top of a background with 'background' color." + } + } + }, + "Colors": { + "id": "Colors", + "type": "object", + "properties": { + "calendar": { + "type": "object", + "description": "Palette of calendar colors, mapping from the color ID to its definition. An 'calendarListEntry' resource refers to one of these color IDs in its 'color' field. Read-only.", + "additionalProperties": { + "$ref": "ColorDefinition", + "description": "A calendar color defintion." + } + }, + "event": { + "type": "object", + "description": "Palette of event colors, mapping from the color ID to its definition. An 'event' resource may refer to one of these color IDs in its 'color' field. Read-only.", + "additionalProperties": { + "$ref": "ColorDefinition", + "description": "An event color definition." + } + }, + "kind": { + "type": "string", + "description": "Type of the resource (\"calendar#colors\").", + "default": "calendar#colors" + }, + "updated": { + "type": "string", + "description": "Last modification time of the color palette (as a RFC 3339 timestamp). Read-only.", + "format": "date-time" + } + } + }, + "Error": { + "id": "Error", + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "Domain, or broad category, of the error." + }, + "reason": { + "type": "string", + "description": "Specific reason for the error. Some of the possible values are: \n- \"groupTooBig\" - The group of users requested is too large for a single query. \n- \"tooManyCalendarsRequested\" - The number of calendars requested is too large for a single query. \n- \"notFound\" - The requested resource was not found. \n- \"internalError\" - The API service has encountered an internal error. Additional error types may be added in the future, so clients should gracefully handle additional error statuses not included in this list." + } + } + }, + "Event": { + "id": "Event", + "type": "object", + "properties": { + "anyoneCanAddSelf": { + "type": "boolean", + "description": "Whether anyone can invite themselves to the event. Optional. The default is False.", + "default": "false" + }, + "attendees": { + "type": "array", + "description": "The attendees of the event.", + "items": { + "$ref": "EventAttendee" + } + }, + "attendeesOmitted": { + "type": "boolean", + "description": "Whether attendees may have been omitted from the event's representation. When retrieving an event, this may be due to a restriction specified by the 'maxAttendee' query parameter. When updating an event, this can be used to only update the participant's response. Optional. The default is False.", + "default": "false" + }, + "colorId": { + "type": "string", + "description": "The color of the event. This is an ID referring to an entry in the \"event\" section of the colors definition (see the \"colors\" endpoint). Optional." + }, + "created": { + "type": "string", + "description": "Creation time of the event (as a RFC 3339 timestamp). Read-only.", + "format": "date-time" + }, + "creator": { + "type": "object", + "description": "The creator of the event. Read-only.", + "properties": { + "displayName": { + "type": "string", + "description": "The creator's name, if available." + }, + "email": { + "type": "string", + "description": "The creator's email address, if available." + }, + "id": { + "type": "string", + "description": "The creator's Profile ID, if available." + }, + "self": { + "type": "boolean", + "description": "Whether the creator corresponds to the calendar on which this copy of the event appears. Read-only. The default is False.", + "default": "false" + } + } + }, + "description": { + "type": "string", + "description": "Description of the event. Optional." + }, + "end": { + "$ref": "EventDateTime", + "description": "The (exclusive) end time of the event. For a recurring event, this is the end time of the first instance.", + "annotations": { + "required": [ + "calendar.events.import", + "calendar.events.insert", + "calendar.events.update" + ] + } + }, + "endTimeUnspecified": { + "type": "boolean", + "description": "Whether the end time is actually unspecified. An end time is still provided for compatibility reasons, even if this attribute is set to True. The default is False.", + "default": "false" + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "extendedProperties": { + "type": "object", + "description": "Extended properties of the event.", + "properties": { + "private": { + "type": "object", + "description": "Properties that are private to the copy of the event that appears on this calendar.", + "additionalProperties": { + "type": "string", + "description": "The name of the private property and the corresponding value." + } + }, + "shared": { + "type": "object", + "description": "Properties that are shared between copies of the event on other attendees' calendars.", + "additionalProperties": { + "type": "string", + "description": "The name of the shared property and the corresponding value." + } + } + } + }, + "gadget": { + "type": "object", + "description": "A gadget that extends this event.", + "properties": { + "display": { + "type": "string", + "description": "The gadget's display mode. Optional. Possible values are: \n- \"icon\" - The gadget displays next to the event's title in the calendar view. \n- \"chip\" - The gadget displays when the event is clicked." + }, + "height": { + "type": "integer", + "description": "The gadget's height in pixels. Optional.", + "format": "int32" + }, + "iconLink": { + "type": "string", + "description": "The gadget's icon URL." + }, + "link": { + "type": "string", + "description": "The gadget's URL." + }, + "preferences": { + "type": "object", + "description": "Preferences.", + "additionalProperties": { + "type": "string", + "description": "The preference name and corresponding value." + } + }, + "title": { + "type": "string", + "description": "The gadget's title." + }, + "type": { + "type": "string", + "description": "The gadget's type." + }, + "width": { + "type": "integer", + "description": "The gadget's width in pixels. Optional.", + "format": "int32" + } + } + }, + "guestsCanInviteOthers": { + "type": "boolean", + "description": "Whether attendees other than the organizer can invite others to the event. Optional. The default is True.", + "default": "true" + }, + "guestsCanModify": { + "type": "boolean", + "description": "Whether attendees other than the organizer can modify the event. Optional. The default is False.", + "default": "false" + }, + "guestsCanSeeOtherGuests": { + "type": "boolean", + "description": "Whether attendees other than the organizer can see who the event's attendees are. Optional. The default is True.", + "default": "true" + }, + "hangoutLink": { + "type": "string", + "description": "An absolute link to the Google+ hangout associated with this event. Read-only." + }, + "htmlLink": { + "type": "string", + "description": "An absolute link to this event in the Google Calendar Web UI. Read-only." + }, + "iCalUID": { + "type": "string", + "description": "Event ID in the iCalendar format.", + "annotations": { + "required": [ + "calendar.events.import" + ] + } + }, + "id": { + "type": "string", + "description": "Identifier of the event. When creating new single or recurring events, you can specify their IDs. Provided IDs must follow these rules: \n- characters allowed in the ID are those used in base32hex encoding, i.e. lowercase letters a-v and digits 0-9, see section 3.1.2 in RFC2938 \n- the length of the ID must be between 5 and 1024 characters \n- the ID must be unique per calendar Due to the globally distributed nature of the system, we cannot guarantee that ID collisions will be detected at event creation time. To minimize the risk of collisions we recommend using an established UUID algorithm such as one described in RFC4122." + }, + "kind": { + "type": "string", + "description": "Type of the resource (\"calendar#event\").", + "default": "calendar#event" + }, + "location": { + "type": "string", + "description": "Geographic location of the event as free-form text. Optional." + }, + "locked": { + "type": "boolean", + "description": "Whether this is a locked event copy where no changes can be made to the main event fields \"summary\", \"description\", \"location\", \"start\", \"end\" or \"recurrence\". The default is False. Read-Only.", + "default": "false" + }, + "organizer": { + "type": "object", + "description": "The organizer of the event. If the organizer is also an attendee, this is indicated with a separate entry in 'attendees' with the 'organizer' field set to True. To change the organizer, use the \"move\" operation. Read-only, except when importing an event.", + "properties": { + "displayName": { + "type": "string", + "description": "The organizer's name, if available." + }, + "email": { + "type": "string", + "description": "The organizer's email address, if available." + }, + "id": { + "type": "string", + "description": "The organizer's Profile ID, if available." + }, + "self": { + "type": "boolean", + "description": "Whether the organizer corresponds to the calendar on which this copy of the event appears. Read-only. The default is False.", + "default": "false" + } + } + }, + "originalStartTime": { + "$ref": "EventDateTime", + "description": "For an instance of a recurring event, this is the time at which this event would start according to the recurrence data in the recurring event identified by recurringEventId. Immutable." + }, + "privateCopy": { + "type": "boolean", + "description": "Whether this is a private event copy where changes are not shared with other copies on other calendars. Optional. Immutable. The default is False.", + "default": "false" + }, + "recurrence": { + "type": "array", + "description": "List of RRULE, EXRULE, RDATE and EXDATE lines for a recurring event. This field is omitted for single events or instances of recurring events.", + "items": { + "type": "string" + } + }, + "recurringEventId": { + "type": "string", + "description": "For an instance of a recurring event, this is the event ID of the recurring event itself. Immutable." + }, + "reminders": { + "type": "object", + "description": "Information about the event's reminders for the authenticated user.", + "properties": { + "overrides": { + "type": "array", + "description": "If the event doesn't use the default reminders, this lists the reminders specific to the event, or, if not set, indicates that no reminders are set for this event.", + "items": { + "$ref": "EventReminder" + } + }, + "useDefault": { + "type": "boolean", + "description": "Whether the default reminders of the calendar apply to the event." + } + } + }, + "sequence": { + "type": "integer", + "description": "Sequence number as per iCalendar.", + "format": "int32" + }, + "source": { + "type": "object", + "description": "Source of an event from which it was created; for example a web page, an email message or any document identifiable by an URL using HTTP/HTTPS protocol. Accessible only by the creator of the event.", + "properties": { + "title": { + "type": "string", + "description": "Title of the source; for example a title of a web page or an email subject." + }, + "url": { + "type": "string", + "description": "URL of the source pointing to a resource. URL's protocol must be HTTP or HTTPS." + } + } + }, + "start": { + "$ref": "EventDateTime", + "description": "The (inclusive) start time of the event. For a recurring event, this is the start time of the first instance.", + "annotations": { + "required": [ + "calendar.events.import", + "calendar.events.insert", + "calendar.events.update" + ] + } + }, + "status": { + "type": "string", + "description": "Status of the event. Optional. Possible values are: \n- \"confirmed\" - The event is confirmed. This is the default status. \n- \"tentative\" - The event is tentatively confirmed. \n- \"cancelled\" - The event is cancelled." + }, + "summary": { + "type": "string", + "description": "Title of the event." + }, + "transparency": { + "type": "string", + "description": "Whether the event blocks time on the calendar. Optional. Possible values are: \n- \"opaque\" - The event blocks time on the calendar. This is the default value. \n- \"transparent\" - The event does not block time on the calendar.", + "default": "opaque" + }, + "updated": { + "type": "string", + "description": "Last modification time of the event (as a RFC 3339 timestamp). Read-only.", + "format": "date-time" + }, + "visibility": { + "type": "string", + "description": "Visibility of the event. Optional. Possible values are: \n- \"default\" - Uses the default visibility for events on the calendar. This is the default value. \n- \"public\" - The event is public and event details are visible to all readers of the calendar. \n- \"private\" - The event is private and only event attendees may view event details. \n- \"confidential\" - The event is private. This value is provided for compatibility reasons.", + "default": "default" + } + } + }, + "EventAttendee": { + "id": "EventAttendee", + "type": "object", + "properties": { + "additionalGuests": { + "type": "integer", + "description": "Number of additional guests. Optional. The default is 0.", + "format": "int32" + }, + "comment": { + "type": "string", + "description": "The attendee's response comment. Optional." + }, + "displayName": { + "type": "string", + "description": "The attendee's name, if available. Optional." + }, + "email": { + "type": "string", + "description": "The attendee's email address, if available. This field must be present when adding an attendee.", + "annotations": { + "required": [ + "calendar.events.import", + "calendar.events.insert", + "calendar.events.update" + ] + } + }, + "id": { + "type": "string", + "description": "The attendee's Profile ID, if available." + }, + "optional": { + "type": "boolean", + "description": "Whether this is an optional attendee. Optional. The default is False." + }, + "organizer": { + "type": "boolean", + "description": "Whether the attendee is the organizer of the event. Read-only. The default is False." + }, + "resource": { + "type": "boolean", + "description": "Whether the attendee is a resource. Read-only. The default is False." + }, + "responseStatus": { + "type": "string", + "description": "The attendee's response status. Possible values are: \n- \"needsAction\" - The attendee has not responded to the invitation. \n- \"declined\" - The attendee has declined the invitation. \n- \"tentative\" - The attendee has tentatively accepted the invitation. \n- \"accepted\" - The attendee has accepted the invitation." + }, + "self": { + "type": "boolean", + "description": "Whether this entry represents the calendar on which this copy of the event appears. Read-only. The default is False." + } + } + }, + "EventDateTime": { + "id": "EventDateTime", + "type": "object", + "properties": { + "date": { + "type": "string", + "description": "The date, in the format \"yyyy-mm-dd\", if this is an all-day event.", + "format": "date" + }, + "dateTime": { + "type": "string", + "description": "The time, as a combined date-time value (formatted according to RFC 3339). A time zone offset is required unless a time zone is explicitly specified in 'timeZone'.", + "format": "date-time" + }, + "timeZone": { + "type": "string", + "description": "The name of the time zone in which the time is specified (e.g. \"Europe/Zurich\"). Optional. The default is the time zone of the calendar." + } + } + }, + "EventReminder": { + "id": "EventReminder", + "type": "object", + "properties": { + "method": { + "type": "string", + "description": "The method used by this reminder. Possible values are: \n- \"email\" - Reminders are sent via email. \n- \"sms\" - Reminders are sent via SMS. \n- \"popup\" - Reminders are sent via a UI popup.", + "annotations": { + "required": [ + "calendar.calendarList.insert", + "calendar.calendarList.update", + "calendar.events.import", + "calendar.events.insert", + "calendar.events.update" + ] + } + }, + "minutes": { + "type": "integer", + "description": "Number of minutes before the start of the event when the reminder should trigger.", + "format": "int32", + "annotations": { + "required": [ + "calendar.calendarList.insert", + "calendar.calendarList.update", + "calendar.events.import", + "calendar.events.insert", + "calendar.events.update" + ] + } + } + } + }, + "Events": { + "id": "Events", + "type": "object", + "properties": { + "accessRole": { + "type": "string", + "description": "The user's access role for this calendar. Read-only. Possible values are: \n- \"none\" - The user has no access. \n- \"freeBusyReader\" - The user has read access to free/busy information. \n- \"reader\" - The user has read access to the calendar. Private events will appear to users with reader access, but event details will be hidden. \n- \"writer\" - The user has read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible. \n- \"owner\" - The user has ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and manipulate ACLs." + }, + "defaultReminders": { + "type": "array", + "description": "The default reminders on the calendar for the authenticated user. These reminders apply to all events on this calendar that do not explicitly override them (i.e. do not have 'reminders.useDefault' set to 'true').", + "items": { + "$ref": "EventReminder" + } + }, + "description": { + "type": "string", + "description": "Description of the calendar. Read-only." + }, + "etag": { + "type": "string", + "description": "ETag of the collection." + }, + "items": { + "type": "array", + "description": "List of events on the calendar.", + "items": { + "$ref": "Event" + } + }, + "kind": { + "type": "string", + "description": "Type of the collection (\"calendar#events\").", + "default": "calendar#events" + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access the next page of this result. Omitted if no further results are available." + }, + "summary": { + "type": "string", + "description": "Title of the calendar. Read-only." + }, + "timeZone": { + "type": "string", + "description": "The time zone of the calendar. Read-only." + }, + "updated": { + "type": "string", + "description": "Last modification time of the calendar (as a RFC 3339 timestamp). Read-only.", + "format": "date-time" + } + } + }, + "FreeBusyCalendar": { + "id": "FreeBusyCalendar", + "type": "object", + "properties": { + "busy": { + "type": "array", + "description": "List of time ranges during which this calendar should be regarded as busy.", + "items": { + "$ref": "TimePeriod" + } + }, + "errors": { + "type": "array", + "description": "Optional error(s) (if computation for the calendar failed).", + "items": { + "$ref": "Error" + } + } + } + }, + "FreeBusyGroup": { + "id": "FreeBusyGroup", + "type": "object", + "properties": { + "calendars": { + "type": "array", + "description": "List of calendars' identifiers within a group.", + "items": { + "type": "string" + } + }, + "errors": { + "type": "array", + "description": "Optional error(s) (if computation for the group failed).", + "items": { + "$ref": "Error" + } + } + } + }, + "FreeBusyRequest": { + "id": "FreeBusyRequest", + "type": "object", + "properties": { + "calendarExpansionMax": { + "type": "integer", + "description": "Maximal number of calendars for which FreeBusy information is to be provided. Optional.", + "format": "int32" + }, + "groupExpansionMax": { + "type": "integer", + "description": "Maximal number of calendar identifiers to be provided for a single group. Optional. An error will be returned for a group with more members than this value.", + "format": "int32" + }, + "items": { + "type": "array", + "description": "List of calendars and/or groups to query.", + "items": { + "$ref": "FreeBusyRequestItem" + } + }, + "timeMax": { + "type": "string", + "description": "The end of the interval for the query.", + "format": "date-time" + }, + "timeMin": { + "type": "string", + "description": "The start of the interval for the query.", + "format": "date-time" + }, + "timeZone": { + "type": "string", + "description": "Time zone used in the response. Optional. The default is UTC.", + "default": "UTC" + } + } + }, + "FreeBusyRequestItem": { + "id": "FreeBusyRequestItem", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The identifier of a calendar or a group." + } + } + }, + "FreeBusyResponse": { + "id": "FreeBusyResponse", + "type": "object", + "properties": { + "calendars": { + "type": "object", + "description": "List of free/busy information for calendars.", + "additionalProperties": { + "$ref": "FreeBusyCalendar", + "description": "Free/busy expansions for a single calendar." + } + }, + "groups": { + "type": "object", + "description": "Expansion of groups.", + "additionalProperties": { + "$ref": "FreeBusyGroup", + "description": "List of calendars that are members of this group." + } + }, + "kind": { + "type": "string", + "description": "Type of the resource (\"calendar#freeBusy\").", + "default": "calendar#freeBusy" + }, + "timeMax": { + "type": "string", + "description": "The end of the interval.", + "format": "date-time" + }, + "timeMin": { + "type": "string", + "description": "The start of the interval.", + "format": "date-time" + } + } + }, + "Setting": { + "id": "Setting", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "id": { + "type": "string", + "description": "The id of the user setting." + }, + "kind": { + "type": "string", + "description": "Type of the resource (\"calendar#setting\").", + "default": "calendar#setting" + }, + "value": { + "type": "string", + "description": "Value of the user setting. The format of the value depends on the ID of the setting. It must always be a UTF-8 string of length up to 1024 characters." + } + } + }, + "Settings": { + "id": "Settings", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of the collection." + }, + "items": { + "type": "array", + "description": "List of user settings.", + "items": { + "$ref": "Setting" + } + }, + "kind": { + "type": "string", + "description": "Type of the collection (\"calendar#settings\").", + "default": "calendar#settings" + } + } + }, + "TimePeriod": { + "id": "TimePeriod", + "type": "object", + "properties": { + "end": { + "type": "string", + "description": "The (exclusive) end of the time period.", + "format": "date-time" + }, + "start": { + "type": "string", + "description": "The (inclusive) start of the time period.", + "format": "date-time" + } + } + } + }, + "resources": { + "acl": { + "methods": { + "delete": { + "id": "calendar.acl.delete", + "path": "calendars/{calendarId}/acl/{ruleId}", + "httpMethod": "DELETE", + "description": "Deletes an access control rule.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + }, + "ruleId": { + "type": "string", + "description": "ACL rule identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "calendarId", + "ruleId" + ], + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + }, + "get": { + "id": "calendar.acl.get", + "path": "calendars/{calendarId}/acl/{ruleId}", + "httpMethod": "GET", + "description": "Returns an access control rule.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + }, + "ruleId": { + "type": "string", + "description": "ACL rule identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "calendarId", + "ruleId" + ], + "response": { + "$ref": "AclRule" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar", + "https://www.googleapis.com/auth/calendar.readonly" + ] + }, + "insert": { + "id": "calendar.acl.insert", + "path": "calendars/{calendarId}/acl", + "httpMethod": "POST", + "description": "Creates an access control rule.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "calendarId" + ], + "request": { + "$ref": "AclRule" + }, + "response": { + "$ref": "AclRule" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + }, + "list": { + "id": "calendar.acl.list", + "path": "calendars/{calendarId}/acl", + "httpMethod": "GET", + "description": "Returns the rules in the access control list for the calendar.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "calendarId" + ], + "response": { + "$ref": "Acl" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ], + "supportsSubscription": true + }, + "patch": { + "id": "calendar.acl.patch", + "path": "calendars/{calendarId}/acl/{ruleId}", + "httpMethod": "PATCH", + "description": "Updates an access control rule. This method supports patch semantics.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + }, + "ruleId": { + "type": "string", + "description": "ACL rule identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "calendarId", + "ruleId" + ], + "request": { + "$ref": "AclRule" + }, + "response": { + "$ref": "AclRule" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + }, + "update": { + "id": "calendar.acl.update", + "path": "calendars/{calendarId}/acl/{ruleId}", + "httpMethod": "PUT", + "description": "Updates an access control rule.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + }, + "ruleId": { + "type": "string", + "description": "ACL rule identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "calendarId", + "ruleId" + ], + "request": { + "$ref": "AclRule" + }, + "response": { + "$ref": "AclRule" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + } + } + }, + "calendarList": { + "methods": { + "delete": { + "id": "calendar.calendarList.delete", + "path": "users/me/calendarList/{calendarId}", + "httpMethod": "DELETE", + "description": "Deletes an entry on the user's calendar list.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "calendarId" + ], + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + }, + "get": { + "id": "calendar.calendarList.get", + "path": "users/me/calendarList/{calendarId}", + "httpMethod": "GET", + "description": "Returns an entry on the user's calendar list.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "calendarId" + ], + "response": { + "$ref": "CalendarListEntry" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar", + "https://www.googleapis.com/auth/calendar.readonly" + ] + }, + "insert": { + "id": "calendar.calendarList.insert", + "path": "users/me/calendarList", + "httpMethod": "POST", + "description": "Adds an entry to the user's calendar list.", + "parameters": { + "colorRgbFormat": { + "type": "boolean", + "description": "Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False.", + "location": "query" + } + }, + "request": { + "$ref": "CalendarListEntry" + }, + "response": { + "$ref": "CalendarListEntry" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + }, + "list": { + "id": "calendar.calendarList.list", + "path": "users/me/calendarList", + "httpMethod": "GET", + "description": "Returns entries on the user's calendar list.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of entries returned on one result page. Optional.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "minAccessRole": { + "type": "string", + "description": "The minimum access role for the user in the returned entires. Optional. The default is no restriction.", + "enum": [ + "freeBusyReader", + "owner", + "reader", + "writer" + ], + "enumDescriptions": [ + "The user can read free/busy information.", + "The user can read and modify events and access control lists.", + "The user can read events that are not private.", + "The user can read and modify events." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token specifying which result page to return. Optional.", + "location": "query" + }, + "showHidden": { + "type": "boolean", + "description": "Whether to show hidden entries. Optional. The default is False.", + "location": "query" + } + }, + "response": { + "$ref": "CalendarList" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar", + "https://www.googleapis.com/auth/calendar.readonly" + ], + "supportsSubscription": true + }, + "patch": { + "id": "calendar.calendarList.patch", + "path": "users/me/calendarList/{calendarId}", + "httpMethod": "PATCH", + "description": "Updates an entry on the user's calendar list. This method supports patch semantics.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + }, + "colorRgbFormat": { + "type": "boolean", + "description": "Whether to use the 'foregroundColor' and 'backgroundColor' fields to write the calendar colors (RGB). If this feature is used, the index-based 'colorId' field will be set to the best matching option automatically. Optional. The default is False.", + "location": "query" + } + }, + "parameterOrder": [ + "calendarId" + ], + "request": { + "$ref": "CalendarListEntry" + }, + "response": { + "$ref": "CalendarListEntry" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + }, + "update": { + "id": "calendar.calendarList.update", + "path": "users/me/calendarList/{calendarId}", + "httpMethod": "PUT", + "description": "Updates an entry on the user's calendar list.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + }, + "colorRgbFormat": { + "type": "boolean", + "description": "Whether to use the 'foregroundColor' and 'backgroundColor' fields to write the calendar colors (RGB). If this feature is used, the index-based 'colorId' field will be set to the best matching option automatically. Optional. The default is False.", + "location": "query" + } + }, + "parameterOrder": [ + "calendarId" + ], + "request": { + "$ref": "CalendarListEntry" + }, + "response": { + "$ref": "CalendarListEntry" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + } + } + }, + "calendars": { + "methods": { + "clear": { + "id": "calendar.calendars.clear", + "path": "calendars/{calendarId}/clear", + "httpMethod": "POST", + "description": "Clears a primary calendar. This operation deletes all data associated with the primary calendar of an account and cannot be undone.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "calendarId" + ], + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + }, + "delete": { + "id": "calendar.calendars.delete", + "path": "calendars/{calendarId}", + "httpMethod": "DELETE", + "description": "Deletes a secondary calendar.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "calendarId" + ], + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + }, + "get": { + "id": "calendar.calendars.get", + "path": "calendars/{calendarId}", + "httpMethod": "GET", + "description": "Returns metadata for a calendar.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "calendarId" + ], + "response": { + "$ref": "Calendar" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar", + "https://www.googleapis.com/auth/calendar.readonly" + ] + }, + "insert": { + "id": "calendar.calendars.insert", + "path": "calendars", + "httpMethod": "POST", + "description": "Creates a secondary calendar.", + "request": { + "$ref": "Calendar" + }, + "response": { + "$ref": "Calendar" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + }, + "patch": { + "id": "calendar.calendars.patch", + "path": "calendars/{calendarId}", + "httpMethod": "PATCH", + "description": "Updates metadata for a calendar. This method supports patch semantics.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "calendarId" + ], + "request": { + "$ref": "Calendar" + }, + "response": { + "$ref": "Calendar" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + }, + "update": { + "id": "calendar.calendars.update", + "path": "calendars/{calendarId}", + "httpMethod": "PUT", + "description": "Updates metadata for a calendar.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "calendarId" + ], + "request": { + "$ref": "Calendar" + }, + "response": { + "$ref": "Calendar" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + } + } + }, + "channels": { + "methods": { + "stop": { + "id": "calendar.channels.stop", + "path": "channels/stop", + "httpMethod": "POST", + "description": "Stop watching resources through this channel", + "request": { + "$ref": "Channel", + "parameterName": "resource" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar", + "https://www.googleapis.com/auth/calendar.readonly" + ] + } + } + }, + "colors": { + "methods": { + "get": { + "id": "calendar.colors.get", + "path": "colors", + "httpMethod": "GET", + "description": "Returns the color definitions for calendars and events.", + "response": { + "$ref": "Colors" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar", + "https://www.googleapis.com/auth/calendar.readonly" + ] + } + } + }, + "events": { + "methods": { + "delete": { + "id": "calendar.events.delete", + "path": "calendars/{calendarId}/events/{eventId}", + "httpMethod": "DELETE", + "description": "Deletes an event.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + }, + "eventId": { + "type": "string", + "description": "Event identifier.", + "required": true, + "location": "path" + }, + "sendNotifications": { + "type": "boolean", + "description": "Whether to send notifications about the deletion of the event. Optional. The default is False.", + "location": "query" + } + }, + "parameterOrder": [ + "calendarId", + "eventId" + ], + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + }, + "get": { + "id": "calendar.events.get", + "path": "calendars/{calendarId}/events/{eventId}", + "httpMethod": "GET", + "description": "Returns an event.", + "parameters": { + "alwaysIncludeEmail": { + "type": "boolean", + "description": "Whether to always include a value in the \"email\" field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.", + "location": "query" + }, + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + }, + "eventId": { + "type": "string", + "description": "Event identifier.", + "required": true, + "location": "path" + }, + "maxAttendees": { + "type": "integer", + "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "timeZone": { + "type": "string", + "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.", + "location": "query" + } + }, + "parameterOrder": [ + "calendarId", + "eventId" + ], + "response": { + "$ref": "Event" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar", + "https://www.googleapis.com/auth/calendar.readonly" + ] + }, + "import": { + "id": "calendar.events.import", + "path": "calendars/{calendarId}/events/import", + "httpMethod": "POST", + "description": "Imports an event. This operation is used to add a private copy of an existing event to a calendar.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "calendarId" + ], + "request": { + "$ref": "Event" + }, + "response": { + "$ref": "Event" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + }, + "insert": { + "id": "calendar.events.insert", + "path": "calendars/{calendarId}/events", + "httpMethod": "POST", + "description": "Creates an event.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + }, + "maxAttendees": { + "type": "integer", + "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "sendNotifications": { + "type": "boolean", + "description": "Whether to send notifications about the creation of the new event. Optional. The default is False.", + "location": "query" + } + }, + "parameterOrder": [ + "calendarId" + ], + "request": { + "$ref": "Event" + }, + "response": { + "$ref": "Event" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + }, + "instances": { + "id": "calendar.events.instances", + "path": "calendars/{calendarId}/events/{eventId}/instances", + "httpMethod": "GET", + "description": "Returns instances of the specified recurring event.", + "parameters": { + "alwaysIncludeEmail": { + "type": "boolean", + "description": "Whether to always include a value in the \"email\" field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.", + "location": "query" + }, + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + }, + "eventId": { + "type": "string", + "description": "Recurring event identifier.", + "required": true, + "location": "path" + }, + "maxAttendees": { + "type": "integer", + "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of events returned on one result page. Optional.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "originalStart": { + "type": "string", + "description": "The original start time of the instance in the result. Optional.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token specifying which result page to return. Optional.", + "location": "query" + }, + "showDeleted": { + "type": "boolean", + "description": "Whether to include deleted events (with 'status' equals 'cancelled') in the result. Cancelled instances of recurring events will still be included if 'singleEvents' is False. Optional. The default is False.", + "location": "query" + }, + "timeMax": { + "type": "string", + "description": "Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time.", + "format": "date-time", + "location": "query" + }, + "timeMin": { + "type": "string", + "description": "Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time.", + "format": "date-time", + "location": "query" + }, + "timeZone": { + "type": "string", + "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.", + "location": "query" + } + }, + "parameterOrder": [ + "calendarId", + "eventId" + ], + "response": { + "$ref": "Events" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar", + "https://www.googleapis.com/auth/calendar.readonly" + ], + "supportsSubscription": true + }, + "list": { + "id": "calendar.events.list", + "path": "calendars/{calendarId}/events", + "httpMethod": "GET", + "description": "Returns events on the specified calendar.", + "parameters": { + "alwaysIncludeEmail": { + "type": "boolean", + "description": "Whether to always include a value in the \"email\" field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.", + "location": "query" + }, + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + }, + "iCalUID": { + "type": "string", + "description": "Specifies iCalendar UID (iCalUID) of events to be included in the response. Optional.", + "location": "query" + }, + "maxAttendees": { + "type": "integer", + "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of events returned on one result page. Optional.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "The order of the events returned in the result. Optional. The default is an unspecified, stable order.", + "enum": [ + "startTime", + "updated" + ], + "enumDescriptions": [ + "Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter \"singleEvents\" is True)", + "Order by last modification time (ascending)." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token specifying which result page to return. Optional.", + "location": "query" + }, + "privateExtendedProperty": { + "type": "string", + "description": "Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to return events that match all given constraints.", + "repeated": true, + "location": "query" + }, + "q": { + "type": "string", + "description": "Free text search terms to find events that match these terms in any field, except for extended properties. Optional.", + "location": "query" + }, + "sharedExtendedProperty": { + "type": "string", + "description": "Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to return events that match all given constraints.", + "repeated": true, + "location": "query" + }, + "showDeleted": { + "type": "boolean", + "description": "Whether to include deleted events (with 'status' equals 'cancelled') in the result. Cancelled instances of recurring events (but not the underlying recurring event) will still be included if 'showDeleted' and 'singleEvents' are both False. If 'showDeleted' and 'singleEvents' are both True, only single instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False.", + "location": "query" + }, + "showHiddenInvitations": { + "type": "boolean", + "description": "Whether to include hidden invitations in the result. Optional. The default is False.", + "location": "query" + }, + "singleEvents": { + "type": "boolean", + "description": "Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves. Optional. The default is False.", + "location": "query" + }, + "timeMax": { + "type": "string", + "description": "Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time.", + "format": "date-time", + "location": "query" + }, + "timeMin": { + "type": "string", + "description": "Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time.", + "format": "date-time", + "location": "query" + }, + "timeZone": { + "type": "string", + "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.", + "location": "query" + }, + "updatedMin": { + "type": "string", + "description": "Lower bound for an event's last modification time (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by last modification time.", + "format": "date-time", + "location": "query" + } + }, + "parameterOrder": [ + "calendarId" + ], + "response": { + "$ref": "Events" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar", + "https://www.googleapis.com/auth/calendar.readonly" + ], + "supportsSubscription": true + }, + "move": { + "id": "calendar.events.move", + "path": "calendars/{calendarId}/events/{eventId}/move", + "httpMethod": "POST", + "description": "Moves an event to another calendar, i.e. changes an event's organizer.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier of the source calendar where the event currently is on.", + "required": true, + "location": "path" + }, + "destination": { + "type": "string", + "description": "Calendar identifier of the target calendar where the event is to be moved to.", + "required": true, + "location": "query" + }, + "eventId": { + "type": "string", + "description": "Event identifier.", + "required": true, + "location": "path" + }, + "sendNotifications": { + "type": "boolean", + "description": "Whether to send notifications about the change of the event's organizer. Optional. The default is False.", + "location": "query" + } + }, + "parameterOrder": [ + "calendarId", + "eventId", + "destination" + ], + "response": { + "$ref": "Event" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + }, + "patch": { + "id": "calendar.events.patch", + "path": "calendars/{calendarId}/events/{eventId}", + "httpMethod": "PATCH", + "description": "Updates an event. This method supports patch semantics.", + "parameters": { + "alwaysIncludeEmail": { + "type": "boolean", + "description": "Whether to always include a value in the \"email\" field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.", + "location": "query" + }, + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + }, + "eventId": { + "type": "string", + "description": "Event identifier.", + "required": true, + "location": "path" + }, + "maxAttendees": { + "type": "integer", + "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "sendNotifications": { + "type": "boolean", + "description": "Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False.", + "location": "query" + } + }, + "parameterOrder": [ + "calendarId", + "eventId" + ], + "request": { + "$ref": "Event" + }, + "response": { + "$ref": "Event" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + }, + "quickAdd": { + "id": "calendar.events.quickAdd", + "path": "calendars/{calendarId}/events/quickAdd", + "httpMethod": "POST", + "description": "Creates an event based on a simple text string.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + }, + "sendNotifications": { + "type": "boolean", + "description": "Whether to send notifications about the creation of the event. Optional. The default is False.", + "location": "query" + }, + "text": { + "type": "string", + "description": "The text describing the event to be created.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "calendarId", + "text" + ], + "response": { + "$ref": "Event" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + }, + "update": { + "id": "calendar.events.update", + "path": "calendars/{calendarId}/events/{eventId}", + "httpMethod": "PUT", + "description": "Updates an event.", + "parameters": { + "alwaysIncludeEmail": { + "type": "boolean", + "description": "Whether to always include a value in the \"email\" field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.", + "location": "query" + }, + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + }, + "eventId": { + "type": "string", + "description": "Event identifier.", + "required": true, + "location": "path" + }, + "maxAttendees": { + "type": "integer", + "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "sendNotifications": { + "type": "boolean", + "description": "Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False.", + "location": "query" + } + }, + "parameterOrder": [ + "calendarId", + "eventId" + ], + "request": { + "$ref": "Event" + }, + "response": { + "$ref": "Event" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ] + }, + "watch": { + "id": "calendar.events.watch", + "path": "calendars/{calendarId}/events/watch", + "httpMethod": "POST", + "description": "Watch for changes to Events resources.", + "parameters": { + "alwaysIncludeEmail": { + "type": "boolean", + "description": "Whether to always include a value in the \"email\" field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.", + "location": "query" + }, + "calendarId": { + "type": "string", + "description": "Calendar identifier.", + "required": true, + "location": "path" + }, + "iCalUID": { + "type": "string", + "description": "Specifies iCalendar UID (iCalUID) of events to be included in the response. Optional.", + "location": "query" + }, + "maxAttendees": { + "type": "integer", + "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of events returned on one result page. Optional.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "The order of the events returned in the result. Optional. The default is an unspecified, stable order.", + "enum": [ + "startTime", + "updated" + ], + "enumDescriptions": [ + "Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter \"singleEvents\" is True)", + "Order by last modification time (ascending)." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token specifying which result page to return. Optional.", + "location": "query" + }, + "privateExtendedProperty": { + "type": "string", + "description": "Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to return events that match all given constraints.", + "repeated": true, + "location": "query" + }, + "q": { + "type": "string", + "description": "Free text search terms to find events that match these terms in any field, except for extended properties. Optional.", + "location": "query" + }, + "sharedExtendedProperty": { + "type": "string", + "description": "Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to return events that match all given constraints.", + "repeated": true, + "location": "query" + }, + "showDeleted": { + "type": "boolean", + "description": "Whether to include deleted events (with 'status' equals 'cancelled') in the result. Cancelled instances of recurring events (but not the underlying recurring event) will still be included if 'showDeleted' and 'singleEvents' are both False. If 'showDeleted' and 'singleEvents' are both True, only single instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False.", + "location": "query" + }, + "showHiddenInvitations": { + "type": "boolean", + "description": "Whether to include hidden invitations in the result. Optional. The default is False.", + "location": "query" + }, + "singleEvents": { + "type": "boolean", + "description": "Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves. Optional. The default is False.", + "location": "query" + }, + "timeMax": { + "type": "string", + "description": "Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time.", + "format": "date-time", + "location": "query" + }, + "timeMin": { + "type": "string", + "description": "Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time.", + "format": "date-time", + "location": "query" + }, + "timeZone": { + "type": "string", + "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.", + "location": "query" + }, + "updatedMin": { + "type": "string", + "description": "Lower bound for an event's last modification time (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by last modification time.", + "format": "date-time", + "location": "query" + } + }, + "parameterOrder": [ + "calendarId" + ], + "request": { + "$ref": "Channel", + "parameterName": "resource" + }, + "response": { + "$ref": "Channel" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar", + "https://www.googleapis.com/auth/calendar.readonly" + ], + "supportsSubscription": true + } + } + }, + "freebusy": { + "methods": { + "query": { + "id": "calendar.freebusy.query", + "path": "freeBusy", + "httpMethod": "POST", + "description": "Returns free/busy information for a set of calendars.", + "request": { + "$ref": "FreeBusyRequest" + }, + "response": { + "$ref": "FreeBusyResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar", + "https://www.googleapis.com/auth/calendar.readonly" + ] + } + } + }, + "settings": { + "methods": { + "get": { + "id": "calendar.settings.get", + "path": "users/me/settings/{setting}", + "httpMethod": "GET", + "description": "Returns a single user setting.", + "parameters": { + "setting": { + "type": "string", + "description": "The id of the user setting.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "setting" + ], + "response": { + "$ref": "Setting" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar", + "https://www.googleapis.com/auth/calendar.readonly" + ] + }, + "list": { + "id": "calendar.settings.list", + "path": "users/me/settings", + "httpMethod": "GET", + "description": "Returns all user settings for the authenticated user.", + "response": { + "$ref": "Settings" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar", + "https://www.googleapis.com/auth/calendar.readonly" + ], + "supportsSubscription": true + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/calendar/v3/calendar-gen.go b/third_party/src/code.google.com/p/google-api-go-client/calendar/v3/calendar-gen.go new file mode 100644 index 0000000000000..34cd8bba501e4 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/calendar/v3/calendar-gen.go @@ -0,0 +1,4423 @@ +// Package calendar provides access to the Calendar API. +// +// See https://developers.google.com/google-apps/calendar/firstapp +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/calendar/v3" +// ... +// calendarService, err := calendar.New(oauthHttpClient) +package calendar + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "calendar:v3" +const apiName = "calendar" +const apiVersion = "v3" +const basePath = "https://www.googleapis.com/calendar/v3/" + +// OAuth2 scopes used by this API. +const ( + // Manage your calendars + CalendarScope = "https://www.googleapis.com/auth/calendar" + + // View your calendars + CalendarReadonlyScope = "https://www.googleapis.com/auth/calendar.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.Acl = NewAclService(s) + s.CalendarList = NewCalendarListService(s) + s.Calendars = NewCalendarsService(s) + s.Channels = NewChannelsService(s) + s.Colors = NewColorsService(s) + s.Events = NewEventsService(s) + s.Freebusy = NewFreebusyService(s) + s.Settings = NewSettingsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Acl *AclService + + CalendarList *CalendarListService + + Calendars *CalendarsService + + Channels *ChannelsService + + Colors *ColorsService + + Events *EventsService + + Freebusy *FreebusyService + + Settings *SettingsService +} + +func NewAclService(s *Service) *AclService { + rs := &AclService{s: s} + return rs +} + +type AclService struct { + s *Service +} + +func NewCalendarListService(s *Service) *CalendarListService { + rs := &CalendarListService{s: s} + return rs +} + +type CalendarListService struct { + s *Service +} + +func NewCalendarsService(s *Service) *CalendarsService { + rs := &CalendarsService{s: s} + return rs +} + +type CalendarsService struct { + s *Service +} + +func NewChannelsService(s *Service) *ChannelsService { + rs := &ChannelsService{s: s} + return rs +} + +type ChannelsService struct { + s *Service +} + +func NewColorsService(s *Service) *ColorsService { + rs := &ColorsService{s: s} + return rs +} + +type ColorsService struct { + s *Service +} + +func NewEventsService(s *Service) *EventsService { + rs := &EventsService{s: s} + return rs +} + +type EventsService struct { + s *Service +} + +func NewFreebusyService(s *Service) *FreebusyService { + rs := &FreebusyService{s: s} + return rs +} + +type FreebusyService struct { + s *Service +} + +func NewSettingsService(s *Service) *SettingsService { + rs := &SettingsService{s: s} + return rs +} + +type SettingsService struct { + s *Service +} + +type Acl struct { + // Etag: ETag of the collection. + Etag string `json:"etag,omitempty"` + + // Items: List of rules on the access control list. + Items []*AclRule `json:"items,omitempty"` + + // Kind: Type of the collection ("calendar#acl"). + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token used to access the next page of this result. + // Omitted if no further results are available. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AclRule struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Id: Identifier of the ACL rule. + Id string `json:"id,omitempty"` + + // Kind: Type of the resource ("calendar#aclRule"). + Kind string `json:"kind,omitempty"` + + // Role: The role assigned to the scope. Possible values are: + // - "none" + // - Provides no access. + // - "freeBusyReader" - Provides read access to + // free/busy information. + // - "reader" - Provides read access to the + // calendar. Private events will appear to users with reader access, but + // event details will be hidden. + // - "writer" - Provides read and write + // access to the calendar. Private events will appear to users with + // writer access, and event details will be visible. + // - "owner" - + // Provides ownership of the calendar. This role has all of the + // permissions of the writer role with the additional ability to see and + // manipulate ACLs. + Role string `json:"role,omitempty"` + + // Scope: The scope of the rule. + Scope *AclRuleScope `json:"scope,omitempty"` +} + +type AclRuleScope struct { + // Type: The type of the scope. Possible values are: + // - "default" - The + // public scope. This is the default value. + // - "user" - Limits the scope + // to a single user. + // - "group" - Limits the scope to a group. + // - + // "domain" - Limits the scope to a domain. Note: The permissions + // granted to the "default", or public, scope apply to any user, + // authenticated or not. + Type string `json:"type,omitempty"` + + // Value: The email address of a user or group, or the name of a domain, + // depending on the scope type. Omitted for type "default". + Value string `json:"value,omitempty"` +} + +type Calendar struct { + // Description: Description of the calendar. Optional. + Description string `json:"description,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Id: Identifier of the calendar. + Id string `json:"id,omitempty"` + + // Kind: Type of the resource ("calendar#calendar"). + Kind string `json:"kind,omitempty"` + + // Location: Geographic location of the calendar as free-form text. + // Optional. + Location string `json:"location,omitempty"` + + // Summary: Title of the calendar. + Summary string `json:"summary,omitempty"` + + // TimeZone: The time zone of the calendar. Optional. + TimeZone string `json:"timeZone,omitempty"` +} + +type CalendarList struct { + // Etag: ETag of the collection. + Etag string `json:"etag,omitempty"` + + // Items: Calendars that are present on the user's calendar list. + Items []*CalendarListEntry `json:"items,omitempty"` + + // Kind: Type of the collection ("calendar#calendarList"). + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token used to access the next page of this result. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type CalendarListEntry struct { + // AccessRole: The effective access role that the authenticated user has + // on the calendar. Read-only. Possible values are: + // - "freeBusyReader" + // - Provides read access to free/busy information. + // - "reader" - + // Provides read access to the calendar. Private events will appear to + // users with reader access, but event details will be hidden. + // - + // "writer" - Provides read and write access to the calendar. Private + // events will appear to users with writer access, and event details + // will be visible. + // - "owner" - Provides ownership of the calendar. + // This role has all of the permissions of the writer role with the + // additional ability to see and manipulate ACLs. + AccessRole string `json:"accessRole,omitempty"` + + // BackgroundColor: The main color of the calendar in the format + // '#0088aa'. This property supersedes the index-based colorId property. + // Optional. + BackgroundColor string `json:"backgroundColor,omitempty"` + + // ColorId: The color of the calendar. This is an ID referring to an + // entry in the "calendar" section of the colors definition (see the + // "colors" endpoint). Optional. + ColorId string `json:"colorId,omitempty"` + + // DefaultReminders: The default reminders that the authenticated user + // has for this calendar. + DefaultReminders []*EventReminder `json:"defaultReminders,omitempty"` + + // Description: Description of the calendar. Optional. Read-only. + Description string `json:"description,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // ForegroundColor: The foreground color of the calendar in the format + // '#ffffff'. This property supersedes the index-based colorId property. + // Optional. + ForegroundColor string `json:"foregroundColor,omitempty"` + + // Hidden: Whether the calendar has been hidden from the list. Optional. + // The default is False. + Hidden bool `json:"hidden,omitempty"` + + // Id: Identifier of the calendar. + Id string `json:"id,omitempty"` + + // Kind: Type of the resource ("calendar#calendarListEntry"). + Kind string `json:"kind,omitempty"` + + // Location: Geographic location of the calendar as free-form text. + // Optional. Read-only. + Location string `json:"location,omitempty"` + + // NotificationSettings: The notifications that the authenticated user + // is receiving for this calendar. + NotificationSettings *CalendarListEntryNotificationSettings `json:"notificationSettings,omitempty"` + + // Primary: Whether the calendar is the primary calendar of the + // authenticated user. Read-only. Optional. The default is False. + Primary bool `json:"primary,omitempty"` + + // Selected: Whether the calendar content shows up in the calendar UI. + // Optional. The default is False. + Selected bool `json:"selected,omitempty"` + + // Summary: Title of the calendar. Read-only. + Summary string `json:"summary,omitempty"` + + // SummaryOverride: The summary that the authenticated user has set for + // this calendar. Optional. + SummaryOverride string `json:"summaryOverride,omitempty"` + + // TimeZone: The time zone of the calendar. Optional. Read-only. + TimeZone string `json:"timeZone,omitempty"` +} + +type CalendarListEntryNotificationSettings struct { + // Notifications: The list of notifications set for this calendar. + Notifications []*CalendarNotification `json:"notifications,omitempty"` +} + +type CalendarNotification struct { + // Method: The method used to deliver the notification. Possible values + // are: + // - "email" - Reminders are sent via email. + // - "sms" - Reminders + // are sent via SMS. This value is read-only and is ignored on inserts + // and updates. + Method string `json:"method,omitempty"` + + // Type: The type of notification. Possible values are: + // - + // "eventCreation" - Notification sent when a new event is put on the + // calendar. + // - "eventChange" - Notification sent when an event is + // changed. + // - "eventCancellation" - Notification sent when an event is + // cancelled. + // - "eventResponse" - Notification sent when an event is + // changed. + // - "agenda" - An agenda with the events of the day (sent out + // in the morning). + Type string `json:"type,omitempty"` +} + +type Channel struct { + // Address: The address where notifications are delivered for this + // channel. + Address string `json:"address,omitempty"` + + // Expiration: Date and time of notification channel expiration, + // expressed as a Unix timestamp, in milliseconds. Optional. + Expiration int64 `json:"expiration,omitempty,string"` + + // Id: A UUID or similar unique string that identifies this channel. + Id string `json:"id,omitempty"` + + // Kind: Identifies this as a notification channel used to watch for + // changes to a resource. Value: the fixed string "api#channel". + Kind string `json:"kind,omitempty"` + + // Params: Additional parameters controlling delivery channel behavior. + // Optional. + Params map[string]string `json:"params,omitempty"` + + // Payload: A Boolean value to indicate whether payload is wanted. + // Optional. + Payload bool `json:"payload,omitempty"` + + // ResourceId: An opaque ID that identifies the resource being watched + // on this channel. Stable across different API versions. + ResourceId string `json:"resourceId,omitempty"` + + // ResourceUri: A version-specific identifier for the watched resource. + ResourceUri string `json:"resourceUri,omitempty"` + + // Token: An arbitrary string delivered to the target address with each + // notification delivered over this channel. Optional. + Token string `json:"token,omitempty"` + + // Type: The type of delivery mechanism used for this channel. + Type string `json:"type,omitempty"` +} + +type ColorDefinition struct { + // Background: The background color associated with this color + // definition. + Background string `json:"background,omitempty"` + + // Foreground: The foreground color that can be used to write on top of + // a background with 'background' color. + Foreground string `json:"foreground,omitempty"` +} + +type Colors struct { + // Calendar: Palette of calendar colors, mapping from the color ID to + // its definition. An 'calendarListEntry' resource refers to one of + // these color IDs in its 'color' field. Read-only. + Calendar *ColorsCalendar `json:"calendar,omitempty"` + + // Event: Palette of event colors, mapping from the color ID to its + // definition. An 'event' resource may refer to one of these color IDs + // in its 'color' field. Read-only. + Event *ColorsEvent `json:"event,omitempty"` + + // Kind: Type of the resource ("calendar#colors"). + Kind string `json:"kind,omitempty"` + + // Updated: Last modification time of the color palette (as a RFC 3339 + // timestamp). Read-only. + Updated string `json:"updated,omitempty"` +} + +type ColorsCalendar struct { +} + +type ColorsEvent struct { +} + +type Error struct { + // Domain: Domain, or broad category, of the error. + Domain string `json:"domain,omitempty"` + + // Reason: Specific reason for the error. Some of the possible values + // are: + // - "groupTooBig" - The group of users requested is too large + // for a single query. + // - "tooManyCalendarsRequested" - The number of + // calendars requested is too large for a single query. + // - "notFound" - + // The requested resource was not found. + // - "internalError" - The API + // service has encountered an internal error. Additional error types + // may be added in the future, so clients should gracefully handle + // additional error statuses not included in this list. + Reason string `json:"reason,omitempty"` +} + +type Event struct { + // AnyoneCanAddSelf: Whether anyone can invite themselves to the event. + // Optional. The default is False. + AnyoneCanAddSelf bool `json:"anyoneCanAddSelf,omitempty"` + + // Attendees: The attendees of the event. + Attendees []*EventAttendee `json:"attendees,omitempty"` + + // AttendeesOmitted: Whether attendees may have been omitted from the + // event's representation. When retrieving an event, this may be due to + // a restriction specified by the 'maxAttendee' query parameter. When + // updating an event, this can be used to only update the participant's + // response. Optional. The default is False. + AttendeesOmitted bool `json:"attendeesOmitted,omitempty"` + + // ColorId: The color of the event. This is an ID referring to an entry + // in the "event" section of the colors definition (see the "colors" + // endpoint). Optional. + ColorId string `json:"colorId,omitempty"` + + // Created: Creation time of the event (as a RFC 3339 timestamp). + // Read-only. + Created string `json:"created,omitempty"` + + // Creator: The creator of the event. Read-only. + Creator *EventCreator `json:"creator,omitempty"` + + // Description: Description of the event. Optional. + Description string `json:"description,omitempty"` + + // End: The (exclusive) end time of the event. For a recurring event, + // this is the end time of the first instance. + End *EventDateTime `json:"end,omitempty"` + + // EndTimeUnspecified: Whether the end time is actually unspecified. An + // end time is still provided for compatibility reasons, even if this + // attribute is set to True. The default is False. + EndTimeUnspecified bool `json:"endTimeUnspecified,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // ExtendedProperties: Extended properties of the event. + ExtendedProperties *EventExtendedProperties `json:"extendedProperties,omitempty"` + + // Gadget: A gadget that extends this event. + Gadget *EventGadget `json:"gadget,omitempty"` + + // GuestsCanInviteOthers: Whether attendees other than the organizer can + // invite others to the event. Optional. The default is True. + GuestsCanInviteOthers bool `json:"guestsCanInviteOthers,omitempty"` + + // GuestsCanModify: Whether attendees other than the organizer can + // modify the event. Optional. The default is False. + GuestsCanModify bool `json:"guestsCanModify,omitempty"` + + // GuestsCanSeeOtherGuests: Whether attendees other than the organizer + // can see who the event's attendees are. Optional. The default is True. + GuestsCanSeeOtherGuests bool `json:"guestsCanSeeOtherGuests,omitempty"` + + // HangoutLink: An absolute link to the Google+ hangout associated with + // this event. Read-only. + HangoutLink string `json:"hangoutLink,omitempty"` + + // HtmlLink: An absolute link to this event in the Google Calendar Web + // UI. Read-only. + HtmlLink string `json:"htmlLink,omitempty"` + + // ICalUID: Event ID in the iCalendar format. + ICalUID string `json:"iCalUID,omitempty"` + + // Id: Identifier of the event. When creating new single or recurring + // events, you can specify their IDs. Provided IDs must follow these + // rules: + // - characters allowed in the ID are those used in base32hex + // encoding, i.e. lowercase letters a-v and digits 0-9, see section + // 3.1.2 in RFC2938 + // - the length of the ID must be between 5 and 1024 + // characters + // - the ID must be unique per calendar Due to the globally + // distributed nature of the system, we cannot guarantee that ID + // collisions will be detected at event creation time. To minimize the + // risk of collisions we recommend using an established UUID algorithm + // such as one described in RFC4122. + Id string `json:"id,omitempty"` + + // Kind: Type of the resource ("calendar#event"). + Kind string `json:"kind,omitempty"` + + // Location: Geographic location of the event as free-form text. + // Optional. + Location string `json:"location,omitempty"` + + // Locked: Whether this is a locked event copy where no changes can be + // made to the main event fields "summary", "description", "location", + // "start", "end" or "recurrence". The default is False. Read-Only. + Locked bool `json:"locked,omitempty"` + + // Organizer: The organizer of the event. If the organizer is also an + // attendee, this is indicated with a separate entry in 'attendees' with + // the 'organizer' field set to True. To change the organizer, use the + // "move" operation. Read-only, except when importing an event. + Organizer *EventOrganizer `json:"organizer,omitempty"` + + // OriginalStartTime: For an instance of a recurring event, this is the + // time at which this event would start according to the recurrence data + // in the recurring event identified by recurringEventId. Immutable. + OriginalStartTime *EventDateTime `json:"originalStartTime,omitempty"` + + // PrivateCopy: Whether this is a private event copy where changes are + // not shared with other copies on other calendars. Optional. Immutable. + // The default is False. + PrivateCopy bool `json:"privateCopy,omitempty"` + + // Recurrence: List of RRULE, EXRULE, RDATE and EXDATE lines for a + // recurring event. This field is omitted for single events or instances + // of recurring events. + Recurrence []string `json:"recurrence,omitempty"` + + // RecurringEventId: For an instance of a recurring event, this is the + // event ID of the recurring event itself. Immutable. + RecurringEventId string `json:"recurringEventId,omitempty"` + + // Reminders: Information about the event's reminders for the + // authenticated user. + Reminders *EventReminders `json:"reminders,omitempty"` + + // Sequence: Sequence number as per iCalendar. + Sequence int64 `json:"sequence,omitempty"` + + // Source: Source of an event from which it was created; for example a + // web page, an email message or any document identifiable by an URL + // using HTTP/HTTPS protocol. Accessible only by the creator of the + // event. + Source *EventSource `json:"source,omitempty"` + + // Start: The (inclusive) start time of the event. For a recurring + // event, this is the start time of the first instance. + Start *EventDateTime `json:"start,omitempty"` + + // Status: Status of the event. Optional. Possible values are: + // - + // "confirmed" - The event is confirmed. This is the default status. + // - + // "tentative" - The event is tentatively confirmed. + // - "cancelled" - + // The event is cancelled. + Status string `json:"status,omitempty"` + + // Summary: Title of the event. + Summary string `json:"summary,omitempty"` + + // Transparency: Whether the event blocks time on the calendar. + // Optional. Possible values are: + // - "opaque" - The event blocks time + // on the calendar. This is the default value. + // - "transparent" - The + // event does not block time on the calendar. + Transparency string `json:"transparency,omitempty"` + + // Updated: Last modification time of the event (as a RFC 3339 + // timestamp). Read-only. + Updated string `json:"updated,omitempty"` + + // Visibility: Visibility of the event. Optional. Possible values are: + // + // - "default" - Uses the default visibility for events on the + // calendar. This is the default value. + // - "public" - The event is + // public and event details are visible to all readers of the calendar. + // + // - "private" - The event is private and only event attendees may view + // event details. + // - "confidential" - The event is private. This value + // is provided for compatibility reasons. + Visibility string `json:"visibility,omitempty"` +} + +type EventCreator struct { + // DisplayName: The creator's name, if available. + DisplayName string `json:"displayName,omitempty"` + + // Email: The creator's email address, if available. + Email string `json:"email,omitempty"` + + // Id: The creator's Profile ID, if available. + Id string `json:"id,omitempty"` + + // Self: Whether the creator corresponds to the calendar on which this + // copy of the event appears. Read-only. The default is False. + Self bool `json:"self,omitempty"` +} + +type EventExtendedProperties struct { + // Private: Properties that are private to the copy of the event that + // appears on this calendar. + Private map[string]string `json:"private,omitempty"` + + // Shared: Properties that are shared between copies of the event on + // other attendees' calendars. + Shared map[string]string `json:"shared,omitempty"` +} + +type EventGadget struct { + // Display: The gadget's display mode. Optional. Possible values are: + // + // - "icon" - The gadget displays next to the event's title in the + // calendar view. + // - "chip" - The gadget displays when the event is + // clicked. + Display string `json:"display,omitempty"` + + // Height: The gadget's height in pixels. Optional. + Height int64 `json:"height,omitempty"` + + // IconLink: The gadget's icon URL. + IconLink string `json:"iconLink,omitempty"` + + // Link: The gadget's URL. + Link string `json:"link,omitempty"` + + // Preferences: Preferences. + Preferences map[string]string `json:"preferences,omitempty"` + + // Title: The gadget's title. + Title string `json:"title,omitempty"` + + // Type: The gadget's type. + Type string `json:"type,omitempty"` + + // Width: The gadget's width in pixels. Optional. + Width int64 `json:"width,omitempty"` +} + +type EventOrganizer struct { + // DisplayName: The organizer's name, if available. + DisplayName string `json:"displayName,omitempty"` + + // Email: The organizer's email address, if available. + Email string `json:"email,omitempty"` + + // Id: The organizer's Profile ID, if available. + Id string `json:"id,omitempty"` + + // Self: Whether the organizer corresponds to the calendar on which this + // copy of the event appears. Read-only. The default is False. + Self bool `json:"self,omitempty"` +} + +type EventReminders struct { + // Overrides: If the event doesn't use the default reminders, this lists + // the reminders specific to the event, or, if not set, indicates that + // no reminders are set for this event. + Overrides []*EventReminder `json:"overrides,omitempty"` + + // UseDefault: Whether the default reminders of the calendar apply to + // the event. + UseDefault bool `json:"useDefault,omitempty"` +} + +type EventSource struct { + // Title: Title of the source; for example a title of a web page or an + // email subject. + Title string `json:"title,omitempty"` + + // Url: URL of the source pointing to a resource. URL's protocol must be + // HTTP or HTTPS. + Url string `json:"url,omitempty"` +} + +type EventAttendee struct { + // AdditionalGuests: Number of additional guests. Optional. The default + // is 0. + AdditionalGuests int64 `json:"additionalGuests,omitempty"` + + // Comment: The attendee's response comment. Optional. + Comment string `json:"comment,omitempty"` + + // DisplayName: The attendee's name, if available. Optional. + DisplayName string `json:"displayName,omitempty"` + + // Email: The attendee's email address, if available. This field must be + // present when adding an attendee. + Email string `json:"email,omitempty"` + + // Id: The attendee's Profile ID, if available. + Id string `json:"id,omitempty"` + + // Optional: Whether this is an optional attendee. Optional. The default + // is False. + Optional bool `json:"optional,omitempty"` + + // Organizer: Whether the attendee is the organizer of the event. + // Read-only. The default is False. + Organizer bool `json:"organizer,omitempty"` + + // Resource: Whether the attendee is a resource. Read-only. The default + // is False. + Resource bool `json:"resource,omitempty"` + + // ResponseStatus: The attendee's response status. Possible values are: + // + // - "needsAction" - The attendee has not responded to the invitation. + // + // - "declined" - The attendee has declined the invitation. + // - + // "tentative" - The attendee has tentatively accepted the invitation. + // + // - "accepted" - The attendee has accepted the invitation. + ResponseStatus string `json:"responseStatus,omitempty"` + + // Self: Whether this entry represents the calendar on which this copy + // of the event appears. Read-only. The default is False. + Self bool `json:"self,omitempty"` +} + +type EventDateTime struct { + // Date: The date, in the format "yyyy-mm-dd", if this is an all-day + // event. + Date string `json:"date,omitempty"` + + // DateTime: The time, as a combined date-time value (formatted + // according to RFC 3339). A time zone offset is required unless a time + // zone is explicitly specified in 'timeZone'. + DateTime string `json:"dateTime,omitempty"` + + // TimeZone: The name of the time zone in which the time is specified + // (e.g. "Europe/Zurich"). Optional. The default is the time zone of the + // calendar. + TimeZone string `json:"timeZone,omitempty"` +} + +type EventReminder struct { + // Method: The method used by this reminder. Possible values are: + // - + // "email" - Reminders are sent via email. + // - "sms" - Reminders are sent + // via SMS. + // - "popup" - Reminders are sent via a UI popup. + Method string `json:"method,omitempty"` + + // Minutes: Number of minutes before the start of the event when the + // reminder should trigger. + Minutes int64 `json:"minutes,omitempty"` +} + +type Events struct { + // AccessRole: The user's access role for this calendar. Read-only. + // Possible values are: + // - "none" - The user has no access. + // - + // "freeBusyReader" - The user has read access to free/busy information. + // + // - "reader" - The user has read access to the calendar. Private + // events will appear to users with reader access, but event details + // will be hidden. + // - "writer" - The user has read and write access to + // the calendar. Private events will appear to users with writer access, + // and event details will be visible. + // - "owner" - The user has + // ownership of the calendar. This role has all of the permissions of + // the writer role with the additional ability to see and manipulate + // ACLs. + AccessRole string `json:"accessRole,omitempty"` + + // DefaultReminders: The default reminders on the calendar for the + // authenticated user. These reminders apply to all events on this + // calendar that do not explicitly override them (i.e. do not have + // 'reminders.useDefault' set to 'true'). + DefaultReminders []*EventReminder `json:"defaultReminders,omitempty"` + + // Description: Description of the calendar. Read-only. + Description string `json:"description,omitempty"` + + // Etag: ETag of the collection. + Etag string `json:"etag,omitempty"` + + // Items: List of events on the calendar. + Items []*Event `json:"items,omitempty"` + + // Kind: Type of the collection ("calendar#events"). + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token used to access the next page of this result. + // Omitted if no further results are available. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Summary: Title of the calendar. Read-only. + Summary string `json:"summary,omitempty"` + + // TimeZone: The time zone of the calendar. Read-only. + TimeZone string `json:"timeZone,omitempty"` + + // Updated: Last modification time of the calendar (as a RFC 3339 + // timestamp). Read-only. + Updated string `json:"updated,omitempty"` +} + +type FreeBusyCalendar struct { + // Busy: List of time ranges during which this calendar should be + // regarded as busy. + Busy []*TimePeriod `json:"busy,omitempty"` + + // Errors: Optional error(s) (if computation for the calendar failed). + Errors []*Error `json:"errors,omitempty"` +} + +type FreeBusyGroup struct { + // Calendars: List of calendars' identifiers within a group. + Calendars []string `json:"calendars,omitempty"` + + // Errors: Optional error(s) (if computation for the group failed). + Errors []*Error `json:"errors,omitempty"` +} + +type FreeBusyRequest struct { + // CalendarExpansionMax: Maximal number of calendars for which FreeBusy + // information is to be provided. Optional. + CalendarExpansionMax int64 `json:"calendarExpansionMax,omitempty"` + + // GroupExpansionMax: Maximal number of calendar identifiers to be + // provided for a single group. Optional. An error will be returned for + // a group with more members than this value. + GroupExpansionMax int64 `json:"groupExpansionMax,omitempty"` + + // Items: List of calendars and/or groups to query. + Items []*FreeBusyRequestItem `json:"items,omitempty"` + + // TimeMax: The end of the interval for the query. + TimeMax string `json:"timeMax,omitempty"` + + // TimeMin: The start of the interval for the query. + TimeMin string `json:"timeMin,omitempty"` + + // TimeZone: Time zone used in the response. Optional. The default is + // UTC. + TimeZone string `json:"timeZone,omitempty"` +} + +type FreeBusyRequestItem struct { + // Id: The identifier of a calendar or a group. + Id string `json:"id,omitempty"` +} + +type FreeBusyResponse struct { + // Calendars: List of free/busy information for calendars. + Calendars *FreeBusyResponseCalendars `json:"calendars,omitempty"` + + // Groups: Expansion of groups. + Groups *FreeBusyResponseGroups `json:"groups,omitempty"` + + // Kind: Type of the resource ("calendar#freeBusy"). + Kind string `json:"kind,omitempty"` + + // TimeMax: The end of the interval. + TimeMax string `json:"timeMax,omitempty"` + + // TimeMin: The start of the interval. + TimeMin string `json:"timeMin,omitempty"` +} + +type FreeBusyResponseCalendars struct { +} + +type FreeBusyResponseGroups struct { +} + +type Setting struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Id: The id of the user setting. + Id string `json:"id,omitempty"` + + // Kind: Type of the resource ("calendar#setting"). + Kind string `json:"kind,omitempty"` + + // Value: Value of the user setting. The format of the value depends on + // the ID of the setting. It must always be a UTF-8 string of length up + // to 1024 characters. + Value string `json:"value,omitempty"` +} + +type Settings struct { + // Etag: Etag of the collection. + Etag string `json:"etag,omitempty"` + + // Items: List of user settings. + Items []*Setting `json:"items,omitempty"` + + // Kind: Type of the collection ("calendar#settings"). + Kind string `json:"kind,omitempty"` +} + +type TimePeriod struct { + // End: The (exclusive) end of the time period. + End string `json:"end,omitempty"` + + // Start: The (inclusive) start of the time period. + Start string `json:"start,omitempty"` +} + +// method id "calendar.acl.delete": + +type AclDeleteCall struct { + s *Service + calendarId string + ruleId string + opt_ map[string]interface{} +} + +// Delete: Deletes an access control rule. +func (r *AclService) Delete(calendarId string, ruleId string) *AclDeleteCall { + c := &AclDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.ruleId = ruleId + return c +} + +func (c *AclDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/{ruleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{ruleId}", url.QueryEscape(c.ruleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an access control rule.", + // "httpMethod": "DELETE", + // "id": "calendar.acl.delete", + // "parameterOrder": [ + // "calendarId", + // "ruleId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ruleId": { + // "description": "ACL rule identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "calendars/{calendarId}/acl/{ruleId}", + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.acl.get": + +type AclGetCall struct { + s *Service + calendarId string + ruleId string + opt_ map[string]interface{} +} + +// Get: Returns an access control rule. +func (r *AclService) Get(calendarId string, ruleId string) *AclGetCall { + c := &AclGetCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.ruleId = ruleId + return c +} + +func (c *AclGetCall) Do() (*AclRule, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/{ruleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{ruleId}", url.QueryEscape(c.ruleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AclRule) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns an access control rule.", + // "httpMethod": "GET", + // "id": "calendar.acl.get", + // "parameterOrder": [ + // "calendarId", + // "ruleId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ruleId": { + // "description": "ACL rule identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "calendars/{calendarId}/acl/{ruleId}", + // "response": { + // "$ref": "AclRule" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar", + // "https://www.googleapis.com/auth/calendar.readonly" + // ] + // } + +} + +// method id "calendar.acl.insert": + +type AclInsertCall struct { + s *Service + calendarId string + aclrule *AclRule + opt_ map[string]interface{} +} + +// Insert: Creates an access control rule. +func (r *AclService) Insert(calendarId string, aclrule *AclRule) *AclInsertCall { + c := &AclInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.aclrule = aclrule + return c +} + +func (c *AclInsertCall) Do() (*AclRule, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.aclrule) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AclRule) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an access control rule.", + // "httpMethod": "POST", + // "id": "calendar.acl.insert", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "calendars/{calendarId}/acl", + // "request": { + // "$ref": "AclRule" + // }, + // "response": { + // "$ref": "AclRule" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.acl.list": + +type AclListCall struct { + s *Service + calendarId string + opt_ map[string]interface{} +} + +// List: Returns the rules in the access control list for the calendar. +func (r *AclService) List(calendarId string) *AclListCall { + c := &AclListCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + return c +} + +func (c *AclListCall) Do() (*Acl, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Acl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the rules in the access control list for the calendar.", + // "httpMethod": "GET", + // "id": "calendar.acl.list", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "calendars/{calendarId}/acl", + // "response": { + // "$ref": "Acl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ], + // "supportsSubscription": true + // } + +} + +// method id "calendar.acl.patch": + +type AclPatchCall struct { + s *Service + calendarId string + ruleId string + aclrule *AclRule + opt_ map[string]interface{} +} + +// Patch: Updates an access control rule. This method supports patch +// semantics. +func (r *AclService) Patch(calendarId string, ruleId string, aclrule *AclRule) *AclPatchCall { + c := &AclPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.ruleId = ruleId + c.aclrule = aclrule + return c +} + +func (c *AclPatchCall) Do() (*AclRule, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.aclrule) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/{ruleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{ruleId}", url.QueryEscape(c.ruleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AclRule) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an access control rule. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "calendar.acl.patch", + // "parameterOrder": [ + // "calendarId", + // "ruleId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ruleId": { + // "description": "ACL rule identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "calendars/{calendarId}/acl/{ruleId}", + // "request": { + // "$ref": "AclRule" + // }, + // "response": { + // "$ref": "AclRule" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.acl.update": + +type AclUpdateCall struct { + s *Service + calendarId string + ruleId string + aclrule *AclRule + opt_ map[string]interface{} +} + +// Update: Updates an access control rule. +func (r *AclService) Update(calendarId string, ruleId string, aclrule *AclRule) *AclUpdateCall { + c := &AclUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.ruleId = ruleId + c.aclrule = aclrule + return c +} + +func (c *AclUpdateCall) Do() (*AclRule, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.aclrule) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/{ruleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{ruleId}", url.QueryEscape(c.ruleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AclRule) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an access control rule.", + // "httpMethod": "PUT", + // "id": "calendar.acl.update", + // "parameterOrder": [ + // "calendarId", + // "ruleId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ruleId": { + // "description": "ACL rule identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "calendars/{calendarId}/acl/{ruleId}", + // "request": { + // "$ref": "AclRule" + // }, + // "response": { + // "$ref": "AclRule" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.calendarList.delete": + +type CalendarListDeleteCall struct { + s *Service + calendarId string + opt_ map[string]interface{} +} + +// Delete: Deletes an entry on the user's calendar list. +func (r *CalendarListService) Delete(calendarId string) *CalendarListDeleteCall { + c := &CalendarListDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + return c +} + +func (c *CalendarListDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/{calendarId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an entry on the user's calendar list.", + // "httpMethod": "DELETE", + // "id": "calendar.calendarList.delete", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/me/calendarList/{calendarId}", + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.calendarList.get": + +type CalendarListGetCall struct { + s *Service + calendarId string + opt_ map[string]interface{} +} + +// Get: Returns an entry on the user's calendar list. +func (r *CalendarListService) Get(calendarId string) *CalendarListGetCall { + c := &CalendarListGetCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + return c +} + +func (c *CalendarListGetCall) Do() (*CalendarListEntry, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/{calendarId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CalendarListEntry) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns an entry on the user's calendar list.", + // "httpMethod": "GET", + // "id": "calendar.calendarList.get", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/me/calendarList/{calendarId}", + // "response": { + // "$ref": "CalendarListEntry" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar", + // "https://www.googleapis.com/auth/calendar.readonly" + // ] + // } + +} + +// method id "calendar.calendarList.insert": + +type CalendarListInsertCall struct { + s *Service + calendarlistentry *CalendarListEntry + opt_ map[string]interface{} +} + +// Insert: Adds an entry to the user's calendar list. +func (r *CalendarListService) Insert(calendarlistentry *CalendarListEntry) *CalendarListInsertCall { + c := &CalendarListInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarlistentry = calendarlistentry + return c +} + +// ColorRgbFormat sets the optional parameter "colorRgbFormat": Whether +// to use the foregroundColor and backgroundColor fields to write the +// calendar colors (RGB). If this feature is used, the index-based +// colorId field will be set to the best matching option automatically. +// The default is False. +func (c *CalendarListInsertCall) ColorRgbFormat(colorRgbFormat bool) *CalendarListInsertCall { + c.opt_["colorRgbFormat"] = colorRgbFormat + return c +} + +func (c *CalendarListInsertCall) Do() (*CalendarListEntry, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarlistentry) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["colorRgbFormat"]; ok { + params.Set("colorRgbFormat", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CalendarListEntry) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds an entry to the user's calendar list.", + // "httpMethod": "POST", + // "id": "calendar.calendarList.insert", + // "parameters": { + // "colorRgbFormat": { + // "description": "Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "users/me/calendarList", + // "request": { + // "$ref": "CalendarListEntry" + // }, + // "response": { + // "$ref": "CalendarListEntry" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.calendarList.list": + +type CalendarListListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Returns entries on the user's calendar list. +func (r *CalendarListService) List() *CalendarListListCall { + c := &CalendarListListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of entries returned on one result page. +func (c *CalendarListListCall) MaxResults(maxResults int64) *CalendarListListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// MinAccessRole sets the optional parameter "minAccessRole": The +// minimum access role for the user in the returned entires. The +// default is no restriction. +func (c *CalendarListListCall) MinAccessRole(minAccessRole string) *CalendarListListCall { + c.opt_["minAccessRole"] = minAccessRole + return c +} + +// PageToken sets the optional parameter "pageToken": Token specifying +// which result page to return. +func (c *CalendarListListCall) PageToken(pageToken string) *CalendarListListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ShowHidden sets the optional parameter "showHidden": Whether to show +// hidden entries. The default is False. +func (c *CalendarListListCall) ShowHidden(showHidden bool) *CalendarListListCall { + c.opt_["showHidden"] = showHidden + return c +} + +func (c *CalendarListListCall) Do() (*CalendarList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minAccessRole"]; ok { + params.Set("minAccessRole", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["showHidden"]; ok { + params.Set("showHidden", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CalendarList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns entries on the user's calendar list.", + // "httpMethod": "GET", + // "id": "calendar.calendarList.list", + // "parameters": { + // "maxResults": { + // "description": "Maximum number of entries returned on one result page. Optional.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "minAccessRole": { + // "description": "The minimum access role for the user in the returned entires. Optional. The default is no restriction.", + // "enum": [ + // "freeBusyReader", + // "owner", + // "reader", + // "writer" + // ], + // "enumDescriptions": [ + // "The user can read free/busy information.", + // "The user can read and modify events and access control lists.", + // "The user can read events that are not private.", + // "The user can read and modify events." + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Token specifying which result page to return. Optional.", + // "location": "query", + // "type": "string" + // }, + // "showHidden": { + // "description": "Whether to show hidden entries. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "users/me/calendarList", + // "response": { + // "$ref": "CalendarList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar", + // "https://www.googleapis.com/auth/calendar.readonly" + // ], + // "supportsSubscription": true + // } + +} + +// method id "calendar.calendarList.patch": + +type CalendarListPatchCall struct { + s *Service + calendarId string + calendarlistentry *CalendarListEntry + opt_ map[string]interface{} +} + +// Patch: Updates an entry on the user's calendar list. This method +// supports patch semantics. +func (r *CalendarListService) Patch(calendarId string, calendarlistentry *CalendarListEntry) *CalendarListPatchCall { + c := &CalendarListPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.calendarlistentry = calendarlistentry + return c +} + +// ColorRgbFormat sets the optional parameter "colorRgbFormat": Whether +// to use the 'foregroundColor' and 'backgroundColor' fields to write +// the calendar colors (RGB). If this feature is used, the index-based +// 'colorId' field will be set to the best matching option +// automatically. The default is False. +func (c *CalendarListPatchCall) ColorRgbFormat(colorRgbFormat bool) *CalendarListPatchCall { + c.opt_["colorRgbFormat"] = colorRgbFormat + return c +} + +func (c *CalendarListPatchCall) Do() (*CalendarListEntry, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarlistentry) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["colorRgbFormat"]; ok { + params.Set("colorRgbFormat", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/{calendarId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CalendarListEntry) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an entry on the user's calendar list. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "calendar.calendarList.patch", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "colorRgbFormat": { + // "description": "Whether to use the 'foregroundColor' and 'backgroundColor' fields to write the calendar colors (RGB). If this feature is used, the index-based 'colorId' field will be set to the best matching option automatically. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "users/me/calendarList/{calendarId}", + // "request": { + // "$ref": "CalendarListEntry" + // }, + // "response": { + // "$ref": "CalendarListEntry" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.calendarList.update": + +type CalendarListUpdateCall struct { + s *Service + calendarId string + calendarlistentry *CalendarListEntry + opt_ map[string]interface{} +} + +// Update: Updates an entry on the user's calendar list. +func (r *CalendarListService) Update(calendarId string, calendarlistentry *CalendarListEntry) *CalendarListUpdateCall { + c := &CalendarListUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.calendarlistentry = calendarlistentry + return c +} + +// ColorRgbFormat sets the optional parameter "colorRgbFormat": Whether +// to use the 'foregroundColor' and 'backgroundColor' fields to write +// the calendar colors (RGB). If this feature is used, the index-based +// 'colorId' field will be set to the best matching option +// automatically. The default is False. +func (c *CalendarListUpdateCall) ColorRgbFormat(colorRgbFormat bool) *CalendarListUpdateCall { + c.opt_["colorRgbFormat"] = colorRgbFormat + return c +} + +func (c *CalendarListUpdateCall) Do() (*CalendarListEntry, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarlistentry) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["colorRgbFormat"]; ok { + params.Set("colorRgbFormat", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/{calendarId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CalendarListEntry) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an entry on the user's calendar list.", + // "httpMethod": "PUT", + // "id": "calendar.calendarList.update", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "colorRgbFormat": { + // "description": "Whether to use the 'foregroundColor' and 'backgroundColor' fields to write the calendar colors (RGB). If this feature is used, the index-based 'colorId' field will be set to the best matching option automatically. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "users/me/calendarList/{calendarId}", + // "request": { + // "$ref": "CalendarListEntry" + // }, + // "response": { + // "$ref": "CalendarListEntry" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.calendars.clear": + +type CalendarsClearCall struct { + s *Service + calendarId string + opt_ map[string]interface{} +} + +// Clear: Clears a primary calendar. This operation deletes all data +// associated with the primary calendar of an account and cannot be +// undone. +func (r *CalendarsService) Clear(calendarId string) *CalendarsClearCall { + c := &CalendarsClearCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + return c +} + +func (c *CalendarsClearCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/clear") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Clears a primary calendar. This operation deletes all data associated with the primary calendar of an account and cannot be undone.", + // "httpMethod": "POST", + // "id": "calendar.calendars.clear", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "calendars/{calendarId}/clear", + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.calendars.delete": + +type CalendarsDeleteCall struct { + s *Service + calendarId string + opt_ map[string]interface{} +} + +// Delete: Deletes a secondary calendar. +func (r *CalendarsService) Delete(calendarId string) *CalendarsDeleteCall { + c := &CalendarsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + return c +} + +func (c *CalendarsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a secondary calendar.", + // "httpMethod": "DELETE", + // "id": "calendar.calendars.delete", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "calendars/{calendarId}", + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.calendars.get": + +type CalendarsGetCall struct { + s *Service + calendarId string + opt_ map[string]interface{} +} + +// Get: Returns metadata for a calendar. +func (r *CalendarsService) Get(calendarId string) *CalendarsGetCall { + c := &CalendarsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + return c +} + +func (c *CalendarsGetCall) Do() (*Calendar, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Calendar) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns metadata for a calendar.", + // "httpMethod": "GET", + // "id": "calendar.calendars.get", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "calendars/{calendarId}", + // "response": { + // "$ref": "Calendar" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar", + // "https://www.googleapis.com/auth/calendar.readonly" + // ] + // } + +} + +// method id "calendar.calendars.insert": + +type CalendarsInsertCall struct { + s *Service + calendar *Calendar + opt_ map[string]interface{} +} + +// Insert: Creates a secondary calendar. +func (r *CalendarsService) Insert(calendar *Calendar) *CalendarsInsertCall { + c := &CalendarsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.calendar = calendar + return c +} + +func (c *CalendarsInsertCall) Do() (*Calendar, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendar) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Calendar) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a secondary calendar.", + // "httpMethod": "POST", + // "id": "calendar.calendars.insert", + // "path": "calendars", + // "request": { + // "$ref": "Calendar" + // }, + // "response": { + // "$ref": "Calendar" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.calendars.patch": + +type CalendarsPatchCall struct { + s *Service + calendarId string + calendar *Calendar + opt_ map[string]interface{} +} + +// Patch: Updates metadata for a calendar. This method supports patch +// semantics. +func (r *CalendarsService) Patch(calendarId string, calendar *Calendar) *CalendarsPatchCall { + c := &CalendarsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.calendar = calendar + return c +} + +func (c *CalendarsPatchCall) Do() (*Calendar, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendar) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Calendar) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates metadata for a calendar. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "calendar.calendars.patch", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "calendars/{calendarId}", + // "request": { + // "$ref": "Calendar" + // }, + // "response": { + // "$ref": "Calendar" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.calendars.update": + +type CalendarsUpdateCall struct { + s *Service + calendarId string + calendar *Calendar + opt_ map[string]interface{} +} + +// Update: Updates metadata for a calendar. +func (r *CalendarsService) Update(calendarId string, calendar *Calendar) *CalendarsUpdateCall { + c := &CalendarsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.calendar = calendar + return c +} + +func (c *CalendarsUpdateCall) Do() (*Calendar, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendar) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Calendar) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates metadata for a calendar.", + // "httpMethod": "PUT", + // "id": "calendar.calendars.update", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "calendars/{calendarId}", + // "request": { + // "$ref": "Calendar" + // }, + // "response": { + // "$ref": "Calendar" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.channels.stop": + +type ChannelsStopCall struct { + s *Service + channel *Channel + opt_ map[string]interface{} +} + +// Stop: Stop watching resources through this channel +func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall { + c := &ChannelsStopCall{s: r.s, opt_: make(map[string]interface{})} + c.channel = channel + return c +} + +func (c *ChannelsStopCall) Do() error { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + if err != nil { + return err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Stop watching resources through this channel", + // "httpMethod": "POST", + // "id": "calendar.channels.stop", + // "path": "channels/stop", + // "request": { + // "$ref": "Channel", + // "parameterName": "resource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar", + // "https://www.googleapis.com/auth/calendar.readonly" + // ] + // } + +} + +// method id "calendar.colors.get": + +type ColorsGetCall struct { + s *Service + opt_ map[string]interface{} +} + +// Get: Returns the color definitions for calendars and events. +func (r *ColorsService) Get() *ColorsGetCall { + c := &ColorsGetCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *ColorsGetCall) Do() (*Colors, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "colors") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Colors) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the color definitions for calendars and events.", + // "httpMethod": "GET", + // "id": "calendar.colors.get", + // "path": "colors", + // "response": { + // "$ref": "Colors" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar", + // "https://www.googleapis.com/auth/calendar.readonly" + // ] + // } + +} + +// method id "calendar.events.delete": + +type EventsDeleteCall struct { + s *Service + calendarId string + eventId string + opt_ map[string]interface{} +} + +// Delete: Deletes an event. +func (r *EventsService) Delete(calendarId string, eventId string) *EventsDeleteCall { + c := &EventsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.eventId = eventId + return c +} + +// SendNotifications sets the optional parameter "sendNotifications": +// Whether to send notifications about the deletion of the event. The +// default is False. +func (c *EventsDeleteCall) SendNotifications(sendNotifications bool) *EventsDeleteCall { + c.opt_["sendNotifications"] = sendNotifications + return c +} + +func (c *EventsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["sendNotifications"]; ok { + params.Set("sendNotifications", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{eventId}", url.QueryEscape(c.eventId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an event.", + // "httpMethod": "DELETE", + // "id": "calendar.events.delete", + // "parameterOrder": [ + // "calendarId", + // "eventId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "eventId": { + // "description": "Event identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sendNotifications": { + // "description": "Whether to send notifications about the deletion of the event. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "calendars/{calendarId}/events/{eventId}", + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.events.get": + +type EventsGetCall struct { + s *Service + calendarId string + eventId string + opt_ map[string]interface{} +} + +// Get: Returns an event. +func (r *EventsService) Get(calendarId string, eventId string) *EventsGetCall { + c := &EventsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.eventId = eventId + return c +} + +// AlwaysIncludeEmail sets the optional parameter "alwaysIncludeEmail": +// Whether to always include a value in the "email" field for the +// organizer, creator and attendees, even if no real email is available +// (i.e. a generated, non-working value will be provided). The use of +// this option is discouraged and should only be used by clients which +// cannot handle the absence of an email address value in the mentioned +// places. The default is False. +func (c *EventsGetCall) AlwaysIncludeEmail(alwaysIncludeEmail bool) *EventsGetCall { + c.opt_["alwaysIncludeEmail"] = alwaysIncludeEmail + return c +} + +// MaxAttendees sets the optional parameter "maxAttendees": The maximum +// number of attendees to include in the response. If there are more +// than the specified number of attendees, only the participant is +// returned. +func (c *EventsGetCall) MaxAttendees(maxAttendees int64) *EventsGetCall { + c.opt_["maxAttendees"] = maxAttendees + return c +} + +// TimeZone sets the optional parameter "timeZone": Time zone used in +// the response. The default is the time zone of the calendar. +func (c *EventsGetCall) TimeZone(timeZone string) *EventsGetCall { + c.opt_["timeZone"] = timeZone + return c +} + +func (c *EventsGetCall) Do() (*Event, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["alwaysIncludeEmail"]; ok { + params.Set("alwaysIncludeEmail", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxAttendees"]; ok { + params.Set("maxAttendees", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timeZone"]; ok { + params.Set("timeZone", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{eventId}", url.QueryEscape(c.eventId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Event) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns an event.", + // "httpMethod": "GET", + // "id": "calendar.events.get", + // "parameterOrder": [ + // "calendarId", + // "eventId" + // ], + // "parameters": { + // "alwaysIncludeEmail": { + // "description": "Whether to always include a value in the \"email\" field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "eventId": { + // "description": "Event identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxAttendees": { + // "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "timeZone": { + // "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "calendars/{calendarId}/events/{eventId}", + // "response": { + // "$ref": "Event" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar", + // "https://www.googleapis.com/auth/calendar.readonly" + // ] + // } + +} + +// method id "calendar.events.import": + +type EventsImportCall struct { + s *Service + calendarId string + event *Event + opt_ map[string]interface{} +} + +// Import: Imports an event. This operation is used to add a private +// copy of an existing event to a calendar. +func (r *EventsService) Import(calendarId string, event *Event) *EventsImportCall { + c := &EventsImportCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.event = event + return c +} + +func (c *EventsImportCall) Do() (*Event, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.event) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/import") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Event) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Imports an event. This operation is used to add a private copy of an existing event to a calendar.", + // "httpMethod": "POST", + // "id": "calendar.events.import", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "calendars/{calendarId}/events/import", + // "request": { + // "$ref": "Event" + // }, + // "response": { + // "$ref": "Event" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.events.insert": + +type EventsInsertCall struct { + s *Service + calendarId string + event *Event + opt_ map[string]interface{} +} + +// Insert: Creates an event. +func (r *EventsService) Insert(calendarId string, event *Event) *EventsInsertCall { + c := &EventsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.event = event + return c +} + +// MaxAttendees sets the optional parameter "maxAttendees": The maximum +// number of attendees to include in the response. If there are more +// than the specified number of attendees, only the participant is +// returned. +func (c *EventsInsertCall) MaxAttendees(maxAttendees int64) *EventsInsertCall { + c.opt_["maxAttendees"] = maxAttendees + return c +} + +// SendNotifications sets the optional parameter "sendNotifications": +// Whether to send notifications about the creation of the new event. +// The default is False. +func (c *EventsInsertCall) SendNotifications(sendNotifications bool) *EventsInsertCall { + c.opt_["sendNotifications"] = sendNotifications + return c +} + +func (c *EventsInsertCall) Do() (*Event, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.event) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxAttendees"]; ok { + params.Set("maxAttendees", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sendNotifications"]; ok { + params.Set("sendNotifications", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Event) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an event.", + // "httpMethod": "POST", + // "id": "calendar.events.insert", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxAttendees": { + // "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "sendNotifications": { + // "description": "Whether to send notifications about the creation of the new event. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "calendars/{calendarId}/events", + // "request": { + // "$ref": "Event" + // }, + // "response": { + // "$ref": "Event" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.events.instances": + +type EventsInstancesCall struct { + s *Service + calendarId string + eventId string + opt_ map[string]interface{} +} + +// Instances: Returns instances of the specified recurring event. +func (r *EventsService) Instances(calendarId string, eventId string) *EventsInstancesCall { + c := &EventsInstancesCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.eventId = eventId + return c +} + +// AlwaysIncludeEmail sets the optional parameter "alwaysIncludeEmail": +// Whether to always include a value in the "email" field for the +// organizer, creator and attendees, even if no real email is available +// (i.e. a generated, non-working value will be provided). The use of +// this option is discouraged and should only be used by clients which +// cannot handle the absence of an email address value in the mentioned +// places. The default is False. +func (c *EventsInstancesCall) AlwaysIncludeEmail(alwaysIncludeEmail bool) *EventsInstancesCall { + c.opt_["alwaysIncludeEmail"] = alwaysIncludeEmail + return c +} + +// MaxAttendees sets the optional parameter "maxAttendees": The maximum +// number of attendees to include in the response. If there are more +// than the specified number of attendees, only the participant is +// returned. +func (c *EventsInstancesCall) MaxAttendees(maxAttendees int64) *EventsInstancesCall { + c.opt_["maxAttendees"] = maxAttendees + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of events returned on one result page. +func (c *EventsInstancesCall) MaxResults(maxResults int64) *EventsInstancesCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OriginalStart sets the optional parameter "originalStart": The +// original start time of the instance in the result. +func (c *EventsInstancesCall) OriginalStart(originalStart string) *EventsInstancesCall { + c.opt_["originalStart"] = originalStart + return c +} + +// PageToken sets the optional parameter "pageToken": Token specifying +// which result page to return. +func (c *EventsInstancesCall) PageToken(pageToken string) *EventsInstancesCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ShowDeleted sets the optional parameter "showDeleted": Whether to +// include deleted events (with 'status' equals 'cancelled') in the +// result. Cancelled instances of recurring events will still be +// included if 'singleEvents' is False. The default is False. +func (c *EventsInstancesCall) ShowDeleted(showDeleted bool) *EventsInstancesCall { + c.opt_["showDeleted"] = showDeleted + return c +} + +// TimeMax sets the optional parameter "timeMax": Upper bound +// (exclusive) for an event's start time to filter by. The default is +// not to filter by start time. +func (c *EventsInstancesCall) TimeMax(timeMax string) *EventsInstancesCall { + c.opt_["timeMax"] = timeMax + return c +} + +// TimeMin sets the optional parameter "timeMin": Lower bound +// (inclusive) for an event's end time to filter by. The default is not +// to filter by end time. +func (c *EventsInstancesCall) TimeMin(timeMin string) *EventsInstancesCall { + c.opt_["timeMin"] = timeMin + return c +} + +// TimeZone sets the optional parameter "timeZone": Time zone used in +// the response. The default is the time zone of the calendar. +func (c *EventsInstancesCall) TimeZone(timeZone string) *EventsInstancesCall { + c.opt_["timeZone"] = timeZone + return c +} + +func (c *EventsInstancesCall) Do() (*Events, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["alwaysIncludeEmail"]; ok { + params.Set("alwaysIncludeEmail", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxAttendees"]; ok { + params.Set("maxAttendees", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["originalStart"]; ok { + params.Set("originalStart", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["showDeleted"]; ok { + params.Set("showDeleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timeMax"]; ok { + params.Set("timeMax", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timeMin"]; ok { + params.Set("timeMin", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timeZone"]; ok { + params.Set("timeZone", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{eventId}", url.QueryEscape(c.eventId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Events) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns instances of the specified recurring event.", + // "httpMethod": "GET", + // "id": "calendar.events.instances", + // "parameterOrder": [ + // "calendarId", + // "eventId" + // ], + // "parameters": { + // "alwaysIncludeEmail": { + // "description": "Whether to always include a value in the \"email\" field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "eventId": { + // "description": "Recurring event identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxAttendees": { + // "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "maxResults": { + // "description": "Maximum number of events returned on one result page. Optional.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "originalStart": { + // "description": "The original start time of the instance in the result. Optional.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Token specifying which result page to return. Optional.", + // "location": "query", + // "type": "string" + // }, + // "showDeleted": { + // "description": "Whether to include deleted events (with 'status' equals 'cancelled') in the result. Cancelled instances of recurring events will still be included if 'singleEvents' is False. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "timeMax": { + // "description": "Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "timeMin": { + // "description": "Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "timeZone": { + // "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "calendars/{calendarId}/events/{eventId}/instances", + // "response": { + // "$ref": "Events" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar", + // "https://www.googleapis.com/auth/calendar.readonly" + // ], + // "supportsSubscription": true + // } + +} + +// method id "calendar.events.list": + +type EventsListCall struct { + s *Service + calendarId string + opt_ map[string]interface{} +} + +// List: Returns events on the specified calendar. +func (r *EventsService) List(calendarId string) *EventsListCall { + c := &EventsListCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + return c +} + +// AlwaysIncludeEmail sets the optional parameter "alwaysIncludeEmail": +// Whether to always include a value in the "email" field for the +// organizer, creator and attendees, even if no real email is available +// (i.e. a generated, non-working value will be provided). The use of +// this option is discouraged and should only be used by clients which +// cannot handle the absence of an email address value in the mentioned +// places. The default is False. +func (c *EventsListCall) AlwaysIncludeEmail(alwaysIncludeEmail bool) *EventsListCall { + c.opt_["alwaysIncludeEmail"] = alwaysIncludeEmail + return c +} + +// ICalUID sets the optional parameter "iCalUID": Specifies iCalendar +// UID (iCalUID) of events to be included in the response. +func (c *EventsListCall) ICalUID(iCalUID string) *EventsListCall { + c.opt_["iCalUID"] = iCalUID + return c +} + +// MaxAttendees sets the optional parameter "maxAttendees": The maximum +// number of attendees to include in the response. If there are more +// than the specified number of attendees, only the participant is +// returned. +func (c *EventsListCall) MaxAttendees(maxAttendees int64) *EventsListCall { + c.opt_["maxAttendees"] = maxAttendees + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of events returned on one result page. +func (c *EventsListCall) MaxResults(maxResults int64) *EventsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": The order of the +// events returned in the result. The default is an unspecified, stable +// order. +func (c *EventsListCall) OrderBy(orderBy string) *EventsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Token specifying +// which result page to return. +func (c *EventsListCall) PageToken(pageToken string) *EventsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PrivateExtendedProperty sets the optional parameter +// "privateExtendedProperty": Extended properties constraint specified +// as propertyName=value. Matches only private properties. This +// parameter might be repeated multiple times to return events that +// match all given constraints. +func (c *EventsListCall) PrivateExtendedProperty(privateExtendedProperty string) *EventsListCall { + c.opt_["privateExtendedProperty"] = privateExtendedProperty + return c +} + +// Q sets the optional parameter "q": Free text search terms to find +// events that match these terms in any field, except for extended +// properties. +func (c *EventsListCall) Q(q string) *EventsListCall { + c.opt_["q"] = q + return c +} + +// SharedExtendedProperty sets the optional parameter +// "sharedExtendedProperty": Extended properties constraint specified as +// propertyName=value. Matches only shared properties. This parameter +// might be repeated multiple times to return events that match all +// given constraints. +func (c *EventsListCall) SharedExtendedProperty(sharedExtendedProperty string) *EventsListCall { + c.opt_["sharedExtendedProperty"] = sharedExtendedProperty + return c +} + +// ShowDeleted sets the optional parameter "showDeleted": Whether to +// include deleted events (with 'status' equals 'cancelled') in the +// result. Cancelled instances of recurring events (but not the +// underlying recurring event) will still be included if 'showDeleted' +// and 'singleEvents' are both False. If 'showDeleted' and +// 'singleEvents' are both True, only single instances of deleted events +// (but not the underlying recurring events) are returned. The default +// is False. +func (c *EventsListCall) ShowDeleted(showDeleted bool) *EventsListCall { + c.opt_["showDeleted"] = showDeleted + return c +} + +// ShowHiddenInvitations sets the optional parameter +// "showHiddenInvitations": Whether to include hidden invitations in the +// result. The default is False. +func (c *EventsListCall) ShowHiddenInvitations(showHiddenInvitations bool) *EventsListCall { + c.opt_["showHiddenInvitations"] = showHiddenInvitations + return c +} + +// SingleEvents sets the optional parameter "singleEvents": Whether to +// expand recurring events into instances and only return single one-off +// events and instances of recurring events, but not the underlying +// recurring events themselves. The default is False. +func (c *EventsListCall) SingleEvents(singleEvents bool) *EventsListCall { + c.opt_["singleEvents"] = singleEvents + return c +} + +// TimeMax sets the optional parameter "timeMax": Upper bound +// (exclusive) for an event's start time to filter by. The default is +// not to filter by start time. +func (c *EventsListCall) TimeMax(timeMax string) *EventsListCall { + c.opt_["timeMax"] = timeMax + return c +} + +// TimeMin sets the optional parameter "timeMin": Lower bound +// (inclusive) for an event's end time to filter by. The default is not +// to filter by end time. +func (c *EventsListCall) TimeMin(timeMin string) *EventsListCall { + c.opt_["timeMin"] = timeMin + return c +} + +// TimeZone sets the optional parameter "timeZone": Time zone used in +// the response. The default is the time zone of the calendar. +func (c *EventsListCall) TimeZone(timeZone string) *EventsListCall { + c.opt_["timeZone"] = timeZone + return c +} + +// UpdatedMin sets the optional parameter "updatedMin": Lower bound for +// an event's last modification time (as a RFC 3339 timestamp) to filter +// by. The default is not to filter by last modification time. +func (c *EventsListCall) UpdatedMin(updatedMin string) *EventsListCall { + c.opt_["updatedMin"] = updatedMin + return c +} + +func (c *EventsListCall) Do() (*Events, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["alwaysIncludeEmail"]; ok { + params.Set("alwaysIncludeEmail", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["iCalUID"]; ok { + params.Set("iCalUID", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxAttendees"]; ok { + params.Set("maxAttendees", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["privateExtendedProperty"]; ok { + params.Set("privateExtendedProperty", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["q"]; ok { + params.Set("q", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sharedExtendedProperty"]; ok { + params.Set("sharedExtendedProperty", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["showDeleted"]; ok { + params.Set("showDeleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["showHiddenInvitations"]; ok { + params.Set("showHiddenInvitations", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["singleEvents"]; ok { + params.Set("singleEvents", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timeMax"]; ok { + params.Set("timeMax", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timeMin"]; ok { + params.Set("timeMin", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timeZone"]; ok { + params.Set("timeZone", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updatedMin"]; ok { + params.Set("updatedMin", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Events) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns events on the specified calendar.", + // "httpMethod": "GET", + // "id": "calendar.events.list", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "alwaysIncludeEmail": { + // "description": "Whether to always include a value in the \"email\" field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "iCalUID": { + // "description": "Specifies iCalendar UID (iCalUID) of events to be included in the response. Optional.", + // "location": "query", + // "type": "string" + // }, + // "maxAttendees": { + // "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "maxResults": { + // "description": "Maximum number of events returned on one result page. Optional.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "orderBy": { + // "description": "The order of the events returned in the result. Optional. The default is an unspecified, stable order.", + // "enum": [ + // "startTime", + // "updated" + // ], + // "enumDescriptions": [ + // "Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter \"singleEvents\" is True)", + // "Order by last modification time (ascending)." + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Token specifying which result page to return. Optional.", + // "location": "query", + // "type": "string" + // }, + // "privateExtendedProperty": { + // "description": "Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to return events that match all given constraints.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "q": { + // "description": "Free text search terms to find events that match these terms in any field, except for extended properties. Optional.", + // "location": "query", + // "type": "string" + // }, + // "sharedExtendedProperty": { + // "description": "Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to return events that match all given constraints.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "showDeleted": { + // "description": "Whether to include deleted events (with 'status' equals 'cancelled') in the result. Cancelled instances of recurring events (but not the underlying recurring event) will still be included if 'showDeleted' and 'singleEvents' are both False. If 'showDeleted' and 'singleEvents' are both True, only single instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "showHiddenInvitations": { + // "description": "Whether to include hidden invitations in the result. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "singleEvents": { + // "description": "Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "timeMax": { + // "description": "Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "timeMin": { + // "description": "Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "timeZone": { + // "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.", + // "location": "query", + // "type": "string" + // }, + // "updatedMin": { + // "description": "Lower bound for an event's last modification time (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by last modification time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "calendars/{calendarId}/events", + // "response": { + // "$ref": "Events" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar", + // "https://www.googleapis.com/auth/calendar.readonly" + // ], + // "supportsSubscription": true + // } + +} + +// method id "calendar.events.move": + +type EventsMoveCall struct { + s *Service + calendarId string + eventId string + destinationid string + opt_ map[string]interface{} +} + +// Move: Moves an event to another calendar, i.e. changes an event's +// organizer. +func (r *EventsService) Move(calendarId string, eventId string, destinationid string) *EventsMoveCall { + c := &EventsMoveCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.eventId = eventId + c.destinationid = destinationid + return c +} + +// SendNotifications sets the optional parameter "sendNotifications": +// Whether to send notifications about the change of the event's +// organizer. The default is False. +func (c *EventsMoveCall) SendNotifications(sendNotifications bool) *EventsMoveCall { + c.opt_["sendNotifications"] = sendNotifications + return c +} + +func (c *EventsMoveCall) Do() (*Event, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("destination", fmt.Sprintf("%v", c.destinationid)) + if v, ok := c.opt_["sendNotifications"]; ok { + params.Set("sendNotifications", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}/move") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{eventId}", url.QueryEscape(c.eventId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Event) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Moves an event to another calendar, i.e. changes an event's organizer.", + // "httpMethod": "POST", + // "id": "calendar.events.move", + // "parameterOrder": [ + // "calendarId", + // "eventId", + // "destination" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier of the source calendar where the event currently is on.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "destination": { + // "description": "Calendar identifier of the target calendar where the event is to be moved to.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "eventId": { + // "description": "Event identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sendNotifications": { + // "description": "Whether to send notifications about the change of the event's organizer. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "calendars/{calendarId}/events/{eventId}/move", + // "response": { + // "$ref": "Event" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.events.patch": + +type EventsPatchCall struct { + s *Service + calendarId string + eventId string + event *Event + opt_ map[string]interface{} +} + +// Patch: Updates an event. This method supports patch semantics. +func (r *EventsService) Patch(calendarId string, eventId string, event *Event) *EventsPatchCall { + c := &EventsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.eventId = eventId + c.event = event + return c +} + +// AlwaysIncludeEmail sets the optional parameter "alwaysIncludeEmail": +// Whether to always include a value in the "email" field for the +// organizer, creator and attendees, even if no real email is available +// (i.e. a generated, non-working value will be provided). The use of +// this option is discouraged and should only be used by clients which +// cannot handle the absence of an email address value in the mentioned +// places. The default is False. +func (c *EventsPatchCall) AlwaysIncludeEmail(alwaysIncludeEmail bool) *EventsPatchCall { + c.opt_["alwaysIncludeEmail"] = alwaysIncludeEmail + return c +} + +// MaxAttendees sets the optional parameter "maxAttendees": The maximum +// number of attendees to include in the response. If there are more +// than the specified number of attendees, only the participant is +// returned. +func (c *EventsPatchCall) MaxAttendees(maxAttendees int64) *EventsPatchCall { + c.opt_["maxAttendees"] = maxAttendees + return c +} + +// SendNotifications sets the optional parameter "sendNotifications": +// Whether to send notifications about the event update (e.g. attendee's +// responses, title changes, etc.). The default is False. +func (c *EventsPatchCall) SendNotifications(sendNotifications bool) *EventsPatchCall { + c.opt_["sendNotifications"] = sendNotifications + return c +} + +func (c *EventsPatchCall) Do() (*Event, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.event) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["alwaysIncludeEmail"]; ok { + params.Set("alwaysIncludeEmail", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxAttendees"]; ok { + params.Set("maxAttendees", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sendNotifications"]; ok { + params.Set("sendNotifications", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{eventId}", url.QueryEscape(c.eventId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Event) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an event. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "calendar.events.patch", + // "parameterOrder": [ + // "calendarId", + // "eventId" + // ], + // "parameters": { + // "alwaysIncludeEmail": { + // "description": "Whether to always include a value in the \"email\" field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "eventId": { + // "description": "Event identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxAttendees": { + // "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "sendNotifications": { + // "description": "Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "calendars/{calendarId}/events/{eventId}", + // "request": { + // "$ref": "Event" + // }, + // "response": { + // "$ref": "Event" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.events.quickAdd": + +type EventsQuickAddCall struct { + s *Service + calendarId string + text string + opt_ map[string]interface{} +} + +// QuickAdd: Creates an event based on a simple text string. +func (r *EventsService) QuickAdd(calendarId string, text string) *EventsQuickAddCall { + c := &EventsQuickAddCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.text = text + return c +} + +// SendNotifications sets the optional parameter "sendNotifications": +// Whether to send notifications about the creation of the event. The +// default is False. +func (c *EventsQuickAddCall) SendNotifications(sendNotifications bool) *EventsQuickAddCall { + c.opt_["sendNotifications"] = sendNotifications + return c +} + +func (c *EventsQuickAddCall) Do() (*Event, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("text", fmt.Sprintf("%v", c.text)) + if v, ok := c.opt_["sendNotifications"]; ok { + params.Set("sendNotifications", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/quickAdd") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Event) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an event based on a simple text string.", + // "httpMethod": "POST", + // "id": "calendar.events.quickAdd", + // "parameterOrder": [ + // "calendarId", + // "text" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sendNotifications": { + // "description": "Whether to send notifications about the creation of the event. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "text": { + // "description": "The text describing the event to be created.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "calendars/{calendarId}/events/quickAdd", + // "response": { + // "$ref": "Event" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.events.update": + +type EventsUpdateCall struct { + s *Service + calendarId string + eventId string + event *Event + opt_ map[string]interface{} +} + +// Update: Updates an event. +func (r *EventsService) Update(calendarId string, eventId string, event *Event) *EventsUpdateCall { + c := &EventsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.eventId = eventId + c.event = event + return c +} + +// AlwaysIncludeEmail sets the optional parameter "alwaysIncludeEmail": +// Whether to always include a value in the "email" field for the +// organizer, creator and attendees, even if no real email is available +// (i.e. a generated, non-working value will be provided). The use of +// this option is discouraged and should only be used by clients which +// cannot handle the absence of an email address value in the mentioned +// places. The default is False. +func (c *EventsUpdateCall) AlwaysIncludeEmail(alwaysIncludeEmail bool) *EventsUpdateCall { + c.opt_["alwaysIncludeEmail"] = alwaysIncludeEmail + return c +} + +// MaxAttendees sets the optional parameter "maxAttendees": The maximum +// number of attendees to include in the response. If there are more +// than the specified number of attendees, only the participant is +// returned. +func (c *EventsUpdateCall) MaxAttendees(maxAttendees int64) *EventsUpdateCall { + c.opt_["maxAttendees"] = maxAttendees + return c +} + +// SendNotifications sets the optional parameter "sendNotifications": +// Whether to send notifications about the event update (e.g. attendee's +// responses, title changes, etc.). The default is False. +func (c *EventsUpdateCall) SendNotifications(sendNotifications bool) *EventsUpdateCall { + c.opt_["sendNotifications"] = sendNotifications + return c +} + +func (c *EventsUpdateCall) Do() (*Event, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.event) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["alwaysIncludeEmail"]; ok { + params.Set("alwaysIncludeEmail", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxAttendees"]; ok { + params.Set("maxAttendees", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sendNotifications"]; ok { + params.Set("sendNotifications", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{eventId}", url.QueryEscape(c.eventId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Event) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an event.", + // "httpMethod": "PUT", + // "id": "calendar.events.update", + // "parameterOrder": [ + // "calendarId", + // "eventId" + // ], + // "parameters": { + // "alwaysIncludeEmail": { + // "description": "Whether to always include a value in the \"email\" field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "eventId": { + // "description": "Event identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxAttendees": { + // "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "sendNotifications": { + // "description": "Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "calendars/{calendarId}/events/{eventId}", + // "request": { + // "$ref": "Event" + // }, + // "response": { + // "$ref": "Event" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ] + // } + +} + +// method id "calendar.events.watch": + +type EventsWatchCall struct { + s *Service + calendarId string + channel *Channel + opt_ map[string]interface{} +} + +// Watch: Watch for changes to Events resources. +func (r *EventsService) Watch(calendarId string, channel *Channel) *EventsWatchCall { + c := &EventsWatchCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.channel = channel + return c +} + +// AlwaysIncludeEmail sets the optional parameter "alwaysIncludeEmail": +// Whether to always include a value in the "email" field for the +// organizer, creator and attendees, even if no real email is available +// (i.e. a generated, non-working value will be provided). The use of +// this option is discouraged and should only be used by clients which +// cannot handle the absence of an email address value in the mentioned +// places. The default is False. +func (c *EventsWatchCall) AlwaysIncludeEmail(alwaysIncludeEmail bool) *EventsWatchCall { + c.opt_["alwaysIncludeEmail"] = alwaysIncludeEmail + return c +} + +// ICalUID sets the optional parameter "iCalUID": Specifies iCalendar +// UID (iCalUID) of events to be included in the response. +func (c *EventsWatchCall) ICalUID(iCalUID string) *EventsWatchCall { + c.opt_["iCalUID"] = iCalUID + return c +} + +// MaxAttendees sets the optional parameter "maxAttendees": The maximum +// number of attendees to include in the response. If there are more +// than the specified number of attendees, only the participant is +// returned. +func (c *EventsWatchCall) MaxAttendees(maxAttendees int64) *EventsWatchCall { + c.opt_["maxAttendees"] = maxAttendees + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of events returned on one result page. +func (c *EventsWatchCall) MaxResults(maxResults int64) *EventsWatchCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": The order of the +// events returned in the result. The default is an unspecified, stable +// order. +func (c *EventsWatchCall) OrderBy(orderBy string) *EventsWatchCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Token specifying +// which result page to return. +func (c *EventsWatchCall) PageToken(pageToken string) *EventsWatchCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PrivateExtendedProperty sets the optional parameter +// "privateExtendedProperty": Extended properties constraint specified +// as propertyName=value. Matches only private properties. This +// parameter might be repeated multiple times to return events that +// match all given constraints. +func (c *EventsWatchCall) PrivateExtendedProperty(privateExtendedProperty string) *EventsWatchCall { + c.opt_["privateExtendedProperty"] = privateExtendedProperty + return c +} + +// Q sets the optional parameter "q": Free text search terms to find +// events that match these terms in any field, except for extended +// properties. +func (c *EventsWatchCall) Q(q string) *EventsWatchCall { + c.opt_["q"] = q + return c +} + +// SharedExtendedProperty sets the optional parameter +// "sharedExtendedProperty": Extended properties constraint specified as +// propertyName=value. Matches only shared properties. This parameter +// might be repeated multiple times to return events that match all +// given constraints. +func (c *EventsWatchCall) SharedExtendedProperty(sharedExtendedProperty string) *EventsWatchCall { + c.opt_["sharedExtendedProperty"] = sharedExtendedProperty + return c +} + +// ShowDeleted sets the optional parameter "showDeleted": Whether to +// include deleted events (with 'status' equals 'cancelled') in the +// result. Cancelled instances of recurring events (but not the +// underlying recurring event) will still be included if 'showDeleted' +// and 'singleEvents' are both False. If 'showDeleted' and +// 'singleEvents' are both True, only single instances of deleted events +// (but not the underlying recurring events) are returned. The default +// is False. +func (c *EventsWatchCall) ShowDeleted(showDeleted bool) *EventsWatchCall { + c.opt_["showDeleted"] = showDeleted + return c +} + +// ShowHiddenInvitations sets the optional parameter +// "showHiddenInvitations": Whether to include hidden invitations in the +// result. The default is False. +func (c *EventsWatchCall) ShowHiddenInvitations(showHiddenInvitations bool) *EventsWatchCall { + c.opt_["showHiddenInvitations"] = showHiddenInvitations + return c +} + +// SingleEvents sets the optional parameter "singleEvents": Whether to +// expand recurring events into instances and only return single one-off +// events and instances of recurring events, but not the underlying +// recurring events themselves. The default is False. +func (c *EventsWatchCall) SingleEvents(singleEvents bool) *EventsWatchCall { + c.opt_["singleEvents"] = singleEvents + return c +} + +// TimeMax sets the optional parameter "timeMax": Upper bound +// (exclusive) for an event's start time to filter by. The default is +// not to filter by start time. +func (c *EventsWatchCall) TimeMax(timeMax string) *EventsWatchCall { + c.opt_["timeMax"] = timeMax + return c +} + +// TimeMin sets the optional parameter "timeMin": Lower bound +// (inclusive) for an event's end time to filter by. The default is not +// to filter by end time. +func (c *EventsWatchCall) TimeMin(timeMin string) *EventsWatchCall { + c.opt_["timeMin"] = timeMin + return c +} + +// TimeZone sets the optional parameter "timeZone": Time zone used in +// the response. The default is the time zone of the calendar. +func (c *EventsWatchCall) TimeZone(timeZone string) *EventsWatchCall { + c.opt_["timeZone"] = timeZone + return c +} + +// UpdatedMin sets the optional parameter "updatedMin": Lower bound for +// an event's last modification time (as a RFC 3339 timestamp) to filter +// by. The default is not to filter by last modification time. +func (c *EventsWatchCall) UpdatedMin(updatedMin string) *EventsWatchCall { + c.opt_["updatedMin"] = updatedMin + return c +} + +func (c *EventsWatchCall) Do() (*Channel, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["alwaysIncludeEmail"]; ok { + params.Set("alwaysIncludeEmail", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["iCalUID"]; ok { + params.Set("iCalUID", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxAttendees"]; ok { + params.Set("maxAttendees", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["privateExtendedProperty"]; ok { + params.Set("privateExtendedProperty", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["q"]; ok { + params.Set("q", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sharedExtendedProperty"]; ok { + params.Set("sharedExtendedProperty", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["showDeleted"]; ok { + params.Set("showDeleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["showHiddenInvitations"]; ok { + params.Set("showHiddenInvitations", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["singleEvents"]; ok { + params.Set("singleEvents", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timeMax"]; ok { + params.Set("timeMax", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timeMin"]; ok { + params.Set("timeMin", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timeZone"]; ok { + params.Set("timeZone", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updatedMin"]; ok { + params.Set("updatedMin", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/watch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{calendarId}", url.QueryEscape(c.calendarId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Channel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Watch for changes to Events resources.", + // "httpMethod": "POST", + // "id": "calendar.events.watch", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "alwaysIncludeEmail": { + // "description": "Whether to always include a value in the \"email\" field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "calendarId": { + // "description": "Calendar identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "iCalUID": { + // "description": "Specifies iCalendar UID (iCalUID) of events to be included in the response. Optional.", + // "location": "query", + // "type": "string" + // }, + // "maxAttendees": { + // "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "maxResults": { + // "description": "Maximum number of events returned on one result page. Optional.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "orderBy": { + // "description": "The order of the events returned in the result. Optional. The default is an unspecified, stable order.", + // "enum": [ + // "startTime", + // "updated" + // ], + // "enumDescriptions": [ + // "Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter \"singleEvents\" is True)", + // "Order by last modification time (ascending)." + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Token specifying which result page to return. Optional.", + // "location": "query", + // "type": "string" + // }, + // "privateExtendedProperty": { + // "description": "Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to return events that match all given constraints.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "q": { + // "description": "Free text search terms to find events that match these terms in any field, except for extended properties. Optional.", + // "location": "query", + // "type": "string" + // }, + // "sharedExtendedProperty": { + // "description": "Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to return events that match all given constraints.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "showDeleted": { + // "description": "Whether to include deleted events (with 'status' equals 'cancelled') in the result. Cancelled instances of recurring events (but not the underlying recurring event) will still be included if 'showDeleted' and 'singleEvents' are both False. If 'showDeleted' and 'singleEvents' are both True, only single instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "showHiddenInvitations": { + // "description": "Whether to include hidden invitations in the result. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "singleEvents": { + // "description": "Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "timeMax": { + // "description": "Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "timeMin": { + // "description": "Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "timeZone": { + // "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.", + // "location": "query", + // "type": "string" + // }, + // "updatedMin": { + // "description": "Lower bound for an event's last modification time (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by last modification time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "calendars/{calendarId}/events/watch", + // "request": { + // "$ref": "Channel", + // "parameterName": "resource" + // }, + // "response": { + // "$ref": "Channel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar", + // "https://www.googleapis.com/auth/calendar.readonly" + // ], + // "supportsSubscription": true + // } + +} + +// method id "calendar.freebusy.query": + +type FreebusyQueryCall struct { + s *Service + freebusyrequest *FreeBusyRequest + opt_ map[string]interface{} +} + +// Query: Returns free/busy information for a set of calendars. +func (r *FreebusyService) Query(freebusyrequest *FreeBusyRequest) *FreebusyQueryCall { + c := &FreebusyQueryCall{s: r.s, opt_: make(map[string]interface{})} + c.freebusyrequest = freebusyrequest + return c +} + +func (c *FreebusyQueryCall) Do() (*FreeBusyResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.freebusyrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "freeBusy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(FreeBusyResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns free/busy information for a set of calendars.", + // "httpMethod": "POST", + // "id": "calendar.freebusy.query", + // "path": "freeBusy", + // "request": { + // "$ref": "FreeBusyRequest" + // }, + // "response": { + // "$ref": "FreeBusyResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar", + // "https://www.googleapis.com/auth/calendar.readonly" + // ] + // } + +} + +// method id "calendar.settings.get": + +type SettingsGetCall struct { + s *Service + setting string + opt_ map[string]interface{} +} + +// Get: Returns a single user setting. +func (r *SettingsService) Get(setting string) *SettingsGetCall { + c := &SettingsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.setting = setting + return c +} + +func (c *SettingsGetCall) Do() (*Setting, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/settings/{setting}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{setting}", url.QueryEscape(c.setting), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Setting) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a single user setting.", + // "httpMethod": "GET", + // "id": "calendar.settings.get", + // "parameterOrder": [ + // "setting" + // ], + // "parameters": { + // "setting": { + // "description": "The id of the user setting.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/me/settings/{setting}", + // "response": { + // "$ref": "Setting" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar", + // "https://www.googleapis.com/auth/calendar.readonly" + // ] + // } + +} + +// method id "calendar.settings.list": + +type SettingsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Returns all user settings for the authenticated user. +func (r *SettingsService) List() *SettingsListCall { + c := &SettingsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *SettingsListCall) Do() (*Settings, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/settings") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Settings) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns all user settings for the authenticated user.", + // "httpMethod": "GET", + // "id": "calendar.settings.list", + // "path": "users/me/settings", + // "response": { + // "$ref": "Settings" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar", + // "https://www.googleapis.com/auth/calendar.readonly" + // ], + // "supportsSubscription": true + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/civicinfo/us_v1/civicinfo-api.json b/third_party/src/code.google.com/p/google-api-go-client/civicinfo/us_v1/civicinfo-api.json new file mode 100644 index 0000000000000..a72f8d4a7d359 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/civicinfo/us_v1/civicinfo-api.json @@ -0,0 +1,839 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/fgmSCrAaA7mxBfjU-xmYlE1C4zQ\"", + "discoveryVersion": "v1", + "id": "civicinfo:us_v1", + "name": "civicinfo", + "canonicalName": "Civic Info", + "version": "us_v1", + "title": "Google Civic Information API", + "description": "An API for accessing civic information.", + "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/civic-information", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/civicinfo/us_v1/", + "basePath": "/civicinfo/us_v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "civicinfo/us_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" + } + }, + "schemas": { + "AdministrationRegion": { + "id": "AdministrationRegion", + "type": "object", + "description": "Describes information about a regional election administrative area.", + "properties": { + "electionAdministrationBody": { + "$ref": "AdministrativeBody", + "description": "The election administration body for this area." + }, + "id": { + "type": "string", + "description": "An ID for this object. IDs may change in future requests and should not be cached. Access to this field requires special access that can be requested from the Request more link on the Quotas page." + }, + "local_jurisdiction": { + "$ref": "AdministrationRegion", + "description": "The city or county that provides election information for this voter. This object can have the same elements as state." + }, + "name": { + "type": "string", + "description": "The name of the jurisdiction." + }, + "sources": { + "type": "array", + "description": "A list of sources for this area. If multiple sources are listed the data has been aggregated from those sources.", + "items": { + "$ref": "Source" + } + } + } + }, + "AdministrativeBody": { + "id": "AdministrativeBody", + "type": "object", + "description": "Information about an election administrative body (e.g. County Board of Elections).", + "properties": { + "absenteeVotingInfoUrl": { + "type": "string", + "description": "A URL provided by this administrative body for information on absentee voting." + }, + "ballotInfoUrl": { + "type": "string", + "description": "A URL provided by this administrative body to give contest information to the voter." + }, + "correspondenceAddress": { + "$ref": "SimpleAddressType", + "description": "The mailing address of this administrative body." + }, + "electionInfoUrl": { + "type": "string", + "description": "A URL provided by this administrative body for looking up general election information." + }, + "electionOfficials": { + "type": "array", + "description": "The election officials for this election administrative body.", + "items": { + "$ref": "ElectionOfficial" + } + }, + "electionRegistrationConfirmationUrl": { + "type": "string", + "description": "A URL provided by this administrative body for confirming that the voter is registered to vote." + }, + "electionRegistrationUrl": { + "type": "string", + "description": "A URL provided by this administrative body for looking up how to register to vote." + }, + "electionRulesUrl": { + "type": "string", + "description": "A URL provided by this administrative body describing election rules to the voter." + }, + "hoursOfOperation": { + "type": "string", + "description": "A description of the hours of operation for this administrative body." + }, + "name": { + "type": "string", + "description": "The name of this election administrative body." + }, + "physicalAddress": { + "$ref": "SimpleAddressType", + "description": "The physical address of this administrative body." + }, + "voter_services": { + "type": "array", + "description": "A description of the services this administrative body may provide.", + "items": { + "type": "string" + } + }, + "votingLocationFinderUrl": { + "type": "string", + "description": "A URL provided by this administrative body for looking up where to vote." + } + } + }, + "Candidate": { + "id": "Candidate", + "type": "object", + "description": "Information about a candidate running for elected office.", + "properties": { + "candidateUrl": { + "type": "string", + "description": "The URL for the candidate's campaign web site." + }, + "channels": { + "type": "array", + "description": "A list of known (social) media channels for this candidate.", + "items": { + "$ref": "Channel" + } + }, + "email": { + "type": "string", + "description": "The email address for the candidate's campaign." + }, + "name": { + "type": "string", + "description": "The candidate's name." + }, + "orderOnBallot": { + "type": "string", + "description": "The order the candidate appears on the ballot for this contest.", + "format": "int64" + }, + "party": { + "type": "string", + "description": "The full name of the party the candidate is a member of." + }, + "phone": { + "type": "string", + "description": "The voice phone number for the candidate's campaign office." + }, + "photoUrl": { + "type": "string", + "description": "A URL for a photo of the candidate." + } + } + }, + "Channel": { + "id": "Channel", + "type": "object", + "description": "A social media or web channel for a candidate.", + "properties": { + "id": { + "type": "string", + "description": "The unique public identifier for the candidate's channel." + }, + "type": { + "type": "string", + "description": "The type of channel. The following is a list of types of channels, but is not exhaustive. More channel types may be added at a later time. One of: GooglePlus, YouTube, Facebook, Twitter" + } + } + }, + "Contest": { + "id": "Contest", + "type": "object", + "description": "Information about a contest that appears on a voter's ballot.", + "properties": { + "ballotPlacement": { + "type": "string", + "description": "A number specifying the position of this contest on the voter's ballot.", + "format": "int64" + }, + "candidates": { + "type": "array", + "description": "The candidate choices for this contest.", + "items": { + "$ref": "Candidate" + } + }, + "district": { + "$ref": "ElectoralDistrict", + "description": "Information about the electoral district that this contest is in." + }, + "electorateSpecifications": { + "type": "string", + "description": "A description of any additional eligibility requirements for voting in this contest." + }, + "id": { + "type": "string", + "description": "An ID for this object. IDs may change in future requests and should not be cached. Access to this field requires special access that can be requested from the Request more link on the Quotas page." + }, + "level": { + "type": "string", + "description": "The level of office for this contest. One of: federal, state, county, city, other" + }, + "numberElected": { + "type": "string", + "description": "The number of candidates that will be elected to office in this contest.", + "format": "int64" + }, + "numberVotingFor": { + "type": "string", + "description": "The number of candidates that a voter may vote for in this contest.", + "format": "int64" + }, + "office": { + "type": "string", + "description": "The name of the office for this contest." + }, + "primaryParty": { + "type": "string", + "description": "If this is a partisan election, the name of the party it is for." + }, + "referendumSubtitle": { + "type": "string", + "description": "A brief description of the referendum. This field is only populated for contests of type 'Referendum'." + }, + "referendumTitle": { + "type": "string", + "description": "The title of the referendum (e.g. 'Proposition 42'). This field is only populated for contests of type 'Referendum'." + }, + "referendumUrl": { + "type": "string", + "description": "A link to the referendum. This field is only populated for contests of type 'Referendum'." + }, + "sources": { + "type": "array", + "description": "A list of sources for this contest. If multiple sources are listed, the data has been aggregated from those sources.", + "items": { + "$ref": "Source" + } + }, + "special": { + "type": "string", + "description": "\"Yes\" or \"No\" depending on whether this a contest being held outside the normal election cycle." + }, + "type": { + "type": "string", + "description": "The type of contest. Usually this will be 'General', 'Primary', or 'Run-off' for contests with candidates. For referenda this will be 'Referendum'." + } + } + }, + "DivisionSearchResponse": { + "id": "DivisionSearchResponse", + "type": "object", + "description": "The result of a division search query.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"civicinfo#divisionSearchResponse\".", + "default": "civicinfo#divisionSearchResponse" + }, + "results": { + "type": "array", + "items": { + "$ref": "DivisionSearchResult" + } + }, + "status": { + "type": "string", + "description": "The result of the request. One of: success, addressUnparseable, noAddressParameter, internalLookupFailure" + } + } + }, + "DivisionSearchResult": { + "id": "DivisionSearchResult", + "type": "object", + "description": "Represents a political geographic division that matches the requested query.", + "properties": { + "name": { + "type": "string", + "description": "The name of the division." + }, + "ocdId": { + "type": "string", + "description": "The unique Open Civic Data identifier for this division." + } + } + }, + "Election": { + "id": "Election", + "type": "object", + "description": "Information about the election that was queried.", + "properties": { + "electionDay": { + "type": "string", + "description": "Day of the election in YYYY-MM-DD format." + }, + "id": { + "type": "string", + "description": "The unique ID of this election.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "A displayable name for the election." + } + } + }, + "ElectionOfficial": { + "id": "ElectionOfficial", + "type": "object", + "description": "Information about individual election officials.", + "properties": { + "emailAddress": { + "type": "string", + "description": "The email address of the election official." + }, + "faxNumber": { + "type": "string", + "description": "The fax number of the election official." + }, + "name": { + "type": "string", + "description": "The full name of the election official." + }, + "officePhoneNumber": { + "type": "string", + "description": "The office phone number of the election official." + }, + "title": { + "type": "string", + "description": "The title of the election official." + } + } + }, + "ElectionsQueryResponse": { + "id": "ElectionsQueryResponse", + "type": "object", + "description": "The list of elections available for this version of the API.", + "properties": { + "elections": { + "type": "array", + "description": "A list of available elections", + "items": { + "$ref": "Election" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"civicinfo#electionsQueryResponse\".", + "default": "civicinfo#electionsQueryResponse" + } + } + }, + "ElectoralDistrict": { + "id": "ElectoralDistrict", + "type": "object", + "description": "Describes the geographic scope of a contest.", + "properties": { + "id": { + "type": "string", + "description": "An identifier for this district, relative to its scope. For example, the 34th State Senate district would have id \"34\" and a scope of stateUpper." + }, + "name": { + "type": "string", + "description": "The name of the district." + }, + "scope": { + "type": "string", + "description": "The geographic scope of this district. If unspecified the district's geography is not known. One of: national, statewide, congressional, stateUpper, stateLower, countywide, judicial, schoolBoard, cityWide, township, countyCouncil, cityCouncil, ward, special" + } + } + }, + "GeographicDivision": { + "id": "GeographicDivision", + "type": "object", + "description": "Describes a political geography.", + "properties": { + "name": { + "type": "string", + "description": "The name of the division." + }, + "officeIds": { + "type": "array", + "description": "List of keys in the offices object, one for each office elected from this division. Will only be present if includeOffices was true (or absent) in the request.", + "items": { + "type": "string" + } + }, + "scope": { + "type": "string", + "description": "The geographic scope of the division. If unspecified, the division's geography is not known. One of: national, statewide, congressional, stateUpper, stateLower, countywide, judicial, schoolBoard, cityWide, township, countyCouncil, cityCouncil, ward, special" + } + } + }, + "Office": { + "id": "Office", + "type": "object", + "description": "Information about an Office held by one or more Officials.", + "properties": { + "level": { + "type": "string", + "description": "The level of this elected office. One of: federal, state, county, city, other" + }, + "name": { + "type": "string", + "description": "The human-readable name of the office." + }, + "officialIds": { + "type": "array", + "description": "List of people who presently hold the office.", + "items": { + "type": "string" + } + }, + "sources": { + "type": "array", + "description": "A list of sources for this office. If multiple sources are listed, the data has been aggregated from those sources.", + "items": { + "$ref": "Source" + } + } + } + }, + "Official": { + "id": "Official", + "type": "object", + "description": "Information about a official holding an elected office.", + "properties": { + "address": { + "type": "array", + "description": "Addresses at which to contact the official.", + "items": { + "$ref": "SimpleAddressType" + } + }, + "channels": { + "type": "array", + "description": "A list of known (social) media channels for this official.", + "items": { + "$ref": "Channel" + } + }, + "emails": { + "type": "array", + "description": "The direct email addresses for the official.", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "description": "The official's name." + }, + "party": { + "type": "string", + "description": "The full name of the party the official belongs to." + }, + "phones": { + "type": "array", + "description": "The official's public contact phone numbers.", + "items": { + "type": "string" + } + }, + "photoUrl": { + "type": "string", + "description": "A URL for a photo of the official." + }, + "urls": { + "type": "array", + "description": "The official's public website URLs.", + "items": { + "type": "string" + } + } + } + }, + "PollingLocation": { + "id": "PollingLocation", + "type": "object", + "description": "A location where a voter can vote. This may be an early vote site or an election day voting location.", + "properties": { + "address": { + "$ref": "SimpleAddressType", + "description": "The address of the location" + }, + "endDate": { + "type": "string", + "description": "The last date that this early vote site may be used. This field is not populated for polling locations." + }, + "id": { + "type": "string", + "description": "An ID for this object. IDs may change in future requests and should not be cached. Access to this field requires special access that can be requested from the Request more link on the Quotas page." + }, + "name": { + "type": "string", + "description": "The name of the early vote site. This field is not populated for polling locations." + }, + "notes": { + "type": "string", + "description": "Notes about this location (e.g. accessibility ramp or entrance to use)" + }, + "pollingHours": { + "type": "string", + "description": "A description of when this location is open." + }, + "sources": { + "type": "array", + "description": "A list of sources for this location. If multiple sources are listed the data has been aggregated from those sources.", + "items": { + "$ref": "Source" + } + }, + "startDate": { + "type": "string", + "description": "The first date that this early vote site may be used. This field is not populated for polling locations." + }, + "voterServices": { + "type": "string", + "description": "The services provided by this early vote site. This field is not populated for polling locations." + } + } + }, + "RepresentativeInfoRequest": { + "id": "RepresentativeInfoRequest", + "type": "object", + "description": "A request for political geography and representative information for an address.", + "properties": { + "address": { + "type": "string", + "description": "The address to look up. May only be specified if the field ocdId is not given in the URL." + } + } + }, + "RepresentativeInfoResponse": { + "id": "RepresentativeInfoResponse", + "type": "object", + "description": "The result of a representative info lookup query.", + "properties": { + "divisions": { + "type": "object", + "description": "Political geographic divisions that contain the requested address.", + "additionalProperties": { + "$ref": "GeographicDivision", + "description": "The unique Open Civic Data identifier for this division." + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"civicinfo#representativeInfoResponse\".", + "default": "civicinfo#representativeInfoResponse" + }, + "normalizedInput": { + "$ref": "SimpleAddressType", + "description": "The normalized version of the requested address" + }, + "offices": { + "type": "object", + "description": "Elected offices referenced by the divisions listed above. Will only be present if includeOffices was true in the request.", + "additionalProperties": { + "$ref": "Office", + "description": "A unique identifier for this office, within the context of this request. Identifiers are *not* long-lived: the same office may get different IDs on different requests." + } + }, + "officials": { + "type": "object", + "description": "Officials holding the offices listed above. Will only be present if includeOffices was true in the request.", + "additionalProperties": { + "$ref": "Official", + "description": "A unique identifier for this official, within the context of this request. Identifiers are *not* long-lived: the same official may get different IDs on different requests." + } + }, + "status": { + "type": "string", + "description": "The result of the request. One of: success, noStreetSegmentFound, addressUnparseable, noAddressParameter, multipleStreetSegmentsFound, electionOver, electionUnknown, internalLookupFailure, RequestedBothAddressAndOcdId" + } + } + }, + "SimpleAddressType": { + "id": "SimpleAddressType", + "type": "object", + "description": "A simple representation of an address.", + "properties": { + "city": { + "type": "string", + "description": "The city or town for the address." + }, + "line1": { + "type": "string", + "description": "The street name and number of this address." + }, + "line2": { + "type": "string", + "description": "The second line the address, if needed." + }, + "line3": { + "type": "string", + "description": "The third line of the address, if needed." + }, + "locationName": { + "type": "string", + "description": "The name of the location." + }, + "state": { + "type": "string", + "description": "The US two letter state abbreviation of the address." + }, + "zip": { + "type": "string", + "description": "The US Postal Zip Code of the address." + } + } + }, + "Source": { + "id": "Source", + "type": "object", + "description": "Contains information about the data source for the element containing it.", + "properties": { + "name": { + "type": "string", + "description": "The name of the data source." + }, + "official": { + "type": "boolean", + "description": "Whether this data comes from an official government source." + } + } + }, + "VoterInfoRequest": { + "id": "VoterInfoRequest", + "type": "object", + "description": "A request for information about a voter.", + "properties": { + "address": { + "type": "string", + "description": "The registered address of the voter to look up." + } + } + }, + "VoterInfoResponse": { + "id": "VoterInfoResponse", + "type": "object", + "description": "The result of a voter info lookup query.", + "properties": { + "contests": { + "type": "array", + "description": "Contests that will appear on the voter's ballot", + "items": { + "$ref": "Contest" + } + }, + "earlyVoteSites": { + "type": "array", + "description": "Locations where the voter is eligible to vote early, prior to election day", + "items": { + "$ref": "PollingLocation" + } + }, + "election": { + "$ref": "Election", + "description": "The election that was queried." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"civicinfo#voterInfoResponse\".", + "default": "civicinfo#voterInfoResponse" + }, + "normalizedInput": { + "$ref": "SimpleAddressType", + "description": "The normalized version of the requested address" + }, + "pollingLocations": { + "type": "array", + "description": "Locations where the voter is eligible to vote on election day. For states with mail-in voting only, these locations will be nearby drop box locations. Drop box locations are free to the voter and may be used instead of placing the ballot in the mail.", + "items": { + "$ref": "PollingLocation" + } + }, + "state": { + "type": "array", + "description": "Local Election Information for the state that the voter votes in. For the US, there will only be one element in this array.", + "items": { + "$ref": "AdministrationRegion" + } + }, + "status": { + "type": "string", + "description": "The result of the request. One of: success, noStreetSegmentFound, addressUnparseable, noAddressParameter, multipleStreetSegmentsFound, electionOver, electionUnknown, internalLookupFailure" + } + } + } + }, + "resources": { + "divisions": { + "methods": { + "search": { + "id": "civicinfo.divisions.search", + "path": "representatives/division_search", + "httpMethod": "GET", + "description": "Searches for political divisions by their natural name or OCD ID.", + "parameters": { + "query": { + "type": "string", + "description": "The search query. Queries can cover any parts of a OCD ID or a human readable division name. All words given in the query are treated as required patterns. In addition to that, most query operators of the Apache Lucene library are supported. See http://lucene.apache.org/core/2_9_4/queryparsersyntax.html", + "location": "query" + } + }, + "response": { + "$ref": "DivisionSearchResponse" + } + } + } + }, + "elections": { + "methods": { + "electionQuery": { + "id": "civicinfo.elections.electionQuery", + "path": "elections", + "httpMethod": "GET", + "description": "List of available elections to query.", + "response": { + "$ref": "ElectionsQueryResponse" + } + }, + "voterInfoQuery": { + "id": "civicinfo.elections.voterInfoQuery", + "path": "voterinfo/{electionId}/lookup", + "httpMethod": "POST", + "description": "Looks up information relevant to a voter based on the voter's registered address.", + "parameters": { + "electionId": { + "type": "string", + "description": "The unique ID of the election to look up. A list of election IDs can be obtained at https://www.googleapis.com/civicinfo/{version}/elections", + "required": true, + "format": "int64", + "location": "path" + }, + "officialOnly": { + "type": "boolean", + "description": "If set to true, only data from official state sources will be returned.", + "default": "false", + "location": "query" + } + }, + "parameterOrder": [ + "electionId" + ], + "request": { + "$ref": "VoterInfoRequest" + }, + "response": { + "$ref": "VoterInfoResponse" + } + } + } + }, + "representatives": { + "methods": { + "representativeInfoQuery": { + "id": "civicinfo.representatives.representativeInfoQuery", + "path": "representatives/lookup", + "httpMethod": "POST", + "description": "Looks up political geography and (optionally) representative information based on an address.", + "parameters": { + "includeOffices": { + "type": "boolean", + "description": "Whether to return information about offices and officials. If false, only the top-level district information will be returned.", + "default": "true", + "location": "query" + }, + "ocdId": { + "type": "string", + "description": "The division to look up. May only be specified if the address field is not given in the request body.", + "location": "query" + } + }, + "request": { + "$ref": "RepresentativeInfoRequest" + }, + "response": { + "$ref": "RepresentativeInfoResponse" + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/civicinfo/us_v1/civicinfo-gen.go b/third_party/src/code.google.com/p/google-api-go-client/civicinfo/us_v1/civicinfo-gen.go new file mode 100644 index 0000000000000..9aa9d5da67fac --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/civicinfo/us_v1/civicinfo-gen.go @@ -0,0 +1,851 @@ +// Package civicinfo provides access to the Google Civic Information API. +// +// See https://developers.google.com/civic-information +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/civicinfo/us_v1" +// ... +// civicinfoService, err := civicinfo.New(oauthHttpClient) +package civicinfo + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "civicinfo:us_v1" +const apiName = "civicinfo" +const apiVersion = "us_v1" +const basePath = "https://www.googleapis.com/civicinfo/us_v1/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Divisions = NewDivisionsService(s) + s.Elections = NewElectionsService(s) + s.Representatives = NewRepresentativesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Divisions *DivisionsService + + Elections *ElectionsService + + Representatives *RepresentativesService +} + +func NewDivisionsService(s *Service) *DivisionsService { + rs := &DivisionsService{s: s} + return rs +} + +type DivisionsService struct { + s *Service +} + +func NewElectionsService(s *Service) *ElectionsService { + rs := &ElectionsService{s: s} + return rs +} + +type ElectionsService struct { + s *Service +} + +func NewRepresentativesService(s *Service) *RepresentativesService { + rs := &RepresentativesService{s: s} + return rs +} + +type RepresentativesService struct { + s *Service +} + +type AdministrationRegion struct { + // ElectionAdministrationBody: The election administration body for this + // area. + ElectionAdministrationBody *AdministrativeBody `json:"electionAdministrationBody,omitempty"` + + // Id: An ID for this object. IDs may change in future requests and + // should not be cached. Access to this field requires special access + // that can be requested from the Request more link on the Quotas page. + Id string `json:"id,omitempty"` + + // Local_jurisdiction: The city or county that provides election + // information for this voter. This object can have the same elements as + // state. + Local_jurisdiction *AdministrationRegion `json:"local_jurisdiction,omitempty"` + + // Name: The name of the jurisdiction. + Name string `json:"name,omitempty"` + + // Sources: A list of sources for this area. If multiple sources are + // listed the data has been aggregated from those sources. + Sources []*Source `json:"sources,omitempty"` +} + +type AdministrativeBody struct { + // AbsenteeVotingInfoUrl: A URL provided by this administrative body for + // information on absentee voting. + AbsenteeVotingInfoUrl string `json:"absenteeVotingInfoUrl,omitempty"` + + // BallotInfoUrl: A URL provided by this administrative body to give + // contest information to the voter. + BallotInfoUrl string `json:"ballotInfoUrl,omitempty"` + + // CorrespondenceAddress: The mailing address of this administrative + // body. + CorrespondenceAddress *SimpleAddressType `json:"correspondenceAddress,omitempty"` + + // ElectionInfoUrl: A URL provided by this administrative body for + // looking up general election information. + ElectionInfoUrl string `json:"electionInfoUrl,omitempty"` + + // ElectionOfficials: The election officials for this election + // administrative body. + ElectionOfficials []*ElectionOfficial `json:"electionOfficials,omitempty"` + + // ElectionRegistrationConfirmationUrl: A URL provided by this + // administrative body for confirming that the voter is registered to + // vote. + ElectionRegistrationConfirmationUrl string `json:"electionRegistrationConfirmationUrl,omitempty"` + + // ElectionRegistrationUrl: A URL provided by this administrative body + // for looking up how to register to vote. + ElectionRegistrationUrl string `json:"electionRegistrationUrl,omitempty"` + + // ElectionRulesUrl: A URL provided by this administrative body + // describing election rules to the voter. + ElectionRulesUrl string `json:"electionRulesUrl,omitempty"` + + // HoursOfOperation: A description of the hours of operation for this + // administrative body. + HoursOfOperation string `json:"hoursOfOperation,omitempty"` + + // Name: The name of this election administrative body. + Name string `json:"name,omitempty"` + + // PhysicalAddress: The physical address of this administrative body. + PhysicalAddress *SimpleAddressType `json:"physicalAddress,omitempty"` + + // Voter_services: A description of the services this administrative + // body may provide. + Voter_services []string `json:"voter_services,omitempty"` + + // VotingLocationFinderUrl: A URL provided by this administrative body + // for looking up where to vote. + VotingLocationFinderUrl string `json:"votingLocationFinderUrl,omitempty"` +} + +type Candidate struct { + // CandidateUrl: The URL for the candidate's campaign web site. + CandidateUrl string `json:"candidateUrl,omitempty"` + + // Channels: A list of known (social) media channels for this candidate. + Channels []*Channel `json:"channels,omitempty"` + + // Email: The email address for the candidate's campaign. + Email string `json:"email,omitempty"` + + // Name: The candidate's name. + Name string `json:"name,omitempty"` + + // OrderOnBallot: The order the candidate appears on the ballot for this + // contest. + OrderOnBallot int64 `json:"orderOnBallot,omitempty,string"` + + // Party: The full name of the party the candidate is a member of. + Party string `json:"party,omitempty"` + + // Phone: The voice phone number for the candidate's campaign office. + Phone string `json:"phone,omitempty"` + + // PhotoUrl: A URL for a photo of the candidate. + PhotoUrl string `json:"photoUrl,omitempty"` +} + +type Channel struct { + // Id: The unique public identifier for the candidate's channel. + Id string `json:"id,omitempty"` + + // Type: The type of channel. The following is a list of types of + // channels, but is not exhaustive. More channel types may be added at a + // later time. One of: GooglePlus, YouTube, Facebook, Twitter + Type string `json:"type,omitempty"` +} + +type Contest struct { + // BallotPlacement: A number specifying the position of this contest on + // the voter's ballot. + BallotPlacement int64 `json:"ballotPlacement,omitempty,string"` + + // Candidates: The candidate choices for this contest. + Candidates []*Candidate `json:"candidates,omitempty"` + + // District: Information about the electoral district that this contest + // is in. + District *ElectoralDistrict `json:"district,omitempty"` + + // ElectorateSpecifications: A description of any additional eligibility + // requirements for voting in this contest. + ElectorateSpecifications string `json:"electorateSpecifications,omitempty"` + + // Id: An ID for this object. IDs may change in future requests and + // should not be cached. Access to this field requires special access + // that can be requested from the Request more link on the Quotas page. + Id string `json:"id,omitempty"` + + // Level: The level of office for this contest. One of: federal, state, + // county, city, other + Level string `json:"level,omitempty"` + + // NumberElected: The number of candidates that will be elected to + // office in this contest. + NumberElected int64 `json:"numberElected,omitempty,string"` + + // NumberVotingFor: The number of candidates that a voter may vote for + // in this contest. + NumberVotingFor int64 `json:"numberVotingFor,omitempty,string"` + + // Office: The name of the office for this contest. + Office string `json:"office,omitempty"` + + // PrimaryParty: If this is a partisan election, the name of the party + // it is for. + PrimaryParty string `json:"primaryParty,omitempty"` + + // ReferendumSubtitle: A brief description of the referendum. This field + // is only populated for contests of type 'Referendum'. + ReferendumSubtitle string `json:"referendumSubtitle,omitempty"` + + // ReferendumTitle: The title of the referendum (e.g. 'Proposition 42'). + // This field is only populated for contests of type 'Referendum'. + ReferendumTitle string `json:"referendumTitle,omitempty"` + + // ReferendumUrl: A link to the referendum. This field is only populated + // for contests of type 'Referendum'. + ReferendumUrl string `json:"referendumUrl,omitempty"` + + // Sources: A list of sources for this contest. If multiple sources are + // listed, the data has been aggregated from those sources. + Sources []*Source `json:"sources,omitempty"` + + // Special: "Yes" or "No" depending on whether this a contest being held + // outside the normal election cycle. + Special string `json:"special,omitempty"` + + // Type: The type of contest. Usually this will be 'General', 'Primary', + // or 'Run-off' for contests with candidates. For referenda this will be + // 'Referendum'. + Type string `json:"type,omitempty"` +} + +type DivisionSearchResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "civicinfo#divisionSearchResponse". + Kind string `json:"kind,omitempty"` + + Results []*DivisionSearchResult `json:"results,omitempty"` + + // Status: The result of the request. One of: success, + // addressUnparseable, noAddressParameter, internalLookupFailure + Status string `json:"status,omitempty"` +} + +type DivisionSearchResult struct { + // Name: The name of the division. + Name string `json:"name,omitempty"` + + // OcdId: The unique Open Civic Data identifier for this division. + OcdId string `json:"ocdId,omitempty"` +} + +type Election struct { + // ElectionDay: Day of the election in YYYY-MM-DD format. + ElectionDay string `json:"electionDay,omitempty"` + + // Id: The unique ID of this election. + Id int64 `json:"id,omitempty,string"` + + // Name: A displayable name for the election. + Name string `json:"name,omitempty"` +} + +type ElectionOfficial struct { + // EmailAddress: The email address of the election official. + EmailAddress string `json:"emailAddress,omitempty"` + + // FaxNumber: The fax number of the election official. + FaxNumber string `json:"faxNumber,omitempty"` + + // Name: The full name of the election official. + Name string `json:"name,omitempty"` + + // OfficePhoneNumber: The office phone number of the election official. + OfficePhoneNumber string `json:"officePhoneNumber,omitempty"` + + // Title: The title of the election official. + Title string `json:"title,omitempty"` +} + +type ElectionsQueryResponse struct { + // Elections: A list of available elections + Elections []*Election `json:"elections,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "civicinfo#electionsQueryResponse". + Kind string `json:"kind,omitempty"` +} + +type ElectoralDistrict struct { + // Id: An identifier for this district, relative to its scope. For + // example, the 34th State Senate district would have id "34" and a + // scope of stateUpper. + Id string `json:"id,omitempty"` + + // Name: The name of the district. + Name string `json:"name,omitempty"` + + // Scope: The geographic scope of this district. If unspecified the + // district's geography is not known. One of: national, statewide, + // congressional, stateUpper, stateLower, countywide, judicial, + // schoolBoard, cityWide, township, countyCouncil, cityCouncil, ward, + // special + Scope string `json:"scope,omitempty"` +} + +type GeographicDivision struct { + // Name: The name of the division. + Name string `json:"name,omitempty"` + + // OfficeIds: List of keys in the offices object, one for each office + // elected from this division. Will only be present if includeOffices + // was true (or absent) in the request. + OfficeIds []string `json:"officeIds,omitempty"` + + // Scope: The geographic scope of the division. If unspecified, the + // division's geography is not known. One of: national, statewide, + // congressional, stateUpper, stateLower, countywide, judicial, + // schoolBoard, cityWide, township, countyCouncil, cityCouncil, ward, + // special + Scope string `json:"scope,omitempty"` +} + +type Office struct { + // Level: The level of this elected office. One of: federal, state, + // county, city, other + Level string `json:"level,omitempty"` + + // Name: The human-readable name of the office. + Name string `json:"name,omitempty"` + + // OfficialIds: List of people who presently hold the office. + OfficialIds []string `json:"officialIds,omitempty"` + + // Sources: A list of sources for this office. If multiple sources are + // listed, the data has been aggregated from those sources. + Sources []*Source `json:"sources,omitempty"` +} + +type Official struct { + // Address: Addresses at which to contact the official. + Address []*SimpleAddressType `json:"address,omitempty"` + + // Channels: A list of known (social) media channels for this official. + Channels []*Channel `json:"channels,omitempty"` + + // Emails: The direct email addresses for the official. + Emails []string `json:"emails,omitempty"` + + // Name: The official's name. + Name string `json:"name,omitempty"` + + // Party: The full name of the party the official belongs to. + Party string `json:"party,omitempty"` + + // Phones: The official's public contact phone numbers. + Phones []string `json:"phones,omitempty"` + + // PhotoUrl: A URL for a photo of the official. + PhotoUrl string `json:"photoUrl,omitempty"` + + // Urls: The official's public website URLs. + Urls []string `json:"urls,omitempty"` +} + +type PollingLocation struct { + // Address: The address of the location + Address *SimpleAddressType `json:"address,omitempty"` + + // EndDate: The last date that this early vote site may be used. This + // field is not populated for polling locations. + EndDate string `json:"endDate,omitempty"` + + // Id: An ID for this object. IDs may change in future requests and + // should not be cached. Access to this field requires special access + // that can be requested from the Request more link on the Quotas page. + Id string `json:"id,omitempty"` + + // Name: The name of the early vote site. This field is not populated + // for polling locations. + Name string `json:"name,omitempty"` + + // Notes: Notes about this location (e.g. accessibility ramp or entrance + // to use) + Notes string `json:"notes,omitempty"` + + // PollingHours: A description of when this location is open. + PollingHours string `json:"pollingHours,omitempty"` + + // Sources: A list of sources for this location. If multiple sources are + // listed the data has been aggregated from those sources. + Sources []*Source `json:"sources,omitempty"` + + // StartDate: The first date that this early vote site may be used. This + // field is not populated for polling locations. + StartDate string `json:"startDate,omitempty"` + + // VoterServices: The services provided by this early vote site. This + // field is not populated for polling locations. + VoterServices string `json:"voterServices,omitempty"` +} + +type RepresentativeInfoRequest struct { + // Address: The address to look up. May only be specified if the field + // ocdId is not given in the URL. + Address string `json:"address,omitempty"` +} + +type RepresentativeInfoResponse struct { + // Divisions: Political geographic divisions that contain the requested + // address. + Divisions *RepresentativeInfoResponseDivisions `json:"divisions,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "civicinfo#representativeInfoResponse". + Kind string `json:"kind,omitempty"` + + // NormalizedInput: The normalized version of the requested address + NormalizedInput *SimpleAddressType `json:"normalizedInput,omitempty"` + + // Offices: Elected offices referenced by the divisions listed above. + // Will only be present if includeOffices was true in the request. + Offices *RepresentativeInfoResponseOffices `json:"offices,omitempty"` + + // Officials: Officials holding the offices listed above. Will only be + // present if includeOffices was true in the request. + Officials *RepresentativeInfoResponseOfficials `json:"officials,omitempty"` + + // Status: The result of the request. One of: success, + // noStreetSegmentFound, addressUnparseable, noAddressParameter, + // multipleStreetSegmentsFound, electionOver, electionUnknown, + // internalLookupFailure, RequestedBothAddressAndOcdId + Status string `json:"status,omitempty"` +} + +type RepresentativeInfoResponseDivisions struct { +} + +type RepresentativeInfoResponseOffices struct { +} + +type RepresentativeInfoResponseOfficials struct { +} + +type SimpleAddressType struct { + // City: The city or town for the address. + City string `json:"city,omitempty"` + + // Line1: The street name and number of this address. + Line1 string `json:"line1,omitempty"` + + // Line2: The second line the address, if needed. + Line2 string `json:"line2,omitempty"` + + // Line3: The third line of the address, if needed. + Line3 string `json:"line3,omitempty"` + + // LocationName: The name of the location. + LocationName string `json:"locationName,omitempty"` + + // State: The US two letter state abbreviation of the address. + State string `json:"state,omitempty"` + + // Zip: The US Postal Zip Code of the address. + Zip string `json:"zip,omitempty"` +} + +type Source struct { + // Name: The name of the data source. + Name string `json:"name,omitempty"` + + // Official: Whether this data comes from an official government source. + Official bool `json:"official,omitempty"` +} + +type VoterInfoRequest struct { + // Address: The registered address of the voter to look up. + Address string `json:"address,omitempty"` +} + +type VoterInfoResponse struct { + // Contests: Contests that will appear on the voter's ballot + Contests []*Contest `json:"contests,omitempty"` + + // EarlyVoteSites: Locations where the voter is eligible to vote early, + // prior to election day + EarlyVoteSites []*PollingLocation `json:"earlyVoteSites,omitempty"` + + // Election: The election that was queried. + Election *Election `json:"election,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "civicinfo#voterInfoResponse". + Kind string `json:"kind,omitempty"` + + // NormalizedInput: The normalized version of the requested address + NormalizedInput *SimpleAddressType `json:"normalizedInput,omitempty"` + + // PollingLocations: Locations where the voter is eligible to vote on + // election day. For states with mail-in voting only, these locations + // will be nearby drop box locations. Drop box locations are free to the + // voter and may be used instead of placing the ballot in the mail. + PollingLocations []*PollingLocation `json:"pollingLocations,omitempty"` + + // State: Local Election Information for the state that the voter votes + // in. For the US, there will only be one element in this array. + State []*AdministrationRegion `json:"state,omitempty"` + + // Status: The result of the request. One of: success, + // noStreetSegmentFound, addressUnparseable, noAddressParameter, + // multipleStreetSegmentsFound, electionOver, electionUnknown, + // internalLookupFailure + Status string `json:"status,omitempty"` +} + +// method id "civicinfo.divisions.search": + +type DivisionsSearchCall struct { + s *Service + opt_ map[string]interface{} +} + +// Search: Searches for political divisions by their natural name or OCD +// ID. +func (r *DivisionsService) Search() *DivisionsSearchCall { + c := &DivisionsSearchCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Query sets the optional parameter "query": The search query. Queries +// can cover any parts of a OCD ID or a human readable division name. +// All words given in the query are treated as required patterns. In +// addition to that, most query operators of the Apache Lucene library +// are supported. See +// http://lucene.apache.org/core/2_9_4/queryparsersyntax.html +func (c *DivisionsSearchCall) Query(query string) *DivisionsSearchCall { + c.opt_["query"] = query + return c +} + +func (c *DivisionsSearchCall) Do() (*DivisionSearchResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["query"]; ok { + params.Set("query", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "representatives/division_search") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DivisionSearchResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Searches for political divisions by their natural name or OCD ID.", + // "httpMethod": "GET", + // "id": "civicinfo.divisions.search", + // "parameters": { + // "query": { + // "description": "The search query. Queries can cover any parts of a OCD ID or a human readable division name. All words given in the query are treated as required patterns. In addition to that, most query operators of the Apache Lucene library are supported. See http://lucene.apache.org/core/2_9_4/queryparsersyntax.html", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "representatives/division_search", + // "response": { + // "$ref": "DivisionSearchResponse" + // } + // } + +} + +// method id "civicinfo.elections.electionQuery": + +type ElectionsElectionQueryCall struct { + s *Service + opt_ map[string]interface{} +} + +// ElectionQuery: List of available elections to query. +func (r *ElectionsService) ElectionQuery() *ElectionsElectionQueryCall { + c := &ElectionsElectionQueryCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *ElectionsElectionQueryCall) Do() (*ElectionsQueryResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "elections") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ElectionsQueryResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List of available elections to query.", + // "httpMethod": "GET", + // "id": "civicinfo.elections.electionQuery", + // "path": "elections", + // "response": { + // "$ref": "ElectionsQueryResponse" + // } + // } + +} + +// method id "civicinfo.elections.voterInfoQuery": + +type ElectionsVoterInfoQueryCall struct { + s *Service + electionId int64 + voterinforequest *VoterInfoRequest + opt_ map[string]interface{} +} + +// VoterInfoQuery: Looks up information relevant to a voter based on the +// voter's registered address. +func (r *ElectionsService) VoterInfoQuery(electionId int64, voterinforequest *VoterInfoRequest) *ElectionsVoterInfoQueryCall { + c := &ElectionsVoterInfoQueryCall{s: r.s, opt_: make(map[string]interface{})} + c.electionId = electionId + c.voterinforequest = voterinforequest + return c +} + +// OfficialOnly sets the optional parameter "officialOnly": If set to +// true, only data from official state sources will be returned. +func (c *ElectionsVoterInfoQueryCall) OfficialOnly(officialOnly bool) *ElectionsVoterInfoQueryCall { + c.opt_["officialOnly"] = officialOnly + return c +} + +func (c *ElectionsVoterInfoQueryCall) Do() (*VoterInfoResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.voterinforequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["officialOnly"]; ok { + params.Set("officialOnly", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "voterinfo/{electionId}/lookup") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{electionId}", strconv.FormatInt(c.electionId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(VoterInfoResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Looks up information relevant to a voter based on the voter's registered address.", + // "httpMethod": "POST", + // "id": "civicinfo.elections.voterInfoQuery", + // "parameterOrder": [ + // "electionId" + // ], + // "parameters": { + // "electionId": { + // "description": "The unique ID of the election to look up. A list of election IDs can be obtained at https://www.googleapis.com/civicinfo/{version}/elections", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "officialOnly": { + // "default": "false", + // "description": "If set to true, only data from official state sources will be returned.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "voterinfo/{electionId}/lookup", + // "request": { + // "$ref": "VoterInfoRequest" + // }, + // "response": { + // "$ref": "VoterInfoResponse" + // } + // } + +} + +// method id "civicinfo.representatives.representativeInfoQuery": + +type RepresentativesRepresentativeInfoQueryCall struct { + s *Service + representativeinforequest *RepresentativeInfoRequest + opt_ map[string]interface{} +} + +// RepresentativeInfoQuery: Looks up political geography and +// (optionally) representative information based on an address. +func (r *RepresentativesService) RepresentativeInfoQuery(representativeinforequest *RepresentativeInfoRequest) *RepresentativesRepresentativeInfoQueryCall { + c := &RepresentativesRepresentativeInfoQueryCall{s: r.s, opt_: make(map[string]interface{})} + c.representativeinforequest = representativeinforequest + return c +} + +// IncludeOffices sets the optional parameter "includeOffices": Whether +// to return information about offices and officials. If false, only the +// top-level district information will be returned. +func (c *RepresentativesRepresentativeInfoQueryCall) IncludeOffices(includeOffices bool) *RepresentativesRepresentativeInfoQueryCall { + c.opt_["includeOffices"] = includeOffices + return c +} + +// OcdId sets the optional parameter "ocdId": The division to look up. +// May only be specified if the address field is not given in the +// request body. +func (c *RepresentativesRepresentativeInfoQueryCall) OcdId(ocdId string) *RepresentativesRepresentativeInfoQueryCall { + c.opt_["ocdId"] = ocdId + return c +} + +func (c *RepresentativesRepresentativeInfoQueryCall) Do() (*RepresentativeInfoResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.representativeinforequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeOffices"]; ok { + params.Set("includeOffices", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ocdId"]; ok { + params.Set("ocdId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "representatives/lookup") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RepresentativeInfoResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Looks up political geography and (optionally) representative information based on an address.", + // "httpMethod": "POST", + // "id": "civicinfo.representatives.representativeInfoQuery", + // "parameters": { + // "includeOffices": { + // "default": "true", + // "description": "Whether to return information about offices and officials. If false, only the top-level district information will be returned.", + // "location": "query", + // "type": "boolean" + // }, + // "ocdId": { + // "description": "The division to look up. May only be specified if the address field is not given in the request body.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "representatives/lookup", + // "request": { + // "$ref": "RepresentativeInfoRequest" + // }, + // "response": { + // "$ref": "RepresentativeInfoResponse" + // } + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/compute/v1/compute-api.json b/third_party/src/code.google.com/p/google-api-go-client/compute/v1/compute-api.json new file mode 100644 index 0000000000000..1e18b60362c0f --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/compute/v1/compute-api.json @@ -0,0 +1,9129 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"C11OM5Qtr9122-scy_WeqND9D3o/qLGD1lW3Gg5l2ZgG6H6aby7D0Xw\"", + "discoveryVersion": "v1", + "id": "compute:v1", + "name": "compute", + "version": "v1", + "title": "Compute Engine API", + "description": "API for the Google Compute Engine service.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "http://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://developers.google.com/compute/docs/reference/latest/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/compute/v1/projects/", + "basePath": "/compute/v1/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "compute/v1/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/compute": { + "description": "View and manage your Google Compute Engine resources" + }, + "https://www.googleapis.com/auth/compute.readonly": { + "description": "View your Google Compute Engine resources" + }, + "https://www.googleapis.com/auth/devstorage.full_control": { + "description": "Manage your data and permissions in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" + } + } + } + }, + "schemas": { + "AccessConfig": { + "id": "AccessConfig", + "type": "object", + "description": "An access configuration attached to an instance's network interface.", + "properties": { + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#accessConfig" + }, + "name": { + "type": "string", + "description": "Name of this access configuration." + }, + "natIP": { + "type": "string", + "description": "An external IP address associated with this instance. Specify an unused static IP address available to the project. If not specified, the external IP will be drawn from a shared ephemeral pool." + }, + "type": { + "type": "string", + "description": "Type of configuration. Must be set to \"ONE_TO_ONE_NAT\". This configures port-for-port NAT to the internet.", + "default": "ONE_TO_ONE_NAT", + "enum": [ + "ONE_TO_ONE_NAT" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "Address": { + "id": "Address", + "type": "object", + "description": "A reserved address resource.", + "properties": { + "address": { + "type": "string", + "description": "The IP address represented by this resource." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#address" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.addresses.insert" + ] + } + }, + "region": { + "type": "string", + "description": "URL of the region where the regional address resides (output only). This field is not applicable to global addresses." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "status": { + "type": "string", + "description": "The status of the address (output only).", + "enum": [ + "IN_USE", + "RESERVED" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "users": { + "type": "array", + "description": "The resources that are using this address resource.", + "items": { + "type": "string" + } + } + } + }, + "AddressAggregatedList": { + "id": "AddressAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped address lists.", + "additionalProperties": { + "$ref": "AddressesScopedList", + "description": "Name of the scope containing this set of addresses." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#addressAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "AddressList": { + "id": "AddressList", + "type": "object", + "description": "Contains a list of address resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The address resources.", + "items": { + "$ref": "Address" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#addressList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "AddressesScopedList": { + "id": "AddressesScopedList", + "type": "object", + "properties": { + "addresses": { + "type": "array", + "description": "List of addresses contained in this scope.", + "items": { + "$ref": "Address" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of addresses when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "AttachedDisk": { + "id": "AttachedDisk", + "type": "object", + "description": "An instance-attached disk resource.", + "properties": { + "autoDelete": { + "type": "boolean", + "description": "Whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance)." + }, + "boot": { + "type": "boolean", + "description": "Indicates that this is a boot disk. VM will use the first partition of the disk for its root filesystem." + }, + "deviceName": { + "type": "string", + "description": "Persistent disk only; must be unique within the instance when specified. This represents a unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. If not specified, a default will be chosen by the system." + }, + "index": { + "type": "integer", + "description": "A zero-based index to assign to this disk, where 0 is reserved for the boot disk. If not specified, the server will choose an appropriate value (output only).", + "format": "int32" + }, + "initializeParams": { + "$ref": "AttachedDiskInitializeParams", + "description": "Initialization parameters." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#attachedDisk" + }, + "mode": { + "type": "string", + "description": "The mode in which to attach this disk, either \"READ_WRITE\" or \"READ_ONLY\".", + "enum": [ + "READ_ONLY", + "READ_WRITE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "source": { + "type": "string", + "description": "Persistent disk only; the URL of the persistent disk resource." + }, + "type": { + "type": "string", + "description": "Type of the disk, either \"SCRATCH\" or \"PERSISTENT\". Note that persistent disks must be created before you can specify them here.", + "enum": [ + "PERSISTENT", + "SCRATCH" + ], + "enumDescriptions": [ + "", + "" + ], + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + } + } + }, + "AttachedDiskInitializeParams": { + "id": "AttachedDiskInitializeParams", + "type": "object", + "description": "Initialization parameters for the new disk (Mutually exclusive with 'source', can currently only be specified on the boot disk).", + "properties": { + "diskName": { + "type": "string", + "description": "Name of the disk (when not provided defaults to the name of the instance)." + }, + "diskSizeGb": { + "type": "string", + "description": "Size of the disk in base-2 GB.", + "format": "int64" + }, + "diskType": { + "type": "string", + "description": "URL of the disk type resource describing which disk type to use to create the disk; provided by the client when the disk is created." + }, + "sourceImage": { + "type": "string", + "description": "The source image used to create this disk." + } + } + }, + "Backend": { + "id": "Backend", + "type": "object", + "description": "Message containing information of one individual backend.", + "properties": { + "balancingMode": { + "type": "string", + "description": "The balancing mode of this backend, default is UTILIZATION.", + "enum": [ + "RATE", + "UTILIZATION" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "capacityScaler": { + "type": "number", + "description": "The multiplier (a value between 0 and 1e6) of the max capacity (CPU or RPS, depending on 'balancingMode') the group should serve up to. 0 means the group is totally drained. Default value is 1. Valid range is [0, 1e6].", + "format": "float" + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource, which is provided by the client when the resource is created." + }, + "group": { + "type": "string", + "description": "URL of a zonal Cloud Resource View resource. This resoure view defines the list of instances that serve traffic. Member virtual machine instances from each resource view must live in the same zone as the resource view itself." + }, + "maxRate": { + "type": "integer", + "description": "The max RPS of the group. Can be used with either balancing mode, but required if RATE mode. For RATE mode, either maxRate or maxRatePerInstance must be set.", + "format": "int32" + }, + "maxRatePerInstance": { + "type": "number", + "description": "The max RPS that a single backed instance can handle. This is used to calculate the capacity of the group. Can be used in either balancing mode. For RATE mode, either maxRate or maxRatePerInstance must be set.", + "format": "float" + }, + "maxUtilization": { + "type": "number", + "description": "Used when 'balancingMode' is UTILIZATION. This ratio defines the CPU utilization target for the group. The default is 0.8. Valid range is [0, 1].", + "format": "float" + } + } + }, + "BackendService": { + "id": "BackendService", + "type": "object", + "description": "A BackendService resource. This resource defines a group of backend VMs together with their serving capacity.", + "properties": { + "backends": { + "type": "array", + "description": "The list of backends that serve this BackendService.", + "items": { + "$ref": "Backend" + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "fingerprint": { + "type": "string", + "description": "Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a BackendService. An up-to-date fingerprint must be provided in order to update the BackendService.", + "format": "byte" + }, + "healthChecks": { + "type": "array", + "description": "The list of URLs to the HttpHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified, and a health check is required.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#backendService" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "port": { + "type": "integer", + "description": "The TCP port to connect on the backend. The default value is 80.", + "format": "int32" + }, + "protocol": { + "type": "string", + "enum": [ + "HTTP" + ], + "enumDescriptions": [ + "" + ] + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "timeoutSec": { + "type": "integer", + "description": "How many seconds to wait for the backend before considering it a failed request. Default is 30 seconds.", + "format": "int32" + } + } + }, + "BackendServiceGroupHealth": { + "id": "BackendServiceGroupHealth", + "type": "object", + "properties": { + "healthStatus": { + "type": "array", + "items": { + "$ref": "HealthStatus" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#backendServiceGroupHealth" + } + } + }, + "BackendServiceList": { + "id": "BackendServiceList", + "type": "object", + "description": "Contains a list of BackendService resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The BackendService resources.", + "items": { + "$ref": "BackendService" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#backendServiceList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "DeprecationStatus": { + "id": "DeprecationStatus", + "type": "object", + "description": "Deprecation status for a public resource.", + "properties": { + "deleted": { + "type": "string", + "description": "An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to DELETED." + }, + "deprecated": { + "type": "string", + "description": "An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to DEPRECATED." + }, + "obsolete": { + "type": "string", + "description": "An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to OBSOLETE." + }, + "replacement": { + "type": "string", + "description": "A URL of the suggested replacement for the deprecated resource. The deprecated resource and its replacement must be resources of the same kind." + }, + "state": { + "type": "string", + "description": "The deprecation state. Can be \"DEPRECATED\", \"OBSOLETE\", or \"DELETED\". Operations which create a new resource using a \"DEPRECATED\" resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. New uses of \"OBSOLETE\" or \"DELETED\" resources will result in an error.", + "enum": [ + "DELETED", + "DEPRECATED", + "OBSOLETE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "Disk": { + "id": "Disk", + "type": "object", + "description": "A persistent disk resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#disk" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.disks.insert" + ] + } + }, + "options": { + "type": "string", + "description": "Internal use only." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sizeGb": { + "type": "string", + "description": "Size of the persistent disk, specified in GB. This parameter is optional when creating a disk from a disk image or a snapshot, otherwise it is required.", + "format": "int64" + }, + "sourceImage": { + "type": "string", + "description": "The source image used to create this disk. Once the source image has been deleted from the system, this field will not be set, even if an image with the same name has been re-created." + }, + "sourceImageId": { + "type": "string", + "description": "The 'id' value of the image used to create this disk. This value may be used to determine whether the disk was created from the current or a previous instance of a given image." + }, + "sourceSnapshot": { + "type": "string", + "description": "The source snapshot used to create this disk. Once the source snapshot has been deleted from the system, this field will be cleared, and will not be set even if a snapshot with the same name has been re-created." + }, + "sourceSnapshotId": { + "type": "string", + "description": "The 'id' value of the snapshot used to create this disk. This value may be used to determine whether the disk was created from the current or a previous instance of a given disk snapshot." + }, + "status": { + "type": "string", + "description": "The status of disk creation (output only).", + "enum": [ + "CREATING", + "FAILED", + "READY", + "RESTORING" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "type": { + "type": "string", + "description": "URL of the disk type resource describing which disk type to use to create the disk; provided by the client when the disk is created." + }, + "zone": { + "type": "string", + "description": "URL of the zone where the disk resides (output only)." + } + } + }, + "DiskAggregatedList": { + "id": "DiskAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped disk lists.", + "additionalProperties": { + "$ref": "DisksScopedList", + "description": "Name of the scope containing this set of disks." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#diskAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "DiskList": { + "id": "DiskList", + "type": "object", + "description": "Contains a list of persistent disk resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The persistent disk resources.", + "items": { + "$ref": "Disk" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#diskList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "DiskType": { + "id": "DiskType", + "type": "object", + "description": "A disk type resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this disk type." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#diskType" + }, + "name": { + "type": "string", + "description": "Name of the resource.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "validDiskSize": { + "type": "string", + "description": "An optional textual descroption of the valid disk size, e.g., \"10GB-10TB\"." + }, + "zone": { + "type": "string", + "description": "Url of the zone where the disk type resides (output only)." + } + } + }, + "DiskTypeAggregatedList": { + "id": "DiskTypeAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped disk type lists.", + "additionalProperties": { + "$ref": "DiskTypesScopedList", + "description": "Name of the scope containing this set of disk types." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#diskTypeAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "DiskTypeList": { + "id": "DiskTypeList", + "type": "object", + "description": "Contains a list of disk type resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The disk type resources.", + "items": { + "$ref": "DiskType" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#diskTypeList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "DiskTypesScopedList": { + "id": "DiskTypesScopedList", + "type": "object", + "properties": { + "diskTypes": { + "type": "array", + "description": "List of disk types contained in this scope.", + "items": { + "$ref": "DiskType" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of disk types when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "DisksScopedList": { + "id": "DisksScopedList", + "type": "object", + "properties": { + "disks": { + "type": "array", + "description": "List of disks contained in this scope.", + "items": { + "$ref": "Disk" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of disks when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "Firewall": { + "id": "Firewall", + "type": "object", + "description": "A firewall resource.", + "properties": { + "allowed": { + "type": "array", + "description": "The list of rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection.", + "items": { + "type": "object", + "properties": { + "IPProtocol": { + "type": "string", + "description": "Required; this is the IP protocol that is allowed for this rule. This can either be one of the following well known protocol strings [\"tcp\", \"udp\", \"icmp\", \"esp\", \"ah\", \"sctp\"], or the IP protocol number." + }, + "ports": { + "type": "array", + "description": "An optional list of ports which are allowed. It is an error to specify this for any protocol that isn't UDP or TCP. Each entry must be either an integer or a range. If not specified, connections through any port are allowed.\n\nExample inputs include: [\"22\"], [\"80\",\"443\"] and [\"12345-12349\"].", + "items": { + "type": "string" + } + } + } + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#firewall" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.firewalls.insert", + "compute.firewalls.patch" + ] + } + }, + "network": { + "type": "string", + "description": "URL of the network to which this firewall is applied; provided by the client when the firewall is created.", + "annotations": { + "required": [ + "compute.firewalls.insert", + "compute.firewalls.patch" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sourceRanges": { + "type": "array", + "description": "A list of IP address blocks expressed in CIDR format which this rule applies to. One or both of sourceRanges and sourceTags may be set; an inbound connection is allowed if either the range or the tag of the source matches.", + "items": { + "type": "string" + } + }, + "sourceTags": { + "type": "array", + "description": "A list of instance tags which this rule applies to. One or both of sourceRanges and sourceTags may be set; an inbound connection is allowed if either the range or the tag of the source matches.", + "items": { + "type": "string" + } + }, + "targetTags": { + "type": "array", + "description": "A list of instance tags indicating sets of instances located on network which may make network connections as specified in allowed. If no targetTags are specified, the firewall rule applies to all instances on the specified network.", + "items": { + "type": "string" + } + } + } + }, + "FirewallList": { + "id": "FirewallList", + "type": "object", + "description": "Contains a list of firewall resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The firewall resources.", + "items": { + "$ref": "Firewall" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#firewallList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "ForwardingRule": { + "id": "ForwardingRule", + "type": "object", + "description": "A ForwardingRule resource. A ForwardingRule resource specifies which pool of target VMs to forward a packet to if it matches the given [IPAddress, IPProtocol, portRange] tuple.", + "properties": { + "IPAddress": { + "type": "string", + "description": "Value of the reserved IP address that this forwarding rule is serving on behalf of. For global forwarding rules, the address must be a global IP; for regional forwarding rules, the address must live in the same region as the forwarding rule. If left empty (default value), an ephemeral IP from the same scope (global or regional) will be assigned." + }, + "IPProtocol": { + "type": "string", + "description": "The IP protocol to which this rule applies, valid options are 'TCP', 'UDP', 'ESP', 'AH' or 'SCTP'", + "enum": [ + "AH", + "ESP", + "SCTP", + "TCP", + "UDP" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#forwardingRule" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "portRange": { + "type": "string", + "description": "Applicable only when 'IPProtocol' is 'TCP', 'UDP' or 'SCTP', only packets addressed to ports in the specified range will be forwarded to 'target'. If 'portRange' is left empty (default value), all ports are forwarded. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges. @pattern: \\d+(?:-\\d+)?" + }, + "region": { + "type": "string", + "description": "URL of the region where the regional forwarding rule resides (output only). This field is not applicable to global forwarding rules." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "target": { + "type": "string", + "description": "The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must live in the same region as the forwarding rule. For global forwarding rules, this target must be a global TargetHttpProxy resource." + } + } + }, + "ForwardingRuleAggregatedList": { + "id": "ForwardingRuleAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped forwarding rule lists.", + "additionalProperties": { + "$ref": "ForwardingRulesScopedList", + "description": "Name of the scope containing this set of addresses." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#forwardingRuleAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "ForwardingRuleList": { + "id": "ForwardingRuleList", + "type": "object", + "description": "Contains a list of ForwardingRule resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The ForwardingRule resources.", + "items": { + "$ref": "ForwardingRule" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#forwardingRuleList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "ForwardingRulesScopedList": { + "id": "ForwardingRulesScopedList", + "type": "object", + "properties": { + "forwardingRules": { + "type": "array", + "description": "List of forwarding rules contained in this scope.", + "items": { + "$ref": "ForwardingRule" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of forwarding rules when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "HealthCheckReference": { + "id": "HealthCheckReference", + "type": "object", + "properties": { + "healthCheck": { + "type": "string" + } + } + }, + "HealthStatus": { + "id": "HealthStatus", + "type": "object", + "properties": { + "healthState": { + "type": "string", + "description": "Health state of the instance.", + "enum": [ + "HEALTHY", + "UNHEALTHY" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "instance": { + "type": "string", + "description": "URL of the instance resource." + }, + "ipAddress": { + "type": "string", + "description": "The IP address represented by this resource." + } + } + }, + "HostRule": { + "id": "HostRule", + "type": "object", + "description": "A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService.", + "properties": { + "description": { + "type": "string" + }, + "hosts": { + "type": "array", + "description": "The list of host patterns to match. They must be FQDN except that it may start with ?*.? or ?*-?. The ?*? acts like a glob and will match any string of atoms (separated by .?s and -?s) to the left.", + "items": { + "type": "string" + } + }, + "pathMatcher": { + "type": "string", + "description": "The name of the PathMatcher to match the path portion of the URL, if the this HostRule matches the URL's host portion." + } + } + }, + "HttpHealthCheck": { + "id": "HttpHealthCheck", + "type": "object", + "description": "An HttpHealthCheck resource. This resource defines a template for how individual VMs should be checked for health, via HTTP.", + "properties": { + "checkIntervalSec": { + "type": "integer", + "description": "How often (in seconds) to send a health check. The default value is 5 seconds.", + "format": "int32" + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "healthyThreshold": { + "type": "integer", + "description": "A so-far unhealthy VM will be marked healthy after this many consecutive successes. The default value is 2.", + "format": "int32" + }, + "host": { + "type": "string", + "description": "The value of the host header in the HTTP health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#httpHealthCheck" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "port": { + "type": "integer", + "description": "The TCP port number for the HTTP health check request. The default value is 80.", + "format": "int32" + }, + "requestPath": { + "type": "string", + "description": "The request path of the HTTP health check request. The default value is \"/\"." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "timeoutSec": { + "type": "integer", + "description": "How long (in seconds) to wait before claiming failure. The default value is 5 seconds.", + "format": "int32" + }, + "unhealthyThreshold": { + "type": "integer", + "description": "A so-far healthy VM will be marked unhealthy after this many consecutive failures. The default value is 2.", + "format": "int32" + } + } + }, + "HttpHealthCheckList": { + "id": "HttpHealthCheckList", + "type": "object", + "description": "Contains a list of HttpHealthCheck resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The HttpHealthCheck resources.", + "items": { + "$ref": "HttpHealthCheck" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#httpHealthCheckList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Image": { + "id": "Image", + "type": "object", + "description": "A disk image resource.", + "properties": { + "archiveSizeBytes": { + "type": "string", + "description": "Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).", + "format": "int64" + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this image." + }, + "description": { + "type": "string", + "description": "Textual description of the resource; provided by the client when the resource is created." + }, + "diskSizeGb": { + "type": "string", + "description": "Size of the image when restored onto a disk (in GiB).", + "format": "int64" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#image" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + }, + "rawDisk": { + "type": "object", + "description": "The raw disk image parameters.", + "properties": { + "containerType": { + "type": "string", + "description": "The format used to encode and transmit the block device. Should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created.", + "enum": [ + "TAR" + ], + "enumDescriptions": [ + "" + ] + }, + "sha1Checksum": { + "type": "string", + "description": "An optional SHA1 checksum of the disk image before unpackaging; provided by the client when the disk image is created.", + "pattern": "[a-f0-9]{40}" + }, + "source": { + "type": "string", + "description": "The full Google Cloud Storage URL where the disk image is stored; provided by the client when the disk image is created.", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + } + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sourceType": { + "type": "string", + "description": "Must be \"RAW\"; provided by the client when the disk image is created.", + "default": "RAW", + "enum": [ + "RAW" + ], + "enumDescriptions": [ + "" + ] + }, + "status": { + "type": "string", + "description": "Status of the image (output only). It will be one of the following READY - after image has been successfully created and is ready for use FAILED - if creating the image fails for some reason PENDING - the image creation is in progress An image can be used to create other resources suck as instances only after the image has been successfully created and the status is set to READY.", + "enum": [ + "FAILED", + "PENDING", + "READY" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "ImageList": { + "id": "ImageList", + "type": "object", + "description": "Contains a list of disk image resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The disk image resources.", + "items": { + "$ref": "Image" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#imageList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Instance": { + "id": "Instance", + "type": "object", + "description": "An instance resource.", + "properties": { + "canIpForward": { + "type": "boolean", + "description": "Allows this instance to send packets with source IP addresses other than its own and receive packets with destination IP addresses other than its own. If this instance will be used as an IP gateway or it will be set as the next-hop in a Route resource, say true. If unsure, leave this set to false." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "disks": { + "type": "array", + "description": "Array of disks associated with this instance. Persistent disks must be created before you can assign them.", + "items": { + "$ref": "AttachedDisk" + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#instance" + }, + "machineType": { + "type": "string", + "description": "URL of the machine type resource describing which machine type to use to host the instance; provided by the client when the instance is created.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "metadata": { + "$ref": "Metadata", + "description": "Metadata key/value pairs assigned to this instance. Consists of custom metadata or predefined keys; see Instance documentation for more information." + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "networkInterfaces": { + "type": "array", + "description": "Array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.", + "items": { + "$ref": "NetworkInterface" + } + }, + "scheduling": { + "$ref": "Scheduling", + "description": "Scheduling options for this instance." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + }, + "serviceAccounts": { + "type": "array", + "description": "A list of service accounts each with specified scopes, for which access tokens are to be made available to the instance through metadata queries.", + "items": { + "$ref": "ServiceAccount" + } + }, + "status": { + "type": "string", + "description": "Instance status. One of the following values: \"PROVISIONING\", \"STAGING\", \"RUNNING\", \"STOPPING\", \"STOPPED\", \"TERMINATED\" (output only).", + "enum": [ + "PROVISIONING", + "RUNNING", + "STAGING", + "STOPPED", + "STOPPING", + "TERMINATED" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "statusMessage": { + "type": "string", + "description": "An optional, human-readable explanation of the status (output only)." + }, + "tags": { + "$ref": "Tags", + "description": "A list of tags to be applied to this instance. Used to identify valid sources or targets for network firewalls. Provided by the client on instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035." + }, + "zone": { + "type": "string", + "description": "URL of the zone where the instance resides (output only)." + } + } + }, + "InstanceAggregatedList": { + "id": "InstanceAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped instance lists.", + "additionalProperties": { + "$ref": "InstancesScopedList", + "description": "Name of the scope containing this set of instances." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#instanceAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "InstanceList": { + "id": "InstanceList", + "type": "object", + "description": "Contains a list of instance resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "A list of instance resources.", + "items": { + "$ref": "Instance" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#instanceList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "InstanceReference": { + "id": "InstanceReference", + "type": "object", + "properties": { + "instance": { + "type": "string" + } + } + }, + "InstancesScopedList": { + "id": "InstancesScopedList", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "List of instances contained in this scope.", + "items": { + "$ref": "Instance" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of instances when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "MachineType": { + "id": "MachineType", + "type": "object", + "description": "A machine type resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this machine type." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "guestCpus": { + "type": "integer", + "description": "Count of CPUs exposed to the instance.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "imageSpaceGb": { + "type": "integer", + "description": "Space allotted for the image, defined in GB.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#machineType" + }, + "maximumPersistentDisks": { + "type": "integer", + "description": "Maximum persistent disks allowed.", + "format": "int32" + }, + "maximumPersistentDisksSizeGb": { + "type": "string", + "description": "Maximum total persistent disks size (GB) allowed.", + "format": "int64" + }, + "memoryMb": { + "type": "integer", + "description": "Physical memory assigned to the instance, defined in MB.", + "format": "int32" + }, + "name": { + "type": "string", + "description": "Name of the resource.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "scratchDisks": { + "type": "array", + "description": "List of extended scratch disks assigned to the instance.", + "items": { + "type": "object", + "properties": { + "diskGb": { + "type": "integer", + "description": "Size of the scratch disk, defined in GB.", + "format": "int32" + } + } + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "zone": { + "type": "string", + "description": "Url of the zone where the machine type resides (output only)." + } + } + }, + "MachineTypeAggregatedList": { + "id": "MachineTypeAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped machine type lists.", + "additionalProperties": { + "$ref": "MachineTypesScopedList", + "description": "Name of the scope containing this set of machine types." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#machineTypeAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "MachineTypeList": { + "id": "MachineTypeList", + "type": "object", + "description": "Contains a list of machine type resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The machine type resources.", + "items": { + "$ref": "MachineType" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#machineTypeList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "MachineTypesScopedList": { + "id": "MachineTypesScopedList", + "type": "object", + "properties": { + "machineTypes": { + "type": "array", + "description": "List of machine types contained in this scope.", + "items": { + "$ref": "MachineType" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of machine types when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "Metadata": { + "id": "Metadata", + "type": "object", + "description": "A metadata key/value entry.", + "properties": { + "fingerprint": { + "type": "string", + "description": "Fingerprint of this resource. A hash of the metadata's contents. This field is used for optimistic locking. An up-to-date metadata fingerprint must be provided in order to modify metadata.", + "format": "byte" + }, + "items": { + "type": "array", + "description": "Array of key/value pairs. The total size of all keys and values must be less than 512 KB.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.", + "pattern": "[a-zA-Z0-9-_]{1,128}", + "annotations": { + "required": [ + "compute.instances.insert", + "compute.projects.setCommonInstanceMetadata" + ] + } + }, + "value": { + "type": "string", + "description": "Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes.", + "annotations": { + "required": [ + "compute.instances.insert", + "compute.projects.setCommonInstanceMetadata" + ] + } + } + } + } + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#metadata" + } + } + }, + "Network": { + "id": "Network", + "type": "object", + "description": "A network resource.", + "properties": { + "IPv4Range": { + "type": "string", + "description": "Required; The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client when the network is created.", + "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}/[0-9]{1,2}", + "annotations": { + "required": [ + "compute.networks.insert" + ] + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "gatewayIPv4": { + "type": "string", + "description": "An optional address that is used for default routing to other networks. This must be within the range specified by IPv4Range, and is typically the first usable address in that range. If not specified, the default value is the first usable address in IPv4Range.", + "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#network" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.networks.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "NetworkInterface": { + "id": "NetworkInterface", + "type": "object", + "description": "A network interface resource attached to an instance.", + "properties": { + "accessConfigs": { + "type": "array", + "description": "Array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.", + "items": { + "$ref": "AccessConfig" + } + }, + "name": { + "type": "string", + "description": "Name of the network interface, determined by the server; for network devices, these are e.g. eth0, eth1, etc. (output only)." + }, + "network": { + "type": "string", + "description": "URL of the network resource attached to this interface.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "networkIP": { + "type": "string", + "description": "An optional IPV4 internal network address assigned to the instance for this network interface (output only)." + } + } + }, + "NetworkList": { + "id": "NetworkList", + "type": "object", + "description": "Contains a list of network resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The network resources.", + "items": { + "$ref": "Network" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#networkList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "An operation resource, used to manage asynchronous API requests.", + "properties": { + "clientOperationId": { + "type": "string", + "description": "An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only)." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "endTime": { + "type": "string", + "description": "The time that this operation was completed. This is in RFC 3339 format (output only)." + }, + "error": { + "type": "object", + "description": "If errors occurred during processing of this operation, this field will be populated (output only).", + "properties": { + "errors": { + "type": "array", + "description": "The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "An optional, human-readable error message." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only)." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "If operation fails, the HTTP error status code returned, e.g. 404. (output only).", + "format": "int32" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "The time that this operation was requested. This is in RFC 3339 format (output only)." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#operation" + }, + "name": { + "type": "string", + "description": "Name of the resource (output only)." + }, + "operationType": { + "type": "string", + "description": "Type of the operation. Examples include \"insert\", \"update\", and \"delete\" (output only)." + }, + "progress": { + "type": "integer", + "description": "An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only).", + "format": "int32" + }, + "region": { + "type": "string", + "description": "URL of the region where the operation resides (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "startTime": { + "type": "string", + "description": "The time that this operation was started by the server. This is in RFC 3339 format (output only)." + }, + "status": { + "type": "string", + "description": "Status of the operation. Can be one of the following: \"PENDING\", \"RUNNING\", or \"DONE\" (output only).", + "enum": [ + "DONE", + "PENDING", + "RUNNING" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "statusMessage": { + "type": "string", + "description": "An optional textual description of the current status of the operation (output only)." + }, + "targetId": { + "type": "string", + "description": "Unique target id which identifies a particular incarnation of the target (output only).", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "URL of the resource the operation is mutating (output only)." + }, + "user": { + "type": "string", + "description": "User who requested the operation, for example \"user@example.com\" (output only)." + }, + "warnings": { + "type": "array", + "description": "If warning messages generated during processing of this operation, this field will be populated (output only).", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + }, + "zone": { + "type": "string", + "description": "URL of the zone where the operation resides (output only)." + } + } + }, + "OperationAggregatedList": { + "id": "OperationAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped operation lists.", + "additionalProperties": { + "$ref": "OperationsScopedList", + "description": "Name of the scope containing this set of operations." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#operationAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "OperationList": { + "id": "OperationList", + "type": "object", + "description": "Contains a list of operation resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The operation resources.", + "items": { + "$ref": "Operation" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#operationList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "OperationsScopedList": { + "id": "OperationsScopedList", + "type": "object", + "properties": { + "operations": { + "type": "array", + "description": "List of operations contained in this scope.", + "items": { + "$ref": "Operation" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of operations when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "PathMatcher": { + "id": "PathMatcher", + "type": "object", + "description": "A matcher for the path portion of the URL. The BackendService from the longest-matched rule will serve the URL. If no rule was matched, the default_service will be used.", + "properties": { + "defaultService": { + "type": "string", + "description": "The URL to the BackendService resource. This will be used if none of the 'pathRules' defined by this PathMatcher is met by the URL's path portion." + }, + "description": { + "type": "string" + }, + "name": { + "type": "string", + "description": "The name to which this PathMatcher is referred by the HostRule." + }, + "pathRules": { + "type": "array", + "description": "The list of path rules.", + "items": { + "$ref": "PathRule" + } + } + } + }, + "PathRule": { + "id": "PathRule", + "type": "object", + "description": "A path-matching rule for a URL. If matched, will use the specified BackendService to handle the traffic arriving at this URL.", + "properties": { + "paths": { + "type": "array", + "description": "The list of path patterns to match. Each must start with ?/\" and the only place a \"*\" is allowed is at the end following a \"/\". The string fed to the path matcher does not include any text after the first \"?\" or \"#\", and those chars are not allowed here.", + "items": { + "type": "string" + } + }, + "service": { + "type": "string", + "description": "The URL of the BackendService resource if this rule is matched." + } + } + }, + "Project": { + "id": "Project", + "type": "object", + "description": "A project resource. Projects can be created only in the APIs Console. Unless marked otherwise, values can only be modified in the console.", + "properties": { + "commonInstanceMetadata": { + "$ref": "Metadata", + "description": "Metadata key/value pairs available to all instances contained in this project." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#project" + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "quotas": { + "type": "array", + "description": "Quotas assigned to this project.", + "items": { + "$ref": "Quota" + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "usageExportLocation": { + "$ref": "UsageExportLocation", + "description": "The location in Cloud Storage and naming method of the daily usage report." + } + } + }, + "Quota": { + "id": "Quota", + "type": "object", + "description": "A quotas entry.", + "properties": { + "limit": { + "type": "number", + "description": "Quota limit for this metric.", + "format": "double" + }, + "metric": { + "type": "string", + "description": "Name of the quota metric.", + "enum": [ + "BACKEND_SERVICES", + "CPUS", + "DISKS", + "DISKS_TOTAL_GB", + "EPHEMERAL_ADDRESSES", + "FIREWALLS", + "FORWARDING_RULES", + "HEALTH_CHECKS", + "IMAGES", + "IMAGES_TOTAL_GB", + "INSTANCES", + "IN_USE_ADDRESSES", + "KERNELS", + "KERNELS_TOTAL_GB", + "NETWORKS", + "OPERATIONS", + "ROUTES", + "SNAPSHOTS", + "SSD_TOTAL_GB", + "STATIC_ADDRESSES", + "TARGET_HTTP_PROXIES", + "TARGET_INSTANCES", + "TARGET_POOLS", + "URL_MAPS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "usage": { + "type": "number", + "description": "Current usage of this metric.", + "format": "double" + } + } + }, + "Region": { + "id": "Region", + "type": "object", + "description": "Region resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this region." + }, + "description": { + "type": "string", + "description": "Textual description of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#region" + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "quotas": { + "type": "array", + "description": "Quotas assigned to this region.", + "items": { + "$ref": "Quota" + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "status": { + "type": "string", + "description": "Status of the region, \"UP\" or \"DOWN\".", + "enum": [ + "DOWN", + "UP" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "zones": { + "type": "array", + "description": "A list of zones homed in this region, in the form of resource URLs.", + "items": { + "type": "string" + } + } + } + }, + "RegionList": { + "id": "RegionList", + "type": "object", + "description": "Contains a list of region resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The region resources.", + "items": { + "$ref": "Region" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#regionList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "ResourceGroupReference": { + "id": "ResourceGroupReference", + "type": "object", + "properties": { + "group": { + "type": "string" + } + } + }, + "Route": { + "id": "Route", + "type": "object", + "description": "The route resource. A Route is a rule that specifies how certain packets should be handled by the virtual network. Routes are associated with VMs by tag and the set of Routes for a particular VM is called its routing table. For each packet leaving a VM, the system searches that VM's routing table for a single best matching Route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the Route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching Routes. The packet is then forwarded as specified by the next_hop field of the winning Route -- either to another VM destination, a VM gateway or a GCE operated gateway. Packets that do not match any Route in the sending VM's routing table will be dropped.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "destRange": { + "type": "string", + "description": "Which packets does this route apply to?", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#route" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "network": { + "type": "string", + "description": "URL of the network to which this route is applied; provided by the client when the route is created.", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "nextHopGateway": { + "type": "string", + "description": "The URL to a gateway that should handle matching packets." + }, + "nextHopInstance": { + "type": "string", + "description": "The URL to an instance that should handle matching packets." + }, + "nextHopIp": { + "type": "string", + "description": "The network IP address of an instance that should handle matching packets." + }, + "nextHopNetwork": { + "type": "string", + "description": "The URL of the local network if it should handle matching packets." + }, + "priority": { + "type": "integer", + "description": "Breaks ties between Routes of equal specificity. Routes with smaller values win when tied with routes with larger values.", + "format": "uint32", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "tags": { + "type": "array", + "description": "A list of instance tags to which this route applies.", + "items": { + "type": "string" + }, + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "warnings": { + "type": "array", + "description": "If potential misconfigurations are detected for this route, this field will be populated with warning messages.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + } + }, + "RouteList": { + "id": "RouteList", + "type": "object", + "description": "Contains a list of route resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The route resources.", + "items": { + "$ref": "Route" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#routeList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Scheduling": { + "id": "Scheduling", + "type": "object", + "description": "Scheduling options for an Instance.", + "properties": { + "automaticRestart": { + "type": "boolean", + "description": "Whether the Instance should be automatically restarted whenever it is terminated by Compute Engine (not terminated by user)." + }, + "onHostMaintenance": { + "type": "string", + "description": "How the instance should behave when the host machine undergoes maintenance that may temporarily impact instance performance.", + "enum": [ + "MIGRATE", + "TERMINATE" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "SerialPortOutput": { + "id": "SerialPortOutput", + "type": "object", + "description": "An instance serial console output.", + "properties": { + "contents": { + "type": "string", + "description": "The contents of the console output." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#serialPortOutput" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "ServiceAccount": { + "id": "ServiceAccount", + "type": "object", + "description": "A service account.", + "properties": { + "email": { + "type": "string", + "description": "Email address of the service account." + }, + "scopes": { + "type": "array", + "description": "The list of scopes to be made available for this service account.", + "items": { + "type": "string" + } + } + } + }, + "Snapshot": { + "id": "Snapshot", + "type": "object", + "description": "A persistent disk snapshot resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "diskSizeGb": { + "type": "string", + "description": "Size of the persistent disk snapshot, specified in GB (output only).", + "format": "int64" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#snapshot" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sourceDisk": { + "type": "string", + "description": "The source disk used to create this snapshot. Once the source disk has been deleted from the system, this field will be cleared, and will not be set even if a disk with the same name has been re-created (output only)." + }, + "sourceDiskId": { + "type": "string", + "description": "The 'id' value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name." + }, + "status": { + "type": "string", + "description": "The status of the persistent disk snapshot (output only).", + "enum": [ + "CREATING", + "DELETING", + "FAILED", + "READY", + "UPLOADING" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "storageBytes": { + "type": "string", + "description": "A size of the the storage used by the snapshot. As snapshots share storage this number is expected to change with snapshot creation/deletion.", + "format": "int64" + }, + "storageBytesStatus": { + "type": "string", + "description": "An indicator whether storageBytes is in a stable state, or it is being adjusted as a result of shared storage reallocation.", + "enum": [ + "UPDATING", + "UP_TO_DATE" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "SnapshotList": { + "id": "SnapshotList", + "type": "object", + "description": "Contains a list of persistent disk snapshot resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The persistent snapshot resources.", + "items": { + "$ref": "Snapshot" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#snapshotList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Tags": { + "id": "Tags", + "type": "object", + "description": "A set of instance tags.", + "properties": { + "fingerprint": { + "type": "string", + "description": "Fingerprint of this resource. A hash of the tags stored in this object. This field is used optimistic locking. An up-to-date tags fingerprint must be provided in order to modify tags.", + "format": "byte" + }, + "items": { + "type": "array", + "description": "An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.", + "items": { + "type": "string" + } + } + } + }, + "TargetHttpProxy": { + "id": "TargetHttpProxy", + "type": "object", + "description": "A TargetHttpProxy resource. This resource defines an HTTP proxy.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#targetHttpProxy" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "urlMap": { + "type": "string", + "description": "URL to the UrlMap resource that defines the mapping from URL to the BackendService." + } + } + }, + "TargetHttpProxyList": { + "id": "TargetHttpProxyList", + "type": "object", + "description": "Contains a list of TargetHttpProxy resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The TargetHttpProxy resources.", + "items": { + "$ref": "TargetHttpProxy" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetHttpProxyList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "TargetInstance": { + "id": "TargetInstance", + "type": "object", + "description": "A TargetInstance resource. This resource defines an endpoint VM that terminates traffic of certain protocols.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "instance": { + "type": "string", + "description": "The URL to the instance that terminates the relevant traffic." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#targetInstance" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "natPolicy": { + "type": "string", + "description": "NAT option controlling how IPs are NAT'ed to the VM. Currently only NO_NAT (default value) is supported.", + "enum": [ + "NO_NAT" + ], + "enumDescriptions": [ + "" + ] + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "zone": { + "type": "string", + "description": "URL of the zone where the target instance resides (output only)." + } + } + }, + "TargetInstanceAggregatedList": { + "id": "TargetInstanceAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped target instance lists.", + "additionalProperties": { + "$ref": "TargetInstancesScopedList", + "description": "Name of the scope containing this set of target instances." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetInstanceAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "TargetInstanceList": { + "id": "TargetInstanceList", + "type": "object", + "description": "Contains a list of TargetInstance resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The TargetInstance resources.", + "items": { + "$ref": "TargetInstance" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetInstanceList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "TargetInstancesScopedList": { + "id": "TargetInstancesScopedList", + "type": "object", + "properties": { + "targetInstances": { + "type": "array", + "description": "List of target instances contained in this scope.", + "items": { + "$ref": "TargetInstance" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of addresses when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "TargetPool": { + "id": "TargetPool", + "type": "object", + "description": "A TargetPool resource. This resource defines a pool of VMs, associated HttpHealthCheck resources, and the fallback TargetPool.", + "properties": { + "backupPool": { + "type": "string", + "description": "This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its 'failoverRatio' field is properly set to a value between [0, 1].\n\n'backupPool' and 'failoverRatio' together define the fallback behavior of the primary target pool: if the ratio of the healthy VMs in the primary pool is at or below 'failoverRatio', traffic arriving at the load-balanced IP will be directed to the backup pool.\n\nIn case where 'failoverRatio' and 'backupPool' are not set, or all the VMs in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the \"force\" mode, where traffic will be spread to the healthy VMs with the best effort, or to all VMs when no VM is healthy." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "failoverRatio": { + "type": "number", + "description": "This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some other target pool). The value of the field must be in [0, 1].\n\nIf set, 'backupPool' must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy VMs in the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool.\n\nIn case where 'failoverRatio' is not set or all the VMs in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the \"force\" mode, where traffic will be spread to the healthy VMs with the best effort, or to all VMs when no VM is healthy.", + "format": "float" + }, + "healthChecks": { + "type": "array", + "description": "A list of URLs to the HttpHealthCheck resource. A member VM in this pool is considered healthy if and only if all specified health checks pass. An empty list means all member VMs will be considered healthy at all times.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "instances": { + "type": "array", + "description": "A list of resource URLs to the member VMs serving this pool. They must live in zones contained in the same region as this pool.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#targetPool" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "region": { + "type": "string", + "description": "URL of the region where the target pool resides (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sessionAffinity": { + "type": "string", + "description": "Sesssion affinity option, must be one of the following values: 'NONE': Connections from the same client IP may go to any VM in the pool; 'CLIENT_IP': Connections from the same client IP will go to the same VM in the pool while that VM remains healthy. 'CLIENT_IP_PROTO': Connections from the same client IP with the same IP protocol will go to the same VM in the pool while that VM remains healthy.", + "enum": [ + "CLIENT_IP", + "CLIENT_IP_PROTO", + "NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "TargetPoolAggregatedList": { + "id": "TargetPoolAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped target pool lists.", + "additionalProperties": { + "$ref": "TargetPoolsScopedList", + "description": "Name of the scope containing this set of target pools." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetPoolAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "TargetPoolInstanceHealth": { + "id": "TargetPoolInstanceHealth", + "type": "object", + "properties": { + "healthStatus": { + "type": "array", + "items": { + "$ref": "HealthStatus" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetPoolInstanceHealth" + } + } + }, + "TargetPoolList": { + "id": "TargetPoolList", + "type": "object", + "description": "Contains a list of TargetPool resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The TargetPool resources.", + "items": { + "$ref": "TargetPool" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetPoolList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "TargetPoolsAddHealthCheckRequest": { + "id": "TargetPoolsAddHealthCheckRequest", + "type": "object", + "properties": { + "healthChecks": { + "type": "array", + "description": "Health check URLs to be added to targetPool.", + "items": { + "$ref": "HealthCheckReference" + } + } + } + }, + "TargetPoolsAddInstanceRequest": { + "id": "TargetPoolsAddInstanceRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "URLs of the instances to be added to targetPool.", + "items": { + "$ref": "InstanceReference" + } + } + } + }, + "TargetPoolsRemoveHealthCheckRequest": { + "id": "TargetPoolsRemoveHealthCheckRequest", + "type": "object", + "properties": { + "healthChecks": { + "type": "array", + "description": "Health check URLs to be removed from targetPool.", + "items": { + "$ref": "HealthCheckReference" + } + } + } + }, + "TargetPoolsRemoveInstanceRequest": { + "id": "TargetPoolsRemoveInstanceRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "URLs of the instances to be removed from targetPool.", + "items": { + "$ref": "InstanceReference" + } + } + } + }, + "TargetPoolsScopedList": { + "id": "TargetPoolsScopedList", + "type": "object", + "properties": { + "targetPools": { + "type": "array", + "description": "List of target pools contained in this scope.", + "items": { + "$ref": "TargetPool" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of addresses when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "TargetReference": { + "id": "TargetReference", + "type": "object", + "properties": { + "target": { + "type": "string" + } + } + }, + "TestFailure": { + "id": "TestFailure", + "type": "object", + "properties": { + "actualService": { + "type": "string" + }, + "expectedService": { + "type": "string" + }, + "host": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "UrlMap": { + "id": "UrlMap", + "type": "object", + "description": "A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the \"longest-match\" of the URL's host and path.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "defaultService": { + "type": "string", + "description": "The URL of the BackendService resource if none of the hostRules match." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "fingerprint": { + "type": "string", + "description": "Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a UrlMap. An up-to-date fingerprint must be provided in order to update the UrlMap.", + "format": "byte" + }, + "hostRules": { + "type": "array", + "description": "The list of HostRules to use against the URL.", + "items": { + "$ref": "HostRule" + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#urlMap" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "pathMatchers": { + "type": "array", + "description": "The list of named PathMatchers to use against the URL.", + "items": { + "$ref": "PathMatcher" + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "tests": { + "type": "array", + "description": "The list of expected URL mappings. Request to update this UrlMap will succeed only all of the test cases pass.", + "items": { + "$ref": "UrlMapTest" + } + } + } + }, + "UrlMapList": { + "id": "UrlMapList", + "type": "object", + "description": "Contains a list of UrlMap resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The UrlMap resources.", + "items": { + "$ref": "UrlMap" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#urlMapList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "UrlMapReference": { + "id": "UrlMapReference", + "type": "object", + "properties": { + "urlMap": { + "type": "string" + } + } + }, + "UrlMapTest": { + "id": "UrlMapTest", + "type": "object", + "description": "Message for the expected URL mappings.", + "properties": { + "description": { + "type": "string", + "description": "Description of this test case." + }, + "host": { + "type": "string", + "description": "Host portion of the URL." + }, + "path": { + "type": "string", + "description": "Path portion of the URL." + }, + "service": { + "type": "string", + "description": "Expected BackendService resource the given URL should be mapped to." + } + } + }, + "UrlMapValidationResult": { + "id": "UrlMapValidationResult", + "type": "object", + "description": "Message representing the validation result for a UrlMap.", + "properties": { + "loadErrors": { + "type": "array", + "items": { + "type": "string" + } + }, + "loadSucceeded": { + "type": "boolean", + "description": "Whether the given UrlMap can be successfully loaded. If false, 'loadErrors' indicates the reasons." + }, + "testFailures": { + "type": "array", + "items": { + "$ref": "TestFailure" + } + }, + "testPassed": { + "type": "boolean", + "description": "If successfully loaded, this field indicates whether the test passed. If false, 'testFailures's indicate the reason of failure." + } + } + }, + "UrlMapsValidateRequest": { + "id": "UrlMapsValidateRequest", + "type": "object", + "properties": { + "resource": { + "$ref": "UrlMap", + "description": "Content of the UrlMap to be validated." + } + } + }, + "UrlMapsValidateResponse": { + "id": "UrlMapsValidateResponse", + "type": "object", + "properties": { + "result": { + "$ref": "UrlMapValidationResult" + } + } + }, + "UsageExportLocation": { + "id": "UsageExportLocation", + "type": "object", + "description": "The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix.", + "properties": { + "bucketName": { + "type": "string", + "description": "The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This is simply the bucket name, with no \"gs://\" or \"https://storage.googleapis.com/\" in front of it." + }, + "reportNamePrefix": { + "type": "string", + "description": "An optional prefix for the name of the usage report object stored in bucket_name. If not supplied, defaults to \"usage_\". The report is stored as a CSV file named _gce_.csv. where is the day of the usage according to Pacific Time. The prefix should conform to Cloud Storage object naming conventions." + } + } + }, + "Zone": { + "id": "Zone", + "type": "object", + "description": "A zone resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this zone." + }, + "description": { + "type": "string", + "description": "Textual description of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#zone" + }, + "maintenanceWindows": { + "type": "array", + "description": "Scheduled maintenance windows for the zone. When the zone is in a maintenance window, all resources which reside in the zone will be unavailable.", + "items": { + "type": "object", + "properties": { + "beginTime": { + "type": "string", + "description": "Begin time of the maintenance window, in RFC 3339 format." + }, + "description": { + "type": "string", + "description": "Textual description of the maintenance window." + }, + "endTime": { + "type": "string", + "description": "End time of the maintenance window, in RFC 3339 format." + }, + "name": { + "type": "string", + "description": "Name of the maintenance window." + } + } + } + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "region": { + "type": "string", + "description": "Full URL reference to the region which hosts the zone (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "status": { + "type": "string", + "description": "Status of the zone. \"UP\" or \"DOWN\".", + "enum": [ + "DOWN", + "UP" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "ZoneList": { + "id": "ZoneList", + "type": "object", + "description": "Contains a list of zone resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The zone resources.", + "items": { + "$ref": "Zone" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#zoneList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + } + }, + "resources": { + "addresses": { + "methods": { + "aggregatedList": { + "id": "compute.addresses.aggregatedList", + "path": "{project}/aggregated/addresses", + "httpMethod": "GET", + "description": "Retrieves the list of addresses grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "AddressAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.addresses.delete", + "path": "{project}/regions/{region}/addresses/{address}", + "httpMethod": "DELETE", + "description": "Deletes the specified address resource.", + "parameters": { + "address": { + "type": "string", + "description": "Name of the address resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "address" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.addresses.get", + "path": "{project}/regions/{region}/addresses/{address}", + "httpMethod": "GET", + "description": "Returns the specified address resource.", + "parameters": { + "address": { + "type": "string", + "description": "Name of the address resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "address" + ], + "response": { + "$ref": "Address" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.addresses.insert", + "path": "{project}/regions/{region}/addresses", + "httpMethod": "POST", + "description": "Creates an address resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "request": { + "$ref": "Address" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.addresses.list", + "path": "{project}/regions/{region}/addresses", + "httpMethod": "GET", + "description": "Retrieves the list of address resources contained within the specified region.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "AddressList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "backendServices": { + "methods": { + "delete": { + "id": "compute.backendServices.delete", + "path": "{project}/global/backendServices/{backendService}", + "httpMethod": "DELETE", + "description": "Deletes the specified BackendService resource.", + "parameters": { + "backendService": { + "type": "string", + "description": "Name of the BackendService resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "backendService" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.backendServices.get", + "path": "{project}/global/backendServices/{backendService}", + "httpMethod": "GET", + "description": "Returns the specified BackendService resource.", + "parameters": { + "backendService": { + "type": "string", + "description": "Name of the BackendService resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "backendService" + ], + "response": { + "$ref": "BackendService" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "getHealth": { + "id": "compute.backendServices.getHealth", + "path": "{project}/global/backendServices/{backendService}/getHealth", + "httpMethod": "POST", + "description": "Gets the most recent health check results for this BackendService.", + "parameters": { + "backendService": { + "type": "string", + "description": "Name of the BackendService resource to which the queried instance belongs.", + "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" + } + }, + "parameterOrder": [ + "project", + "backendService" + ], + "request": { + "$ref": "ResourceGroupReference" + }, + "response": { + "$ref": "BackendServiceGroupHealth" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.backendServices.insert", + "path": "{project}/global/backendServices", + "httpMethod": "POST", + "description": "Creates a BackendService resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "BackendService" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.backendServices.list", + "path": "{project}/global/backendServices", + "httpMethod": "GET", + "description": "Retrieves the list of BackendService resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "BackendServiceList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.backendServices.patch", + "path": "{project}/global/backendServices/{backendService}", + "httpMethod": "PATCH", + "description": "Update the entire content of the BackendService resource. This method supports patch semantics.", + "parameters": { + "backendService": { + "type": "string", + "description": "Name of the BackendService resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "backendService" + ], + "request": { + "$ref": "BackendService" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "compute.backendServices.update", + "path": "{project}/global/backendServices/{backendService}", + "httpMethod": "PUT", + "description": "Update the entire content of the BackendService resource.", + "parameters": { + "backendService": { + "type": "string", + "description": "Name of the BackendService resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "backendService" + ], + "request": { + "$ref": "BackendService" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "diskTypes": { + "methods": { + "aggregatedList": { + "id": "compute.diskTypes.aggregatedList", + "path": "{project}/aggregated/diskTypes", + "httpMethod": "GET", + "description": "Retrieves the list of disk type resources grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "DiskTypeAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "get": { + "id": "compute.diskTypes.get", + "path": "{project}/zones/{zone}/diskTypes/{diskType}", + "httpMethod": "GET", + "description": "Returns the specified disk type resource.", + "parameters": { + "diskType": { + "type": "string", + "description": "Name of the disk type resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "diskType" + ], + "response": { + "$ref": "DiskType" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.diskTypes.list", + "path": "{project}/zones/{zone}/diskTypes", + "httpMethod": "GET", + "description": "Retrieves the list of disk type resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "DiskTypeList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "disks": { + "methods": { + "aggregatedList": { + "id": "compute.disks.aggregatedList", + "path": "{project}/aggregated/disks", + "httpMethod": "GET", + "description": "Retrieves the list of disks grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "DiskAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "createSnapshot": { + "id": "compute.disks.createSnapshot", + "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot", + "httpMethod": "POST", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk resource to snapshot.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "disk" + ], + "request": { + "$ref": "Snapshot" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "delete": { + "id": "compute.disks.delete", + "path": "{project}/zones/{zone}/disks/{disk}", + "httpMethod": "DELETE", + "description": "Deletes the specified persistent disk resource.", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "disk" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.disks.get", + "path": "{project}/zones/{zone}/disks/{disk}", + "httpMethod": "GET", + "description": "Returns the specified persistent disk resource.", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "disk" + ], + "response": { + "$ref": "Disk" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.disks.insert", + "path": "{project}/zones/{zone}/disks", + "httpMethod": "POST", + "description": "Creates a persistent disk resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "sourceImage": { + "type": "string", + "description": "Optional. Source image to restore onto a disk.", + "location": "query" + }, + "zone": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "Disk" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.disks.list", + "path": "{project}/zones/{zone}/disks", + "httpMethod": "GET", + "description": "Retrieves the list of persistent disk resources contained within the specified zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "DiskList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "firewalls": { + "methods": { + "delete": { + "id": "compute.firewalls.delete", + "path": "{project}/global/firewalls/{firewall}", + "httpMethod": "DELETE", + "description": "Deletes the specified firewall resource.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.firewalls.get", + "path": "{project}/global/firewalls/{firewall}", + "httpMethod": "GET", + "description": "Returns the specified firewall resource.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "response": { + "$ref": "Firewall" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.firewalls.insert", + "path": "{project}/global/firewalls", + "httpMethod": "POST", + "description": "Creates a firewall resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Firewall" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.firewalls.list", + "path": "{project}/global/firewalls", + "httpMethod": "GET", + "description": "Retrieves the list of firewall resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "FirewallList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.firewalls.patch", + "path": "{project}/global/firewalls/{firewall}", + "httpMethod": "PATCH", + "description": "Updates the specified firewall resource with the data included in the request. This method supports patch semantics.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "request": { + "$ref": "Firewall" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "compute.firewalls.update", + "path": "{project}/global/firewalls/{firewall}", + "httpMethod": "PUT", + "description": "Updates the specified firewall resource with the data included in the request.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "request": { + "$ref": "Firewall" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "forwardingRules": { + "methods": { + "aggregatedList": { + "id": "compute.forwardingRules.aggregatedList", + "path": "{project}/aggregated/forwardingRules", + "httpMethod": "GET", + "description": "Retrieves the list of forwarding rules grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "ForwardingRuleAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.forwardingRules.delete", + "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}", + "httpMethod": "DELETE", + "description": "Deletes the specified ForwardingRule resource.", + "parameters": { + "forwardingRule": { + "type": "string", + "description": "Name of the ForwardingRule resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "forwardingRule" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.forwardingRules.get", + "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}", + "httpMethod": "GET", + "description": "Returns the specified ForwardingRule resource.", + "parameters": { + "forwardingRule": { + "type": "string", + "description": "Name of the ForwardingRule resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "forwardingRule" + ], + "response": { + "$ref": "ForwardingRule" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.forwardingRules.insert", + "path": "{project}/regions/{region}/forwardingRules", + "httpMethod": "POST", + "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "request": { + "$ref": "ForwardingRule" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.forwardingRules.list", + "path": "{project}/regions/{region}/forwardingRules", + "httpMethod": "GET", + "description": "Retrieves the list of ForwardingRule resources available to the specified project and region.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "ForwardingRuleList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "setTarget": { + "id": "compute.forwardingRules.setTarget", + "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget", + "httpMethod": "POST", + "description": "Changes target url for forwarding rule.", + "parameters": { + "forwardingRule": { + "type": "string", + "description": "Name of the ForwardingRule resource in which target is to be set.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "forwardingRule" + ], + "request": { + "$ref": "TargetReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "globalAddresses": { + "methods": { + "delete": { + "id": "compute.globalAddresses.delete", + "path": "{project}/global/addresses/{address}", + "httpMethod": "DELETE", + "description": "Deletes the specified address resource.", + "parameters": { + "address": { + "type": "string", + "description": "Name of the address resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "address" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.globalAddresses.get", + "path": "{project}/global/addresses/{address}", + "httpMethod": "GET", + "description": "Returns the specified address resource.", + "parameters": { + "address": { + "type": "string", + "description": "Name of the address resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "address" + ], + "response": { + "$ref": "Address" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.globalAddresses.insert", + "path": "{project}/global/addresses", + "httpMethod": "POST", + "description": "Creates an address resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Address" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.globalAddresses.list", + "path": "{project}/global/addresses", + "httpMethod": "GET", + "description": "Retrieves the list of global address resources.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "AddressList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "globalForwardingRules": { + "methods": { + "delete": { + "id": "compute.globalForwardingRules.delete", + "path": "{project}/global/forwardingRules/{forwardingRule}", + "httpMethod": "DELETE", + "description": "Deletes the specified ForwardingRule resource.", + "parameters": { + "forwardingRule": { + "type": "string", + "description": "Name of the ForwardingRule resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "forwardingRule" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.globalForwardingRules.get", + "path": "{project}/global/forwardingRules/{forwardingRule}", + "httpMethod": "GET", + "description": "Returns the specified ForwardingRule resource.", + "parameters": { + "forwardingRule": { + "type": "string", + "description": "Name of the ForwardingRule resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "forwardingRule" + ], + "response": { + "$ref": "ForwardingRule" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.globalForwardingRules.insert", + "path": "{project}/global/forwardingRules", + "httpMethod": "POST", + "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "ForwardingRule" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.globalForwardingRules.list", + "path": "{project}/global/forwardingRules", + "httpMethod": "GET", + "description": "Retrieves the list of ForwardingRule resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "ForwardingRuleList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "setTarget": { + "id": "compute.globalForwardingRules.setTarget", + "path": "{project}/global/forwardingRules/{forwardingRule}/setTarget", + "httpMethod": "POST", + "description": "Changes target url for forwarding rule.", + "parameters": { + "forwardingRule": { + "type": "string", + "description": "Name of the ForwardingRule resource in which target is to be set.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "forwardingRule" + ], + "request": { + "$ref": "TargetReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "globalOperations": { + "methods": { + "aggregatedList": { + "id": "compute.globalOperations.aggregatedList", + "path": "{project}/aggregated/operations", + "httpMethod": "GET", + "description": "Retrieves the list of all operations grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "OperationAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.globalOperations.delete", + "path": "{project}/global/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "operation" + ], + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.globalOperations.get", + "path": "{project}/global/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "operation" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.globalOperations.list", + "path": "{project}/global/operations", + "httpMethod": "GET", + "description": "Retrieves the list of operation resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "OperationList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "httpHealthChecks": { + "methods": { + "delete": { + "id": "compute.httpHealthChecks.delete", + "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + "httpMethod": "DELETE", + "description": "Deletes the specified HttpHealthCheck resource.", + "parameters": { + "httpHealthCheck": { + "type": "string", + "description": "Name of the HttpHealthCheck resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "httpHealthCheck" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.httpHealthChecks.get", + "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + "httpMethod": "GET", + "description": "Returns the specified HttpHealthCheck resource.", + "parameters": { + "httpHealthCheck": { + "type": "string", + "description": "Name of the HttpHealthCheck resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "httpHealthCheck" + ], + "response": { + "$ref": "HttpHealthCheck" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.httpHealthChecks.insert", + "path": "{project}/global/httpHealthChecks", + "httpMethod": "POST", + "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "HttpHealthCheck" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.httpHealthChecks.list", + "path": "{project}/global/httpHealthChecks", + "httpMethod": "GET", + "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "HttpHealthCheckList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.httpHealthChecks.patch", + "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + "httpMethod": "PATCH", + "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + "parameters": { + "httpHealthCheck": { + "type": "string", + "description": "Name of the HttpHealthCheck resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "httpHealthCheck" + ], + "request": { + "$ref": "HttpHealthCheck" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "compute.httpHealthChecks.update", + "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + "httpMethod": "PUT", + "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.", + "parameters": { + "httpHealthCheck": { + "type": "string", + "description": "Name of the HttpHealthCheck resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "httpHealthCheck" + ], + "request": { + "$ref": "HttpHealthCheck" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "images": { + "methods": { + "delete": { + "id": "compute.images.delete", + "path": "{project}/global/images/{image}", + "httpMethod": "DELETE", + "description": "Deletes the specified image resource.", + "parameters": { + "image": { + "type": "string", + "description": "Name of the image resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "image" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "deprecate": { + "id": "compute.images.deprecate", + "path": "{project}/global/images/{image}/deprecate", + "httpMethod": "POST", + "description": "Sets the deprecation status of an image. If no message body is given, clears the deprecation status instead.", + "parameters": { + "image": { + "type": "string", + "description": "Image name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "image" + ], + "request": { + "$ref": "DeprecationStatus" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.images.get", + "path": "{project}/global/images/{image}", + "httpMethod": "GET", + "description": "Returns the specified image resource.", + "parameters": { + "image": { + "type": "string", + "description": "Name of the image resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "image" + ], + "response": { + "$ref": "Image" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.images.insert", + "path": "{project}/global/images", + "httpMethod": "POST", + "description": "Creates an image resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Image" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "list": { + "id": "compute.images.list", + "path": "{project}/global/images", + "httpMethod": "GET", + "description": "Retrieves the list of image resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "ImageList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "instances": { + "methods": { + "addAccessConfig": { + "id": "compute.instances.addAccessConfig", + "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig", + "httpMethod": "POST", + "description": "Adds an access config to an instance's network interface.", + "parameters": { + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "networkInterface": { + "type": "string", + "description": "Network interface name.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance", + "networkInterface" + ], + "request": { + "$ref": "AccessConfig" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "aggregatedList": { + "id": "compute.instances.aggregatedList", + "path": "{project}/aggregated/instances", + "httpMethod": "GET", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "InstanceAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "attachDisk": { + "id": "compute.instances.attachDisk", + "path": "{project}/zones/{zone}/instances/{instance}/attachDisk", + "httpMethod": "POST", + "description": "Attaches a disk resource to an instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "request": { + "$ref": "AttachedDisk" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "delete": { + "id": "compute.instances.delete", + "path": "{project}/zones/{zone}/instances/{instance}", + "httpMethod": "DELETE", + "description": "Deletes the specified instance resource.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "deleteAccessConfig": { + "id": "compute.instances.deleteAccessConfig", + "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig", + "httpMethod": "POST", + "description": "Deletes an access config from an instance's network interface.", + "parameters": { + "accessConfig": { + "type": "string", + "description": "Access config name.", + "required": true, + "location": "query" + }, + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "networkInterface": { + "type": "string", + "description": "Network interface name.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance", + "accessConfig", + "networkInterface" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "detachDisk": { + "id": "compute.instances.detachDisk", + "path": "{project}/zones/{zone}/instances/{instance}/detachDisk", + "httpMethod": "POST", + "description": "Detaches a disk from an instance.", + "parameters": { + "deviceName": { + "type": "string", + "description": "Disk device name to detach.", + "required": true, + "pattern": "\\w[\\w.-]{0,254}", + "location": "query" + }, + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance", + "deviceName" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.instances.get", + "path": "{project}/zones/{zone}/instances/{instance}", + "httpMethod": "GET", + "description": "Returns the specified instance resource.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "Instance" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "getSerialPortOutput": { + "id": "compute.instances.getSerialPortOutput", + "path": "{project}/zones/{zone}/instances/{instance}/serialPort", + "httpMethod": "GET", + "description": "Returns the specified instance's serial port output.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "SerialPortOutput" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.instances.insert", + "path": "{project}/zones/{zone}/instances", + "httpMethod": "POST", + "description": "Creates an instance resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "Instance" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.instances.list", + "path": "{project}/zones/{zone}/instances", + "httpMethod": "GET", + "description": "Retrieves the list of instance resources contained within the specified zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "InstanceList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "reset": { + "id": "compute.instances.reset", + "path": "{project}/zones/{zone}/instances/{instance}/reset", + "httpMethod": "POST", + "description": "Performs a hard reset on the instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "setDiskAutoDelete": { + "id": "compute.instances.setDiskAutoDelete", + "path": "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete", + "httpMethod": "POST", + "description": "Sets the auto-delete flag for a disk attached to an instance", + "parameters": { + "autoDelete": { + "type": "boolean", + "description": "Whether to auto-delete the disk when the instance is deleted.", + "required": true, + "location": "query" + }, + "deviceName": { + "type": "string", + "description": "Disk device name to modify.", + "required": true, + "pattern": "\\w[\\w.-]{0,254}", + "location": "query" + }, + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance", + "autoDelete", + "deviceName" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "setMetadata": { + "id": "compute.instances.setMetadata", + "path": "{project}/zones/{zone}/instances/{instance}/setMetadata", + "httpMethod": "POST", + "description": "Sets metadata for the specified instance to the data included in the request.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "request": { + "$ref": "Metadata" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "setScheduling": { + "id": "compute.instances.setScheduling", + "path": "{project}/zones/{zone}/instances/{instance}/setScheduling", + "httpMethod": "POST", + "description": "Sets an instance's scheduling options.", + "parameters": { + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "request": { + "$ref": "Scheduling" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "setTags": { + "id": "compute.instances.setTags", + "path": "{project}/zones/{zone}/instances/{instance}/setTags", + "httpMethod": "POST", + "description": "Sets tags for the specified instance to the data included in the request.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "request": { + "$ref": "Tags" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "machineTypes": { + "methods": { + "aggregatedList": { + "id": "compute.machineTypes.aggregatedList", + "path": "{project}/aggregated/machineTypes", + "httpMethod": "GET", + "description": "Retrieves the list of machine type resources grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "MachineTypeAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "get": { + "id": "compute.machineTypes.get", + "path": "{project}/zones/{zone}/machineTypes/{machineType}", + "httpMethod": "GET", + "description": "Returns the specified machine type resource.", + "parameters": { + "machineType": { + "type": "string", + "description": "Name of the machine type resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "machineType" + ], + "response": { + "$ref": "MachineType" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.machineTypes.list", + "path": "{project}/zones/{zone}/machineTypes", + "httpMethod": "GET", + "description": "Retrieves the list of machine type resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "MachineTypeList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "networks": { + "methods": { + "delete": { + "id": "compute.networks.delete", + "path": "{project}/global/networks/{network}", + "httpMethod": "DELETE", + "description": "Deletes the specified network resource.", + "parameters": { + "network": { + "type": "string", + "description": "Name of the network resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "network" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.networks.get", + "path": "{project}/global/networks/{network}", + "httpMethod": "GET", + "description": "Returns the specified network resource.", + "parameters": { + "network": { + "type": "string", + "description": "Name of the network resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "network" + ], + "response": { + "$ref": "Network" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.networks.insert", + "path": "{project}/global/networks", + "httpMethod": "POST", + "description": "Creates a network resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Network" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.networks.list", + "path": "{project}/global/networks", + "httpMethod": "GET", + "description": "Retrieves the list of network resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "NetworkList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "projects": { + "methods": { + "get": { + "id": "compute.projects.get", + "path": "{project}", + "httpMethod": "GET", + "description": "Returns the specified project resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project resource to retrieve.", + "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": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "setCommonInstanceMetadata": { + "id": "compute.projects.setCommonInstanceMetadata", + "path": "{project}/setCommonInstanceMetadata", + "httpMethod": "POST", + "description": "Sets metadata common to all instances within the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Metadata" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "setUsageExportBucket": { + "id": "compute.projects.setUsageExportBucket", + "path": "{project}/setUsageExportBucket", + "httpMethod": "POST", + "description": "Sets usage export location", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "UsageExportLocation" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + } + } + }, + "regionOperations": { + "methods": { + "delete": { + "id": "compute.regionOperations.delete", + "path": "{project}/regions/{region}/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified region-specific operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "operation" + ], + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.regionOperations.get", + "path": "{project}/regions/{region}/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified region-specific operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "operation" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.regionOperations.list", + "path": "{project}/regions/{region}/operations", + "httpMethod": "GET", + "description": "Retrieves the list of operation resources contained within the specified region.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "OperationList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "regions": { + "methods": { + "get": { + "id": "compute.regions.get", + "path": "{project}/regions/{region}", + "httpMethod": "GET", + "description": "Returns the specified region resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "Region" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.regions.list", + "path": "{project}/regions", + "httpMethod": "GET", + "description": "Retrieves the list of region resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "RegionList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "routes": { + "methods": { + "delete": { + "id": "compute.routes.delete", + "path": "{project}/global/routes/{route}", + "httpMethod": "DELETE", + "description": "Deletes the specified route resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "route": { + "type": "string", + "description": "Name of the route resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "route" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.routes.get", + "path": "{project}/global/routes/{route}", + "httpMethod": "GET", + "description": "Returns the specified route resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "route": { + "type": "string", + "description": "Name of the route resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "route" + ], + "response": { + "$ref": "Route" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.routes.insert", + "path": "{project}/global/routes", + "httpMethod": "POST", + "description": "Creates a route resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Route" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.routes.list", + "path": "{project}/global/routes", + "httpMethod": "GET", + "description": "Retrieves the list of route resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "RouteList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "snapshots": { + "methods": { + "delete": { + "id": "compute.snapshots.delete", + "path": "{project}/global/snapshots/{snapshot}", + "httpMethod": "DELETE", + "description": "Deletes the specified persistent disk snapshot resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "snapshot": { + "type": "string", + "description": "Name of the persistent disk snapshot resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "snapshot" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.snapshots.get", + "path": "{project}/global/snapshots/{snapshot}", + "httpMethod": "GET", + "description": "Returns the specified persistent disk snapshot resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "snapshot": { + "type": "string", + "description": "Name of the persistent disk snapshot resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "snapshot" + ], + "response": { + "$ref": "Snapshot" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.snapshots.list", + "path": "{project}/global/snapshots", + "httpMethod": "GET", + "description": "Retrieves the list of persistent disk snapshot resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "SnapshotList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "targetHttpProxies": { + "methods": { + "delete": { + "id": "compute.targetHttpProxies.delete", + "path": "{project}/global/targetHttpProxies/{targetHttpProxy}", + "httpMethod": "DELETE", + "description": "Deletes the specified TargetHttpProxy resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "targetHttpProxy": { + "type": "string", + "description": "Name of the TargetHttpProxy resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "targetHttpProxy" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.targetHttpProxies.get", + "path": "{project}/global/targetHttpProxies/{targetHttpProxy}", + "httpMethod": "GET", + "description": "Returns the specified TargetHttpProxy resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "targetHttpProxy": { + "type": "string", + "description": "Name of the TargetHttpProxy resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "targetHttpProxy" + ], + "response": { + "$ref": "TargetHttpProxy" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.targetHttpProxies.insert", + "path": "{project}/global/targetHttpProxies", + "httpMethod": "POST", + "description": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "TargetHttpProxy" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.targetHttpProxies.list", + "path": "{project}/global/targetHttpProxies", + "httpMethod": "GET", + "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "TargetHttpProxyList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "setUrlMap": { + "id": "compute.targetHttpProxies.setUrlMap", + "path": "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap", + "httpMethod": "POST", + "description": "Changes the URL map for TargetHttpProxy.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "targetHttpProxy": { + "type": "string", + "description": "Name of the TargetHttpProxy resource whose URL map is to be set.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "targetHttpProxy" + ], + "request": { + "$ref": "UrlMapReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "targetInstances": { + "methods": { + "aggregatedList": { + "id": "compute.targetInstances.aggregatedList", + "path": "{project}/aggregated/targetInstances", + "httpMethod": "GET", + "description": "Retrieves the list of target instances grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "TargetInstanceAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.targetInstances.delete", + "path": "{project}/zones/{zone}/targetInstances/{targetInstance}", + "httpMethod": "DELETE", + "description": "Deletes the specified TargetInstance resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "targetInstance": { + "type": "string", + "description": "Name of the TargetInstance resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "targetInstance" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.targetInstances.get", + "path": "{project}/zones/{zone}/targetInstances/{targetInstance}", + "httpMethod": "GET", + "description": "Returns the specified TargetInstance resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "targetInstance": { + "type": "string", + "description": "Name of the TargetInstance resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "targetInstance" + ], + "response": { + "$ref": "TargetInstance" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.targetInstances.insert", + "path": "{project}/zones/{zone}/targetInstances", + "httpMethod": "POST", + "description": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "TargetInstance" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.targetInstances.list", + "path": "{project}/zones/{zone}/targetInstances", + "httpMethod": "GET", + "description": "Retrieves the list of TargetInstance resources available to the specified project and zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "TargetInstanceList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "targetPools": { + "methods": { + "addHealthCheck": { + "id": "compute.targetPools.addHealthCheck", + "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck", + "httpMethod": "POST", + "description": "Adds health check URL to targetPool.", + "parameters": { + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to which health_check_url is to be added.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "request": { + "$ref": "TargetPoolsAddHealthCheckRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "addInstance": { + "id": "compute.targetPools.addInstance", + "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance", + "httpMethod": "POST", + "description": "Adds instance url to targetPool.", + "parameters": { + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to which instance_url is to be added.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "request": { + "$ref": "TargetPoolsAddInstanceRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "aggregatedList": { + "id": "compute.targetPools.aggregatedList", + "path": "{project}/aggregated/targetPools", + "httpMethod": "GET", + "description": "Retrieves the list of target pools grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "TargetPoolAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.targetPools.delete", + "path": "{project}/regions/{region}/targetPools/{targetPool}", + "httpMethod": "DELETE", + "description": "Deletes the specified TargetPool resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.targetPools.get", + "path": "{project}/regions/{region}/targetPools/{targetPool}", + "httpMethod": "GET", + "description": "Returns the specified TargetPool resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "response": { + "$ref": "TargetPool" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "getHealth": { + "id": "compute.targetPools.getHealth", + "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth", + "httpMethod": "POST", + "description": "Gets the most recent health check results for each IP for the given instance that is referenced by given TargetPool.", + "parameters": { + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to which the queried instance belongs.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "request": { + "$ref": "InstanceReference" + }, + "response": { + "$ref": "TargetPoolInstanceHealth" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.targetPools.insert", + "path": "{project}/regions/{region}/targetPools", + "httpMethod": "POST", + "description": "Creates a TargetPool resource in the specified project and region using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "request": { + "$ref": "TargetPool" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.targetPools.list", + "path": "{project}/regions/{region}/targetPools", + "httpMethod": "GET", + "description": "Retrieves the list of TargetPool resources available to the specified project and region.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "TargetPoolList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "removeHealthCheck": { + "id": "compute.targetPools.removeHealthCheck", + "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck", + "httpMethod": "POST", + "description": "Removes health check URL from targetPool.", + "parameters": { + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to which health_check_url is to be removed.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "request": { + "$ref": "TargetPoolsRemoveHealthCheckRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "removeInstance": { + "id": "compute.targetPools.removeInstance", + "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance", + "httpMethod": "POST", + "description": "Removes instance URL from targetPool.", + "parameters": { + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to which instance_url is to be removed.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "request": { + "$ref": "TargetPoolsRemoveInstanceRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "setBackup": { + "id": "compute.targetPools.setBackup", + "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup", + "httpMethod": "POST", + "description": "Changes backup pool configurations.", + "parameters": { + "failoverRatio": { + "type": "number", + "description": "New failoverRatio value for the containing target pool.", + "format": "float", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource for which the backup is to be set.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "request": { + "$ref": "TargetReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "urlMaps": { + "methods": { + "delete": { + "id": "compute.urlMaps.delete", + "path": "{project}/global/urlMaps/{urlMap}", + "httpMethod": "DELETE", + "description": "Deletes the specified UrlMap resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "urlMap": { + "type": "string", + "description": "Name of the UrlMap resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "urlMap" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.urlMaps.get", + "path": "{project}/global/urlMaps/{urlMap}", + "httpMethod": "GET", + "description": "Returns the specified UrlMap resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "urlMap": { + "type": "string", + "description": "Name of the UrlMap resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "urlMap" + ], + "response": { + "$ref": "UrlMap" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.urlMaps.insert", + "path": "{project}/global/urlMaps", + "httpMethod": "POST", + "description": "Creates a UrlMap resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "UrlMap" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.urlMaps.list", + "path": "{project}/global/urlMaps", + "httpMethod": "GET", + "description": "Retrieves the list of UrlMap resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "UrlMapList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.urlMaps.patch", + "path": "{project}/global/urlMaps/{urlMap}", + "httpMethod": "PATCH", + "description": "Update the entire content of the UrlMap resource. This method supports patch semantics.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "urlMap": { + "type": "string", + "description": "Name of the UrlMap resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "urlMap" + ], + "request": { + "$ref": "UrlMap" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "compute.urlMaps.update", + "path": "{project}/global/urlMaps/{urlMap}", + "httpMethod": "PUT", + "description": "Update the entire content of the UrlMap resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "urlMap": { + "type": "string", + "description": "Name of the UrlMap resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "urlMap" + ], + "request": { + "$ref": "UrlMap" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "validate": { + "id": "compute.urlMaps.validate", + "path": "{project}/global/urlMaps/{urlMap}/validate", + "httpMethod": "POST", + "description": "Run static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "urlMap": { + "type": "string", + "description": "Name of the UrlMap resource to be validated as.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "urlMap" + ], + "request": { + "$ref": "UrlMapsValidateRequest" + }, + "response": { + "$ref": "UrlMapsValidateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "zoneOperations": { + "methods": { + "delete": { + "id": "compute.zoneOperations.delete", + "path": "{project}/zones/{zone}/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified zone-specific operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "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": "compute.zoneOperations.get", + "path": "{project}/zones/{zone}/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified zone-specific operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "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": "compute.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", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "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": { + "get": { + "id": "compute.zones.get", + "path": "{project}/zones/{zone}", + "httpMethod": "GET", + "description": "Returns the specified zone resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "Zone" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.zones.list", + "path": "{project}/zones", + "httpMethod": "GET", + "description": "Retrieves the list of zone resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/compute/v1/compute-gen.go b/third_party/src/code.google.com/p/google-api-go-client/compute/v1/compute-gen.go new file mode 100644 index 0000000000000..ba43aca61cf07 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/compute/v1/compute-gen.go @@ -0,0 +1,14800 @@ +// Package compute provides access to the Compute Engine API. +// +// See https://developers.google.com/compute/docs/reference/latest/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/compute/v1" +// ... +// computeService, err := compute.New(oauthHttpClient) +package compute + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "compute:v1" +const apiName = "compute" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/compute/v1/projects/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Google Compute Engine resources + ComputeScope = "https://www.googleapis.com/auth/compute" + + // View your Google Compute Engine resources + ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly" + + // Manage your data and permissions in Google Cloud Storage + DevstorageFull_controlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageRead_onlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageRead_writeScope = "https://www.googleapis.com/auth/devstorage.read_write" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Addresses = NewAddressesService(s) + s.BackendServices = NewBackendServicesService(s) + s.DiskTypes = NewDiskTypesService(s) + s.Disks = NewDisksService(s) + s.Firewalls = NewFirewallsService(s) + s.ForwardingRules = NewForwardingRulesService(s) + s.GlobalAddresses = NewGlobalAddressesService(s) + s.GlobalForwardingRules = NewGlobalForwardingRulesService(s) + s.GlobalOperations = NewGlobalOperationsService(s) + s.HttpHealthChecks = NewHttpHealthChecksService(s) + s.Images = NewImagesService(s) + s.Instances = NewInstancesService(s) + s.MachineTypes = NewMachineTypesService(s) + s.Networks = NewNetworksService(s) + s.Projects = NewProjectsService(s) + s.RegionOperations = NewRegionOperationsService(s) + s.Regions = NewRegionsService(s) + s.Routes = NewRoutesService(s) + s.Snapshots = NewSnapshotsService(s) + s.TargetHttpProxies = NewTargetHttpProxiesService(s) + s.TargetInstances = NewTargetInstancesService(s) + s.TargetPools = NewTargetPoolsService(s) + s.UrlMaps = NewUrlMapsService(s) + s.ZoneOperations = NewZoneOperationsService(s) + s.Zones = NewZonesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Addresses *AddressesService + + BackendServices *BackendServicesService + + DiskTypes *DiskTypesService + + Disks *DisksService + + Firewalls *FirewallsService + + ForwardingRules *ForwardingRulesService + + GlobalAddresses *GlobalAddressesService + + GlobalForwardingRules *GlobalForwardingRulesService + + GlobalOperations *GlobalOperationsService + + HttpHealthChecks *HttpHealthChecksService + + Images *ImagesService + + Instances *InstancesService + + MachineTypes *MachineTypesService + + Networks *NetworksService + + Projects *ProjectsService + + RegionOperations *RegionOperationsService + + Regions *RegionsService + + Routes *RoutesService + + Snapshots *SnapshotsService + + TargetHttpProxies *TargetHttpProxiesService + + TargetInstances *TargetInstancesService + + TargetPools *TargetPoolsService + + UrlMaps *UrlMapsService + + ZoneOperations *ZoneOperationsService + + Zones *ZonesService +} + +func NewAddressesService(s *Service) *AddressesService { + rs := &AddressesService{s: s} + return rs +} + +type AddressesService struct { + s *Service +} + +func NewBackendServicesService(s *Service) *BackendServicesService { + rs := &BackendServicesService{s: s} + return rs +} + +type BackendServicesService struct { + s *Service +} + +func NewDiskTypesService(s *Service) *DiskTypesService { + rs := &DiskTypesService{s: s} + return rs +} + +type DiskTypesService struct { + s *Service +} + +func NewDisksService(s *Service) *DisksService { + rs := &DisksService{s: s} + return rs +} + +type DisksService struct { + s *Service +} + +func NewFirewallsService(s *Service) *FirewallsService { + rs := &FirewallsService{s: s} + return rs +} + +type FirewallsService struct { + s *Service +} + +func NewForwardingRulesService(s *Service) *ForwardingRulesService { + rs := &ForwardingRulesService{s: s} + return rs +} + +type ForwardingRulesService struct { + s *Service +} + +func NewGlobalAddressesService(s *Service) *GlobalAddressesService { + rs := &GlobalAddressesService{s: s} + return rs +} + +type GlobalAddressesService struct { + s *Service +} + +func NewGlobalForwardingRulesService(s *Service) *GlobalForwardingRulesService { + rs := &GlobalForwardingRulesService{s: s} + return rs +} + +type GlobalForwardingRulesService struct { + s *Service +} + +func NewGlobalOperationsService(s *Service) *GlobalOperationsService { + rs := &GlobalOperationsService{s: s} + return rs +} + +type GlobalOperationsService struct { + s *Service +} + +func NewHttpHealthChecksService(s *Service) *HttpHealthChecksService { + rs := &HttpHealthChecksService{s: s} + return rs +} + +type HttpHealthChecksService struct { + s *Service +} + +func NewImagesService(s *Service) *ImagesService { + rs := &ImagesService{s: s} + return rs +} + +type ImagesService struct { + s *Service +} + +func NewInstancesService(s *Service) *InstancesService { + rs := &InstancesService{s: s} + return rs +} + +type InstancesService struct { + s *Service +} + +func NewMachineTypesService(s *Service) *MachineTypesService { + rs := &MachineTypesService{s: s} + return rs +} + +type MachineTypesService struct { + s *Service +} + +func NewNetworksService(s *Service) *NetworksService { + rs := &NetworksService{s: s} + return rs +} + +type NetworksService struct { + s *Service +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + return rs +} + +type ProjectsService struct { + s *Service +} + +func NewRegionOperationsService(s *Service) *RegionOperationsService { + rs := &RegionOperationsService{s: s} + return rs +} + +type RegionOperationsService struct { + s *Service +} + +func NewRegionsService(s *Service) *RegionsService { + rs := &RegionsService{s: s} + return rs +} + +type RegionsService struct { + s *Service +} + +func NewRoutesService(s *Service) *RoutesService { + rs := &RoutesService{s: s} + return rs +} + +type RoutesService struct { + s *Service +} + +func NewSnapshotsService(s *Service) *SnapshotsService { + rs := &SnapshotsService{s: s} + return rs +} + +type SnapshotsService struct { + s *Service +} + +func NewTargetHttpProxiesService(s *Service) *TargetHttpProxiesService { + rs := &TargetHttpProxiesService{s: s} + return rs +} + +type TargetHttpProxiesService struct { + s *Service +} + +func NewTargetInstancesService(s *Service) *TargetInstancesService { + rs := &TargetInstancesService{s: s} + return rs +} + +type TargetInstancesService struct { + s *Service +} + +func NewTargetPoolsService(s *Service) *TargetPoolsService { + rs := &TargetPoolsService{s: s} + return rs +} + +type TargetPoolsService struct { + s *Service +} + +func NewUrlMapsService(s *Service) *UrlMapsService { + rs := &UrlMapsService{s: s} + return rs +} + +type UrlMapsService struct { + s *Service +} + +func NewZoneOperationsService(s *Service) *ZoneOperationsService { + rs := &ZoneOperationsService{s: s} + return rs +} + +type ZoneOperationsService struct { + s *Service +} + +func NewZonesService(s *Service) *ZonesService { + rs := &ZonesService{s: s} + return rs +} + +type ZonesService struct { + s *Service +} + +type AccessConfig struct { + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of this access configuration. + Name string `json:"name,omitempty"` + + // NatIP: An external IP address associated with this instance. Specify + // an unused static IP address available to the project. If not + // specified, the external IP will be drawn from a shared ephemeral + // pool. + NatIP string `json:"natIP,omitempty"` + + // Type: Type of configuration. Must be set to "ONE_TO_ONE_NAT". This + // configures port-for-port NAT to the internet. + Type string `json:"type,omitempty"` +} + +type Address struct { + // Address: The IP address represented by this resource. + Address string `json:"address,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Region: URL of the region where the regional address resides (output + // only). This field is not applicable to global addresses. + Region string `json:"region,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Status: The status of the address (output only). + Status string `json:"status,omitempty"` + + // Users: The resources that are using this address resource. + Users []string `json:"users,omitempty"` +} + +type AddressAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped address lists. + Items *AddressAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type AddressAggregatedListItems struct { +} + +type AddressList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The address resources. + Items []*Address `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type AddressesScopedList struct { + // Addresses: List of addresses contained in this scope. + Addresses []*Address `json:"addresses,omitempty"` + + // Warning: Informational warning which replaces the list of addresses + // when the list is empty. + Warning *AddressesScopedListWarning `json:"warning,omitempty"` +} + +type AddressesScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*AddressesScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type AddressesScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type AttachedDisk struct { + // AutoDelete: Whether the disk will be auto-deleted when the instance + // is deleted (but not when the disk is detached from the instance). + AutoDelete bool `json:"autoDelete,omitempty"` + + // Boot: Indicates that this is a boot disk. VM will use the first + // partition of the disk for its root filesystem. + Boot bool `json:"boot,omitempty"` + + // DeviceName: Persistent disk only; must be unique within the instance + // when specified. This represents a unique device name that is + // reflected into the /dev/ tree of a Linux operating system running + // within the instance. If not specified, a default will be chosen by + // the system. + DeviceName string `json:"deviceName,omitempty"` + + // Index: A zero-based index to assign to this disk, where 0 is reserved + // for the boot disk. If not specified, the server will choose an + // appropriate value (output only). + Index int64 `json:"index,omitempty"` + + // InitializeParams: Initialization parameters. + InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Mode: The mode in which to attach this disk, either "READ_WRITE" or + // "READ_ONLY". + Mode string `json:"mode,omitempty"` + + // Source: Persistent disk only; the URL of the persistent disk + // resource. + Source string `json:"source,omitempty"` + + // Type: Type of the disk, either "SCRATCH" or "PERSISTENT". Note that + // persistent disks must be created before you can specify them here. + Type string `json:"type,omitempty"` +} + +type AttachedDiskInitializeParams struct { + // DiskName: Name of the disk (when not provided defaults to the name of + // the instance). + DiskName string `json:"diskName,omitempty"` + + // DiskSizeGb: Size of the disk in base-2 GB. + DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` + + // DiskType: URL of the disk type resource describing which disk type to + // use to create the disk; provided by the client when the disk is + // created. + DiskType string `json:"diskType,omitempty"` + + // SourceImage: The source image used to create this disk. + SourceImage string `json:"sourceImage,omitempty"` +} + +type Backend struct { + // BalancingMode: The balancing mode of this backend, default is + // UTILIZATION. + BalancingMode string `json:"balancingMode,omitempty"` + + // CapacityScaler: The multiplier (a value between 0 and 1e6) of the max + // capacity (CPU or RPS, depending on 'balancingMode') the group should + // serve up to. 0 means the group is totally drained. Default value is + // 1. Valid range is [0, 1e6]. + CapacityScaler float64 `json:"capacityScaler,omitempty"` + + // Description: An optional textual description of the resource, which + // is provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Group: URL of a zonal Cloud Resource View resource. This resoure view + // defines the list of instances that serve traffic. Member virtual + // machine instances from each resource view must live in the same zone + // as the resource view itself. + Group string `json:"group,omitempty"` + + // MaxRate: The max RPS of the group. Can be used with either balancing + // mode, but required if RATE mode. For RATE mode, either maxRate or + // maxRatePerInstance must be set. + MaxRate int64 `json:"maxRate,omitempty"` + + // MaxRatePerInstance: The max RPS that a single backed instance can + // handle. This is used to calculate the capacity of the group. Can be + // used in either balancing mode. For RATE mode, either maxRate or + // maxRatePerInstance must be set. + MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"` + + // MaxUtilization: Used when 'balancingMode' is UTILIZATION. This ratio + // defines the CPU utilization target for the group. The default is 0.8. + // Valid range is [0, 1]. + MaxUtilization float64 `json:"maxUtilization,omitempty"` +} + +type BackendService struct { + // Backends: The list of backends that serve this BackendService. + Backends []*Backend `json:"backends,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Fingerprint: Fingerprint of this resource. A hash of the contents + // stored in this object. This field is used in optimistic locking. This + // field will be ignored when inserting a BackendService. An up-to-date + // fingerprint must be provided in order to update the BackendService. + Fingerprint string `json:"fingerprint,omitempty"` + + // HealthChecks: The list of URLs to the HttpHealthCheck resource for + // health checking this BackendService. Currently at most one health + // check can be specified, and a health check is required. + HealthChecks []string `json:"healthChecks,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Port: The TCP port to connect on the backend. The default value is + // 80. + Port int64 `json:"port,omitempty"` + + Protocol string `json:"protocol,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // TimeoutSec: How many seconds to wait for the backend before + // considering it a failed request. Default is 30 seconds. + TimeoutSec int64 `json:"timeoutSec,omitempty"` +} + +type BackendServiceGroupHealth struct { + HealthStatus []*HealthStatus `json:"healthStatus,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` +} + +type BackendServiceList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The BackendService resources. + Items []*BackendService `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type DeprecationStatus struct { + // Deleted: An optional RFC3339 timestamp on or after which the + // deprecation state of this resource will be changed to DELETED. + Deleted string `json:"deleted,omitempty"` + + // Deprecated: An optional RFC3339 timestamp on or after which the + // deprecation state of this resource will be changed to DEPRECATED. + Deprecated string `json:"deprecated,omitempty"` + + // Obsolete: An optional RFC3339 timestamp on or after which the + // deprecation state of this resource will be changed to OBSOLETE. + Obsolete string `json:"obsolete,omitempty"` + + // Replacement: A URL of the suggested replacement for the deprecated + // resource. The deprecated resource and its replacement must be + // resources of the same kind. + Replacement string `json:"replacement,omitempty"` + + // State: The deprecation state. Can be "DEPRECATED", "OBSOLETE", or + // "DELETED". Operations which create a new resource using a + // "DEPRECATED" resource will return successfully, but with a warning + // indicating the deprecated resource and recommending its replacement. + // New uses of "OBSOLETE" or "DELETED" resources will result in an + // error. + State string `json:"state,omitempty"` +} + +type Disk struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Options: Internal use only. + Options string `json:"options,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SizeGb: Size of the persistent disk, specified in GB. This parameter + // is optional when creating a disk from a disk image or a snapshot, + // otherwise it is required. + SizeGb int64 `json:"sizeGb,omitempty,string"` + + // SourceImage: The source image used to create this disk. Once the + // source image has been deleted from the system, this field will not be + // set, even if an image with the same name has been re-created. + SourceImage string `json:"sourceImage,omitempty"` + + // SourceImageId: The 'id' value of the image used to create this disk. + // This value may be used to determine whether the disk was created from + // the current or a previous instance of a given image. + SourceImageId string `json:"sourceImageId,omitempty"` + + // SourceSnapshot: The source snapshot used to create this disk. Once + // the source snapshot has been deleted from the system, this field will + // be cleared, and will not be set even if a snapshot with the same name + // has been re-created. + SourceSnapshot string `json:"sourceSnapshot,omitempty"` + + // SourceSnapshotId: The 'id' value of the snapshot used to create this + // disk. This value may be used to determine whether the disk was + // created from the current or a previous instance of a given disk + // snapshot. + SourceSnapshotId string `json:"sourceSnapshotId,omitempty"` + + // Status: The status of disk creation (output only). + Status string `json:"status,omitempty"` + + // Type: URL of the disk type resource describing which disk type to use + // to create the disk; provided by the client when the disk is created. + Type string `json:"type,omitempty"` + + // Zone: URL of the zone where the disk resides (output only). + Zone string `json:"zone,omitempty"` +} + +type DiskAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped disk lists. + Items *DiskAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type DiskAggregatedListItems struct { +} + +type DiskList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The persistent disk resources. + Items []*Disk `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type DiskType struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this disk type. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // ValidDiskSize: An optional textual descroption of the valid disk + // size, e.g., "10GB-10TB". + ValidDiskSize string `json:"validDiskSize,omitempty"` + + // Zone: Url of the zone where the disk type resides (output only). + Zone string `json:"zone,omitempty"` +} + +type DiskTypeAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped disk type lists. + Items *DiskTypeAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type DiskTypeAggregatedListItems struct { +} + +type DiskTypeList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The disk type resources. + Items []*DiskType `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type DiskTypesScopedList struct { + // DiskTypes: List of disk types contained in this scope. + DiskTypes []*DiskType `json:"diskTypes,omitempty"` + + // Warning: Informational warning which replaces the list of disk types + // when the list is empty. + Warning *DiskTypesScopedListWarning `json:"warning,omitempty"` +} + +type DiskTypesScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*DiskTypesScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type DiskTypesScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type DisksScopedList struct { + // Disks: List of disks contained in this scope. + Disks []*Disk `json:"disks,omitempty"` + + // Warning: Informational warning which replaces the list of disks when + // the list is empty. + Warning *DisksScopedListWarning `json:"warning,omitempty"` +} + +type DisksScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*DisksScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type DisksScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type Firewall struct { + // Allowed: The list of rules specified by this firewall. Each rule + // specifies a protocol and port-range tuple that describes a permitted + // connection. + Allowed []*FirewallAllowed `json:"allowed,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Network: URL of the network to which this firewall is applied; + // provided by the client when the firewall is created. + Network string `json:"network,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SourceRanges: A list of IP address blocks expressed in CIDR format + // which this rule applies to. One or both of sourceRanges and + // sourceTags may be set; an inbound connection is allowed if either the + // range or the tag of the source matches. + SourceRanges []string `json:"sourceRanges,omitempty"` + + // SourceTags: A list of instance tags which this rule applies to. One + // or both of sourceRanges and sourceTags may be set; an inbound + // connection is allowed if either the range or the tag of the source + // matches. + SourceTags []string `json:"sourceTags,omitempty"` + + // TargetTags: A list of instance tags indicating sets of instances + // located on network which may make network connections as specified in + // allowed. If no targetTags are specified, the firewall rule applies to + // all instances on the specified network. + TargetTags []string `json:"targetTags,omitempty"` +} + +type FirewallAllowed struct { + // IPProtocol: Required; this is the IP protocol that is allowed for + // this rule. This can either be one of the following well known + // protocol strings ["tcp", "udp", "icmp", "esp", "ah", "sctp"], or the + // IP protocol number. + IPProtocol string `json:"IPProtocol,omitempty"` + + // Ports: An optional list of ports which are allowed. It is an error to + // specify this for any protocol that isn't UDP or TCP. Each entry must + // be either an integer or a range. If not specified, connections + // through any port are allowed. + // + // Example inputs include: ["22"], + // ["80","443"] and ["12345-12349"]. + Ports []string `json:"ports,omitempty"` +} + +type FirewallList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The firewall resources. + Items []*Firewall `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type ForwardingRule struct { + // IPAddress: Value of the reserved IP address that this forwarding rule + // is serving on behalf of. For global forwarding rules, the address + // must be a global IP; for regional forwarding rules, the address must + // live in the same region as the forwarding rule. If left empty + // (default value), an ephemeral IP from the same scope (global or + // regional) will be assigned. + IPAddress string `json:"IPAddress,omitempty"` + + // IPProtocol: The IP protocol to which this rule applies, valid options + // are 'TCP', 'UDP', 'ESP', 'AH' or 'SCTP' + IPProtocol string `json:"IPProtocol,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // PortRange: Applicable only when 'IPProtocol' is 'TCP', 'UDP' or + // 'SCTP', only packets addressed to ports in the specified range will + // be forwarded to 'target'. If 'portRange' is left empty (default + // value), all ports are forwarded. Forwarding rules with the same + // [IPAddress, IPProtocol] pair must have disjoint port ranges. + // @pattern: \d+(?:-\d+)? + PortRange string `json:"portRange,omitempty"` + + // Region: URL of the region where the regional forwarding rule resides + // (output only). This field is not applicable to global forwarding + // rules. + Region string `json:"region,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Target: The URL of the target resource to receive the matched + // traffic. For regional forwarding rules, this target must live in the + // same region as the forwarding rule. For global forwarding rules, this + // target must be a global TargetHttpProxy resource. + Target string `json:"target,omitempty"` +} + +type ForwardingRuleAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped forwarding rule lists. + Items *ForwardingRuleAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type ForwardingRuleAggregatedListItems struct { +} + +type ForwardingRuleList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The ForwardingRule resources. + Items []*ForwardingRule `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type ForwardingRulesScopedList struct { + // ForwardingRules: List of forwarding rules contained in this scope. + ForwardingRules []*ForwardingRule `json:"forwardingRules,omitempty"` + + // Warning: Informational warning which replaces the list of forwarding + // rules when the list is empty. + Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"` +} + +type ForwardingRulesScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type ForwardingRulesScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type HealthCheckReference struct { + HealthCheck string `json:"healthCheck,omitempty"` +} + +type HealthStatus struct { + // HealthState: Health state of the instance. + HealthState string `json:"healthState,omitempty"` + + // Instance: URL of the instance resource. + Instance string `json:"instance,omitempty"` + + // IpAddress: The IP address represented by this resource. + IpAddress string `json:"ipAddress,omitempty"` +} + +type HostRule struct { + Description string `json:"description,omitempty"` + + // Hosts: The list of host patterns to match. They must be FQDN except + // that it may start with ?*.? or ?*-?. The ?*? acts like a glob and + // will match any string of atoms (separated by .?s and -?s) to the + // left. + Hosts []string `json:"hosts,omitempty"` + + // PathMatcher: The name of the PathMatcher to match the path portion of + // the URL, if the this HostRule matches the URL's host portion. + PathMatcher string `json:"pathMatcher,omitempty"` +} + +type HttpHealthCheck struct { + // CheckIntervalSec: How often (in seconds) to send a health check. The + // default value is 5 seconds. + CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // HealthyThreshold: A so-far unhealthy VM will be marked healthy after + // this many consecutive successes. The default value is 2. + HealthyThreshold int64 `json:"healthyThreshold,omitempty"` + + // Host: The value of the host header in the HTTP health check request. + // If left empty (default value), the public IP on behalf of which this + // health check is performed will be used. + Host string `json:"host,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Port: The TCP port number for the HTTP health check request. The + // default value is 80. + Port int64 `json:"port,omitempty"` + + // RequestPath: The request path of the HTTP health check request. The + // default value is "/". + RequestPath string `json:"requestPath,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // TimeoutSec: How long (in seconds) to wait before claiming failure. + // The default value is 5 seconds. + TimeoutSec int64 `json:"timeoutSec,omitempty"` + + // UnhealthyThreshold: A so-far healthy VM will be marked unhealthy + // after this many consecutive failures. The default value is 2. + UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"` +} + +type HttpHealthCheckList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The HttpHealthCheck resources. + Items []*HttpHealthCheck `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Image struct { + // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google + // Cloud Storage (in bytes). + ArchiveSizeBytes int64 `json:"archiveSizeBytes,omitempty,string"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this image. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: Textual description of the resource; provided by the + // client when the resource is created. + Description string `json:"description,omitempty"` + + // DiskSizeGb: Size of the image when restored onto a disk (in GiB). + DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // RawDisk: The raw disk image parameters. + RawDisk *ImageRawDisk `json:"rawDisk,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SourceType: Must be "RAW"; provided by the client when the disk image + // is created. + SourceType string `json:"sourceType,omitempty"` + + // Status: Status of the image (output only). It will be one of the + // following READY - after image has been successfully created and is + // ready for use FAILED - if creating the image fails for some reason + // PENDING - the image creation is in progress An image can be used to + // create other resources suck as instances only after the image has + // been successfully created and the status is set to READY. + Status string `json:"status,omitempty"` +} + +type ImageRawDisk struct { + // ContainerType: The format used to encode and transmit the block + // device. Should be TAR. This is just a container and transmission + // format and not a runtime format. Provided by the client when the disk + // image is created. + ContainerType string `json:"containerType,omitempty"` + + // Sha1Checksum: An optional SHA1 checksum of the disk image before + // unpackaging; provided by the client when the disk image is created. + Sha1Checksum string `json:"sha1Checksum,omitempty"` + + // Source: The full Google Cloud Storage URL where the disk image is + // stored; provided by the client when the disk image is created. + Source string `json:"source,omitempty"` +} + +type ImageList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The disk image resources. + Items []*Image `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Instance struct { + // CanIpForward: Allows this instance to send packets with source IP + // addresses other than its own and receive packets with destination IP + // addresses other than its own. If this instance will be used as an IP + // gateway or it will be set as the next-hop in a Route resource, say + // true. If unsure, leave this set to false. + CanIpForward bool `json:"canIpForward,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Disks: Array of disks associated with this instance. Persistent disks + // must be created before you can assign them. + Disks []*AttachedDisk `json:"disks,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MachineType: URL of the machine type resource describing which + // machine type to use to host the instance; provided by the client when + // the instance is created. + MachineType string `json:"machineType,omitempty"` + + // Metadata: Metadata key/value pairs assigned to this instance. + // Consists of custom metadata or predefined keys; see Instance + // documentation for more information. + Metadata *Metadata `json:"metadata,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // NetworkInterfaces: Array of configurations for this interface. This + // specifies how this interface is configured to interact with other + // network services, such as connecting to the internet. Currently, + // ONE_TO_ONE_NAT is the only access config supported. If there are no + // accessConfigs specified, then this instance will have no external + // internet access. + NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"` + + // Scheduling: Scheduling options for this instance. + Scheduling *Scheduling `json:"scheduling,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // ServiceAccounts: A list of service accounts each with specified + // scopes, for which access tokens are to be made available to the + // instance through metadata queries. + ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"` + + // Status: Instance status. One of the following values: "PROVISIONING", + // "STAGING", "RUNNING", "STOPPING", "STOPPED", "TERMINATED" (output + // only). + Status string `json:"status,omitempty"` + + // StatusMessage: An optional, human-readable explanation of the status + // (output only). + StatusMessage string `json:"statusMessage,omitempty"` + + // Tags: A list of tags to be applied to this instance. Used to identify + // valid sources or targets for network firewalls. Provided by the + // client on instance creation. The tags can be later modified by the + // setTags method. Each tag within the list must comply with RFC1035. + Tags *Tags `json:"tags,omitempty"` + + // Zone: URL of the zone where the instance resides (output only). + Zone string `json:"zone,omitempty"` +} + +type InstanceAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped instance lists. + Items *InstanceAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type InstanceAggregatedListItems struct { +} + +type InstanceList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A list of instance resources. + Items []*Instance `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type InstanceReference struct { + Instance string `json:"instance,omitempty"` +} + +type InstancesScopedList struct { + // Instances: List of instances contained in this scope. + Instances []*Instance `json:"instances,omitempty"` + + // Warning: Informational warning which replaces the list of instances + // when the list is empty. + Warning *InstancesScopedListWarning `json:"warning,omitempty"` +} + +type InstancesScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*InstancesScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type InstancesScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type MachineType struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this machine type. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // GuestCpus: Count of CPUs exposed to the instance. + GuestCpus int64 `json:"guestCpus,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // ImageSpaceGb: Space allotted for the image, defined in GB. + ImageSpaceGb int64 `json:"imageSpaceGb,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MaximumPersistentDisks: Maximum persistent disks allowed. + MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"` + + // MaximumPersistentDisksSizeGb: Maximum total persistent disks size + // (GB) allowed. + MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"` + + // MemoryMb: Physical memory assigned to the instance, defined in MB. + MemoryMb int64 `json:"memoryMb,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // ScratchDisks: List of extended scratch disks assigned to the + // instance. + ScratchDisks []*MachineTypeScratchDisks `json:"scratchDisks,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Zone: Url of the zone where the machine type resides (output only). + Zone string `json:"zone,omitempty"` +} + +type MachineTypeScratchDisks struct { + // DiskGb: Size of the scratch disk, defined in GB. + DiskGb int64 `json:"diskGb,omitempty"` +} + +type MachineTypeAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped machine type lists. + Items *MachineTypeAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type MachineTypeAggregatedListItems struct { +} + +type MachineTypeList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The machine type resources. + Items []*MachineType `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type MachineTypesScopedList struct { + // MachineTypes: List of machine types contained in this scope. + MachineTypes []*MachineType `json:"machineTypes,omitempty"` + + // Warning: Informational warning which replaces the list of machine + // types when the list is empty. + Warning *MachineTypesScopedListWarning `json:"warning,omitempty"` +} + +type MachineTypesScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*MachineTypesScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type MachineTypesScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type Metadata struct { + // Fingerprint: Fingerprint of this resource. A hash of the metadata's + // contents. This field is used for optimistic locking. An up-to-date + // metadata fingerprint must be provided in order to modify metadata. + Fingerprint string `json:"fingerprint,omitempty"` + + // Items: Array of key/value pairs. The total size of all keys and + // values must be less than 512 KB. + Items []*MetadataItems `json:"items,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` +} + +type MetadataItems struct { + // Key: Key for the metadata entry. Keys must conform to the following + // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is + // reflected as part of a URL in the metadata server. Additionally, to + // avoid ambiguity, keys must not conflict with any other metadata keys + // for the project. + Key string `json:"key,omitempty"` + + // Value: Value for the metadata entry. These are free-form strings, and + // only have meaning as interpreted by the image running in the + // instance. The only restriction placed on values is that their size + // must be less than or equal to 32768 bytes. + Value string `json:"value,omitempty"` +} + +type Network struct { + // IPv4Range: Required; The range of internal addresses that are legal + // on this network. This range is a CIDR specification, for example: + // 192.168.0.0/16. Provided by the client when the network is created. + IPv4Range string `json:"IPv4Range,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // GatewayIPv4: An optional address that is used for default routing to + // other networks. This must be within the range specified by IPv4Range, + // and is typically the first usable address in that range. If not + // specified, the default value is the first usable address in + // IPv4Range. + GatewayIPv4 string `json:"gatewayIPv4,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type NetworkInterface struct { + // AccessConfigs: Array of configurations for this interface. This + // specifies how this interface is configured to interact with other + // network services, such as connecting to the internet. Currently, + // ONE_TO_ONE_NAT is the only access config supported. If there are no + // accessConfigs specified, then this instance will have no external + // internet access. + AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"` + + // Name: Name of the network interface, determined by the server; for + // network devices, these are e.g. eth0, eth1, etc. (output only). + Name string `json:"name,omitempty"` + + // Network: URL of the network resource attached to this interface. + Network string `json:"network,omitempty"` + + // NetworkIP: An optional IPV4 internal network address assigned to the + // instance for this network interface (output only). + NetworkIP string `json:"networkIP,omitempty"` +} + +type NetworkList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The network resources. + Items []*Network `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Operation struct { + // ClientOperationId: An optional identifier specified by the client + // when the mutation was initiated. Must be unique for all operation + // resources in the project (output only). + ClientOperationId string `json:"clientOperationId,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // EndTime: The time that this operation was completed. This is in RFC + // 3339 format (output only). + EndTime string `json:"endTime,omitempty"` + + // Error: If errors occurred during processing of this operation, this + // field will be populated (output only). + Error *OperationError `json:"error,omitempty"` + + // HttpErrorMessage: If operation fails, the HTTP error message + // returned, e.g. NOT FOUND. (output only). + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + // HttpErrorStatusCode: If operation fails, the HTTP error status code + // returned, e.g. 404. (output only). + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: The time that this operation was requested. This is in + // RFC 3339 format (output only). + InsertTime string `json:"insertTime,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource (output only). + Name string `json:"name,omitempty"` + + // OperationType: Type of the operation. Examples include "insert", + // "update", and "delete" (output only). + OperationType string `json:"operationType,omitempty"` + + // Progress: An optional progress indicator that ranges from 0 to 100. + // There is no requirement that this be linear or support any + // granularity of operations. This should not be used to guess at when + // the operation will be complete. This number should be monotonically + // increasing as the operation progresses (output only). + Progress int64 `json:"progress,omitempty"` + + // Region: URL of the region where the operation resides (output only). + Region string `json:"region,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // StartTime: The time that this operation was started by the server. + // This is in RFC 3339 format (output only). + StartTime string `json:"startTime,omitempty"` + + // Status: Status of the operation. Can be one of the following: + // "PENDING", "RUNNING", or "DONE" (output only). + Status string `json:"status,omitempty"` + + // StatusMessage: An optional textual description of the current status + // of the operation (output only). + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetId: Unique target id which identifies a particular incarnation + // of the target (output only). + TargetId uint64 `json:"targetId,omitempty,string"` + + // TargetLink: URL of the resource the operation is mutating (output + // only). + TargetLink string `json:"targetLink,omitempty"` + + // User: User who requested the operation, for example + // "user@example.com" (output only). + User string `json:"user,omitempty"` + + // Warnings: If warning messages generated during processing of this + // operation, this field will be populated (output only). + Warnings []*OperationWarnings `json:"warnings,omitempty"` + + // Zone: URL of the zone where the operation resides (output only). + Zone string `json:"zone,omitempty"` +} + +type OperationError struct { + // Errors: The array of errors encountered while processing this + // operation. + Errors []*OperationErrorErrors `json:"errors,omitempty"` +} + +type OperationErrorErrors struct { + // Code: The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: Indicates the field in the request which caused the error. + // This property is optional. + Location string `json:"location,omitempty"` + + // Message: An optional, human-readable error message. + Message string `json:"message,omitempty"` +} + +type OperationWarnings struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*OperationWarningsData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type OperationWarningsData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type OperationAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped operation lists. + Items *OperationAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type OperationAggregatedListItems struct { +} + +type OperationList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The operation resources. + Items []*Operation `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type OperationsScopedList struct { + // Operations: List of operations contained in this scope. + Operations []*Operation `json:"operations,omitempty"` + + // Warning: Informational warning which replaces the list of operations + // when the list is empty. + Warning *OperationsScopedListWarning `json:"warning,omitempty"` +} + +type OperationsScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*OperationsScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type OperationsScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type PathMatcher struct { + // DefaultService: The URL to the BackendService resource. This will be + // used if none of the 'pathRules' defined by this PathMatcher is met by + // the URL's path portion. + DefaultService string `json:"defaultService,omitempty"` + + Description string `json:"description,omitempty"` + + // Name: The name to which this PathMatcher is referred by the HostRule. + Name string `json:"name,omitempty"` + + // PathRules: The list of path rules. + PathRules []*PathRule `json:"pathRules,omitempty"` +} + +type PathRule struct { + // Paths: The list of path patterns to match. Each must start with ?/" + // and the only place a "*" is allowed is at the end following a "/". + // The string fed to the path matcher does not include any text after + // the first "?" or "#", and those chars are not allowed here. + Paths []string `json:"paths,omitempty"` + + // Service: The URL of the BackendService resource if this rule is + // matched. + Service string `json:"service,omitempty"` +} + +type Project struct { + // CommonInstanceMetadata: Metadata key/value pairs available to all + // instances contained in this project. + CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // Quotas: Quotas assigned to this project. + Quotas []*Quota `json:"quotas,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // UsageExportLocation: The location in Cloud Storage and naming method + // of the daily usage report. + UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"` +} + +type Quota struct { + // Limit: Quota limit for this metric. + Limit float64 `json:"limit,omitempty"` + + // Metric: Name of the quota metric. + Metric string `json:"metric,omitempty"` + + // Usage: Current usage of this metric. + Usage float64 `json:"usage,omitempty"` +} + +type Region struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this region. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: Textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // Quotas: Quotas assigned to this region. + Quotas []*Quota `json:"quotas,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Status: Status of the region, "UP" or "DOWN". + Status string `json:"status,omitempty"` + + // Zones: A list of zones homed in this region, in the form of resource + // URLs. + Zones []string `json:"zones,omitempty"` +} + +type RegionList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The region resources. + Items []*Region `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type ResourceGroupReference struct { + Group string `json:"group,omitempty"` +} + +type Route struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // DestRange: Which packets does this route apply to? + DestRange string `json:"destRange,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Network: URL of the network to which this route is applied; provided + // by the client when the route is created. + Network string `json:"network,omitempty"` + + // NextHopGateway: The URL to a gateway that should handle matching + // packets. + NextHopGateway string `json:"nextHopGateway,omitempty"` + + // NextHopInstance: The URL to an instance that should handle matching + // packets. + NextHopInstance string `json:"nextHopInstance,omitempty"` + + // NextHopIp: The network IP address of an instance that should handle + // matching packets. + NextHopIp string `json:"nextHopIp,omitempty"` + + // NextHopNetwork: The URL of the local network if it should handle + // matching packets. + NextHopNetwork string `json:"nextHopNetwork,omitempty"` + + // Priority: Breaks ties between Routes of equal specificity. Routes + // with smaller values win when tied with routes with larger values. + Priority int64 `json:"priority,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Tags: A list of instance tags to which this route applies. + Tags []string `json:"tags,omitempty"` + + // Warnings: If potential misconfigurations are detected for this route, + // this field will be populated with warning messages. + Warnings []*RouteWarnings `json:"warnings,omitempty"` +} + +type RouteWarnings struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*RouteWarningsData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type RouteWarningsData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type RouteList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The route resources. + Items []*Route `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Scheduling struct { + // AutomaticRestart: Whether the Instance should be automatically + // restarted whenever it is terminated by Compute Engine (not terminated + // by user). + AutomaticRestart bool `json:"automaticRestart,omitempty"` + + // OnHostMaintenance: How the instance should behave when the host + // machine undergoes maintenance that may temporarily impact instance + // performance. + OnHostMaintenance string `json:"onHostMaintenance,omitempty"` +} + +type SerialPortOutput struct { + // Contents: The contents of the console output. + Contents string `json:"contents,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type ServiceAccount struct { + // Email: Email address of the service account. + Email string `json:"email,omitempty"` + + // Scopes: The list of scopes to be made available for this service + // account. + Scopes []string `json:"scopes,omitempty"` +} + +type Snapshot struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // DiskSizeGb: Size of the persistent disk snapshot, specified in GB + // (output only). + DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SourceDisk: The source disk used to create this snapshot. Once the + // source disk has been deleted from the system, this field will be + // cleared, and will not be set even if a disk with the same name has + // been re-created (output only). + SourceDisk string `json:"sourceDisk,omitempty"` + + // SourceDiskId: The 'id' value of the disk used to create this + // snapshot. This value may be used to determine whether the snapshot + // was taken from the current or a previous instance of a given disk + // name. + SourceDiskId string `json:"sourceDiskId,omitempty"` + + // Status: The status of the persistent disk snapshot (output only). + Status string `json:"status,omitempty"` + + // StorageBytes: A size of the the storage used by the snapshot. As + // snapshots share storage this number is expected to change with + // snapshot creation/deletion. + StorageBytes int64 `json:"storageBytes,omitempty,string"` + + // StorageBytesStatus: An indicator whether storageBytes is in a stable + // state, or it is being adjusted as a result of shared storage + // reallocation. + StorageBytesStatus string `json:"storageBytesStatus,omitempty"` +} + +type SnapshotList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The persistent snapshot resources. + Items []*Snapshot `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Tags struct { + // Fingerprint: Fingerprint of this resource. A hash of the tags stored + // in this object. This field is used optimistic locking. An up-to-date + // tags fingerprint must be provided in order to modify tags. + Fingerprint string `json:"fingerprint,omitempty"` + + // Items: An array of tags. Each tag must be 1-63 characters long, and + // comply with RFC1035. + Items []string `json:"items,omitempty"` +} + +type TargetHttpProxy struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // UrlMap: URL to the UrlMap resource that defines the mapping from URL + // to the BackendService. + UrlMap string `json:"urlMap,omitempty"` +} + +type TargetHttpProxyList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The TargetHttpProxy resources. + Items []*TargetHttpProxy `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type TargetInstance struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Instance: The URL to the instance that terminates the relevant + // traffic. + Instance string `json:"instance,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // NatPolicy: NAT option controlling how IPs are NAT'ed to the VM. + // Currently only NO_NAT (default value) is supported. + NatPolicy string `json:"natPolicy,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Zone: URL of the zone where the target instance resides (output + // only). + Zone string `json:"zone,omitempty"` +} + +type TargetInstanceAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped target instance lists. + Items *TargetInstanceAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type TargetInstanceAggregatedListItems struct { +} + +type TargetInstanceList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The TargetInstance resources. + Items []*TargetInstance `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type TargetInstancesScopedList struct { + // TargetInstances: List of target instances contained in this scope. + TargetInstances []*TargetInstance `json:"targetInstances,omitempty"` + + // Warning: Informational warning which replaces the list of addresses + // when the list is empty. + Warning *TargetInstancesScopedListWarning `json:"warning,omitempty"` +} + +type TargetInstancesScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type TargetInstancesScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type TargetPool struct { + // BackupPool: This field is applicable only when the containing target + // pool is serving a forwarding rule as the primary pool, and its + // 'failoverRatio' field is properly set to a value between [0, + // 1]. + // + // 'backupPool' and 'failoverRatio' together define the fallback + // behavior of the primary target pool: if the ratio of the healthy VMs + // in the primary pool is at or below 'failoverRatio', traffic arriving + // at the load-balanced IP will be directed to the backup pool. + // + // In case + // where 'failoverRatio' and 'backupPool' are not set, or all the VMs in + // the backup pool are unhealthy, the traffic will be directed back to + // the primary pool in the "force" mode, where traffic will be spread to + // the healthy VMs with the best effort, or to all VMs when no VM is + // healthy. + BackupPool string `json:"backupPool,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // FailoverRatio: This field is applicable only when the containing + // target pool is serving a forwarding rule as the primary pool (i.e., + // not as a backup pool to some other target pool). The value of the + // field must be in [0, 1]. + // + // If set, 'backupPool' must also be set. They + // together define the fallback behavior of the primary target pool: if + // the ratio of the healthy VMs in the primary pool is at or below this + // number, traffic arriving at the load-balanced IP will be directed to + // the backup pool. + // + // In case where 'failoverRatio' is not set or all the + // VMs in the backup pool are unhealthy, the traffic will be directed + // back to the primary pool in the "force" mode, where traffic will be + // spread to the healthy VMs with the best effort, or to all VMs when no + // VM is healthy. + FailoverRatio float64 `json:"failoverRatio,omitempty"` + + // HealthChecks: A list of URLs to the HttpHealthCheck resource. A + // member VM in this pool is considered healthy if and only if all + // specified health checks pass. An empty list means all member VMs will + // be considered healthy at all times. + HealthChecks []string `json:"healthChecks,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Instances: A list of resource URLs to the member VMs serving this + // pool. They must live in zones contained in the same region as this + // pool. + Instances []string `json:"instances,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Region: URL of the region where the target pool resides (output + // only). + Region string `json:"region,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SessionAffinity: Sesssion affinity option, must be one of the + // following values: 'NONE': Connections from the same client IP may go + // to any VM in the pool; 'CLIENT_IP': Connections from the same client + // IP will go to the same VM in the pool while that VM remains healthy. + // 'CLIENT_IP_PROTO': Connections from the same client IP with the same + // IP protocol will go to the same VM in the pool while that VM remains + // healthy. + SessionAffinity string `json:"sessionAffinity,omitempty"` +} + +type TargetPoolAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped target pool lists. + Items *TargetPoolAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type TargetPoolAggregatedListItems struct { +} + +type TargetPoolInstanceHealth struct { + HealthStatus []*HealthStatus `json:"healthStatus,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` +} + +type TargetPoolList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The TargetPool resources. + Items []*TargetPool `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type TargetPoolsAddHealthCheckRequest struct { + // HealthChecks: Health check URLs to be added to targetPool. + HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"` +} + +type TargetPoolsAddInstanceRequest struct { + // Instances: URLs of the instances to be added to targetPool. + Instances []*InstanceReference `json:"instances,omitempty"` +} + +type TargetPoolsRemoveHealthCheckRequest struct { + // HealthChecks: Health check URLs to be removed from targetPool. + HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"` +} + +type TargetPoolsRemoveInstanceRequest struct { + // Instances: URLs of the instances to be removed from targetPool. + Instances []*InstanceReference `json:"instances,omitempty"` +} + +type TargetPoolsScopedList struct { + // TargetPools: List of target pools contained in this scope. + TargetPools []*TargetPool `json:"targetPools,omitempty"` + + // Warning: Informational warning which replaces the list of addresses + // when the list is empty. + Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"` +} + +type TargetPoolsScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type TargetPoolsScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type TargetReference struct { + Target string `json:"target,omitempty"` +} + +type TestFailure struct { + ActualService string `json:"actualService,omitempty"` + + ExpectedService string `json:"expectedService,omitempty"` + + Host string `json:"host,omitempty"` + + Path string `json:"path,omitempty"` +} + +type UrlMap struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // DefaultService: The URL of the BackendService resource if none of the + // hostRules match. + DefaultService string `json:"defaultService,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Fingerprint: Fingerprint of this resource. A hash of the contents + // stored in this object. This field is used in optimistic locking. This + // field will be ignored when inserting a UrlMap. An up-to-date + // fingerprint must be provided in order to update the UrlMap. + Fingerprint string `json:"fingerprint,omitempty"` + + // HostRules: The list of HostRules to use against the URL. + HostRules []*HostRule `json:"hostRules,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // PathMatchers: The list of named PathMatchers to use against the URL. + PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Tests: The list of expected URL mappings. Request to update this + // UrlMap will succeed only all of the test cases pass. + Tests []*UrlMapTest `json:"tests,omitempty"` +} + +type UrlMapList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The UrlMap resources. + Items []*UrlMap `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type UrlMapReference struct { + UrlMap string `json:"urlMap,omitempty"` +} + +type UrlMapTest struct { + // Description: Description of this test case. + Description string `json:"description,omitempty"` + + // Host: Host portion of the URL. + Host string `json:"host,omitempty"` + + // Path: Path portion of the URL. + Path string `json:"path,omitempty"` + + // Service: Expected BackendService resource the given URL should be + // mapped to. + Service string `json:"service,omitempty"` +} + +type UrlMapValidationResult struct { + LoadErrors []string `json:"loadErrors,omitempty"` + + // LoadSucceeded: Whether the given UrlMap can be successfully loaded. + // If false, 'loadErrors' indicates the reasons. + LoadSucceeded bool `json:"loadSucceeded,omitempty"` + + TestFailures []*TestFailure `json:"testFailures,omitempty"` + + // TestPassed: If successfully loaded, this field indicates whether the + // test passed. If false, 'testFailures's indicate the reason of + // failure. + TestPassed bool `json:"testPassed,omitempty"` +} + +type UrlMapsValidateRequest struct { + // Resource: Content of the UrlMap to be validated. + Resource *UrlMap `json:"resource,omitempty"` +} + +type UrlMapsValidateResponse struct { + Result *UrlMapValidationResult `json:"result,omitempty"` +} + +type UsageExportLocation struct { + // BucketName: The name of an existing bucket in Cloud Storage where the + // usage report object is stored. The Google Service Account is granted + // write access to this bucket. This is simply the bucket name, with no + // "gs://" or "https://storage.googleapis.com/" in front of it. + BucketName string `json:"bucketName,omitempty"` + + // ReportNamePrefix: An optional prefix for the name of the usage report + // object stored in bucket_name. If not supplied, defaults to "usage_". + // The report is stored as a CSV file named _gce_.csv. where is the day + // of the usage according to Pacific Time. The prefix should conform to + // Cloud Storage object naming conventions. + ReportNamePrefix string `json:"reportNamePrefix,omitempty"` +} + +type Zone struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this zone. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: Textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MaintenanceWindows: Scheduled maintenance windows for the zone. When + // the zone is in a maintenance window, all resources which reside in + // the zone will be unavailable. + MaintenanceWindows []*ZoneMaintenanceWindows `json:"maintenanceWindows,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // Region: Full URL reference to the region which hosts the zone (output + // only). + Region string `json:"region,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Status: Status of the zone. "UP" or "DOWN". + Status string `json:"status,omitempty"` +} + +type ZoneMaintenanceWindows struct { + // BeginTime: Begin time of the maintenance window, in RFC 3339 format. + BeginTime string `json:"beginTime,omitempty"` + + // Description: Textual description of the maintenance window. + Description string `json:"description,omitempty"` + + // EndTime: End time of the maintenance window, in RFC 3339 format. + EndTime string `json:"endTime,omitempty"` + + // Name: Name of the maintenance window. + Name string `json:"name,omitempty"` +} + +type ZoneList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The zone resources. + Items []*Zone `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +// method id "compute.addresses.aggregatedList": + +type AddressesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of addresses grouped by scope. +func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall { + c := &AddressesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AddressesAggregatedListCall) Do() (*AddressAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *AddressAggregatedList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of addresses grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.addresses.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/addresses", + // "response": { + // "$ref": "AddressAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.addresses.delete": + +type AddressesDeleteCall struct { + s *Service + project string + region string + address string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified address resource. +func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall { + c := &AddressesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.address = address + return c +} + +func (c *AddressesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{address}", url.QueryEscape(c.address), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified address resource.", + // "httpMethod": "DELETE", + // "id": "compute.addresses.delete", + // "parameterOrder": [ + // "project", + // "region", + // "address" + // ], + // "parameters": { + // "address": { + // "description": "Name of the address resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/addresses/{address}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.addresses.get": + +type AddressesGetCall struct { + s *Service + project string + region string + address string + opt_ map[string]interface{} +} + +// Get: Returns the specified address resource. +func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall { + c := &AddressesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.address = address + return c +} + +func (c *AddressesGetCall) Do() (*Address, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{address}", url.QueryEscape(c.address), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Address + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified address resource.", + // "httpMethod": "GET", + // "id": "compute.addresses.get", + // "parameterOrder": [ + // "project", + // "region", + // "address" + // ], + // "parameters": { + // "address": { + // "description": "Name of the address resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/addresses/{address}", + // "response": { + // "$ref": "Address" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.addresses.insert": + +type AddressesInsertCall struct { + s *Service + project string + region string + address *Address + opt_ map[string]interface{} +} + +// Insert: Creates an address resource in the specified project using +// the data included in the request. +func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall { + c := &AddressesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.address = address + return c +} + +func (c *AddressesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.address) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an address resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.addresses.insert", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/addresses", + // "request": { + // "$ref": "Address" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.addresses.list": + +type AddressesListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} +} + +// List: Retrieves the list of address resources contained within the +// specified region. +func (r *AddressesService) List(project string, region string) *AddressesListCall { + c := &AddressesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *AddressesListCall) Filter(filter string) *AddressesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AddressesListCall) Do() (*AddressList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *AddressList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of address resources contained within the specified region.", + // "httpMethod": "GET", + // "id": "compute.addresses.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/addresses", + // "response": { + // "$ref": "AddressList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.backendServices.delete": + +type BackendServicesDeleteCall struct { + s *Service + project string + backendService string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified BackendService resource. +func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall { + c := &BackendServicesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.backendService = backendService + return c +} + +func (c *BackendServicesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{backendService}", url.QueryEscape(c.backendService), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified BackendService resource.", + // "httpMethod": "DELETE", + // "id": "compute.backendServices.delete", + // "parameterOrder": [ + // "project", + // "backendService" + // ], + // "parameters": { + // "backendService": { + // "description": "Name of the BackendService resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/backendServices/{backendService}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.backendServices.get": + +type BackendServicesGetCall struct { + s *Service + project string + backendService string + opt_ map[string]interface{} +} + +// Get: Returns the specified BackendService resource. +func (r *BackendServicesService) Get(project string, backendService string) *BackendServicesGetCall { + c := &BackendServicesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.backendService = backendService + return c +} + +func (c *BackendServicesGetCall) Do() (*BackendService, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{backendService}", url.QueryEscape(c.backendService), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *BackendService + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified BackendService resource.", + // "httpMethod": "GET", + // "id": "compute.backendServices.get", + // "parameterOrder": [ + // "project", + // "backendService" + // ], + // "parameters": { + // "backendService": { + // "description": "Name of the BackendService resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/backendServices/{backendService}", + // "response": { + // "$ref": "BackendService" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.backendServices.getHealth": + +type BackendServicesGetHealthCall struct { + s *Service + project string + backendService string + resourcegroupreference *ResourceGroupReference + opt_ map[string]interface{} +} + +// GetHealth: Gets the most recent health check results for this +// BackendService. +func (r *BackendServicesService) GetHealth(project string, backendService string, resourcegroupreference *ResourceGroupReference) *BackendServicesGetHealthCall { + c := &BackendServicesGetHealthCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.backendService = backendService + c.resourcegroupreference = resourcegroupreference + return c +} + +func (c *BackendServicesGetHealthCall) Do() (*BackendServiceGroupHealth, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/getHealth") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{backendService}", url.QueryEscape(c.backendService), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *BackendServiceGroupHealth + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the most recent health check results for this BackendService.", + // "httpMethod": "POST", + // "id": "compute.backendServices.getHealth", + // "parameterOrder": [ + // "project", + // "backendService" + // ], + // "parameters": { + // "backendService": { + // "description": "Name of the BackendService resource to which the queried instance belongs.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/backendServices/{backendService}/getHealth", + // "request": { + // "$ref": "ResourceGroupReference" + // }, + // "response": { + // "$ref": "BackendServiceGroupHealth" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.backendServices.insert": + +type BackendServicesInsertCall struct { + s *Service + project string + backendservice *BackendService + opt_ map[string]interface{} +} + +// Insert: Creates a BackendService resource in the specified project +// using the data included in the request. +func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall { + c := &BackendServicesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.backendservice = backendservice + return c +} + +func (c *BackendServicesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a BackendService resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.backendServices.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/backendServices", + // "request": { + // "$ref": "BackendService" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.backendServices.list": + +type BackendServicesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of BackendService resources available to the +// specified project. +func (r *BackendServicesService) List(project string) *BackendServicesListCall { + c := &BackendServicesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *BackendServicesListCall) Filter(filter string) *BackendServicesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *BackendServicesListCall) Do() (*BackendServiceList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *BackendServiceList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of BackendService resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.backendServices.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/backendServices", + // "response": { + // "$ref": "BackendServiceList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.backendServices.patch": + +type BackendServicesPatchCall struct { + s *Service + project string + backendService string + backendservice *BackendService + opt_ map[string]interface{} +} + +// Patch: Update the entire content of the BackendService resource. This +// method supports patch semantics. +func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall { + c := &BackendServicesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.backendService = backendService + c.backendservice = backendservice + return c +} + +func (c *BackendServicesPatchCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{backendService}", url.QueryEscape(c.backendService), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the entire content of the BackendService resource. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "compute.backendServices.patch", + // "parameterOrder": [ + // "project", + // "backendService" + // ], + // "parameters": { + // "backendService": { + // "description": "Name of the BackendService resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/backendServices/{backendService}", + // "request": { + // "$ref": "BackendService" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.backendServices.update": + +type BackendServicesUpdateCall struct { + s *Service + project string + backendService string + backendservice *BackendService + opt_ map[string]interface{} +} + +// Update: Update the entire content of the BackendService resource. +func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall { + c := &BackendServicesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.backendService = backendService + c.backendservice = backendservice + return c +} + +func (c *BackendServicesUpdateCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{backendService}", url.QueryEscape(c.backendService), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the entire content of the BackendService resource.", + // "httpMethod": "PUT", + // "id": "compute.backendServices.update", + // "parameterOrder": [ + // "project", + // "backendService" + // ], + // "parameters": { + // "backendService": { + // "description": "Name of the BackendService resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/backendServices/{backendService}", + // "request": { + // "$ref": "BackendService" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.diskTypes.aggregatedList": + +type DiskTypesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of disk type resources grouped by +// scope. +func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall { + c := &DiskTypesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *DiskTypesAggregatedListCall) Filter(filter string) *DiskTypesAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *DiskTypesAggregatedListCall) Do() (*DiskTypeAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/diskTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *DiskTypeAggregatedList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of disk type resources grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.diskTypes.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/diskTypes", + // "response": { + // "$ref": "DiskTypeAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.diskTypes.get": + +type DiskTypesGetCall struct { + s *Service + project string + zone string + diskType string + opt_ map[string]interface{} +} + +// Get: Returns the specified disk type resource. +func (r *DiskTypesService) Get(project string, zone string, diskType string) *DiskTypesGetCall { + c := &DiskTypesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.diskType = diskType + return c +} + +func (c *DiskTypesGetCall) Do() (*DiskType, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes/{diskType}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{diskType}", url.QueryEscape(c.diskType), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *DiskType + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified disk type resource.", + // "httpMethod": "GET", + // "id": "compute.diskTypes.get", + // "parameterOrder": [ + // "project", + // "zone", + // "diskType" + // ], + // "parameters": { + // "diskType": { + // "description": "Name of the disk type resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/diskTypes/{diskType}", + // "response": { + // "$ref": "DiskType" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.diskTypes.list": + +type DiskTypesListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// List: Retrieves the list of disk type resources available to the +// specified project. +func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall { + c := &DiskTypesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *DiskTypesListCall) Filter(filter string) *DiskTypesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *DiskTypesListCall) Do() (*DiskTypeList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *DiskTypeList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of disk type resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.diskTypes.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/diskTypes", + // "response": { + // "$ref": "DiskTypeList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.disks.aggregatedList": + +type DisksAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of disks grouped by scope. +func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall { + c := &DisksAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *DisksAggregatedListCall) Do() (*DiskAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/disks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *DiskAggregatedList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of disks grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.disks.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/disks", + // "response": { + // "$ref": "DiskAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.disks.createSnapshot": + +type DisksCreateSnapshotCall struct { + s *Service + project string + zone string + disk string + snapshot *Snapshot + opt_ map[string]interface{} +} + +// CreateSnapshot: +func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall { + c := &DisksCreateSnapshotCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.disk = disk + c.snapshot = snapshot + return c +} + +func (c *DisksCreateSnapshotCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/createSnapshot") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{disk}", url.QueryEscape(c.disk), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "POST", + // "id": "compute.disks.createSnapshot", + // "parameterOrder": [ + // "project", + // "zone", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk resource to snapshot.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot", + // "request": { + // "$ref": "Snapshot" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.disks.delete": + +type DisksDeleteCall struct { + s *Service + project string + zone string + disk string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified persistent disk resource. +func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall { + c := &DisksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.disk = disk + return c +} + +func (c *DisksDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{disk}", url.QueryEscape(c.disk), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified persistent disk resource.", + // "httpMethod": "DELETE", + // "id": "compute.disks.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks/{disk}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.disks.get": + +type DisksGetCall struct { + s *Service + project string + zone string + disk string + opt_ map[string]interface{} +} + +// Get: Returns the specified persistent disk resource. +func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall { + c := &DisksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.disk = disk + return c +} + +func (c *DisksGetCall) Do() (*Disk, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{disk}", url.QueryEscape(c.disk), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Disk + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified persistent disk resource.", + // "httpMethod": "GET", + // "id": "compute.disks.get", + // "parameterOrder": [ + // "project", + // "zone", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks/{disk}", + // "response": { + // "$ref": "Disk" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.disks.insert": + +type DisksInsertCall struct { + s *Service + project string + zone string + disk *Disk + opt_ map[string]interface{} +} + +// Insert: Creates a persistent disk resource in the specified project +// using the data included in the request. +func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall { + c := &DisksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.disk = disk + return c +} + +// SourceImage sets the optional parameter "sourceImage": Source image +// to restore onto a disk. +func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall { + c.opt_["sourceImage"] = sourceImage + return c +} + +func (c *DisksInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["sourceImage"]; ok { + params.Set("sourceImage", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a persistent disk resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.disks.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "sourceImage": { + // "description": "Optional. Source image to restore onto a disk.", + // "location": "query", + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks", + // "request": { + // "$ref": "Disk" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.disks.list": + +type DisksListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// List: Retrieves the list of persistent disk resources contained +// within the specified zone. +func (r *DisksService) List(project string, zone string) *DisksListCall { + c := &DisksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *DisksListCall) Filter(filter string) *DisksListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *DisksListCall) PageToken(pageToken string) *DisksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *DisksListCall) Do() (*DiskList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *DiskList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of persistent disk resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.disks.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks", + // "response": { + // "$ref": "DiskList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.firewalls.delete": + +type FirewallsDeleteCall struct { + s *Service + project string + firewall string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified firewall resource. +func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall { + c := &FirewallsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + return c +} + +func (c *FirewallsDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{firewall}", url.QueryEscape(c.firewall), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified firewall resource.", + // "httpMethod": "DELETE", + // "id": "compute.firewalls.delete", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls/{firewall}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.get": + +type FirewallsGetCall struct { + s *Service + project string + firewall string + opt_ map[string]interface{} +} + +// Get: Returns the specified firewall resource. +func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall { + c := &FirewallsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + return c +} + +func (c *FirewallsGetCall) Do() (*Firewall, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{firewall}", url.QueryEscape(c.firewall), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Firewall + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified firewall resource.", + // "httpMethod": "GET", + // "id": "compute.firewalls.get", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls/{firewall}", + // "response": { + // "$ref": "Firewall" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.firewalls.insert": + +type FirewallsInsertCall struct { + s *Service + project string + firewall *Firewall + opt_ map[string]interface{} +} + +// Insert: Creates a firewall resource in the specified project using +// the data included in the request. +func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall { + c := &FirewallsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + return c +} + +func (c *FirewallsInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a firewall resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.firewalls.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls", + // "request": { + // "$ref": "Firewall" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.list": + +type FirewallsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of firewall resources available to the +// specified project. +func (r *FirewallsService) List(project string) *FirewallsListCall { + c := &FirewallsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *FirewallsListCall) Do() (*FirewallList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *FirewallList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of firewall resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.firewalls.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls", + // "response": { + // "$ref": "FirewallList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.firewalls.patch": + +type FirewallsPatchCall struct { + s *Service + project string + firewall string + firewall2 *Firewall + opt_ map[string]interface{} +} + +// Patch: Updates the specified firewall resource with the data included +// in the request. This method supports patch semantics. +func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall { + c := &FirewallsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + c.firewall2 = firewall2 + return c +} + +func (c *FirewallsPatchCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{firewall}", url.QueryEscape(c.firewall), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified firewall resource with the data included in the request. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "compute.firewalls.patch", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls/{firewall}", + // "request": { + // "$ref": "Firewall" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.update": + +type FirewallsUpdateCall struct { + s *Service + project string + firewall string + firewall2 *Firewall + opt_ map[string]interface{} +} + +// Update: Updates the specified firewall resource with the data +// included in the request. +func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall { + c := &FirewallsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + c.firewall2 = firewall2 + return c +} + +func (c *FirewallsUpdateCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{firewall}", url.QueryEscape(c.firewall), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified firewall resource with the data included in the request.", + // "httpMethod": "PUT", + // "id": "compute.firewalls.update", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls/{firewall}", + // "request": { + // "$ref": "Firewall" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.forwardingRules.aggregatedList": + +type ForwardingRulesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of forwarding rules grouped by +// scope. +func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall { + c := &ForwardingRulesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ForwardingRulesAggregatedListCall) Do() (*ForwardingRuleAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *ForwardingRuleAggregatedList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of forwarding rules grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.forwardingRules.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/forwardingRules", + // "response": { + // "$ref": "ForwardingRuleAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.forwardingRules.delete": + +type ForwardingRulesDeleteCall struct { + s *Service + project string + region string + forwardingRule string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified ForwardingRule resource. +func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall { + c := &ForwardingRulesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.forwardingRule = forwardingRule + return c +} + +func (c *ForwardingRulesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{forwardingRule}", url.QueryEscape(c.forwardingRule), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified ForwardingRule resource.", + // "httpMethod": "DELETE", + // "id": "compute.forwardingRules.delete", + // "parameterOrder": [ + // "project", + // "region", + // "forwardingRule" + // ], + // "parameters": { + // "forwardingRule": { + // "description": "Name of the ForwardingRule resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.forwardingRules.get": + +type ForwardingRulesGetCall struct { + s *Service + project string + region string + forwardingRule string + opt_ map[string]interface{} +} + +// Get: Returns the specified ForwardingRule resource. +func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall { + c := &ForwardingRulesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.forwardingRule = forwardingRule + return c +} + +func (c *ForwardingRulesGetCall) Do() (*ForwardingRule, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{forwardingRule}", url.QueryEscape(c.forwardingRule), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *ForwardingRule + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified ForwardingRule resource.", + // "httpMethod": "GET", + // "id": "compute.forwardingRules.get", + // "parameterOrder": [ + // "project", + // "region", + // "forwardingRule" + // ], + // "parameters": { + // "forwardingRule": { + // "description": "Name of the ForwardingRule resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}", + // "response": { + // "$ref": "ForwardingRule" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.forwardingRules.insert": + +type ForwardingRulesInsertCall struct { + s *Service + project string + region string + forwardingrule *ForwardingRule + opt_ map[string]interface{} +} + +// Insert: Creates a ForwardingRule resource in the specified project +// and region using the data included in the request. +func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall { + c := &ForwardingRulesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.forwardingrule = forwardingrule + return c +} + +func (c *ForwardingRulesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.forwardingRules.insert", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/forwardingRules", + // "request": { + // "$ref": "ForwardingRule" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.forwardingRules.list": + +type ForwardingRulesListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} +} + +// List: Retrieves the list of ForwardingRule resources available to the +// specified project and region. +func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall { + c := &ForwardingRulesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ForwardingRulesListCall) Do() (*ForwardingRuleList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *ForwardingRuleList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of ForwardingRule resources available to the specified project and region.", + // "httpMethod": "GET", + // "id": "compute.forwardingRules.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/forwardingRules", + // "response": { + // "$ref": "ForwardingRuleList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.forwardingRules.setTarget": + +type ForwardingRulesSetTargetCall struct { + s *Service + project string + region string + forwardingRule string + targetreference *TargetReference + opt_ map[string]interface{} +} + +// SetTarget: Changes target url for forwarding rule. +func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall { + c := &ForwardingRulesSetTargetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.forwardingRule = forwardingRule + c.targetreference = targetreference + return c +} + +func (c *ForwardingRulesSetTargetCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{forwardingRule}", url.QueryEscape(c.forwardingRule), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Changes target url for forwarding rule.", + // "httpMethod": "POST", + // "id": "compute.forwardingRules.setTarget", + // "parameterOrder": [ + // "project", + // "region", + // "forwardingRule" + // ], + // "parameters": { + // "forwardingRule": { + // "description": "Name of the ForwardingRule resource in which target is to be set.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget", + // "request": { + // "$ref": "TargetReference" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalAddresses.delete": + +type GlobalAddressesDeleteCall struct { + s *Service + project string + address string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified address resource. +func (r *GlobalAddressesService) Delete(project string, address string) *GlobalAddressesDeleteCall { + c := &GlobalAddressesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.address = address + return c +} + +func (c *GlobalAddressesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{address}", url.QueryEscape(c.address), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified address resource.", + // "httpMethod": "DELETE", + // "id": "compute.globalAddresses.delete", + // "parameterOrder": [ + // "project", + // "address" + // ], + // "parameters": { + // "address": { + // "description": "Name of the address resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/addresses/{address}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalAddresses.get": + +type GlobalAddressesGetCall struct { + s *Service + project string + address string + opt_ map[string]interface{} +} + +// Get: Returns the specified address resource. +func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall { + c := &GlobalAddressesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.address = address + return c +} + +func (c *GlobalAddressesGetCall) Do() (*Address, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{address}", url.QueryEscape(c.address), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Address + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified address resource.", + // "httpMethod": "GET", + // "id": "compute.globalAddresses.get", + // "parameterOrder": [ + // "project", + // "address" + // ], + // "parameters": { + // "address": { + // "description": "Name of the address resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/addresses/{address}", + // "response": { + // "$ref": "Address" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.globalAddresses.insert": + +type GlobalAddressesInsertCall struct { + s *Service + project string + address *Address + opt_ map[string]interface{} +} + +// Insert: Creates an address resource in the specified project using +// the data included in the request. +func (r *GlobalAddressesService) Insert(project string, address *Address) *GlobalAddressesInsertCall { + c := &GlobalAddressesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.address = address + return c +} + +func (c *GlobalAddressesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.address) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an address resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.globalAddresses.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/addresses", + // "request": { + // "$ref": "Address" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalAddresses.list": + +type GlobalAddressesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of global address resources. +func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall { + c := &GlobalAddressesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *GlobalAddressesListCall) Filter(filter string) *GlobalAddressesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *GlobalAddressesListCall) Do() (*AddressList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *AddressList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of global address resources.", + // "httpMethod": "GET", + // "id": "compute.globalAddresses.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/addresses", + // "response": { + // "$ref": "AddressList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.globalForwardingRules.delete": + +type GlobalForwardingRulesDeleteCall struct { + s *Service + project string + forwardingRule string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified ForwardingRule resource. +func (r *GlobalForwardingRulesService) Delete(project string, forwardingRule string) *GlobalForwardingRulesDeleteCall { + c := &GlobalForwardingRulesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.forwardingRule = forwardingRule + return c +} + +func (c *GlobalForwardingRulesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{forwardingRule}", url.QueryEscape(c.forwardingRule), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified ForwardingRule resource.", + // "httpMethod": "DELETE", + // "id": "compute.globalForwardingRules.delete", + // "parameterOrder": [ + // "project", + // "forwardingRule" + // ], + // "parameters": { + // "forwardingRule": { + // "description": "Name of the ForwardingRule resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/forwardingRules/{forwardingRule}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalForwardingRules.get": + +type GlobalForwardingRulesGetCall struct { + s *Service + project string + forwardingRule string + opt_ map[string]interface{} +} + +// Get: Returns the specified ForwardingRule resource. +func (r *GlobalForwardingRulesService) Get(project string, forwardingRule string) *GlobalForwardingRulesGetCall { + c := &GlobalForwardingRulesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.forwardingRule = forwardingRule + return c +} + +func (c *GlobalForwardingRulesGetCall) Do() (*ForwardingRule, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{forwardingRule}", url.QueryEscape(c.forwardingRule), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *ForwardingRule + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified ForwardingRule resource.", + // "httpMethod": "GET", + // "id": "compute.globalForwardingRules.get", + // "parameterOrder": [ + // "project", + // "forwardingRule" + // ], + // "parameters": { + // "forwardingRule": { + // "description": "Name of the ForwardingRule resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/forwardingRules/{forwardingRule}", + // "response": { + // "$ref": "ForwardingRule" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.globalForwardingRules.insert": + +type GlobalForwardingRulesInsertCall struct { + s *Service + project string + forwardingrule *ForwardingRule + opt_ map[string]interface{} +} + +// Insert: Creates a ForwardingRule resource in the specified project +// and region using the data included in the request. +func (r *GlobalForwardingRulesService) Insert(project string, forwardingrule *ForwardingRule) *GlobalForwardingRulesInsertCall { + c := &GlobalForwardingRulesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.forwardingrule = forwardingrule + return c +} + +func (c *GlobalForwardingRulesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.globalForwardingRules.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/forwardingRules", + // "request": { + // "$ref": "ForwardingRule" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalForwardingRules.list": + +type GlobalForwardingRulesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of ForwardingRule resources available to the +// specified project. +func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall { + c := &GlobalForwardingRulesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *GlobalForwardingRulesListCall) Filter(filter string) *GlobalForwardingRulesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *GlobalForwardingRulesListCall) Do() (*ForwardingRuleList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *ForwardingRuleList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of ForwardingRule resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.globalForwardingRules.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/forwardingRules", + // "response": { + // "$ref": "ForwardingRuleList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.globalForwardingRules.setTarget": + +type GlobalForwardingRulesSetTargetCall struct { + s *Service + project string + forwardingRule string + targetreference *TargetReference + opt_ map[string]interface{} +} + +// SetTarget: Changes target url for forwarding rule. +func (r *GlobalForwardingRulesService) SetTarget(project string, forwardingRule string, targetreference *TargetReference) *GlobalForwardingRulesSetTargetCall { + c := &GlobalForwardingRulesSetTargetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.forwardingRule = forwardingRule + c.targetreference = targetreference + return c +} + +func (c *GlobalForwardingRulesSetTargetCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}/setTarget") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{forwardingRule}", url.QueryEscape(c.forwardingRule), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Changes target url for forwarding rule.", + // "httpMethod": "POST", + // "id": "compute.globalForwardingRules.setTarget", + // "parameterOrder": [ + // "project", + // "forwardingRule" + // ], + // "parameters": { + // "forwardingRule": { + // "description": "Name of the ForwardingRule resource in which target is to be set.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/forwardingRules/{forwardingRule}/setTarget", + // "request": { + // "$ref": "TargetReference" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalOperations.aggregatedList": + +type GlobalOperationsAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of all operations grouped by +// scope. +func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall { + c := &GlobalOperationsAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *GlobalOperationsAggregatedListCall) Do() (*OperationAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *OperationAggregatedList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of all operations grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.globalOperations.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/operations", + // "response": { + // "$ref": "OperationAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.globalOperations.delete": + +type GlobalOperationsDeleteCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified operation resource. +func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall { + c := &GlobalOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +func (c *GlobalOperationsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified operation resource.", + // "httpMethod": "DELETE", + // "id": "compute.globalOperations.delete", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/operations/{operation}", + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalOperations.get": + +type GlobalOperationsGetCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} +} + +// Get: Retrieves the specified operation resource. +func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall { + c := &GlobalOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +func (c *GlobalOperationsGetCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified operation resource.", + // "httpMethod": "GET", + // "id": "compute.globalOperations.get", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/operations/{operation}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.globalOperations.list": + +type GlobalOperationsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of operation resources contained within the +// specified project. +func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall { + c := &GlobalOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *GlobalOperationsListCall) Do() (*OperationList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *OperationList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.globalOperations.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/operations", + // "response": { + // "$ref": "OperationList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.httpHealthChecks.delete": + +type HttpHealthChecksDeleteCall struct { + s *Service + project string + httpHealthCheck string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified HttpHealthCheck resource. +func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall { + c := &HttpHealthChecksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpHealthCheck = httpHealthCheck + return c +} + +func (c *HttpHealthChecksDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{httpHealthCheck}", url.QueryEscape(c.httpHealthCheck), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified HttpHealthCheck resource.", + // "httpMethod": "DELETE", + // "id": "compute.httpHealthChecks.delete", + // "parameterOrder": [ + // "project", + // "httpHealthCheck" + // ], + // "parameters": { + // "httpHealthCheck": { + // "description": "Name of the HttpHealthCheck resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpHealthChecks.get": + +type HttpHealthChecksGetCall struct { + s *Service + project string + httpHealthCheck string + opt_ map[string]interface{} +} + +// Get: Returns the specified HttpHealthCheck resource. +func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall { + c := &HttpHealthChecksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpHealthCheck = httpHealthCheck + return c +} + +func (c *HttpHealthChecksGetCall) Do() (*HttpHealthCheck, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{httpHealthCheck}", url.QueryEscape(c.httpHealthCheck), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *HttpHealthCheck + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified HttpHealthCheck resource.", + // "httpMethod": "GET", + // "id": "compute.httpHealthChecks.get", + // "parameterOrder": [ + // "project", + // "httpHealthCheck" + // ], + // "parameters": { + // "httpHealthCheck": { + // "description": "Name of the HttpHealthCheck resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + // "response": { + // "$ref": "HttpHealthCheck" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.httpHealthChecks.insert": + +type HttpHealthChecksInsertCall struct { + s *Service + project string + httphealthcheck *HttpHealthCheck + opt_ map[string]interface{} +} + +// Insert: Creates a HttpHealthCheck resource in the specified project +// using the data included in the request. +func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall { + c := &HttpHealthChecksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httphealthcheck = httphealthcheck + return c +} + +func (c *HttpHealthChecksInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.httpHealthChecks.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpHealthChecks", + // "request": { + // "$ref": "HttpHealthCheck" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpHealthChecks.list": + +type HttpHealthChecksListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of HttpHealthCheck resources available to +// the specified project. +func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall { + c := &HttpHealthChecksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *HttpHealthChecksListCall) Do() (*HttpHealthCheckList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *HttpHealthCheckList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.httpHealthChecks.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpHealthChecks", + // "response": { + // "$ref": "HttpHealthCheckList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.httpHealthChecks.patch": + +type HttpHealthChecksPatchCall struct { + s *Service + project string + httpHealthCheck string + httphealthcheck *HttpHealthCheck + opt_ map[string]interface{} +} + +// Patch: Updates a HttpHealthCheck resource in the specified project +// using the data included in the request. This method supports patch +// semantics. +func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall { + c := &HttpHealthChecksPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpHealthCheck = httpHealthCheck + c.httphealthcheck = httphealthcheck + return c +} + +func (c *HttpHealthChecksPatchCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{httpHealthCheck}", url.QueryEscape(c.httpHealthCheck), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "compute.httpHealthChecks.patch", + // "parameterOrder": [ + // "project", + // "httpHealthCheck" + // ], + // "parameters": { + // "httpHealthCheck": { + // "description": "Name of the HttpHealthCheck resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + // "request": { + // "$ref": "HttpHealthCheck" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpHealthChecks.update": + +type HttpHealthChecksUpdateCall struct { + s *Service + project string + httpHealthCheck string + httphealthcheck *HttpHealthCheck + opt_ map[string]interface{} +} + +// Update: Updates a HttpHealthCheck resource in the specified project +// using the data included in the request. +func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall { + c := &HttpHealthChecksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpHealthCheck = httpHealthCheck + c.httphealthcheck = httphealthcheck + return c +} + +func (c *HttpHealthChecksUpdateCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{httpHealthCheck}", url.QueryEscape(c.httpHealthCheck), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.", + // "httpMethod": "PUT", + // "id": "compute.httpHealthChecks.update", + // "parameterOrder": [ + // "project", + // "httpHealthCheck" + // ], + // "parameters": { + // "httpHealthCheck": { + // "description": "Name of the HttpHealthCheck resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + // "request": { + // "$ref": "HttpHealthCheck" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.delete": + +type ImagesDeleteCall struct { + s *Service + project string + image string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified image resource. +func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall { + c := &ImagesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + return c +} + +func (c *ImagesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{image}", url.QueryEscape(c.image), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified image resource.", + // "httpMethod": "DELETE", + // "id": "compute.images.delete", + // "parameterOrder": [ + // "project", + // "image" + // ], + // "parameters": { + // "image": { + // "description": "Name of the image resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images/{image}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.deprecate": + +type ImagesDeprecateCall struct { + s *Service + project string + image string + deprecationstatus *DeprecationStatus + opt_ map[string]interface{} +} + +// Deprecate: Sets the deprecation status of an image. If no message +// body is given, clears the deprecation status instead. +func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall { + c := &ImagesDeprecateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + c.deprecationstatus = deprecationstatus + return c +} + +func (c *ImagesDeprecateCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}/deprecate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{image}", url.QueryEscape(c.image), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the deprecation status of an image. If no message body is given, clears the deprecation status instead.", + // "httpMethod": "POST", + // "id": "compute.images.deprecate", + // "parameterOrder": [ + // "project", + // "image" + // ], + // "parameters": { + // "image": { + // "description": "Image name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images/{image}/deprecate", + // "request": { + // "$ref": "DeprecationStatus" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.get": + +type ImagesGetCall struct { + s *Service + project string + image string + opt_ map[string]interface{} +} + +// Get: Returns the specified image resource. +func (r *ImagesService) Get(project string, image string) *ImagesGetCall { + c := &ImagesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + return c +} + +func (c *ImagesGetCall) Do() (*Image, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{image}", url.QueryEscape(c.image), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Image + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified image resource.", + // "httpMethod": "GET", + // "id": "compute.images.get", + // "parameterOrder": [ + // "project", + // "image" + // ], + // "parameters": { + // "image": { + // "description": "Name of the image resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images/{image}", + // "response": { + // "$ref": "Image" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.images.insert": + +type ImagesInsertCall struct { + s *Service + project string + image *Image + opt_ map[string]interface{} +} + +// Insert: Creates an image resource in the specified project using the +// data included in the request. +func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall { + c := &ImagesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + return c +} + +func (c *ImagesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.image) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an image resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.images.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images", + // "request": { + // "$ref": "Image" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "compute.images.list": + +type ImagesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of image resources available to the +// specified project. +func (r *ImagesService) List(project string) *ImagesListCall { + c := &ImagesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ImagesListCall) Filter(filter string) *ImagesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ImagesListCall) Do() (*ImageList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *ImageList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of image resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.images.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images", + // "response": { + // "$ref": "ImageList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.addAccessConfig": + +type InstancesAddAccessConfigCall struct { + s *Service + project string + zone string + instance string + networkInterface string + accessconfig *AccessConfig + opt_ map[string]interface{} +} + +// AddAccessConfig: Adds an access config to an instance's network +// interface. +func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall { + c := &InstancesAddAccessConfigCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.networkInterface = networkInterface + c.accessconfig = accessconfig + return c +} + +func (c *InstancesAddAccessConfigCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + params.Set("networkInterface", fmt.Sprintf("%v", c.networkInterface)) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addAccessConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds an access config to an instance's network interface.", + // "httpMethod": "POST", + // "id": "compute.instances.addAccessConfig", + // "parameterOrder": [ + // "project", + // "zone", + // "instance", + // "networkInterface" + // ], + // "parameters": { + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "networkInterface": { + // "description": "Network interface name.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig", + // "request": { + // "$ref": "AccessConfig" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.aggregatedList": + +type InstancesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: +func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall { + c := &InstancesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *InstancesAggregatedListCall) Do() (*InstanceAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *InstanceAggregatedList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "compute.instances.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/instances", + // "response": { + // "$ref": "InstanceAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.attachDisk": + +type InstancesAttachDiskCall struct { + s *Service + project string + zone string + instance string + attacheddisk *AttachedDisk + opt_ map[string]interface{} +} + +// AttachDisk: Attaches a disk resource to an instance. +func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall { + c := &InstancesAttachDiskCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.attacheddisk = attacheddisk + return c +} + +func (c *InstancesAttachDiskCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/attachDisk") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Attaches a disk resource to an instance.", + // "httpMethod": "POST", + // "id": "compute.instances.attachDisk", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/attachDisk", + // "request": { + // "$ref": "AttachedDisk" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.delete": + +type InstancesDeleteCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified instance resource. +func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall { + c := &InstancesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified instance resource.", + // "httpMethod": "DELETE", + // "id": "compute.instances.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.deleteAccessConfig": + +type InstancesDeleteAccessConfigCall struct { + s *Service + project string + zone string + instance string + accessConfig string + networkInterface string + opt_ map[string]interface{} +} + +// DeleteAccessConfig: Deletes an access config from an instance's +// network interface. +func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall { + c := &InstancesDeleteAccessConfigCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.accessConfig = accessConfig + c.networkInterface = networkInterface + return c +} + +func (c *InstancesDeleteAccessConfigCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("accessConfig", fmt.Sprintf("%v", c.accessConfig)) + params.Set("networkInterface", fmt.Sprintf("%v", c.networkInterface)) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes an access config from an instance's network interface.", + // "httpMethod": "POST", + // "id": "compute.instances.deleteAccessConfig", + // "parameterOrder": [ + // "project", + // "zone", + // "instance", + // "accessConfig", + // "networkInterface" + // ], + // "parameters": { + // "accessConfig": { + // "description": "Access config name.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "networkInterface": { + // "description": "Network interface name.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.detachDisk": + +type InstancesDetachDiskCall struct { + s *Service + project string + zone string + instance string + deviceName string + opt_ map[string]interface{} +} + +// DetachDisk: Detaches a disk from an instance. +func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall { + c := &InstancesDetachDiskCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.deviceName = deviceName + return c +} + +func (c *InstancesDetachDiskCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("deviceName", fmt.Sprintf("%v", c.deviceName)) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/detachDisk") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Detaches a disk from an instance.", + // "httpMethod": "POST", + // "id": "compute.instances.detachDisk", + // "parameterOrder": [ + // "project", + // "zone", + // "instance", + // "deviceName" + // ], + // "parameters": { + // "deviceName": { + // "description": "Disk device name to detach.", + // "location": "query", + // "pattern": "\\w[\\w.-]{0,254}", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/detachDisk", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.get": + +type InstancesGetCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} +} + +// Get: Returns the specified instance resource. +func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall { + c := &InstancesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesGetCall) Do() (*Instance, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Instance + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified instance resource.", + // "httpMethod": "GET", + // "id": "compute.instances.get", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}", + // "response": { + // "$ref": "Instance" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.getSerialPortOutput": + +type InstancesGetSerialPortOutputCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} +} + +// GetSerialPortOutput: Returns the specified instance's serial port +// output. +func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall { + c := &InstancesGetSerialPortOutputCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesGetSerialPortOutputCall) Do() (*SerialPortOutput, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/serialPort") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *SerialPortOutput + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified instance's serial port output.", + // "httpMethod": "GET", + // "id": "compute.instances.getSerialPortOutput", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/serialPort", + // "response": { + // "$ref": "SerialPortOutput" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.insert": + +type InstancesInsertCall struct { + s *Service + project string + zone string + instance *Instance + opt_ map[string]interface{} +} + +// Insert: Creates an instance resource in the specified project using +// the data included in the request. +func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall { + c := &InstancesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an instance resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.instances.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances", + // "request": { + // "$ref": "Instance" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.list": + +type InstancesListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// List: Retrieves the list of instance resources contained within the +// specified zone. +func (r *InstancesService) List(project string, zone string) *InstancesListCall { + c := &InstancesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *InstancesListCall) Filter(filter string) *InstancesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *InstancesListCall) Do() (*InstanceList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *InstanceList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of instance resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.instances.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances", + // "response": { + // "$ref": "InstanceList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.reset": + +type InstancesResetCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} +} + +// Reset: Performs a hard reset on the instance. +func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall { + c := &InstancesResetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesResetCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Performs a hard reset on the instance.", + // "httpMethod": "POST", + // "id": "compute.instances.reset", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/reset", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.setDiskAutoDelete": + +type InstancesSetDiskAutoDeleteCall struct { + s *Service + project string + zone string + instance string + autoDelete bool + deviceName string + opt_ map[string]interface{} +} + +// SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to +// an instance +func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall { + c := &InstancesSetDiskAutoDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.autoDelete = autoDelete + c.deviceName = deviceName + return c +} + +func (c *InstancesSetDiskAutoDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("autoDelete", fmt.Sprintf("%v", c.autoDelete)) + params.Set("deviceName", fmt.Sprintf("%v", c.deviceName)) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the auto-delete flag for a disk attached to an instance", + // "httpMethod": "POST", + // "id": "compute.instances.setDiskAutoDelete", + // "parameterOrder": [ + // "project", + // "zone", + // "instance", + // "autoDelete", + // "deviceName" + // ], + // "parameters": { + // "autoDelete": { + // "description": "Whether to auto-delete the disk when the instance is deleted.", + // "location": "query", + // "required": true, + // "type": "boolean" + // }, + // "deviceName": { + // "description": "Disk device name to modify.", + // "location": "query", + // "pattern": "\\w[\\w.-]{0,254}", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.setMetadata": + +type InstancesSetMetadataCall struct { + s *Service + project string + zone string + instance string + metadata *Metadata + opt_ map[string]interface{} +} + +// SetMetadata: Sets metadata for the specified instance to the data +// included in the request. +func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall { + c := &InstancesSetMetadataCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.metadata = metadata + return c +} + +func (c *InstancesSetMetadataCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMetadata") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets metadata for the specified instance to the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.instances.setMetadata", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/setMetadata", + // "request": { + // "$ref": "Metadata" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.setScheduling": + +type InstancesSetSchedulingCall struct { + s *Service + project string + zone string + instance string + scheduling *Scheduling + opt_ map[string]interface{} +} + +// SetScheduling: Sets an instance's scheduling options. +func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall { + c := &InstancesSetSchedulingCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.scheduling = scheduling + return c +} + +func (c *InstancesSetSchedulingCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setScheduling") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets an instance's scheduling options.", + // "httpMethod": "POST", + // "id": "compute.instances.setScheduling", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/setScheduling", + // "request": { + // "$ref": "Scheduling" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.setTags": + +type InstancesSetTagsCall struct { + s *Service + project string + zone string + instance string + tags *Tags + opt_ map[string]interface{} +} + +// SetTags: Sets tags for the specified instance to the data included in +// the request. +func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall { + c := &InstancesSetTagsCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.tags = tags + return c +} + +func (c *InstancesSetTagsCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setTags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets tags for the specified instance to the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.instances.setTags", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/setTags", + // "request": { + // "$ref": "Tags" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.machineTypes.aggregatedList": + +type MachineTypesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of machine type resources grouped +// by scope. +func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall { + c := &MachineTypesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *MachineTypesAggregatedListCall) Do() (*MachineTypeAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/machineTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *MachineTypeAggregatedList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of machine type resources grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/machineTypes", + // "response": { + // "$ref": "MachineTypeAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.machineTypes.get": + +type MachineTypesGetCall struct { + s *Service + project string + zone string + machineType string + opt_ map[string]interface{} +} + +// Get: Returns the specified machine type resource. +func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall { + c := &MachineTypesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.machineType = machineType + return c +} + +func (c *MachineTypesGetCall) Do() (*MachineType, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes/{machineType}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{machineType}", url.QueryEscape(c.machineType), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *MachineType + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified machine type resource.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.get", + // "parameterOrder": [ + // "project", + // "zone", + // "machineType" + // ], + // "parameters": { + // "machineType": { + // "description": "Name of the machine type resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/machineTypes/{machineType}", + // "response": { + // "$ref": "MachineType" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.machineTypes.list": + +type MachineTypesListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// List: Retrieves the list of machine type resources available to the +// specified project. +func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall { + c := &MachineTypesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *MachineTypesListCall) Do() (*MachineTypeList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *MachineTypeList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of machine type resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/machineTypes", + // "response": { + // "$ref": "MachineTypeList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.networks.delete": + +type NetworksDeleteCall struct { + s *Service + project string + network string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified network resource. +func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall { + c := &NetworksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.network = network + return c +} + +func (c *NetworksDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{network}", url.QueryEscape(c.network), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified network resource.", + // "httpMethod": "DELETE", + // "id": "compute.networks.delete", + // "parameterOrder": [ + // "project", + // "network" + // ], + // "parameters": { + // "network": { + // "description": "Name of the network resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/networks/{network}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.networks.get": + +type NetworksGetCall struct { + s *Service + project string + network string + opt_ map[string]interface{} +} + +// Get: Returns the specified network resource. +func (r *NetworksService) Get(project string, network string) *NetworksGetCall { + c := &NetworksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.network = network + return c +} + +func (c *NetworksGetCall) Do() (*Network, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{network}", url.QueryEscape(c.network), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Network + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified network resource.", + // "httpMethod": "GET", + // "id": "compute.networks.get", + // "parameterOrder": [ + // "project", + // "network" + // ], + // "parameters": { + // "network": { + // "description": "Name of the network resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/networks/{network}", + // "response": { + // "$ref": "Network" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.networks.insert": + +type NetworksInsertCall struct { + s *Service + project string + network *Network + opt_ map[string]interface{} +} + +// Insert: Creates a network resource in the specified project using the +// data included in the request. +func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall { + c := &NetworksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.network = network + return c +} + +func (c *NetworksInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.network) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a network resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.networks.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/networks", + // "request": { + // "$ref": "Network" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.networks.list": + +type NetworksListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of network resources available to the +// specified project. +func (r *NetworksService) List(project string) *NetworksListCall { + c := &NetworksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *NetworksListCall) Filter(filter string) *NetworksListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *NetworksListCall) Do() (*NetworkList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *NetworkList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of network resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.networks.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/networks", + // "response": { + // "$ref": "NetworkList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.projects.get": + +type ProjectsGetCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// Get: Returns the specified project resource. +func (r *ProjectsService) Get(project string) *ProjectsGetCall { + c := &ProjectsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +func (c *ProjectsGetCall) Do() (*Project, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Project + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified project resource.", + // "httpMethod": "GET", + // "id": "compute.projects.get", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project resource to retrieve.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}", + // "response": { + // "$ref": "Project" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.projects.setCommonInstanceMetadata": + +type ProjectsSetCommonInstanceMetadataCall struct { + s *Service + project string + metadata *Metadata + opt_ map[string]interface{} +} + +// SetCommonInstanceMetadata: Sets metadata common to all instances +// within the specified project using the data included in the request. +func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall { + c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.metadata = metadata + return c +} + +func (c *ProjectsSetCommonInstanceMetadataCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setCommonInstanceMetadata") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets metadata common to all instances within the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.projects.setCommonInstanceMetadata", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/setCommonInstanceMetadata", + // "request": { + // "$ref": "Metadata" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.projects.setUsageExportBucket": + +type ProjectsSetUsageExportBucketCall struct { + s *Service + project string + usageexportlocation *UsageExportLocation + opt_ map[string]interface{} +} + +// SetUsageExportBucket: Sets usage export location +func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall { + c := &ProjectsSetUsageExportBucketCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.usageexportlocation = usageexportlocation + return c +} + +func (c *ProjectsSetUsageExportBucketCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportBucket") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets usage export location", + // "httpMethod": "POST", + // "id": "compute.projects.setUsageExportBucket", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/setUsageExportBucket", + // "request": { + // "$ref": "UsageExportLocation" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "compute.regionOperations.delete": + +type RegionOperationsDeleteCall struct { + s *Service + project string + region string + operation string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified region-specific operation resource. +func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall { + c := &RegionOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.operation = operation + return c +} + +func (c *RegionOperationsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified region-specific operation resource.", + // "httpMethod": "DELETE", + // "id": "compute.regionOperations.delete", + // "parameterOrder": [ + // "project", + // "region", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/operations/{operation}", + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.regionOperations.get": + +type RegionOperationsGetCall struct { + s *Service + project string + region string + operation string + opt_ map[string]interface{} +} + +// Get: Retrieves the specified region-specific operation resource. +func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall { + c := &RegionOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.operation = operation + return c +} + +func (c *RegionOperationsGetCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified region-specific operation resource.", + // "httpMethod": "GET", + // "id": "compute.regionOperations.get", + // "parameterOrder": [ + // "project", + // "region", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/operations/{operation}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.regionOperations.list": + +type RegionOperationsListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} +} + +// List: Retrieves the list of operation resources contained within the +// specified region. +func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall { + c := &RegionOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *RegionOperationsListCall) Do() (*OperationList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *OperationList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified region.", + // "httpMethod": "GET", + // "id": "compute.regionOperations.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/operations", + // "response": { + // "$ref": "OperationList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.regions.get": + +type RegionsGetCall struct { + s *Service + project string + region string + opt_ map[string]interface{} +} + +// Get: Returns the specified region resource. +func (r *RegionsService) Get(project string, region string) *RegionsGetCall { + c := &RegionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +func (c *RegionsGetCall) Do() (*Region, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Region + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified region resource.", + // "httpMethod": "GET", + // "id": "compute.regions.get", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}", + // "response": { + // "$ref": "Region" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.regions.list": + +type RegionsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of region resources available to the +// specified project. +func (r *RegionsService) List(project string) *RegionsListCall { + c := &RegionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *RegionsListCall) Filter(filter string) *RegionsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *RegionsListCall) Do() (*RegionList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *RegionList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of region resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.regions.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions", + // "response": { + // "$ref": "RegionList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.routes.delete": + +type RoutesDeleteCall struct { + s *Service + project string + route string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified route resource. +func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall { + c := &RoutesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.route = route + return c +} + +func (c *RoutesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{route}", url.QueryEscape(c.route), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified route resource.", + // "httpMethod": "DELETE", + // "id": "compute.routes.delete", + // "parameterOrder": [ + // "project", + // "route" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "route": { + // "description": "Name of the route resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/routes/{route}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.routes.get": + +type RoutesGetCall struct { + s *Service + project string + route string + opt_ map[string]interface{} +} + +// Get: Returns the specified route resource. +func (r *RoutesService) Get(project string, route string) *RoutesGetCall { + c := &RoutesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.route = route + return c +} + +func (c *RoutesGetCall) Do() (*Route, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{route}", url.QueryEscape(c.route), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Route + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified route resource.", + // "httpMethod": "GET", + // "id": "compute.routes.get", + // "parameterOrder": [ + // "project", + // "route" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "route": { + // "description": "Name of the route resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/routes/{route}", + // "response": { + // "$ref": "Route" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.routes.insert": + +type RoutesInsertCall struct { + s *Service + project string + route *Route + opt_ map[string]interface{} +} + +// Insert: Creates a route resource in the specified project using the +// data included in the request. +func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall { + c := &RoutesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.route = route + return c +} + +func (c *RoutesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.route) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a route resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.routes.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/routes", + // "request": { + // "$ref": "Route" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.routes.list": + +type RoutesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of route resources available to the +// specified project. +func (r *RoutesService) List(project string) *RoutesListCall { + c := &RoutesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *RoutesListCall) Filter(filter string) *RoutesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *RoutesListCall) Do() (*RouteList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *RouteList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of route resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.routes.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/routes", + // "response": { + // "$ref": "RouteList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.snapshots.delete": + +type SnapshotsDeleteCall struct { + s *Service + project string + snapshot string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified persistent disk snapshot resource. +func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall { + c := &SnapshotsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.snapshot = snapshot + return c +} + +func (c *SnapshotsDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{snapshot}", url.QueryEscape(c.snapshot), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified persistent disk snapshot resource.", + // "httpMethod": "DELETE", + // "id": "compute.snapshots.delete", + // "parameterOrder": [ + // "project", + // "snapshot" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "snapshot": { + // "description": "Name of the persistent disk snapshot resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/snapshots/{snapshot}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.snapshots.get": + +type SnapshotsGetCall struct { + s *Service + project string + snapshot string + opt_ map[string]interface{} +} + +// Get: Returns the specified persistent disk snapshot resource. +func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall { + c := &SnapshotsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.snapshot = snapshot + return c +} + +func (c *SnapshotsGetCall) Do() (*Snapshot, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{snapshot}", url.QueryEscape(c.snapshot), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Snapshot + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified persistent disk snapshot resource.", + // "httpMethod": "GET", + // "id": "compute.snapshots.get", + // "parameterOrder": [ + // "project", + // "snapshot" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "snapshot": { + // "description": "Name of the persistent disk snapshot resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/snapshots/{snapshot}", + // "response": { + // "$ref": "Snapshot" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.snapshots.list": + +type SnapshotsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of persistent disk snapshot resources +// contained within the specified project. +func (r *SnapshotsService) List(project string) *SnapshotsListCall { + c := &SnapshotsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *SnapshotsListCall) Do() (*SnapshotList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *SnapshotList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of persistent disk snapshot resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.snapshots.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/snapshots", + // "response": { + // "$ref": "SnapshotList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetHttpProxies.delete": + +type TargetHttpProxiesDeleteCall struct { + s *Service + project string + targetHttpProxy string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified TargetHttpProxy resource. +func (r *TargetHttpProxiesService) Delete(project string, targetHttpProxy string) *TargetHttpProxiesDeleteCall { + c := &TargetHttpProxiesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.targetHttpProxy = targetHttpProxy + return c +} + +func (c *TargetHttpProxiesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetHttpProxy}", url.QueryEscape(c.targetHttpProxy), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified TargetHttpProxy resource.", + // "httpMethod": "DELETE", + // "id": "compute.targetHttpProxies.delete", + // "parameterOrder": [ + // "project", + // "targetHttpProxy" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "targetHttpProxy": { + // "description": "Name of the TargetHttpProxy resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetHttpProxies.get": + +type TargetHttpProxiesGetCall struct { + s *Service + project string + targetHttpProxy string + opt_ map[string]interface{} +} + +// Get: Returns the specified TargetHttpProxy resource. +func (r *TargetHttpProxiesService) Get(project string, targetHttpProxy string) *TargetHttpProxiesGetCall { + c := &TargetHttpProxiesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.targetHttpProxy = targetHttpProxy + return c +} + +func (c *TargetHttpProxiesGetCall) Do() (*TargetHttpProxy, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetHttpProxy}", url.QueryEscape(c.targetHttpProxy), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *TargetHttpProxy + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified TargetHttpProxy resource.", + // "httpMethod": "GET", + // "id": "compute.targetHttpProxies.get", + // "parameterOrder": [ + // "project", + // "targetHttpProxy" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "targetHttpProxy": { + // "description": "Name of the TargetHttpProxy resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}", + // "response": { + // "$ref": "TargetHttpProxy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetHttpProxies.insert": + +type TargetHttpProxiesInsertCall struct { + s *Service + project string + targethttpproxy *TargetHttpProxy + opt_ map[string]interface{} +} + +// Insert: Creates a TargetHttpProxy resource in the specified project +// using the data included in the request. +func (r *TargetHttpProxiesService) Insert(project string, targethttpproxy *TargetHttpProxy) *TargetHttpProxiesInsertCall { + c := &TargetHttpProxiesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.targethttpproxy = targethttpproxy + return c +} + +func (c *TargetHttpProxiesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.targetHttpProxies.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/targetHttpProxies", + // "request": { + // "$ref": "TargetHttpProxy" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetHttpProxies.list": + +type TargetHttpProxiesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of TargetHttpProxy resources available to +// the specified project. +func (r *TargetHttpProxiesService) List(project string) *TargetHttpProxiesListCall { + c := &TargetHttpProxiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *TargetHttpProxiesListCall) Filter(filter string) *TargetHttpProxiesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *TargetHttpProxiesListCall) Do() (*TargetHttpProxyList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *TargetHttpProxyList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.targetHttpProxies.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/targetHttpProxies", + // "response": { + // "$ref": "TargetHttpProxyList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetHttpProxies.setUrlMap": + +type TargetHttpProxiesSetUrlMapCall struct { + s *Service + project string + targetHttpProxy string + urlmapreference *UrlMapReference + opt_ map[string]interface{} +} + +// SetUrlMap: Changes the URL map for TargetHttpProxy. +func (r *TargetHttpProxiesService) SetUrlMap(project string, targetHttpProxy string, urlmapreference *UrlMapReference) *TargetHttpProxiesSetUrlMapCall { + c := &TargetHttpProxiesSetUrlMapCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.targetHttpProxy = targetHttpProxy + c.urlmapreference = urlmapreference + return c +} + +func (c *TargetHttpProxiesSetUrlMapCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetHttpProxy}", url.QueryEscape(c.targetHttpProxy), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Changes the URL map for TargetHttpProxy.", + // "httpMethod": "POST", + // "id": "compute.targetHttpProxies.setUrlMap", + // "parameterOrder": [ + // "project", + // "targetHttpProxy" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "targetHttpProxy": { + // "description": "Name of the TargetHttpProxy resource whose URL map is to be set.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap", + // "request": { + // "$ref": "UrlMapReference" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetInstances.aggregatedList": + +type TargetInstancesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of target instances grouped by +// scope. +func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall { + c := &TargetInstancesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *TargetInstancesAggregatedListCall) Filter(filter string) *TargetInstancesAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *TargetInstancesAggregatedListCall) Do() (*TargetInstanceAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *TargetInstanceAggregatedList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of target instances grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.targetInstances.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/targetInstances", + // "response": { + // "$ref": "TargetInstanceAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetInstances.delete": + +type TargetInstancesDeleteCall struct { + s *Service + project string + zone string + targetInstance string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified TargetInstance resource. +func (r *TargetInstancesService) Delete(project string, zone string, targetInstance string) *TargetInstancesDeleteCall { + c := &TargetInstancesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.targetInstance = targetInstance + return c +} + +func (c *TargetInstancesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetInstance}", url.QueryEscape(c.targetInstance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified TargetInstance resource.", + // "httpMethod": "DELETE", + // "id": "compute.targetInstances.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "targetInstance" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "targetInstance": { + // "description": "Name of the TargetInstance resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetInstances.get": + +type TargetInstancesGetCall struct { + s *Service + project string + zone string + targetInstance string + opt_ map[string]interface{} +} + +// Get: Returns the specified TargetInstance resource. +func (r *TargetInstancesService) Get(project string, zone string, targetInstance string) *TargetInstancesGetCall { + c := &TargetInstancesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.targetInstance = targetInstance + return c +} + +func (c *TargetInstancesGetCall) Do() (*TargetInstance, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetInstance}", url.QueryEscape(c.targetInstance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *TargetInstance + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified TargetInstance resource.", + // "httpMethod": "GET", + // "id": "compute.targetInstances.get", + // "parameterOrder": [ + // "project", + // "zone", + // "targetInstance" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "targetInstance": { + // "description": "Name of the TargetInstance resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}", + // "response": { + // "$ref": "TargetInstance" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetInstances.insert": + +type TargetInstancesInsertCall struct { + s *Service + project string + zone string + targetinstance *TargetInstance + opt_ map[string]interface{} +} + +// Insert: Creates a TargetInstance resource in the specified project +// and zone using the data included in the request. +func (r *TargetInstancesService) Insert(project string, zone string, targetinstance *TargetInstance) *TargetInstancesInsertCall { + c := &TargetInstancesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.targetinstance = targetinstance + return c +} + +func (c *TargetInstancesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.targetInstances.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/targetInstances", + // "request": { + // "$ref": "TargetInstance" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetInstances.list": + +type TargetInstancesListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// List: Retrieves the list of TargetInstance resources available to the +// specified project and zone. +func (r *TargetInstancesService) List(project string, zone string) *TargetInstancesListCall { + c := &TargetInstancesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *TargetInstancesListCall) Filter(filter string) *TargetInstancesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *TargetInstancesListCall) Do() (*TargetInstanceList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *TargetInstanceList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of TargetInstance resources available to the specified project and zone.", + // "httpMethod": "GET", + // "id": "compute.targetInstances.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/targetInstances", + // "response": { + // "$ref": "TargetInstanceList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetPools.addHealthCheck": + +type TargetPoolsAddHealthCheckCall struct { + s *Service + project string + region string + targetPool string + targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest + opt_ map[string]interface{} +} + +// AddHealthCheck: Adds health check URL to targetPool. +func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest) *TargetPoolsAddHealthCheckCall { + c := &TargetPoolsAddHealthCheckCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + c.targetpoolsaddhealthcheckrequest = targetpoolsaddhealthcheckrequest + return c +} + +func (c *TargetPoolsAddHealthCheckCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds health check URL to targetPool.", + // "httpMethod": "POST", + // "id": "compute.targetPools.addHealthCheck", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to which health_check_url is to be added.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck", + // "request": { + // "$ref": "TargetPoolsAddHealthCheckRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.addInstance": + +type TargetPoolsAddInstanceCall struct { + s *Service + project string + region string + targetPool string + targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest + opt_ map[string]interface{} +} + +// AddInstance: Adds instance url to targetPool. +func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest) *TargetPoolsAddInstanceCall { + c := &TargetPoolsAddInstanceCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + c.targetpoolsaddinstancerequest = targetpoolsaddinstancerequest + return c +} + +func (c *TargetPoolsAddInstanceCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addInstance") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds instance url to targetPool.", + // "httpMethod": "POST", + // "id": "compute.targetPools.addInstance", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to which instance_url is to be added.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance", + // "request": { + // "$ref": "TargetPoolsAddInstanceRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.aggregatedList": + +type TargetPoolsAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of target pools grouped by scope. +func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall { + c := &TargetPoolsAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *TargetPoolsAggregatedListCall) Do() (*TargetPoolAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetPools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *TargetPoolAggregatedList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of target pools grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.targetPools.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/targetPools", + // "response": { + // "$ref": "TargetPoolAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetPools.delete": + +type TargetPoolsDeleteCall struct { + s *Service + project string + region string + targetPool string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified TargetPool resource. +func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall { + c := &TargetPoolsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + return c +} + +func (c *TargetPoolsDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified TargetPool resource.", + // "httpMethod": "DELETE", + // "id": "compute.targetPools.delete", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.get": + +type TargetPoolsGetCall struct { + s *Service + project string + region string + targetPool string + opt_ map[string]interface{} +} + +// Get: Returns the specified TargetPool resource. +func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall { + c := &TargetPoolsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + return c +} + +func (c *TargetPoolsGetCall) Do() (*TargetPool, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *TargetPool + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified TargetPool resource.", + // "httpMethod": "GET", + // "id": "compute.targetPools.get", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}", + // "response": { + // "$ref": "TargetPool" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetPools.getHealth": + +type TargetPoolsGetHealthCall struct { + s *Service + project string + region string + targetPool string + instancereference *InstanceReference + opt_ map[string]interface{} +} + +// GetHealth: Gets the most recent health check results for each IP for +// the given instance that is referenced by given TargetPool. +func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall { + c := &TargetPoolsGetHealthCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + c.instancereference = instancereference + return c +} + +func (c *TargetPoolsGetHealthCall) Do() (*TargetPoolInstanceHealth, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/getHealth") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *TargetPoolInstanceHealth + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the most recent health check results for each IP for the given instance that is referenced by given TargetPool.", + // "httpMethod": "POST", + // "id": "compute.targetPools.getHealth", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to which the queried instance belongs.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth", + // "request": { + // "$ref": "InstanceReference" + // }, + // "response": { + // "$ref": "TargetPoolInstanceHealth" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetPools.insert": + +type TargetPoolsInsertCall struct { + s *Service + project string + region string + targetpool *TargetPool + opt_ map[string]interface{} +} + +// Insert: Creates a TargetPool resource in the specified project and +// region using the data included in the request. +func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall { + c := &TargetPoolsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetpool = targetpool + return c +} + +func (c *TargetPoolsInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a TargetPool resource in the specified project and region using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.targetPools.insert", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools", + // "request": { + // "$ref": "TargetPool" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.list": + +type TargetPoolsListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} +} + +// List: Retrieves the list of TargetPool resources available to the +// specified project and region. +func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall { + c := &TargetPoolsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *TargetPoolsListCall) Do() (*TargetPoolList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *TargetPoolList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of TargetPool resources available to the specified project and region.", + // "httpMethod": "GET", + // "id": "compute.targetPools.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools", + // "response": { + // "$ref": "TargetPoolList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetPools.removeHealthCheck": + +type TargetPoolsRemoveHealthCheckCall struct { + s *Service + project string + region string + targetPool string + targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest + opt_ map[string]interface{} +} + +// RemoveHealthCheck: Removes health check URL from targetPool. +func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest) *TargetPoolsRemoveHealthCheckCall { + c := &TargetPoolsRemoveHealthCheckCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + c.targetpoolsremovehealthcheckrequest = targetpoolsremovehealthcheckrequest + return c +} + +func (c *TargetPoolsRemoveHealthCheckCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes health check URL from targetPool.", + // "httpMethod": "POST", + // "id": "compute.targetPools.removeHealthCheck", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to which health_check_url is to be removed.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck", + // "request": { + // "$ref": "TargetPoolsRemoveHealthCheckRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.removeInstance": + +type TargetPoolsRemoveInstanceCall struct { + s *Service + project string + region string + targetPool string + targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest + opt_ map[string]interface{} +} + +// RemoveInstance: Removes instance URL from targetPool. +func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest) *TargetPoolsRemoveInstanceCall { + c := &TargetPoolsRemoveInstanceCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + c.targetpoolsremoveinstancerequest = targetpoolsremoveinstancerequest + return c +} + +func (c *TargetPoolsRemoveInstanceCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeInstance") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes instance URL from targetPool.", + // "httpMethod": "POST", + // "id": "compute.targetPools.removeInstance", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to which instance_url is to be removed.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance", + // "request": { + // "$ref": "TargetPoolsRemoveInstanceRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.setBackup": + +type TargetPoolsSetBackupCall struct { + s *Service + project string + region string + targetPool string + targetreference *TargetReference + opt_ map[string]interface{} +} + +// SetBackup: Changes backup pool configurations. +func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall { + c := &TargetPoolsSetBackupCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + c.targetreference = targetreference + return c +} + +// FailoverRatio sets the optional parameter "failoverRatio": New +// failoverRatio value for the containing target pool. +func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall { + c.opt_["failoverRatio"] = failoverRatio + return c +} + +func (c *TargetPoolsSetBackupCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["failoverRatio"]; ok { + params.Set("failoverRatio", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/setBackup") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Changes backup pool configurations.", + // "httpMethod": "POST", + // "id": "compute.targetPools.setBackup", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "failoverRatio": { + // "description": "New failoverRatio value for the containing target pool.", + // "format": "float", + // "location": "query", + // "type": "number" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource for which the backup is to be set.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup", + // "request": { + // "$ref": "TargetReference" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.urlMaps.delete": + +type UrlMapsDeleteCall struct { + s *Service + project string + urlMap string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified UrlMap resource. +func (r *UrlMapsService) Delete(project string, urlMap string) *UrlMapsDeleteCall { + c := &UrlMapsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.urlMap = urlMap + return c +} + +func (c *UrlMapsDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{urlMap}", url.QueryEscape(c.urlMap), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified UrlMap resource.", + // "httpMethod": "DELETE", + // "id": "compute.urlMaps.delete", + // "parameterOrder": [ + // "project", + // "urlMap" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "urlMap": { + // "description": "Name of the UrlMap resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/urlMaps/{urlMap}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.urlMaps.get": + +type UrlMapsGetCall struct { + s *Service + project string + urlMap string + opt_ map[string]interface{} +} + +// Get: Returns the specified UrlMap resource. +func (r *UrlMapsService) Get(project string, urlMap string) *UrlMapsGetCall { + c := &UrlMapsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.urlMap = urlMap + return c +} + +func (c *UrlMapsGetCall) Do() (*UrlMap, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{urlMap}", url.QueryEscape(c.urlMap), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *UrlMap + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified UrlMap resource.", + // "httpMethod": "GET", + // "id": "compute.urlMaps.get", + // "parameterOrder": [ + // "project", + // "urlMap" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "urlMap": { + // "description": "Name of the UrlMap resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/urlMaps/{urlMap}", + // "response": { + // "$ref": "UrlMap" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.urlMaps.insert": + +type UrlMapsInsertCall struct { + s *Service + project string + urlmap *UrlMap + opt_ map[string]interface{} +} + +// Insert: Creates a UrlMap resource in the specified project using the +// data included in the request. +func (r *UrlMapsService) Insert(project string, urlmap *UrlMap) *UrlMapsInsertCall { + c := &UrlMapsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.urlmap = urlmap + return c +} + +func (c *UrlMapsInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a UrlMap resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.urlMaps.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/urlMaps", + // "request": { + // "$ref": "UrlMap" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.urlMaps.list": + +type UrlMapsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of UrlMap resources available to the +// specified project. +func (r *UrlMapsService) List(project string) *UrlMapsListCall { + c := &UrlMapsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *UrlMapsListCall) Filter(filter string) *UrlMapsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *UrlMapsListCall) Do() (*UrlMapList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *UrlMapList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of UrlMap resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.urlMaps.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/urlMaps", + // "response": { + // "$ref": "UrlMapList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.urlMaps.patch": + +type UrlMapsPatchCall struct { + s *Service + project string + urlMap string + urlmap *UrlMap + opt_ map[string]interface{} +} + +// Patch: Update the entire content of the UrlMap resource. This method +// supports patch semantics. +func (r *UrlMapsService) Patch(project string, urlMap string, urlmap *UrlMap) *UrlMapsPatchCall { + c := &UrlMapsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.urlMap = urlMap + c.urlmap = urlmap + return c +} + +func (c *UrlMapsPatchCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{urlMap}", url.QueryEscape(c.urlMap), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the entire content of the UrlMap resource. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "compute.urlMaps.patch", + // "parameterOrder": [ + // "project", + // "urlMap" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "urlMap": { + // "description": "Name of the UrlMap resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/urlMaps/{urlMap}", + // "request": { + // "$ref": "UrlMap" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.urlMaps.update": + +type UrlMapsUpdateCall struct { + s *Service + project string + urlMap string + urlmap *UrlMap + opt_ map[string]interface{} +} + +// Update: Update the entire content of the UrlMap resource. +func (r *UrlMapsService) Update(project string, urlMap string, urlmap *UrlMap) *UrlMapsUpdateCall { + c := &UrlMapsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.urlMap = urlMap + c.urlmap = urlmap + return c +} + +func (c *UrlMapsUpdateCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{urlMap}", url.QueryEscape(c.urlMap), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the entire content of the UrlMap resource.", + // "httpMethod": "PUT", + // "id": "compute.urlMaps.update", + // "parameterOrder": [ + // "project", + // "urlMap" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "urlMap": { + // "description": "Name of the UrlMap resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/urlMaps/{urlMap}", + // "request": { + // "$ref": "UrlMap" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.urlMaps.validate": + +type UrlMapsValidateCall struct { + s *Service + project string + urlMap string + urlmapsvalidaterequest *UrlMapsValidateRequest + opt_ map[string]interface{} +} + +// Validate: Run static validation for the UrlMap. In particular, the +// tests of the provided UrlMap will be run. Calling this method does +// NOT create the UrlMap. +func (r *UrlMapsService) Validate(project string, urlMap string, urlmapsvalidaterequest *UrlMapsValidateRequest) *UrlMapsValidateCall { + c := &UrlMapsValidateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.urlMap = urlMap + c.urlmapsvalidaterequest = urlmapsvalidaterequest + return c +} + +func (c *UrlMapsValidateCall) Do() (*UrlMapsValidateResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/validate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{urlMap}", url.QueryEscape(c.urlMap), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *UrlMapsValidateResponse + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Run static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.", + // "httpMethod": "POST", + // "id": "compute.urlMaps.validate", + // "parameterOrder": [ + // "project", + // "urlMap" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "urlMap": { + // "description": "Name of the UrlMap resource to be validated as.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/urlMaps/{urlMap}/validate", + // "request": { + // "$ref": "UrlMapsValidateRequest" + // }, + // "response": { + // "$ref": "UrlMapsValidateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.zoneOperations.delete": + +type ZoneOperationsDeleteCall struct { + s *Service + project string + zone string + operation string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified zone-specific operation resource. +func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall { + c := &ZoneOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.operation = operation + return c +} + +func (c *ZoneOperationsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified zone-specific operation resource.", + // "httpMethod": "DELETE", + // "id": "compute.zoneOperations.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/operations/{operation}", + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.zoneOperations.get": + +type ZoneOperationsGetCall struct { + s *Service + project string + zone string + operation string + opt_ map[string]interface{} +} + +// Get: Retrieves the specified zone-specific operation resource. +func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall { + c := &ZoneOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.operation = operation + return c +} + +func (c *ZoneOperationsGetCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified zone-specific operation resource.", + // "httpMethod": "GET", + // "id": "compute.zoneOperations.get", + // "parameterOrder": [ + // "project", + // "zone", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/operations/{operation}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.zoneOperations.list": + +type ZoneOperationsListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// List: Retrieves the list of operation resources contained within the +// specified zone. +func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall { + c := &ZoneOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ZoneOperationsListCall) Do() (*OperationList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *OperationList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.zoneOperations.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/operations", + // "response": { + // "$ref": "OperationList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.zones.get": + +type ZonesGetCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// Get: Returns the specified zone resource. +func (r *ZonesService) Get(project string, zone string) *ZonesGetCall { + c := &ZonesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +func (c *ZonesGetCall) Do() (*Zone, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Zone + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified zone resource.", + // "httpMethod": "GET", + // "id": "compute.zones.get", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}", + // "response": { + // "$ref": "Zone" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.zones.list": + +type ZonesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of zone resources available to the specified +// project. +func (r *ZonesService) List(project string) *ZonesListCall { + c := &ZonesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ZonesListCall) Filter(filter string) *ZonesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ZonesListCall) Do() (*ZoneList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *ZoneList + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of zone resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.zones.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones", + // "response": { + // "$ref": "ZoneList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta12/compute-api.json b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta12/compute-api.json new file mode 100644 index 0000000000000..efb454a49f51f --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta12/compute-api.json @@ -0,0 +1,2774 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"a3GBuXuTtUYW9BV1SIieU5LiL7w/OMc_Q6bo_yRgn65QpS7XfQtbdfQ\"", + "discoveryVersion": "v1", + "id": "compute:v1beta12", + "name": "compute", + "version": "v1beta12", + "revision": "20121022", + "title": "Compute Engine API", + "description": "API for the Google Compute Engine service.", + "icons": { + "x16": "http://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "http://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://developers.google.com/compute/docs/reference/v1beta12", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/compute/v1beta12/projects/", + "basePath": "/compute/v1beta12/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "compute/v1beta12/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/compute": { + "description": "View and manage your Google Compute Engine resources" + }, + "https://www.googleapis.com/auth/compute.readonly": { + "description": "View your Google Compute Engine resources" + }, + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + } + } + } + }, + "schemas": { + "AccessConfig": { + "id": "AccessConfig", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#accessConfig" + }, + "name": { + "type": "string", + "description": "Name of this access configuration." + }, + "natIP": { + "type": "string", + "description": "An external IP address associated with this instance. Specify an unused static IP address available to the project. If left blank, the external IP will be drawn from a shared ephemeral pool." + }, + "type": { + "type": "string", + "description": "Type of configuration. Must be set to \"ONE_TO_ONE_NAT\". This configures port-for-port NAT to the internet.", + "default": "ONE_TO_ONE_NAT" + } + } + }, + "AttachedDisk": { + "id": "AttachedDisk", + "type": "object", + "properties": { + "deleteOnTerminate": { + "type": "boolean", + "description": "Persistent disk only; If true, delete the disk and all its data when the associated instance is deleted. This property defaults to false if not specified." + }, + "deviceName": { + "type": "string", + "description": "Persistent disk only; must be unique within the instance when specified. This represents a unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. If not specified, a default will be chosen by the system." + }, + "index": { + "type": "integer", + "description": "A zero-based index to assign to this disk, where 0 is reserved for the boot disk. If not specified, the server will choose an appropriate value.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#attachedDisk" + }, + "mode": { + "type": "string", + "description": "The mode in which to attach this disk, either \"READ_WRITE\" or \"READ_ONLY\"." + }, + "source": { + "type": "string", + "description": "Persistent disk only; the URL of the persistent disk resource." + }, + "type": { + "type": "string", + "description": "Type of the disk, either \"EPHEMERAL\" or \"PERSISTENT\". Note that persistent disks must be created before you can specify them here.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + } + } + }, + "Disk": { + "id": "Disk", + "type": "object", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#disk" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.disks.insert" + ] + } + }, + "options": { + "type": "string", + "description": "Internal use only." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sizeGb": { + "type": "string", + "description": "Size of the persistent disk, specified in GB.", + "format": "int64", + "annotations": { + "required": [ + "compute.disks.insert" + ] + } + }, + "sourceSnapshot": { + "type": "string", + "description": "The source snapshot used to create this disk. Once the source snapshot has been deleted from the system, this field will be cleared, and will not be set even if a snapshot with the same name has been re-created." + }, + "sourceSnapshotId": { + "type": "string", + "description": "The 'id' value of the snapshot used to create this disk. This value may be used to determine whether the disk was created from the current or a previous instance of a given disk snapshot." + }, + "status": { + "type": "string", + "description": "The status of disk creation (output only)." + }, + "zone": { + "type": "string", + "description": "URL for the zone where the persistent disk resides; provided by the client when the disk is created. A persistent disk must reside in the same zone as the instance to which it is attached.", + "annotations": { + "required": [ + "compute.disks.insert" + ] + } + } + } + }, + "DiskList": { + "id": "DiskList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The persistent disk resources.", + "items": { + "$ref": "Disk" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#diskList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Firewall": { + "id": "Firewall", + "type": "object", + "properties": { + "allowed": { + "type": "array", + "description": "The list of rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection.", + "items": { + "type": "object", + "properties": { + "IPProtocol": { + "type": "string", + "description": "Required; this is the IP protocol that is allowed for this rule. This can either be a well known protocol string (tcp, udp or icmp) or the IP protocol number." + }, + "ports": { + "type": "array", + "description": "An optional list of ports which are allowed. It is an error to specify this for any protocol that isn't UDP or TCP. Each entry must be either an integer or a range. If not specified, connections through any port are allowed.\nExample inputs include: [\"22\"], [\"80,\"443\"] and [\"12345-12349\"].", + "items": { + "type": "string" + } + } + } + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#firewall" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.firewalls.insert", + "compute.firewalls.patch" + ] + } + }, + "network": { + "type": "string", + "description": "URL of the network to which this firewall is applied; provided by the client when the firewall is created.", + "annotations": { + "required": [ + "compute.firewalls.insert", + "compute.firewalls.patch" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sourceRanges": { + "type": "array", + "description": "A list of IP address blocks expressed in CIDR format which this rule applies to. One or both of sourceRanges and sourceTags may be set; an inbound connection is allowed if either the range or the tag of the source matches.", + "items": { + "type": "string", + "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}/[0-9]{1,2}" + } + }, + "sourceTags": { + "type": "array", + "description": "A list of instance tags which this rule applies to. One or both of sourceRanges and sourceTags may be set; an inbound connection is allowed if either the range or the tag of the source matches.", + "items": { + "type": "string", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + } + }, + "targetTags": { + "type": "array", + "description": "A list of instance tags indicating sets of instances located on network which may make network connections as specified in allowed. If no targetTags are specified, the firewall rule applies to all instances on the specified network.", + "items": { + "type": "string", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + } + } + } + }, + "FirewallList": { + "id": "FirewallList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The firewall resources.", + "items": { + "$ref": "Firewall" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#firewallList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Image": { + "id": "Image", + "type": "object", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "Textual description of the resource; provided by the client when the resource is created." + }, + "diskSnapshot": { + "type": "object", + "description": "Not yet implemented.", + "properties": { + "source": { + "type": "string", + "description": "URL of the disk snapshot.", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + } + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#image" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + }, + "preferredKernel": { + "type": "string", + "description": "An optional URL of the preferred kernel for use with this disk image. If not specified, a server defined default kernel will be used." + }, + "rawDisk": { + "type": "object", + "description": "The raw disk image parameters.", + "properties": { + "containerType": { + "type": "string", + "description": "The format used to encode and transmit the block device. Should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created.", + "default": "TAR", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + }, + "sha1Checksum": { + "type": "string", + "description": "An optional SHA1 checksum of the disk image before unpackaging; provided by the client when the disk image is created.", + "pattern": "[a-f0-9]{40}" + }, + "source": { + "type": "string", + "description": "The full Google Cloud Storage URL where the disk image is stored; provided by the client when the disk image is created.", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + } + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sourceType": { + "type": "string", + "description": "Must be \"RAW\"; provided by the client when the disk image is created.", + "default": "RAW", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + } + } + }, + "ImageList": { + "id": "ImageList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The disk image resources.", + "items": { + "$ref": "Image" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#imageList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Instance": { + "id": "Instance", + "type": "object", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "disks": { + "type": "array", + "description": "Array of disks associated with this instance. Persistent disks must be created before you can assign them.", + "items": { + "$ref": "AttachedDisk" + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "image": { + "type": "string", + "description": "An optional URL of the disk image resource to be to be installed on this instance; provided by the client when the instance is created. If not specified, the server will choose a default image.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#instance" + }, + "machineType": { + "type": "string", + "description": "URL of the machine type resource describing which machine type to use to host the instance; provided by the client when the instance is created.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "metadata": { + "$ref": "Metadata", + "description": "Metadata key/value pairs assigned to this instance. Consists of custom metadata or predefined keys; see Instance documentation for more information." + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "networkInterfaces": { + "type": "array", + "description": "Array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.", + "items": { + "$ref": "NetworkInterface" + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "serviceAccounts": { + "type": "array", + "description": "A list of service accounts each with specified scopes, for which access tokens are to be made available to the instance through metadata queries.", + "items": { + "$ref": "ServiceAccount" + } + }, + "status": { + "type": "string", + "description": "Instance status. One of the following values: \"PROVISIONING\", \"STAGING\", \"RUNNING\" (output only)." + }, + "statusMessage": { + "type": "string", + "description": "An optional, human-readable explanation of the status (output only)." + }, + "tags": { + "type": "array", + "description": "An optional set of tags applied to this instance. Used to identify valid sources or targets for network firewalls. Provided by the client when the instance is created. Each tag must be 1-63 characters long, and comply with RFC1035.", + "items": { + "type": "string", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + } + }, + "zone": { + "type": "string", + "description": "URL of the zone resource describing where this instance should be hosted; provided by the client when the instance is created.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + } + } + }, + "InstanceList": { + "id": "InstanceList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "A list of instance resources.", + "items": { + "$ref": "Instance" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#instanceList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Kernel": { + "id": "Kernel", + "type": "object", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#kernel" + }, + "name": { + "type": "string", + "description": "Name of the resource.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "KernelList": { + "id": "KernelList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The kernel resources.", + "items": { + "$ref": "Kernel" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#kernelList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "MachineType": { + "id": "MachineType", + "type": "object", + "properties": { + "availableZone": { + "type": "array", + "description": "The zones that this machine type can run in.", + "items": { + "type": "any" + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "ephemeralDisks": { + "type": "array", + "description": "List of extended ephemeral disks assigned to the instance.", + "items": { + "type": "object", + "properties": { + "diskGb": { + "type": "integer", + "description": "Size of the ephemeral disk, defined in GB.", + "format": "int32" + } + } + } + }, + "guestCpus": { + "type": "integer", + "description": "Count of CPUs exposed to the instance.", + "format": "int32" + }, + "hostCpus": { + "type": "number", + "description": "Count of physical CPUs reserved on the virtual machine host. Deprecated.", + "format": "double" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "imageSpaceGb": { + "type": "integer", + "description": "Space allotted for the image, defined in GB.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#machineType" + }, + "maximumPersistentDisks": { + "type": "integer", + "description": "Maximum persistent disks allowed.", + "format": "int32" + }, + "maximumPersistentDisksSizeGb": { + "type": "string", + "description": "Maximum total persistent disks size (GB) allowed.", + "format": "int64" + }, + "memoryMb": { + "type": "integer", + "description": "Physical memory assigned to the instance, defined in MB.", + "format": "int32" + }, + "name": { + "type": "string", + "description": "Name of the resource.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "MachineTypeList": { + "id": "MachineTypeList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The machine type resources.", + "items": { + "$ref": "MachineType" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#machineTypeList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Metadata": { + "id": "Metadata", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "Array of key/value pairs. The total size of all keys and values must be less than 512 KB.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must be unique.", + "pattern": "[a-zA-Z0-9-_]{1,128}", + "annotations": { + "required": [ + "compute.instances.insert", + "compute.projects.setCommonInstanceMetadata" + ] + } + }, + "value": { + "type": "string", + "description": "Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 15000 bytes.", + "annotations": { + "required": [ + "compute.instances.insert", + "compute.projects.setCommonInstanceMetadata" + ] + } + } + } + } + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#metadata" + } + } + }, + "Network": { + "id": "Network", + "type": "object", + "properties": { + "IPv4Range": { + "type": "string", + "description": "Required; The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client when the network is created.", + "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}/[0-9]{1,2}", + "annotations": { + "required": [ + "compute.networks.insert" + ] + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "gatewayIPv4": { + "type": "string", + "description": "An optional address that is used for default routing to other networks. This must be within the range specified by IPv4Range, and is typically the first usable address in that range. If not specified, the default value is the first usable address in IPv4Range.", + "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#network" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.networks.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "NetworkInterface": { + "id": "NetworkInterface", + "type": "object", + "properties": { + "accessConfigs": { + "type": "array", + "description": "Array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.", + "items": { + "$ref": "AccessConfig" + } + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#networkInterface" + }, + "name": { + "type": "string", + "description": "Name of the resource, determined by the server; for network devices, these are e.g. eth0, eth1, etc. (output only)." + }, + "network": { + "type": "string", + "description": "URL of the network resource attached to this interface.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "networkIP": { + "type": "string", + "description": "An optional IPV4 internal network address to assign to this instance. If not specified, one will be assigned from the available range." + } + } + }, + "NetworkList": { + "id": "NetworkList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The network resources.", + "items": { + "$ref": "Network" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#networkList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "properties": { + "clientOperationId": { + "type": "string", + "description": "An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only)." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "endTime": { + "type": "string", + "description": "The time that this operation was completed. This is in RFC 3339 format (output only)." + }, + "error": { + "type": "object", + "description": "If errors occurred during processing of this operation, this field will be populated (output only).", + "properties": { + "errors": { + "type": "array", + "description": "The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "An optional, human-readable error message." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only)." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "If operation fails, the HTTP error status code returned, e.g. 404. (output only).", + "format": "int32" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "The time that this operation was requested. This is in RFC 3339 format (output only)." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#operation" + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "operationType": { + "type": "string", + "description": "Type of the operation. Examples include \"insert\", \"update\", and \"delete\" (output only)." + }, + "progress": { + "type": "integer", + "description": "An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only).", + "format": "int32" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "startTime": { + "type": "string", + "description": "The time that this operation was started by the server. This is in RFC 3339 format (output only)." + }, + "status": { + "type": "string", + "description": "Status of the operation. Can be one of the following: \"PENDING\", \"RUNNING\", or \"DONE\" (output only)." + }, + "statusMessage": { + "type": "string", + "description": "An optional textual description of the current status of the operation (output only)." + }, + "targetId": { + "type": "string", + "description": "Unique target id which identifies a particular incarnation of the target (output only).", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "URL of the resource the operation is mutating (output only)." + }, + "user": { + "type": "string", + "description": "User who requested the operation, for example \"user@example.com\" (output only)." + } + } + }, + "OperationList": { + "id": "OperationList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The operation resources.", + "items": { + "$ref": "Operation" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#operationList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Project": { + "id": "Project", + "type": "object", + "properties": { + "commonInstanceMetadata": { + "$ref": "Metadata", + "description": "Metadata key/value pairs available to all instances contained in this project." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "externalIpAddresses": { + "type": "array", + "description": "Internet available IP addresses available for use in this project.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#project" + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "quotas": { + "type": "array", + "description": "Quotas assigned to this project.", + "items": { + "type": "object", + "properties": { + "limit": { + "type": "number", + "description": "Quota limit for this metric.", + "format": "double" + }, + "metric": { + "type": "string", + "description": "Name of the quota metric." + }, + "usage": { + "type": "number", + "description": "Current usage of this metric.", + "format": "double" + } + } + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "ServiceAccount": { + "id": "ServiceAccount", + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email address of the service account." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#serviceAccount" + }, + "scopes": { + "type": "array", + "description": "The list of scopes to be made available for this service account.", + "items": { + "type": "string" + } + } + } + }, + "Snapshot": { + "id": "Snapshot", + "type": "object", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "diskSizeGb": { + "type": "string", + "description": "Size of the persistent disk snapshot, specified in GB (output only).", + "format": "int64" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#snapshot" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.snapshots.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sourceDisk": { + "type": "string", + "description": "The source disk used to create this snapshot. Once the source disk has been deleted from the system, this field will be cleared, and will not be set even if a disk with the same name has been re-created." + }, + "sourceDiskId": { + "type": "string", + "description": "The 'id' value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name." + }, + "status": { + "type": "string", + "description": "The status of the persistent disk snapshot (output only)." + } + } + }, + "SnapshotList": { + "id": "SnapshotList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The persistent snapshot resources.", + "items": { + "$ref": "Snapshot" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#snapshotList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Zone": { + "id": "Zone", + "type": "object", + "properties": { + "availableMachineType": { + "type": "array", + "description": "The machine types that can be used in this zone (output only).", + "items": { + "type": "any" + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "Textual description of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#zone" + }, + "maintenanceWindows": { + "type": "array", + "description": "Scheduled maintenance windows for the zone. When the zone is in a maintenance window, all resources which reside in the zone will be unavailable.", + "items": { + "type": "object", + "properties": { + "beginTime": { + "type": "string", + "description": "Begin time of the maintenance window, in RFC 3339 format." + }, + "description": { + "type": "string", + "description": "Textual description of the maintenance window." + }, + "endTime": { + "type": "string", + "description": "End time of the maintenance window, in RFC 3339 format." + }, + "name": { + "type": "string", + "description": "Name of the maintenance window." + } + } + } + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "status": { + "type": "string", + "description": "Status of the zone. \"UP\" or \"DOWN\"." + } + } + }, + "ZoneList": { + "id": "ZoneList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The zone resources.", + "items": { + "$ref": "Zone" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#zoneList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + } + }, + "resources": { + "disks": { + "methods": { + "delete": { + "id": "compute.disks.delete", + "path": "{project}/disks/{disk}", + "httpMethod": "DELETE", + "description": "Deletes the specified persistent disk resource.", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "disk" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.disks.get", + "path": "{project}/disks/{disk}", + "httpMethod": "GET", + "description": "Returns the specified persistent disk resource.", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "disk" + ], + "response": { + "$ref": "Disk" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.disks.insert", + "path": "{project}/disks", + "httpMethod": "POST", + "description": "Creates a persistent disk resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Disk" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.disks.list", + "path": "{project}/disks", + "httpMethod": "GET", + "description": "Retrieves the list of persistent disk resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "DiskList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "firewalls": { + "methods": { + "delete": { + "id": "compute.firewalls.delete", + "path": "{project}/firewalls/{firewall}", + "httpMethod": "DELETE", + "description": "Deletes the specified firewall resource.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.firewalls.get", + "path": "{project}/firewalls/{firewall}", + "httpMethod": "GET", + "description": "Returns the specified firewall resource.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "response": { + "$ref": "Firewall" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.firewalls.insert", + "path": "{project}/firewalls", + "httpMethod": "POST", + "description": "Creates a firewall resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Firewall" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.firewalls.list", + "path": "{project}/firewalls", + "httpMethod": "GET", + "description": "Retrieves the list of firewall resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "FirewallList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.firewalls.patch", + "path": "{project}/firewalls/{firewall}", + "httpMethod": "PATCH", + "description": "Updates the specified firewall resource with the data included in the request. This method supports patch semantics.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "request": { + "$ref": "Firewall" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "compute.firewalls.update", + "path": "{project}/firewalls/{firewall}", + "httpMethod": "PUT", + "description": "Updates the specified firewall resource with the data included in the request.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "request": { + "$ref": "Firewall" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "images": { + "methods": { + "delete": { + "id": "compute.images.delete", + "path": "{project}/images/{image}", + "httpMethod": "DELETE", + "description": "Deletes the specified image resource.", + "parameters": { + "image": { + "type": "string", + "description": "Name of the image resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "image" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.images.get", + "path": "{project}/images/{image}", + "httpMethod": "GET", + "description": "Returns the specified image resource.", + "parameters": { + "image": { + "type": "string", + "description": "Name of the image resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "image" + ], + "response": { + "$ref": "Image" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.images.insert", + "path": "{project}/images", + "httpMethod": "POST", + "description": "Creates an image resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Image" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/devstorage.read_only" + ] + }, + "list": { + "id": "compute.images.list", + "path": "{project}/images", + "httpMethod": "GET", + "description": "Retrieves the list of image resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "ImageList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "instances": { + "methods": { + "addAccessConfig": { + "id": "compute.instances.addAccessConfig", + "path": "{project}/instances/{instance}/add-access-config", + "httpMethod": "POST", + "description": "Adds an access config to an instance's network interface.", + "parameters": { + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "network_interface": { + "type": "string", + "description": "Network interface name.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "instance", + "network_interface" + ], + "request": { + "$ref": "AccessConfig" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "delete": { + "id": "compute.instances.delete", + "path": "{project}/instances/{instance}", + "httpMethod": "DELETE", + "description": "Deletes the specified instance resource.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "instance" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "deleteAccessConfig": { + "id": "compute.instances.deleteAccessConfig", + "path": "{project}/instances/{instance}/delete-access-config", + "httpMethod": "POST", + "description": "Deletes an access config from an instance's network interface.", + "parameters": { + "access_config": { + "type": "string", + "description": "Access config name.", + "required": true, + "location": "query" + }, + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "network_interface": { + "type": "string", + "description": "Network interface name.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "instance", + "access_config", + "network_interface" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.instances.get", + "path": "{project}/instances/{instance}", + "httpMethod": "GET", + "description": "Returns the specified instance resource.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "instance" + ], + "response": { + "$ref": "Instance" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.instances.insert", + "path": "{project}/instances", + "httpMethod": "POST", + "description": "Creates an instance resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Instance" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.instances.list", + "path": "{project}/instances", + "httpMethod": "GET", + "description": "Retrieves the list of instance resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "InstanceList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "kernels": { + "methods": { + "get": { + "id": "compute.kernels.get", + "path": "{project}/kernels/{kernel}", + "httpMethod": "GET", + "description": "Returns the specified kernel resource.", + "parameters": { + "kernel": { + "type": "string", + "description": "Name of the kernel resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "kernel" + ], + "response": { + "$ref": "Kernel" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.kernels.list", + "path": "{project}/kernels", + "httpMethod": "GET", + "description": "Retrieves the list of kernel resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "KernelList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "machineTypes": { + "methods": { + "get": { + "id": "compute.machineTypes.get", + "path": "{project}/machine-types/{machineType}", + "httpMethod": "GET", + "description": "Returns the specified machine type resource.", + "parameters": { + "machineType": { + "type": "string", + "description": "Name of the machine type resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "machineType" + ], + "response": { + "$ref": "MachineType" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.machineTypes.list", + "path": "{project}/machine-types", + "httpMethod": "GET", + "description": "Retrieves the list of machine type resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "MachineTypeList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "networks": { + "methods": { + "delete": { + "id": "compute.networks.delete", + "path": "{project}/networks/{network}", + "httpMethod": "DELETE", + "description": "Deletes the specified network resource.", + "parameters": { + "network": { + "type": "string", + "description": "Name of the network resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "network" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.networks.get", + "path": "{project}/networks/{network}", + "httpMethod": "GET", + "description": "Returns the specified network resource.", + "parameters": { + "network": { + "type": "string", + "description": "Name of the network resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "network" + ], + "response": { + "$ref": "Network" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.networks.insert", + "path": "{project}/networks", + "httpMethod": "POST", + "description": "Creates a network resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Network" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.networks.list", + "path": "{project}/networks", + "httpMethod": "GET", + "description": "Retrieves the list of network resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "NetworkList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "operations": { + "methods": { + "delete": { + "id": "compute.operations.delete", + "path": "{project}/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "operation" + ], + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.operations.get", + "path": "{project}/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "operation" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.operations.list", + "path": "{project}/operations", + "httpMethod": "GET", + "description": "Retrieves the list of operation resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "OperationList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "projects": { + "methods": { + "get": { + "id": "compute.projects.get", + "path": "{project}", + "httpMethod": "GET", + "description": "Returns the specified project resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project resource to retrieve.", + "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": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "setCommonInstanceMetadata": { + "id": "compute.projects.setCommonInstanceMetadata", + "path": "{project}/set-common-instance-metadata", + "httpMethod": "POST", + "description": "Sets metadata common to all instances within the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Metadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "snapshots": { + "methods": { + "delete": { + "id": "compute.snapshots.delete", + "path": "{project}/snapshots/{snapshot}", + "httpMethod": "DELETE", + "description": "Deletes the specified persistent disk snapshot resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "snapshot": { + "type": "string", + "description": "Name of the persistent disk snapshot resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "snapshot" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.snapshots.get", + "path": "{project}/snapshots/{snapshot}", + "httpMethod": "GET", + "description": "Returns the specified persistent disk snapshot resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "snapshot": { + "type": "string", + "description": "Name of the persistent disk snapshot resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "snapshot" + ], + "response": { + "$ref": "Snapshot" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.snapshots.insert", + "path": "{project}/snapshots", + "httpMethod": "POST", + "description": "Creates a persistent disk snapshot resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Snapshot" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.snapshots.list", + "path": "{project}/snapshots", + "httpMethod": "GET", + "description": "Retrieves the list of persistent disk snapshot resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "SnapshotList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "zones": { + "methods": { + "get": { + "id": "compute.zones.get", + "path": "{project}/zones/{zone}", + "httpMethod": "GET", + "description": "Returns the specified zone resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "Zone" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.zones.list", + "path": "{project}/zones", + "httpMethod": "GET", + "description": "Retrieves the list of zone resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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.readonly" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta12/compute-gen.go b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta12/compute-gen.go new file mode 100644 index 0000000000000..8dca92bf6d981 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta12/compute-gen.go @@ -0,0 +1,4384 @@ +// Package compute provides access to the Compute Engine API. +// +// See https://developers.google.com/compute/docs/reference/v1beta12 +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/compute/v1beta12" +// ... +// computeService, err := compute.New(oauthHttpClient) +package compute + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New + +const apiId = "compute:v1beta12" +const apiName = "compute" +const apiVersion = "v1beta12" +const basePath = "https://www.googleapis.com/compute/v1beta12/projects/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Google Compute Engine resources + ComputeScope = "https://www.googleapis.com/auth/compute" + + // View your Google Compute Engine resources + ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly" + + // View your data in Google Cloud Storage + DevstorageRead_onlyScope = "https://www.googleapis.com/auth/devstorage.read_only" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client} + s.Disks = &DisksService{s: s} + s.Firewalls = &FirewallsService{s: s} + s.Images = &ImagesService{s: s} + s.Instances = &InstancesService{s: s} + s.Kernels = &KernelsService{s: s} + s.MachineTypes = &MachineTypesService{s: s} + s.Networks = &NetworksService{s: s} + s.Operations = &OperationsService{s: s} + s.Projects = &ProjectsService{s: s} + s.Snapshots = &SnapshotsService{s: s} + s.Zones = &ZonesService{s: s} + return s, nil +} + +type Service struct { + client *http.Client + + Disks *DisksService + + Firewalls *FirewallsService + + Images *ImagesService + + Instances *InstancesService + + Kernels *KernelsService + + MachineTypes *MachineTypesService + + Networks *NetworksService + + Operations *OperationsService + + Projects *ProjectsService + + Snapshots *SnapshotsService + + Zones *ZonesService +} + +type DisksService struct { + s *Service +} + +type FirewallsService struct { + s *Service +} + +type ImagesService struct { + s *Service +} + +type InstancesService struct { + s *Service +} + +type KernelsService struct { + s *Service +} + +type MachineTypesService struct { + s *Service +} + +type NetworksService struct { + s *Service +} + +type OperationsService struct { + s *Service +} + +type ProjectsService struct { + s *Service +} + +type SnapshotsService struct { + s *Service +} + +type ZonesService struct { + s *Service +} + +type AccessConfig struct { + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of this access configuration. + Name string `json:"name,omitempty"` + + // NatIP: An external IP address associated with this instance. Specify + // an unused static IP address available to the project. If left blank, + // the external IP will be drawn from a shared ephemeral pool. + NatIP string `json:"natIP,omitempty"` + + // Type: Type of configuration. Must be set to "ONE_TO_ONE_NAT". This + // configures port-for-port NAT to the internet. + Type string `json:"type,omitempty"` +} + +type AttachedDisk struct { + // DeleteOnTerminate: Persistent disk only; If true, delete the disk and + // all its data when the associated instance is deleted. This property + // defaults to false if not specified. + DeleteOnTerminate bool `json:"deleteOnTerminate,omitempty"` + + // DeviceName: Persistent disk only; must be unique within the instance + // when specified. This represents a unique device name that is + // reflected into the /dev/ tree of a Linux operating system running + // within the instance. If not specified, a default will be chosen by + // the system. + DeviceName string `json:"deviceName,omitempty"` + + // Index: A zero-based index to assign to this disk, where 0 is reserved + // for the boot disk. If not specified, the server will choose an + // appropriate value. + Index int64 `json:"index,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Mode: The mode in which to attach this disk, either "READ_WRITE" or + // "READ_ONLY". + Mode string `json:"mode,omitempty"` + + // Source: Persistent disk only; the URL of the persistent disk + // resource. + Source string `json:"source,omitempty"` + + // Type: Type of the disk, either "EPHEMERAL" or "PERSISTENT". Note that + // persistent disks must be created before you can specify them here. + Type string `json:"type,omitempty"` +} + +type Disk struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Options: Internal use only. + Options string `json:"options,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SizeGb: Size of the persistent disk, specified in GB. + SizeGb int64 `json:"sizeGb,omitempty,string"` + + // SourceSnapshot: The source snapshot used to create this disk. Once + // the source snapshot has been deleted from the system, this field will + // be cleared, and will not be set even if a snapshot with the same name + // has been re-created. + SourceSnapshot string `json:"sourceSnapshot,omitempty"` + + // SourceSnapshotId: The 'id' value of the snapshot used to create this + // disk. This value may be used to determine whether the disk was + // created from the current or a previous instance of a given disk + // snapshot. + SourceSnapshotId string `json:"sourceSnapshotId,omitempty"` + + // Status: The status of disk creation (output only). + Status string `json:"status,omitempty"` + + // Zone: URL for the zone where the persistent disk resides; provided by + // the client when the disk is created. A persistent disk must reside in + // the same zone as the instance to which it is attached. + Zone string `json:"zone,omitempty"` +} + +type DiskList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The persistent disk resources. + Items []*Disk `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Firewall struct { + // Allowed: The list of rules specified by this firewall. Each rule + // specifies a protocol and port-range tuple that describes a permitted + // connection. + Allowed []*FirewallAllowed `json:"allowed,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Network: URL of the network to which this firewall is applied; + // provided by the client when the firewall is created. + Network string `json:"network,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SourceRanges: A list of IP address blocks expressed in CIDR format + // which this rule applies to. One or both of sourceRanges and + // sourceTags may be set; an inbound connection is allowed if either the + // range or the tag of the source matches. + SourceRanges []string `json:"sourceRanges,omitempty"` + + // SourceTags: A list of instance tags which this rule applies to. One + // or both of sourceRanges and sourceTags may be set; an inbound + // connection is allowed if either the range or the tag of the source + // matches. + SourceTags []string `json:"sourceTags,omitempty"` + + // TargetTags: A list of instance tags indicating sets of instances + // located on network which may make network connections as specified in + // allowed. If no targetTags are specified, the firewall rule applies to + // all instances on the specified network. + TargetTags []string `json:"targetTags,omitempty"` +} + +type FirewallAllowed struct { + // IPProtocol: Required; this is the IP protocol that is allowed for + // this rule. This can either be a well known protocol string (tcp, udp + // or icmp) or the IP protocol number. + IPProtocol string `json:"IPProtocol,omitempty"` + + // Ports: An optional list of ports which are allowed. It is an error to + // specify this for any protocol that isn't UDP or TCP. Each entry must + // be either an integer or a range. If not specified, connections + // through any port are allowed. + // Example inputs include: ["22"], + // ["80,"443"] and ["12345-12349"]. + Ports []string `json:"ports,omitempty"` +} + +type FirewallList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The firewall resources. + Items []*Firewall `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Image struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: Textual description of the resource; provided by the + // client when the resource is created. + Description string `json:"description,omitempty"` + + // DiskSnapshot: Not yet implemented. + DiskSnapshot *ImageDiskSnapshot `json:"diskSnapshot,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // PreferredKernel: An optional URL of the preferred kernel for use with + // this disk image. If not specified, a server defined default kernel + // will be used. + PreferredKernel string `json:"preferredKernel,omitempty"` + + // RawDisk: The raw disk image parameters. + RawDisk *ImageRawDisk `json:"rawDisk,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SourceType: Must be "RAW"; provided by the client when the disk image + // is created. + SourceType string `json:"sourceType,omitempty"` +} + +type ImageDiskSnapshot struct { + // Source: URL of the disk snapshot. + Source string `json:"source,omitempty"` +} + +type ImageRawDisk struct { + // ContainerType: The format used to encode and transmit the block + // device. Should be TAR. This is just a container and transmission + // format and not a runtime format. Provided by the client when the disk + // image is created. + ContainerType string `json:"containerType,omitempty"` + + // Sha1Checksum: An optional SHA1 checksum of the disk image before + // unpackaging; provided by the client when the disk image is created. + Sha1Checksum string `json:"sha1Checksum,omitempty"` + + // Source: The full Google Cloud Storage URL where the disk image is + // stored; provided by the client when the disk image is created. + Source string `json:"source,omitempty"` +} + +type ImageList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The disk image resources. + Items []*Image `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Instance struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Disks: Array of disks associated with this instance. Persistent disks + // must be created before you can assign them. + Disks []*AttachedDisk `json:"disks,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Image: An optional URL of the disk image resource to be to be + // installed on this instance; provided by the client when the instance + // is created. If not specified, the server will choose a default image. + Image string `json:"image,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MachineType: URL of the machine type resource describing which + // machine type to use to host the instance; provided by the client when + // the instance is created. + MachineType string `json:"machineType,omitempty"` + + // Metadata: Metadata key/value pairs assigned to this instance. + // Consists of custom metadata or predefined keys; see Instance + // documentation for more information. + Metadata *Metadata `json:"metadata,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // NetworkInterfaces: Array of configurations for this interface. This + // specifies how this interface is configured to interact with other + // network services, such as connecting to the internet. Currently, + // ONE_TO_ONE_NAT is the only access config supported. If there are no + // accessConfigs specified, then this instance will have no external + // internet access. + NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // ServiceAccounts: A list of service accounts each with specified + // scopes, for which access tokens are to be made available to the + // instance through metadata queries. + ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"` + + // Status: Instance status. One of the following values: "PROVISIONING", + // "STAGING", "RUNNING" (output only). + Status string `json:"status,omitempty"` + + // StatusMessage: An optional, human-readable explanation of the status + // (output only). + StatusMessage string `json:"statusMessage,omitempty"` + + // Tags: An optional set of tags applied to this instance. Used to + // identify valid sources or targets for network firewalls. Provided by + // the client when the instance is created. Each tag must be 1-63 + // characters long, and comply with RFC1035. + Tags []string `json:"tags,omitempty"` + + // Zone: URL of the zone resource describing where this instance should + // be hosted; provided by the client when the instance is created. + Zone string `json:"zone,omitempty"` +} + +type InstanceList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A list of instance resources. + Items []*Instance `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Kernel struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type KernelList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The kernel resources. + Items []*Kernel `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type MachineType struct { + // AvailableZone: The zones that this machine type can run in. + AvailableZone []interface{} `json:"availableZone,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // EphemeralDisks: List of extended ephemeral disks assigned to the + // instance. + EphemeralDisks []*MachineTypeEphemeralDisks `json:"ephemeralDisks,omitempty"` + + // GuestCpus: Count of CPUs exposed to the instance. + GuestCpus int64 `json:"guestCpus,omitempty"` + + // HostCpus: Count of physical CPUs reserved on the virtual machine + // host. Deprecated. + HostCpus float64 `json:"hostCpus,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // ImageSpaceGb: Space allotted for the image, defined in GB. + ImageSpaceGb int64 `json:"imageSpaceGb,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MaximumPersistentDisks: Maximum persistent disks allowed. + MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"` + + // MaximumPersistentDisksSizeGb: Maximum total persistent disks size + // (GB) allowed. + MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"` + + // MemoryMb: Physical memory assigned to the instance, defined in MB. + MemoryMb int64 `json:"memoryMb,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type MachineTypeEphemeralDisks struct { + // DiskGb: Size of the ephemeral disk, defined in GB. + DiskGb int64 `json:"diskGb,omitempty"` +} + +type MachineTypeList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The machine type resources. + Items []*MachineType `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Metadata struct { + // Items: Array of key/value pairs. The total size of all keys and + // values must be less than 512 KB. + Items []*MetadataItems `json:"items,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` +} + +type MetadataItems struct { + // Key: Key for the metadata entry. Keys must conform to the following + // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is + // reflected as part of a URL in the metadata server. Additionally, to + // avoid ambiguity, keys must be unique. + Key string `json:"key,omitempty"` + + // Value: Value for the metadata entry. These are free-form strings, and + // only have meaning as interpreted by the image running in the + // instance. The only restriction placed on values is that their size + // must be less than or equal to 15000 bytes. + Value string `json:"value,omitempty"` +} + +type Network struct { + // IPv4Range: Required; The range of internal addresses that are legal + // on this network. This range is a CIDR specification, for example: + // 192.168.0.0/16. Provided by the client when the network is created. + IPv4Range string `json:"IPv4Range,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // GatewayIPv4: An optional address that is used for default routing to + // other networks. This must be within the range specified by IPv4Range, + // and is typically the first usable address in that range. If not + // specified, the default value is the first usable address in + // IPv4Range. + GatewayIPv4 string `json:"gatewayIPv4,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type NetworkInterface struct { + // AccessConfigs: Array of configurations for this interface. This + // specifies how this interface is configured to interact with other + // network services, such as connecting to the internet. Currently, + // ONE_TO_ONE_NAT is the only access config supported. If there are no + // accessConfigs specified, then this instance will have no external + // internet access. + AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource, determined by the server; for network + // devices, these are e.g. eth0, eth1, etc. (output only). + Name string `json:"name,omitempty"` + + // Network: URL of the network resource attached to this interface. + Network string `json:"network,omitempty"` + + // NetworkIP: An optional IPV4 internal network address to assign to + // this instance. If not specified, one will be assigned from the + // available range. + NetworkIP string `json:"networkIP,omitempty"` +} + +type NetworkList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The network resources. + Items []*Network `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Operation struct { + // ClientOperationId: An optional identifier specified by the client + // when the mutation was initiated. Must be unique for all operation + // resources in the project (output only). + ClientOperationId string `json:"clientOperationId,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // EndTime: The time that this operation was completed. This is in RFC + // 3339 format (output only). + EndTime string `json:"endTime,omitempty"` + + // Error: If errors occurred during processing of this operation, this + // field will be populated (output only). + Error *OperationError `json:"error,omitempty"` + + // HttpErrorMessage: If operation fails, the HTTP error message + // returned, e.g. NOT FOUND. (output only). + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + // HttpErrorStatusCode: If operation fails, the HTTP error status code + // returned, e.g. 404. (output only). + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: The time that this operation was requested. This is in + // RFC 3339 format (output only). + InsertTime string `json:"insertTime,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // OperationType: Type of the operation. Examples include "insert", + // "update", and "delete" (output only). + OperationType string `json:"operationType,omitempty"` + + // Progress: An optional progress indicator that ranges from 0 to 100. + // There is no requirement that this be linear or support any + // granularity of operations. This should not be used to guess at when + // the operation will be complete. This number should be monotonically + // increasing as the operation progresses (output only). + Progress int64 `json:"progress,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // StartTime: The time that this operation was started by the server. + // This is in RFC 3339 format (output only). + StartTime string `json:"startTime,omitempty"` + + // Status: Status of the operation. Can be one of the following: + // "PENDING", "RUNNING", or "DONE" (output only). + Status string `json:"status,omitempty"` + + // StatusMessage: An optional textual description of the current status + // of the operation (output only). + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetId: Unique target id which identifies a particular incarnation + // of the target (output only). + TargetId uint64 `json:"targetId,omitempty,string"` + + // TargetLink: URL of the resource the operation is mutating (output + // only). + TargetLink string `json:"targetLink,omitempty"` + + // User: User who requested the operation, for example + // "user@example.com" (output only). + User string `json:"user,omitempty"` +} + +type OperationError struct { + // Errors: The array of errors encountered while processing this + // operation. + Errors []*OperationErrorErrors `json:"errors,omitempty"` +} + +type OperationErrorErrors struct { + // Code: The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: Indicates the field in the request which caused the error. + // This property is optional. + Location string `json:"location,omitempty"` + + // Message: An optional, human-readable error message. + Message string `json:"message,omitempty"` +} + +type OperationList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The operation resources. + Items []*Operation `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Project struct { + // CommonInstanceMetadata: Metadata key/value pairs available to all + // instances contained in this project. + CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // ExternalIpAddresses: Internet available IP addresses available for + // use in this project. + ExternalIpAddresses []string `json:"externalIpAddresses,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // Quotas: Quotas assigned to this project. + Quotas []*ProjectQuotas `json:"quotas,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type ProjectQuotas struct { + // Limit: Quota limit for this metric. + Limit float64 `json:"limit,omitempty"` + + // Metric: Name of the quota metric. + Metric string `json:"metric,omitempty"` + + // Usage: Current usage of this metric. + Usage float64 `json:"usage,omitempty"` +} + +type ServiceAccount struct { + // Email: Email address of the service account. + Email string `json:"email,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Scopes: The list of scopes to be made available for this service + // account. + Scopes []string `json:"scopes,omitempty"` +} + +type Snapshot struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // DiskSizeGb: Size of the persistent disk snapshot, specified in GB + // (output only). + DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SourceDisk: The source disk used to create this snapshot. Once the + // source disk has been deleted from the system, this field will be + // cleared, and will not be set even if a disk with the same name has + // been re-created. + SourceDisk string `json:"sourceDisk,omitempty"` + + // SourceDiskId: The 'id' value of the disk used to create this + // snapshot. This value may be used to determine whether the snapshot + // was taken from the current or a previous instance of a given disk + // name. + SourceDiskId string `json:"sourceDiskId,omitempty"` + + // Status: The status of the persistent disk snapshot (output only). + Status string `json:"status,omitempty"` +} + +type SnapshotList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The persistent snapshot resources. + Items []*Snapshot `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Zone struct { + // AvailableMachineType: The machine types that can be used in this zone + // (output only). + AvailableMachineType []interface{} `json:"availableMachineType,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: Textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MaintenanceWindows: Scheduled maintenance windows for the zone. When + // the zone is in a maintenance window, all resources which reside in + // the zone will be unavailable. + MaintenanceWindows []*ZoneMaintenanceWindows `json:"maintenanceWindows,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Status: Status of the zone. "UP" or "DOWN". + Status string `json:"status,omitempty"` +} + +type ZoneMaintenanceWindows struct { + // BeginTime: Begin time of the maintenance window, in RFC 3339 format. + BeginTime string `json:"beginTime,omitempty"` + + // Description: Textual description of the maintenance window. + Description string `json:"description,omitempty"` + + // EndTime: End time of the maintenance window, in RFC 3339 format. + EndTime string `json:"endTime,omitempty"` + + // Name: Name of the maintenance window. + Name string `json:"name,omitempty"` +} + +type ZoneList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The zone resources. + Items []*Zone `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +// method id "compute.disks.delete": + +type DisksDeleteCall struct { + s *Service + project string + disk string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified persistent disk resource. +func (r *DisksService) Delete(project string, disk string) *DisksDeleteCall { + c := &DisksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.disk = disk + return c +} + +func (c *DisksDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/disks/{disk}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{disk}", cleanPathString(c.disk), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified persistent disk resource.", + // "httpMethod": "DELETE", + // "id": "compute.disks.delete", + // "parameterOrder": [ + // "project", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/disks/{disk}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.disks.get": + +type DisksGetCall struct { + s *Service + project string + disk string + opt_ map[string]interface{} +} + +// Get: Returns the specified persistent disk resource. +func (r *DisksService) Get(project string, disk string) *DisksGetCall { + c := &DisksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.disk = disk + return c +} + +func (c *DisksGetCall) Do() (*Disk, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/disks/{disk}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{disk}", cleanPathString(c.disk), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Disk) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified persistent disk resource.", + // "httpMethod": "GET", + // "id": "compute.disks.get", + // "parameterOrder": [ + // "project", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/disks/{disk}", + // "response": { + // "$ref": "Disk" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.disks.insert": + +type DisksInsertCall struct { + s *Service + project string + disk *Disk + opt_ map[string]interface{} +} + +// Insert: Creates a persistent disk resource in the specified project +// using the data included in the request. +func (r *DisksService) Insert(project string, disk *Disk) *DisksInsertCall { + c := &DisksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.disk = disk + return c +} + +func (c *DisksInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/disks") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a persistent disk resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.disks.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/disks", + // "request": { + // "$ref": "Disk" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.disks.list": + +type DisksListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of persistent disk resources contained +// within the specified project. +func (r *DisksService) List(project string) *DisksListCall { + c := &DisksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *DisksListCall) Filter(filter string) *DisksListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *DisksListCall) PageToken(pageToken string) *DisksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *DisksListCall) Do() (*DiskList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/disks") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DiskList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of persistent disk resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.disks.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/disks", + // "response": { + // "$ref": "DiskList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.firewalls.delete": + +type FirewallsDeleteCall struct { + s *Service + project string + firewall string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified firewall resource. +func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall { + c := &FirewallsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + return c +} + +func (c *FirewallsDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/firewalls/{firewall}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{firewall}", cleanPathString(c.firewall), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified firewall resource.", + // "httpMethod": "DELETE", + // "id": "compute.firewalls.delete", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/firewalls/{firewall}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.get": + +type FirewallsGetCall struct { + s *Service + project string + firewall string + opt_ map[string]interface{} +} + +// Get: Returns the specified firewall resource. +func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall { + c := &FirewallsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + return c +} + +func (c *FirewallsGetCall) Do() (*Firewall, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/firewalls/{firewall}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{firewall}", cleanPathString(c.firewall), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Firewall) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified firewall resource.", + // "httpMethod": "GET", + // "id": "compute.firewalls.get", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/firewalls/{firewall}", + // "response": { + // "$ref": "Firewall" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.firewalls.insert": + +type FirewallsInsertCall struct { + s *Service + project string + firewall *Firewall + opt_ map[string]interface{} +} + +// Insert: Creates a firewall resource in the specified project using +// the data included in the request. +func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall { + c := &FirewallsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + return c +} + +func (c *FirewallsInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/firewalls") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a firewall resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.firewalls.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/firewalls", + // "request": { + // "$ref": "Firewall" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.list": + +type FirewallsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of firewall resources available to the +// specified project. +func (r *FirewallsService) List(project string) *FirewallsListCall { + c := &FirewallsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *FirewallsListCall) Do() (*FirewallList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/firewalls") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(FirewallList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of firewall resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.firewalls.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/firewalls", + // "response": { + // "$ref": "FirewallList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.firewalls.patch": + +type FirewallsPatchCall struct { + s *Service + project string + firewall string + firewall2 *Firewall + opt_ map[string]interface{} +} + +// Patch: Updates the specified firewall resource with the data included +// in the request. This method supports patch semantics. +func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall { + c := &FirewallsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + c.firewall2 = firewall2 + return c +} + +func (c *FirewallsPatchCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/firewalls/{firewall}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{firewall}", cleanPathString(c.firewall), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified firewall resource with the data included in the request. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "compute.firewalls.patch", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/firewalls/{firewall}", + // "request": { + // "$ref": "Firewall" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.update": + +type FirewallsUpdateCall struct { + s *Service + project string + firewall string + firewall2 *Firewall + opt_ map[string]interface{} +} + +// Update: Updates the specified firewall resource with the data +// included in the request. +func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall { + c := &FirewallsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + c.firewall2 = firewall2 + return c +} + +func (c *FirewallsUpdateCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/firewalls/{firewall}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{firewall}", cleanPathString(c.firewall), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified firewall resource with the data included in the request.", + // "httpMethod": "PUT", + // "id": "compute.firewalls.update", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/firewalls/{firewall}", + // "request": { + // "$ref": "Firewall" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.delete": + +type ImagesDeleteCall struct { + s *Service + project string + image string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified image resource. +func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall { + c := &ImagesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + return c +} + +func (c *ImagesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/images/{image}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{image}", cleanPathString(c.image), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified image resource.", + // "httpMethod": "DELETE", + // "id": "compute.images.delete", + // "parameterOrder": [ + // "project", + // "image" + // ], + // "parameters": { + // "image": { + // "description": "Name of the image resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/images/{image}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.get": + +type ImagesGetCall struct { + s *Service + project string + image string + opt_ map[string]interface{} +} + +// Get: Returns the specified image resource. +func (r *ImagesService) Get(project string, image string) *ImagesGetCall { + c := &ImagesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + return c +} + +func (c *ImagesGetCall) Do() (*Image, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/images/{image}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{image}", cleanPathString(c.image), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Image) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified image resource.", + // "httpMethod": "GET", + // "id": "compute.images.get", + // "parameterOrder": [ + // "project", + // "image" + // ], + // "parameters": { + // "image": { + // "description": "Name of the image resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/images/{image}", + // "response": { + // "$ref": "Image" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.images.insert": + +type ImagesInsertCall struct { + s *Service + project string + image *Image + opt_ map[string]interface{} +} + +// Insert: Creates an image resource in the specified project using the +// data included in the request. +func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall { + c := &ImagesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + return c +} + +func (c *ImagesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.image) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/images") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an image resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.images.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/images", + // "request": { + // "$ref": "Image" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/devstorage.read_only" + // ] + // } + +} + +// method id "compute.images.list": + +type ImagesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of image resources available to the +// specified project. +func (r *ImagesService) List(project string) *ImagesListCall { + c := &ImagesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ImagesListCall) Filter(filter string) *ImagesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ImagesListCall) Do() (*ImageList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/images") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ImageList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of image resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.images.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/images", + // "response": { + // "$ref": "ImageList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.addAccessConfig": + +type InstancesAddAccessConfigCall struct { + s *Service + project string + instance string + network_interface string + accessconfig *AccessConfig + opt_ map[string]interface{} +} + +// AddAccessConfig: Adds an access config to an instance's network +// interface. +func (r *InstancesService) AddAccessConfig(project string, instance string, network_interface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall { + c := &InstancesAddAccessConfigCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.network_interface = network_interface + c.accessconfig = accessconfig + return c +} + +func (c *InstancesAddAccessConfigCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + params.Set("network_interface", fmt.Sprintf("%v", c.network_interface)) + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/instances/{instance}/add-access-config") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{instance}", cleanPathString(c.instance), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds an access config to an instance's network interface.", + // "httpMethod": "POST", + // "id": "compute.instances.addAccessConfig", + // "parameterOrder": [ + // "project", + // "instance", + // "network_interface" + // ], + // "parameters": { + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "network_interface": { + // "description": "Network interface name.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/instances/{instance}/add-access-config", + // "request": { + // "$ref": "AccessConfig" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.delete": + +type InstancesDeleteCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified instance resource. +func (r *InstancesService) Delete(project string, instance string) *InstancesDeleteCall { + c := &InstancesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +func (c *InstancesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/instances/{instance}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{instance}", cleanPathString(c.instance), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified instance resource.", + // "httpMethod": "DELETE", + // "id": "compute.instances.delete", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/instances/{instance}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.deleteAccessConfig": + +type InstancesDeleteAccessConfigCall struct { + s *Service + project string + instance string + access_config string + network_interface string + opt_ map[string]interface{} +} + +// DeleteAccessConfig: Deletes an access config from an instance's +// network interface. +func (r *InstancesService) DeleteAccessConfig(project string, instance string, access_config string, network_interface string) *InstancesDeleteAccessConfigCall { + c := &InstancesDeleteAccessConfigCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.access_config = access_config + c.network_interface = network_interface + return c +} + +func (c *InstancesDeleteAccessConfigCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("access_config", fmt.Sprintf("%v", c.access_config)) + params.Set("network_interface", fmt.Sprintf("%v", c.network_interface)) + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/instances/{instance}/delete-access-config") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{instance}", cleanPathString(c.instance), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes an access config from an instance's network interface.", + // "httpMethod": "POST", + // "id": "compute.instances.deleteAccessConfig", + // "parameterOrder": [ + // "project", + // "instance", + // "access_config", + // "network_interface" + // ], + // "parameters": { + // "access_config": { + // "description": "Access config name.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "network_interface": { + // "description": "Network interface name.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/instances/{instance}/delete-access-config", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.get": + +type InstancesGetCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} +} + +// Get: Returns the specified instance resource. +func (r *InstancesService) Get(project string, instance string) *InstancesGetCall { + c := &InstancesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +func (c *InstancesGetCall) Do() (*Instance, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/instances/{instance}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{instance}", cleanPathString(c.instance), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Instance) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified instance resource.", + // "httpMethod": "GET", + // "id": "compute.instances.get", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/instances/{instance}", + // "response": { + // "$ref": "Instance" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.insert": + +type InstancesInsertCall struct { + s *Service + project string + instance *Instance + opt_ map[string]interface{} +} + +// Insert: Creates an instance resource in the specified project using +// the data included in the request. +func (r *InstancesService) Insert(project string, instance *Instance) *InstancesInsertCall { + c := &InstancesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +func (c *InstancesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/instances") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an instance resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.instances.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/instances", + // "request": { + // "$ref": "Instance" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.list": + +type InstancesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of instance resources contained within the +// specified project. +func (r *InstancesService) List(project string) *InstancesListCall { + c := &InstancesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *InstancesListCall) Filter(filter string) *InstancesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *InstancesListCall) Do() (*InstanceList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/instances") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstanceList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of instance resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.instances.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/instances", + // "response": { + // "$ref": "InstanceList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.kernels.get": + +type KernelsGetCall struct { + s *Service + project string + kernel string + opt_ map[string]interface{} +} + +// Get: Returns the specified kernel resource. +func (r *KernelsService) Get(project string, kernel string) *KernelsGetCall { + c := &KernelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.kernel = kernel + return c +} + +func (c *KernelsGetCall) Do() (*Kernel, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/kernels/{kernel}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{kernel}", cleanPathString(c.kernel), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Kernel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified kernel resource.", + // "httpMethod": "GET", + // "id": "compute.kernels.get", + // "parameterOrder": [ + // "project", + // "kernel" + // ], + // "parameters": { + // "kernel": { + // "description": "Name of the kernel resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/kernels/{kernel}", + // "response": { + // "$ref": "Kernel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.kernels.list": + +type KernelsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of kernel resources available to the +// specified project. +func (r *KernelsService) List(project string) *KernelsListCall { + c := &KernelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *KernelsListCall) Filter(filter string) *KernelsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *KernelsListCall) MaxResults(maxResults int64) *KernelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *KernelsListCall) PageToken(pageToken string) *KernelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *KernelsListCall) Do() (*KernelList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/kernels") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(KernelList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of kernel resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.kernels.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/kernels", + // "response": { + // "$ref": "KernelList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.machineTypes.get": + +type MachineTypesGetCall struct { + s *Service + project string + machineType string + opt_ map[string]interface{} +} + +// Get: Returns the specified machine type resource. +func (r *MachineTypesService) Get(project string, machineType string) *MachineTypesGetCall { + c := &MachineTypesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.machineType = machineType + return c +} + +func (c *MachineTypesGetCall) Do() (*MachineType, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/machine-types/{machineType}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{machineType}", cleanPathString(c.machineType), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(MachineType) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified machine type resource.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.get", + // "parameterOrder": [ + // "project", + // "machineType" + // ], + // "parameters": { + // "machineType": { + // "description": "Name of the machine type resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/machine-types/{machineType}", + // "response": { + // "$ref": "MachineType" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.machineTypes.list": + +type MachineTypesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of machine type resources available to the +// specified project. +func (r *MachineTypesService) List(project string) *MachineTypesListCall { + c := &MachineTypesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *MachineTypesListCall) Do() (*MachineTypeList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/machine-types") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(MachineTypeList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of machine type resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/machine-types", + // "response": { + // "$ref": "MachineTypeList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.networks.delete": + +type NetworksDeleteCall struct { + s *Service + project string + network string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified network resource. +func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall { + c := &NetworksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.network = network + return c +} + +func (c *NetworksDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/networks/{network}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{network}", cleanPathString(c.network), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified network resource.", + // "httpMethod": "DELETE", + // "id": "compute.networks.delete", + // "parameterOrder": [ + // "project", + // "network" + // ], + // "parameters": { + // "network": { + // "description": "Name of the network resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/networks/{network}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.networks.get": + +type NetworksGetCall struct { + s *Service + project string + network string + opt_ map[string]interface{} +} + +// Get: Returns the specified network resource. +func (r *NetworksService) Get(project string, network string) *NetworksGetCall { + c := &NetworksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.network = network + return c +} + +func (c *NetworksGetCall) Do() (*Network, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/networks/{network}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{network}", cleanPathString(c.network), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Network) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified network resource.", + // "httpMethod": "GET", + // "id": "compute.networks.get", + // "parameterOrder": [ + // "project", + // "network" + // ], + // "parameters": { + // "network": { + // "description": "Name of the network resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/networks/{network}", + // "response": { + // "$ref": "Network" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.networks.insert": + +type NetworksInsertCall struct { + s *Service + project string + network *Network + opt_ map[string]interface{} +} + +// Insert: Creates a network resource in the specified project using the +// data included in the request. +func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall { + c := &NetworksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.network = network + return c +} + +func (c *NetworksInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.network) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/networks") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a network resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.networks.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/networks", + // "request": { + // "$ref": "Network" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.networks.list": + +type NetworksListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of network resources available to the +// specified project. +func (r *NetworksService) List(project string) *NetworksListCall { + c := &NetworksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *NetworksListCall) Filter(filter string) *NetworksListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *NetworksListCall) Do() (*NetworkList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/networks") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(NetworkList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of network resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.networks.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/networks", + // "response": { + // "$ref": "NetworkList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.operations.delete": + +type OperationsDeleteCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified operation resource. +func (r *OperationsService) Delete(project string, operation string) *OperationsDeleteCall { + c := &OperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +func (c *OperationsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/operations/{operation}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{operation}", cleanPathString(c.operation), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified operation resource.", + // "httpMethod": "DELETE", + // "id": "compute.operations.delete", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/operations/{operation}", + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.operations.get": + +type OperationsGetCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} +} + +// Get: Retrieves the specified operation resource. +func (r *OperationsService) Get(project string, operation string) *OperationsGetCall { + c := &OperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +func (c *OperationsGetCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/operations/{operation}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{operation}", cleanPathString(c.operation), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified operation resource.", + // "httpMethod": "GET", + // "id": "compute.operations.get", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/operations/{operation}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.operations.list": + +type OperationsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of operation resources contained within the +// specified project. +func (r *OperationsService) List(project string) *OperationsListCall { + c := &OperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *OperationsListCall) Filter(filter string) *OperationsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *OperationsListCall) Do() (*OperationList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/operations") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OperationList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.operations.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/operations", + // "response": { + // "$ref": "OperationList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.projects.get": + +type ProjectsGetCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// Get: Returns the specified project resource. +func (r *ProjectsService) Get(project string) *ProjectsGetCall { + c := &ProjectsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +func (c *ProjectsGetCall) Do() (*Project, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Project) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified project resource.", + // "httpMethod": "GET", + // "id": "compute.projects.get", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project resource to retrieve.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}", + // "response": { + // "$ref": "Project" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.projects.setCommonInstanceMetadata": + +type ProjectsSetCommonInstanceMetadataCall struct { + s *Service + project string + metadata *Metadata + opt_ map[string]interface{} +} + +// SetCommonInstanceMetadata: Sets metadata common to all instances +// within the specified project using the data included in the request. +func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall { + c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.metadata = metadata + return c +} + +func (c *ProjectsSetCommonInstanceMetadataCall) Do() error { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) + if err != nil { + return err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/set-common-instance-metadata") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Sets metadata common to all instances within the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.projects.setCommonInstanceMetadata", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/set-common-instance-metadata", + // "request": { + // "$ref": "Metadata" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.snapshots.delete": + +type SnapshotsDeleteCall struct { + s *Service + project string + snapshot string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified persistent disk snapshot resource. +func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall { + c := &SnapshotsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.snapshot = snapshot + return c +} + +func (c *SnapshotsDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/snapshots/{snapshot}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{snapshot}", cleanPathString(c.snapshot), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified persistent disk snapshot resource.", + // "httpMethod": "DELETE", + // "id": "compute.snapshots.delete", + // "parameterOrder": [ + // "project", + // "snapshot" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "snapshot": { + // "description": "Name of the persistent disk snapshot resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/snapshots/{snapshot}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.snapshots.get": + +type SnapshotsGetCall struct { + s *Service + project string + snapshot string + opt_ map[string]interface{} +} + +// Get: Returns the specified persistent disk snapshot resource. +func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall { + c := &SnapshotsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.snapshot = snapshot + return c +} + +func (c *SnapshotsGetCall) Do() (*Snapshot, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/snapshots/{snapshot}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{snapshot}", cleanPathString(c.snapshot), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Snapshot) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified persistent disk snapshot resource.", + // "httpMethod": "GET", + // "id": "compute.snapshots.get", + // "parameterOrder": [ + // "project", + // "snapshot" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "snapshot": { + // "description": "Name of the persistent disk snapshot resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/snapshots/{snapshot}", + // "response": { + // "$ref": "Snapshot" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.snapshots.insert": + +type SnapshotsInsertCall struct { + s *Service + project string + snapshot *Snapshot + opt_ map[string]interface{} +} + +// Insert: Creates a persistent disk snapshot resource in the specified +// project using the data included in the request. +func (r *SnapshotsService) Insert(project string, snapshot *Snapshot) *SnapshotsInsertCall { + c := &SnapshotsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.snapshot = snapshot + return c +} + +func (c *SnapshotsInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/snapshots") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a persistent disk snapshot resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.snapshots.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/snapshots", + // "request": { + // "$ref": "Snapshot" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.snapshots.list": + +type SnapshotsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of persistent disk snapshot resources +// contained within the specified project. +func (r *SnapshotsService) List(project string) *SnapshotsListCall { + c := &SnapshotsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *SnapshotsListCall) Do() (*SnapshotList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/snapshots") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SnapshotList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of persistent disk snapshot resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.snapshots.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/snapshots", + // "response": { + // "$ref": "SnapshotList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.zones.get": + +type ZonesGetCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// Get: Returns the specified zone resource. +func (r *ZonesService) Get(project string, zone string) *ZonesGetCall { + c := &ZonesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +func (c *ZonesGetCall) Do() (*Zone, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/zones/{zone}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{zone}", cleanPathString(c.zone), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Zone) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified zone resource.", + // "httpMethod": "GET", + // "id": "compute.zones.get", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}", + // "response": { + // "$ref": "Zone" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.zones.list": + +type ZonesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of zone resources available to the specified +// project. +func (r *ZonesService) List(project string) *ZonesListCall { + c := &ZonesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ZonesListCall) Filter(filter string) *ZonesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ZonesListCall) Do() (*ZoneList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta12/projects/", "{project}/zones") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ZoneList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of zone resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.zones.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones", + // "response": { + // "$ref": "ZoneList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +func cleanPathString(s string) string { + return strings.Map(func(r rune) rune { + if r >= 0x2d && r <= 0x7a || r == '~' { + return r + } + return -1 + }, s) +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta13/compute-api.json b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta13/compute-api.json new file mode 100644 index 0000000000000..60e5bb28c67cd --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta13/compute-api.json @@ -0,0 +1,2872 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"95FJOuWe9QdOljMvtEYMArTvwNI/uZCmzQDE6V2uI2eL0FGkfgF1tAE\"", + "discoveryVersion": "v1", + "id": "compute:v1beta13", + "name": "compute", + "version": "v1beta13", + "revision": "20130403", + "title": "Compute Engine API", + "description": "API for the Google Compute Engine service.", + "icons": { + "x16": "http://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "http://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://developers.google.com/compute/docs/reference/v1beta13", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/compute/v1beta13/projects/", + "basePath": "/compute/v1beta13/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "compute/v1beta13/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/compute": { + "description": "View and manage your Google Compute Engine resources" + }, + "https://www.googleapis.com/auth/compute.readonly": { + "description": "View your Google Compute Engine resources" + }, + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + } + } + } + }, + "schemas": { + "AccessConfig": { + "id": "AccessConfig", + "type": "object", + "description": "An access configuration attached to an instance's network interface.", + "properties": { + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#accessConfig" + }, + "name": { + "type": "string", + "description": "Name of this access configuration." + }, + "natIP": { + "type": "string", + "description": "An external IP address associated with this instance. Specify an unused static IP address available to the project. If not specified, the external IP will be drawn from a shared ephemeral pool." + }, + "type": { + "type": "string", + "description": "Type of configuration. Must be set to \"ONE_TO_ONE_NAT\". This configures port-for-port NAT to the internet.", + "default": "ONE_TO_ONE_NAT" + } + } + }, + "AttachedDisk": { + "id": "AttachedDisk", + "type": "object", + "description": "An instance-attached disk resource.", + "properties": { + "deleteOnTerminate": { + "type": "boolean", + "description": "Persistent disk only; If true, delete the disk and all its data when the associated instance is deleted. This property defaults to false if not specified." + }, + "deviceName": { + "type": "string", + "description": "Persistent disk only; must be unique within the instance when specified. This represents a unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. If not specified, a default will be chosen by the system." + }, + "index": { + "type": "integer", + "description": "A zero-based index to assign to this disk, where 0 is reserved for the boot disk. If not specified, the server will choose an appropriate value.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#attachedDisk" + }, + "mode": { + "type": "string", + "description": "The mode in which to attach this disk, either \"READ_WRITE\" or \"READ_ONLY\"." + }, + "source": { + "type": "string", + "description": "Persistent disk only; the URL of the persistent disk resource." + }, + "type": { + "type": "string", + "description": "Type of the disk, either \"EPHEMERAL\" or \"PERSISTENT\". Note that persistent disks must be created before you can specify them here.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + } + } + }, + "Disk": { + "id": "Disk", + "type": "object", + "description": "A persistent disk resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#disk" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.disks.insert" + ] + } + }, + "options": { + "type": "string", + "description": "Internal use only." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sizeGb": { + "type": "string", + "description": "Size of the persistent disk, specified in GB.", + "format": "int64", + "annotations": { + "required": [ + "compute.disks.insert" + ] + } + }, + "sourceSnapshot": { + "type": "string", + "description": "The source snapshot used to create this disk. Once the source snapshot has been deleted from the system, this field will be cleared, and will not be set even if a snapshot with the same name has been re-created." + }, + "sourceSnapshotId": { + "type": "string", + "description": "The 'id' value of the snapshot used to create this disk. This value may be used to determine whether the disk was created from the current or a previous instance of a given disk snapshot." + }, + "status": { + "type": "string", + "description": "The status of disk creation (output only)." + }, + "zone": { + "type": "string", + "description": "URL for the zone where the persistent disk resides; provided by the client when the disk is created. A persistent disk must reside in the same zone as the instance to which it is attached.", + "annotations": { + "required": [ + "compute.disks.insert" + ] + } + } + } + }, + "DiskList": { + "id": "DiskList", + "type": "object", + "description": "Contains a list of persistent disk resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The persistent disk resources.", + "items": { + "$ref": "Disk" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#diskList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Firewall": { + "id": "Firewall", + "type": "object", + "description": "A firewall resource.", + "properties": { + "allowed": { + "type": "array", + "description": "The list of rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection.", + "items": { + "type": "object", + "properties": { + "IPProtocol": { + "type": "string", + "description": "Required; this is the IP protocol that is allowed for this rule. This can either be a well known protocol string (tcp, udp or icmp) or the IP protocol number." + }, + "ports": { + "type": "array", + "description": "An optional list of ports which are allowed. It is an error to specify this for any protocol that isn't UDP or TCP. Each entry must be either an integer or a range. If not specified, connections through any port are allowed.\nExample inputs include: [\"22\"], [\"80,\"443\"] and [\"12345-12349\"].", + "items": { + "type": "string" + } + } + } + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#firewall" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.firewalls.insert", + "compute.firewalls.patch" + ] + } + }, + "network": { + "type": "string", + "description": "URL of the network to which this firewall is applied; provided by the client when the firewall is created.", + "annotations": { + "required": [ + "compute.firewalls.insert", + "compute.firewalls.patch" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sourceRanges": { + "type": "array", + "description": "A list of IP address blocks expressed in CIDR format which this rule applies to. One or both of sourceRanges and sourceTags may be set; an inbound connection is allowed if either the range or the tag of the source matches.", + "items": { + "type": "string", + "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}/[0-9]{1,2}" + } + }, + "sourceTags": { + "type": "array", + "description": "A list of instance tags which this rule applies to. One or both of sourceRanges and sourceTags may be set; an inbound connection is allowed if either the range or the tag of the source matches.", + "items": { + "type": "string", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + } + }, + "targetTags": { + "type": "array", + "description": "A list of instance tags indicating sets of instances located on network which may make network connections as specified in allowed. If no targetTags are specified, the firewall rule applies to all instances on the specified network.", + "items": { + "type": "string", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + } + } + } + }, + "FirewallList": { + "id": "FirewallList", + "type": "object", + "description": "Contains a list of firewall resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The firewall resources.", + "items": { + "$ref": "Firewall" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#firewallList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Image": { + "id": "Image", + "type": "object", + "description": "A disk image resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "Textual description of the resource; provided by the client when the resource is created." + }, + "diskSnapshot": { + "type": "object", + "description": "Not yet implemented.", + "properties": { + "source": { + "type": "string", + "description": "URL of the disk snapshot.", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + } + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#image" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + }, + "preferredKernel": { + "type": "string", + "description": "An optional URL of the preferred kernel for use with this disk image. If not specified, a server defined default kernel will be used." + }, + "rawDisk": { + "type": "object", + "description": "The raw disk image parameters.", + "properties": { + "containerType": { + "type": "string", + "description": "The format used to encode and transmit the block device. Should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created.", + "default": "TAR", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + }, + "sha1Checksum": { + "type": "string", + "description": "An optional SHA1 checksum of the disk image before unpackaging; provided by the client when the disk image is created.", + "pattern": "[a-f0-9]{40}" + }, + "source": { + "type": "string", + "description": "The full Google Cloud Storage URL where the disk image is stored; provided by the client when the disk image is created.", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + } + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sourceType": { + "type": "string", + "description": "Must be \"RAW\"; provided by the client when the disk image is created.", + "default": "RAW", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + } + } + }, + "ImageList": { + "id": "ImageList", + "type": "object", + "description": "Contains a list of disk image resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The disk image resources.", + "items": { + "$ref": "Image" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#imageList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Instance": { + "id": "Instance", + "type": "object", + "description": "An instance resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "disks": { + "type": "array", + "description": "Array of disks associated with this instance. Persistent disks must be created before you can assign them.", + "items": { + "$ref": "AttachedDisk" + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "image": { + "type": "string", + "description": "An optional URL of the disk image resource to be to be installed on this instance; provided by the client when the instance is created. If not specified, the server will choose a default image.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#instance" + }, + "machineType": { + "type": "string", + "description": "URL of the machine type resource describing which machine type to use to host the instance; provided by the client when the instance is created.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "metadata": { + "$ref": "Metadata", + "description": "Metadata key/value pairs assigned to this instance. Consists of custom metadata or predefined keys; see Instance documentation for more information." + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "networkInterfaces": { + "type": "array", + "description": "Array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.", + "items": { + "$ref": "NetworkInterface" + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "serviceAccounts": { + "type": "array", + "description": "A list of service accounts each with specified scopes, for which access tokens are to be made available to the instance through metadata queries.", + "items": { + "$ref": "ServiceAccount" + } + }, + "status": { + "type": "string", + "description": "Instance status. One of the following values: \"PROVISIONING\", \"STAGING\", \"RUNNING\", \"STOPPED\", \"TERMINATED\", and \"STOPPING\" (output only)." + }, + "statusMessage": { + "type": "string", + "description": "An optional, human-readable explanation of the status (output only)." + }, + "tags": { + "type": "array", + "description": "An optional set of tags applied to this instance. Used to identify valid sources or targets for network firewalls. Provided by the client when the instance is created. Each tag must be 1-63 characters long, and comply with RFC1035.", + "items": { + "type": "string", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + } + }, + "zone": { + "type": "string", + "description": "URL of the zone resource describing where this instance should be hosted; provided by the client when the instance is created.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + } + } + }, + "InstanceList": { + "id": "InstanceList", + "type": "object", + "description": "Contains a list of instance resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "A list of instance resources.", + "items": { + "$ref": "Instance" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#instanceList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Kernel": { + "id": "Kernel", + "type": "object", + "description": "A kernel resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#kernel" + }, + "name": { + "type": "string", + "description": "Name of the resource.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "KernelList": { + "id": "KernelList", + "type": "object", + "description": "Contains a list of kernel resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The kernel resources.", + "items": { + "$ref": "Kernel" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#kernelList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "MachineType": { + "id": "MachineType", + "type": "object", + "description": "A machine type resource.", + "properties": { + "availableZone": { + "type": "array", + "description": "The zones that this machine type can run in.", + "items": { + "type": "string" + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "ephemeralDisks": { + "type": "array", + "description": "List of extended ephemeral disks assigned to the instance.", + "items": { + "type": "object", + "properties": { + "diskGb": { + "type": "integer", + "description": "Size of the ephemeral disk, defined in GB.", + "format": "int32" + } + } + } + }, + "guestCpus": { + "type": "integer", + "description": "Count of CPUs exposed to the instance.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "imageSpaceGb": { + "type": "integer", + "description": "Space allotted for the image, defined in GB.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#machineType" + }, + "maximumPersistentDisks": { + "type": "integer", + "description": "Maximum persistent disks allowed.", + "format": "int32" + }, + "maximumPersistentDisksSizeGb": { + "type": "string", + "description": "Maximum total persistent disks size (GB) allowed.", + "format": "int64" + }, + "memoryMb": { + "type": "integer", + "description": "Physical memory assigned to the instance, defined in MB.", + "format": "int32" + }, + "name": { + "type": "string", + "description": "Name of the resource.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "MachineTypeList": { + "id": "MachineTypeList", + "type": "object", + "description": "Contains a list of machine type resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The machine type resources.", + "items": { + "$ref": "MachineType" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#machineTypeList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Metadata": { + "id": "Metadata", + "type": "object", + "description": "A metadata key/value entry.", + "properties": { + "items": { + "type": "array", + "description": "Array of key/value pairs. The total size of all keys and values must be less than 512 KB.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.", + "pattern": "[a-zA-Z0-9-_]{1,128}", + "annotations": { + "required": [ + "compute.instances.insert", + "compute.projects.setCommonInstanceMetadata" + ] + } + }, + "value": { + "type": "string", + "description": "Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes.", + "annotations": { + "required": [ + "compute.instances.insert", + "compute.projects.setCommonInstanceMetadata" + ] + } + } + } + } + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#metadata" + } + } + }, + "Network": { + "id": "Network", + "type": "object", + "description": "A network resource.", + "properties": { + "IPv4Range": { + "type": "string", + "description": "Required; The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client when the network is created.", + "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}/[0-9]{1,2}", + "annotations": { + "required": [ + "compute.networks.insert" + ] + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "gatewayIPv4": { + "type": "string", + "description": "An optional address that is used for default routing to other networks. This must be within the range specified by IPv4Range, and is typically the first usable address in that range. If not specified, the default value is the first usable address in IPv4Range.", + "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#network" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.networks.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "NetworkInterface": { + "id": "NetworkInterface", + "type": "object", + "description": "A network interface resource attached to an instance.", + "properties": { + "accessConfigs": { + "type": "array", + "description": "Array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.", + "items": { + "$ref": "AccessConfig" + } + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#networkInterface" + }, + "name": { + "type": "string", + "description": "Name of the resource, determined by the server; for network devices, these are e.g. eth0, eth1, etc. (output only)." + }, + "network": { + "type": "string", + "description": "URL of the network resource attached to this interface.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "networkIP": { + "type": "string", + "description": "An optional IPV4 internal network address to assign to this instance. If not specified, one will be assigned from the available range." + } + } + }, + "NetworkList": { + "id": "NetworkList", + "type": "object", + "description": "Contains a list of network resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The network resources.", + "items": { + "$ref": "Network" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#networkList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "An operation resource, used to manage asynchronous API requests.", + "properties": { + "clientOperationId": { + "type": "string", + "description": "An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only)." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "endTime": { + "type": "string", + "description": "The time that this operation was completed. This is in RFC 3339 format (output only)." + }, + "error": { + "type": "object", + "description": "If errors occurred during processing of this operation, this field will be populated (output only).", + "properties": { + "errors": { + "type": "array", + "description": "The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "An optional, human-readable error message." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only)." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "If operation fails, the HTTP error status code returned, e.g. 404. (output only).", + "format": "int32" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "The time that this operation was requested. This is in RFC 3339 format (output only)." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#operation" + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "operationType": { + "type": "string", + "description": "Type of the operation. Examples include \"insert\", \"update\", and \"delete\" (output only)." + }, + "progress": { + "type": "integer", + "description": "An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only).", + "format": "int32" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "startTime": { + "type": "string", + "description": "The time that this operation was started by the server. This is in RFC 3339 format (output only)." + }, + "status": { + "type": "string", + "description": "Status of the operation. Can be one of the following: \"PENDING\", \"RUNNING\", or \"DONE\" (output only)." + }, + "statusMessage": { + "type": "string", + "description": "An optional textual description of the current status of the operation (output only)." + }, + "targetId": { + "type": "string", + "description": "Unique target id which identifies a particular incarnation of the target (output only).", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "URL of the resource the operation is mutating (output only)." + }, + "user": { + "type": "string", + "description": "User who requested the operation, for example \"user@example.com\" (output only)." + } + } + }, + "OperationList": { + "id": "OperationList", + "type": "object", + "description": "Contains a list of operation resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The operation resources.", + "items": { + "$ref": "Operation" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#operationList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Project": { + "id": "Project", + "type": "object", + "description": "A project resource. Projects can be created only in the APIs Console. Unless marked otherwise, values can only be modified in the console.", + "properties": { + "commonInstanceMetadata": { + "$ref": "Metadata", + "description": "Metadata key/value pairs available to all instances contained in this project." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "externalIpAddresses": { + "type": "array", + "description": "Internet available IP addresses available for use in this project.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#project" + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "quotas": { + "type": "array", + "description": "Quotas assigned to this project.", + "items": { + "type": "object", + "properties": { + "limit": { + "type": "number", + "description": "Quota limit for this metric.", + "format": "double" + }, + "metric": { + "type": "string", + "description": "Name of the quota metric." + }, + "usage": { + "type": "number", + "description": "Current usage of this metric.", + "format": "double" + } + } + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "SerialPortOutput": { + "id": "SerialPortOutput", + "type": "object", + "description": "An instance serial console output.", + "properties": { + "contents": { + "type": "string", + "description": "The contents of the console output." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#serialPortOutput" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource." + } + } + }, + "ServiceAccount": { + "id": "ServiceAccount", + "type": "object", + "description": "A service account.", + "properties": { + "email": { + "type": "string", + "description": "Email address of the service account." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#serviceAccount" + }, + "scopes": { + "type": "array", + "description": "The list of scopes to be made available for this service account.", + "items": { + "type": "string" + } + } + } + }, + "Snapshot": { + "id": "Snapshot", + "type": "object", + "description": "A persistent disk snapshot resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "diskSizeGb": { + "type": "string", + "description": "Size of the persistent disk snapshot, specified in GB (output only).", + "format": "int64" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#snapshot" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.snapshots.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sourceDisk": { + "type": "string", + "description": "The source disk used to create this snapshot. Once the source disk has been deleted from the system, this field will be cleared, and will not be set even if a disk with the same name has been re-created." + }, + "sourceDiskId": { + "type": "string", + "description": "The 'id' value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name." + }, + "status": { + "type": "string", + "description": "The status of the persistent disk snapshot (output only)." + } + } + }, + "SnapshotList": { + "id": "SnapshotList", + "type": "object", + "description": "Contains a list of persistent disk snapshot resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The persistent snapshot resources.", + "items": { + "$ref": "Snapshot" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#snapshotList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Zone": { + "id": "Zone", + "type": "object", + "description": "A zone resource.", + "properties": { + "availableMachineType": { + "type": "array", + "description": "The machine types that can be used in this zone (output only).", + "items": { + "type": "string" + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "Textual description of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#zone" + }, + "maintenanceWindows": { + "type": "array", + "description": "Scheduled maintenance windows for the zone. When the zone is in a maintenance window, all resources which reside in the zone will be unavailable.", + "items": { + "type": "object", + "properties": { + "beginTime": { + "type": "string", + "description": "Begin time of the maintenance window, in RFC 3339 format." + }, + "description": { + "type": "string", + "description": "Textual description of the maintenance window." + }, + "endTime": { + "type": "string", + "description": "End time of the maintenance window, in RFC 3339 format." + }, + "name": { + "type": "string", + "description": "Name of the maintenance window." + } + } + } + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "status": { + "type": "string", + "description": "Status of the zone. \"UP\" or \"DOWN\"." + } + } + }, + "ZoneList": { + "id": "ZoneList", + "type": "object", + "description": "Contains a list of zone resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The zone resources.", + "items": { + "$ref": "Zone" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#zoneList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + } + }, + "resources": { + "disks": { + "methods": { + "delete": { + "id": "compute.disks.delete", + "path": "{project}/disks/{disk}", + "httpMethod": "DELETE", + "description": "Deletes the specified persistent disk resource.", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "disk" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.disks.get", + "path": "{project}/disks/{disk}", + "httpMethod": "GET", + "description": "Returns the specified persistent disk resource.", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "disk" + ], + "response": { + "$ref": "Disk" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.disks.insert", + "path": "{project}/disks", + "httpMethod": "POST", + "description": "Creates a persistent disk resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Disk" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.disks.list", + "path": "{project}/disks", + "httpMethod": "GET", + "description": "Retrieves the list of persistent disk resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "DiskList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "firewalls": { + "methods": { + "delete": { + "id": "compute.firewalls.delete", + "path": "{project}/firewalls/{firewall}", + "httpMethod": "DELETE", + "description": "Deletes the specified firewall resource.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.firewalls.get", + "path": "{project}/firewalls/{firewall}", + "httpMethod": "GET", + "description": "Returns the specified firewall resource.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "response": { + "$ref": "Firewall" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.firewalls.insert", + "path": "{project}/firewalls", + "httpMethod": "POST", + "description": "Creates a firewall resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Firewall" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.firewalls.list", + "path": "{project}/firewalls", + "httpMethod": "GET", + "description": "Retrieves the list of firewall resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "FirewallList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.firewalls.patch", + "path": "{project}/firewalls/{firewall}", + "httpMethod": "PATCH", + "description": "Updates the specified firewall resource with the data included in the request. This method supports patch semantics.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "request": { + "$ref": "Firewall" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "compute.firewalls.update", + "path": "{project}/firewalls/{firewall}", + "httpMethod": "PUT", + "description": "Updates the specified firewall resource with the data included in the request.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "request": { + "$ref": "Firewall" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "images": { + "methods": { + "delete": { + "id": "compute.images.delete", + "path": "{project}/images/{image}", + "httpMethod": "DELETE", + "description": "Deletes the specified image resource.", + "parameters": { + "image": { + "type": "string", + "description": "Name of the image resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "image" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.images.get", + "path": "{project}/images/{image}", + "httpMethod": "GET", + "description": "Returns the specified image resource.", + "parameters": { + "image": { + "type": "string", + "description": "Name of the image resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "image" + ], + "response": { + "$ref": "Image" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.images.insert", + "path": "{project}/images", + "httpMethod": "POST", + "description": "Creates an image resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Image" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/devstorage.read_only" + ] + }, + "list": { + "id": "compute.images.list", + "path": "{project}/images", + "httpMethod": "GET", + "description": "Retrieves the list of image resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "ImageList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "instances": { + "methods": { + "addAccessConfig": { + "id": "compute.instances.addAccessConfig", + "path": "{project}/instances/{instance}/addAccessConfig", + "httpMethod": "POST", + "description": "Adds an access config to an instance's network interface.", + "parameters": { + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "network_interface": { + "type": "string", + "description": "Network interface name.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "instance", + "network_interface" + ], + "request": { + "$ref": "AccessConfig" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "delete": { + "id": "compute.instances.delete", + "path": "{project}/instances/{instance}", + "httpMethod": "DELETE", + "description": "Deletes the specified instance resource.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "instance" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "deleteAccessConfig": { + "id": "compute.instances.deleteAccessConfig", + "path": "{project}/instances/{instance}/deleteAccessConfig", + "httpMethod": "POST", + "description": "Deletes an access config from an instance's network interface.", + "parameters": { + "access_config": { + "type": "string", + "description": "Access config name.", + "required": true, + "location": "query" + }, + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "network_interface": { + "type": "string", + "description": "Network interface name.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "instance", + "access_config", + "network_interface" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.instances.get", + "path": "{project}/instances/{instance}", + "httpMethod": "GET", + "description": "Returns the specified instance resource.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "instance" + ], + "response": { + "$ref": "Instance" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "getSerialPortOutput": { + "id": "compute.instances.getSerialPortOutput", + "path": "{project}/instances/{instance}/serialPort", + "httpMethod": "GET", + "description": "Returns the specified instance's serial port output.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "instance" + ], + "response": { + "$ref": "SerialPortOutput" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.instances.insert", + "path": "{project}/instances", + "httpMethod": "POST", + "description": "Creates an instance resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Instance" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.instances.list", + "path": "{project}/instances", + "httpMethod": "GET", + "description": "Retrieves the list of instance resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "InstanceList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "kernels": { + "methods": { + "get": { + "id": "compute.kernels.get", + "path": "{project}/kernels/{kernel}", + "httpMethod": "GET", + "description": "Returns the specified kernel resource.", + "parameters": { + "kernel": { + "type": "string", + "description": "Name of the kernel resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "kernel" + ], + "response": { + "$ref": "Kernel" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.kernels.list", + "path": "{project}/kernels", + "httpMethod": "GET", + "description": "Retrieves the list of kernel resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "KernelList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "machineTypes": { + "methods": { + "get": { + "id": "compute.machineTypes.get", + "path": "{project}/machineTypes/{machineType}", + "httpMethod": "GET", + "description": "Returns the specified machine type resource.", + "parameters": { + "machineType": { + "type": "string", + "description": "Name of the machine type resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "machineType" + ], + "response": { + "$ref": "MachineType" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.machineTypes.list", + "path": "{project}/machineTypes", + "httpMethod": "GET", + "description": "Retrieves the list of machine type resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "MachineTypeList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "networks": { + "methods": { + "delete": { + "id": "compute.networks.delete", + "path": "{project}/networks/{network}", + "httpMethod": "DELETE", + "description": "Deletes the specified network resource.", + "parameters": { + "network": { + "type": "string", + "description": "Name of the network resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "network" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.networks.get", + "path": "{project}/networks/{network}", + "httpMethod": "GET", + "description": "Returns the specified network resource.", + "parameters": { + "network": { + "type": "string", + "description": "Name of the network resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "network" + ], + "response": { + "$ref": "Network" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.networks.insert", + "path": "{project}/networks", + "httpMethod": "POST", + "description": "Creates a network resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Network" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.networks.list", + "path": "{project}/networks", + "httpMethod": "GET", + "description": "Retrieves the list of network resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "NetworkList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "operations": { + "methods": { + "delete": { + "id": "compute.operations.delete", + "path": "{project}/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "operation" + ], + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.operations.get", + "path": "{project}/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "operation" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.operations.list", + "path": "{project}/operations", + "httpMethod": "GET", + "description": "Retrieves the list of operation resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "OperationList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "projects": { + "methods": { + "get": { + "id": "compute.projects.get", + "path": "{project}", + "httpMethod": "GET", + "description": "Returns the specified project resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project resource to retrieve.", + "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": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "setCommonInstanceMetadata": { + "id": "compute.projects.setCommonInstanceMetadata", + "path": "{project}/setCommonInstanceMetadata", + "httpMethod": "POST", + "description": "Sets metadata common to all instances within the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Metadata" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "snapshots": { + "methods": { + "delete": { + "id": "compute.snapshots.delete", + "path": "{project}/snapshots/{snapshot}", + "httpMethod": "DELETE", + "description": "Deletes the specified persistent disk snapshot resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "snapshot": { + "type": "string", + "description": "Name of the persistent disk snapshot resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "snapshot" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.snapshots.get", + "path": "{project}/snapshots/{snapshot}", + "httpMethod": "GET", + "description": "Returns the specified persistent disk snapshot resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "snapshot": { + "type": "string", + "description": "Name of the persistent disk snapshot resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "snapshot" + ], + "response": { + "$ref": "Snapshot" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.snapshots.insert", + "path": "{project}/snapshots", + "httpMethod": "POST", + "description": "Creates a persistent disk snapshot resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Snapshot" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.snapshots.list", + "path": "{project}/snapshots", + "httpMethod": "GET", + "description": "Retrieves the list of persistent disk snapshot resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "SnapshotList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "zones": { + "methods": { + "get": { + "id": "compute.zones.get", + "path": "{project}/zones/{zone}", + "httpMethod": "GET", + "description": "Returns the specified zone resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "Zone" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.zones.list", + "path": "{project}/zones", + "httpMethod": "GET", + "description": "Retrieves the list of zone resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta13/compute-gen.go b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta13/compute-gen.go new file mode 100644 index 0000000000000..13c16dd790e78 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta13/compute-gen.go @@ -0,0 +1,4553 @@ +// Package compute provides access to the Compute Engine API. +// +// See https://developers.google.com/compute/docs/reference/v1beta13 +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/compute/v1beta13" +// ... +// computeService, err := compute.New(oauthHttpClient) +package compute + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New + +const apiId = "compute:v1beta13" +const apiName = "compute" +const apiVersion = "v1beta13" +const basePath = "https://www.googleapis.com/compute/v1beta13/projects/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Google Compute Engine resources + ComputeScope = "https://www.googleapis.com/auth/compute" + + // View your Google Compute Engine resources + ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly" + + // View your data in Google Cloud Storage + DevstorageRead_onlyScope = "https://www.googleapis.com/auth/devstorage.read_only" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client} + s.Disks = NewDisksService(s) + s.Firewalls = NewFirewallsService(s) + s.Images = NewImagesService(s) + s.Instances = NewInstancesService(s) + s.Kernels = NewKernelsService(s) + s.MachineTypes = NewMachineTypesService(s) + s.Networks = NewNetworksService(s) + s.Operations = NewOperationsService(s) + s.Projects = NewProjectsService(s) + s.Snapshots = NewSnapshotsService(s) + s.Zones = NewZonesService(s) + return s, nil +} + +type Service struct { + client *http.Client + + Disks *DisksService + + Firewalls *FirewallsService + + Images *ImagesService + + Instances *InstancesService + + Kernels *KernelsService + + MachineTypes *MachineTypesService + + Networks *NetworksService + + Operations *OperationsService + + Projects *ProjectsService + + Snapshots *SnapshotsService + + Zones *ZonesService +} + +func NewDisksService(s *Service) *DisksService { + rs := &DisksService{s: s} + return rs +} + +type DisksService struct { + s *Service +} + +func NewFirewallsService(s *Service) *FirewallsService { + rs := &FirewallsService{s: s} + return rs +} + +type FirewallsService struct { + s *Service +} + +func NewImagesService(s *Service) *ImagesService { + rs := &ImagesService{s: s} + return rs +} + +type ImagesService struct { + s *Service +} + +func NewInstancesService(s *Service) *InstancesService { + rs := &InstancesService{s: s} + return rs +} + +type InstancesService struct { + s *Service +} + +func NewKernelsService(s *Service) *KernelsService { + rs := &KernelsService{s: s} + return rs +} + +type KernelsService struct { + s *Service +} + +func NewMachineTypesService(s *Service) *MachineTypesService { + rs := &MachineTypesService{s: s} + return rs +} + +type MachineTypesService struct { + s *Service +} + +func NewNetworksService(s *Service) *NetworksService { + rs := &NetworksService{s: s} + return rs +} + +type NetworksService struct { + s *Service +} + +func NewOperationsService(s *Service) *OperationsService { + rs := &OperationsService{s: s} + return rs +} + +type OperationsService struct { + s *Service +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + return rs +} + +type ProjectsService struct { + s *Service +} + +func NewSnapshotsService(s *Service) *SnapshotsService { + rs := &SnapshotsService{s: s} + return rs +} + +type SnapshotsService struct { + s *Service +} + +func NewZonesService(s *Service) *ZonesService { + rs := &ZonesService{s: s} + return rs +} + +type ZonesService struct { + s *Service +} + +type AccessConfig struct { + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of this access configuration. + Name string `json:"name,omitempty"` + + // NatIP: An external IP address associated with this instance. Specify + // an unused static IP address available to the project. If not + // specified, the external IP will be drawn from a shared ephemeral + // pool. + NatIP string `json:"natIP,omitempty"` + + // Type: Type of configuration. Must be set to "ONE_TO_ONE_NAT". This + // configures port-for-port NAT to the internet. + Type string `json:"type,omitempty"` +} + +type AttachedDisk struct { + // DeleteOnTerminate: Persistent disk only; If true, delete the disk and + // all its data when the associated instance is deleted. This property + // defaults to false if not specified. + DeleteOnTerminate bool `json:"deleteOnTerminate,omitempty"` + + // DeviceName: Persistent disk only; must be unique within the instance + // when specified. This represents a unique device name that is + // reflected into the /dev/ tree of a Linux operating system running + // within the instance. If not specified, a default will be chosen by + // the system. + DeviceName string `json:"deviceName,omitempty"` + + // Index: A zero-based index to assign to this disk, where 0 is reserved + // for the boot disk. If not specified, the server will choose an + // appropriate value. + Index int64 `json:"index,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Mode: The mode in which to attach this disk, either "READ_WRITE" or + // "READ_ONLY". + Mode string `json:"mode,omitempty"` + + // Source: Persistent disk only; the URL of the persistent disk + // resource. + Source string `json:"source,omitempty"` + + // Type: Type of the disk, either "EPHEMERAL" or "PERSISTENT". Note that + // persistent disks must be created before you can specify them here. + Type string `json:"type,omitempty"` +} + +type Disk struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Options: Internal use only. + Options string `json:"options,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SizeGb: Size of the persistent disk, specified in GB. + SizeGb int64 `json:"sizeGb,omitempty,string"` + + // SourceSnapshot: The source snapshot used to create this disk. Once + // the source snapshot has been deleted from the system, this field will + // be cleared, and will not be set even if a snapshot with the same name + // has been re-created. + SourceSnapshot string `json:"sourceSnapshot,omitempty"` + + // SourceSnapshotId: The 'id' value of the snapshot used to create this + // disk. This value may be used to determine whether the disk was + // created from the current or a previous instance of a given disk + // snapshot. + SourceSnapshotId string `json:"sourceSnapshotId,omitempty"` + + // Status: The status of disk creation (output only). + Status string `json:"status,omitempty"` + + // Zone: URL for the zone where the persistent disk resides; provided by + // the client when the disk is created. A persistent disk must reside in + // the same zone as the instance to which it is attached. + Zone string `json:"zone,omitempty"` +} + +type DiskList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The persistent disk resources. + Items []*Disk `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Firewall struct { + // Allowed: The list of rules specified by this firewall. Each rule + // specifies a protocol and port-range tuple that describes a permitted + // connection. + Allowed []*FirewallAllowed `json:"allowed,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Network: URL of the network to which this firewall is applied; + // provided by the client when the firewall is created. + Network string `json:"network,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SourceRanges: A list of IP address blocks expressed in CIDR format + // which this rule applies to. One or both of sourceRanges and + // sourceTags may be set; an inbound connection is allowed if either the + // range or the tag of the source matches. + SourceRanges []string `json:"sourceRanges,omitempty"` + + // SourceTags: A list of instance tags which this rule applies to. One + // or both of sourceRanges and sourceTags may be set; an inbound + // connection is allowed if either the range or the tag of the source + // matches. + SourceTags []string `json:"sourceTags,omitempty"` + + // TargetTags: A list of instance tags indicating sets of instances + // located on network which may make network connections as specified in + // allowed. If no targetTags are specified, the firewall rule applies to + // all instances on the specified network. + TargetTags []string `json:"targetTags,omitempty"` +} + +type FirewallAllowed struct { + // IPProtocol: Required; this is the IP protocol that is allowed for + // this rule. This can either be a well known protocol string (tcp, udp + // or icmp) or the IP protocol number. + IPProtocol string `json:"IPProtocol,omitempty"` + + // Ports: An optional list of ports which are allowed. It is an error to + // specify this for any protocol that isn't UDP or TCP. Each entry must + // be either an integer or a range. If not specified, connections + // through any port are allowed. + // Example inputs include: ["22"], + // ["80,"443"] and ["12345-12349"]. + Ports []string `json:"ports,omitempty"` +} + +type FirewallList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The firewall resources. + Items []*Firewall `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Image struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: Textual description of the resource; provided by the + // client when the resource is created. + Description string `json:"description,omitempty"` + + // DiskSnapshot: Not yet implemented. + DiskSnapshot *ImageDiskSnapshot `json:"diskSnapshot,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // PreferredKernel: An optional URL of the preferred kernel for use with + // this disk image. If not specified, a server defined default kernel + // will be used. + PreferredKernel string `json:"preferredKernel,omitempty"` + + // RawDisk: The raw disk image parameters. + RawDisk *ImageRawDisk `json:"rawDisk,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SourceType: Must be "RAW"; provided by the client when the disk image + // is created. + SourceType string `json:"sourceType,omitempty"` +} + +type ImageDiskSnapshot struct { + // Source: URL of the disk snapshot. + Source string `json:"source,omitempty"` +} + +type ImageRawDisk struct { + // ContainerType: The format used to encode and transmit the block + // device. Should be TAR. This is just a container and transmission + // format and not a runtime format. Provided by the client when the disk + // image is created. + ContainerType string `json:"containerType,omitempty"` + + // Sha1Checksum: An optional SHA1 checksum of the disk image before + // unpackaging; provided by the client when the disk image is created. + Sha1Checksum string `json:"sha1Checksum,omitempty"` + + // Source: The full Google Cloud Storage URL where the disk image is + // stored; provided by the client when the disk image is created. + Source string `json:"source,omitempty"` +} + +type ImageList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The disk image resources. + Items []*Image `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Instance struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Disks: Array of disks associated with this instance. Persistent disks + // must be created before you can assign them. + Disks []*AttachedDisk `json:"disks,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Image: An optional URL of the disk image resource to be to be + // installed on this instance; provided by the client when the instance + // is created. If not specified, the server will choose a default image. + Image string `json:"image,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MachineType: URL of the machine type resource describing which + // machine type to use to host the instance; provided by the client when + // the instance is created. + MachineType string `json:"machineType,omitempty"` + + // Metadata: Metadata key/value pairs assigned to this instance. + // Consists of custom metadata or predefined keys; see Instance + // documentation for more information. + Metadata *Metadata `json:"metadata,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // NetworkInterfaces: Array of configurations for this interface. This + // specifies how this interface is configured to interact with other + // network services, such as connecting to the internet. Currently, + // ONE_TO_ONE_NAT is the only access config supported. If there are no + // accessConfigs specified, then this instance will have no external + // internet access. + NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // ServiceAccounts: A list of service accounts each with specified + // scopes, for which access tokens are to be made available to the + // instance through metadata queries. + ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"` + + // Status: Instance status. One of the following values: "PROVISIONING", + // "STAGING", "RUNNING", "STOPPED", "TERMINATED", and "STOPPING" (output + // only). + Status string `json:"status,omitempty"` + + // StatusMessage: An optional, human-readable explanation of the status + // (output only). + StatusMessage string `json:"statusMessage,omitempty"` + + // Tags: An optional set of tags applied to this instance. Used to + // identify valid sources or targets for network firewalls. Provided by + // the client when the instance is created. Each tag must be 1-63 + // characters long, and comply with RFC1035. + Tags []string `json:"tags,omitempty"` + + // Zone: URL of the zone resource describing where this instance should + // be hosted; provided by the client when the instance is created. + Zone string `json:"zone,omitempty"` +} + +type InstanceList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A list of instance resources. + Items []*Instance `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Kernel struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type KernelList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The kernel resources. + Items []*Kernel `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type MachineType struct { + // AvailableZone: The zones that this machine type can run in. + AvailableZone []string `json:"availableZone,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // EphemeralDisks: List of extended ephemeral disks assigned to the + // instance. + EphemeralDisks []*MachineTypeEphemeralDisks `json:"ephemeralDisks,omitempty"` + + // GuestCpus: Count of CPUs exposed to the instance. + GuestCpus int64 `json:"guestCpus,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // ImageSpaceGb: Space allotted for the image, defined in GB. + ImageSpaceGb int64 `json:"imageSpaceGb,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MaximumPersistentDisks: Maximum persistent disks allowed. + MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"` + + // MaximumPersistentDisksSizeGb: Maximum total persistent disks size + // (GB) allowed. + MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"` + + // MemoryMb: Physical memory assigned to the instance, defined in MB. + MemoryMb int64 `json:"memoryMb,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type MachineTypeEphemeralDisks struct { + // DiskGb: Size of the ephemeral disk, defined in GB. + DiskGb int64 `json:"diskGb,omitempty"` +} + +type MachineTypeList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The machine type resources. + Items []*MachineType `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Metadata struct { + // Items: Array of key/value pairs. The total size of all keys and + // values must be less than 512 KB. + Items []*MetadataItems `json:"items,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` +} + +type MetadataItems struct { + // Key: Key for the metadata entry. Keys must conform to the following + // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is + // reflected as part of a URL in the metadata server. Additionally, to + // avoid ambiguity, keys must not conflict with any other metadata keys + // for the project. + Key string `json:"key,omitempty"` + + // Value: Value for the metadata entry. These are free-form strings, and + // only have meaning as interpreted by the image running in the + // instance. The only restriction placed on values is that their size + // must be less than or equal to 32768 bytes. + Value string `json:"value,omitempty"` +} + +type Network struct { + // IPv4Range: Required; The range of internal addresses that are legal + // on this network. This range is a CIDR specification, for example: + // 192.168.0.0/16. Provided by the client when the network is created. + IPv4Range string `json:"IPv4Range,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // GatewayIPv4: An optional address that is used for default routing to + // other networks. This must be within the range specified by IPv4Range, + // and is typically the first usable address in that range. If not + // specified, the default value is the first usable address in + // IPv4Range. + GatewayIPv4 string `json:"gatewayIPv4,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type NetworkInterface struct { + // AccessConfigs: Array of configurations for this interface. This + // specifies how this interface is configured to interact with other + // network services, such as connecting to the internet. Currently, + // ONE_TO_ONE_NAT is the only access config supported. If there are no + // accessConfigs specified, then this instance will have no external + // internet access. + AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource, determined by the server; for network + // devices, these are e.g. eth0, eth1, etc. (output only). + Name string `json:"name,omitempty"` + + // Network: URL of the network resource attached to this interface. + Network string `json:"network,omitempty"` + + // NetworkIP: An optional IPV4 internal network address to assign to + // this instance. If not specified, one will be assigned from the + // available range. + NetworkIP string `json:"networkIP,omitempty"` +} + +type NetworkList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The network resources. + Items []*Network `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Operation struct { + // ClientOperationId: An optional identifier specified by the client + // when the mutation was initiated. Must be unique for all operation + // resources in the project (output only). + ClientOperationId string `json:"clientOperationId,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // EndTime: The time that this operation was completed. This is in RFC + // 3339 format (output only). + EndTime string `json:"endTime,omitempty"` + + // Error: If errors occurred during processing of this operation, this + // field will be populated (output only). + Error *OperationError `json:"error,omitempty"` + + // HttpErrorMessage: If operation fails, the HTTP error message + // returned, e.g. NOT FOUND. (output only). + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + // HttpErrorStatusCode: If operation fails, the HTTP error status code + // returned, e.g. 404. (output only). + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: The time that this operation was requested. This is in + // RFC 3339 format (output only). + InsertTime string `json:"insertTime,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // OperationType: Type of the operation. Examples include "insert", + // "update", and "delete" (output only). + OperationType string `json:"operationType,omitempty"` + + // Progress: An optional progress indicator that ranges from 0 to 100. + // There is no requirement that this be linear or support any + // granularity of operations. This should not be used to guess at when + // the operation will be complete. This number should be monotonically + // increasing as the operation progresses (output only). + Progress int64 `json:"progress,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // StartTime: The time that this operation was started by the server. + // This is in RFC 3339 format (output only). + StartTime string `json:"startTime,omitempty"` + + // Status: Status of the operation. Can be one of the following: + // "PENDING", "RUNNING", or "DONE" (output only). + Status string `json:"status,omitempty"` + + // StatusMessage: An optional textual description of the current status + // of the operation (output only). + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetId: Unique target id which identifies a particular incarnation + // of the target (output only). + TargetId uint64 `json:"targetId,omitempty,string"` + + // TargetLink: URL of the resource the operation is mutating (output + // only). + TargetLink string `json:"targetLink,omitempty"` + + // User: User who requested the operation, for example + // "user@example.com" (output only). + User string `json:"user,omitempty"` +} + +type OperationError struct { + // Errors: The array of errors encountered while processing this + // operation. + Errors []*OperationErrorErrors `json:"errors,omitempty"` +} + +type OperationErrorErrors struct { + // Code: The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: Indicates the field in the request which caused the error. + // This property is optional. + Location string `json:"location,omitempty"` + + // Message: An optional, human-readable error message. + Message string `json:"message,omitempty"` +} + +type OperationList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The operation resources. + Items []*Operation `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Project struct { + // CommonInstanceMetadata: Metadata key/value pairs available to all + // instances contained in this project. + CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // ExternalIpAddresses: Internet available IP addresses available for + // use in this project. + ExternalIpAddresses []string `json:"externalIpAddresses,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // Quotas: Quotas assigned to this project. + Quotas []*ProjectQuotas `json:"quotas,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type ProjectQuotas struct { + // Limit: Quota limit for this metric. + Limit float64 `json:"limit,omitempty"` + + // Metric: Name of the quota metric. + Metric string `json:"metric,omitempty"` + + // Usage: Current usage of this metric. + Usage float64 `json:"usage,omitempty"` +} + +type SerialPortOutput struct { + // Contents: The contents of the console output. + Contents string `json:"contents,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // SelfLink: Server defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` +} + +type ServiceAccount struct { + // Email: Email address of the service account. + Email string `json:"email,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Scopes: The list of scopes to be made available for this service + // account. + Scopes []string `json:"scopes,omitempty"` +} + +type Snapshot struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // DiskSizeGb: Size of the persistent disk snapshot, specified in GB + // (output only). + DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SourceDisk: The source disk used to create this snapshot. Once the + // source disk has been deleted from the system, this field will be + // cleared, and will not be set even if a disk with the same name has + // been re-created. + SourceDisk string `json:"sourceDisk,omitempty"` + + // SourceDiskId: The 'id' value of the disk used to create this + // snapshot. This value may be used to determine whether the snapshot + // was taken from the current or a previous instance of a given disk + // name. + SourceDiskId string `json:"sourceDiskId,omitempty"` + + // Status: The status of the persistent disk snapshot (output only). + Status string `json:"status,omitempty"` +} + +type SnapshotList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The persistent snapshot resources. + Items []*Snapshot `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Zone struct { + // AvailableMachineType: The machine types that can be used in this zone + // (output only). + AvailableMachineType []string `json:"availableMachineType,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: Textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MaintenanceWindows: Scheduled maintenance windows for the zone. When + // the zone is in a maintenance window, all resources which reside in + // the zone will be unavailable. + MaintenanceWindows []*ZoneMaintenanceWindows `json:"maintenanceWindows,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Status: Status of the zone. "UP" or "DOWN". + Status string `json:"status,omitempty"` +} + +type ZoneMaintenanceWindows struct { + // BeginTime: Begin time of the maintenance window, in RFC 3339 format. + BeginTime string `json:"beginTime,omitempty"` + + // Description: Textual description of the maintenance window. + Description string `json:"description,omitempty"` + + // EndTime: End time of the maintenance window, in RFC 3339 format. + EndTime string `json:"endTime,omitempty"` + + // Name: Name of the maintenance window. + Name string `json:"name,omitempty"` +} + +type ZoneList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The zone resources. + Items []*Zone `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +// method id "compute.disks.delete": + +type DisksDeleteCall struct { + s *Service + project string + disk string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified persistent disk resource. +func (r *DisksService) Delete(project string, disk string) *DisksDeleteCall { + c := &DisksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.disk = disk + return c +} + +func (c *DisksDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/disks/{disk}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{disk}", cleanPathString(c.disk), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified persistent disk resource.", + // "httpMethod": "DELETE", + // "id": "compute.disks.delete", + // "parameterOrder": [ + // "project", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/disks/{disk}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.disks.get": + +type DisksGetCall struct { + s *Service + project string + disk string + opt_ map[string]interface{} +} + +// Get: Returns the specified persistent disk resource. +func (r *DisksService) Get(project string, disk string) *DisksGetCall { + c := &DisksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.disk = disk + return c +} + +func (c *DisksGetCall) Do() (*Disk, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/disks/{disk}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{disk}", cleanPathString(c.disk), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Disk) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified persistent disk resource.", + // "httpMethod": "GET", + // "id": "compute.disks.get", + // "parameterOrder": [ + // "project", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/disks/{disk}", + // "response": { + // "$ref": "Disk" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.disks.insert": + +type DisksInsertCall struct { + s *Service + project string + disk *Disk + opt_ map[string]interface{} +} + +// Insert: Creates a persistent disk resource in the specified project +// using the data included in the request. +func (r *DisksService) Insert(project string, disk *Disk) *DisksInsertCall { + c := &DisksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.disk = disk + return c +} + +func (c *DisksInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/disks") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a persistent disk resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.disks.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/disks", + // "request": { + // "$ref": "Disk" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.disks.list": + +type DisksListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of persistent disk resources contained +// within the specified project. +func (r *DisksService) List(project string) *DisksListCall { + c := &DisksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *DisksListCall) Filter(filter string) *DisksListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *DisksListCall) PageToken(pageToken string) *DisksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *DisksListCall) Do() (*DiskList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/disks") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DiskList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of persistent disk resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.disks.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/disks", + // "response": { + // "$ref": "DiskList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.firewalls.delete": + +type FirewallsDeleteCall struct { + s *Service + project string + firewall string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified firewall resource. +func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall { + c := &FirewallsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + return c +} + +func (c *FirewallsDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/firewalls/{firewall}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{firewall}", cleanPathString(c.firewall), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified firewall resource.", + // "httpMethod": "DELETE", + // "id": "compute.firewalls.delete", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/firewalls/{firewall}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.get": + +type FirewallsGetCall struct { + s *Service + project string + firewall string + opt_ map[string]interface{} +} + +// Get: Returns the specified firewall resource. +func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall { + c := &FirewallsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + return c +} + +func (c *FirewallsGetCall) Do() (*Firewall, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/firewalls/{firewall}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{firewall}", cleanPathString(c.firewall), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Firewall) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified firewall resource.", + // "httpMethod": "GET", + // "id": "compute.firewalls.get", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/firewalls/{firewall}", + // "response": { + // "$ref": "Firewall" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.firewalls.insert": + +type FirewallsInsertCall struct { + s *Service + project string + firewall *Firewall + opt_ map[string]interface{} +} + +// Insert: Creates a firewall resource in the specified project using +// the data included in the request. +func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall { + c := &FirewallsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + return c +} + +func (c *FirewallsInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/firewalls") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a firewall resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.firewalls.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/firewalls", + // "request": { + // "$ref": "Firewall" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.list": + +type FirewallsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of firewall resources available to the +// specified project. +func (r *FirewallsService) List(project string) *FirewallsListCall { + c := &FirewallsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *FirewallsListCall) Do() (*FirewallList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/firewalls") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(FirewallList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of firewall resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.firewalls.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/firewalls", + // "response": { + // "$ref": "FirewallList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.firewalls.patch": + +type FirewallsPatchCall struct { + s *Service + project string + firewall string + firewall2 *Firewall + opt_ map[string]interface{} +} + +// Patch: Updates the specified firewall resource with the data included +// in the request. This method supports patch semantics. +func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall { + c := &FirewallsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + c.firewall2 = firewall2 + return c +} + +func (c *FirewallsPatchCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/firewalls/{firewall}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{firewall}", cleanPathString(c.firewall), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified firewall resource with the data included in the request. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "compute.firewalls.patch", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/firewalls/{firewall}", + // "request": { + // "$ref": "Firewall" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.update": + +type FirewallsUpdateCall struct { + s *Service + project string + firewall string + firewall2 *Firewall + opt_ map[string]interface{} +} + +// Update: Updates the specified firewall resource with the data +// included in the request. +func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall { + c := &FirewallsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + c.firewall2 = firewall2 + return c +} + +func (c *FirewallsUpdateCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/firewalls/{firewall}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{firewall}", cleanPathString(c.firewall), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified firewall resource with the data included in the request.", + // "httpMethod": "PUT", + // "id": "compute.firewalls.update", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/firewalls/{firewall}", + // "request": { + // "$ref": "Firewall" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.delete": + +type ImagesDeleteCall struct { + s *Service + project string + image string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified image resource. +func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall { + c := &ImagesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + return c +} + +func (c *ImagesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/images/{image}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{image}", cleanPathString(c.image), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified image resource.", + // "httpMethod": "DELETE", + // "id": "compute.images.delete", + // "parameterOrder": [ + // "project", + // "image" + // ], + // "parameters": { + // "image": { + // "description": "Name of the image resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/images/{image}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.get": + +type ImagesGetCall struct { + s *Service + project string + image string + opt_ map[string]interface{} +} + +// Get: Returns the specified image resource. +func (r *ImagesService) Get(project string, image string) *ImagesGetCall { + c := &ImagesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + return c +} + +func (c *ImagesGetCall) Do() (*Image, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/images/{image}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{image}", cleanPathString(c.image), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Image) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified image resource.", + // "httpMethod": "GET", + // "id": "compute.images.get", + // "parameterOrder": [ + // "project", + // "image" + // ], + // "parameters": { + // "image": { + // "description": "Name of the image resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/images/{image}", + // "response": { + // "$ref": "Image" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.images.insert": + +type ImagesInsertCall struct { + s *Service + project string + image *Image + opt_ map[string]interface{} +} + +// Insert: Creates an image resource in the specified project using the +// data included in the request. +func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall { + c := &ImagesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + return c +} + +func (c *ImagesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.image) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/images") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an image resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.images.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/images", + // "request": { + // "$ref": "Image" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/devstorage.read_only" + // ] + // } + +} + +// method id "compute.images.list": + +type ImagesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of image resources available to the +// specified project. +func (r *ImagesService) List(project string) *ImagesListCall { + c := &ImagesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ImagesListCall) Filter(filter string) *ImagesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ImagesListCall) Do() (*ImageList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/images") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ImageList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of image resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.images.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/images", + // "response": { + // "$ref": "ImageList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.addAccessConfig": + +type InstancesAddAccessConfigCall struct { + s *Service + project string + instance string + network_interface string + accessconfig *AccessConfig + opt_ map[string]interface{} +} + +// AddAccessConfig: Adds an access config to an instance's network +// interface. +func (r *InstancesService) AddAccessConfig(project string, instance string, network_interface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall { + c := &InstancesAddAccessConfigCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.network_interface = network_interface + c.accessconfig = accessconfig + return c +} + +func (c *InstancesAddAccessConfigCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + params.Set("network_interface", fmt.Sprintf("%v", c.network_interface)) + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/instances/{instance}/addAccessConfig") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{instance}", cleanPathString(c.instance), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds an access config to an instance's network interface.", + // "httpMethod": "POST", + // "id": "compute.instances.addAccessConfig", + // "parameterOrder": [ + // "project", + // "instance", + // "network_interface" + // ], + // "parameters": { + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "network_interface": { + // "description": "Network interface name.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/instances/{instance}/addAccessConfig", + // "request": { + // "$ref": "AccessConfig" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.delete": + +type InstancesDeleteCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified instance resource. +func (r *InstancesService) Delete(project string, instance string) *InstancesDeleteCall { + c := &InstancesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +func (c *InstancesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/instances/{instance}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{instance}", cleanPathString(c.instance), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified instance resource.", + // "httpMethod": "DELETE", + // "id": "compute.instances.delete", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/instances/{instance}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.deleteAccessConfig": + +type InstancesDeleteAccessConfigCall struct { + s *Service + project string + instance string + access_config string + network_interface string + opt_ map[string]interface{} +} + +// DeleteAccessConfig: Deletes an access config from an instance's +// network interface. +func (r *InstancesService) DeleteAccessConfig(project string, instance string, access_config string, network_interface string) *InstancesDeleteAccessConfigCall { + c := &InstancesDeleteAccessConfigCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.access_config = access_config + c.network_interface = network_interface + return c +} + +func (c *InstancesDeleteAccessConfigCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("access_config", fmt.Sprintf("%v", c.access_config)) + params.Set("network_interface", fmt.Sprintf("%v", c.network_interface)) + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/instances/{instance}/deleteAccessConfig") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{instance}", cleanPathString(c.instance), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes an access config from an instance's network interface.", + // "httpMethod": "POST", + // "id": "compute.instances.deleteAccessConfig", + // "parameterOrder": [ + // "project", + // "instance", + // "access_config", + // "network_interface" + // ], + // "parameters": { + // "access_config": { + // "description": "Access config name.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "network_interface": { + // "description": "Network interface name.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/instances/{instance}/deleteAccessConfig", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.get": + +type InstancesGetCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} +} + +// Get: Returns the specified instance resource. +func (r *InstancesService) Get(project string, instance string) *InstancesGetCall { + c := &InstancesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +func (c *InstancesGetCall) Do() (*Instance, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/instances/{instance}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{instance}", cleanPathString(c.instance), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Instance) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified instance resource.", + // "httpMethod": "GET", + // "id": "compute.instances.get", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/instances/{instance}", + // "response": { + // "$ref": "Instance" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.getSerialPortOutput": + +type InstancesGetSerialPortOutputCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} +} + +// GetSerialPortOutput: Returns the specified instance's serial port +// output. +func (r *InstancesService) GetSerialPortOutput(project string, instance string) *InstancesGetSerialPortOutputCall { + c := &InstancesGetSerialPortOutputCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +func (c *InstancesGetSerialPortOutputCall) Do() (*SerialPortOutput, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/instances/{instance}/serialPort") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{instance}", cleanPathString(c.instance), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SerialPortOutput) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified instance's serial port output.", + // "httpMethod": "GET", + // "id": "compute.instances.getSerialPortOutput", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/instances/{instance}/serialPort", + // "response": { + // "$ref": "SerialPortOutput" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.insert": + +type InstancesInsertCall struct { + s *Service + project string + instance *Instance + opt_ map[string]interface{} +} + +// Insert: Creates an instance resource in the specified project using +// the data included in the request. +func (r *InstancesService) Insert(project string, instance *Instance) *InstancesInsertCall { + c := &InstancesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +func (c *InstancesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/instances") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an instance resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.instances.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/instances", + // "request": { + // "$ref": "Instance" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.list": + +type InstancesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of instance resources contained within the +// specified project. +func (r *InstancesService) List(project string) *InstancesListCall { + c := &InstancesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *InstancesListCall) Filter(filter string) *InstancesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *InstancesListCall) Do() (*InstanceList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/instances") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstanceList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of instance resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.instances.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/instances", + // "response": { + // "$ref": "InstanceList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.kernels.get": + +type KernelsGetCall struct { + s *Service + project string + kernel string + opt_ map[string]interface{} +} + +// Get: Returns the specified kernel resource. +func (r *KernelsService) Get(project string, kernel string) *KernelsGetCall { + c := &KernelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.kernel = kernel + return c +} + +func (c *KernelsGetCall) Do() (*Kernel, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/kernels/{kernel}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{kernel}", cleanPathString(c.kernel), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Kernel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified kernel resource.", + // "httpMethod": "GET", + // "id": "compute.kernels.get", + // "parameterOrder": [ + // "project", + // "kernel" + // ], + // "parameters": { + // "kernel": { + // "description": "Name of the kernel resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/kernels/{kernel}", + // "response": { + // "$ref": "Kernel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.kernels.list": + +type KernelsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of kernel resources available to the +// specified project. +func (r *KernelsService) List(project string) *KernelsListCall { + c := &KernelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *KernelsListCall) Filter(filter string) *KernelsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *KernelsListCall) MaxResults(maxResults int64) *KernelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *KernelsListCall) PageToken(pageToken string) *KernelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *KernelsListCall) Do() (*KernelList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/kernels") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(KernelList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of kernel resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.kernels.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/kernels", + // "response": { + // "$ref": "KernelList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.machineTypes.get": + +type MachineTypesGetCall struct { + s *Service + project string + machineType string + opt_ map[string]interface{} +} + +// Get: Returns the specified machine type resource. +func (r *MachineTypesService) Get(project string, machineType string) *MachineTypesGetCall { + c := &MachineTypesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.machineType = machineType + return c +} + +func (c *MachineTypesGetCall) Do() (*MachineType, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/machineTypes/{machineType}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{machineType}", cleanPathString(c.machineType), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(MachineType) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified machine type resource.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.get", + // "parameterOrder": [ + // "project", + // "machineType" + // ], + // "parameters": { + // "machineType": { + // "description": "Name of the machine type resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/machineTypes/{machineType}", + // "response": { + // "$ref": "MachineType" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.machineTypes.list": + +type MachineTypesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of machine type resources available to the +// specified project. +func (r *MachineTypesService) List(project string) *MachineTypesListCall { + c := &MachineTypesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *MachineTypesListCall) Do() (*MachineTypeList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/machineTypes") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(MachineTypeList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of machine type resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/machineTypes", + // "response": { + // "$ref": "MachineTypeList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.networks.delete": + +type NetworksDeleteCall struct { + s *Service + project string + network string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified network resource. +func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall { + c := &NetworksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.network = network + return c +} + +func (c *NetworksDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/networks/{network}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{network}", cleanPathString(c.network), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified network resource.", + // "httpMethod": "DELETE", + // "id": "compute.networks.delete", + // "parameterOrder": [ + // "project", + // "network" + // ], + // "parameters": { + // "network": { + // "description": "Name of the network resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/networks/{network}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.networks.get": + +type NetworksGetCall struct { + s *Service + project string + network string + opt_ map[string]interface{} +} + +// Get: Returns the specified network resource. +func (r *NetworksService) Get(project string, network string) *NetworksGetCall { + c := &NetworksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.network = network + return c +} + +func (c *NetworksGetCall) Do() (*Network, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/networks/{network}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{network}", cleanPathString(c.network), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Network) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified network resource.", + // "httpMethod": "GET", + // "id": "compute.networks.get", + // "parameterOrder": [ + // "project", + // "network" + // ], + // "parameters": { + // "network": { + // "description": "Name of the network resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/networks/{network}", + // "response": { + // "$ref": "Network" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.networks.insert": + +type NetworksInsertCall struct { + s *Service + project string + network *Network + opt_ map[string]interface{} +} + +// Insert: Creates a network resource in the specified project using the +// data included in the request. +func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall { + c := &NetworksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.network = network + return c +} + +func (c *NetworksInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.network) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/networks") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a network resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.networks.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/networks", + // "request": { + // "$ref": "Network" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.networks.list": + +type NetworksListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of network resources available to the +// specified project. +func (r *NetworksService) List(project string) *NetworksListCall { + c := &NetworksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *NetworksListCall) Filter(filter string) *NetworksListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *NetworksListCall) Do() (*NetworkList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/networks") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(NetworkList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of network resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.networks.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/networks", + // "response": { + // "$ref": "NetworkList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.operations.delete": + +type OperationsDeleteCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified operation resource. +func (r *OperationsService) Delete(project string, operation string) *OperationsDeleteCall { + c := &OperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +func (c *OperationsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/operations/{operation}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{operation}", cleanPathString(c.operation), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified operation resource.", + // "httpMethod": "DELETE", + // "id": "compute.operations.delete", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/operations/{operation}", + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.operations.get": + +type OperationsGetCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} +} + +// Get: Retrieves the specified operation resource. +func (r *OperationsService) Get(project string, operation string) *OperationsGetCall { + c := &OperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +func (c *OperationsGetCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/operations/{operation}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{operation}", cleanPathString(c.operation), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified operation resource.", + // "httpMethod": "GET", + // "id": "compute.operations.get", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/operations/{operation}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.operations.list": + +type OperationsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of operation resources contained within the +// specified project. +func (r *OperationsService) List(project string) *OperationsListCall { + c := &OperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *OperationsListCall) Filter(filter string) *OperationsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *OperationsListCall) Do() (*OperationList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/operations") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OperationList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.operations.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/operations", + // "response": { + // "$ref": "OperationList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.projects.get": + +type ProjectsGetCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// Get: Returns the specified project resource. +func (r *ProjectsService) Get(project string) *ProjectsGetCall { + c := &ProjectsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +func (c *ProjectsGetCall) Do() (*Project, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Project) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified project resource.", + // "httpMethod": "GET", + // "id": "compute.projects.get", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project resource to retrieve.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}", + // "response": { + // "$ref": "Project" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.projects.setCommonInstanceMetadata": + +type ProjectsSetCommonInstanceMetadataCall struct { + s *Service + project string + metadata *Metadata + opt_ map[string]interface{} +} + +// SetCommonInstanceMetadata: Sets metadata common to all instances +// within the specified project using the data included in the request. +func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall { + c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.metadata = metadata + return c +} + +func (c *ProjectsSetCommonInstanceMetadataCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/setCommonInstanceMetadata") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets metadata common to all instances within the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.projects.setCommonInstanceMetadata", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/setCommonInstanceMetadata", + // "request": { + // "$ref": "Metadata" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.snapshots.delete": + +type SnapshotsDeleteCall struct { + s *Service + project string + snapshot string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified persistent disk snapshot resource. +func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall { + c := &SnapshotsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.snapshot = snapshot + return c +} + +func (c *SnapshotsDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/snapshots/{snapshot}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{snapshot}", cleanPathString(c.snapshot), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified persistent disk snapshot resource.", + // "httpMethod": "DELETE", + // "id": "compute.snapshots.delete", + // "parameterOrder": [ + // "project", + // "snapshot" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "snapshot": { + // "description": "Name of the persistent disk snapshot resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/snapshots/{snapshot}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.snapshots.get": + +type SnapshotsGetCall struct { + s *Service + project string + snapshot string + opt_ map[string]interface{} +} + +// Get: Returns the specified persistent disk snapshot resource. +func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall { + c := &SnapshotsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.snapshot = snapshot + return c +} + +func (c *SnapshotsGetCall) Do() (*Snapshot, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/snapshots/{snapshot}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{snapshot}", cleanPathString(c.snapshot), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Snapshot) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified persistent disk snapshot resource.", + // "httpMethod": "GET", + // "id": "compute.snapshots.get", + // "parameterOrder": [ + // "project", + // "snapshot" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "snapshot": { + // "description": "Name of the persistent disk snapshot resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/snapshots/{snapshot}", + // "response": { + // "$ref": "Snapshot" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.snapshots.insert": + +type SnapshotsInsertCall struct { + s *Service + project string + snapshot *Snapshot + opt_ map[string]interface{} +} + +// Insert: Creates a persistent disk snapshot resource in the specified +// project using the data included in the request. +func (r *SnapshotsService) Insert(project string, snapshot *Snapshot) *SnapshotsInsertCall { + c := &SnapshotsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.snapshot = snapshot + return c +} + +func (c *SnapshotsInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/snapshots") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a persistent disk snapshot resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.snapshots.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/snapshots", + // "request": { + // "$ref": "Snapshot" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.snapshots.list": + +type SnapshotsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of persistent disk snapshot resources +// contained within the specified project. +func (r *SnapshotsService) List(project string) *SnapshotsListCall { + c := &SnapshotsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *SnapshotsListCall) Do() (*SnapshotList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/snapshots") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SnapshotList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of persistent disk snapshot resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.snapshots.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/snapshots", + // "response": { + // "$ref": "SnapshotList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.zones.get": + +type ZonesGetCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// Get: Returns the specified zone resource. +func (r *ZonesService) Get(project string, zone string) *ZonesGetCall { + c := &ZonesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +func (c *ZonesGetCall) Do() (*Zone, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/zones/{zone}") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls = strings.Replace(urls, "{zone}", cleanPathString(c.zone), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Zone) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified zone resource.", + // "httpMethod": "GET", + // "id": "compute.zones.get", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}", + // "response": { + // "$ref": "Zone" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.zones.list": + +type ZonesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of zone resources available to the specified +// project. +func (r *ZonesService) List(project string) *ZonesListCall { + c := &ZonesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ZonesListCall) Filter(filter string) *ZonesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ZonesListCall) Do() (*ZoneList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta13/projects/", "{project}/zones") + urls = strings.Replace(urls, "{project}", cleanPathString(c.project), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ZoneList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of zone resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.zones.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones", + // "response": { + // "$ref": "ZoneList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +func cleanPathString(s string) string { + return strings.Map(func(r rune) rune { + if r >= 0x2d && r <= 0x7a || r == '~' { + return r + } + return -1 + }, s) +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta14/compute-api.json b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta14/compute-api.json new file mode 100644 index 0000000000000..bb6bfe6f0b559 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta14/compute-api.json @@ -0,0 +1,3696 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"wtgj9ZncHCe-ShJM8RewHb1DgWI/rrS0bXxeuc6ZnqrHW5G1FQX-ifQ\"", + "discoveryVersion": "v1", + "id": "compute:v1beta14", + "name": "compute", + "version": "v1beta14", + "revision": "20130525", + "title": "Compute Engine API", + "description": "API for the Google Compute Engine service.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "http://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://developers.google.com/compute/docs/reference/v1beta14", + "labels": [ + "deprecated" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/compute/v1beta14/projects/", + "basePath": "/compute/v1beta14/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "compute/v1beta14/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/compute": { + "description": "View and manage your Google Compute Engine resources" + }, + "https://www.googleapis.com/auth/compute.readonly": { + "description": "View your Google Compute Engine resources" + }, + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" + } + } + } + }, + "schemas": { + "AccessConfig": { + "id": "AccessConfig", + "type": "object", + "description": "An access configuration attached to an instance's network interface.", + "properties": { + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#accessConfig" + }, + "name": { + "type": "string", + "description": "Name of this access configuration." + }, + "natIP": { + "type": "string", + "description": "An external IP address associated with this instance. Specify an unused static IP address available to the project. If not specified, the external IP will be drawn from a shared ephemeral pool." + }, + "type": { + "type": "string", + "description": "Type of configuration. Must be set to \"ONE_TO_ONE_NAT\". This configures port-for-port NAT to the internet.", + "default": "ONE_TO_ONE_NAT" + } + } + }, + "AttachedDisk": { + "id": "AttachedDisk", + "type": "object", + "description": "An instance-attached disk resource.", + "properties": { + "boot": { + "type": "boolean", + "description": "Indicates that this is a boot disk. VM will use the first partition of the disk for its root filesystem." + }, + "deviceName": { + "type": "string", + "description": "Persistent disk only; must be unique within the instance when specified. This represents a unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. If not specified, a default will be chosen by the system." + }, + "index": { + "type": "integer", + "description": "A zero-based index to assign to this disk, where 0 is reserved for the boot disk. If not specified, the server will choose an appropriate value.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#attachedDisk" + }, + "mode": { + "type": "string", + "description": "The mode in which to attach this disk, either \"READ_WRITE\" or \"READ_ONLY\"." + }, + "source": { + "type": "string", + "description": "Persistent disk only; the URL of the persistent disk resource." + }, + "type": { + "type": "string", + "description": "Type of the disk, either \"EPHEMERAL\" or \"PERSISTENT\". Note that persistent disks must be created before you can specify them here.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + } + } + }, + "DeprecationStatus": { + "id": "DeprecationStatus", + "type": "object", + "description": "Deprecation status for a public resource.", + "properties": { + "deleted": { + "type": "string", + "description": "An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to DELETED." + }, + "deprecated": { + "type": "string", + "description": "An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to DEPRECATED." + }, + "obsolete": { + "type": "string", + "description": "An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to OBSOLETE." + }, + "replacement": { + "type": "string", + "description": "A URL of the suggested replacement for the deprecated resource. The deprecated resource and its replacement must be resources of the same kind." + }, + "state": { + "type": "string", + "description": "The deprecation state. Can be \"DEPRECATED\", \"OBSOLETE\", or \"DELETED\". Operations which create a new resource using a \"DEPRECATED\" resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. New uses of \"OBSOLETE\" or \"DELETED\" resources will result in an error." + } + } + }, + "Disk": { + "id": "Disk", + "type": "object", + "description": "A persistent disk resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#disk" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.disks.insert" + ] + } + }, + "options": { + "type": "string", + "description": "Internal use only." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sizeGb": { + "type": "string", + "description": "Size of the persistent disk, specified in GB. This parameter is optional when creating a disk from a disk image or a snapshot, otherwise it is required.", + "format": "int64" + }, + "sourceSnapshot": { + "type": "string", + "description": "The source snapshot used to create this disk. Once the source snapshot has been deleted from the system, this field will be cleared, and will not be set even if a snapshot with the same name has been re-created." + }, + "sourceSnapshotId": { + "type": "string", + "description": "The 'id' value of the snapshot used to create this disk. This value may be used to determine whether the disk was created from the current or a previous instance of a given disk snapshot." + }, + "status": { + "type": "string", + "description": "The status of disk creation (output only)." + }, + "zone": { + "type": "string", + "description": "URL of the zone where the disk resides (output only)." + } + } + }, + "DiskList": { + "id": "DiskList", + "type": "object", + "description": "Contains a list of persistent disk resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The persistent disk resources.", + "items": { + "$ref": "Disk" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#diskList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Firewall": { + "id": "Firewall", + "type": "object", + "description": "A firewall resource.", + "properties": { + "allowed": { + "type": "array", + "description": "The list of rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection.", + "items": { + "type": "object", + "properties": { + "IPProtocol": { + "type": "string", + "description": "Required; this is the IP protocol that is allowed for this rule. This can either be a well known protocol string (tcp, udp or icmp) or the IP protocol number." + }, + "ports": { + "type": "array", + "description": "An optional list of ports which are allowed. It is an error to specify this for any protocol that isn't UDP or TCP. Each entry must be either an integer or a range. If not specified, connections through any port are allowed.\n\nExample inputs include: [\"22\"], [\"80\",\"443\"] and [\"12345-12349\"].", + "items": { + "type": "string" + } + } + } + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#firewall" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.firewalls.insert", + "compute.firewalls.patch" + ] + } + }, + "network": { + "type": "string", + "description": "URL of the network to which this firewall is applied; provided by the client when the firewall is created.", + "annotations": { + "required": [ + "compute.firewalls.insert", + "compute.firewalls.patch" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sourceRanges": { + "type": "array", + "description": "A list of IP address blocks expressed in CIDR format which this rule applies to. One or both of sourceRanges and sourceTags may be set; an inbound connection is allowed if either the range or the tag of the source matches.", + "items": { + "type": "string" + } + }, + "sourceTags": { + "type": "array", + "description": "A list of instance tags which this rule applies to. One or both of sourceRanges and sourceTags may be set; an inbound connection is allowed if either the range or the tag of the source matches.", + "items": { + "type": "string" + } + }, + "targetTags": { + "type": "array", + "description": "A list of instance tags indicating sets of instances located on network which may make network connections as specified in allowed. If no targetTags are specified, the firewall rule applies to all instances on the specified network.", + "items": { + "type": "string" + } + } + } + }, + "FirewallList": { + "id": "FirewallList", + "type": "object", + "description": "Contains a list of firewall resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The firewall resources.", + "items": { + "$ref": "Firewall" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#firewallList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Image": { + "id": "Image", + "type": "object", + "description": "A disk image resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this image." + }, + "description": { + "type": "string", + "description": "Textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#image" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + }, + "preferredKernel": { + "type": "string", + "description": "An optional URL of the preferred kernel for use with this disk image. If not specified, a server defined default kernel will be used.", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + }, + "rawDisk": { + "type": "object", + "description": "The raw disk image parameters.", + "properties": { + "containerType": { + "type": "string", + "description": "The format used to encode and transmit the block device. Should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created.", + "default": "TAR" + }, + "sha1Checksum": { + "type": "string", + "description": "An optional SHA1 checksum of the disk image before unpackaging; provided by the client when the disk image is created.", + "pattern": "[a-f0-9]{40}" + }, + "source": { + "type": "string", + "description": "The full Google Cloud Storage URL where the disk image is stored; provided by the client when the disk image is created.", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + } + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sourceType": { + "type": "string", + "description": "Must be \"RAW\"; provided by the client when the disk image is created.", + "default": "RAW", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + } + } + }, + "ImageList": { + "id": "ImageList", + "type": "object", + "description": "Contains a list of disk image resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The disk image resources.", + "items": { + "$ref": "Image" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#imageList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Instance": { + "id": "Instance", + "type": "object", + "description": "An instance resource.", + "properties": { + "canIpForward": { + "type": "boolean", + "description": "Allows this instance to send packets with source IP addresses other than its own and receive packets with destination IP addresses other than its own. If this instance will be used as an IP gateway or it will be set as the next-hop in a Route resource, say true. If unsure, leave this set to false." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "disks": { + "type": "array", + "description": "Array of disks associated with this instance. Persistent disks must be created before you can assign them.", + "items": { + "$ref": "AttachedDisk" + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "image": { + "type": "string", + "description": "An optional URL of the disk image resource to be installed on this instance; provided by the client when the instance is created. Alternatively to passing the image, the client may choose to boot from a persistent disk, by setting boot=true flag on one of the entries in disks[] collection." + }, + "kernel": { + "type": "string", + "description": "URL of the kernel resource to use when booting. In case of booting from persistent disk, this parameter is required. When booting from a disk image, it is optional, but may be provided to use a different kernel than the one associated with the image." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#instance" + }, + "machineType": { + "type": "string", + "description": "URL of the machine type resource describing which machine type to use to host the instance; provided by the client when the instance is created.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "metadata": { + "$ref": "Metadata", + "description": "Metadata key/value pairs assigned to this instance. Consists of custom metadata or predefined keys; see Instance documentation for more information." + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "networkInterfaces": { + "type": "array", + "description": "Array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.", + "items": { + "$ref": "NetworkInterface" + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + }, + "serviceAccounts": { + "type": "array", + "description": "A list of service accounts each with specified scopes, for which access tokens are to be made available to the instance through metadata queries.", + "items": { + "$ref": "ServiceAccount" + } + }, + "status": { + "type": "string", + "description": "Instance status. One of the following values: \"PROVISIONING\", \"STAGING\", \"RUNNING\", \"STOPPING\", \"STOPPED\", \"TERMINATED\" (output only)." + }, + "statusMessage": { + "type": "string", + "description": "An optional, human-readable explanation of the status (output only)." + }, + "tags": { + "$ref": "Tags", + "description": "A list of tags to be applied to this instance. Used to identify valid sources or targets for network firewalls. Provided by the client on instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035." + }, + "zone": { + "type": "string", + "description": "URL of the zone where the instance resides (output only)." + } + } + }, + "InstanceList": { + "id": "InstanceList", + "type": "object", + "description": "Contains a list of instance resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "A list of instance resources.", + "items": { + "$ref": "Instance" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#instanceList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Kernel": { + "id": "Kernel", + "type": "object", + "description": "A kernel resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this kernel." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#kernel" + }, + "name": { + "type": "string", + "description": "Name of the resource.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "KernelList": { + "id": "KernelList", + "type": "object", + "description": "Contains a list of kernel resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The kernel resources.", + "items": { + "$ref": "Kernel" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#kernelList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "MachineType": { + "id": "MachineType", + "type": "object", + "description": "A machine type resource.", + "properties": { + "availableZone": { + "type": "array", + "description": "The zones that this machine type can run in.", + "items": { + "type": "string" + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this machine type." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "ephemeralDisks": { + "type": "array", + "description": "List of extended ephemeral disks assigned to the instance.", + "items": { + "type": "object", + "properties": { + "diskGb": { + "type": "integer", + "description": "Size of the ephemeral disk, defined in GB.", + "format": "int32" + } + } + } + }, + "guestCpus": { + "type": "integer", + "description": "Count of CPUs exposed to the instance.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "imageSpaceGb": { + "type": "integer", + "description": "Space allotted for the image, defined in GB.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#machineType" + }, + "maximumPersistentDisks": { + "type": "integer", + "description": "Maximum persistent disks allowed.", + "format": "int32" + }, + "maximumPersistentDisksSizeGb": { + "type": "string", + "description": "Maximum total persistent disks size (GB) allowed.", + "format": "int64" + }, + "memoryMb": { + "type": "integer", + "description": "Physical memory assigned to the instance, defined in MB.", + "format": "int32" + }, + "name": { + "type": "string", + "description": "Name of the resource.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "MachineTypeList": { + "id": "MachineTypeList", + "type": "object", + "description": "Contains a list of machine type resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The machine type resources.", + "items": { + "$ref": "MachineType" + } + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#machineTypeList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "Metadata": { + "id": "Metadata", + "type": "object", + "description": "A metadata key/value entry.", + "properties": { + "fingerprint": { + "type": "string", + "description": "Fingerprint of this resource. A hash of the metadata's contents. This field is used for optimistic locking. An up-to-date metadata fingerprint must be provided in order to modify metadata.", + "format": "byte" + }, + "items": { + "type": "array", + "description": "Array of key/value pairs. The total size of all keys and values must be less than 512 KB.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.", + "pattern": "[a-zA-Z0-9-_]{1,128}", + "annotations": { + "required": [ + "compute.instances.insert", + "compute.projects.setCommonInstanceMetadata" + ] + } + }, + "value": { + "type": "string", + "description": "Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes.", + "annotations": { + "required": [ + "compute.instances.insert", + "compute.projects.setCommonInstanceMetadata" + ] + } + } + } + } + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#metadata" + } + } + }, + "Network": { + "id": "Network", + "type": "object", + "description": "A network resource.", + "properties": { + "IPv4Range": { + "type": "string", + "description": "Required; The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client when the network is created.", + "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}/[0-9]{1,2}", + "annotations": { + "required": [ + "compute.networks.insert" + ] + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "gatewayIPv4": { + "type": "string", + "description": "An optional address that is used for default routing to other networks. This must be within the range specified by IPv4Range, and is typically the first usable address in that range. If not specified, the default value is the first usable address in IPv4Range.", + "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#network" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.networks.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "NetworkInterface": { + "id": "NetworkInterface", + "type": "object", + "description": "A network interface resource attached to an instance.", + "properties": { + "accessConfigs": { + "type": "array", + "description": "Array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.", + "items": { + "$ref": "AccessConfig" + } + }, + "name": { + "type": "string", + "description": "Name of the network interface, determined by the server; for network devices, these are e.g. eth0, eth1, etc. (output only)." + }, + "network": { + "type": "string", + "description": "URL of the network resource attached to this interface.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "networkIP": { + "type": "string", + "description": "An optional IPV4 internal network address to assign to the instance for this network interface. If not specified, one will be assigned from the available range." + } + } + }, + "NetworkList": { + "id": "NetworkList", + "type": "object", + "description": "Contains a list of network resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The network resources.", + "items": { + "$ref": "Network" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#networkList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "An operation resource, used to manage asynchronous API requests.", + "properties": { + "clientOperationId": { + "type": "string", + "description": "An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only)." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "endTime": { + "type": "string", + "description": "The time that this operation was completed. This is in RFC 3339 format (output only)." + }, + "error": { + "type": "object", + "description": "If errors occurred during processing of this operation, this field will be populated (output only).", + "properties": { + "errors": { + "type": "array", + "description": "The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "An optional, human-readable error message." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only)." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "If operation fails, the HTTP error status code returned, e.g. 404. (output only).", + "format": "int32" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "The time that this operation was requested. This is in RFC 3339 format (output only)." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#operation" + }, + "name": { + "type": "string", + "description": "Name of the resource (output only)." + }, + "operationType": { + "type": "string", + "description": "Type of the operation. Examples include \"insert\", \"update\", and \"delete\" (output only)." + }, + "progress": { + "type": "integer", + "description": "An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only).", + "format": "int32" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "startTime": { + "type": "string", + "description": "The time that this operation was started by the server. This is in RFC 3339 format (output only)." + }, + "status": { + "type": "string", + "description": "Status of the operation. Can be one of the following: \"PENDING\", \"RUNNING\", or \"DONE\" (output only)." + }, + "statusMessage": { + "type": "string", + "description": "An optional textual description of the current status of the operation (output only)." + }, + "targetId": { + "type": "string", + "description": "Unique target id which identifies a particular incarnation of the target (output only).", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "URL of the resource the operation is mutating (output only)." + }, + "user": { + "type": "string", + "description": "User who requested the operation, for example \"user@example.com\" (output only)." + }, + "warnings": { + "type": "array", + "description": "If warning messages generated during processing of this operation, this field will be populated (output only).", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning." + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + }, + "zone": { + "type": "string", + "description": "URL of the zone where the operation resides (output only)." + } + } + }, + "OperationList": { + "id": "OperationList", + "type": "object", + "description": "Contains a list of operation resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The operation resources.", + "items": { + "$ref": "Operation" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#operationList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Project": { + "id": "Project", + "type": "object", + "description": "A project resource. Projects can be created only in the APIs Console. Unless marked otherwise, values can only be modified in the console.", + "properties": { + "commonInstanceMetadata": { + "$ref": "Metadata", + "description": "Metadata key/value pairs available to all instances contained in this project." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "externalIpAddresses": { + "type": "array", + "description": "Internet available IP addresses available for use in this project.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#project" + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "quotas": { + "type": "array", + "description": "Quotas assigned to this project.", + "items": { + "$ref": "Quota" + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "Quota": { + "id": "Quota", + "type": "object", + "description": "A quotas entry.", + "properties": { + "limit": { + "type": "number", + "description": "Quota limit for this metric.", + "format": "double" + }, + "metric": { + "type": "string", + "description": "Name of the quota metric." + }, + "usage": { + "type": "number", + "description": "Current usage of this metric.", + "format": "double" + } + } + }, + "Route": { + "id": "Route", + "type": "object", + "description": "The route resource. A Route is a rule that specifies how certain packets should be handled by the virtual network. Routes are associated with VMs by tag and the set of Routes for a particular VM is called its routing table. For each packet leaving a VM, the system searches that VM's routing table for a single best matching Route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the Route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching Routes. The packet is then forwarded as specified by the next_hop field of the winning Route -- either to another VM destination, a VM gateway or a GCE operated gateway. Packets that do not match any Route in the sending VM's routing table will be dropped.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "destRange": { + "type": "string", + "description": "Which packets does this route apply to?", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#route" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "network": { + "type": "string", + "description": "URL of the network to which this route is applied; provided by the client when the route is created.", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "nextHopGateway": { + "type": "string", + "description": "The URL to a gateway that should handle matching packets." + }, + "nextHopInstance": { + "type": "string", + "description": "The URL to an instance that should handle matching packets." + }, + "nextHopIp": { + "type": "string", + "description": "The network IP address of an instance that should handle matching packets." + }, + "nextHopNetwork": { + "type": "string", + "description": "The URL of the local network if it should handle matching packets." + }, + "priority": { + "type": "integer", + "description": "Breaks ties between Routes of equal specificity. Routes with smaller values win when tied with routes with larger values.", + "format": "uint32", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "tags": { + "type": "array", + "description": "A list of instance tags to which this route applies.", + "items": { + "type": "string" + }, + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + } + } + }, + "RouteList": { + "id": "RouteList", + "type": "object", + "description": "Contains a list of route resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The route resources.", + "items": { + "$ref": "Route" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#routeList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "SerialPortOutput": { + "id": "SerialPortOutput", + "type": "object", + "description": "An instance serial console output.", + "properties": { + "contents": { + "type": "string", + "description": "The contents of the console output." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#serialPortOutput" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "ServiceAccount": { + "id": "ServiceAccount", + "type": "object", + "description": "A service account.", + "properties": { + "email": { + "type": "string", + "description": "Email address of the service account." + }, + "scopes": { + "type": "array", + "description": "The list of scopes to be made available for this service account.", + "items": { + "type": "string" + } + } + } + }, + "Snapshot": { + "id": "Snapshot", + "type": "object", + "description": "A persistent disk snapshot resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "diskSizeGb": { + "type": "string", + "description": "Size of the persistent disk snapshot, specified in GB (output only).", + "format": "int64" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#snapshot" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.snapshots.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sourceDisk": { + "type": "string", + "description": "The source disk used to create this snapshot. Once the source disk has been deleted from the system, this field will be cleared, and will not be set even if a disk with the same name has been re-created." + }, + "sourceDiskId": { + "type": "string", + "description": "The 'id' value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name." + }, + "status": { + "type": "string", + "description": "The status of the persistent disk snapshot (output only)." + } + } + }, + "SnapshotList": { + "id": "SnapshotList", + "type": "object", + "description": "Contains a list of persistent disk snapshot resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The persistent snapshot resources.", + "items": { + "$ref": "Snapshot" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#snapshotList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Tags": { + "id": "Tags", + "type": "object", + "description": "A set of instance tags.", + "properties": { + "fingerprint": { + "type": "string", + "description": "Fingerprint of this resource. A hash of the tags stored in this object. This field is used optimistic locking. An up-to-date tags fingerprint must be provided in order to modify tags.", + "format": "byte" + }, + "items": { + "type": "array", + "description": "An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.", + "items": { + "type": "string" + } + } + } + }, + "Zone": { + "id": "Zone", + "type": "object", + "description": "A zone resource.", + "properties": { + "availableMachineType": { + "type": "array", + "description": "The machine types that can be used in this zone (output only).", + "items": { + "type": "string" + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this zone." + }, + "description": { + "type": "string", + "description": "Textual description of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#zone" + }, + "maintenanceWindows": { + "type": "array", + "description": "Scheduled maintenance windows for the zone. When the zone is in a maintenance window, all resources which reside in the zone will be unavailable.", + "items": { + "type": "object", + "properties": { + "beginTime": { + "type": "string", + "description": "Begin time of the maintenance window, in RFC 3339 format." + }, + "description": { + "type": "string", + "description": "Textual description of the maintenance window." + }, + "endTime": { + "type": "string", + "description": "End time of the maintenance window, in RFC 3339 format." + }, + "name": { + "type": "string", + "description": "Name of the maintenance window." + } + } + } + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "quotas": { + "type": "array", + "description": "Quotas assigned to this zone.", + "items": { + "$ref": "Quota" + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "status": { + "type": "string", + "description": "Status of the zone. \"UP\" or \"DOWN\"." + } + } + }, + "ZoneList": { + "id": "ZoneList", + "type": "object", + "description": "Contains a list of zone resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The zone resources.", + "items": { + "$ref": "Zone" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#zoneList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + } + }, + "resources": { + "disks": { + "methods": { + "delete": { + "id": "compute.disks.delete", + "path": "{project}/zones/{zone}/disks/{disk}", + "httpMethod": "DELETE", + "description": "Deletes the specified persistent disk resource.", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "disk" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.disks.get", + "path": "{project}/zones/{zone}/disks/{disk}", + "httpMethod": "GET", + "description": "Returns the specified persistent disk resource.", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "disk" + ], + "response": { + "$ref": "Disk" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.disks.insert", + "path": "{project}/zones/{zone}/disks", + "httpMethod": "POST", + "description": "Creates a persistent disk resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "sourceImage": { + "type": "string", + "description": "Optional. Source image to restore onto a disk.", + "location": "query" + }, + "zone": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "Disk" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.disks.list", + "path": "{project}/zones/{zone}/disks", + "httpMethod": "GET", + "description": "Retrieves the list of persistent disk resources contained within the specified zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "DiskList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "firewalls": { + "methods": { + "delete": { + "id": "compute.firewalls.delete", + "path": "{project}/global/firewalls/{firewall}", + "httpMethod": "DELETE", + "description": "Deletes the specified firewall resource.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.firewalls.get", + "path": "{project}/global/firewalls/{firewall}", + "httpMethod": "GET", + "description": "Returns the specified firewall resource.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "response": { + "$ref": "Firewall" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.firewalls.insert", + "path": "{project}/global/firewalls", + "httpMethod": "POST", + "description": "Creates a firewall resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Firewall" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.firewalls.list", + "path": "{project}/global/firewalls", + "httpMethod": "GET", + "description": "Retrieves the list of firewall resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "FirewallList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.firewalls.patch", + "path": "{project}/global/firewalls/{firewall}", + "httpMethod": "PATCH", + "description": "Updates the specified firewall resource with the data included in the request. This method supports patch semantics.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "request": { + "$ref": "Firewall" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "compute.firewalls.update", + "path": "{project}/global/firewalls/{firewall}", + "httpMethod": "PUT", + "description": "Updates the specified firewall resource with the data included in the request.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "request": { + "$ref": "Firewall" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "globalOperations": { + "methods": { + "delete": { + "id": "compute.globalOperations.delete", + "path": "{project}/global/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "operation" + ], + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.globalOperations.get", + "path": "{project}/global/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "operation" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.globalOperations.list", + "path": "{project}/global/operations", + "httpMethod": "GET", + "description": "Retrieves the list of operation resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "OperationList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "images": { + "methods": { + "delete": { + "id": "compute.images.delete", + "path": "{project}/global/images/{image}", + "httpMethod": "DELETE", + "description": "Deletes the specified image resource.", + "parameters": { + "image": { + "type": "string", + "description": "Name of the image resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "image" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "deprecate": { + "id": "compute.images.deprecate", + "path": "{project}/global/images/{image}/deprecate", + "httpMethod": "POST", + "description": "Sets the deprecation status of an image. If no message body is given, clears the deprecation status instead.", + "parameters": { + "image": { + "type": "string", + "description": "Image name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "image" + ], + "request": { + "$ref": "DeprecationStatus" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.images.get", + "path": "{project}/global/images/{image}", + "httpMethod": "GET", + "description": "Returns the specified image resource.", + "parameters": { + "image": { + "type": "string", + "description": "Name of the image resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "image" + ], + "response": { + "$ref": "Image" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.images.insert", + "path": "{project}/global/images", + "httpMethod": "POST", + "description": "Creates an image resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Image" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "list": { + "id": "compute.images.list", + "path": "{project}/global/images", + "httpMethod": "GET", + "description": "Retrieves the list of image resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "ImageList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "instances": { + "methods": { + "addAccessConfig": { + "id": "compute.instances.addAccessConfig", + "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig", + "httpMethod": "POST", + "description": "Adds an access config to an instance's network interface.", + "parameters": { + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "network_interface": { + "type": "string", + "description": "Network interface name.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance", + "network_interface" + ], + "request": { + "$ref": "AccessConfig" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "attachDisk": { + "id": "compute.instances.attachDisk", + "path": "{project}/zones/{zone}/instances/{instance}/attachDisk", + "httpMethod": "POST", + "description": "Attaches a disk resource to an instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "request": { + "$ref": "AttachedDisk" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "delete": { + "id": "compute.instances.delete", + "path": "{project}/zones/{zone}/instances/{instance}", + "httpMethod": "DELETE", + "description": "Deletes the specified instance resource.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "deleteAccessConfig": { + "id": "compute.instances.deleteAccessConfig", + "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig", + "httpMethod": "POST", + "description": "Deletes an access config from an instance's network interface.", + "parameters": { + "access_config": { + "type": "string", + "description": "Access config name.", + "required": true, + "location": "query" + }, + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "network_interface": { + "type": "string", + "description": "Network interface name.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance", + "access_config", + "network_interface" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "detachDisk": { + "id": "compute.instances.detachDisk", + "path": "{project}/zones/{zone}/instances/{instance}/detachDisk", + "httpMethod": "POST", + "description": "Detaches a disk from an instance.", + "parameters": { + "deviceName": { + "type": "string", + "description": "Disk device name to detach.", + "required": true, + "pattern": "\\w[\\w.-]{0,254}", + "location": "query" + }, + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance", + "deviceName" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.instances.get", + "path": "{project}/zones/{zone}/instances/{instance}", + "httpMethod": "GET", + "description": "Returns the specified instance resource.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "Instance" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "getSerialPortOutput": { + "id": "compute.instances.getSerialPortOutput", + "path": "{project}/zones/{zone}/instances/{instance}/serialPort", + "httpMethod": "GET", + "description": "Returns the specified instance's serial port output.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "SerialPortOutput" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.instances.insert", + "path": "{project}/zones/{zone}/instances", + "httpMethod": "POST", + "description": "Creates an instance resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "Instance" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.instances.list", + "path": "{project}/zones/{zone}/instances", + "httpMethod": "GET", + "description": "Retrieves the list of instance resources contained within the specified zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "InstanceList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "reset": { + "id": "compute.instances.reset", + "path": "{project}/zones/{zone}/instances/{instance}/reset", + "httpMethod": "POST", + "description": "Performs a hard reset on the instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "setMetadata": { + "id": "compute.instances.setMetadata", + "path": "{project}/zones/{zone}/instances/{instance}/setMetadata", + "httpMethod": "POST", + "description": "Sets metadata for the specified instance to the data included in the request.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "request": { + "$ref": "Metadata" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "setTags": { + "id": "compute.instances.setTags", + "path": "{project}/zones/{zone}/instances/{instance}/setTags", + "httpMethod": "POST", + "description": "Sets tags for the specified instance to the data included in the request.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "request": { + "$ref": "Tags" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "kernels": { + "methods": { + "get": { + "id": "compute.kernels.get", + "path": "{project}/global/kernels/{kernel}", + "httpMethod": "GET", + "description": "Returns the specified kernel resource.", + "parameters": { + "kernel": { + "type": "string", + "description": "Name of the kernel resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "kernel" + ], + "response": { + "$ref": "Kernel" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.kernels.list", + "path": "{project}/global/kernels", + "httpMethod": "GET", + "description": "Retrieves the list of kernel resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "KernelList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "machineTypes": { + "methods": { + "get": { + "id": "compute.machineTypes.get", + "path": "{project}/global/machineTypes/{machineType}", + "httpMethod": "GET", + "description": "Returns the specified machine type resource.", + "parameters": { + "machineType": { + "type": "string", + "description": "Name of the machine type resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "machineType" + ], + "response": { + "$ref": "MachineType" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.machineTypes.list", + "path": "{project}/global/machineTypes", + "httpMethod": "GET", + "description": "Retrieves the list of machine type resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "MachineTypeList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "networks": { + "methods": { + "delete": { + "id": "compute.networks.delete", + "path": "{project}/global/networks/{network}", + "httpMethod": "DELETE", + "description": "Deletes the specified network resource.", + "parameters": { + "network": { + "type": "string", + "description": "Name of the network resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "network" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.networks.get", + "path": "{project}/global/networks/{network}", + "httpMethod": "GET", + "description": "Returns the specified network resource.", + "parameters": { + "network": { + "type": "string", + "description": "Name of the network resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "network" + ], + "response": { + "$ref": "Network" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.networks.insert", + "path": "{project}/global/networks", + "httpMethod": "POST", + "description": "Creates a network resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Network" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.networks.list", + "path": "{project}/global/networks", + "httpMethod": "GET", + "description": "Retrieves the list of network resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "NetworkList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "projects": { + "methods": { + "get": { + "id": "compute.projects.get", + "path": "{project}", + "httpMethod": "GET", + "description": "Returns the specified project resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project resource to retrieve.", + "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": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "setCommonInstanceMetadata": { + "id": "compute.projects.setCommonInstanceMetadata", + "path": "{project}/setCommonInstanceMetadata", + "httpMethod": "POST", + "description": "Sets metadata common to all instances within the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Metadata" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "routes": { + "methods": { + "delete": { + "id": "compute.routes.delete", + "path": "{project}/global/routes/{route}", + "httpMethod": "DELETE", + "description": "Deletes the specified route resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "route": { + "type": "string", + "description": "Name of the route resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "route" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.routes.get", + "path": "{project}/global/routes/{route}", + "httpMethod": "GET", + "description": "Returns the specified route resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "route": { + "type": "string", + "description": "Name of the route resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "route" + ], + "response": { + "$ref": "Route" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.routes.insert", + "path": "{project}/global/routes", + "httpMethod": "POST", + "description": "Creates a route resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Route" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.routes.list", + "path": "{project}/global/routes", + "httpMethod": "GET", + "description": "Retrieves the list of route resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "RouteList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "snapshots": { + "methods": { + "delete": { + "id": "compute.snapshots.delete", + "path": "{project}/global/snapshots/{snapshot}", + "httpMethod": "DELETE", + "description": "Deletes the specified persistent disk snapshot resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "snapshot": { + "type": "string", + "description": "Name of the persistent disk snapshot resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "snapshot" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.snapshots.get", + "path": "{project}/global/snapshots/{snapshot}", + "httpMethod": "GET", + "description": "Returns the specified persistent disk snapshot resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "snapshot": { + "type": "string", + "description": "Name of the persistent disk snapshot resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "snapshot" + ], + "response": { + "$ref": "Snapshot" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.snapshots.insert", + "path": "{project}/global/snapshots", + "httpMethod": "POST", + "description": "Creates a persistent disk snapshot resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Snapshot" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.snapshots.list", + "path": "{project}/global/snapshots", + "httpMethod": "GET", + "description": "Retrieves the list of persistent disk snapshot resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "SnapshotList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "zoneOperations": { + "methods": { + "delete": { + "id": "compute.zoneOperations.delete", + "path": "{project}/zones/{zone}/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified zone-specific operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "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": "compute.zoneOperations.get", + "path": "{project}/zones/{zone}/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified zone-specific operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "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": "compute.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", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "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": { + "get": { + "id": "compute.zones.get", + "path": "{project}/zones/{zone}", + "httpMethod": "GET", + "description": "Returns the specified zone resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "Zone" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.zones.list", + "path": "{project}/zones", + "httpMethod": "GET", + "description": "Retrieves the list of zone resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta14/compute-gen.go b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta14/compute-gen.go new file mode 100644 index 0000000000000..1ed11e155ce26 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta14/compute-gen.go @@ -0,0 +1,6161 @@ +// Package compute provides access to the Compute Engine API. +// +// See https://developers.google.com/compute/docs/reference/v1beta14 +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/compute/v1beta14" +// ... +// computeService, err := compute.New(oauthHttpClient) +package compute + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "compute:v1beta14" +const apiName = "compute" +const apiVersion = "v1beta14" +const basePath = "https://www.googleapis.com/compute/v1beta14/projects/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Google Compute Engine resources + ComputeScope = "https://www.googleapis.com/auth/compute" + + // View your Google Compute Engine resources + ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly" + + // View your data in Google Cloud Storage + DevstorageRead_onlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageRead_writeScope = "https://www.googleapis.com/auth/devstorage.read_write" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client} + s.Disks = NewDisksService(s) + s.Firewalls = NewFirewallsService(s) + s.GlobalOperations = NewGlobalOperationsService(s) + s.Images = NewImagesService(s) + s.Instances = NewInstancesService(s) + s.Kernels = NewKernelsService(s) + s.MachineTypes = NewMachineTypesService(s) + s.Networks = NewNetworksService(s) + s.Projects = NewProjectsService(s) + s.Routes = NewRoutesService(s) + s.Snapshots = NewSnapshotsService(s) + s.ZoneOperations = NewZoneOperationsService(s) + s.Zones = NewZonesService(s) + return s, nil +} + +type Service struct { + client *http.Client + + Disks *DisksService + + Firewalls *FirewallsService + + GlobalOperations *GlobalOperationsService + + Images *ImagesService + + Instances *InstancesService + + Kernels *KernelsService + + MachineTypes *MachineTypesService + + Networks *NetworksService + + Projects *ProjectsService + + Routes *RoutesService + + Snapshots *SnapshotsService + + ZoneOperations *ZoneOperationsService + + Zones *ZonesService +} + +func NewDisksService(s *Service) *DisksService { + rs := &DisksService{s: s} + return rs +} + +type DisksService struct { + s *Service +} + +func NewFirewallsService(s *Service) *FirewallsService { + rs := &FirewallsService{s: s} + return rs +} + +type FirewallsService struct { + s *Service +} + +func NewGlobalOperationsService(s *Service) *GlobalOperationsService { + rs := &GlobalOperationsService{s: s} + return rs +} + +type GlobalOperationsService struct { + s *Service +} + +func NewImagesService(s *Service) *ImagesService { + rs := &ImagesService{s: s} + return rs +} + +type ImagesService struct { + s *Service +} + +func NewInstancesService(s *Service) *InstancesService { + rs := &InstancesService{s: s} + return rs +} + +type InstancesService struct { + s *Service +} + +func NewKernelsService(s *Service) *KernelsService { + rs := &KernelsService{s: s} + return rs +} + +type KernelsService struct { + s *Service +} + +func NewMachineTypesService(s *Service) *MachineTypesService { + rs := &MachineTypesService{s: s} + return rs +} + +type MachineTypesService struct { + s *Service +} + +func NewNetworksService(s *Service) *NetworksService { + rs := &NetworksService{s: s} + return rs +} + +type NetworksService struct { + s *Service +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + return rs +} + +type ProjectsService struct { + s *Service +} + +func NewRoutesService(s *Service) *RoutesService { + rs := &RoutesService{s: s} + return rs +} + +type RoutesService struct { + s *Service +} + +func NewSnapshotsService(s *Service) *SnapshotsService { + rs := &SnapshotsService{s: s} + return rs +} + +type SnapshotsService struct { + s *Service +} + +func NewZoneOperationsService(s *Service) *ZoneOperationsService { + rs := &ZoneOperationsService{s: s} + return rs +} + +type ZoneOperationsService struct { + s *Service +} + +func NewZonesService(s *Service) *ZonesService { + rs := &ZonesService{s: s} + return rs +} + +type ZonesService struct { + s *Service +} + +type AccessConfig struct { + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of this access configuration. + Name string `json:"name,omitempty"` + + // NatIP: An external IP address associated with this instance. Specify + // an unused static IP address available to the project. If not + // specified, the external IP will be drawn from a shared ephemeral + // pool. + NatIP string `json:"natIP,omitempty"` + + // Type: Type of configuration. Must be set to "ONE_TO_ONE_NAT". This + // configures port-for-port NAT to the internet. + Type string `json:"type,omitempty"` +} + +type AttachedDisk struct { + // Boot: Indicates that this is a boot disk. VM will use the first + // partition of the disk for its root filesystem. + Boot bool `json:"boot,omitempty"` + + // DeviceName: Persistent disk only; must be unique within the instance + // when specified. This represents a unique device name that is + // reflected into the /dev/ tree of a Linux operating system running + // within the instance. If not specified, a default will be chosen by + // the system. + DeviceName string `json:"deviceName,omitempty"` + + // Index: A zero-based index to assign to this disk, where 0 is reserved + // for the boot disk. If not specified, the server will choose an + // appropriate value. + Index int64 `json:"index,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Mode: The mode in which to attach this disk, either "READ_WRITE" or + // "READ_ONLY". + Mode string `json:"mode,omitempty"` + + // Source: Persistent disk only; the URL of the persistent disk + // resource. + Source string `json:"source,omitempty"` + + // Type: Type of the disk, either "EPHEMERAL" or "PERSISTENT". Note that + // persistent disks must be created before you can specify them here. + Type string `json:"type,omitempty"` +} + +type DeprecationStatus struct { + // Deleted: An optional RFC3339 timestamp on or after which the + // deprecation state of this resource will be changed to DELETED. + Deleted string `json:"deleted,omitempty"` + + // Deprecated: An optional RFC3339 timestamp on or after which the + // deprecation state of this resource will be changed to DEPRECATED. + Deprecated string `json:"deprecated,omitempty"` + + // Obsolete: An optional RFC3339 timestamp on or after which the + // deprecation state of this resource will be changed to OBSOLETE. + Obsolete string `json:"obsolete,omitempty"` + + // Replacement: A URL of the suggested replacement for the deprecated + // resource. The deprecated resource and its replacement must be + // resources of the same kind. + Replacement string `json:"replacement,omitempty"` + + // State: The deprecation state. Can be "DEPRECATED", "OBSOLETE", or + // "DELETED". Operations which create a new resource using a + // "DEPRECATED" resource will return successfully, but with a warning + // indicating the deprecated resource and recommending its replacement. + // New uses of "OBSOLETE" or "DELETED" resources will result in an + // error. + State string `json:"state,omitempty"` +} + +type Disk struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Options: Internal use only. + Options string `json:"options,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SizeGb: Size of the persistent disk, specified in GB. This parameter + // is optional when creating a disk from a disk image or a snapshot, + // otherwise it is required. + SizeGb int64 `json:"sizeGb,omitempty,string"` + + // SourceSnapshot: The source snapshot used to create this disk. Once + // the source snapshot has been deleted from the system, this field will + // be cleared, and will not be set even if a snapshot with the same name + // has been re-created. + SourceSnapshot string `json:"sourceSnapshot,omitempty"` + + // SourceSnapshotId: The 'id' value of the snapshot used to create this + // disk. This value may be used to determine whether the disk was + // created from the current or a previous instance of a given disk + // snapshot. + SourceSnapshotId string `json:"sourceSnapshotId,omitempty"` + + // Status: The status of disk creation (output only). + Status string `json:"status,omitempty"` + + // Zone: URL of the zone where the disk resides (output only). + Zone string `json:"zone,omitempty"` +} + +type DiskList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The persistent disk resources. + Items []*Disk `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Firewall struct { + // Allowed: The list of rules specified by this firewall. Each rule + // specifies a protocol and port-range tuple that describes a permitted + // connection. + Allowed []*FirewallAllowed `json:"allowed,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Network: URL of the network to which this firewall is applied; + // provided by the client when the firewall is created. + Network string `json:"network,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SourceRanges: A list of IP address blocks expressed in CIDR format + // which this rule applies to. One or both of sourceRanges and + // sourceTags may be set; an inbound connection is allowed if either the + // range or the tag of the source matches. + SourceRanges []string `json:"sourceRanges,omitempty"` + + // SourceTags: A list of instance tags which this rule applies to. One + // or both of sourceRanges and sourceTags may be set; an inbound + // connection is allowed if either the range or the tag of the source + // matches. + SourceTags []string `json:"sourceTags,omitempty"` + + // TargetTags: A list of instance tags indicating sets of instances + // located on network which may make network connections as specified in + // allowed. If no targetTags are specified, the firewall rule applies to + // all instances on the specified network. + TargetTags []string `json:"targetTags,omitempty"` +} + +type FirewallAllowed struct { + // IPProtocol: Required; this is the IP protocol that is allowed for + // this rule. This can either be a well known protocol string (tcp, udp + // or icmp) or the IP protocol number. + IPProtocol string `json:"IPProtocol,omitempty"` + + // Ports: An optional list of ports which are allowed. It is an error to + // specify this for any protocol that isn't UDP or TCP. Each entry must + // be either an integer or a range. If not specified, connections + // through any port are allowed. + // + // Example inputs include: ["22"], + // ["80","443"] and ["12345-12349"]. + Ports []string `json:"ports,omitempty"` +} + +type FirewallList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The firewall resources. + Items []*Firewall `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Image struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this image. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: Textual description of the resource; provided by the + // client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // PreferredKernel: An optional URL of the preferred kernel for use with + // this disk image. If not specified, a server defined default kernel + // will be used. + PreferredKernel string `json:"preferredKernel,omitempty"` + + // RawDisk: The raw disk image parameters. + RawDisk *ImageRawDisk `json:"rawDisk,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SourceType: Must be "RAW"; provided by the client when the disk image + // is created. + SourceType string `json:"sourceType,omitempty"` +} + +type ImageRawDisk struct { + // ContainerType: The format used to encode and transmit the block + // device. Should be TAR. This is just a container and transmission + // format and not a runtime format. Provided by the client when the disk + // image is created. + ContainerType string `json:"containerType,omitempty"` + + // Sha1Checksum: An optional SHA1 checksum of the disk image before + // unpackaging; provided by the client when the disk image is created. + Sha1Checksum string `json:"sha1Checksum,omitempty"` + + // Source: The full Google Cloud Storage URL where the disk image is + // stored; provided by the client when the disk image is created. + Source string `json:"source,omitempty"` +} + +type ImageList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The disk image resources. + Items []*Image `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Instance struct { + // CanIpForward: Allows this instance to send packets with source IP + // addresses other than its own and receive packets with destination IP + // addresses other than its own. If this instance will be used as an IP + // gateway or it will be set as the next-hop in a Route resource, say + // true. If unsure, leave this set to false. + CanIpForward bool `json:"canIpForward,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Disks: Array of disks associated with this instance. Persistent disks + // must be created before you can assign them. + Disks []*AttachedDisk `json:"disks,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Image: An optional URL of the disk image resource to be installed on + // this instance; provided by the client when the instance is created. + // Alternatively to passing the image, the client may choose to boot + // from a persistent disk, by setting boot=true flag on one of the + // entries in disks[] collection. + Image string `json:"image,omitempty"` + + // Kernel: URL of the kernel resource to use when booting. In case of + // booting from persistent disk, this parameter is required. When + // booting from a disk image, it is optional, but may be provided to use + // a different kernel than the one associated with the image. + Kernel string `json:"kernel,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MachineType: URL of the machine type resource describing which + // machine type to use to host the instance; provided by the client when + // the instance is created. + MachineType string `json:"machineType,omitempty"` + + // Metadata: Metadata key/value pairs assigned to this instance. + // Consists of custom metadata or predefined keys; see Instance + // documentation for more information. + Metadata *Metadata `json:"metadata,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // NetworkInterfaces: Array of configurations for this interface. This + // specifies how this interface is configured to interact with other + // network services, such as connecting to the internet. Currently, + // ONE_TO_ONE_NAT is the only access config supported. If there are no + // accessConfigs specified, then this instance will have no external + // internet access. + NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // ServiceAccounts: A list of service accounts each with specified + // scopes, for which access tokens are to be made available to the + // instance through metadata queries. + ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"` + + // Status: Instance status. One of the following values: "PROVISIONING", + // "STAGING", "RUNNING", "STOPPING", "STOPPED", "TERMINATED" (output + // only). + Status string `json:"status,omitempty"` + + // StatusMessage: An optional, human-readable explanation of the status + // (output only). + StatusMessage string `json:"statusMessage,omitempty"` + + // Tags: A list of tags to be applied to this instance. Used to identify + // valid sources or targets for network firewalls. Provided by the + // client on instance creation. The tags can be later modified by the + // setTags method. Each tag within the list must comply with RFC1035. + Tags *Tags `json:"tags,omitempty"` + + // Zone: URL of the zone where the instance resides (output only). + Zone string `json:"zone,omitempty"` +} + +type InstanceList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A list of instance resources. + Items []*Instance `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Kernel struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this kernel. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type KernelList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The kernel resources. + Items []*Kernel `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type MachineType struct { + // AvailableZone: The zones that this machine type can run in. + AvailableZone []string `json:"availableZone,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this machine type. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // EphemeralDisks: List of extended ephemeral disks assigned to the + // instance. + EphemeralDisks []*MachineTypeEphemeralDisks `json:"ephemeralDisks,omitempty"` + + // GuestCpus: Count of CPUs exposed to the instance. + GuestCpus int64 `json:"guestCpus,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // ImageSpaceGb: Space allotted for the image, defined in GB. + ImageSpaceGb int64 `json:"imageSpaceGb,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MaximumPersistentDisks: Maximum persistent disks allowed. + MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"` + + // MaximumPersistentDisksSizeGb: Maximum total persistent disks size + // (GB) allowed. + MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"` + + // MemoryMb: Physical memory assigned to the instance, defined in MB. + MemoryMb int64 `json:"memoryMb,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type MachineTypeEphemeralDisks struct { + // DiskGb: Size of the ephemeral disk, defined in GB. + DiskGb int64 `json:"diskGb,omitempty"` +} + +type MachineTypeList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The machine type resources. + Items []*MachineType `json:"items,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Metadata struct { + // Fingerprint: Fingerprint of this resource. A hash of the metadata's + // contents. This field is used for optimistic locking. An up-to-date + // metadata fingerprint must be provided in order to modify metadata. + Fingerprint string `json:"fingerprint,omitempty"` + + // Items: Array of key/value pairs. The total size of all keys and + // values must be less than 512 KB. + Items []*MetadataItems `json:"items,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` +} + +type MetadataItems struct { + // Key: Key for the metadata entry. Keys must conform to the following + // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is + // reflected as part of a URL in the metadata server. Additionally, to + // avoid ambiguity, keys must not conflict with any other metadata keys + // for the project. + Key string `json:"key,omitempty"` + + // Value: Value for the metadata entry. These are free-form strings, and + // only have meaning as interpreted by the image running in the + // instance. The only restriction placed on values is that their size + // must be less than or equal to 32768 bytes. + Value string `json:"value,omitempty"` +} + +type Network struct { + // IPv4Range: Required; The range of internal addresses that are legal + // on this network. This range is a CIDR specification, for example: + // 192.168.0.0/16. Provided by the client when the network is created. + IPv4Range string `json:"IPv4Range,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // GatewayIPv4: An optional address that is used for default routing to + // other networks. This must be within the range specified by IPv4Range, + // and is typically the first usable address in that range. If not + // specified, the default value is the first usable address in + // IPv4Range. + GatewayIPv4 string `json:"gatewayIPv4,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type NetworkInterface struct { + // AccessConfigs: Array of configurations for this interface. This + // specifies how this interface is configured to interact with other + // network services, such as connecting to the internet. Currently, + // ONE_TO_ONE_NAT is the only access config supported. If there are no + // accessConfigs specified, then this instance will have no external + // internet access. + AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"` + + // Name: Name of the network interface, determined by the server; for + // network devices, these are e.g. eth0, eth1, etc. (output only). + Name string `json:"name,omitempty"` + + // Network: URL of the network resource attached to this interface. + Network string `json:"network,omitempty"` + + // NetworkIP: An optional IPV4 internal network address to assign to the + // instance for this network interface. If not specified, one will be + // assigned from the available range. + NetworkIP string `json:"networkIP,omitempty"` +} + +type NetworkList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The network resources. + Items []*Network `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Operation struct { + // ClientOperationId: An optional identifier specified by the client + // when the mutation was initiated. Must be unique for all operation + // resources in the project (output only). + ClientOperationId string `json:"clientOperationId,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // EndTime: The time that this operation was completed. This is in RFC + // 3339 format (output only). + EndTime string `json:"endTime,omitempty"` + + // Error: If errors occurred during processing of this operation, this + // field will be populated (output only). + Error *OperationError `json:"error,omitempty"` + + // HttpErrorMessage: If operation fails, the HTTP error message + // returned, e.g. NOT FOUND. (output only). + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + // HttpErrorStatusCode: If operation fails, the HTTP error status code + // returned, e.g. 404. (output only). + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: The time that this operation was requested. This is in + // RFC 3339 format (output only). + InsertTime string `json:"insertTime,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource (output only). + Name string `json:"name,omitempty"` + + // OperationType: Type of the operation. Examples include "insert", + // "update", and "delete" (output only). + OperationType string `json:"operationType,omitempty"` + + // Progress: An optional progress indicator that ranges from 0 to 100. + // There is no requirement that this be linear or support any + // granularity of operations. This should not be used to guess at when + // the operation will be complete. This number should be monotonically + // increasing as the operation progresses (output only). + Progress int64 `json:"progress,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // StartTime: The time that this operation was started by the server. + // This is in RFC 3339 format (output only). + StartTime string `json:"startTime,omitempty"` + + // Status: Status of the operation. Can be one of the following: + // "PENDING", "RUNNING", or "DONE" (output only). + Status string `json:"status,omitempty"` + + // StatusMessage: An optional textual description of the current status + // of the operation (output only). + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetId: Unique target id which identifies a particular incarnation + // of the target (output only). + TargetId uint64 `json:"targetId,omitempty,string"` + + // TargetLink: URL of the resource the operation is mutating (output + // only). + TargetLink string `json:"targetLink,omitempty"` + + // User: User who requested the operation, for example + // "user@example.com" (output only). + User string `json:"user,omitempty"` + + // Warnings: If warning messages generated during processing of this + // operation, this field will be populated (output only). + Warnings []*OperationWarnings `json:"warnings,omitempty"` + + // Zone: URL of the zone where the operation resides (output only). + Zone string `json:"zone,omitempty"` +} + +type OperationError struct { + // Errors: The array of errors encountered while processing this + // operation. + Errors []*OperationErrorErrors `json:"errors,omitempty"` +} + +type OperationErrorErrors struct { + // Code: The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: Indicates the field in the request which caused the error. + // This property is optional. + Location string `json:"location,omitempty"` + + // Message: An optional, human-readable error message. + Message string `json:"message,omitempty"` +} + +type OperationWarnings struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*OperationWarningsData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type OperationWarningsData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type OperationList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The operation resources. + Items []*Operation `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Project struct { + // CommonInstanceMetadata: Metadata key/value pairs available to all + // instances contained in this project. + CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // ExternalIpAddresses: Internet available IP addresses available for + // use in this project. + ExternalIpAddresses []string `json:"externalIpAddresses,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // Quotas: Quotas assigned to this project. + Quotas []*Quota `json:"quotas,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Quota struct { + // Limit: Quota limit for this metric. + Limit float64 `json:"limit,omitempty"` + + // Metric: Name of the quota metric. + Metric string `json:"metric,omitempty"` + + // Usage: Current usage of this metric. + Usage float64 `json:"usage,omitempty"` +} + +type Route struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // DestRange: Which packets does this route apply to? + DestRange string `json:"destRange,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Network: URL of the network to which this route is applied; provided + // by the client when the route is created. + Network string `json:"network,omitempty"` + + // NextHopGateway: The URL to a gateway that should handle matching + // packets. + NextHopGateway string `json:"nextHopGateway,omitempty"` + + // NextHopInstance: The URL to an instance that should handle matching + // packets. + NextHopInstance string `json:"nextHopInstance,omitempty"` + + // NextHopIp: The network IP address of an instance that should handle + // matching packets. + NextHopIp string `json:"nextHopIp,omitempty"` + + // NextHopNetwork: The URL of the local network if it should handle + // matching packets. + NextHopNetwork string `json:"nextHopNetwork,omitempty"` + + // Priority: Breaks ties between Routes of equal specificity. Routes + // with smaller values win when tied with routes with larger values. + Priority int64 `json:"priority,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Tags: A list of instance tags to which this route applies. + Tags []string `json:"tags,omitempty"` +} + +type RouteList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The route resources. + Items []*Route `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type SerialPortOutput struct { + // Contents: The contents of the console output. + Contents string `json:"contents,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type ServiceAccount struct { + // Email: Email address of the service account. + Email string `json:"email,omitempty"` + + // Scopes: The list of scopes to be made available for this service + // account. + Scopes []string `json:"scopes,omitempty"` +} + +type Snapshot struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // DiskSizeGb: Size of the persistent disk snapshot, specified in GB + // (output only). + DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SourceDisk: The source disk used to create this snapshot. Once the + // source disk has been deleted from the system, this field will be + // cleared, and will not be set even if a disk with the same name has + // been re-created. + SourceDisk string `json:"sourceDisk,omitempty"` + + // SourceDiskId: The 'id' value of the disk used to create this + // snapshot. This value may be used to determine whether the snapshot + // was taken from the current or a previous instance of a given disk + // name. + SourceDiskId string `json:"sourceDiskId,omitempty"` + + // Status: The status of the persistent disk snapshot (output only). + Status string `json:"status,omitempty"` +} + +type SnapshotList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The persistent snapshot resources. + Items []*Snapshot `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Tags struct { + // Fingerprint: Fingerprint of this resource. A hash of the tags stored + // in this object. This field is used optimistic locking. An up-to-date + // tags fingerprint must be provided in order to modify tags. + Fingerprint string `json:"fingerprint,omitempty"` + + // Items: An array of tags. Each tag must be 1-63 characters long, and + // comply with RFC1035. + Items []string `json:"items,omitempty"` +} + +type Zone struct { + // AvailableMachineType: The machine types that can be used in this zone + // (output only). + AvailableMachineType []string `json:"availableMachineType,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this zone. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: Textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MaintenanceWindows: Scheduled maintenance windows for the zone. When + // the zone is in a maintenance window, all resources which reside in + // the zone will be unavailable. + MaintenanceWindows []*ZoneMaintenanceWindows `json:"maintenanceWindows,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // Quotas: Quotas assigned to this zone. + Quotas []*Quota `json:"quotas,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Status: Status of the zone. "UP" or "DOWN". + Status string `json:"status,omitempty"` +} + +type ZoneMaintenanceWindows struct { + // BeginTime: Begin time of the maintenance window, in RFC 3339 format. + BeginTime string `json:"beginTime,omitempty"` + + // Description: Textual description of the maintenance window. + Description string `json:"description,omitempty"` + + // EndTime: End time of the maintenance window, in RFC 3339 format. + EndTime string `json:"endTime,omitempty"` + + // Name: Name of the maintenance window. + Name string `json:"name,omitempty"` +} + +type ZoneList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The zone resources. + Items []*Zone `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +// method id "compute.disks.delete": + +type DisksDeleteCall struct { + s *Service + project string + zone string + disk string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified persistent disk resource. +func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall { + c := &DisksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.disk = disk + return c +} + +func (c *DisksDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/disks/{disk}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{disk}", url.QueryEscape(c.disk), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified persistent disk resource.", + // "httpMethod": "DELETE", + // "id": "compute.disks.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks/{disk}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.disks.get": + +type DisksGetCall struct { + s *Service + project string + zone string + disk string + opt_ map[string]interface{} +} + +// Get: Returns the specified persistent disk resource. +func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall { + c := &DisksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.disk = disk + return c +} + +func (c *DisksGetCall) Do() (*Disk, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/disks/{disk}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{disk}", url.QueryEscape(c.disk), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Disk) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified persistent disk resource.", + // "httpMethod": "GET", + // "id": "compute.disks.get", + // "parameterOrder": [ + // "project", + // "zone", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks/{disk}", + // "response": { + // "$ref": "Disk" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.disks.insert": + +type DisksInsertCall struct { + s *Service + project string + zone string + disk *Disk + opt_ map[string]interface{} +} + +// Insert: Creates a persistent disk resource in the specified project +// using the data included in the request. +func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall { + c := &DisksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.disk = disk + return c +} + +// SourceImage sets the optional parameter "sourceImage": Source image +// to restore onto a disk. +func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall { + c.opt_["sourceImage"] = sourceImage + return c +} + +func (c *DisksInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["sourceImage"]; ok { + params.Set("sourceImage", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/disks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a persistent disk resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.disks.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "sourceImage": { + // "description": "Optional. Source image to restore onto a disk.", + // "location": "query", + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks", + // "request": { + // "$ref": "Disk" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.disks.list": + +type DisksListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// List: Retrieves the list of persistent disk resources contained +// within the specified zone. +func (r *DisksService) List(project string, zone string) *DisksListCall { + c := &DisksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *DisksListCall) Filter(filter string) *DisksListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *DisksListCall) PageToken(pageToken string) *DisksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *DisksListCall) Do() (*DiskList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/disks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DiskList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of persistent disk resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.disks.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks", + // "response": { + // "$ref": "DiskList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.firewalls.delete": + +type FirewallsDeleteCall struct { + s *Service + project string + firewall string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified firewall resource. +func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall { + c := &FirewallsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + return c +} + +func (c *FirewallsDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{firewall}", url.QueryEscape(c.firewall), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified firewall resource.", + // "httpMethod": "DELETE", + // "id": "compute.firewalls.delete", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls/{firewall}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.get": + +type FirewallsGetCall struct { + s *Service + project string + firewall string + opt_ map[string]interface{} +} + +// Get: Returns the specified firewall resource. +func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall { + c := &FirewallsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + return c +} + +func (c *FirewallsGetCall) Do() (*Firewall, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{firewall}", url.QueryEscape(c.firewall), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Firewall) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified firewall resource.", + // "httpMethod": "GET", + // "id": "compute.firewalls.get", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls/{firewall}", + // "response": { + // "$ref": "Firewall" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.firewalls.insert": + +type FirewallsInsertCall struct { + s *Service + project string + firewall *Firewall + opt_ map[string]interface{} +} + +// Insert: Creates a firewall resource in the specified project using +// the data included in the request. +func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall { + c := &FirewallsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + return c +} + +func (c *FirewallsInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/firewalls") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a firewall resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.firewalls.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls", + // "request": { + // "$ref": "Firewall" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.list": + +type FirewallsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of firewall resources available to the +// specified project. +func (r *FirewallsService) List(project string) *FirewallsListCall { + c := &FirewallsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *FirewallsListCall) Do() (*FirewallList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/firewalls") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(FirewallList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of firewall resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.firewalls.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls", + // "response": { + // "$ref": "FirewallList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.firewalls.patch": + +type FirewallsPatchCall struct { + s *Service + project string + firewall string + firewall2 *Firewall + opt_ map[string]interface{} +} + +// Patch: Updates the specified firewall resource with the data included +// in the request. This method supports patch semantics. +func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall { + c := &FirewallsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + c.firewall2 = firewall2 + return c +} + +func (c *FirewallsPatchCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{firewall}", url.QueryEscape(c.firewall), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified firewall resource with the data included in the request. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "compute.firewalls.patch", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls/{firewall}", + // "request": { + // "$ref": "Firewall" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.update": + +type FirewallsUpdateCall struct { + s *Service + project string + firewall string + firewall2 *Firewall + opt_ map[string]interface{} +} + +// Update: Updates the specified firewall resource with the data +// included in the request. +func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall { + c := &FirewallsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + c.firewall2 = firewall2 + return c +} + +func (c *FirewallsUpdateCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{firewall}", url.QueryEscape(c.firewall), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified firewall resource with the data included in the request.", + // "httpMethod": "PUT", + // "id": "compute.firewalls.update", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls/{firewall}", + // "request": { + // "$ref": "Firewall" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalOperations.delete": + +type GlobalOperationsDeleteCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified operation resource. +func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall { + c := &GlobalOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +func (c *GlobalOperationsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified operation resource.", + // "httpMethod": "DELETE", + // "id": "compute.globalOperations.delete", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/operations/{operation}", + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalOperations.get": + +type GlobalOperationsGetCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} +} + +// Get: Retrieves the specified operation resource. +func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall { + c := &GlobalOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +func (c *GlobalOperationsGetCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified operation resource.", + // "httpMethod": "GET", + // "id": "compute.globalOperations.get", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/operations/{operation}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.globalOperations.list": + +type GlobalOperationsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of operation resources contained within the +// specified project. +func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall { + c := &GlobalOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *GlobalOperationsListCall) Do() (*OperationList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OperationList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.globalOperations.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/operations", + // "response": { + // "$ref": "OperationList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.images.delete": + +type ImagesDeleteCall struct { + s *Service + project string + image string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified image resource. +func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall { + c := &ImagesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + return c +} + +func (c *ImagesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/images/{image}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{image}", url.QueryEscape(c.image), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified image resource.", + // "httpMethod": "DELETE", + // "id": "compute.images.delete", + // "parameterOrder": [ + // "project", + // "image" + // ], + // "parameters": { + // "image": { + // "description": "Name of the image resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images/{image}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.deprecate": + +type ImagesDeprecateCall struct { + s *Service + project string + image string + deprecationstatus *DeprecationStatus + opt_ map[string]interface{} +} + +// Deprecate: Sets the deprecation status of an image. If no message +// body is given, clears the deprecation status instead. +func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall { + c := &ImagesDeprecateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + c.deprecationstatus = deprecationstatus + return c +} + +func (c *ImagesDeprecateCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/images/{image}/deprecate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{image}", url.QueryEscape(c.image), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the deprecation status of an image. If no message body is given, clears the deprecation status instead.", + // "httpMethod": "POST", + // "id": "compute.images.deprecate", + // "parameterOrder": [ + // "project", + // "image" + // ], + // "parameters": { + // "image": { + // "description": "Image name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images/{image}/deprecate", + // "request": { + // "$ref": "DeprecationStatus" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.get": + +type ImagesGetCall struct { + s *Service + project string + image string + opt_ map[string]interface{} +} + +// Get: Returns the specified image resource. +func (r *ImagesService) Get(project string, image string) *ImagesGetCall { + c := &ImagesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + return c +} + +func (c *ImagesGetCall) Do() (*Image, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/images/{image}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{image}", url.QueryEscape(c.image), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Image) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified image resource.", + // "httpMethod": "GET", + // "id": "compute.images.get", + // "parameterOrder": [ + // "project", + // "image" + // ], + // "parameters": { + // "image": { + // "description": "Name of the image resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images/{image}", + // "response": { + // "$ref": "Image" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.images.insert": + +type ImagesInsertCall struct { + s *Service + project string + image *Image + opt_ map[string]interface{} +} + +// Insert: Creates an image resource in the specified project using the +// data included in the request. +func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall { + c := &ImagesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + return c +} + +func (c *ImagesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.image) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/images") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an image resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.images.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images", + // "request": { + // "$ref": "Image" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "compute.images.list": + +type ImagesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of image resources available to the +// specified project. +func (r *ImagesService) List(project string) *ImagesListCall { + c := &ImagesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ImagesListCall) Filter(filter string) *ImagesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ImagesListCall) Do() (*ImageList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/images") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ImageList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of image resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.images.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images", + // "response": { + // "$ref": "ImageList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.addAccessConfig": + +type InstancesAddAccessConfigCall struct { + s *Service + project string + zone string + instance string + network_interface string + accessconfig *AccessConfig + opt_ map[string]interface{} +} + +// AddAccessConfig: Adds an access config to an instance's network +// interface. +func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, network_interface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall { + c := &InstancesAddAccessConfigCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.network_interface = network_interface + c.accessconfig = accessconfig + return c +} + +func (c *InstancesAddAccessConfigCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + params.Set("network_interface", fmt.Sprintf("%v", c.network_interface)) + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/instances/{instance}/addAccessConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds an access config to an instance's network interface.", + // "httpMethod": "POST", + // "id": "compute.instances.addAccessConfig", + // "parameterOrder": [ + // "project", + // "zone", + // "instance", + // "network_interface" + // ], + // "parameters": { + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "network_interface": { + // "description": "Network interface name.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig", + // "request": { + // "$ref": "AccessConfig" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.attachDisk": + +type InstancesAttachDiskCall struct { + s *Service + project string + zone string + instance string + attacheddisk *AttachedDisk + opt_ map[string]interface{} +} + +// AttachDisk: Attaches a disk resource to an instance. +func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall { + c := &InstancesAttachDiskCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.attacheddisk = attacheddisk + return c +} + +func (c *InstancesAttachDiskCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/instances/{instance}/attachDisk") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Attaches a disk resource to an instance.", + // "httpMethod": "POST", + // "id": "compute.instances.attachDisk", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/attachDisk", + // "request": { + // "$ref": "AttachedDisk" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.delete": + +type InstancesDeleteCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified instance resource. +func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall { + c := &InstancesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified instance resource.", + // "httpMethod": "DELETE", + // "id": "compute.instances.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.deleteAccessConfig": + +type InstancesDeleteAccessConfigCall struct { + s *Service + project string + zone string + instance string + access_config string + network_interface string + opt_ map[string]interface{} +} + +// DeleteAccessConfig: Deletes an access config from an instance's +// network interface. +func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, access_config string, network_interface string) *InstancesDeleteAccessConfigCall { + c := &InstancesDeleteAccessConfigCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.access_config = access_config + c.network_interface = network_interface + return c +} + +func (c *InstancesDeleteAccessConfigCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("access_config", fmt.Sprintf("%v", c.access_config)) + params.Set("network_interface", fmt.Sprintf("%v", c.network_interface)) + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes an access config from an instance's network interface.", + // "httpMethod": "POST", + // "id": "compute.instances.deleteAccessConfig", + // "parameterOrder": [ + // "project", + // "zone", + // "instance", + // "access_config", + // "network_interface" + // ], + // "parameters": { + // "access_config": { + // "description": "Access config name.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "network_interface": { + // "description": "Network interface name.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.detachDisk": + +type InstancesDetachDiskCall struct { + s *Service + project string + zone string + instance string + deviceName string + opt_ map[string]interface{} +} + +// DetachDisk: Detaches a disk from an instance. +func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall { + c := &InstancesDetachDiskCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.deviceName = deviceName + return c +} + +func (c *InstancesDetachDiskCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("deviceName", fmt.Sprintf("%v", c.deviceName)) + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/instances/{instance}/detachDisk") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Detaches a disk from an instance.", + // "httpMethod": "POST", + // "id": "compute.instances.detachDisk", + // "parameterOrder": [ + // "project", + // "zone", + // "instance", + // "deviceName" + // ], + // "parameters": { + // "deviceName": { + // "description": "Disk device name to detach.", + // "location": "query", + // "pattern": "\\w[\\w.-]{0,254}", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/detachDisk", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.get": + +type InstancesGetCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} +} + +// Get: Returns the specified instance resource. +func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall { + c := &InstancesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesGetCall) Do() (*Instance, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Instance) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified instance resource.", + // "httpMethod": "GET", + // "id": "compute.instances.get", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}", + // "response": { + // "$ref": "Instance" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.getSerialPortOutput": + +type InstancesGetSerialPortOutputCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} +} + +// GetSerialPortOutput: Returns the specified instance's serial port +// output. +func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall { + c := &InstancesGetSerialPortOutputCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesGetSerialPortOutputCall) Do() (*SerialPortOutput, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/instances/{instance}/serialPort") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SerialPortOutput) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified instance's serial port output.", + // "httpMethod": "GET", + // "id": "compute.instances.getSerialPortOutput", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/serialPort", + // "response": { + // "$ref": "SerialPortOutput" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.insert": + +type InstancesInsertCall struct { + s *Service + project string + zone string + instance *Instance + opt_ map[string]interface{} +} + +// Insert: Creates an instance resource in the specified project using +// the data included in the request. +func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall { + c := &InstancesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an instance resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.instances.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances", + // "request": { + // "$ref": "Instance" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.list": + +type InstancesListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// List: Retrieves the list of instance resources contained within the +// specified zone. +func (r *InstancesService) List(project string, zone string) *InstancesListCall { + c := &InstancesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *InstancesListCall) Filter(filter string) *InstancesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *InstancesListCall) Do() (*InstanceList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstanceList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of instance resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.instances.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances", + // "response": { + // "$ref": "InstanceList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.reset": + +type InstancesResetCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} +} + +// Reset: Performs a hard reset on the instance. +func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall { + c := &InstancesResetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesResetCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/instances/{instance}/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Performs a hard reset on the instance.", + // "httpMethod": "POST", + // "id": "compute.instances.reset", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/reset", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.setMetadata": + +type InstancesSetMetadataCall struct { + s *Service + project string + zone string + instance string + metadata *Metadata + opt_ map[string]interface{} +} + +// SetMetadata: Sets metadata for the specified instance to the data +// included in the request. +func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall { + c := &InstancesSetMetadataCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.metadata = metadata + return c +} + +func (c *InstancesSetMetadataCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/instances/{instance}/setMetadata") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets metadata for the specified instance to the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.instances.setMetadata", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/setMetadata", + // "request": { + // "$ref": "Metadata" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.setTags": + +type InstancesSetTagsCall struct { + s *Service + project string + zone string + instance string + tags *Tags + opt_ map[string]interface{} +} + +// SetTags: Sets tags for the specified instance to the data included in +// the request. +func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall { + c := &InstancesSetTagsCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.tags = tags + return c +} + +func (c *InstancesSetTagsCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/instances/{instance}/setTags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets tags for the specified instance to the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.instances.setTags", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/setTags", + // "request": { + // "$ref": "Tags" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.kernels.get": + +type KernelsGetCall struct { + s *Service + project string + kernel string + opt_ map[string]interface{} +} + +// Get: Returns the specified kernel resource. +func (r *KernelsService) Get(project string, kernel string) *KernelsGetCall { + c := &KernelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.kernel = kernel + return c +} + +func (c *KernelsGetCall) Do() (*Kernel, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/kernels/{kernel}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{kernel}", url.QueryEscape(c.kernel), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Kernel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified kernel resource.", + // "httpMethod": "GET", + // "id": "compute.kernels.get", + // "parameterOrder": [ + // "project", + // "kernel" + // ], + // "parameters": { + // "kernel": { + // "description": "Name of the kernel resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/kernels/{kernel}", + // "response": { + // "$ref": "Kernel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.kernels.list": + +type KernelsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of kernel resources available to the +// specified project. +func (r *KernelsService) List(project string) *KernelsListCall { + c := &KernelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *KernelsListCall) Filter(filter string) *KernelsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *KernelsListCall) MaxResults(maxResults int64) *KernelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *KernelsListCall) PageToken(pageToken string) *KernelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *KernelsListCall) Do() (*KernelList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/kernels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(KernelList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of kernel resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.kernels.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/kernels", + // "response": { + // "$ref": "KernelList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.machineTypes.get": + +type MachineTypesGetCall struct { + s *Service + project string + machineType string + opt_ map[string]interface{} +} + +// Get: Returns the specified machine type resource. +func (r *MachineTypesService) Get(project string, machineType string) *MachineTypesGetCall { + c := &MachineTypesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.machineType = machineType + return c +} + +func (c *MachineTypesGetCall) Do() (*MachineType, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/machineTypes/{machineType}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{machineType}", url.QueryEscape(c.machineType), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(MachineType) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified machine type resource.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.get", + // "parameterOrder": [ + // "project", + // "machineType" + // ], + // "parameters": { + // "machineType": { + // "description": "Name of the machine type resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/machineTypes/{machineType}", + // "response": { + // "$ref": "MachineType" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.machineTypes.list": + +type MachineTypesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of machine type resources available to the +// specified project. +func (r *MachineTypesService) List(project string) *MachineTypesListCall { + c := &MachineTypesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *MachineTypesListCall) Do() (*MachineTypeList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/machineTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(MachineTypeList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of machine type resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/machineTypes", + // "response": { + // "$ref": "MachineTypeList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.networks.delete": + +type NetworksDeleteCall struct { + s *Service + project string + network string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified network resource. +func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall { + c := &NetworksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.network = network + return c +} + +func (c *NetworksDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/networks/{network}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{network}", url.QueryEscape(c.network), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified network resource.", + // "httpMethod": "DELETE", + // "id": "compute.networks.delete", + // "parameterOrder": [ + // "project", + // "network" + // ], + // "parameters": { + // "network": { + // "description": "Name of the network resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/networks/{network}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.networks.get": + +type NetworksGetCall struct { + s *Service + project string + network string + opt_ map[string]interface{} +} + +// Get: Returns the specified network resource. +func (r *NetworksService) Get(project string, network string) *NetworksGetCall { + c := &NetworksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.network = network + return c +} + +func (c *NetworksGetCall) Do() (*Network, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/networks/{network}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{network}", url.QueryEscape(c.network), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Network) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified network resource.", + // "httpMethod": "GET", + // "id": "compute.networks.get", + // "parameterOrder": [ + // "project", + // "network" + // ], + // "parameters": { + // "network": { + // "description": "Name of the network resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/networks/{network}", + // "response": { + // "$ref": "Network" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.networks.insert": + +type NetworksInsertCall struct { + s *Service + project string + network *Network + opt_ map[string]interface{} +} + +// Insert: Creates a network resource in the specified project using the +// data included in the request. +func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall { + c := &NetworksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.network = network + return c +} + +func (c *NetworksInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.network) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/networks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a network resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.networks.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/networks", + // "request": { + // "$ref": "Network" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.networks.list": + +type NetworksListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of network resources available to the +// specified project. +func (r *NetworksService) List(project string) *NetworksListCall { + c := &NetworksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *NetworksListCall) Filter(filter string) *NetworksListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *NetworksListCall) Do() (*NetworkList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/networks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(NetworkList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of network resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.networks.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/networks", + // "response": { + // "$ref": "NetworkList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.projects.get": + +type ProjectsGetCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// Get: Returns the specified project resource. +func (r *ProjectsService) Get(project string) *ProjectsGetCall { + c := &ProjectsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +func (c *ProjectsGetCall) Do() (*Project, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Project) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified project resource.", + // "httpMethod": "GET", + // "id": "compute.projects.get", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project resource to retrieve.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}", + // "response": { + // "$ref": "Project" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.projects.setCommonInstanceMetadata": + +type ProjectsSetCommonInstanceMetadataCall struct { + s *Service + project string + metadata *Metadata + opt_ map[string]interface{} +} + +// SetCommonInstanceMetadata: Sets metadata common to all instances +// within the specified project using the data included in the request. +func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall { + c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.metadata = metadata + return c +} + +func (c *ProjectsSetCommonInstanceMetadataCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/setCommonInstanceMetadata") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets metadata common to all instances within the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.projects.setCommonInstanceMetadata", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/setCommonInstanceMetadata", + // "request": { + // "$ref": "Metadata" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.routes.delete": + +type RoutesDeleteCall struct { + s *Service + project string + route string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified route resource. +func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall { + c := &RoutesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.route = route + return c +} + +func (c *RoutesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/routes/{route}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{route}", url.QueryEscape(c.route), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified route resource.", + // "httpMethod": "DELETE", + // "id": "compute.routes.delete", + // "parameterOrder": [ + // "project", + // "route" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "route": { + // "description": "Name of the route resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/routes/{route}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.routes.get": + +type RoutesGetCall struct { + s *Service + project string + route string + opt_ map[string]interface{} +} + +// Get: Returns the specified route resource. +func (r *RoutesService) Get(project string, route string) *RoutesGetCall { + c := &RoutesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.route = route + return c +} + +func (c *RoutesGetCall) Do() (*Route, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/routes/{route}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{route}", url.QueryEscape(c.route), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Route) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified route resource.", + // "httpMethod": "GET", + // "id": "compute.routes.get", + // "parameterOrder": [ + // "project", + // "route" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "route": { + // "description": "Name of the route resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/routes/{route}", + // "response": { + // "$ref": "Route" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.routes.insert": + +type RoutesInsertCall struct { + s *Service + project string + route *Route + opt_ map[string]interface{} +} + +// Insert: Creates a route resource in the specified project using the +// data included in the request. +func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall { + c := &RoutesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.route = route + return c +} + +func (c *RoutesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.route) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/routes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a route resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.routes.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/routes", + // "request": { + // "$ref": "Route" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.routes.list": + +type RoutesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of route resources available to the +// specified project. +func (r *RoutesService) List(project string) *RoutesListCall { + c := &RoutesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *RoutesListCall) Filter(filter string) *RoutesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *RoutesListCall) Do() (*RouteList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/routes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RouteList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of route resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.routes.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/routes", + // "response": { + // "$ref": "RouteList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.snapshots.delete": + +type SnapshotsDeleteCall struct { + s *Service + project string + snapshot string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified persistent disk snapshot resource. +func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall { + c := &SnapshotsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.snapshot = snapshot + return c +} + +func (c *SnapshotsDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/snapshots/{snapshot}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{snapshot}", url.QueryEscape(c.snapshot), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified persistent disk snapshot resource.", + // "httpMethod": "DELETE", + // "id": "compute.snapshots.delete", + // "parameterOrder": [ + // "project", + // "snapshot" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "snapshot": { + // "description": "Name of the persistent disk snapshot resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/snapshots/{snapshot}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.snapshots.get": + +type SnapshotsGetCall struct { + s *Service + project string + snapshot string + opt_ map[string]interface{} +} + +// Get: Returns the specified persistent disk snapshot resource. +func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall { + c := &SnapshotsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.snapshot = snapshot + return c +} + +func (c *SnapshotsGetCall) Do() (*Snapshot, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/snapshots/{snapshot}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{snapshot}", url.QueryEscape(c.snapshot), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Snapshot) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified persistent disk snapshot resource.", + // "httpMethod": "GET", + // "id": "compute.snapshots.get", + // "parameterOrder": [ + // "project", + // "snapshot" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "snapshot": { + // "description": "Name of the persistent disk snapshot resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/snapshots/{snapshot}", + // "response": { + // "$ref": "Snapshot" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.snapshots.insert": + +type SnapshotsInsertCall struct { + s *Service + project string + snapshot *Snapshot + opt_ map[string]interface{} +} + +// Insert: Creates a persistent disk snapshot resource in the specified +// project using the data included in the request. +func (r *SnapshotsService) Insert(project string, snapshot *Snapshot) *SnapshotsInsertCall { + c := &SnapshotsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.snapshot = snapshot + return c +} + +func (c *SnapshotsInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/snapshots") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a persistent disk snapshot resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.snapshots.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/snapshots", + // "request": { + // "$ref": "Snapshot" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.snapshots.list": + +type SnapshotsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of persistent disk snapshot resources +// contained within the specified project. +func (r *SnapshotsService) List(project string) *SnapshotsListCall { + c := &SnapshotsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *SnapshotsListCall) Do() (*SnapshotList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/global/snapshots") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SnapshotList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of persistent disk snapshot resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.snapshots.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/snapshots", + // "response": { + // "$ref": "SnapshotList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.zoneOperations.delete": + +type ZoneOperationsDeleteCall struct { + s *Service + project string + zone string + operation string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified zone-specific operation resource. +func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall { + c := &ZoneOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.operation = operation + return c +} + +func (c *ZoneOperationsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified zone-specific operation resource.", + // "httpMethod": "DELETE", + // "id": "compute.zoneOperations.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/operations/{operation}", + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.zoneOperations.get": + +type ZoneOperationsGetCall struct { + s *Service + project string + zone string + operation string + opt_ map[string]interface{} +} + +// Get: Retrieves the specified zone-specific operation resource. +func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall { + c := &ZoneOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.operation = operation + return c +} + +func (c *ZoneOperationsGetCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified zone-specific operation resource.", + // "httpMethod": "GET", + // "id": "compute.zoneOperations.get", + // "parameterOrder": [ + // "project", + // "zone", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/operations/{operation}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.zoneOperations.list": + +type ZoneOperationsListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// List: Retrieves the list of operation resources contained within the +// specified zone. +func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall { + c := &ZoneOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ZoneOperationsListCall) Do() (*OperationList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OperationList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.zoneOperations.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/operations", + // "response": { + // "$ref": "OperationList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.zones.get": + +type ZonesGetCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// Get: Returns the specified zone resource. +func (r *ZonesService) Get(project string, zone string) *ZonesGetCall { + c := &ZonesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +func (c *ZonesGetCall) Do() (*Zone, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones/{zone}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Zone) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified zone resource.", + // "httpMethod": "GET", + // "id": "compute.zones.get", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}", + // "response": { + // "$ref": "Zone" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.zones.list": + +type ZonesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of zone resources available to the specified +// project. +func (r *ZonesService) List(project string) *ZonesListCall { + c := &ZonesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ZonesListCall) Filter(filter string) *ZonesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum and default value is 100. +func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ZonesListCall) Do() (*ZoneList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta14/projects/", "{project}/zones") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ZoneList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of zone resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.zones.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones", + // "response": { + // "$ref": "ZoneList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta15/compute-api.json b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta15/compute-api.json new file mode 100644 index 0000000000000..bb851538c1950 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta15/compute-api.json @@ -0,0 +1,6357 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"_UU0hweWJUeoapnMzW_8ULttsqM/1b42mTNhp-IHR0jf9o6NABcHCFc\"", + "discoveryVersion": "v1", + "id": "compute:v1beta15", + "name": "compute", + "version": "v1beta15", + "title": "Compute Engine API", + "description": "API for the Google Compute Engine service.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "http://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://developers.google.com/compute/docs/reference/v1beta15", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/compute/v1beta15/projects/", + "basePath": "/compute/v1beta15/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "compute/v1beta15/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/compute": { + "description": "View and manage your Google Compute Engine resources" + }, + "https://www.googleapis.com/auth/compute.readonly": { + "description": "View your Google Compute Engine resources" + }, + "https://www.googleapis.com/auth/devstorage.full_control": { + "description": "Manage your data and permissions in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" + } + } + } + }, + "schemas": { + "AccessConfig": { + "id": "AccessConfig", + "type": "object", + "description": "An access configuration attached to an instance's network interface.", + "properties": { + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#accessConfig" + }, + "name": { + "type": "string", + "description": "Name of this access configuration." + }, + "natIP": { + "type": "string", + "description": "An external IP address associated with this instance. Specify an unused static IP address available to the project. If not specified, the external IP will be drawn from a shared ephemeral pool." + }, + "type": { + "type": "string", + "description": "Type of configuration. Must be set to \"ONE_TO_ONE_NAT\". This configures port-for-port NAT to the internet.", + "default": "ONE_TO_ONE_NAT" + } + } + }, + "Address": { + "id": "Address", + "type": "object", + "description": "A reserved address resource.", + "properties": { + "address": { + "type": "string", + "description": "The IP address represented by this resource." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#address" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.addresses.insert" + ] + } + }, + "region": { + "type": "string", + "description": "URL of the region where the address resides (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "status": { + "type": "string", + "description": "The status of the address (output only)." + }, + "user": { + "type": "string" + } + } + }, + "AddressAggregatedList": { + "id": "AddressAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped address lists.", + "additionalProperties": { + "$ref": "AddressesScopedList", + "description": "Name of the scope containing this set of addresses." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#addressAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "AddressList": { + "id": "AddressList", + "type": "object", + "description": "Contains a list of address resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The address resources.", + "items": { + "$ref": "Address" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#addressList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "AddressesScopedList": { + "id": "AddressesScopedList", + "type": "object", + "properties": { + "addresses": { + "type": "array", + "description": "List of addresses contained in this scope.", + "items": { + "$ref": "Address" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of addresses when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning." + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "AttachedDisk": { + "id": "AttachedDisk", + "type": "object", + "description": "An instance-attached disk resource.", + "properties": { + "boot": { + "type": "boolean", + "description": "Indicates that this is a boot disk. VM will use the first partition of the disk for its root filesystem." + }, + "deviceName": { + "type": "string", + "description": "Persistent disk only; must be unique within the instance when specified. This represents a unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. If not specified, a default will be chosen by the system." + }, + "index": { + "type": "integer", + "description": "A zero-based index to assign to this disk, where 0 is reserved for the boot disk. If not specified, the server will choose an appropriate value (output only).", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#attachedDisk" + }, + "mode": { + "type": "string", + "description": "The mode in which to attach this disk, either \"READ_WRITE\" or \"READ_ONLY\"." + }, + "source": { + "type": "string", + "description": "Persistent disk only; the URL of the persistent disk resource." + }, + "type": { + "type": "string", + "description": "Type of the disk, either \"SCRATCH\" or \"PERSISTENT\". Note that persistent disks must be created before you can specify them here.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + } + } + }, + "DeprecationStatus": { + "id": "DeprecationStatus", + "type": "object", + "description": "Deprecation status for a public resource.", + "properties": { + "deleted": { + "type": "string", + "description": "An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to DELETED." + }, + "deprecated": { + "type": "string", + "description": "An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to DEPRECATED." + }, + "obsolete": { + "type": "string", + "description": "An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to OBSOLETE." + }, + "replacement": { + "type": "string", + "description": "A URL of the suggested replacement for the deprecated resource. The deprecated resource and its replacement must be resources of the same kind." + }, + "state": { + "type": "string", + "description": "The deprecation state. Can be \"DEPRECATED\", \"OBSOLETE\", or \"DELETED\". Operations which create a new resource using a \"DEPRECATED\" resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. New uses of \"OBSOLETE\" or \"DELETED\" resources will result in an error." + } + } + }, + "Disk": { + "id": "Disk", + "type": "object", + "description": "A persistent disk resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#disk" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.disks.insert" + ] + } + }, + "options": { + "type": "string", + "description": "Internal use only." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sizeGb": { + "type": "string", + "description": "Size of the persistent disk, specified in GB. This parameter is optional when creating a disk from a disk image or a snapshot, otherwise it is required.", + "format": "int64" + }, + "sourceImage": { + "type": "string", + "description": "The source image used to create this disk. Once the source image has been deleted from the system, this field will not be set, even if an image with the same name has been re-created." + }, + "sourceImageId": { + "type": "string", + "description": "The 'id' value of the image used to create this disk. This value may be used to determine whether the disk was created from the current or a previous instance of a given image." + }, + "sourceSnapshot": { + "type": "string", + "description": "The source snapshot used to create this disk. Once the source snapshot has been deleted from the system, this field will be cleared, and will not be set even if a snapshot with the same name has been re-created." + }, + "sourceSnapshotId": { + "type": "string", + "description": "The 'id' value of the snapshot used to create this disk. This value may be used to determine whether the disk was created from the current or a previous instance of a given disk snapshot." + }, + "status": { + "type": "string", + "description": "The status of disk creation (output only)." + }, + "zone": { + "type": "string", + "description": "URL of the zone where the disk resides (output only)." + } + } + }, + "DiskAggregatedList": { + "id": "DiskAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped disk lists.", + "additionalProperties": { + "$ref": "DisksScopedList", + "description": "Name of the scope containing this set of disks." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#diskAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "DiskList": { + "id": "DiskList", + "type": "object", + "description": "Contains a list of persistent disk resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The persistent disk resources.", + "items": { + "$ref": "Disk" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#diskList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "DisksScopedList": { + "id": "DisksScopedList", + "type": "object", + "properties": { + "disks": { + "type": "array", + "description": "List of disks contained in this scope.", + "items": { + "$ref": "Disk" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of disks when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning." + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "Firewall": { + "id": "Firewall", + "type": "object", + "description": "A firewall resource.", + "properties": { + "allowed": { + "type": "array", + "description": "The list of rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection.", + "items": { + "type": "object", + "properties": { + "IPProtocol": { + "type": "string", + "description": "Required; this is the IP protocol that is allowed for this rule. This can either be a well known protocol string (tcp, udp or icmp) or the IP protocol number." + }, + "ports": { + "type": "array", + "description": "An optional list of ports which are allowed. It is an error to specify this for any protocol that isn't UDP or TCP. Each entry must be either an integer or a range. If not specified, connections through any port are allowed.\n\nExample inputs include: [\"22\"], [\"80\",\"443\"] and [\"12345-12349\"].", + "items": { + "type": "string" + } + } + } + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#firewall" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.firewalls.insert", + "compute.firewalls.patch" + ] + } + }, + "network": { + "type": "string", + "description": "URL of the network to which this firewall is applied; provided by the client when the firewall is created.", + "annotations": { + "required": [ + "compute.firewalls.insert", + "compute.firewalls.patch" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sourceRanges": { + "type": "array", + "description": "A list of IP address blocks expressed in CIDR format which this rule applies to. One or both of sourceRanges and sourceTags may be set; an inbound connection is allowed if either the range or the tag of the source matches.", + "items": { + "type": "string" + } + }, + "sourceTags": { + "type": "array", + "description": "A list of instance tags which this rule applies to. One or both of sourceRanges and sourceTags may be set; an inbound connection is allowed if either the range or the tag of the source matches.", + "items": { + "type": "string" + } + }, + "targetTags": { + "type": "array", + "description": "A list of instance tags indicating sets of instances located on network which may make network connections as specified in allowed. If no targetTags are specified, the firewall rule applies to all instances on the specified network.", + "items": { + "type": "string" + } + } + } + }, + "FirewallList": { + "id": "FirewallList", + "type": "object", + "description": "Contains a list of firewall resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The firewall resources.", + "items": { + "$ref": "Firewall" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#firewallList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "ForwardingRule": { + "id": "ForwardingRule", + "type": "object", + "description": "A ForwardingRule resource. A ForwardingRule resource specifies which pool of target VMs to forward a packet to if it matches the given [IPAddress, IPProtocol, portRange] tuple.", + "properties": { + "IPAddress": { + "type": "string", + "description": "Value of the reserved IP address that this forwarding rule is serving on behalf of. The address resource must live in the same region as the forwarding rule. If left empty (default value), an ephemeral IP will be assigned." + }, + "IPProtocol": { + "type": "string", + "description": "The IP protocol to which this rule applies, can be either 'TCP' or 'UDP' (If left empty, will use TCP by default)." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#forwardingRule" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "portRange": { + "type": "string", + "description": "If 'IPProtocol' is 'TCP' or 'UDP', only packets addressed to ports in the specified range will be forwarded to 'target'. If left empty (default value), all ports are forwarded. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges." + }, + "region": { + "type": "string", + "description": "URL of the region where the forwarding rule resides (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "target": { + "type": "string", + "description": "The URL of the target resource to receive the matched traffic. It must live in the same region as this forwarding rule." + } + } + }, + "ForwardingRuleAggregatedList": { + "id": "ForwardingRuleAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped forwarding rule lists.", + "additionalProperties": { + "$ref": "ForwardingRulesScopedList", + "description": "Name of the scope containing this set of addresses." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#forwardingRuleAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "ForwardingRuleList": { + "id": "ForwardingRuleList", + "type": "object", + "description": "Contains a list of ForwardingRule resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The ForwardingRule resources.", + "items": { + "$ref": "ForwardingRule" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#forwardingRuleList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "ForwardingRulesScopedList": { + "id": "ForwardingRulesScopedList", + "type": "object", + "properties": { + "forwardingRules": { + "type": "array", + "description": "List of forwarding rules contained in this scope.", + "items": { + "$ref": "ForwardingRule" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of forwarding rules when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning." + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "HealthCheckReference": { + "id": "HealthCheckReference", + "type": "object", + "properties": { + "healthCheck": { + "type": "string" + } + } + }, + "HealthStatus": { + "id": "HealthStatus", + "type": "object", + "properties": { + "healthState": { + "type": "string", + "description": "Health state of the instance." + }, + "instance": { + "type": "string", + "description": "URL of the instance resource." + }, + "ipAddress": { + "type": "string", + "description": "The IP address represented by this resource." + } + } + }, + "HttpHealthCheck": { + "id": "HttpHealthCheck", + "type": "object", + "description": "An HttpHealthCheck resource. This resource defines a template for how individual VMs should be checked for health, via HTTP.", + "properties": { + "checkIntervalSec": { + "type": "integer", + "description": "How often (in seconds) to send a health check. The default value is 5 seconds.", + "format": "int32" + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "healthyThreshold": { + "type": "integer", + "description": "A so-far unhealthy VM will be marked healthy after this many consecutive successes. The default value is 2.", + "format": "int32" + }, + "host": { + "type": "string", + "description": "The value of the host header in the HTTP health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#httpHealthCheck" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "port": { + "type": "integer", + "description": "The TCP port number for the HTTP health check request. The default value is 80.", + "format": "int32" + }, + "requestPath": { + "type": "string", + "description": "The request path of the HTTP health check request. The default value is \"/\"." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "timeoutSec": { + "type": "integer", + "description": "How long (in seconds) to wait before claiming failure. The default value is 5 seconds.", + "format": "int32" + }, + "unhealthyThreshold": { + "type": "integer", + "description": "A so-far healthy VM will be marked unhealthy after this many consecutive failures. The default value is 2.", + "format": "int32" + } + } + }, + "HttpHealthCheckList": { + "id": "HttpHealthCheckList", + "type": "object", + "description": "Contains a list of HttpHealthCheck resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The HttpHealthCheck resources.", + "items": { + "$ref": "HttpHealthCheck" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#httpHealthCheckList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Image": { + "id": "Image", + "type": "object", + "description": "A disk image resource.", + "properties": { + "archiveSizeBytes": { + "type": "string", + "description": "Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).", + "format": "int64" + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this image." + }, + "description": { + "type": "string", + "description": "Textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#image" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + }, + "preferredKernel": { + "type": "string", + "description": "An optional URL of the preferred kernel for use with this disk image. If not specified, a server defined default kernel will be used.", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + }, + "rawDisk": { + "type": "object", + "description": "The raw disk image parameters.", + "properties": { + "containerType": { + "type": "string", + "description": "The format used to encode and transmit the block device. Should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created.", + "default": "TAR" + }, + "sha1Checksum": { + "type": "string", + "description": "An optional SHA1 checksum of the disk image before unpackaging; provided by the client when the disk image is created.", + "pattern": "[a-f0-9]{40}" + }, + "source": { + "type": "string", + "description": "The full Google Cloud Storage URL where the disk image is stored; provided by the client when the disk image is created.", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + } + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sourceType": { + "type": "string", + "description": "Must be \"RAW\"; provided by the client when the disk image is created.", + "default": "RAW", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + }, + "status": { + "type": "string", + "description": "Status of the image (output only). It will be one of the following READY - after image has been successfully created and is ready for use FAILED - if creating the image fails for some reason PENDING - the image creation is in progress An image can be used to create other resources suck as instances only after the image has been successfully created and the status is set to READY." + } + } + }, + "ImageList": { + "id": "ImageList", + "type": "object", + "description": "Contains a list of disk image resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The disk image resources.", + "items": { + "$ref": "Image" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#imageList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Instance": { + "id": "Instance", + "type": "object", + "description": "An instance resource.", + "properties": { + "canIpForward": { + "type": "boolean", + "description": "Allows this instance to send packets with source IP addresses other than its own and receive packets with destination IP addresses other than its own. If this instance will be used as an IP gateway or it will be set as the next-hop in a Route resource, say true. If unsure, leave this set to false." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "disks": { + "type": "array", + "description": "Array of disks associated with this instance. Persistent disks must be created before you can assign them.", + "items": { + "$ref": "AttachedDisk" + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "image": { + "type": "string", + "description": "An optional URL of the disk image resource to be installed on this instance; provided by the client when the instance is created. Alternatively to passing the image, the client may choose to boot from a persistent disk, by setting boot=true flag on one of the entries in disks[] collection." + }, + "kernel": { + "type": "string", + "description": "URL of the kernel resource to use when booting. In case of booting from persistent disk, this parameter is required. When booting from a disk image, it is optional, but may be provided to use a different kernel than the one associated with the image." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#instance" + }, + "machineType": { + "type": "string", + "description": "URL of the machine type resource describing which machine type to use to host the instance; provided by the client when the instance is created.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "metadata": { + "$ref": "Metadata", + "description": "Metadata key/value pairs assigned to this instance. Consists of custom metadata or predefined keys; see Instance documentation for more information." + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "networkInterfaces": { + "type": "array", + "description": "Array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.", + "items": { + "$ref": "NetworkInterface" + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + }, + "serviceAccounts": { + "type": "array", + "description": "A list of service accounts each with specified scopes, for which access tokens are to be made available to the instance through metadata queries.", + "items": { + "$ref": "ServiceAccount" + } + }, + "status": { + "type": "string", + "description": "Instance status. One of the following values: \"PROVISIONING\", \"STAGING\", \"RUNNING\", \"STOPPING\", \"STOPPED\", \"TERMINATED\" (output only)." + }, + "statusMessage": { + "type": "string", + "description": "An optional, human-readable explanation of the status (output only)." + }, + "tags": { + "$ref": "Tags", + "description": "A list of tags to be applied to this instance. Used to identify valid sources or targets for network firewalls. Provided by the client on instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035." + }, + "zone": { + "type": "string", + "description": "URL of the zone where the instance resides (output only)." + } + } + }, + "InstanceAggregatedList": { + "id": "InstanceAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped instance lists.", + "additionalProperties": { + "$ref": "InstancesScopedList", + "description": "Name of the scope containing this set of instances." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#instanceAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "InstanceList": { + "id": "InstanceList", + "type": "object", + "description": "Contains a list of instance resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "A list of instance resources.", + "items": { + "$ref": "Instance" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#instanceList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "InstanceReference": { + "id": "InstanceReference", + "type": "object", + "properties": { + "instance": { + "type": "string" + } + } + }, + "InstancesScopedList": { + "id": "InstancesScopedList", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "List of instances contained in this scope.", + "items": { + "$ref": "Instance" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of instances when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning." + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "Kernel": { + "id": "Kernel", + "type": "object", + "description": "A kernel resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this kernel." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#kernel" + }, + "name": { + "type": "string", + "description": "Name of the resource.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "KernelList": { + "id": "KernelList", + "type": "object", + "description": "Contains a list of kernel resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The kernel resources.", + "items": { + "$ref": "Kernel" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#kernelList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "MachineType": { + "id": "MachineType", + "type": "object", + "description": "A machine type resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this machine type." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "guestCpus": { + "type": "integer", + "description": "Count of CPUs exposed to the instance.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "imageSpaceGb": { + "type": "integer", + "description": "Space allotted for the image, defined in GB.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#machineType" + }, + "maximumPersistentDisks": { + "type": "integer", + "description": "Maximum persistent disks allowed.", + "format": "int32" + }, + "maximumPersistentDisksSizeGb": { + "type": "string", + "description": "Maximum total persistent disks size (GB) allowed.", + "format": "int64" + }, + "memoryMb": { + "type": "integer", + "description": "Physical memory assigned to the instance, defined in MB.", + "format": "int32" + }, + "name": { + "type": "string", + "description": "Name of the resource.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "scratchDisks": { + "type": "array", + "description": "List of extended scratch disks assigned to the instance.", + "items": { + "type": "object", + "properties": { + "diskGb": { + "type": "integer", + "description": "Size of the scratch disk, defined in GB.", + "format": "int32" + } + } + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "zone": { + "type": "string", + "description": "Url of the zone where the machine type resides (output only)." + } + } + }, + "MachineTypeAggregatedList": { + "id": "MachineTypeAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped machine type lists.", + "additionalProperties": { + "$ref": "MachineTypesScopedList", + "description": "Name of the scope containing this set of machine types." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#machineTypeAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "MachineTypeList": { + "id": "MachineTypeList", + "type": "object", + "description": "Contains a list of machine type resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The machine type resources.", + "items": { + "$ref": "MachineType" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#machineTypeList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "MachineTypesScopedList": { + "id": "MachineTypesScopedList", + "type": "object", + "properties": { + "machineTypes": { + "type": "array", + "description": "List of machine types contained in this scope.", + "items": { + "$ref": "MachineType" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of machine types when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning." + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "Metadata": { + "id": "Metadata", + "type": "object", + "description": "A metadata key/value entry.", + "properties": { + "fingerprint": { + "type": "string", + "description": "Fingerprint of this resource. A hash of the metadata's contents. This field is used for optimistic locking. An up-to-date metadata fingerprint must be provided in order to modify metadata.", + "format": "byte" + }, + "items": { + "type": "array", + "description": "Array of key/value pairs. The total size of all keys and values must be less than 512 KB.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.", + "pattern": "[a-zA-Z0-9-_]{1,128}", + "annotations": { + "required": [ + "compute.instances.insert", + "compute.projects.setCommonInstanceMetadata" + ] + } + }, + "value": { + "type": "string", + "description": "Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes.", + "annotations": { + "required": [ + "compute.instances.insert", + "compute.projects.setCommonInstanceMetadata" + ] + } + } + } + } + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#metadata" + } + } + }, + "Network": { + "id": "Network", + "type": "object", + "description": "A network resource.", + "properties": { + "IPv4Range": { + "type": "string", + "description": "Required; The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client when the network is created.", + "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}/[0-9]{1,2}", + "annotations": { + "required": [ + "compute.networks.insert" + ] + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "gatewayIPv4": { + "type": "string", + "description": "An optional address that is used for default routing to other networks. This must be within the range specified by IPv4Range, and is typically the first usable address in that range. If not specified, the default value is the first usable address in IPv4Range.", + "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#network" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.networks.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "NetworkInterface": { + "id": "NetworkInterface", + "type": "object", + "description": "A network interface resource attached to an instance.", + "properties": { + "accessConfigs": { + "type": "array", + "description": "Array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.", + "items": { + "$ref": "AccessConfig" + } + }, + "name": { + "type": "string", + "description": "Name of the network interface, determined by the server; for network devices, these are e.g. eth0, eth1, etc. (output only)." + }, + "network": { + "type": "string", + "description": "URL of the network resource attached to this interface.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "networkIP": { + "type": "string", + "description": "An optional IPV4 internal network address assigned to the instance for this network interface (output only)." + } + } + }, + "NetworkList": { + "id": "NetworkList", + "type": "object", + "description": "Contains a list of network resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The network resources.", + "items": { + "$ref": "Network" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#networkList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "An operation resource, used to manage asynchronous API requests.", + "properties": { + "clientOperationId": { + "type": "string", + "description": "An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only)." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "endTime": { + "type": "string", + "description": "The time that this operation was completed. This is in RFC 3339 format (output only)." + }, + "error": { + "type": "object", + "description": "If errors occurred during processing of this operation, this field will be populated (output only).", + "properties": { + "errors": { + "type": "array", + "description": "The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "An optional, human-readable error message." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only)." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "If operation fails, the HTTP error status code returned, e.g. 404. (output only).", + "format": "int32" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "The time that this operation was requested. This is in RFC 3339 format (output only)." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#operation" + }, + "name": { + "type": "string", + "description": "Name of the resource (output only)." + }, + "operationType": { + "type": "string", + "description": "Type of the operation. Examples include \"insert\", \"update\", and \"delete\" (output only)." + }, + "progress": { + "type": "integer", + "description": "An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only).", + "format": "int32" + }, + "region": { + "type": "string", + "description": "URL of the region where the operation resides (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "startTime": { + "type": "string", + "description": "The time that this operation was started by the server. This is in RFC 3339 format (output only)." + }, + "status": { + "type": "string", + "description": "Status of the operation. Can be one of the following: \"PENDING\", \"RUNNING\", or \"DONE\" (output only)." + }, + "statusMessage": { + "type": "string", + "description": "An optional textual description of the current status of the operation (output only)." + }, + "targetId": { + "type": "string", + "description": "Unique target id which identifies a particular incarnation of the target (output only).", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "URL of the resource the operation is mutating (output only)." + }, + "user": { + "type": "string", + "description": "User who requested the operation, for example \"user@example.com\" (output only)." + }, + "warnings": { + "type": "array", + "description": "If warning messages generated during processing of this operation, this field will be populated (output only).", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning." + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + }, + "zone": { + "type": "string", + "description": "URL of the zone where the operation resides (output only)." + } + } + }, + "OperationAggregatedList": { + "id": "OperationAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped operation lists.", + "additionalProperties": { + "$ref": "OperationsScopedList", + "description": "Name of the scope containing this set of operations." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#operationAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "OperationList": { + "id": "OperationList", + "type": "object", + "description": "Contains a list of operation resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The operation resources.", + "items": { + "$ref": "Operation" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#operationList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "OperationsScopedList": { + "id": "OperationsScopedList", + "type": "object", + "properties": { + "operations": { + "type": "array", + "description": "List of operations contained in this scope.", + "items": { + "$ref": "Operation" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of operations when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning." + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "Project": { + "id": "Project", + "type": "object", + "description": "A project resource. Projects can be created only in the APIs Console. Unless marked otherwise, values can only be modified in the console.", + "properties": { + "commonInstanceMetadata": { + "$ref": "Metadata", + "description": "Metadata key/value pairs available to all instances contained in this project." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#project" + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "quotas": { + "type": "array", + "description": "Quotas assigned to this project.", + "items": { + "$ref": "Quota" + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "Quota": { + "id": "Quota", + "type": "object", + "description": "A quotas entry.", + "properties": { + "limit": { + "type": "number", + "description": "Quota limit for this metric.", + "format": "double" + }, + "metric": { + "type": "string", + "description": "Name of the quota metric." + }, + "usage": { + "type": "number", + "description": "Current usage of this metric.", + "format": "double" + } + } + }, + "Region": { + "id": "Region", + "type": "object", + "description": "Region resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this region." + }, + "description": { + "type": "string", + "description": "Textual description of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#region" + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "quotas": { + "type": "array", + "description": "Quotas assigned to this region.", + "items": { + "$ref": "Quota" + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "status": { + "type": "string", + "description": "Status of the region, \"UP\" or \"DOWN\"." + }, + "zones": { + "type": "array", + "description": "A list of zones homed in this region, in the form of resource URLs.", + "items": { + "type": "string" + } + } + } + }, + "RegionList": { + "id": "RegionList", + "type": "object", + "description": "Contains a list of region resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The region resources.", + "items": { + "$ref": "Region" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#regionList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Route": { + "id": "Route", + "type": "object", + "description": "The route resource. A Route is a rule that specifies how certain packets should be handled by the virtual network. Routes are associated with VMs by tag and the set of Routes for a particular VM is called its routing table. For each packet leaving a VM, the system searches that VM's routing table for a single best matching Route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the Route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching Routes. The packet is then forwarded as specified by the next_hop field of the winning Route -- either to another VM destination, a VM gateway or a GCE operated gateway. Packets that do not match any Route in the sending VM's routing table will be dropped.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "destRange": { + "type": "string", + "description": "Which packets does this route apply to?", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#route" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "network": { + "type": "string", + "description": "URL of the network to which this route is applied; provided by the client when the route is created.", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "nextHopGateway": { + "type": "string", + "description": "The URL to a gateway that should handle matching packets." + }, + "nextHopInstance": { + "type": "string", + "description": "The URL to an instance that should handle matching packets." + }, + "nextHopIp": { + "type": "string", + "description": "The network IP address of an instance that should handle matching packets." + }, + "nextHopNetwork": { + "type": "string", + "description": "The URL of the local network if it should handle matching packets." + }, + "priority": { + "type": "integer", + "description": "Breaks ties between Routes of equal specificity. Routes with smaller values win when tied with routes with larger values.", + "format": "uint32", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "tags": { + "type": "array", + "description": "A list of instance tags to which this route applies.", + "items": { + "type": "string" + }, + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "warnings": { + "type": "array", + "description": "If potential misconfigurations are detected for this route, this field will be populated with warning messages.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning." + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + } + }, + "RouteList": { + "id": "RouteList", + "type": "object", + "description": "Contains a list of route resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The route resources.", + "items": { + "$ref": "Route" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#routeList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "SerialPortOutput": { + "id": "SerialPortOutput", + "type": "object", + "description": "An instance serial console output.", + "properties": { + "contents": { + "type": "string", + "description": "The contents of the console output." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#serialPortOutput" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "ServiceAccount": { + "id": "ServiceAccount", + "type": "object", + "description": "A service account.", + "properties": { + "email": { + "type": "string", + "description": "Email address of the service account." + }, + "scopes": { + "type": "array", + "description": "The list of scopes to be made available for this service account.", + "items": { + "type": "string" + } + } + } + }, + "Snapshot": { + "id": "Snapshot", + "type": "object", + "description": "A persistent disk snapshot resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "diskSizeGb": { + "type": "string", + "description": "Size of the persistent disk snapshot, specified in GB (output only).", + "format": "int64" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#snapshot" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sourceDisk": { + "type": "string", + "description": "The source disk used to create this snapshot. Once the source disk has been deleted from the system, this field will be cleared, and will not be set even if a disk with the same name has been re-created (output only)." + }, + "sourceDiskId": { + "type": "string", + "description": "The 'id' value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name." + }, + "status": { + "type": "string", + "description": "The status of the persistent disk snapshot (output only)." + } + } + }, + "SnapshotList": { + "id": "SnapshotList", + "type": "object", + "description": "Contains a list of persistent disk snapshot resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The persistent snapshot resources.", + "items": { + "$ref": "Snapshot" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#snapshotList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Tags": { + "id": "Tags", + "type": "object", + "description": "A set of instance tags.", + "properties": { + "fingerprint": { + "type": "string", + "description": "Fingerprint of this resource. A hash of the tags stored in this object. This field is used optimistic locking. An up-to-date tags fingerprint must be provided in order to modify tags.", + "format": "byte" + }, + "items": { + "type": "array", + "description": "An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.", + "items": { + "type": "string" + } + } + } + }, + "TargetPool": { + "id": "TargetPool", + "type": "object", + "description": "A TargetPool resource. This resource defines a pool of VMs, associated HttpHealthCheck resources, and the fallback TargetPool.", + "properties": { + "backupPool": { + "type": "string", + "description": "This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its 'failoverRatio' field is properly set to a value between [0, 1].\n\n'backupPool' and 'failoverRatio' together define the fallback behavior of the primary target pool: if the ratio of the healthy VMs in the primary pool is at or below 'failoverRatio', traffic arriving at the load-balanced IP will be directed to the backup pool.\n\nIn case where 'failoverRatio' and 'backupPool' are not set, or all the VMs in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the \"force\" mode, where traffic will be spread to the healthy VMs with the best effort, or to all VMs when no VM is healthy." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "failoverRatio": { + "type": "number", + "description": "This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some other target pool). The value of the field must be in [0, 1].\n\nIf set, 'backupPool' must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy VMs in the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool.\n\nIn case where 'failoverRatio' is not set or all the VMs in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the \"force\" mode, where traffic will be spread to the healthy VMs with the best effort, or to all VMs when no VM is healthy.", + "format": "float" + }, + "healthChecks": { + "type": "array", + "description": "A list of URLs to the HttpHealthCheck resource. A member VM in this pool is considered healthy if and only if all specified health checks pass. An empty list means all member VMs will be considered healthy at all times.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "instances": { + "type": "array", + "description": "A list of resource URLs to the member VMs serving this pool. They must live in zones contained in the same region as this pool.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#targetPool" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "region": { + "type": "string", + "description": "URL of the region where the target pool resides (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sessionAffinity": { + "type": "string", + "description": "Sesssion affinity option, must be one of the following values: 'NONE': Connections from the same client IP may go to any VM in the pool; 'CLIENT_IP': Connections from the same client IP will go to the same VM in the pool while that VM remains healthy. 'CLIENT_IP_PROTO': Connections from the same client IP with the same IP protocol will go to the same VM in the pool while that VM remains healthy." + } + } + }, + "TargetPoolAggregatedList": { + "id": "TargetPoolAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped target pool lists.", + "additionalProperties": { + "$ref": "TargetPoolsScopedList", + "description": "Name of the scope containing this set of target pools." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetPoolAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "TargetPoolInstanceHealth": { + "id": "TargetPoolInstanceHealth", + "type": "object", + "properties": { + "healthStatus": { + "type": "array", + "items": { + "$ref": "HealthStatus" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetPoolInstanceHealth" + } + } + }, + "TargetPoolList": { + "id": "TargetPoolList", + "type": "object", + "description": "Contains a list of TargetPool resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The TargetPool resources.", + "items": { + "$ref": "TargetPool" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetPoolList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "TargetPoolsScopedList": { + "id": "TargetPoolsScopedList", + "type": "object", + "properties": { + "targetPools": { + "type": "array", + "description": "List of target pools contained in this scope.", + "items": { + "$ref": "TargetPool" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of addresses when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning." + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "TargetReference": { + "id": "TargetReference", + "type": "object", + "properties": { + "target": { + "type": "string" + } + } + }, + "Zone": { + "id": "Zone", + "type": "object", + "description": "A zone resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this zone." + }, + "description": { + "type": "string", + "description": "Textual description of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#zone" + }, + "maintenanceWindows": { + "type": "array", + "description": "Scheduled maintenance windows for the zone. When the zone is in a maintenance window, all resources which reside in the zone will be unavailable.", + "items": { + "type": "object", + "properties": { + "beginTime": { + "type": "string", + "description": "Begin time of the maintenance window, in RFC 3339 format." + }, + "description": { + "type": "string", + "description": "Textual description of the maintenance window." + }, + "endTime": { + "type": "string", + "description": "End time of the maintenance window, in RFC 3339 format." + }, + "name": { + "type": "string", + "description": "Name of the maintenance window." + } + } + } + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "quotas": { + "type": "array", + "description": "Quotas assigned to this zone.", + "items": { + "$ref": "Quota" + } + }, + "region": { + "type": "string", + "description": "Full URL reference to the region which hosts the zone (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "status": { + "type": "string", + "description": "Status of the zone. \"UP\" or \"DOWN\"." + } + } + }, + "ZoneList": { + "id": "ZoneList", + "type": "object", + "description": "Contains a list of zone resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The zone resources.", + "items": { + "$ref": "Zone" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#zoneList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + } + }, + "resources": { + "addresses": { + "methods": { + "aggregatedList": { + "id": "compute.addresses.aggregatedList", + "path": "{project}/aggregated/addresses", + "httpMethod": "GET", + "description": "Retrieves the list of addresses grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "AddressAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.addresses.delete", + "path": "{project}/regions/{region}/addresses/{address}", + "httpMethod": "DELETE", + "description": "Deletes the specified address resource.", + "parameters": { + "address": { + "type": "string", + "description": "Name of the address resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "address" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.addresses.get", + "path": "{project}/regions/{region}/addresses/{address}", + "httpMethod": "GET", + "description": "Returns the specified address resource.", + "parameters": { + "address": { + "type": "string", + "description": "Name of the address resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "address" + ], + "response": { + "$ref": "Address" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.addresses.insert", + "path": "{project}/regions/{region}/addresses", + "httpMethod": "POST", + "description": "Creates an address resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "request": { + "$ref": "Address" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.addresses.list", + "path": "{project}/regions/{region}/addresses", + "httpMethod": "GET", + "description": "Retrieves the list of address resources contained within the specified region.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "AddressList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "disks": { + "methods": { + "aggregatedList": { + "id": "compute.disks.aggregatedList", + "path": "{project}/aggregated/disks", + "httpMethod": "GET", + "description": "Retrieves the list of disks grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "DiskAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "createSnapshot": { + "id": "compute.disks.createSnapshot", + "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot", + "httpMethod": "POST", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "disk" + ], + "request": { + "$ref": "Snapshot" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "delete": { + "id": "compute.disks.delete", + "path": "{project}/zones/{zone}/disks/{disk}", + "httpMethod": "DELETE", + "description": "Deletes the specified persistent disk resource.", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "disk" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.disks.get", + "path": "{project}/zones/{zone}/disks/{disk}", + "httpMethod": "GET", + "description": "Returns the specified persistent disk resource.", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "disk" + ], + "response": { + "$ref": "Disk" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.disks.insert", + "path": "{project}/zones/{zone}/disks", + "httpMethod": "POST", + "description": "Creates a persistent disk resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "sourceImage": { + "type": "string", + "description": "Optional. Source image to restore onto a disk.", + "location": "query" + }, + "zone": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "Disk" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.disks.list", + "path": "{project}/zones/{zone}/disks", + "httpMethod": "GET", + "description": "Retrieves the list of persistent disk resources contained within the specified zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "DiskList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "firewalls": { + "methods": { + "delete": { + "id": "compute.firewalls.delete", + "path": "{project}/global/firewalls/{firewall}", + "httpMethod": "DELETE", + "description": "Deletes the specified firewall resource.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.firewalls.get", + "path": "{project}/global/firewalls/{firewall}", + "httpMethod": "GET", + "description": "Returns the specified firewall resource.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "response": { + "$ref": "Firewall" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.firewalls.insert", + "path": "{project}/global/firewalls", + "httpMethod": "POST", + "description": "Creates a firewall resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Firewall" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.firewalls.list", + "path": "{project}/global/firewalls", + "httpMethod": "GET", + "description": "Retrieves the list of firewall resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "FirewallList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.firewalls.patch", + "path": "{project}/global/firewalls/{firewall}", + "httpMethod": "PATCH", + "description": "Updates the specified firewall resource with the data included in the request. This method supports patch semantics.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "request": { + "$ref": "Firewall" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "compute.firewalls.update", + "path": "{project}/global/firewalls/{firewall}", + "httpMethod": "PUT", + "description": "Updates the specified firewall resource with the data included in the request.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "request": { + "$ref": "Firewall" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "forwardingRules": { + "methods": { + "aggregatedList": { + "id": "compute.forwardingRules.aggregatedList", + "path": "{project}/aggregated/forwardingRules", + "httpMethod": "GET", + "description": "Retrieves the list of forwarding rules grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "ForwardingRuleAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.forwardingRules.delete", + "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}", + "httpMethod": "DELETE", + "description": "Deletes the specified ForwardingRule resource.", + "parameters": { + "forwardingRule": { + "type": "string", + "description": "Name of the ForwardingRule resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "forwardingRule" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.forwardingRules.get", + "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}", + "httpMethod": "GET", + "description": "Returns the specified ForwardingRule resource.", + "parameters": { + "forwardingRule": { + "type": "string", + "description": "Name of the ForwardingRule resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "forwardingRule" + ], + "response": { + "$ref": "ForwardingRule" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.forwardingRules.insert", + "path": "{project}/regions/{region}/forwardingRules", + "httpMethod": "POST", + "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "request": { + "$ref": "ForwardingRule" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.forwardingRules.list", + "path": "{project}/regions/{region}/forwardingRules", + "httpMethod": "GET", + "description": "Retrieves the list of ForwardingRule resources available to the specified project and region.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "ForwardingRuleList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "setTarget": { + "id": "compute.forwardingRules.setTarget", + "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget", + "httpMethod": "POST", + "description": "Changes target url for forwarding rule.", + "parameters": { + "forwardingRule": { + "type": "string", + "description": "Name of the ForwardingRule resource in which target is to be set.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "forwardingRule" + ], + "request": { + "$ref": "TargetReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "globalOperations": { + "methods": { + "aggregatedList": { + "id": "compute.globalOperations.aggregatedList", + "path": "{project}/aggregated/operations", + "httpMethod": "GET", + "description": "Retrieves the list of all operations grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "OperationAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.globalOperations.delete", + "path": "{project}/global/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "operation" + ], + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.globalOperations.get", + "path": "{project}/global/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "operation" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.globalOperations.list", + "path": "{project}/global/operations", + "httpMethod": "GET", + "description": "Retrieves the list of operation resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "OperationList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "httpHealthChecks": { + "methods": { + "delete": { + "id": "compute.httpHealthChecks.delete", + "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + "httpMethod": "DELETE", + "description": "Deletes the specified HttpHealthCheck resource.", + "parameters": { + "httpHealthCheck": { + "type": "string", + "description": "Name of the HttpHealthCheck resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "httpHealthCheck" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.httpHealthChecks.get", + "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + "httpMethod": "GET", + "description": "Returns the specified HttpHealthCheck resource.", + "parameters": { + "httpHealthCheck": { + "type": "string", + "description": "Name of the HttpHealthCheck resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "httpHealthCheck" + ], + "response": { + "$ref": "HttpHealthCheck" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.httpHealthChecks.insert", + "path": "{project}/global/httpHealthChecks", + "httpMethod": "POST", + "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "HttpHealthCheck" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.httpHealthChecks.list", + "path": "{project}/global/httpHealthChecks", + "httpMethod": "GET", + "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "HttpHealthCheckList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.httpHealthChecks.patch", + "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + "httpMethod": "PATCH", + "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + "parameters": { + "httpHealthCheck": { + "type": "string", + "description": "Name of the HttpHealthCheck resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "httpHealthCheck" + ], + "request": { + "$ref": "HttpHealthCheck" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "compute.httpHealthChecks.update", + "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + "httpMethod": "PUT", + "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.", + "parameters": { + "httpHealthCheck": { + "type": "string", + "description": "Name of the HttpHealthCheck resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "httpHealthCheck" + ], + "request": { + "$ref": "HttpHealthCheck" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "images": { + "methods": { + "delete": { + "id": "compute.images.delete", + "path": "{project}/global/images/{image}", + "httpMethod": "DELETE", + "description": "Deletes the specified image resource.", + "parameters": { + "image": { + "type": "string", + "description": "Name of the image resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "image" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "deprecate": { + "id": "compute.images.deprecate", + "path": "{project}/global/images/{image}/deprecate", + "httpMethod": "POST", + "description": "Sets the deprecation status of an image. If no message body is given, clears the deprecation status instead.", + "parameters": { + "image": { + "type": "string", + "description": "Image name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "image" + ], + "request": { + "$ref": "DeprecationStatus" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.images.get", + "path": "{project}/global/images/{image}", + "httpMethod": "GET", + "description": "Returns the specified image resource.", + "parameters": { + "image": { + "type": "string", + "description": "Name of the image resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "image" + ], + "response": { + "$ref": "Image" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.images.insert", + "path": "{project}/global/images", + "httpMethod": "POST", + "description": "Creates an image resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Image" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "list": { + "id": "compute.images.list", + "path": "{project}/global/images", + "httpMethod": "GET", + "description": "Retrieves the list of image resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "ImageList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "instances": { + "methods": { + "addAccessConfig": { + "id": "compute.instances.addAccessConfig", + "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig", + "httpMethod": "POST", + "description": "Adds an access config to an instance's network interface.", + "parameters": { + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "networkInterface": { + "type": "string", + "description": "Network interface name.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance", + "networkInterface" + ], + "request": { + "$ref": "AccessConfig" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "aggregatedList": { + "id": "compute.instances.aggregatedList", + "path": "{project}/aggregated/instances", + "httpMethod": "GET", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "InstanceAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "attachDisk": { + "id": "compute.instances.attachDisk", + "path": "{project}/zones/{zone}/instances/{instance}/attachDisk", + "httpMethod": "POST", + "description": "Attaches a disk resource to an instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "request": { + "$ref": "AttachedDisk" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "delete": { + "id": "compute.instances.delete", + "path": "{project}/zones/{zone}/instances/{instance}", + "httpMethod": "DELETE", + "description": "Deletes the specified instance resource.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "deleteAccessConfig": { + "id": "compute.instances.deleteAccessConfig", + "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig", + "httpMethod": "POST", + "description": "Deletes an access config from an instance's network interface.", + "parameters": { + "accessConfig": { + "type": "string", + "description": "Access config name.", + "required": true, + "location": "query" + }, + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "networkInterface": { + "type": "string", + "description": "Network interface name.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance", + "accessConfig", + "networkInterface" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "detachDisk": { + "id": "compute.instances.detachDisk", + "path": "{project}/zones/{zone}/instances/{instance}/detachDisk", + "httpMethod": "POST", + "description": "Detaches a disk from an instance.", + "parameters": { + "deviceName": { + "type": "string", + "description": "Disk device name to detach.", + "required": true, + "pattern": "\\w[\\w.-]{0,254}", + "location": "query" + }, + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance", + "deviceName" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.instances.get", + "path": "{project}/zones/{zone}/instances/{instance}", + "httpMethod": "GET", + "description": "Returns the specified instance resource.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "Instance" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "getSerialPortOutput": { + "id": "compute.instances.getSerialPortOutput", + "path": "{project}/zones/{zone}/instances/{instance}/serialPort", + "httpMethod": "GET", + "description": "Returns the specified instance's serial port output.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "SerialPortOutput" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.instances.insert", + "path": "{project}/zones/{zone}/instances", + "httpMethod": "POST", + "description": "Creates an instance resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "Instance" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.instances.list", + "path": "{project}/zones/{zone}/instances", + "httpMethod": "GET", + "description": "Retrieves the list of instance resources contained within the specified zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "InstanceList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "reset": { + "id": "compute.instances.reset", + "path": "{project}/zones/{zone}/instances/{instance}/reset", + "httpMethod": "POST", + "description": "Performs a hard reset on the instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "setMetadata": { + "id": "compute.instances.setMetadata", + "path": "{project}/zones/{zone}/instances/{instance}/setMetadata", + "httpMethod": "POST", + "description": "Sets metadata for the specified instance to the data included in the request.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "request": { + "$ref": "Metadata" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "setTags": { + "id": "compute.instances.setTags", + "path": "{project}/zones/{zone}/instances/{instance}/setTags", + "httpMethod": "POST", + "description": "Sets tags for the specified instance to the data included in the request.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "request": { + "$ref": "Tags" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "kernels": { + "methods": { + "get": { + "id": "compute.kernels.get", + "path": "{project}/global/kernels/{kernel}", + "httpMethod": "GET", + "description": "Returns the specified kernel resource.", + "parameters": { + "kernel": { + "type": "string", + "description": "Name of the kernel resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "kernel" + ], + "response": { + "$ref": "Kernel" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.kernels.list", + "path": "{project}/global/kernels", + "httpMethod": "GET", + "description": "Retrieves the list of kernel resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "KernelList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "machineTypes": { + "methods": { + "aggregatedList": { + "id": "compute.machineTypes.aggregatedList", + "path": "{project}/aggregated/machineTypes", + "httpMethod": "GET", + "description": "Retrieves the list of machine type resources grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "MachineTypeAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "get": { + "id": "compute.machineTypes.get", + "path": "{project}/zones/{zone}/machineTypes/{machineType}", + "httpMethod": "GET", + "description": "Returns the specified machine type resource.", + "parameters": { + "machineType": { + "type": "string", + "description": "Name of the machine type resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "machineType" + ], + "response": { + "$ref": "MachineType" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.machineTypes.list", + "path": "{project}/zones/{zone}/machineTypes", + "httpMethod": "GET", + "description": "Retrieves the list of machine type resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "MachineTypeList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "networks": { + "methods": { + "delete": { + "id": "compute.networks.delete", + "path": "{project}/global/networks/{network}", + "httpMethod": "DELETE", + "description": "Deletes the specified network resource.", + "parameters": { + "network": { + "type": "string", + "description": "Name of the network resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "network" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.networks.get", + "path": "{project}/global/networks/{network}", + "httpMethod": "GET", + "description": "Returns the specified network resource.", + "parameters": { + "network": { + "type": "string", + "description": "Name of the network resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "network" + ], + "response": { + "$ref": "Network" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.networks.insert", + "path": "{project}/global/networks", + "httpMethod": "POST", + "description": "Creates a network resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Network" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.networks.list", + "path": "{project}/global/networks", + "httpMethod": "GET", + "description": "Retrieves the list of network resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "NetworkList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "projects": { + "methods": { + "get": { + "id": "compute.projects.get", + "path": "{project}", + "httpMethod": "GET", + "description": "Returns the specified project resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project resource to retrieve.", + "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": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "setCommonInstanceMetadata": { + "id": "compute.projects.setCommonInstanceMetadata", + "path": "{project}/setCommonInstanceMetadata", + "httpMethod": "POST", + "description": "Sets metadata common to all instances within the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Metadata" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "regionOperations": { + "methods": { + "delete": { + "id": "compute.regionOperations.delete", + "path": "{project}/regions/{region}/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified region-specific operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "operation" + ], + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.regionOperations.get", + "path": "{project}/regions/{region}/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified region-specific operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "operation" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.regionOperations.list", + "path": "{project}/regions/{region}/operations", + "httpMethod": "GET", + "description": "Retrieves the list of operation resources contained within the specified region.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "OperationList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "regions": { + "methods": { + "get": { + "id": "compute.regions.get", + "path": "{project}/regions/{region}", + "httpMethod": "GET", + "description": "Returns the specified region resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "Region" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.regions.list", + "path": "{project}/regions", + "httpMethod": "GET", + "description": "Retrieves the list of region resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "RegionList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "routes": { + "methods": { + "delete": { + "id": "compute.routes.delete", + "path": "{project}/global/routes/{route}", + "httpMethod": "DELETE", + "description": "Deletes the specified route resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "route": { + "type": "string", + "description": "Name of the route resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "route" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.routes.get", + "path": "{project}/global/routes/{route}", + "httpMethod": "GET", + "description": "Returns the specified route resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "route": { + "type": "string", + "description": "Name of the route resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "route" + ], + "response": { + "$ref": "Route" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.routes.insert", + "path": "{project}/global/routes", + "httpMethod": "POST", + "description": "Creates a route resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Route" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.routes.list", + "path": "{project}/global/routes", + "httpMethod": "GET", + "description": "Retrieves the list of route resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "RouteList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "snapshots": { + "methods": { + "delete": { + "id": "compute.snapshots.delete", + "path": "{project}/global/snapshots/{snapshot}", + "httpMethod": "DELETE", + "description": "Deletes the specified persistent disk snapshot resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "snapshot": { + "type": "string", + "description": "Name of the persistent disk snapshot resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "snapshot" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.snapshots.get", + "path": "{project}/global/snapshots/{snapshot}", + "httpMethod": "GET", + "description": "Returns the specified persistent disk snapshot resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "snapshot": { + "type": "string", + "description": "Name of the persistent disk snapshot resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "snapshot" + ], + "response": { + "$ref": "Snapshot" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.snapshots.list", + "path": "{project}/global/snapshots", + "httpMethod": "GET", + "description": "Retrieves the list of persistent disk snapshot resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "SnapshotList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "targetPools": { + "methods": { + "addHealthCheck": { + "id": "compute.targetPools.addHealthCheck", + "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck", + "httpMethod": "POST", + "description": "Adds health check URL to targetPool.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to which health_check_url is to be added.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "request": { + "$ref": "HealthCheckReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "addInstance": { + "id": "compute.targetPools.addInstance", + "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance", + "httpMethod": "POST", + "description": "Adds instance url to targetPool.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to which instance_url is to be added.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "request": { + "$ref": "InstanceReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "aggregatedList": { + "id": "compute.targetPools.aggregatedList", + "path": "{project}/aggregated/targetPools", + "httpMethod": "GET", + "description": "Retrieves the list of target pools grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "TargetPoolAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.targetPools.delete", + "path": "{project}/regions/{region}/targetPools/{targetPool}", + "httpMethod": "DELETE", + "description": "Deletes the specified TargetPool resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.targetPools.get", + "path": "{project}/regions/{region}/targetPools/{targetPool}", + "httpMethod": "GET", + "description": "Returns the specified TargetPool resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "response": { + "$ref": "TargetPool" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "getHealth": { + "id": "compute.targetPools.getHealth", + "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth", + "httpMethod": "POST", + "description": "Gets the most recent health check results for each IP for the given instance that is referenced by given TargetPool.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to which the queried instance belongs.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "request": { + "$ref": "InstanceReference" + }, + "response": { + "$ref": "TargetPoolInstanceHealth" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.targetPools.insert", + "path": "{project}/regions/{region}/targetPools", + "httpMethod": "POST", + "description": "Creates a TargetPool resource in the specified project and region using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "request": { + "$ref": "TargetPool" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.targetPools.list", + "path": "{project}/regions/{region}/targetPools", + "httpMethod": "GET", + "description": "Retrieves the list of TargetPool resources available to the specified project and region.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "TargetPoolList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "removeHealthCheck": { + "id": "compute.targetPools.removeHealthCheck", + "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck", + "httpMethod": "POST", + "description": "Removes health check URL from targetPool.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to which health_check_url is to be removed.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "request": { + "$ref": "HealthCheckReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "removeInstance": { + "id": "compute.targetPools.removeInstance", + "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance", + "httpMethod": "POST", + "description": "Removes instance URL from targetPool.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to which instance_url is to be removed.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "request": { + "$ref": "InstanceReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "setBackup": { + "id": "compute.targetPools.setBackup", + "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup", + "httpMethod": "POST", + "description": "Changes backup pool configurations.", + "parameters": { + "failoverRatio": { + "type": "number", + "description": "New failoverRatio value for the containing target pool.", + "format": "float", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource for which the backup is to be set.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "request": { + "$ref": "TargetReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "zoneOperations": { + "methods": { + "delete": { + "id": "compute.zoneOperations.delete", + "path": "{project}/zones/{zone}/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified zone-specific operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "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": "compute.zoneOperations.get", + "path": "{project}/zones/{zone}/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified zone-specific operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "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": "compute.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", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "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": { + "get": { + "id": "compute.zones.get", + "path": "{project}/zones/{zone}", + "httpMethod": "GET", + "description": "Returns the specified zone resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "Zone" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.zones.list", + "path": "{project}/zones", + "httpMethod": "GET", + "description": "Retrieves the list of zone resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta15/compute-gen.go b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta15/compute-gen.go new file mode 100644 index 0000000000000..5f08be9ef9b5e --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta15/compute-gen.go @@ -0,0 +1,10787 @@ +// Package compute provides access to the Compute Engine API. +// +// See https://developers.google.com/compute/docs/reference/v1beta15 +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/compute/v1beta15" +// ... +// computeService, err := compute.New(oauthHttpClient) +package compute + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "compute:v1beta15" +const apiName = "compute" +const apiVersion = "v1beta15" +const basePath = "https://www.googleapis.com/compute/v1beta15/projects/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Google Compute Engine resources + ComputeScope = "https://www.googleapis.com/auth/compute" + + // View your Google Compute Engine resources + ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly" + + // Manage your data and permissions in Google Cloud Storage + DevstorageFull_controlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageRead_onlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageRead_writeScope = "https://www.googleapis.com/auth/devstorage.read_write" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client} + s.Addresses = NewAddressesService(s) + s.Disks = NewDisksService(s) + s.Firewalls = NewFirewallsService(s) + s.ForwardingRules = NewForwardingRulesService(s) + s.GlobalOperations = NewGlobalOperationsService(s) + s.HttpHealthChecks = NewHttpHealthChecksService(s) + s.Images = NewImagesService(s) + s.Instances = NewInstancesService(s) + s.Kernels = NewKernelsService(s) + s.MachineTypes = NewMachineTypesService(s) + s.Networks = NewNetworksService(s) + s.Projects = NewProjectsService(s) + s.RegionOperations = NewRegionOperationsService(s) + s.Regions = NewRegionsService(s) + s.Routes = NewRoutesService(s) + s.Snapshots = NewSnapshotsService(s) + s.TargetPools = NewTargetPoolsService(s) + s.ZoneOperations = NewZoneOperationsService(s) + s.Zones = NewZonesService(s) + return s, nil +} + +type Service struct { + client *http.Client + + Addresses *AddressesService + + Disks *DisksService + + Firewalls *FirewallsService + + ForwardingRules *ForwardingRulesService + + GlobalOperations *GlobalOperationsService + + HttpHealthChecks *HttpHealthChecksService + + Images *ImagesService + + Instances *InstancesService + + Kernels *KernelsService + + MachineTypes *MachineTypesService + + Networks *NetworksService + + Projects *ProjectsService + + RegionOperations *RegionOperationsService + + Regions *RegionsService + + Routes *RoutesService + + Snapshots *SnapshotsService + + TargetPools *TargetPoolsService + + ZoneOperations *ZoneOperationsService + + Zones *ZonesService +} + +func NewAddressesService(s *Service) *AddressesService { + rs := &AddressesService{s: s} + return rs +} + +type AddressesService struct { + s *Service +} + +func NewDisksService(s *Service) *DisksService { + rs := &DisksService{s: s} + return rs +} + +type DisksService struct { + s *Service +} + +func NewFirewallsService(s *Service) *FirewallsService { + rs := &FirewallsService{s: s} + return rs +} + +type FirewallsService struct { + s *Service +} + +func NewForwardingRulesService(s *Service) *ForwardingRulesService { + rs := &ForwardingRulesService{s: s} + return rs +} + +type ForwardingRulesService struct { + s *Service +} + +func NewGlobalOperationsService(s *Service) *GlobalOperationsService { + rs := &GlobalOperationsService{s: s} + return rs +} + +type GlobalOperationsService struct { + s *Service +} + +func NewHttpHealthChecksService(s *Service) *HttpHealthChecksService { + rs := &HttpHealthChecksService{s: s} + return rs +} + +type HttpHealthChecksService struct { + s *Service +} + +func NewImagesService(s *Service) *ImagesService { + rs := &ImagesService{s: s} + return rs +} + +type ImagesService struct { + s *Service +} + +func NewInstancesService(s *Service) *InstancesService { + rs := &InstancesService{s: s} + return rs +} + +type InstancesService struct { + s *Service +} + +func NewKernelsService(s *Service) *KernelsService { + rs := &KernelsService{s: s} + return rs +} + +type KernelsService struct { + s *Service +} + +func NewMachineTypesService(s *Service) *MachineTypesService { + rs := &MachineTypesService{s: s} + return rs +} + +type MachineTypesService struct { + s *Service +} + +func NewNetworksService(s *Service) *NetworksService { + rs := &NetworksService{s: s} + return rs +} + +type NetworksService struct { + s *Service +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + return rs +} + +type ProjectsService struct { + s *Service +} + +func NewRegionOperationsService(s *Service) *RegionOperationsService { + rs := &RegionOperationsService{s: s} + return rs +} + +type RegionOperationsService struct { + s *Service +} + +func NewRegionsService(s *Service) *RegionsService { + rs := &RegionsService{s: s} + return rs +} + +type RegionsService struct { + s *Service +} + +func NewRoutesService(s *Service) *RoutesService { + rs := &RoutesService{s: s} + return rs +} + +type RoutesService struct { + s *Service +} + +func NewSnapshotsService(s *Service) *SnapshotsService { + rs := &SnapshotsService{s: s} + return rs +} + +type SnapshotsService struct { + s *Service +} + +func NewTargetPoolsService(s *Service) *TargetPoolsService { + rs := &TargetPoolsService{s: s} + return rs +} + +type TargetPoolsService struct { + s *Service +} + +func NewZoneOperationsService(s *Service) *ZoneOperationsService { + rs := &ZoneOperationsService{s: s} + return rs +} + +type ZoneOperationsService struct { + s *Service +} + +func NewZonesService(s *Service) *ZonesService { + rs := &ZonesService{s: s} + return rs +} + +type ZonesService struct { + s *Service +} + +type AccessConfig struct { + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of this access configuration. + Name string `json:"name,omitempty"` + + // NatIP: An external IP address associated with this instance. Specify + // an unused static IP address available to the project. If not + // specified, the external IP will be drawn from a shared ephemeral + // pool. + NatIP string `json:"natIP,omitempty"` + + // Type: Type of configuration. Must be set to "ONE_TO_ONE_NAT". This + // configures port-for-port NAT to the internet. + Type string `json:"type,omitempty"` +} + +type Address struct { + // Address: The IP address represented by this resource. + Address string `json:"address,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Region: URL of the region where the address resides (output only). + Region string `json:"region,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Status: The status of the address (output only). + Status string `json:"status,omitempty"` + + User string `json:"user,omitempty"` +} + +type AddressAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped address lists. + Items *AddressAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type AddressAggregatedListItems struct { +} + +type AddressList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The address resources. + Items []*Address `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type AddressesScopedList struct { + // Addresses: List of addresses contained in this scope. + Addresses []*Address `json:"addresses,omitempty"` + + // Warning: Informational warning which replaces the list of addresses + // when the list is empty. + Warning *AddressesScopedListWarning `json:"warning,omitempty"` +} + +type AddressesScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*AddressesScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type AddressesScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type AttachedDisk struct { + // Boot: Indicates that this is a boot disk. VM will use the first + // partition of the disk for its root filesystem. + Boot bool `json:"boot,omitempty"` + + // DeviceName: Persistent disk only; must be unique within the instance + // when specified. This represents a unique device name that is + // reflected into the /dev/ tree of a Linux operating system running + // within the instance. If not specified, a default will be chosen by + // the system. + DeviceName string `json:"deviceName,omitempty"` + + // Index: A zero-based index to assign to this disk, where 0 is reserved + // for the boot disk. If not specified, the server will choose an + // appropriate value (output only). + Index int64 `json:"index,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Mode: The mode in which to attach this disk, either "READ_WRITE" or + // "READ_ONLY". + Mode string `json:"mode,omitempty"` + + // Source: Persistent disk only; the URL of the persistent disk + // resource. + Source string `json:"source,omitempty"` + + // Type: Type of the disk, either "SCRATCH" or "PERSISTENT". Note that + // persistent disks must be created before you can specify them here. + Type string `json:"type,omitempty"` +} + +type DeprecationStatus struct { + // Deleted: An optional RFC3339 timestamp on or after which the + // deprecation state of this resource will be changed to DELETED. + Deleted string `json:"deleted,omitempty"` + + // Deprecated: An optional RFC3339 timestamp on or after which the + // deprecation state of this resource will be changed to DEPRECATED. + Deprecated string `json:"deprecated,omitempty"` + + // Obsolete: An optional RFC3339 timestamp on or after which the + // deprecation state of this resource will be changed to OBSOLETE. + Obsolete string `json:"obsolete,omitempty"` + + // Replacement: A URL of the suggested replacement for the deprecated + // resource. The deprecated resource and its replacement must be + // resources of the same kind. + Replacement string `json:"replacement,omitempty"` + + // State: The deprecation state. Can be "DEPRECATED", "OBSOLETE", or + // "DELETED". Operations which create a new resource using a + // "DEPRECATED" resource will return successfully, but with a warning + // indicating the deprecated resource and recommending its replacement. + // New uses of "OBSOLETE" or "DELETED" resources will result in an + // error. + State string `json:"state,omitempty"` +} + +type Disk struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Options: Internal use only. + Options string `json:"options,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SizeGb: Size of the persistent disk, specified in GB. This parameter + // is optional when creating a disk from a disk image or a snapshot, + // otherwise it is required. + SizeGb int64 `json:"sizeGb,omitempty,string"` + + // SourceImage: The source image used to create this disk. Once the + // source image has been deleted from the system, this field will not be + // set, even if an image with the same name has been re-created. + SourceImage string `json:"sourceImage,omitempty"` + + // SourceImageId: The 'id' value of the image used to create this disk. + // This value may be used to determine whether the disk was created from + // the current or a previous instance of a given image. + SourceImageId string `json:"sourceImageId,omitempty"` + + // SourceSnapshot: The source snapshot used to create this disk. Once + // the source snapshot has been deleted from the system, this field will + // be cleared, and will not be set even if a snapshot with the same name + // has been re-created. + SourceSnapshot string `json:"sourceSnapshot,omitempty"` + + // SourceSnapshotId: The 'id' value of the snapshot used to create this + // disk. This value may be used to determine whether the disk was + // created from the current or a previous instance of a given disk + // snapshot. + SourceSnapshotId string `json:"sourceSnapshotId,omitempty"` + + // Status: The status of disk creation (output only). + Status string `json:"status,omitempty"` + + // Zone: URL of the zone where the disk resides (output only). + Zone string `json:"zone,omitempty"` +} + +type DiskAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped disk lists. + Items *DiskAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type DiskAggregatedListItems struct { +} + +type DiskList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The persistent disk resources. + Items []*Disk `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type DisksScopedList struct { + // Disks: List of disks contained in this scope. + Disks []*Disk `json:"disks,omitempty"` + + // Warning: Informational warning which replaces the list of disks when + // the list is empty. + Warning *DisksScopedListWarning `json:"warning,omitempty"` +} + +type DisksScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*DisksScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type DisksScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type Firewall struct { + // Allowed: The list of rules specified by this firewall. Each rule + // specifies a protocol and port-range tuple that describes a permitted + // connection. + Allowed []*FirewallAllowed `json:"allowed,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Network: URL of the network to which this firewall is applied; + // provided by the client when the firewall is created. + Network string `json:"network,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SourceRanges: A list of IP address blocks expressed in CIDR format + // which this rule applies to. One or both of sourceRanges and + // sourceTags may be set; an inbound connection is allowed if either the + // range or the tag of the source matches. + SourceRanges []string `json:"sourceRanges,omitempty"` + + // SourceTags: A list of instance tags which this rule applies to. One + // or both of sourceRanges and sourceTags may be set; an inbound + // connection is allowed if either the range or the tag of the source + // matches. + SourceTags []string `json:"sourceTags,omitempty"` + + // TargetTags: A list of instance tags indicating sets of instances + // located on network which may make network connections as specified in + // allowed. If no targetTags are specified, the firewall rule applies to + // all instances on the specified network. + TargetTags []string `json:"targetTags,omitempty"` +} + +type FirewallAllowed struct { + // IPProtocol: Required; this is the IP protocol that is allowed for + // this rule. This can either be a well known protocol string (tcp, udp + // or icmp) or the IP protocol number. + IPProtocol string `json:"IPProtocol,omitempty"` + + // Ports: An optional list of ports which are allowed. It is an error to + // specify this for any protocol that isn't UDP or TCP. Each entry must + // be either an integer or a range. If not specified, connections + // through any port are allowed. + // + // Example inputs include: ["22"], + // ["80","443"] and ["12345-12349"]. + Ports []string `json:"ports,omitempty"` +} + +type FirewallList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The firewall resources. + Items []*Firewall `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type ForwardingRule struct { + // IPAddress: Value of the reserved IP address that this forwarding rule + // is serving on behalf of. The address resource must live in the same + // region as the forwarding rule. If left empty (default value), an + // ephemeral IP will be assigned. + IPAddress string `json:"IPAddress,omitempty"` + + // IPProtocol: The IP protocol to which this rule applies, can be either + // 'TCP' or 'UDP' (If left empty, will use TCP by default). + IPProtocol string `json:"IPProtocol,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // PortRange: If 'IPProtocol' is 'TCP' or 'UDP', only packets addressed + // to ports in the specified range will be forwarded to 'target'. If + // left empty (default value), all ports are forwarded. Forwarding rules + // with the same [IPAddress, IPProtocol] pair must have disjoint port + // ranges. + PortRange string `json:"portRange,omitempty"` + + // Region: URL of the region where the forwarding rule resides (output + // only). + Region string `json:"region,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Target: The URL of the target resource to receive the matched + // traffic. It must live in the same region as this forwarding rule. + Target string `json:"target,omitempty"` +} + +type ForwardingRuleAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped forwarding rule lists. + Items *ForwardingRuleAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type ForwardingRuleAggregatedListItems struct { +} + +type ForwardingRuleList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The ForwardingRule resources. + Items []*ForwardingRule `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type ForwardingRulesScopedList struct { + // ForwardingRules: List of forwarding rules contained in this scope. + ForwardingRules []*ForwardingRule `json:"forwardingRules,omitempty"` + + // Warning: Informational warning which replaces the list of forwarding + // rules when the list is empty. + Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"` +} + +type ForwardingRulesScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type ForwardingRulesScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type HealthCheckReference struct { + HealthCheck string `json:"healthCheck,omitempty"` +} + +type HealthStatus struct { + // HealthState: Health state of the instance. + HealthState string `json:"healthState,omitempty"` + + // Instance: URL of the instance resource. + Instance string `json:"instance,omitempty"` + + // IpAddress: The IP address represented by this resource. + IpAddress string `json:"ipAddress,omitempty"` +} + +type HttpHealthCheck struct { + // CheckIntervalSec: How often (in seconds) to send a health check. The + // default value is 5 seconds. + CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // HealthyThreshold: A so-far unhealthy VM will be marked healthy after + // this many consecutive successes. The default value is 2. + HealthyThreshold int64 `json:"healthyThreshold,omitempty"` + + // Host: The value of the host header in the HTTP health check request. + // If left empty (default value), the public IP on behalf of which this + // health check is performed will be used. + Host string `json:"host,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Port: The TCP port number for the HTTP health check request. The + // default value is 80. + Port int64 `json:"port,omitempty"` + + // RequestPath: The request path of the HTTP health check request. The + // default value is "/". + RequestPath string `json:"requestPath,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // TimeoutSec: How long (in seconds) to wait before claiming failure. + // The default value is 5 seconds. + TimeoutSec int64 `json:"timeoutSec,omitempty"` + + // UnhealthyThreshold: A so-far healthy VM will be marked unhealthy + // after this many consecutive failures. The default value is 2. + UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"` +} + +type HttpHealthCheckList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The HttpHealthCheck resources. + Items []*HttpHealthCheck `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Image struct { + // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google + // Cloud Storage (in bytes). + ArchiveSizeBytes int64 `json:"archiveSizeBytes,omitempty,string"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this image. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: Textual description of the resource; provided by the + // client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // PreferredKernel: An optional URL of the preferred kernel for use with + // this disk image. If not specified, a server defined default kernel + // will be used. + PreferredKernel string `json:"preferredKernel,omitempty"` + + // RawDisk: The raw disk image parameters. + RawDisk *ImageRawDisk `json:"rawDisk,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SourceType: Must be "RAW"; provided by the client when the disk image + // is created. + SourceType string `json:"sourceType,omitempty"` + + // Status: Status of the image (output only). It will be one of the + // following READY - after image has been successfully created and is + // ready for use FAILED - if creating the image fails for some reason + // PENDING - the image creation is in progress An image can be used to + // create other resources suck as instances only after the image has + // been successfully created and the status is set to READY. + Status string `json:"status,omitempty"` +} + +type ImageRawDisk struct { + // ContainerType: The format used to encode and transmit the block + // device. Should be TAR. This is just a container and transmission + // format and not a runtime format. Provided by the client when the disk + // image is created. + ContainerType string `json:"containerType,omitempty"` + + // Sha1Checksum: An optional SHA1 checksum of the disk image before + // unpackaging; provided by the client when the disk image is created. + Sha1Checksum string `json:"sha1Checksum,omitempty"` + + // Source: The full Google Cloud Storage URL where the disk image is + // stored; provided by the client when the disk image is created. + Source string `json:"source,omitempty"` +} + +type ImageList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The disk image resources. + Items []*Image `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Instance struct { + // CanIpForward: Allows this instance to send packets with source IP + // addresses other than its own and receive packets with destination IP + // addresses other than its own. If this instance will be used as an IP + // gateway or it will be set as the next-hop in a Route resource, say + // true. If unsure, leave this set to false. + CanIpForward bool `json:"canIpForward,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Disks: Array of disks associated with this instance. Persistent disks + // must be created before you can assign them. + Disks []*AttachedDisk `json:"disks,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Image: An optional URL of the disk image resource to be installed on + // this instance; provided by the client when the instance is created. + // Alternatively to passing the image, the client may choose to boot + // from a persistent disk, by setting boot=true flag on one of the + // entries in disks[] collection. + Image string `json:"image,omitempty"` + + // Kernel: URL of the kernel resource to use when booting. In case of + // booting from persistent disk, this parameter is required. When + // booting from a disk image, it is optional, but may be provided to use + // a different kernel than the one associated with the image. + Kernel string `json:"kernel,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MachineType: URL of the machine type resource describing which + // machine type to use to host the instance; provided by the client when + // the instance is created. + MachineType string `json:"machineType,omitempty"` + + // Metadata: Metadata key/value pairs assigned to this instance. + // Consists of custom metadata or predefined keys; see Instance + // documentation for more information. + Metadata *Metadata `json:"metadata,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // NetworkInterfaces: Array of configurations for this interface. This + // specifies how this interface is configured to interact with other + // network services, such as connecting to the internet. Currently, + // ONE_TO_ONE_NAT is the only access config supported. If there are no + // accessConfigs specified, then this instance will have no external + // internet access. + NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // ServiceAccounts: A list of service accounts each with specified + // scopes, for which access tokens are to be made available to the + // instance through metadata queries. + ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"` + + // Status: Instance status. One of the following values: "PROVISIONING", + // "STAGING", "RUNNING", "STOPPING", "STOPPED", "TERMINATED" (output + // only). + Status string `json:"status,omitempty"` + + // StatusMessage: An optional, human-readable explanation of the status + // (output only). + StatusMessage string `json:"statusMessage,omitempty"` + + // Tags: A list of tags to be applied to this instance. Used to identify + // valid sources or targets for network firewalls. Provided by the + // client on instance creation. The tags can be later modified by the + // setTags method. Each tag within the list must comply with RFC1035. + Tags *Tags `json:"tags,omitempty"` + + // Zone: URL of the zone where the instance resides (output only). + Zone string `json:"zone,omitempty"` +} + +type InstanceAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped instance lists. + Items *InstanceAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type InstanceAggregatedListItems struct { +} + +type InstanceList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A list of instance resources. + Items []*Instance `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type InstanceReference struct { + Instance string `json:"instance,omitempty"` +} + +type InstancesScopedList struct { + // Instances: List of instances contained in this scope. + Instances []*Instance `json:"instances,omitempty"` + + // Warning: Informational warning which replaces the list of instances + // when the list is empty. + Warning *InstancesScopedListWarning `json:"warning,omitempty"` +} + +type InstancesScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*InstancesScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type InstancesScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type Kernel struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this kernel. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type KernelList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The kernel resources. + Items []*Kernel `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type MachineType struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this machine type. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // GuestCpus: Count of CPUs exposed to the instance. + GuestCpus int64 `json:"guestCpus,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // ImageSpaceGb: Space allotted for the image, defined in GB. + ImageSpaceGb int64 `json:"imageSpaceGb,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MaximumPersistentDisks: Maximum persistent disks allowed. + MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"` + + // MaximumPersistentDisksSizeGb: Maximum total persistent disks size + // (GB) allowed. + MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"` + + // MemoryMb: Physical memory assigned to the instance, defined in MB. + MemoryMb int64 `json:"memoryMb,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // ScratchDisks: List of extended scratch disks assigned to the + // instance. + ScratchDisks []*MachineTypeScratchDisks `json:"scratchDisks,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Zone: Url of the zone where the machine type resides (output only). + Zone string `json:"zone,omitempty"` +} + +type MachineTypeScratchDisks struct { + // DiskGb: Size of the scratch disk, defined in GB. + DiskGb int64 `json:"diskGb,omitempty"` +} + +type MachineTypeAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped machine type lists. + Items *MachineTypeAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type MachineTypeAggregatedListItems struct { +} + +type MachineTypeList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The machine type resources. + Items []*MachineType `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type MachineTypesScopedList struct { + // MachineTypes: List of machine types contained in this scope. + MachineTypes []*MachineType `json:"machineTypes,omitempty"` + + // Warning: Informational warning which replaces the list of machine + // types when the list is empty. + Warning *MachineTypesScopedListWarning `json:"warning,omitempty"` +} + +type MachineTypesScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*MachineTypesScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type MachineTypesScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type Metadata struct { + // Fingerprint: Fingerprint of this resource. A hash of the metadata's + // contents. This field is used for optimistic locking. An up-to-date + // metadata fingerprint must be provided in order to modify metadata. + Fingerprint string `json:"fingerprint,omitempty"` + + // Items: Array of key/value pairs. The total size of all keys and + // values must be less than 512 KB. + Items []*MetadataItems `json:"items,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` +} + +type MetadataItems struct { + // Key: Key for the metadata entry. Keys must conform to the following + // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is + // reflected as part of a URL in the metadata server. Additionally, to + // avoid ambiguity, keys must not conflict with any other metadata keys + // for the project. + Key string `json:"key,omitempty"` + + // Value: Value for the metadata entry. These are free-form strings, and + // only have meaning as interpreted by the image running in the + // instance. The only restriction placed on values is that their size + // must be less than or equal to 32768 bytes. + Value string `json:"value,omitempty"` +} + +type Network struct { + // IPv4Range: Required; The range of internal addresses that are legal + // on this network. This range is a CIDR specification, for example: + // 192.168.0.0/16. Provided by the client when the network is created. + IPv4Range string `json:"IPv4Range,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // GatewayIPv4: An optional address that is used for default routing to + // other networks. This must be within the range specified by IPv4Range, + // and is typically the first usable address in that range. If not + // specified, the default value is the first usable address in + // IPv4Range. + GatewayIPv4 string `json:"gatewayIPv4,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type NetworkInterface struct { + // AccessConfigs: Array of configurations for this interface. This + // specifies how this interface is configured to interact with other + // network services, such as connecting to the internet. Currently, + // ONE_TO_ONE_NAT is the only access config supported. If there are no + // accessConfigs specified, then this instance will have no external + // internet access. + AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"` + + // Name: Name of the network interface, determined by the server; for + // network devices, these are e.g. eth0, eth1, etc. (output only). + Name string `json:"name,omitempty"` + + // Network: URL of the network resource attached to this interface. + Network string `json:"network,omitempty"` + + // NetworkIP: An optional IPV4 internal network address assigned to the + // instance for this network interface (output only). + NetworkIP string `json:"networkIP,omitempty"` +} + +type NetworkList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The network resources. + Items []*Network `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Operation struct { + // ClientOperationId: An optional identifier specified by the client + // when the mutation was initiated. Must be unique for all operation + // resources in the project (output only). + ClientOperationId string `json:"clientOperationId,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // EndTime: The time that this operation was completed. This is in RFC + // 3339 format (output only). + EndTime string `json:"endTime,omitempty"` + + // Error: If errors occurred during processing of this operation, this + // field will be populated (output only). + Error *OperationError `json:"error,omitempty"` + + // HttpErrorMessage: If operation fails, the HTTP error message + // returned, e.g. NOT FOUND. (output only). + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + // HttpErrorStatusCode: If operation fails, the HTTP error status code + // returned, e.g. 404. (output only). + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: The time that this operation was requested. This is in + // RFC 3339 format (output only). + InsertTime string `json:"insertTime,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource (output only). + Name string `json:"name,omitempty"` + + // OperationType: Type of the operation. Examples include "insert", + // "update", and "delete" (output only). + OperationType string `json:"operationType,omitempty"` + + // Progress: An optional progress indicator that ranges from 0 to 100. + // There is no requirement that this be linear or support any + // granularity of operations. This should not be used to guess at when + // the operation will be complete. This number should be monotonically + // increasing as the operation progresses (output only). + Progress int64 `json:"progress,omitempty"` + + // Region: URL of the region where the operation resides (output only). + Region string `json:"region,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // StartTime: The time that this operation was started by the server. + // This is in RFC 3339 format (output only). + StartTime string `json:"startTime,omitempty"` + + // Status: Status of the operation. Can be one of the following: + // "PENDING", "RUNNING", or "DONE" (output only). + Status string `json:"status,omitempty"` + + // StatusMessage: An optional textual description of the current status + // of the operation (output only). + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetId: Unique target id which identifies a particular incarnation + // of the target (output only). + TargetId uint64 `json:"targetId,omitempty,string"` + + // TargetLink: URL of the resource the operation is mutating (output + // only). + TargetLink string `json:"targetLink,omitempty"` + + // User: User who requested the operation, for example + // "user@example.com" (output only). + User string `json:"user,omitempty"` + + // Warnings: If warning messages generated during processing of this + // operation, this field will be populated (output only). + Warnings []*OperationWarnings `json:"warnings,omitempty"` + + // Zone: URL of the zone where the operation resides (output only). + Zone string `json:"zone,omitempty"` +} + +type OperationError struct { + // Errors: The array of errors encountered while processing this + // operation. + Errors []*OperationErrorErrors `json:"errors,omitempty"` +} + +type OperationErrorErrors struct { + // Code: The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: Indicates the field in the request which caused the error. + // This property is optional. + Location string `json:"location,omitempty"` + + // Message: An optional, human-readable error message. + Message string `json:"message,omitempty"` +} + +type OperationWarnings struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*OperationWarningsData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type OperationWarningsData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type OperationAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped operation lists. + Items *OperationAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type OperationAggregatedListItems struct { +} + +type OperationList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The operation resources. + Items []*Operation `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type OperationsScopedList struct { + // Operations: List of operations contained in this scope. + Operations []*Operation `json:"operations,omitempty"` + + // Warning: Informational warning which replaces the list of operations + // when the list is empty. + Warning *OperationsScopedListWarning `json:"warning,omitempty"` +} + +type OperationsScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*OperationsScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type OperationsScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type Project struct { + // CommonInstanceMetadata: Metadata key/value pairs available to all + // instances contained in this project. + CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // Quotas: Quotas assigned to this project. + Quotas []*Quota `json:"quotas,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Quota struct { + // Limit: Quota limit for this metric. + Limit float64 `json:"limit,omitempty"` + + // Metric: Name of the quota metric. + Metric string `json:"metric,omitempty"` + + // Usage: Current usage of this metric. + Usage float64 `json:"usage,omitempty"` +} + +type Region struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this region. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: Textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // Quotas: Quotas assigned to this region. + Quotas []*Quota `json:"quotas,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Status: Status of the region, "UP" or "DOWN". + Status string `json:"status,omitempty"` + + // Zones: A list of zones homed in this region, in the form of resource + // URLs. + Zones []string `json:"zones,omitempty"` +} + +type RegionList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The region resources. + Items []*Region `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Route struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // DestRange: Which packets does this route apply to? + DestRange string `json:"destRange,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Network: URL of the network to which this route is applied; provided + // by the client when the route is created. + Network string `json:"network,omitempty"` + + // NextHopGateway: The URL to a gateway that should handle matching + // packets. + NextHopGateway string `json:"nextHopGateway,omitempty"` + + // NextHopInstance: The URL to an instance that should handle matching + // packets. + NextHopInstance string `json:"nextHopInstance,omitempty"` + + // NextHopIp: The network IP address of an instance that should handle + // matching packets. + NextHopIp string `json:"nextHopIp,omitempty"` + + // NextHopNetwork: The URL of the local network if it should handle + // matching packets. + NextHopNetwork string `json:"nextHopNetwork,omitempty"` + + // Priority: Breaks ties between Routes of equal specificity. Routes + // with smaller values win when tied with routes with larger values. + Priority int64 `json:"priority,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Tags: A list of instance tags to which this route applies. + Tags []string `json:"tags,omitempty"` + + // Warnings: If potential misconfigurations are detected for this route, + // this field will be populated with warning messages. + Warnings []*RouteWarnings `json:"warnings,omitempty"` +} + +type RouteWarnings struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*RouteWarningsData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type RouteWarningsData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type RouteList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The route resources. + Items []*Route `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type SerialPortOutput struct { + // Contents: The contents of the console output. + Contents string `json:"contents,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type ServiceAccount struct { + // Email: Email address of the service account. + Email string `json:"email,omitempty"` + + // Scopes: The list of scopes to be made available for this service + // account. + Scopes []string `json:"scopes,omitempty"` +} + +type Snapshot struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // DiskSizeGb: Size of the persistent disk snapshot, specified in GB + // (output only). + DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SourceDisk: The source disk used to create this snapshot. Once the + // source disk has been deleted from the system, this field will be + // cleared, and will not be set even if a disk with the same name has + // been re-created (output only). + SourceDisk string `json:"sourceDisk,omitempty"` + + // SourceDiskId: The 'id' value of the disk used to create this + // snapshot. This value may be used to determine whether the snapshot + // was taken from the current or a previous instance of a given disk + // name. + SourceDiskId string `json:"sourceDiskId,omitempty"` + + // Status: The status of the persistent disk snapshot (output only). + Status string `json:"status,omitempty"` +} + +type SnapshotList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The persistent snapshot resources. + Items []*Snapshot `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Tags struct { + // Fingerprint: Fingerprint of this resource. A hash of the tags stored + // in this object. This field is used optimistic locking. An up-to-date + // tags fingerprint must be provided in order to modify tags. + Fingerprint string `json:"fingerprint,omitempty"` + + // Items: An array of tags. Each tag must be 1-63 characters long, and + // comply with RFC1035. + Items []string `json:"items,omitempty"` +} + +type TargetPool struct { + // BackupPool: This field is applicable only when the containing target + // pool is serving a forwarding rule as the primary pool, and its + // 'failoverRatio' field is properly set to a value between [0, + // 1]. + // + // 'backupPool' and 'failoverRatio' together define the fallback + // behavior of the primary target pool: if the ratio of the healthy VMs + // in the primary pool is at or below 'failoverRatio', traffic arriving + // at the load-balanced IP will be directed to the backup pool. + // + // In case + // where 'failoverRatio' and 'backupPool' are not set, or all the VMs in + // the backup pool are unhealthy, the traffic will be directed back to + // the primary pool in the "force" mode, where traffic will be spread to + // the healthy VMs with the best effort, or to all VMs when no VM is + // healthy. + BackupPool string `json:"backupPool,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // FailoverRatio: This field is applicable only when the containing + // target pool is serving a forwarding rule as the primary pool (i.e., + // not as a backup pool to some other target pool). The value of the + // field must be in [0, 1]. + // + // If set, 'backupPool' must also be set. They + // together define the fallback behavior of the primary target pool: if + // the ratio of the healthy VMs in the primary pool is at or below this + // number, traffic arriving at the load-balanced IP will be directed to + // the backup pool. + // + // In case where 'failoverRatio' is not set or all the + // VMs in the backup pool are unhealthy, the traffic will be directed + // back to the primary pool in the "force" mode, where traffic will be + // spread to the healthy VMs with the best effort, or to all VMs when no + // VM is healthy. + FailoverRatio float64 `json:"failoverRatio,omitempty"` + + // HealthChecks: A list of URLs to the HttpHealthCheck resource. A + // member VM in this pool is considered healthy if and only if all + // specified health checks pass. An empty list means all member VMs will + // be considered healthy at all times. + HealthChecks []string `json:"healthChecks,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Instances: A list of resource URLs to the member VMs serving this + // pool. They must live in zones contained in the same region as this + // pool. + Instances []string `json:"instances,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Region: URL of the region where the target pool resides (output + // only). + Region string `json:"region,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SessionAffinity: Sesssion affinity option, must be one of the + // following values: 'NONE': Connections from the same client IP may go + // to any VM in the pool; 'CLIENT_IP': Connections from the same client + // IP will go to the same VM in the pool while that VM remains healthy. + // 'CLIENT_IP_PROTO': Connections from the same client IP with the same + // IP protocol will go to the same VM in the pool while that VM remains + // healthy. + SessionAffinity string `json:"sessionAffinity,omitempty"` +} + +type TargetPoolAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped target pool lists. + Items *TargetPoolAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type TargetPoolAggregatedListItems struct { +} + +type TargetPoolInstanceHealth struct { + HealthStatus []*HealthStatus `json:"healthStatus,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` +} + +type TargetPoolList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The TargetPool resources. + Items []*TargetPool `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type TargetPoolsScopedList struct { + // TargetPools: List of target pools contained in this scope. + TargetPools []*TargetPool `json:"targetPools,omitempty"` + + // Warning: Informational warning which replaces the list of addresses + // when the list is empty. + Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"` +} + +type TargetPoolsScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type TargetPoolsScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type TargetReference struct { + Target string `json:"target,omitempty"` +} + +type Zone struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this zone. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: Textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MaintenanceWindows: Scheduled maintenance windows for the zone. When + // the zone is in a maintenance window, all resources which reside in + // the zone will be unavailable. + MaintenanceWindows []*ZoneMaintenanceWindows `json:"maintenanceWindows,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // Quotas: Quotas assigned to this zone. + Quotas []*Quota `json:"quotas,omitempty"` + + // Region: Full URL reference to the region which hosts the zone (output + // only). + Region string `json:"region,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Status: Status of the zone. "UP" or "DOWN". + Status string `json:"status,omitempty"` +} + +type ZoneMaintenanceWindows struct { + // BeginTime: Begin time of the maintenance window, in RFC 3339 format. + BeginTime string `json:"beginTime,omitempty"` + + // Description: Textual description of the maintenance window. + Description string `json:"description,omitempty"` + + // EndTime: End time of the maintenance window, in RFC 3339 format. + EndTime string `json:"endTime,omitempty"` + + // Name: Name of the maintenance window. + Name string `json:"name,omitempty"` +} + +type ZoneList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The zone resources. + Items []*Zone `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +// method id "compute.addresses.aggregatedList": + +type AddressesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of addresses grouped by scope. +func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall { + c := &AddressesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AddressesAggregatedListCall) Do() (*AddressAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/aggregated/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AddressAggregatedList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of addresses grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.addresses.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/addresses", + // "response": { + // "$ref": "AddressAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.addresses.delete": + +type AddressesDeleteCall struct { + s *Service + project string + region string + address string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified address resource. +func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall { + c := &AddressesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.address = address + return c +} + +func (c *AddressesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/addresses/{address}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{address}", url.QueryEscape(c.address), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified address resource.", + // "httpMethod": "DELETE", + // "id": "compute.addresses.delete", + // "parameterOrder": [ + // "project", + // "region", + // "address" + // ], + // "parameters": { + // "address": { + // "description": "Name of the address resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/addresses/{address}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.addresses.get": + +type AddressesGetCall struct { + s *Service + project string + region string + address string + opt_ map[string]interface{} +} + +// Get: Returns the specified address resource. +func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall { + c := &AddressesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.address = address + return c +} + +func (c *AddressesGetCall) Do() (*Address, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/addresses/{address}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{address}", url.QueryEscape(c.address), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Address) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified address resource.", + // "httpMethod": "GET", + // "id": "compute.addresses.get", + // "parameterOrder": [ + // "project", + // "region", + // "address" + // ], + // "parameters": { + // "address": { + // "description": "Name of the address resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/addresses/{address}", + // "response": { + // "$ref": "Address" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.addresses.insert": + +type AddressesInsertCall struct { + s *Service + project string + region string + address *Address + opt_ map[string]interface{} +} + +// Insert: Creates an address resource in the specified project using +// the data included in the request. +func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall { + c := &AddressesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.address = address + return c +} + +func (c *AddressesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.address) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an address resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.addresses.insert", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/addresses", + // "request": { + // "$ref": "Address" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.addresses.list": + +type AddressesListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} +} + +// List: Retrieves the list of address resources contained within the +// specified region. +func (r *AddressesService) List(project string, region string) *AddressesListCall { + c := &AddressesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *AddressesListCall) Filter(filter string) *AddressesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AddressesListCall) Do() (*AddressList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AddressList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of address resources contained within the specified region.", + // "httpMethod": "GET", + // "id": "compute.addresses.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/addresses", + // "response": { + // "$ref": "AddressList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.disks.aggregatedList": + +type DisksAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of disks grouped by scope. +func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall { + c := &DisksAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *DisksAggregatedListCall) Do() (*DiskAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/aggregated/disks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DiskAggregatedList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of disks grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.disks.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/disks", + // "response": { + // "$ref": "DiskAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.disks.createSnapshot": + +type DisksCreateSnapshotCall struct { + s *Service + project string + zone string + disk string + snapshot *Snapshot + opt_ map[string]interface{} +} + +// CreateSnapshot: +func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall { + c := &DisksCreateSnapshotCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.disk = disk + c.snapshot = snapshot + return c +} + +func (c *DisksCreateSnapshotCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/disks/{disk}/createSnapshot") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{disk}", url.QueryEscape(c.disk), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "POST", + // "id": "compute.disks.createSnapshot", + // "parameterOrder": [ + // "project", + // "zone", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot", + // "request": { + // "$ref": "Snapshot" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.disks.delete": + +type DisksDeleteCall struct { + s *Service + project string + zone string + disk string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified persistent disk resource. +func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall { + c := &DisksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.disk = disk + return c +} + +func (c *DisksDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/disks/{disk}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{disk}", url.QueryEscape(c.disk), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified persistent disk resource.", + // "httpMethod": "DELETE", + // "id": "compute.disks.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks/{disk}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.disks.get": + +type DisksGetCall struct { + s *Service + project string + zone string + disk string + opt_ map[string]interface{} +} + +// Get: Returns the specified persistent disk resource. +func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall { + c := &DisksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.disk = disk + return c +} + +func (c *DisksGetCall) Do() (*Disk, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/disks/{disk}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{disk}", url.QueryEscape(c.disk), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Disk) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified persistent disk resource.", + // "httpMethod": "GET", + // "id": "compute.disks.get", + // "parameterOrder": [ + // "project", + // "zone", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks/{disk}", + // "response": { + // "$ref": "Disk" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.disks.insert": + +type DisksInsertCall struct { + s *Service + project string + zone string + disk *Disk + opt_ map[string]interface{} +} + +// Insert: Creates a persistent disk resource in the specified project +// using the data included in the request. +func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall { + c := &DisksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.disk = disk + return c +} + +// SourceImage sets the optional parameter "sourceImage": Source image +// to restore onto a disk. +func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall { + c.opt_["sourceImage"] = sourceImage + return c +} + +func (c *DisksInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["sourceImage"]; ok { + params.Set("sourceImage", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/disks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a persistent disk resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.disks.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "sourceImage": { + // "description": "Optional. Source image to restore onto a disk.", + // "location": "query", + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks", + // "request": { + // "$ref": "Disk" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.disks.list": + +type DisksListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// List: Retrieves the list of persistent disk resources contained +// within the specified zone. +func (r *DisksService) List(project string, zone string) *DisksListCall { + c := &DisksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *DisksListCall) Filter(filter string) *DisksListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *DisksListCall) PageToken(pageToken string) *DisksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *DisksListCall) Do() (*DiskList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/disks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DiskList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of persistent disk resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.disks.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks", + // "response": { + // "$ref": "DiskList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.firewalls.delete": + +type FirewallsDeleteCall struct { + s *Service + project string + firewall string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified firewall resource. +func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall { + c := &FirewallsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + return c +} + +func (c *FirewallsDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{firewall}", url.QueryEscape(c.firewall), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified firewall resource.", + // "httpMethod": "DELETE", + // "id": "compute.firewalls.delete", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls/{firewall}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.get": + +type FirewallsGetCall struct { + s *Service + project string + firewall string + opt_ map[string]interface{} +} + +// Get: Returns the specified firewall resource. +func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall { + c := &FirewallsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + return c +} + +func (c *FirewallsGetCall) Do() (*Firewall, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{firewall}", url.QueryEscape(c.firewall), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Firewall) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified firewall resource.", + // "httpMethod": "GET", + // "id": "compute.firewalls.get", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls/{firewall}", + // "response": { + // "$ref": "Firewall" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.firewalls.insert": + +type FirewallsInsertCall struct { + s *Service + project string + firewall *Firewall + opt_ map[string]interface{} +} + +// Insert: Creates a firewall resource in the specified project using +// the data included in the request. +func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall { + c := &FirewallsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + return c +} + +func (c *FirewallsInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/firewalls") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a firewall resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.firewalls.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls", + // "request": { + // "$ref": "Firewall" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.list": + +type FirewallsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of firewall resources available to the +// specified project. +func (r *FirewallsService) List(project string) *FirewallsListCall { + c := &FirewallsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *FirewallsListCall) Do() (*FirewallList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/firewalls") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(FirewallList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of firewall resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.firewalls.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls", + // "response": { + // "$ref": "FirewallList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.firewalls.patch": + +type FirewallsPatchCall struct { + s *Service + project string + firewall string + firewall2 *Firewall + opt_ map[string]interface{} +} + +// Patch: Updates the specified firewall resource with the data included +// in the request. This method supports patch semantics. +func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall { + c := &FirewallsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + c.firewall2 = firewall2 + return c +} + +func (c *FirewallsPatchCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{firewall}", url.QueryEscape(c.firewall), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified firewall resource with the data included in the request. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "compute.firewalls.patch", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls/{firewall}", + // "request": { + // "$ref": "Firewall" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.update": + +type FirewallsUpdateCall struct { + s *Service + project string + firewall string + firewall2 *Firewall + opt_ map[string]interface{} +} + +// Update: Updates the specified firewall resource with the data +// included in the request. +func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall { + c := &FirewallsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + c.firewall2 = firewall2 + return c +} + +func (c *FirewallsUpdateCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{firewall}", url.QueryEscape(c.firewall), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified firewall resource with the data included in the request.", + // "httpMethod": "PUT", + // "id": "compute.firewalls.update", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls/{firewall}", + // "request": { + // "$ref": "Firewall" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.forwardingRules.aggregatedList": + +type ForwardingRulesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of forwarding rules grouped by +// scope. +func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall { + c := &ForwardingRulesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ForwardingRulesAggregatedListCall) Do() (*ForwardingRuleAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/aggregated/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ForwardingRuleAggregatedList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of forwarding rules grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.forwardingRules.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/forwardingRules", + // "response": { + // "$ref": "ForwardingRuleAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.forwardingRules.delete": + +type ForwardingRulesDeleteCall struct { + s *Service + project string + region string + forwardingRule string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified ForwardingRule resource. +func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall { + c := &ForwardingRulesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.forwardingRule = forwardingRule + return c +} + +func (c *ForwardingRulesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/forwardingRules/{forwardingRule}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{forwardingRule}", url.QueryEscape(c.forwardingRule), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified ForwardingRule resource.", + // "httpMethod": "DELETE", + // "id": "compute.forwardingRules.delete", + // "parameterOrder": [ + // "project", + // "region", + // "forwardingRule" + // ], + // "parameters": { + // "forwardingRule": { + // "description": "Name of the ForwardingRule resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.forwardingRules.get": + +type ForwardingRulesGetCall struct { + s *Service + project string + region string + forwardingRule string + opt_ map[string]interface{} +} + +// Get: Returns the specified ForwardingRule resource. +func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall { + c := &ForwardingRulesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.forwardingRule = forwardingRule + return c +} + +func (c *ForwardingRulesGetCall) Do() (*ForwardingRule, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/forwardingRules/{forwardingRule}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{forwardingRule}", url.QueryEscape(c.forwardingRule), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ForwardingRule) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified ForwardingRule resource.", + // "httpMethod": "GET", + // "id": "compute.forwardingRules.get", + // "parameterOrder": [ + // "project", + // "region", + // "forwardingRule" + // ], + // "parameters": { + // "forwardingRule": { + // "description": "Name of the ForwardingRule resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}", + // "response": { + // "$ref": "ForwardingRule" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.forwardingRules.insert": + +type ForwardingRulesInsertCall struct { + s *Service + project string + region string + forwardingrule *ForwardingRule + opt_ map[string]interface{} +} + +// Insert: Creates a ForwardingRule resource in the specified project +// and region using the data included in the request. +func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall { + c := &ForwardingRulesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.forwardingrule = forwardingrule + return c +} + +func (c *ForwardingRulesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.forwardingRules.insert", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/forwardingRules", + // "request": { + // "$ref": "ForwardingRule" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.forwardingRules.list": + +type ForwardingRulesListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} +} + +// List: Retrieves the list of ForwardingRule resources available to the +// specified project and region. +func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall { + c := &ForwardingRulesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ForwardingRulesListCall) Do() (*ForwardingRuleList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ForwardingRuleList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of ForwardingRule resources available to the specified project and region.", + // "httpMethod": "GET", + // "id": "compute.forwardingRules.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/forwardingRules", + // "response": { + // "$ref": "ForwardingRuleList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.forwardingRules.setTarget": + +type ForwardingRulesSetTargetCall struct { + s *Service + project string + region string + forwardingRule string + targetreference *TargetReference + opt_ map[string]interface{} +} + +// SetTarget: Changes target url for forwarding rule. +func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall { + c := &ForwardingRulesSetTargetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.forwardingRule = forwardingRule + c.targetreference = targetreference + return c +} + +func (c *ForwardingRulesSetTargetCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{forwardingRule}", url.QueryEscape(c.forwardingRule), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Changes target url for forwarding rule.", + // "httpMethod": "POST", + // "id": "compute.forwardingRules.setTarget", + // "parameterOrder": [ + // "project", + // "region", + // "forwardingRule" + // ], + // "parameters": { + // "forwardingRule": { + // "description": "Name of the ForwardingRule resource in which target is to be set.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget", + // "request": { + // "$ref": "TargetReference" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalOperations.aggregatedList": + +type GlobalOperationsAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of all operations grouped by +// scope. +func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall { + c := &GlobalOperationsAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *GlobalOperationsAggregatedListCall) Do() (*OperationAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/aggregated/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OperationAggregatedList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of all operations grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.globalOperations.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/operations", + // "response": { + // "$ref": "OperationAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.globalOperations.delete": + +type GlobalOperationsDeleteCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified operation resource. +func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall { + c := &GlobalOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +func (c *GlobalOperationsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified operation resource.", + // "httpMethod": "DELETE", + // "id": "compute.globalOperations.delete", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/operations/{operation}", + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalOperations.get": + +type GlobalOperationsGetCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} +} + +// Get: Retrieves the specified operation resource. +func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall { + c := &GlobalOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +func (c *GlobalOperationsGetCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified operation resource.", + // "httpMethod": "GET", + // "id": "compute.globalOperations.get", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/operations/{operation}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.globalOperations.list": + +type GlobalOperationsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of operation resources contained within the +// specified project. +func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall { + c := &GlobalOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *GlobalOperationsListCall) Do() (*OperationList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OperationList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.globalOperations.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/operations", + // "response": { + // "$ref": "OperationList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.httpHealthChecks.delete": + +type HttpHealthChecksDeleteCall struct { + s *Service + project string + httpHealthCheck string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified HttpHealthCheck resource. +func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall { + c := &HttpHealthChecksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpHealthCheck = httpHealthCheck + return c +} + +func (c *HttpHealthChecksDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{httpHealthCheck}", url.QueryEscape(c.httpHealthCheck), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified HttpHealthCheck resource.", + // "httpMethod": "DELETE", + // "id": "compute.httpHealthChecks.delete", + // "parameterOrder": [ + // "project", + // "httpHealthCheck" + // ], + // "parameters": { + // "httpHealthCheck": { + // "description": "Name of the HttpHealthCheck resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpHealthChecks.get": + +type HttpHealthChecksGetCall struct { + s *Service + project string + httpHealthCheck string + opt_ map[string]interface{} +} + +// Get: Returns the specified HttpHealthCheck resource. +func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall { + c := &HttpHealthChecksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpHealthCheck = httpHealthCheck + return c +} + +func (c *HttpHealthChecksGetCall) Do() (*HttpHealthCheck, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{httpHealthCheck}", url.QueryEscape(c.httpHealthCheck), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(HttpHealthCheck) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified HttpHealthCheck resource.", + // "httpMethod": "GET", + // "id": "compute.httpHealthChecks.get", + // "parameterOrder": [ + // "project", + // "httpHealthCheck" + // ], + // "parameters": { + // "httpHealthCheck": { + // "description": "Name of the HttpHealthCheck resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + // "response": { + // "$ref": "HttpHealthCheck" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.httpHealthChecks.insert": + +type HttpHealthChecksInsertCall struct { + s *Service + project string + httphealthcheck *HttpHealthCheck + opt_ map[string]interface{} +} + +// Insert: Creates a HttpHealthCheck resource in the specified project +// using the data included in the request. +func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall { + c := &HttpHealthChecksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httphealthcheck = httphealthcheck + return c +} + +func (c *HttpHealthChecksInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/httpHealthChecks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.httpHealthChecks.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpHealthChecks", + // "request": { + // "$ref": "HttpHealthCheck" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpHealthChecks.list": + +type HttpHealthChecksListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of HttpHealthCheck resources available to +// the specified project. +func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall { + c := &HttpHealthChecksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *HttpHealthChecksListCall) Do() (*HttpHealthCheckList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/httpHealthChecks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(HttpHealthCheckList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.httpHealthChecks.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpHealthChecks", + // "response": { + // "$ref": "HttpHealthCheckList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.httpHealthChecks.patch": + +type HttpHealthChecksPatchCall struct { + s *Service + project string + httpHealthCheck string + httphealthcheck *HttpHealthCheck + opt_ map[string]interface{} +} + +// Patch: Updates a HttpHealthCheck resource in the specified project +// using the data included in the request. This method supports patch +// semantics. +func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall { + c := &HttpHealthChecksPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpHealthCheck = httpHealthCheck + c.httphealthcheck = httphealthcheck + return c +} + +func (c *HttpHealthChecksPatchCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{httpHealthCheck}", url.QueryEscape(c.httpHealthCheck), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "compute.httpHealthChecks.patch", + // "parameterOrder": [ + // "project", + // "httpHealthCheck" + // ], + // "parameters": { + // "httpHealthCheck": { + // "description": "Name of the HttpHealthCheck resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + // "request": { + // "$ref": "HttpHealthCheck" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpHealthChecks.update": + +type HttpHealthChecksUpdateCall struct { + s *Service + project string + httpHealthCheck string + httphealthcheck *HttpHealthCheck + opt_ map[string]interface{} +} + +// Update: Updates a HttpHealthCheck resource in the specified project +// using the data included in the request. +func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall { + c := &HttpHealthChecksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpHealthCheck = httpHealthCheck + c.httphealthcheck = httphealthcheck + return c +} + +func (c *HttpHealthChecksUpdateCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{httpHealthCheck}", url.QueryEscape(c.httpHealthCheck), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.", + // "httpMethod": "PUT", + // "id": "compute.httpHealthChecks.update", + // "parameterOrder": [ + // "project", + // "httpHealthCheck" + // ], + // "parameters": { + // "httpHealthCheck": { + // "description": "Name of the HttpHealthCheck resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + // "request": { + // "$ref": "HttpHealthCheck" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.delete": + +type ImagesDeleteCall struct { + s *Service + project string + image string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified image resource. +func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall { + c := &ImagesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + return c +} + +func (c *ImagesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/images/{image}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{image}", url.QueryEscape(c.image), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified image resource.", + // "httpMethod": "DELETE", + // "id": "compute.images.delete", + // "parameterOrder": [ + // "project", + // "image" + // ], + // "parameters": { + // "image": { + // "description": "Name of the image resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images/{image}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.deprecate": + +type ImagesDeprecateCall struct { + s *Service + project string + image string + deprecationstatus *DeprecationStatus + opt_ map[string]interface{} +} + +// Deprecate: Sets the deprecation status of an image. If no message +// body is given, clears the deprecation status instead. +func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall { + c := &ImagesDeprecateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + c.deprecationstatus = deprecationstatus + return c +} + +func (c *ImagesDeprecateCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/images/{image}/deprecate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{image}", url.QueryEscape(c.image), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the deprecation status of an image. If no message body is given, clears the deprecation status instead.", + // "httpMethod": "POST", + // "id": "compute.images.deprecate", + // "parameterOrder": [ + // "project", + // "image" + // ], + // "parameters": { + // "image": { + // "description": "Image name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images/{image}/deprecate", + // "request": { + // "$ref": "DeprecationStatus" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.get": + +type ImagesGetCall struct { + s *Service + project string + image string + opt_ map[string]interface{} +} + +// Get: Returns the specified image resource. +func (r *ImagesService) Get(project string, image string) *ImagesGetCall { + c := &ImagesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + return c +} + +func (c *ImagesGetCall) Do() (*Image, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/images/{image}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{image}", url.QueryEscape(c.image), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Image) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified image resource.", + // "httpMethod": "GET", + // "id": "compute.images.get", + // "parameterOrder": [ + // "project", + // "image" + // ], + // "parameters": { + // "image": { + // "description": "Name of the image resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images/{image}", + // "response": { + // "$ref": "Image" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.images.insert": + +type ImagesInsertCall struct { + s *Service + project string + image *Image + opt_ map[string]interface{} +} + +// Insert: Creates an image resource in the specified project using the +// data included in the request. +func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall { + c := &ImagesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + return c +} + +func (c *ImagesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.image) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/images") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an image resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.images.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images", + // "request": { + // "$ref": "Image" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "compute.images.list": + +type ImagesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of image resources available to the +// specified project. +func (r *ImagesService) List(project string) *ImagesListCall { + c := &ImagesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ImagesListCall) Filter(filter string) *ImagesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ImagesListCall) Do() (*ImageList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/images") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ImageList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of image resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.images.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images", + // "response": { + // "$ref": "ImageList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.addAccessConfig": + +type InstancesAddAccessConfigCall struct { + s *Service + project string + zone string + instance string + networkInterface string + accessconfig *AccessConfig + opt_ map[string]interface{} +} + +// AddAccessConfig: Adds an access config to an instance's network +// interface. +func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall { + c := &InstancesAddAccessConfigCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.networkInterface = networkInterface + c.accessconfig = accessconfig + return c +} + +func (c *InstancesAddAccessConfigCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + params.Set("networkInterface", fmt.Sprintf("%v", c.networkInterface)) + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/instances/{instance}/addAccessConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds an access config to an instance's network interface.", + // "httpMethod": "POST", + // "id": "compute.instances.addAccessConfig", + // "parameterOrder": [ + // "project", + // "zone", + // "instance", + // "networkInterface" + // ], + // "parameters": { + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "networkInterface": { + // "description": "Network interface name.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig", + // "request": { + // "$ref": "AccessConfig" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.aggregatedList": + +type InstancesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: +func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall { + c := &InstancesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *InstancesAggregatedListCall) Do() (*InstanceAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/aggregated/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstanceAggregatedList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "compute.instances.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/instances", + // "response": { + // "$ref": "InstanceAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.attachDisk": + +type InstancesAttachDiskCall struct { + s *Service + project string + zone string + instance string + attacheddisk *AttachedDisk + opt_ map[string]interface{} +} + +// AttachDisk: Attaches a disk resource to an instance. +func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall { + c := &InstancesAttachDiskCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.attacheddisk = attacheddisk + return c +} + +func (c *InstancesAttachDiskCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/instances/{instance}/attachDisk") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Attaches a disk resource to an instance.", + // "httpMethod": "POST", + // "id": "compute.instances.attachDisk", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/attachDisk", + // "request": { + // "$ref": "AttachedDisk" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.delete": + +type InstancesDeleteCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified instance resource. +func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall { + c := &InstancesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified instance resource.", + // "httpMethod": "DELETE", + // "id": "compute.instances.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.deleteAccessConfig": + +type InstancesDeleteAccessConfigCall struct { + s *Service + project string + zone string + instance string + accessConfig string + networkInterface string + opt_ map[string]interface{} +} + +// DeleteAccessConfig: Deletes an access config from an instance's +// network interface. +func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall { + c := &InstancesDeleteAccessConfigCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.accessConfig = accessConfig + c.networkInterface = networkInterface + return c +} + +func (c *InstancesDeleteAccessConfigCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("accessConfig", fmt.Sprintf("%v", c.accessConfig)) + params.Set("networkInterface", fmt.Sprintf("%v", c.networkInterface)) + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes an access config from an instance's network interface.", + // "httpMethod": "POST", + // "id": "compute.instances.deleteAccessConfig", + // "parameterOrder": [ + // "project", + // "zone", + // "instance", + // "accessConfig", + // "networkInterface" + // ], + // "parameters": { + // "accessConfig": { + // "description": "Access config name.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "networkInterface": { + // "description": "Network interface name.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.detachDisk": + +type InstancesDetachDiskCall struct { + s *Service + project string + zone string + instance string + deviceName string + opt_ map[string]interface{} +} + +// DetachDisk: Detaches a disk from an instance. +func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall { + c := &InstancesDetachDiskCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.deviceName = deviceName + return c +} + +func (c *InstancesDetachDiskCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("deviceName", fmt.Sprintf("%v", c.deviceName)) + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/instances/{instance}/detachDisk") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Detaches a disk from an instance.", + // "httpMethod": "POST", + // "id": "compute.instances.detachDisk", + // "parameterOrder": [ + // "project", + // "zone", + // "instance", + // "deviceName" + // ], + // "parameters": { + // "deviceName": { + // "description": "Disk device name to detach.", + // "location": "query", + // "pattern": "\\w[\\w.-]{0,254}", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/detachDisk", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.get": + +type InstancesGetCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} +} + +// Get: Returns the specified instance resource. +func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall { + c := &InstancesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesGetCall) Do() (*Instance, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Instance) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified instance resource.", + // "httpMethod": "GET", + // "id": "compute.instances.get", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}", + // "response": { + // "$ref": "Instance" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.getSerialPortOutput": + +type InstancesGetSerialPortOutputCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} +} + +// GetSerialPortOutput: Returns the specified instance's serial port +// output. +func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall { + c := &InstancesGetSerialPortOutputCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesGetSerialPortOutputCall) Do() (*SerialPortOutput, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/instances/{instance}/serialPort") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SerialPortOutput) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified instance's serial port output.", + // "httpMethod": "GET", + // "id": "compute.instances.getSerialPortOutput", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/serialPort", + // "response": { + // "$ref": "SerialPortOutput" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.insert": + +type InstancesInsertCall struct { + s *Service + project string + zone string + instance *Instance + opt_ map[string]interface{} +} + +// Insert: Creates an instance resource in the specified project using +// the data included in the request. +func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall { + c := &InstancesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an instance resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.instances.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances", + // "request": { + // "$ref": "Instance" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.list": + +type InstancesListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// List: Retrieves the list of instance resources contained within the +// specified zone. +func (r *InstancesService) List(project string, zone string) *InstancesListCall { + c := &InstancesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *InstancesListCall) Filter(filter string) *InstancesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *InstancesListCall) Do() (*InstanceList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstanceList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of instance resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.instances.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances", + // "response": { + // "$ref": "InstanceList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.reset": + +type InstancesResetCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} +} + +// Reset: Performs a hard reset on the instance. +func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall { + c := &InstancesResetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesResetCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/instances/{instance}/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Performs a hard reset on the instance.", + // "httpMethod": "POST", + // "id": "compute.instances.reset", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/reset", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.setMetadata": + +type InstancesSetMetadataCall struct { + s *Service + project string + zone string + instance string + metadata *Metadata + opt_ map[string]interface{} +} + +// SetMetadata: Sets metadata for the specified instance to the data +// included in the request. +func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall { + c := &InstancesSetMetadataCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.metadata = metadata + return c +} + +func (c *InstancesSetMetadataCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/instances/{instance}/setMetadata") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets metadata for the specified instance to the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.instances.setMetadata", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/setMetadata", + // "request": { + // "$ref": "Metadata" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.setTags": + +type InstancesSetTagsCall struct { + s *Service + project string + zone string + instance string + tags *Tags + opt_ map[string]interface{} +} + +// SetTags: Sets tags for the specified instance to the data included in +// the request. +func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall { + c := &InstancesSetTagsCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.tags = tags + return c +} + +func (c *InstancesSetTagsCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/instances/{instance}/setTags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets tags for the specified instance to the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.instances.setTags", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/setTags", + // "request": { + // "$ref": "Tags" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.kernels.get": + +type KernelsGetCall struct { + s *Service + project string + kernel string + opt_ map[string]interface{} +} + +// Get: Returns the specified kernel resource. +func (r *KernelsService) Get(project string, kernel string) *KernelsGetCall { + c := &KernelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.kernel = kernel + return c +} + +func (c *KernelsGetCall) Do() (*Kernel, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/kernels/{kernel}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{kernel}", url.QueryEscape(c.kernel), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Kernel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified kernel resource.", + // "httpMethod": "GET", + // "id": "compute.kernels.get", + // "parameterOrder": [ + // "project", + // "kernel" + // ], + // "parameters": { + // "kernel": { + // "description": "Name of the kernel resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/kernels/{kernel}", + // "response": { + // "$ref": "Kernel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.kernels.list": + +type KernelsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of kernel resources available to the +// specified project. +func (r *KernelsService) List(project string) *KernelsListCall { + c := &KernelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *KernelsListCall) Filter(filter string) *KernelsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *KernelsListCall) MaxResults(maxResults int64) *KernelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *KernelsListCall) PageToken(pageToken string) *KernelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *KernelsListCall) Do() (*KernelList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/kernels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(KernelList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of kernel resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.kernels.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/kernels", + // "response": { + // "$ref": "KernelList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.machineTypes.aggregatedList": + +type MachineTypesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of machine type resources grouped +// by scope. +func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall { + c := &MachineTypesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *MachineTypesAggregatedListCall) Do() (*MachineTypeAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/aggregated/machineTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(MachineTypeAggregatedList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of machine type resources grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/machineTypes", + // "response": { + // "$ref": "MachineTypeAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.machineTypes.get": + +type MachineTypesGetCall struct { + s *Service + project string + zone string + machineType string + opt_ map[string]interface{} +} + +// Get: Returns the specified machine type resource. +func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall { + c := &MachineTypesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.machineType = machineType + return c +} + +func (c *MachineTypesGetCall) Do() (*MachineType, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/machineTypes/{machineType}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{machineType}", url.QueryEscape(c.machineType), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(MachineType) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified machine type resource.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.get", + // "parameterOrder": [ + // "project", + // "zone", + // "machineType" + // ], + // "parameters": { + // "machineType": { + // "description": "Name of the machine type resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/machineTypes/{machineType}", + // "response": { + // "$ref": "MachineType" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.machineTypes.list": + +type MachineTypesListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// List: Retrieves the list of machine type resources available to the +// specified project. +func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall { + c := &MachineTypesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *MachineTypesListCall) Do() (*MachineTypeList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/machineTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(MachineTypeList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of machine type resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/machineTypes", + // "response": { + // "$ref": "MachineTypeList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.networks.delete": + +type NetworksDeleteCall struct { + s *Service + project string + network string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified network resource. +func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall { + c := &NetworksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.network = network + return c +} + +func (c *NetworksDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/networks/{network}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{network}", url.QueryEscape(c.network), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified network resource.", + // "httpMethod": "DELETE", + // "id": "compute.networks.delete", + // "parameterOrder": [ + // "project", + // "network" + // ], + // "parameters": { + // "network": { + // "description": "Name of the network resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/networks/{network}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.networks.get": + +type NetworksGetCall struct { + s *Service + project string + network string + opt_ map[string]interface{} +} + +// Get: Returns the specified network resource. +func (r *NetworksService) Get(project string, network string) *NetworksGetCall { + c := &NetworksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.network = network + return c +} + +func (c *NetworksGetCall) Do() (*Network, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/networks/{network}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{network}", url.QueryEscape(c.network), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Network) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified network resource.", + // "httpMethod": "GET", + // "id": "compute.networks.get", + // "parameterOrder": [ + // "project", + // "network" + // ], + // "parameters": { + // "network": { + // "description": "Name of the network resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/networks/{network}", + // "response": { + // "$ref": "Network" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.networks.insert": + +type NetworksInsertCall struct { + s *Service + project string + network *Network + opt_ map[string]interface{} +} + +// Insert: Creates a network resource in the specified project using the +// data included in the request. +func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall { + c := &NetworksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.network = network + return c +} + +func (c *NetworksInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.network) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/networks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a network resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.networks.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/networks", + // "request": { + // "$ref": "Network" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.networks.list": + +type NetworksListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of network resources available to the +// specified project. +func (r *NetworksService) List(project string) *NetworksListCall { + c := &NetworksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *NetworksListCall) Filter(filter string) *NetworksListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *NetworksListCall) Do() (*NetworkList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/networks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(NetworkList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of network resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.networks.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/networks", + // "response": { + // "$ref": "NetworkList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.projects.get": + +type ProjectsGetCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// Get: Returns the specified project resource. +func (r *ProjectsService) Get(project string) *ProjectsGetCall { + c := &ProjectsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +func (c *ProjectsGetCall) Do() (*Project, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Project) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified project resource.", + // "httpMethod": "GET", + // "id": "compute.projects.get", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project resource to retrieve.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}", + // "response": { + // "$ref": "Project" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.projects.setCommonInstanceMetadata": + +type ProjectsSetCommonInstanceMetadataCall struct { + s *Service + project string + metadata *Metadata + opt_ map[string]interface{} +} + +// SetCommonInstanceMetadata: Sets metadata common to all instances +// within the specified project using the data included in the request. +func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall { + c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.metadata = metadata + return c +} + +func (c *ProjectsSetCommonInstanceMetadataCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/setCommonInstanceMetadata") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets metadata common to all instances within the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.projects.setCommonInstanceMetadata", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/setCommonInstanceMetadata", + // "request": { + // "$ref": "Metadata" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.regionOperations.delete": + +type RegionOperationsDeleteCall struct { + s *Service + project string + region string + operation string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified region-specific operation resource. +func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall { + c := &RegionOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.operation = operation + return c +} + +func (c *RegionOperationsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified region-specific operation resource.", + // "httpMethod": "DELETE", + // "id": "compute.regionOperations.delete", + // "parameterOrder": [ + // "project", + // "region", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/operations/{operation}", + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.regionOperations.get": + +type RegionOperationsGetCall struct { + s *Service + project string + region string + operation string + opt_ map[string]interface{} +} + +// Get: Retrieves the specified region-specific operation resource. +func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall { + c := &RegionOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.operation = operation + return c +} + +func (c *RegionOperationsGetCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified region-specific operation resource.", + // "httpMethod": "GET", + // "id": "compute.regionOperations.get", + // "parameterOrder": [ + // "project", + // "region", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/operations/{operation}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.regionOperations.list": + +type RegionOperationsListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} +} + +// List: Retrieves the list of operation resources contained within the +// specified region. +func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall { + c := &RegionOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *RegionOperationsListCall) Do() (*OperationList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OperationList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified region.", + // "httpMethod": "GET", + // "id": "compute.regionOperations.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/operations", + // "response": { + // "$ref": "OperationList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.regions.get": + +type RegionsGetCall struct { + s *Service + project string + region string + opt_ map[string]interface{} +} + +// Get: Returns the specified region resource. +func (r *RegionsService) Get(project string, region string) *RegionsGetCall { + c := &RegionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +func (c *RegionsGetCall) Do() (*Region, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Region) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified region resource.", + // "httpMethod": "GET", + // "id": "compute.regions.get", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}", + // "response": { + // "$ref": "Region" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.regions.list": + +type RegionsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of region resources available to the +// specified project. +func (r *RegionsService) List(project string) *RegionsListCall { + c := &RegionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *RegionsListCall) Filter(filter string) *RegionsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *RegionsListCall) Do() (*RegionList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RegionList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of region resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.regions.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions", + // "response": { + // "$ref": "RegionList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.routes.delete": + +type RoutesDeleteCall struct { + s *Service + project string + route string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified route resource. +func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall { + c := &RoutesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.route = route + return c +} + +func (c *RoutesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/routes/{route}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{route}", url.QueryEscape(c.route), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified route resource.", + // "httpMethod": "DELETE", + // "id": "compute.routes.delete", + // "parameterOrder": [ + // "project", + // "route" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "route": { + // "description": "Name of the route resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/routes/{route}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.routes.get": + +type RoutesGetCall struct { + s *Service + project string + route string + opt_ map[string]interface{} +} + +// Get: Returns the specified route resource. +func (r *RoutesService) Get(project string, route string) *RoutesGetCall { + c := &RoutesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.route = route + return c +} + +func (c *RoutesGetCall) Do() (*Route, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/routes/{route}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{route}", url.QueryEscape(c.route), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Route) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified route resource.", + // "httpMethod": "GET", + // "id": "compute.routes.get", + // "parameterOrder": [ + // "project", + // "route" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "route": { + // "description": "Name of the route resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/routes/{route}", + // "response": { + // "$ref": "Route" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.routes.insert": + +type RoutesInsertCall struct { + s *Service + project string + route *Route + opt_ map[string]interface{} +} + +// Insert: Creates a route resource in the specified project using the +// data included in the request. +func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall { + c := &RoutesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.route = route + return c +} + +func (c *RoutesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.route) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/routes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a route resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.routes.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/routes", + // "request": { + // "$ref": "Route" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.routes.list": + +type RoutesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of route resources available to the +// specified project. +func (r *RoutesService) List(project string) *RoutesListCall { + c := &RoutesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *RoutesListCall) Filter(filter string) *RoutesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *RoutesListCall) Do() (*RouteList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/routes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RouteList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of route resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.routes.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/routes", + // "response": { + // "$ref": "RouteList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.snapshots.delete": + +type SnapshotsDeleteCall struct { + s *Service + project string + snapshot string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified persistent disk snapshot resource. +func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall { + c := &SnapshotsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.snapshot = snapshot + return c +} + +func (c *SnapshotsDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/snapshots/{snapshot}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{snapshot}", url.QueryEscape(c.snapshot), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified persistent disk snapshot resource.", + // "httpMethod": "DELETE", + // "id": "compute.snapshots.delete", + // "parameterOrder": [ + // "project", + // "snapshot" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "snapshot": { + // "description": "Name of the persistent disk snapshot resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/snapshots/{snapshot}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.snapshots.get": + +type SnapshotsGetCall struct { + s *Service + project string + snapshot string + opt_ map[string]interface{} +} + +// Get: Returns the specified persistent disk snapshot resource. +func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall { + c := &SnapshotsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.snapshot = snapshot + return c +} + +func (c *SnapshotsGetCall) Do() (*Snapshot, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/snapshots/{snapshot}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{snapshot}", url.QueryEscape(c.snapshot), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Snapshot) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified persistent disk snapshot resource.", + // "httpMethod": "GET", + // "id": "compute.snapshots.get", + // "parameterOrder": [ + // "project", + // "snapshot" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "snapshot": { + // "description": "Name of the persistent disk snapshot resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/snapshots/{snapshot}", + // "response": { + // "$ref": "Snapshot" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.snapshots.list": + +type SnapshotsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of persistent disk snapshot resources +// contained within the specified project. +func (r *SnapshotsService) List(project string) *SnapshotsListCall { + c := &SnapshotsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *SnapshotsListCall) Do() (*SnapshotList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/global/snapshots") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SnapshotList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of persistent disk snapshot resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.snapshots.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/snapshots", + // "response": { + // "$ref": "SnapshotList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetPools.addHealthCheck": + +type TargetPoolsAddHealthCheckCall struct { + s *Service + project string + region string + targetPool string + healthcheckreference *HealthCheckReference + opt_ map[string]interface{} +} + +// AddHealthCheck: Adds health check URL to targetPool. +func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, healthcheckreference *HealthCheckReference) *TargetPoolsAddHealthCheckCall { + c := &TargetPoolsAddHealthCheckCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + c.healthcheckreference = healthcheckreference + return c +} + +func (c *TargetPoolsAddHealthCheckCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheckreference) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds health check URL to targetPool.", + // "httpMethod": "POST", + // "id": "compute.targetPools.addHealthCheck", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to which health_check_url is to be added.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck", + // "request": { + // "$ref": "HealthCheckReference" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.addInstance": + +type TargetPoolsAddInstanceCall struct { + s *Service + project string + region string + targetPool string + instancereference *InstanceReference + opt_ map[string]interface{} +} + +// AddInstance: Adds instance url to targetPool. +func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsAddInstanceCall { + c := &TargetPoolsAddInstanceCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + c.instancereference = instancereference + return c +} + +func (c *TargetPoolsAddInstanceCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/targetPools/{targetPool}/addInstance") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds instance url to targetPool.", + // "httpMethod": "POST", + // "id": "compute.targetPools.addInstance", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to which instance_url is to be added.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance", + // "request": { + // "$ref": "InstanceReference" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.aggregatedList": + +type TargetPoolsAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of target pools grouped by scope. +func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall { + c := &TargetPoolsAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *TargetPoolsAggregatedListCall) Do() (*TargetPoolAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/aggregated/targetPools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TargetPoolAggregatedList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of target pools grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.targetPools.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/targetPools", + // "response": { + // "$ref": "TargetPoolAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetPools.delete": + +type TargetPoolsDeleteCall struct { + s *Service + project string + region string + targetPool string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified TargetPool resource. +func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall { + c := &TargetPoolsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + return c +} + +func (c *TargetPoolsDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/targetPools/{targetPool}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified TargetPool resource.", + // "httpMethod": "DELETE", + // "id": "compute.targetPools.delete", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.get": + +type TargetPoolsGetCall struct { + s *Service + project string + region string + targetPool string + opt_ map[string]interface{} +} + +// Get: Returns the specified TargetPool resource. +func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall { + c := &TargetPoolsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + return c +} + +func (c *TargetPoolsGetCall) Do() (*TargetPool, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/targetPools/{targetPool}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TargetPool) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified TargetPool resource.", + // "httpMethod": "GET", + // "id": "compute.targetPools.get", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}", + // "response": { + // "$ref": "TargetPool" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetPools.getHealth": + +type TargetPoolsGetHealthCall struct { + s *Service + project string + region string + targetPool string + instancereference *InstanceReference + opt_ map[string]interface{} +} + +// GetHealth: Gets the most recent health check results for each IP for +// the given instance that is referenced by given TargetPool. +func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall { + c := &TargetPoolsGetHealthCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + c.instancereference = instancereference + return c +} + +func (c *TargetPoolsGetHealthCall) Do() (*TargetPoolInstanceHealth, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/targetPools/{targetPool}/getHealth") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TargetPoolInstanceHealth) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the most recent health check results for each IP for the given instance that is referenced by given TargetPool.", + // "httpMethod": "POST", + // "id": "compute.targetPools.getHealth", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to which the queried instance belongs.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth", + // "request": { + // "$ref": "InstanceReference" + // }, + // "response": { + // "$ref": "TargetPoolInstanceHealth" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetPools.insert": + +type TargetPoolsInsertCall struct { + s *Service + project string + region string + targetpool *TargetPool + opt_ map[string]interface{} +} + +// Insert: Creates a TargetPool resource in the specified project and +// region using the data included in the request. +func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall { + c := &TargetPoolsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetpool = targetpool + return c +} + +func (c *TargetPoolsInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/targetPools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a TargetPool resource in the specified project and region using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.targetPools.insert", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools", + // "request": { + // "$ref": "TargetPool" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.list": + +type TargetPoolsListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} +} + +// List: Retrieves the list of TargetPool resources available to the +// specified project and region. +func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall { + c := &TargetPoolsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *TargetPoolsListCall) Do() (*TargetPoolList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/targetPools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TargetPoolList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of TargetPool resources available to the specified project and region.", + // "httpMethod": "GET", + // "id": "compute.targetPools.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools", + // "response": { + // "$ref": "TargetPoolList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetPools.removeHealthCheck": + +type TargetPoolsRemoveHealthCheckCall struct { + s *Service + project string + region string + targetPool string + healthcheckreference *HealthCheckReference + opt_ map[string]interface{} +} + +// RemoveHealthCheck: Removes health check URL from targetPool. +func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, healthcheckreference *HealthCheckReference) *TargetPoolsRemoveHealthCheckCall { + c := &TargetPoolsRemoveHealthCheckCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + c.healthcheckreference = healthcheckreference + return c +} + +func (c *TargetPoolsRemoveHealthCheckCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheckreference) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes health check URL from targetPool.", + // "httpMethod": "POST", + // "id": "compute.targetPools.removeHealthCheck", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to which health_check_url is to be removed.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck", + // "request": { + // "$ref": "HealthCheckReference" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.removeInstance": + +type TargetPoolsRemoveInstanceCall struct { + s *Service + project string + region string + targetPool string + instancereference *InstanceReference + opt_ map[string]interface{} +} + +// RemoveInstance: Removes instance URL from targetPool. +func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsRemoveInstanceCall { + c := &TargetPoolsRemoveInstanceCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + c.instancereference = instancereference + return c +} + +func (c *TargetPoolsRemoveInstanceCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/targetPools/{targetPool}/removeInstance") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes instance URL from targetPool.", + // "httpMethod": "POST", + // "id": "compute.targetPools.removeInstance", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to which instance_url is to be removed.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance", + // "request": { + // "$ref": "InstanceReference" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.setBackup": + +type TargetPoolsSetBackupCall struct { + s *Service + project string + region string + targetPool string + targetreference *TargetReference + opt_ map[string]interface{} +} + +// SetBackup: Changes backup pool configurations. +func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall { + c := &TargetPoolsSetBackupCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + c.targetreference = targetreference + return c +} + +// FailoverRatio sets the optional parameter "failoverRatio": New +// failoverRatio value for the containing target pool. +func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall { + c.opt_["failoverRatio"] = failoverRatio + return c +} + +func (c *TargetPoolsSetBackupCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["failoverRatio"]; ok { + params.Set("failoverRatio", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/regions/{region}/targetPools/{targetPool}/setBackup") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Changes backup pool configurations.", + // "httpMethod": "POST", + // "id": "compute.targetPools.setBackup", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "failoverRatio": { + // "description": "New failoverRatio value for the containing target pool.", + // "format": "float", + // "location": "query", + // "type": "number" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource for which the backup is to be set.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup", + // "request": { + // "$ref": "TargetReference" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.zoneOperations.delete": + +type ZoneOperationsDeleteCall struct { + s *Service + project string + zone string + operation string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified zone-specific operation resource. +func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall { + c := &ZoneOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.operation = operation + return c +} + +func (c *ZoneOperationsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified zone-specific operation resource.", + // "httpMethod": "DELETE", + // "id": "compute.zoneOperations.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/operations/{operation}", + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.zoneOperations.get": + +type ZoneOperationsGetCall struct { + s *Service + project string + zone string + operation string + opt_ map[string]interface{} +} + +// Get: Retrieves the specified zone-specific operation resource. +func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall { + c := &ZoneOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.operation = operation + return c +} + +func (c *ZoneOperationsGetCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified zone-specific operation resource.", + // "httpMethod": "GET", + // "id": "compute.zoneOperations.get", + // "parameterOrder": [ + // "project", + // "zone", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/operations/{operation}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.zoneOperations.list": + +type ZoneOperationsListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// List: Retrieves the list of operation resources contained within the +// specified zone. +func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall { + c := &ZoneOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ZoneOperationsListCall) Do() (*OperationList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OperationList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.zoneOperations.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/operations", + // "response": { + // "$ref": "OperationList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.zones.get": + +type ZonesGetCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// Get: Returns the specified zone resource. +func (r *ZonesService) Get(project string, zone string) *ZonesGetCall { + c := &ZonesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +func (c *ZonesGetCall) Do() (*Zone, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones/{zone}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Zone) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified zone resource.", + // "httpMethod": "GET", + // "id": "compute.zones.get", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}", + // "response": { + // "$ref": "Zone" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.zones.list": + +type ZonesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of zone resources available to the specified +// project. +func (r *ZonesService) List(project string) *ZonesListCall { + c := &ZonesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ZonesListCall) Filter(filter string) *ZonesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 100. +func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ZonesListCall) Do() (*ZoneList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta15/projects/", "{project}/zones") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ZoneList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of zone resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.zones.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones", + // "response": { + // "$ref": "ZoneList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta16/compute-api.json b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta16/compute-api.json new file mode 100644 index 0000000000000..c9614315c1cb0 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta16/compute-api.json @@ -0,0 +1,6919 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"R6H4aXXmd1SZaWpEcGSkC2StmNw/YUolxkzL_8Ggy-XySmNJLv4Q5RQ\"", + "discoveryVersion": "v1", + "id": "compute:v1beta16", + "name": "compute", + "version": "v1beta16", + "title": "Compute Engine API", + "description": "API for the Google Compute Engine service.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "http://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://developers.google.com/compute/docs/reference/v1beta16", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/compute/v1beta16/projects/", + "basePath": "/compute/v1beta16/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "compute/v1beta16/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/compute": { + "description": "View and manage your Google Compute Engine resources" + }, + "https://www.googleapis.com/auth/compute.readonly": { + "description": "View your Google Compute Engine resources" + }, + "https://www.googleapis.com/auth/devstorage.full_control": { + "description": "Manage your data and permissions in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" + } + } + } + }, + "schemas": { + "AccessConfig": { + "id": "AccessConfig", + "type": "object", + "description": "An access configuration attached to an instance's network interface.", + "properties": { + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#accessConfig" + }, + "name": { + "type": "string", + "description": "Name of this access configuration." + }, + "natIP": { + "type": "string", + "description": "An external IP address associated with this instance. Specify an unused static IP address available to the project. If not specified, the external IP will be drawn from a shared ephemeral pool." + }, + "type": { + "type": "string", + "description": "Type of configuration. Must be set to \"ONE_TO_ONE_NAT\". This configures port-for-port NAT to the internet.", + "default": "ONE_TO_ONE_NAT", + "enum": [ + "ONE_TO_ONE_NAT" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "Address": { + "id": "Address", + "type": "object", + "description": "A reserved address resource.", + "properties": { + "address": { + "type": "string", + "description": "The IP address represented by this resource." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#address" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.addresses.insert" + ] + } + }, + "region": { + "type": "string", + "description": "URL of the region where the address resides (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "status": { + "type": "string", + "description": "The status of the address (output only).", + "enum": [ + "IN_USE", + "RESERVED" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "users": { + "type": "array", + "description": "The resources that are using this address resource.", + "items": { + "type": "string" + } + } + } + }, + "AddressAggregatedList": { + "id": "AddressAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped address lists.", + "additionalProperties": { + "$ref": "AddressesScopedList", + "description": "Name of the scope containing this set of addresses." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#addressAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "AddressList": { + "id": "AddressList", + "type": "object", + "description": "Contains a list of address resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The address resources.", + "items": { + "$ref": "Address" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#addressList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "AddressesScopedList": { + "id": "AddressesScopedList", + "type": "object", + "properties": { + "addresses": { + "type": "array", + "description": "List of addresses contained in this scope.", + "items": { + "$ref": "Address" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of addresses when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "AttachedDisk": { + "id": "AttachedDisk", + "type": "object", + "description": "An instance-attached disk resource.", + "properties": { + "boot": { + "type": "boolean", + "description": "Indicates that this is a boot disk. VM will use the first partition of the disk for its root filesystem." + }, + "deviceName": { + "type": "string", + "description": "Persistent disk only; must be unique within the instance when specified. This represents a unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. If not specified, a default will be chosen by the system." + }, + "index": { + "type": "integer", + "description": "A zero-based index to assign to this disk, where 0 is reserved for the boot disk. If not specified, the server will choose an appropriate value (output only).", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#attachedDisk" + }, + "mode": { + "type": "string", + "description": "The mode in which to attach this disk, either \"READ_WRITE\" or \"READ_ONLY\".", + "enum": [ + "READ_ONLY", + "READ_WRITE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "source": { + "type": "string", + "description": "Persistent disk only; the URL of the persistent disk resource." + }, + "type": { + "type": "string", + "description": "Type of the disk, either \"SCRATCH\" or \"PERSISTENT\". Note that persistent disks must be created before you can specify them here.", + "enum": [ + "PERSISTENT", + "SCRATCH" + ], + "enumDescriptions": [ + "", + "" + ], + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + } + } + }, + "DeprecationStatus": { + "id": "DeprecationStatus", + "type": "object", + "description": "Deprecation status for a public resource.", + "properties": { + "deleted": { + "type": "string", + "description": "An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to DELETED." + }, + "deprecated": { + "type": "string", + "description": "An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to DEPRECATED." + }, + "obsolete": { + "type": "string", + "description": "An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to OBSOLETE." + }, + "replacement": { + "type": "string", + "description": "A URL of the suggested replacement for the deprecated resource. The deprecated resource and its replacement must be resources of the same kind." + }, + "state": { + "type": "string", + "description": "The deprecation state. Can be \"DEPRECATED\", \"OBSOLETE\", or \"DELETED\". Operations which create a new resource using a \"DEPRECATED\" resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. New uses of \"OBSOLETE\" or \"DELETED\" resources will result in an error.", + "enum": [ + "DELETED", + "DEPRECATED", + "OBSOLETE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "Disk": { + "id": "Disk", + "type": "object", + "description": "A persistent disk resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#disk" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.disks.insert" + ] + } + }, + "options": { + "type": "string", + "description": "Internal use only." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sizeGb": { + "type": "string", + "description": "Size of the persistent disk, specified in GB. This parameter is optional when creating a disk from a disk image or a snapshot, otherwise it is required.", + "format": "int64" + }, + "sourceImage": { + "type": "string", + "description": "The source image used to create this disk. Once the source image has been deleted from the system, this field will not be set, even if an image with the same name has been re-created." + }, + "sourceImageId": { + "type": "string", + "description": "The 'id' value of the image used to create this disk. This value may be used to determine whether the disk was created from the current or a previous instance of a given image." + }, + "sourceSnapshot": { + "type": "string", + "description": "The source snapshot used to create this disk. Once the source snapshot has been deleted from the system, this field will be cleared, and will not be set even if a snapshot with the same name has been re-created." + }, + "sourceSnapshotId": { + "type": "string", + "description": "The 'id' value of the snapshot used to create this disk. This value may be used to determine whether the disk was created from the current or a previous instance of a given disk snapshot." + }, + "status": { + "type": "string", + "description": "The status of disk creation (output only).", + "enum": [ + "CREATING", + "FAILED", + "READY", + "RESTORING" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "zone": { + "type": "string", + "description": "URL of the zone where the disk resides (output only)." + } + } + }, + "DiskAggregatedList": { + "id": "DiskAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped disk lists.", + "additionalProperties": { + "$ref": "DisksScopedList", + "description": "Name of the scope containing this set of disks." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#diskAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "DiskList": { + "id": "DiskList", + "type": "object", + "description": "Contains a list of persistent disk resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The persistent disk resources.", + "items": { + "$ref": "Disk" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#diskList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "DisksScopedList": { + "id": "DisksScopedList", + "type": "object", + "properties": { + "disks": { + "type": "array", + "description": "List of disks contained in this scope.", + "items": { + "$ref": "Disk" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of disks when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "Firewall": { + "id": "Firewall", + "type": "object", + "description": "A firewall resource.", + "properties": { + "allowed": { + "type": "array", + "description": "The list of rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection.", + "items": { + "type": "object", + "properties": { + "IPProtocol": { + "type": "string", + "description": "Required; this is the IP protocol that is allowed for this rule. This can either be a well known protocol string (tcp, udp or icmp) or the IP protocol number." + }, + "ports": { + "type": "array", + "description": "An optional list of ports which are allowed. It is an error to specify this for any protocol that isn't UDP or TCP. Each entry must be either an integer or a range. If not specified, connections through any port are allowed.\n\nExample inputs include: [\"22\"], [\"80\",\"443\"] and [\"12345-12349\"].", + "items": { + "type": "string" + } + } + } + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#firewall" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.firewalls.insert", + "compute.firewalls.patch" + ] + } + }, + "network": { + "type": "string", + "description": "URL of the network to which this firewall is applied; provided by the client when the firewall is created.", + "annotations": { + "required": [ + "compute.firewalls.insert", + "compute.firewalls.patch" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sourceRanges": { + "type": "array", + "description": "A list of IP address blocks expressed in CIDR format which this rule applies to. One or both of sourceRanges and sourceTags may be set; an inbound connection is allowed if either the range or the tag of the source matches.", + "items": { + "type": "string" + } + }, + "sourceTags": { + "type": "array", + "description": "A list of instance tags which this rule applies to. One or both of sourceRanges and sourceTags may be set; an inbound connection is allowed if either the range or the tag of the source matches.", + "items": { + "type": "string" + } + }, + "targetTags": { + "type": "array", + "description": "A list of instance tags indicating sets of instances located on network which may make network connections as specified in allowed. If no targetTags are specified, the firewall rule applies to all instances on the specified network.", + "items": { + "type": "string" + } + } + } + }, + "FirewallList": { + "id": "FirewallList", + "type": "object", + "description": "Contains a list of firewall resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The firewall resources.", + "items": { + "$ref": "Firewall" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#firewallList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "ForwardingRule": { + "id": "ForwardingRule", + "type": "object", + "description": "A ForwardingRule resource. A ForwardingRule resource specifies which pool of target VMs to forward a packet to if it matches the given [IPAddress, IPProtocol, portRange] tuple.", + "properties": { + "IPAddress": { + "type": "string", + "description": "Value of the reserved IP address that this forwarding rule is serving on behalf of. The address resource must live in the same region as the forwarding rule. If left empty (default value), an ephemeral IP will be assigned." + }, + "IPProtocol": { + "type": "string", + "description": "The IP protocol to which this rule applies, can be either 'TCP' or 'UDP' (If left empty, will use TCP by default).", + "enum": [ + "TCP", + "UDP" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#forwardingRule" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "portRange": { + "type": "string", + "description": "If 'IPProtocol' is 'TCP' or 'UDP', only packets addressed to ports in the specified range will be forwarded to 'target'. If left empty (default value), all ports are forwarded. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges." + }, + "region": { + "type": "string", + "description": "URL of the region where the forwarding rule resides (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "target": { + "type": "string", + "description": "The URL of the target resource to receive the matched traffic. It must live in the same region as this forwarding rule." + } + } + }, + "ForwardingRuleAggregatedList": { + "id": "ForwardingRuleAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped forwarding rule lists.", + "additionalProperties": { + "$ref": "ForwardingRulesScopedList", + "description": "Name of the scope containing this set of addresses." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#forwardingRuleAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "ForwardingRuleList": { + "id": "ForwardingRuleList", + "type": "object", + "description": "Contains a list of ForwardingRule resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The ForwardingRule resources.", + "items": { + "$ref": "ForwardingRule" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#forwardingRuleList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "ForwardingRulesScopedList": { + "id": "ForwardingRulesScopedList", + "type": "object", + "properties": { + "forwardingRules": { + "type": "array", + "description": "List of forwarding rules contained in this scope.", + "items": { + "$ref": "ForwardingRule" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of forwarding rules when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "HealthCheckReference": { + "id": "HealthCheckReference", + "type": "object", + "properties": { + "healthCheck": { + "type": "string" + } + } + }, + "HealthStatus": { + "id": "HealthStatus", + "type": "object", + "properties": { + "healthState": { + "type": "string", + "description": "Health state of the instance.", + "enum": [ + "HEALTHY", + "UNHEALTHY" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "instance": { + "type": "string", + "description": "URL of the instance resource." + }, + "ipAddress": { + "type": "string", + "description": "The IP address represented by this resource." + } + } + }, + "HttpHealthCheck": { + "id": "HttpHealthCheck", + "type": "object", + "description": "An HttpHealthCheck resource. This resource defines a template for how individual VMs should be checked for health, via HTTP.", + "properties": { + "checkIntervalSec": { + "type": "integer", + "description": "How often (in seconds) to send a health check. The default value is 5 seconds.", + "format": "int32" + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "healthyThreshold": { + "type": "integer", + "description": "A so-far unhealthy VM will be marked healthy after this many consecutive successes. The default value is 2.", + "format": "int32" + }, + "host": { + "type": "string", + "description": "The value of the host header in the HTTP health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#httpHealthCheck" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "port": { + "type": "integer", + "description": "The TCP port number for the HTTP health check request. The default value is 80.", + "format": "int32" + }, + "requestPath": { + "type": "string", + "description": "The request path of the HTTP health check request. The default value is \"/\"." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "timeoutSec": { + "type": "integer", + "description": "How long (in seconds) to wait before claiming failure. The default value is 5 seconds.", + "format": "int32" + }, + "unhealthyThreshold": { + "type": "integer", + "description": "A so-far healthy VM will be marked unhealthy after this many consecutive failures. The default value is 2.", + "format": "int32" + } + } + }, + "HttpHealthCheckList": { + "id": "HttpHealthCheckList", + "type": "object", + "description": "Contains a list of HttpHealthCheck resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The HttpHealthCheck resources.", + "items": { + "$ref": "HttpHealthCheck" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#httpHealthCheckList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Image": { + "id": "Image", + "type": "object", + "description": "A disk image resource.", + "properties": { + "archiveSizeBytes": { + "type": "string", + "description": "Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).", + "format": "int64" + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this image." + }, + "description": { + "type": "string", + "description": "Textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#image" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + }, + "preferredKernel": { + "type": "string", + "description": "An optional URL of the preferred kernel for use with this disk image. If not specified, a server defined default kernel will be used.", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + }, + "rawDisk": { + "type": "object", + "description": "The raw disk image parameters.", + "properties": { + "containerType": { + "type": "string", + "description": "The format used to encode and transmit the block device. Should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created.", + "default": "TAR" + }, + "sha1Checksum": { + "type": "string", + "description": "An optional SHA1 checksum of the disk image before unpackaging; provided by the client when the disk image is created.", + "pattern": "[a-f0-9]{40}" + }, + "source": { + "type": "string", + "description": "The full Google Cloud Storage URL where the disk image is stored; provided by the client when the disk image is created.", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + } + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sourceType": { + "type": "string", + "description": "Must be \"RAW\"; provided by the client when the disk image is created.", + "default": "RAW", + "enum": [ + "RAW" + ], + "enumDescriptions": [ + "" + ], + "annotations": { + "required": [ + "compute.images.insert" + ] + } + }, + "status": { + "type": "string", + "description": "Status of the image (output only). It will be one of the following READY - after image has been successfully created and is ready for use FAILED - if creating the image fails for some reason PENDING - the image creation is in progress An image can be used to create other resources suck as instances only after the image has been successfully created and the status is set to READY.", + "enum": [ + "FAILED", + "PENDING", + "READY" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "ImageList": { + "id": "ImageList", + "type": "object", + "description": "Contains a list of disk image resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The disk image resources.", + "items": { + "$ref": "Image" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#imageList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Instance": { + "id": "Instance", + "type": "object", + "description": "An instance resource.", + "properties": { + "canIpForward": { + "type": "boolean", + "description": "Allows this instance to send packets with source IP addresses other than its own and receive packets with destination IP addresses other than its own. If this instance will be used as an IP gateway or it will be set as the next-hop in a Route resource, say true. If unsure, leave this set to false." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "disks": { + "type": "array", + "description": "Array of disks associated with this instance. Persistent disks must be created before you can assign them.", + "items": { + "$ref": "AttachedDisk" + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "image": { + "type": "string", + "description": "An optional URL of the disk image resource to be installed on this instance; provided by the client when the instance is created. Alternatively to passing the image, the client may choose to boot from a persistent disk, by setting boot=true flag on one of the entries in disks[] collection." + }, + "kernel": { + "type": "string", + "description": "URL of the kernel resource to use when booting. In case of booting from persistent disk, this parameter is required. When booting from a disk image, it is optional, but may be provided to use a different kernel than the one associated with the image." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#instance" + }, + "machineType": { + "type": "string", + "description": "URL of the machine type resource describing which machine type to use to host the instance; provided by the client when the instance is created.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "metadata": { + "$ref": "Metadata", + "description": "Metadata key/value pairs assigned to this instance. Consists of custom metadata or predefined keys; see Instance documentation for more information." + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "networkInterfaces": { + "type": "array", + "description": "Array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.", + "items": { + "$ref": "NetworkInterface" + } + }, + "scheduling": { + "$ref": "Scheduling", + "description": "Scheduling options for this instance." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + }, + "serviceAccounts": { + "type": "array", + "description": "A list of service accounts each with specified scopes, for which access tokens are to be made available to the instance through metadata queries.", + "items": { + "$ref": "ServiceAccount" + } + }, + "status": { + "type": "string", + "description": "Instance status. One of the following values: \"PROVISIONING\", \"STAGING\", \"RUNNING\", \"STOPPING\", \"STOPPED\", \"TERMINATED\" (output only).", + "enum": [ + "PROVISIONING", + "RUNNING", + "STAGING", + "STOPPED", + "STOPPING", + "TERMINATED" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "statusMessage": { + "type": "string", + "description": "An optional, human-readable explanation of the status (output only)." + }, + "tags": { + "$ref": "Tags", + "description": "A list of tags to be applied to this instance. Used to identify valid sources or targets for network firewalls. Provided by the client on instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035." + }, + "zone": { + "type": "string", + "description": "URL of the zone where the instance resides (output only)." + } + } + }, + "InstanceAggregatedList": { + "id": "InstanceAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped instance lists.", + "additionalProperties": { + "$ref": "InstancesScopedList", + "description": "Name of the scope containing this set of instances." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#instanceAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "InstanceList": { + "id": "InstanceList", + "type": "object", + "description": "Contains a list of instance resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "A list of instance resources.", + "items": { + "$ref": "Instance" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#instanceList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "InstanceReference": { + "id": "InstanceReference", + "type": "object", + "properties": { + "instance": { + "type": "string" + } + } + }, + "InstancesScopedList": { + "id": "InstancesScopedList", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "List of instances contained in this scope.", + "items": { + "$ref": "Instance" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of instances when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "Kernel": { + "id": "Kernel", + "type": "object", + "description": "A kernel resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this kernel." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#kernel" + }, + "name": { + "type": "string", + "description": "Name of the resource.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "KernelList": { + "id": "KernelList", + "type": "object", + "description": "Contains a list of kernel resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The kernel resources.", + "items": { + "$ref": "Kernel" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#kernelList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "MachineType": { + "id": "MachineType", + "type": "object", + "description": "A machine type resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this machine type." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "guestCpus": { + "type": "integer", + "description": "Count of CPUs exposed to the instance.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "imageSpaceGb": { + "type": "integer", + "description": "Space allotted for the image, defined in GB.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#machineType" + }, + "maximumPersistentDisks": { + "type": "integer", + "description": "Maximum persistent disks allowed.", + "format": "int32" + }, + "maximumPersistentDisksSizeGb": { + "type": "string", + "description": "Maximum total persistent disks size (GB) allowed.", + "format": "int64" + }, + "memoryMb": { + "type": "integer", + "description": "Physical memory assigned to the instance, defined in MB.", + "format": "int32" + }, + "name": { + "type": "string", + "description": "Name of the resource.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "scratchDisks": { + "type": "array", + "description": "List of extended scratch disks assigned to the instance.", + "items": { + "type": "object", + "properties": { + "diskGb": { + "type": "integer", + "description": "Size of the scratch disk, defined in GB.", + "format": "int32" + } + } + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "zone": { + "type": "string", + "description": "Url of the zone where the machine type resides (output only)." + } + } + }, + "MachineTypeAggregatedList": { + "id": "MachineTypeAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped machine type lists.", + "additionalProperties": { + "$ref": "MachineTypesScopedList", + "description": "Name of the scope containing this set of machine types." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#machineTypeAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "MachineTypeList": { + "id": "MachineTypeList", + "type": "object", + "description": "Contains a list of machine type resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The machine type resources.", + "items": { + "$ref": "MachineType" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#machineTypeList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "MachineTypesScopedList": { + "id": "MachineTypesScopedList", + "type": "object", + "properties": { + "machineTypes": { + "type": "array", + "description": "List of machine types contained in this scope.", + "items": { + "$ref": "MachineType" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of machine types when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "Metadata": { + "id": "Metadata", + "type": "object", + "description": "A metadata key/value entry.", + "properties": { + "fingerprint": { + "type": "string", + "description": "Fingerprint of this resource. A hash of the metadata's contents. This field is used for optimistic locking. An up-to-date metadata fingerprint must be provided in order to modify metadata.", + "format": "byte" + }, + "items": { + "type": "array", + "description": "Array of key/value pairs. The total size of all keys and values must be less than 512 KB.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.", + "pattern": "[a-zA-Z0-9-_]{1,128}", + "annotations": { + "required": [ + "compute.instances.insert", + "compute.projects.setCommonInstanceMetadata" + ] + } + }, + "value": { + "type": "string", + "description": "Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes.", + "annotations": { + "required": [ + "compute.instances.insert", + "compute.projects.setCommonInstanceMetadata" + ] + } + } + } + } + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#metadata" + } + } + }, + "Network": { + "id": "Network", + "type": "object", + "description": "A network resource.", + "properties": { + "IPv4Range": { + "type": "string", + "description": "Required; The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client when the network is created.", + "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}/[0-9]{1,2}", + "annotations": { + "required": [ + "compute.networks.insert" + ] + } + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "gatewayIPv4": { + "type": "string", + "description": "An optional address that is used for default routing to other networks. This must be within the range specified by IPv4Range, and is typically the first usable address in that range. If not specified, the default value is the first usable address in IPv4Range.", + "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#network" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.networks.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "NetworkInterface": { + "id": "NetworkInterface", + "type": "object", + "description": "A network interface resource attached to an instance.", + "properties": { + "accessConfigs": { + "type": "array", + "description": "Array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.", + "items": { + "$ref": "AccessConfig" + } + }, + "name": { + "type": "string", + "description": "Name of the network interface, determined by the server; for network devices, these are e.g. eth0, eth1, etc. (output only)." + }, + "network": { + "type": "string", + "description": "URL of the network resource attached to this interface.", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "networkIP": { + "type": "string", + "description": "An optional IPV4 internal network address assigned to the instance for this network interface (output only)." + } + } + }, + "NetworkList": { + "id": "NetworkList", + "type": "object", + "description": "Contains a list of network resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The network resources.", + "items": { + "$ref": "Network" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#networkList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "An operation resource, used to manage asynchronous API requests.", + "properties": { + "clientOperationId": { + "type": "string", + "description": "An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only)." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "endTime": { + "type": "string", + "description": "The time that this operation was completed. This is in RFC 3339 format (output only)." + }, + "error": { + "type": "object", + "description": "If errors occurred during processing of this operation, this field will be populated (output only).", + "properties": { + "errors": { + "type": "array", + "description": "The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "An optional, human-readable error message." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only)." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "If operation fails, the HTTP error status code returned, e.g. 404. (output only).", + "format": "int32" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "The time that this operation was requested. This is in RFC 3339 format (output only)." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#operation" + }, + "name": { + "type": "string", + "description": "Name of the resource (output only)." + }, + "operationType": { + "type": "string", + "description": "Type of the operation. Examples include \"insert\", \"update\", and \"delete\" (output only)." + }, + "progress": { + "type": "integer", + "description": "An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only).", + "format": "int32" + }, + "region": { + "type": "string", + "description": "URL of the region where the operation resides (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "startTime": { + "type": "string", + "description": "The time that this operation was started by the server. This is in RFC 3339 format (output only)." + }, + "status": { + "type": "string", + "description": "Status of the operation. Can be one of the following: \"PENDING\", \"RUNNING\", or \"DONE\" (output only).", + "enum": [ + "DONE", + "PENDING", + "RUNNING" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "statusMessage": { + "type": "string", + "description": "An optional textual description of the current status of the operation (output only)." + }, + "targetId": { + "type": "string", + "description": "Unique target id which identifies a particular incarnation of the target (output only).", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "URL of the resource the operation is mutating (output only)." + }, + "user": { + "type": "string", + "description": "User who requested the operation, for example \"user@example.com\" (output only)." + }, + "warnings": { + "type": "array", + "description": "If warning messages generated during processing of this operation, this field will be populated (output only).", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + }, + "zone": { + "type": "string", + "description": "URL of the zone where the operation resides (output only)." + } + } + }, + "OperationAggregatedList": { + "id": "OperationAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped operation lists.", + "additionalProperties": { + "$ref": "OperationsScopedList", + "description": "Name of the scope containing this set of operations." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#operationAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "OperationList": { + "id": "OperationList", + "type": "object", + "description": "Contains a list of operation resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The operation resources.", + "items": { + "$ref": "Operation" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#operationList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "OperationsScopedList": { + "id": "OperationsScopedList", + "type": "object", + "properties": { + "operations": { + "type": "array", + "description": "List of operations contained in this scope.", + "items": { + "$ref": "Operation" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of operations when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "Project": { + "id": "Project", + "type": "object", + "description": "A project resource. Projects can be created only in the APIs Console. Unless marked otherwise, values can only be modified in the console.", + "properties": { + "commonInstanceMetadata": { + "$ref": "Metadata", + "description": "Metadata key/value pairs available to all instances contained in this project." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#project" + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "quotas": { + "type": "array", + "description": "Quotas assigned to this project.", + "items": { + "$ref": "Quota" + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "Quota": { + "id": "Quota", + "type": "object", + "description": "A quotas entry.", + "properties": { + "limit": { + "type": "number", + "description": "Quota limit for this metric.", + "format": "double" + }, + "metric": { + "type": "string", + "description": "Name of the quota metric.", + "enum": [ + "CPUS", + "DISKS", + "DISKS_TOTAL_GB", + "EPHEMERAL_ADDRESSES", + "FIREWALLS", + "FORWARDING_RULES", + "HEALTH_CHECKS", + "IMAGES", + "IMAGES_TOTAL_GB", + "INSTANCES", + "IN_USE_ADDRESSES", + "KERNELS", + "KERNELS_TOTAL_GB", + "NETWORKS", + "OPERATIONS", + "ROUTES", + "SNAPSHOTS", + "STATIC_ADDRESSES", + "TARGET_POOLS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "usage": { + "type": "number", + "description": "Current usage of this metric.", + "format": "double" + } + } + }, + "Region": { + "id": "Region", + "type": "object", + "description": "Region resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this region." + }, + "description": { + "type": "string", + "description": "Textual description of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#region" + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "quotas": { + "type": "array", + "description": "Quotas assigned to this region.", + "items": { + "$ref": "Quota" + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "status": { + "type": "string", + "description": "Status of the region, \"UP\" or \"DOWN\".", + "enum": [ + "DOWN", + "UP" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "zones": { + "type": "array", + "description": "A list of zones homed in this region, in the form of resource URLs.", + "items": { + "type": "string" + } + } + } + }, + "RegionList": { + "id": "RegionList", + "type": "object", + "description": "Contains a list of region resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The region resources.", + "items": { + "$ref": "Region" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#regionList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Route": { + "id": "Route", + "type": "object", + "description": "The route resource. A Route is a rule that specifies how certain packets should be handled by the virtual network. Routes are associated with VMs by tag and the set of Routes for a particular VM is called its routing table. For each packet leaving a VM, the system searches that VM's routing table for a single best matching Route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the Route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching Routes. The packet is then forwarded as specified by the next_hop field of the winning Route -- either to another VM destination, a VM gateway or a GCE operated gateway. Packets that do not match any Route in the sending VM's routing table will be dropped.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "destRange": { + "type": "string", + "description": "Which packets does this route apply to?", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#route" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "network": { + "type": "string", + "description": "URL of the network to which this route is applied; provided by the client when the route is created.", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "nextHopGateway": { + "type": "string", + "description": "The URL to a gateway that should handle matching packets." + }, + "nextHopInstance": { + "type": "string", + "description": "The URL to an instance that should handle matching packets." + }, + "nextHopIp": { + "type": "string", + "description": "The network IP address of an instance that should handle matching packets." + }, + "nextHopNetwork": { + "type": "string", + "description": "The URL of the local network if it should handle matching packets." + }, + "priority": { + "type": "integer", + "description": "Breaks ties between Routes of equal specificity. Routes with smaller values win when tied with routes with larger values.", + "format": "uint32", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "tags": { + "type": "array", + "description": "A list of instance tags to which this route applies.", + "items": { + "type": "string" + }, + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "warnings": { + "type": "array", + "description": "If potential misconfigurations are detected for this route, this field will be populated with warning messages.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + } + }, + "RouteList": { + "id": "RouteList", + "type": "object", + "description": "Contains a list of route resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The route resources.", + "items": { + "$ref": "Route" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#routeList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Scheduling": { + "id": "Scheduling", + "type": "object", + "description": "Scheduling options for an Instance.", + "properties": { + "automaticRestart": { + "type": "boolean", + "description": "Whether the Instance should be automatically restarted whenever it is terminated by Compute Engine (not terminated by user)." + }, + "onHostMaintenance": { + "type": "string", + "description": "How the instance should behave when the host machine undergoes maintenance that may temporarily impact instance performance.", + "enum": [ + "MIGRATE", + "TERMINATE" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "SerialPortOutput": { + "id": "SerialPortOutput", + "type": "object", + "description": "An instance serial console output.", + "properties": { + "contents": { + "type": "string", + "description": "The contents of the console output." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#serialPortOutput" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + } + } + }, + "ServiceAccount": { + "id": "ServiceAccount", + "type": "object", + "description": "A service account.", + "properties": { + "email": { + "type": "string", + "description": "Email address of the service account." + }, + "scopes": { + "type": "array", + "description": "The list of scopes to be made available for this service account.", + "items": { + "type": "string" + } + } + } + }, + "Snapshot": { + "id": "Snapshot", + "type": "object", + "description": "A persistent disk snapshot resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "diskSizeGb": { + "type": "string", + "description": "Size of the persistent disk snapshot, specified in GB (output only).", + "format": "int64" + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#snapshot" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sourceDisk": { + "type": "string", + "description": "The source disk used to create this snapshot. Once the source disk has been deleted from the system, this field will be cleared, and will not be set even if a disk with the same name has been re-created (output only)." + }, + "sourceDiskId": { + "type": "string", + "description": "The 'id' value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name." + }, + "status": { + "type": "string", + "description": "The status of the persistent disk snapshot (output only).", + "enum": [ + "CREATING", + "DELETING", + "FAILED", + "READY", + "UPLOADING" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "storageBytes": { + "type": "string", + "description": "A size of the the storage used by the snapshot. As snapshots share storage this number is expected to change with snapshot creation/deletion.", + "format": "int64" + }, + "storageBytesStatus": { + "type": "string", + "description": "An indicator whether storageBytes is in a stable state, or it is being adjusted as a result of shared storage reallocation.", + "enum": [ + "UPDATING", + "UP_TO_DATE" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "SnapshotList": { + "id": "SnapshotList", + "type": "object", + "description": "Contains a list of persistent disk snapshot resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The persistent snapshot resources.", + "items": { + "$ref": "Snapshot" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#snapshotList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "Tags": { + "id": "Tags", + "type": "object", + "description": "A set of instance tags.", + "properties": { + "fingerprint": { + "type": "string", + "description": "Fingerprint of this resource. A hash of the tags stored in this object. This field is used optimistic locking. An up-to-date tags fingerprint must be provided in order to modify tags.", + "format": "byte" + }, + "items": { + "type": "array", + "description": "An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.", + "items": { + "type": "string" + } + } + } + }, + "TargetPool": { + "id": "TargetPool", + "type": "object", + "description": "A TargetPool resource. This resource defines a pool of VMs, associated HttpHealthCheck resources, and the fallback TargetPool.", + "properties": { + "backupPool": { + "type": "string", + "description": "This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its 'failoverRatio' field is properly set to a value between [0, 1].\n\n'backupPool' and 'failoverRatio' together define the fallback behavior of the primary target pool: if the ratio of the healthy VMs in the primary pool is at or below 'failoverRatio', traffic arriving at the load-balanced IP will be directed to the backup pool.\n\nIn case where 'failoverRatio' and 'backupPool' are not set, or all the VMs in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the \"force\" mode, where traffic will be spread to the healthy VMs with the best effort, or to all VMs when no VM is healthy." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "failoverRatio": { + "type": "number", + "description": "This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some other target pool). The value of the field must be in [0, 1].\n\nIf set, 'backupPool' must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy VMs in the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool.\n\nIn case where 'failoverRatio' is not set or all the VMs in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the \"force\" mode, where traffic will be spread to the healthy VMs with the best effort, or to all VMs when no VM is healthy.", + "format": "float" + }, + "healthChecks": { + "type": "array", + "description": "A list of URLs to the HttpHealthCheck resource. A member VM in this pool is considered healthy if and only if all specified health checks pass. An empty list means all member VMs will be considered healthy at all times.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "instances": { + "type": "array", + "description": "A list of resource URLs to the member VMs serving this pool. They must live in zones contained in the same region as this pool.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#targetPool" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "region": { + "type": "string", + "description": "URL of the region where the target pool resides (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "sessionAffinity": { + "type": "string", + "description": "Sesssion affinity option, must be one of the following values: 'NONE': Connections from the same client IP may go to any VM in the pool; 'CLIENT_IP': Connections from the same client IP will go to the same VM in the pool while that VM remains healthy. 'CLIENT_IP_PROTO': Connections from the same client IP with the same IP protocol will go to the same VM in the pool while that VM remains healthy.", + "enum": [ + "CLIENT_IP", + "CLIENT_IP_PROTO", + "NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "TargetPoolAggregatedList": { + "id": "TargetPoolAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped target pool lists.", + "additionalProperties": { + "$ref": "TargetPoolsScopedList", + "description": "Name of the scope containing this set of target pools." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetPoolAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "TargetPoolInstanceHealth": { + "id": "TargetPoolInstanceHealth", + "type": "object", + "properties": { + "healthStatus": { + "type": "array", + "items": { + "$ref": "HealthStatus" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetPoolInstanceHealth" + } + } + }, + "TargetPoolList": { + "id": "TargetPoolList", + "type": "object", + "description": "Contains a list of TargetPool resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The TargetPool resources.", + "items": { + "$ref": "TargetPool" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetPoolList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "TargetPoolsAddHealthCheckRequest": { + "id": "TargetPoolsAddHealthCheckRequest", + "type": "object", + "properties": { + "healthChecks": { + "type": "array", + "description": "Health check URLs to be added to targetPool.", + "items": { + "$ref": "HealthCheckReference" + } + } + } + }, + "TargetPoolsAddInstanceRequest": { + "id": "TargetPoolsAddInstanceRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "URLs of the instances to be added to targetPool.", + "items": { + "$ref": "InstanceReference" + } + } + } + }, + "TargetPoolsRemoveHealthCheckRequest": { + "id": "TargetPoolsRemoveHealthCheckRequest", + "type": "object", + "properties": { + "healthChecks": { + "type": "array", + "description": "Health check URLs to be removed from targetPool.", + "items": { + "$ref": "HealthCheckReference" + } + } + } + }, + "TargetPoolsRemoveInstanceRequest": { + "id": "TargetPoolsRemoveInstanceRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "URLs of the instances to be removed from targetPool.", + "items": { + "$ref": "InstanceReference" + } + } + } + }, + "TargetPoolsScopedList": { + "id": "TargetPoolsScopedList", + "type": "object", + "properties": { + "targetPools": { + "type": "array", + "description": "List of target pools contained in this scope.", + "items": { + "$ref": "TargetPool" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of addresses when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "Metadata for this warning in 'key: value' format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "A key for the warning data." + }, + "value": { + "type": "string", + "description": "A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "Optional human-readable details for this warning." + } + } + } + } + }, + "TargetReference": { + "id": "TargetReference", + "type": "object", + "properties": { + "target": { + "type": "string" + } + } + }, + "Zone": { + "id": "Zone", + "type": "object", + "description": "A zone resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "The deprecation status associated with this zone." + }, + "description": { + "type": "string", + "description": "Textual description of the resource." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#zone" + }, + "maintenanceWindows": { + "type": "array", + "description": "Scheduled maintenance windows for the zone. When the zone is in a maintenance window, all resources which reside in the zone will be unavailable.", + "items": { + "type": "object", + "properties": { + "beginTime": { + "type": "string", + "description": "Begin time of the maintenance window, in RFC 3339 format." + }, + "description": { + "type": "string", + "description": "Textual description of the maintenance window." + }, + "endTime": { + "type": "string", + "description": "End time of the maintenance window, in RFC 3339 format." + }, + "name": { + "type": "string", + "description": "Name of the maintenance window." + } + } + } + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "region": { + "type": "string", + "description": "Full URL reference to the region which hosts the zone (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "status": { + "type": "string", + "description": "Status of the zone. \"UP\" or \"DOWN\".", + "enum": [ + "DOWN", + "UP" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "ZoneList": { + "id": "ZoneList", + "type": "object", + "description": "Contains a list of zone resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "The zone resources.", + "items": { + "$ref": "Zone" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#zoneList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + } + }, + "resources": { + "addresses": { + "methods": { + "aggregatedList": { + "id": "compute.addresses.aggregatedList", + "path": "{project}/aggregated/addresses", + "httpMethod": "GET", + "description": "Retrieves the list of addresses grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "AddressAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.addresses.delete", + "path": "{project}/regions/{region}/addresses/{address}", + "httpMethod": "DELETE", + "description": "Deletes the specified address resource.", + "parameters": { + "address": { + "type": "string", + "description": "Name of the address resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "address" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.addresses.get", + "path": "{project}/regions/{region}/addresses/{address}", + "httpMethod": "GET", + "description": "Returns the specified address resource.", + "parameters": { + "address": { + "type": "string", + "description": "Name of the address resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "address" + ], + "response": { + "$ref": "Address" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.addresses.insert", + "path": "{project}/regions/{region}/addresses", + "httpMethod": "POST", + "description": "Creates an address resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "request": { + "$ref": "Address" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.addresses.list", + "path": "{project}/regions/{region}/addresses", + "httpMethod": "GET", + "description": "Retrieves the list of address resources contained within the specified region.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "AddressList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "disks": { + "methods": { + "aggregatedList": { + "id": "compute.disks.aggregatedList", + "path": "{project}/aggregated/disks", + "httpMethod": "GET", + "description": "Retrieves the list of disks grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "DiskAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "createSnapshot": { + "id": "compute.disks.createSnapshot", + "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot", + "httpMethod": "POST", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk resource to snapshot.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "disk" + ], + "request": { + "$ref": "Snapshot" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "delete": { + "id": "compute.disks.delete", + "path": "{project}/zones/{zone}/disks/{disk}", + "httpMethod": "DELETE", + "description": "Deletes the specified persistent disk resource.", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "disk" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.disks.get", + "path": "{project}/zones/{zone}/disks/{disk}", + "httpMethod": "GET", + "description": "Returns the specified persistent disk resource.", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "disk" + ], + "response": { + "$ref": "Disk" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.disks.insert", + "path": "{project}/zones/{zone}/disks", + "httpMethod": "POST", + "description": "Creates a persistent disk resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "sourceImage": { + "type": "string", + "description": "Optional. Source image to restore onto a disk.", + "location": "query" + }, + "zone": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "Disk" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.disks.list", + "path": "{project}/zones/{zone}/disks", + "httpMethod": "GET", + "description": "Retrieves the list of persistent disk resources contained within the specified zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "DiskList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "firewalls": { + "methods": { + "delete": { + "id": "compute.firewalls.delete", + "path": "{project}/global/firewalls/{firewall}", + "httpMethod": "DELETE", + "description": "Deletes the specified firewall resource.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.firewalls.get", + "path": "{project}/global/firewalls/{firewall}", + "httpMethod": "GET", + "description": "Returns the specified firewall resource.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "response": { + "$ref": "Firewall" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.firewalls.insert", + "path": "{project}/global/firewalls", + "httpMethod": "POST", + "description": "Creates a firewall resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Firewall" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.firewalls.list", + "path": "{project}/global/firewalls", + "httpMethod": "GET", + "description": "Retrieves the list of firewall resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "FirewallList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.firewalls.patch", + "path": "{project}/global/firewalls/{firewall}", + "httpMethod": "PATCH", + "description": "Updates the specified firewall resource with the data included in the request. This method supports patch semantics.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "request": { + "$ref": "Firewall" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "compute.firewalls.update", + "path": "{project}/global/firewalls/{firewall}", + "httpMethod": "PUT", + "description": "Updates the specified firewall resource with the data included in the request.", + "parameters": { + "firewall": { + "type": "string", + "description": "Name of the firewall resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "firewall" + ], + "request": { + "$ref": "Firewall" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "forwardingRules": { + "methods": { + "aggregatedList": { + "id": "compute.forwardingRules.aggregatedList", + "path": "{project}/aggregated/forwardingRules", + "httpMethod": "GET", + "description": "Retrieves the list of forwarding rules grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "ForwardingRuleAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.forwardingRules.delete", + "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}", + "httpMethod": "DELETE", + "description": "Deletes the specified ForwardingRule resource.", + "parameters": { + "forwardingRule": { + "type": "string", + "description": "Name of the ForwardingRule resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "forwardingRule" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.forwardingRules.get", + "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}", + "httpMethod": "GET", + "description": "Returns the specified ForwardingRule resource.", + "parameters": { + "forwardingRule": { + "type": "string", + "description": "Name of the ForwardingRule resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "forwardingRule" + ], + "response": { + "$ref": "ForwardingRule" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.forwardingRules.insert", + "path": "{project}/regions/{region}/forwardingRules", + "httpMethod": "POST", + "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "request": { + "$ref": "ForwardingRule" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.forwardingRules.list", + "path": "{project}/regions/{region}/forwardingRules", + "httpMethod": "GET", + "description": "Retrieves the list of ForwardingRule resources available to the specified project and region.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "ForwardingRuleList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "setTarget": { + "id": "compute.forwardingRules.setTarget", + "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget", + "httpMethod": "POST", + "description": "Changes target url for forwarding rule.", + "parameters": { + "forwardingRule": { + "type": "string", + "description": "Name of the ForwardingRule resource in which target is to be set.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "forwardingRule" + ], + "request": { + "$ref": "TargetReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "globalOperations": { + "methods": { + "aggregatedList": { + "id": "compute.globalOperations.aggregatedList", + "path": "{project}/aggregated/operations", + "httpMethod": "GET", + "description": "Retrieves the list of all operations grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "OperationAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.globalOperations.delete", + "path": "{project}/global/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "operation" + ], + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.globalOperations.get", + "path": "{project}/global/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "operation" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.globalOperations.list", + "path": "{project}/global/operations", + "httpMethod": "GET", + "description": "Retrieves the list of operation resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "OperationList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "httpHealthChecks": { + "methods": { + "delete": { + "id": "compute.httpHealthChecks.delete", + "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + "httpMethod": "DELETE", + "description": "Deletes the specified HttpHealthCheck resource.", + "parameters": { + "httpHealthCheck": { + "type": "string", + "description": "Name of the HttpHealthCheck resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "httpHealthCheck" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.httpHealthChecks.get", + "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + "httpMethod": "GET", + "description": "Returns the specified HttpHealthCheck resource.", + "parameters": { + "httpHealthCheck": { + "type": "string", + "description": "Name of the HttpHealthCheck resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "httpHealthCheck" + ], + "response": { + "$ref": "HttpHealthCheck" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.httpHealthChecks.insert", + "path": "{project}/global/httpHealthChecks", + "httpMethod": "POST", + "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "HttpHealthCheck" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.httpHealthChecks.list", + "path": "{project}/global/httpHealthChecks", + "httpMethod": "GET", + "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "HttpHealthCheckList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.httpHealthChecks.patch", + "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + "httpMethod": "PATCH", + "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + "parameters": { + "httpHealthCheck": { + "type": "string", + "description": "Name of the HttpHealthCheck resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "httpHealthCheck" + ], + "request": { + "$ref": "HttpHealthCheck" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "compute.httpHealthChecks.update", + "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + "httpMethod": "PUT", + "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.", + "parameters": { + "httpHealthCheck": { + "type": "string", + "description": "Name of the HttpHealthCheck resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "httpHealthCheck" + ], + "request": { + "$ref": "HttpHealthCheck" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "images": { + "methods": { + "delete": { + "id": "compute.images.delete", + "path": "{project}/global/images/{image}", + "httpMethod": "DELETE", + "description": "Deletes the specified image resource.", + "parameters": { + "image": { + "type": "string", + "description": "Name of the image resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "image" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "deprecate": { + "id": "compute.images.deprecate", + "path": "{project}/global/images/{image}/deprecate", + "httpMethod": "POST", + "description": "Sets the deprecation status of an image. If no message body is given, clears the deprecation status instead.", + "parameters": { + "image": { + "type": "string", + "description": "Image name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "image" + ], + "request": { + "$ref": "DeprecationStatus" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.images.get", + "path": "{project}/global/images/{image}", + "httpMethod": "GET", + "description": "Returns the specified image resource.", + "parameters": { + "image": { + "type": "string", + "description": "Name of the image resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "image" + ], + "response": { + "$ref": "Image" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.images.insert", + "path": "{project}/global/images", + "httpMethod": "POST", + "description": "Creates an image resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Image" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "list": { + "id": "compute.images.list", + "path": "{project}/global/images", + "httpMethod": "GET", + "description": "Retrieves the list of image resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "ImageList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "instances": { + "methods": { + "addAccessConfig": { + "id": "compute.instances.addAccessConfig", + "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig", + "httpMethod": "POST", + "description": "Adds an access config to an instance's network interface.", + "parameters": { + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "networkInterface": { + "type": "string", + "description": "Network interface name.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance", + "networkInterface" + ], + "request": { + "$ref": "AccessConfig" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "aggregatedList": { + "id": "compute.instances.aggregatedList", + "path": "{project}/aggregated/instances", + "httpMethod": "GET", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "InstanceAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "attachDisk": { + "id": "compute.instances.attachDisk", + "path": "{project}/zones/{zone}/instances/{instance}/attachDisk", + "httpMethod": "POST", + "description": "Attaches a disk resource to an instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "request": { + "$ref": "AttachedDisk" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "delete": { + "id": "compute.instances.delete", + "path": "{project}/zones/{zone}/instances/{instance}", + "httpMethod": "DELETE", + "description": "Deletes the specified instance resource.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "deleteAccessConfig": { + "id": "compute.instances.deleteAccessConfig", + "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig", + "httpMethod": "POST", + "description": "Deletes an access config from an instance's network interface.", + "parameters": { + "accessConfig": { + "type": "string", + "description": "Access config name.", + "required": true, + "location": "query" + }, + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "networkInterface": { + "type": "string", + "description": "Network interface name.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance", + "accessConfig", + "networkInterface" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "detachDisk": { + "id": "compute.instances.detachDisk", + "path": "{project}/zones/{zone}/instances/{instance}/detachDisk", + "httpMethod": "POST", + "description": "Detaches a disk from an instance.", + "parameters": { + "deviceName": { + "type": "string", + "description": "Disk device name to detach.", + "required": true, + "pattern": "\\w[\\w.-]{0,254}", + "location": "query" + }, + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance", + "deviceName" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.instances.get", + "path": "{project}/zones/{zone}/instances/{instance}", + "httpMethod": "GET", + "description": "Returns the specified instance resource.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "Instance" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "getSerialPortOutput": { + "id": "compute.instances.getSerialPortOutput", + "path": "{project}/zones/{zone}/instances/{instance}/serialPort", + "httpMethod": "GET", + "description": "Returns the specified instance's serial port output.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "SerialPortOutput" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.instances.insert", + "path": "{project}/zones/{zone}/instances", + "httpMethod": "POST", + "description": "Creates an instance resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "Instance" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.instances.list", + "path": "{project}/zones/{zone}/instances", + "httpMethod": "GET", + "description": "Retrieves the list of instance resources contained within the specified zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "InstanceList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "reset": { + "id": "compute.instances.reset", + "path": "{project}/zones/{zone}/instances/{instance}/reset", + "httpMethod": "POST", + "description": "Performs a hard reset on the instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "setMetadata": { + "id": "compute.instances.setMetadata", + "path": "{project}/zones/{zone}/instances/{instance}/setMetadata", + "httpMethod": "POST", + "description": "Sets metadata for the specified instance to the data included in the request.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "request": { + "$ref": "Metadata" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "setScheduling": { + "id": "compute.instances.setScheduling", + "path": "{project}/zones/{zone}/instances/{instance}/setScheduling", + "httpMethod": "POST", + "description": "Sets an instance's scheduling options.", + "parameters": { + "instance": { + "type": "string", + "description": "Instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project name.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "request": { + "$ref": "Scheduling" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "setTags": { + "id": "compute.instances.setTags", + "path": "{project}/zones/{zone}/instances/{instance}/setTags", + "httpMethod": "POST", + "description": "Sets tags for the specified instance to the data included in the request.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "request": { + "$ref": "Tags" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "kernels": { + "methods": { + "get": { + "id": "compute.kernels.get", + "path": "{project}/global/kernels/{kernel}", + "httpMethod": "GET", + "description": "Returns the specified kernel resource.", + "parameters": { + "kernel": { + "type": "string", + "description": "Name of the kernel resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "kernel" + ], + "response": { + "$ref": "Kernel" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.kernels.list", + "path": "{project}/global/kernels", + "httpMethod": "GET", + "description": "Retrieves the list of kernel resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "KernelList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "machineTypes": { + "methods": { + "aggregatedList": { + "id": "compute.machineTypes.aggregatedList", + "path": "{project}/aggregated/machineTypes", + "httpMethod": "GET", + "description": "Retrieves the list of machine type resources grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "MachineTypeAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "get": { + "id": "compute.machineTypes.get", + "path": "{project}/zones/{zone}/machineTypes/{machineType}", + "httpMethod": "GET", + "description": "Returns the specified machine type resource.", + "parameters": { + "machineType": { + "type": "string", + "description": "Name of the machine type resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "machineType" + ], + "response": { + "$ref": "MachineType" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.machineTypes.list", + "path": "{project}/zones/{zone}/machineTypes", + "httpMethod": "GET", + "description": "Retrieves the list of machine type resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "MachineTypeList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "networks": { + "methods": { + "delete": { + "id": "compute.networks.delete", + "path": "{project}/global/networks/{network}", + "httpMethod": "DELETE", + "description": "Deletes the specified network resource.", + "parameters": { + "network": { + "type": "string", + "description": "Name of the network resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "network" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.networks.get", + "path": "{project}/global/networks/{network}", + "httpMethod": "GET", + "description": "Returns the specified network resource.", + "parameters": { + "network": { + "type": "string", + "description": "Name of the network resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "network" + ], + "response": { + "$ref": "Network" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.networks.insert", + "path": "{project}/global/networks", + "httpMethod": "POST", + "description": "Creates a network resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Network" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.networks.list", + "path": "{project}/global/networks", + "httpMethod": "GET", + "description": "Retrieves the list of network resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "NetworkList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "projects": { + "methods": { + "get": { + "id": "compute.projects.get", + "path": "{project}", + "httpMethod": "GET", + "description": "Returns the specified project resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project resource to retrieve.", + "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": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "setCommonInstanceMetadata": { + "id": "compute.projects.setCommonInstanceMetadata", + "path": "{project}/setCommonInstanceMetadata", + "httpMethod": "POST", + "description": "Sets metadata common to all instances within the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Metadata" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "regionOperations": { + "methods": { + "delete": { + "id": "compute.regionOperations.delete", + "path": "{project}/regions/{region}/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified region-specific operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "operation" + ], + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.regionOperations.get", + "path": "{project}/regions/{region}/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified region-specific operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "operation" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.regionOperations.list", + "path": "{project}/regions/{region}/operations", + "httpMethod": "GET", + "description": "Retrieves the list of operation resources contained within the specified region.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "OperationList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "regions": { + "methods": { + "get": { + "id": "compute.regions.get", + "path": "{project}/regions/{region}", + "httpMethod": "GET", + "description": "Returns the specified region resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "Region" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.regions.list", + "path": "{project}/regions", + "httpMethod": "GET", + "description": "Retrieves the list of region resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "RegionList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "routes": { + "methods": { + "delete": { + "id": "compute.routes.delete", + "path": "{project}/global/routes/{route}", + "httpMethod": "DELETE", + "description": "Deletes the specified route resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "route": { + "type": "string", + "description": "Name of the route resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "route" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.routes.get", + "path": "{project}/global/routes/{route}", + "httpMethod": "GET", + "description": "Returns the specified route resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "route": { + "type": "string", + "description": "Name of the route resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "route" + ], + "response": { + "$ref": "Route" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.routes.insert", + "path": "{project}/global/routes", + "httpMethod": "POST", + "description": "Creates a route resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ], + "request": { + "$ref": "Route" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.routes.list", + "path": "{project}/global/routes", + "httpMethod": "GET", + "description": "Retrieves the list of route resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "RouteList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "snapshots": { + "methods": { + "delete": { + "id": "compute.snapshots.delete", + "path": "{project}/global/snapshots/{snapshot}", + "httpMethod": "DELETE", + "description": "Deletes the specified persistent disk snapshot resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "snapshot": { + "type": "string", + "description": "Name of the persistent disk snapshot resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "snapshot" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.snapshots.get", + "path": "{project}/global/snapshots/{snapshot}", + "httpMethod": "GET", + "description": "Returns the specified persistent disk snapshot resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "snapshot": { + "type": "string", + "description": "Name of the persistent disk snapshot resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "snapshot" + ], + "response": { + "$ref": "Snapshot" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.snapshots.list", + "path": "{project}/global/snapshots", + "httpMethod": "GET", + "description": "Retrieves the list of persistent disk snapshot resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "SnapshotList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "targetPools": { + "methods": { + "addHealthCheck": { + "id": "compute.targetPools.addHealthCheck", + "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck", + "httpMethod": "POST", + "description": "Adds health check URL to targetPool.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to which health_check_url is to be added.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "request": { + "$ref": "TargetPoolsAddHealthCheckRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "addInstance": { + "id": "compute.targetPools.addInstance", + "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance", + "httpMethod": "POST", + "description": "Adds instance url to targetPool.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to which instance_url is to be added.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "request": { + "$ref": "TargetPoolsAddInstanceRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "aggregatedList": { + "id": "compute.targetPools.aggregatedList", + "path": "{project}/aggregated/targetPools", + "httpMethod": "GET", + "description": "Retrieves the list of target pools grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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": "TargetPoolAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.targetPools.delete", + "path": "{project}/regions/{region}/targetPools/{targetPool}", + "httpMethod": "DELETE", + "description": "Deletes the specified TargetPool resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.targetPools.get", + "path": "{project}/regions/{region}/targetPools/{targetPool}", + "httpMethod": "GET", + "description": "Returns the specified TargetPool resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "response": { + "$ref": "TargetPool" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "getHealth": { + "id": "compute.targetPools.getHealth", + "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth", + "httpMethod": "POST", + "description": "Gets the most recent health check results for each IP for the given instance that is referenced by given TargetPool.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to which the queried instance belongs.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "request": { + "$ref": "InstanceReference" + }, + "response": { + "$ref": "TargetPoolInstanceHealth" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.targetPools.insert", + "path": "{project}/regions/{region}/targetPools", + "httpMethod": "POST", + "description": "Creates a TargetPool resource in the specified project and region using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "request": { + "$ref": "TargetPool" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.targetPools.list", + "path": "{project}/regions/{region}/targetPools", + "httpMethod": "GET", + "description": "Retrieves the list of TargetPool resources available to the specified project and region.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "TargetPoolList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "removeHealthCheck": { + "id": "compute.targetPools.removeHealthCheck", + "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck", + "httpMethod": "POST", + "description": "Removes health check URL from targetPool.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to which health_check_url is to be removed.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "request": { + "$ref": "TargetPoolsRemoveHealthCheckRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "removeInstance": { + "id": "compute.targetPools.removeInstance", + "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance", + "httpMethod": "POST", + "description": "Removes instance URL from targetPool.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource to which instance_url is to be removed.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "request": { + "$ref": "TargetPoolsRemoveInstanceRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "setBackup": { + "id": "compute.targetPools.setBackup", + "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup", + "httpMethod": "POST", + "description": "Changes backup pool configurations.", + "parameters": { + "failoverRatio": { + "type": "number", + "description": "New failoverRatio value for the containing target pool.", + "format": "float", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetPool": { + "type": "string", + "description": "Name of the TargetPool resource for which the backup is to be set.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetPool" + ], + "request": { + "$ref": "TargetReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "zoneOperations": { + "methods": { + "delete": { + "id": "compute.zoneOperations.delete", + "path": "{project}/zones/{zone}/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified zone-specific operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "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": "compute.zoneOperations.get", + "path": "{project}/zones/{zone}/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified zone-specific operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "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": "compute.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", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone scoping this request.", + "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": { + "get": { + "id": "compute.zones.get", + "path": "{project}/zones/{zone}", + "httpMethod": "GET", + "description": "Returns the specified zone resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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", + "description": "Name of the zone resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "Zone" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.zones.list", + "path": "{project}/zones", + "httpMethod": "GET", + "description": "Retrieves the list of zone resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Optional. Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "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" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta16/compute-gen.go b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta16/compute-gen.go new file mode 100644 index 0000000000000..e3dd956b9111a --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/compute/v1beta16/compute-gen.go @@ -0,0 +1,10928 @@ +// Package compute provides access to the Compute Engine API. +// +// See https://developers.google.com/compute/docs/reference/v1beta16 +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/compute/v1beta16" +// ... +// computeService, err := compute.New(oauthHttpClient) +package compute + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "compute:v1beta16" +const apiName = "compute" +const apiVersion = "v1beta16" +const basePath = "https://www.googleapis.com/compute/v1beta16/projects/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Google Compute Engine resources + ComputeScope = "https://www.googleapis.com/auth/compute" + + // View your Google Compute Engine resources + ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly" + + // Manage your data and permissions in Google Cloud Storage + DevstorageFull_controlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageRead_onlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageRead_writeScope = "https://www.googleapis.com/auth/devstorage.read_write" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client} + s.Addresses = NewAddressesService(s) + s.Disks = NewDisksService(s) + s.Firewalls = NewFirewallsService(s) + s.ForwardingRules = NewForwardingRulesService(s) + s.GlobalOperations = NewGlobalOperationsService(s) + s.HttpHealthChecks = NewHttpHealthChecksService(s) + s.Images = NewImagesService(s) + s.Instances = NewInstancesService(s) + s.Kernels = NewKernelsService(s) + s.MachineTypes = NewMachineTypesService(s) + s.Networks = NewNetworksService(s) + s.Projects = NewProjectsService(s) + s.RegionOperations = NewRegionOperationsService(s) + s.Regions = NewRegionsService(s) + s.Routes = NewRoutesService(s) + s.Snapshots = NewSnapshotsService(s) + s.TargetPools = NewTargetPoolsService(s) + s.ZoneOperations = NewZoneOperationsService(s) + s.Zones = NewZonesService(s) + return s, nil +} + +type Service struct { + client *http.Client + + Addresses *AddressesService + + Disks *DisksService + + Firewalls *FirewallsService + + ForwardingRules *ForwardingRulesService + + GlobalOperations *GlobalOperationsService + + HttpHealthChecks *HttpHealthChecksService + + Images *ImagesService + + Instances *InstancesService + + Kernels *KernelsService + + MachineTypes *MachineTypesService + + Networks *NetworksService + + Projects *ProjectsService + + RegionOperations *RegionOperationsService + + Regions *RegionsService + + Routes *RoutesService + + Snapshots *SnapshotsService + + TargetPools *TargetPoolsService + + ZoneOperations *ZoneOperationsService + + Zones *ZonesService +} + +func NewAddressesService(s *Service) *AddressesService { + rs := &AddressesService{s: s} + return rs +} + +type AddressesService struct { + s *Service +} + +func NewDisksService(s *Service) *DisksService { + rs := &DisksService{s: s} + return rs +} + +type DisksService struct { + s *Service +} + +func NewFirewallsService(s *Service) *FirewallsService { + rs := &FirewallsService{s: s} + return rs +} + +type FirewallsService struct { + s *Service +} + +func NewForwardingRulesService(s *Service) *ForwardingRulesService { + rs := &ForwardingRulesService{s: s} + return rs +} + +type ForwardingRulesService struct { + s *Service +} + +func NewGlobalOperationsService(s *Service) *GlobalOperationsService { + rs := &GlobalOperationsService{s: s} + return rs +} + +type GlobalOperationsService struct { + s *Service +} + +func NewHttpHealthChecksService(s *Service) *HttpHealthChecksService { + rs := &HttpHealthChecksService{s: s} + return rs +} + +type HttpHealthChecksService struct { + s *Service +} + +func NewImagesService(s *Service) *ImagesService { + rs := &ImagesService{s: s} + return rs +} + +type ImagesService struct { + s *Service +} + +func NewInstancesService(s *Service) *InstancesService { + rs := &InstancesService{s: s} + return rs +} + +type InstancesService struct { + s *Service +} + +func NewKernelsService(s *Service) *KernelsService { + rs := &KernelsService{s: s} + return rs +} + +type KernelsService struct { + s *Service +} + +func NewMachineTypesService(s *Service) *MachineTypesService { + rs := &MachineTypesService{s: s} + return rs +} + +type MachineTypesService struct { + s *Service +} + +func NewNetworksService(s *Service) *NetworksService { + rs := &NetworksService{s: s} + return rs +} + +type NetworksService struct { + s *Service +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + return rs +} + +type ProjectsService struct { + s *Service +} + +func NewRegionOperationsService(s *Service) *RegionOperationsService { + rs := &RegionOperationsService{s: s} + return rs +} + +type RegionOperationsService struct { + s *Service +} + +func NewRegionsService(s *Service) *RegionsService { + rs := &RegionsService{s: s} + return rs +} + +type RegionsService struct { + s *Service +} + +func NewRoutesService(s *Service) *RoutesService { + rs := &RoutesService{s: s} + return rs +} + +type RoutesService struct { + s *Service +} + +func NewSnapshotsService(s *Service) *SnapshotsService { + rs := &SnapshotsService{s: s} + return rs +} + +type SnapshotsService struct { + s *Service +} + +func NewTargetPoolsService(s *Service) *TargetPoolsService { + rs := &TargetPoolsService{s: s} + return rs +} + +type TargetPoolsService struct { + s *Service +} + +func NewZoneOperationsService(s *Service) *ZoneOperationsService { + rs := &ZoneOperationsService{s: s} + return rs +} + +type ZoneOperationsService struct { + s *Service +} + +func NewZonesService(s *Service) *ZonesService { + rs := &ZonesService{s: s} + return rs +} + +type ZonesService struct { + s *Service +} + +type AccessConfig struct { + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of this access configuration. + Name string `json:"name,omitempty"` + + // NatIP: An external IP address associated with this instance. Specify + // an unused static IP address available to the project. If not + // specified, the external IP will be drawn from a shared ephemeral + // pool. + NatIP string `json:"natIP,omitempty"` + + // Type: Type of configuration. Must be set to "ONE_TO_ONE_NAT". This + // configures port-for-port NAT to the internet. + Type string `json:"type,omitempty"` +} + +type Address struct { + // Address: The IP address represented by this resource. + Address string `json:"address,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Region: URL of the region where the address resides (output only). + Region string `json:"region,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Status: The status of the address (output only). + Status string `json:"status,omitempty"` + + // Users: The resources that are using this address resource. + Users []string `json:"users,omitempty"` +} + +type AddressAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped address lists. + Items *AddressAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type AddressAggregatedListItems struct { +} + +type AddressList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The address resources. + Items []*Address `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type AddressesScopedList struct { + // Addresses: List of addresses contained in this scope. + Addresses []*Address `json:"addresses,omitempty"` + + // Warning: Informational warning which replaces the list of addresses + // when the list is empty. + Warning *AddressesScopedListWarning `json:"warning,omitempty"` +} + +type AddressesScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*AddressesScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type AddressesScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type AttachedDisk struct { + // Boot: Indicates that this is a boot disk. VM will use the first + // partition of the disk for its root filesystem. + Boot bool `json:"boot,omitempty"` + + // DeviceName: Persistent disk only; must be unique within the instance + // when specified. This represents a unique device name that is + // reflected into the /dev/ tree of a Linux operating system running + // within the instance. If not specified, a default will be chosen by + // the system. + DeviceName string `json:"deviceName,omitempty"` + + // Index: A zero-based index to assign to this disk, where 0 is reserved + // for the boot disk. If not specified, the server will choose an + // appropriate value (output only). + Index int64 `json:"index,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Mode: The mode in which to attach this disk, either "READ_WRITE" or + // "READ_ONLY". + Mode string `json:"mode,omitempty"` + + // Source: Persistent disk only; the URL of the persistent disk + // resource. + Source string `json:"source,omitempty"` + + // Type: Type of the disk, either "SCRATCH" or "PERSISTENT". Note that + // persistent disks must be created before you can specify them here. + Type string `json:"type,omitempty"` +} + +type DeprecationStatus struct { + // Deleted: An optional RFC3339 timestamp on or after which the + // deprecation state of this resource will be changed to DELETED. + Deleted string `json:"deleted,omitempty"` + + // Deprecated: An optional RFC3339 timestamp on or after which the + // deprecation state of this resource will be changed to DEPRECATED. + Deprecated string `json:"deprecated,omitempty"` + + // Obsolete: An optional RFC3339 timestamp on or after which the + // deprecation state of this resource will be changed to OBSOLETE. + Obsolete string `json:"obsolete,omitempty"` + + // Replacement: A URL of the suggested replacement for the deprecated + // resource. The deprecated resource and its replacement must be + // resources of the same kind. + Replacement string `json:"replacement,omitempty"` + + // State: The deprecation state. Can be "DEPRECATED", "OBSOLETE", or + // "DELETED". Operations which create a new resource using a + // "DEPRECATED" resource will return successfully, but with a warning + // indicating the deprecated resource and recommending its replacement. + // New uses of "OBSOLETE" or "DELETED" resources will result in an + // error. + State string `json:"state,omitempty"` +} + +type Disk struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Options: Internal use only. + Options string `json:"options,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SizeGb: Size of the persistent disk, specified in GB. This parameter + // is optional when creating a disk from a disk image or a snapshot, + // otherwise it is required. + SizeGb int64 `json:"sizeGb,omitempty,string"` + + // SourceImage: The source image used to create this disk. Once the + // source image has been deleted from the system, this field will not be + // set, even if an image with the same name has been re-created. + SourceImage string `json:"sourceImage,omitempty"` + + // SourceImageId: The 'id' value of the image used to create this disk. + // This value may be used to determine whether the disk was created from + // the current or a previous instance of a given image. + SourceImageId string `json:"sourceImageId,omitempty"` + + // SourceSnapshot: The source snapshot used to create this disk. Once + // the source snapshot has been deleted from the system, this field will + // be cleared, and will not be set even if a snapshot with the same name + // has been re-created. + SourceSnapshot string `json:"sourceSnapshot,omitempty"` + + // SourceSnapshotId: The 'id' value of the snapshot used to create this + // disk. This value may be used to determine whether the disk was + // created from the current or a previous instance of a given disk + // snapshot. + SourceSnapshotId string `json:"sourceSnapshotId,omitempty"` + + // Status: The status of disk creation (output only). + Status string `json:"status,omitempty"` + + // Zone: URL of the zone where the disk resides (output only). + Zone string `json:"zone,omitempty"` +} + +type DiskAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped disk lists. + Items *DiskAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type DiskAggregatedListItems struct { +} + +type DiskList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The persistent disk resources. + Items []*Disk `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type DisksScopedList struct { + // Disks: List of disks contained in this scope. + Disks []*Disk `json:"disks,omitempty"` + + // Warning: Informational warning which replaces the list of disks when + // the list is empty. + Warning *DisksScopedListWarning `json:"warning,omitempty"` +} + +type DisksScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*DisksScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type DisksScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type Firewall struct { + // Allowed: The list of rules specified by this firewall. Each rule + // specifies a protocol and port-range tuple that describes a permitted + // connection. + Allowed []*FirewallAllowed `json:"allowed,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Network: URL of the network to which this firewall is applied; + // provided by the client when the firewall is created. + Network string `json:"network,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SourceRanges: A list of IP address blocks expressed in CIDR format + // which this rule applies to. One or both of sourceRanges and + // sourceTags may be set; an inbound connection is allowed if either the + // range or the tag of the source matches. + SourceRanges []string `json:"sourceRanges,omitempty"` + + // SourceTags: A list of instance tags which this rule applies to. One + // or both of sourceRanges and sourceTags may be set; an inbound + // connection is allowed if either the range or the tag of the source + // matches. + SourceTags []string `json:"sourceTags,omitempty"` + + // TargetTags: A list of instance tags indicating sets of instances + // located on network which may make network connections as specified in + // allowed. If no targetTags are specified, the firewall rule applies to + // all instances on the specified network. + TargetTags []string `json:"targetTags,omitempty"` +} + +type FirewallAllowed struct { + // IPProtocol: Required; this is the IP protocol that is allowed for + // this rule. This can either be a well known protocol string (tcp, udp + // or icmp) or the IP protocol number. + IPProtocol string `json:"IPProtocol,omitempty"` + + // Ports: An optional list of ports which are allowed. It is an error to + // specify this for any protocol that isn't UDP or TCP. Each entry must + // be either an integer or a range. If not specified, connections + // through any port are allowed. + // + // Example inputs include: ["22"], + // ["80","443"] and ["12345-12349"]. + Ports []string `json:"ports,omitempty"` +} + +type FirewallList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The firewall resources. + Items []*Firewall `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type ForwardingRule struct { + // IPAddress: Value of the reserved IP address that this forwarding rule + // is serving on behalf of. The address resource must live in the same + // region as the forwarding rule. If left empty (default value), an + // ephemeral IP will be assigned. + IPAddress string `json:"IPAddress,omitempty"` + + // IPProtocol: The IP protocol to which this rule applies, can be either + // 'TCP' or 'UDP' (If left empty, will use TCP by default). + IPProtocol string `json:"IPProtocol,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // PortRange: If 'IPProtocol' is 'TCP' or 'UDP', only packets addressed + // to ports in the specified range will be forwarded to 'target'. If + // left empty (default value), all ports are forwarded. Forwarding rules + // with the same [IPAddress, IPProtocol] pair must have disjoint port + // ranges. + PortRange string `json:"portRange,omitempty"` + + // Region: URL of the region where the forwarding rule resides (output + // only). + Region string `json:"region,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Target: The URL of the target resource to receive the matched + // traffic. It must live in the same region as this forwarding rule. + Target string `json:"target,omitempty"` +} + +type ForwardingRuleAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped forwarding rule lists. + Items *ForwardingRuleAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type ForwardingRuleAggregatedListItems struct { +} + +type ForwardingRuleList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The ForwardingRule resources. + Items []*ForwardingRule `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type ForwardingRulesScopedList struct { + // ForwardingRules: List of forwarding rules contained in this scope. + ForwardingRules []*ForwardingRule `json:"forwardingRules,omitempty"` + + // Warning: Informational warning which replaces the list of forwarding + // rules when the list is empty. + Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"` +} + +type ForwardingRulesScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type ForwardingRulesScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type HealthCheckReference struct { + HealthCheck string `json:"healthCheck,omitempty"` +} + +type HealthStatus struct { + // HealthState: Health state of the instance. + HealthState string `json:"healthState,omitempty"` + + // Instance: URL of the instance resource. + Instance string `json:"instance,omitempty"` + + // IpAddress: The IP address represented by this resource. + IpAddress string `json:"ipAddress,omitempty"` +} + +type HttpHealthCheck struct { + // CheckIntervalSec: How often (in seconds) to send a health check. The + // default value is 5 seconds. + CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // HealthyThreshold: A so-far unhealthy VM will be marked healthy after + // this many consecutive successes. The default value is 2. + HealthyThreshold int64 `json:"healthyThreshold,omitempty"` + + // Host: The value of the host header in the HTTP health check request. + // If left empty (default value), the public IP on behalf of which this + // health check is performed will be used. + Host string `json:"host,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Port: The TCP port number for the HTTP health check request. The + // default value is 80. + Port int64 `json:"port,omitempty"` + + // RequestPath: The request path of the HTTP health check request. The + // default value is "/". + RequestPath string `json:"requestPath,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // TimeoutSec: How long (in seconds) to wait before claiming failure. + // The default value is 5 seconds. + TimeoutSec int64 `json:"timeoutSec,omitempty"` + + // UnhealthyThreshold: A so-far healthy VM will be marked unhealthy + // after this many consecutive failures. The default value is 2. + UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"` +} + +type HttpHealthCheckList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The HttpHealthCheck resources. + Items []*HttpHealthCheck `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Image struct { + // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google + // Cloud Storage (in bytes). + ArchiveSizeBytes int64 `json:"archiveSizeBytes,omitempty,string"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this image. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: Textual description of the resource; provided by the + // client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // PreferredKernel: An optional URL of the preferred kernel for use with + // this disk image. If not specified, a server defined default kernel + // will be used. + PreferredKernel string `json:"preferredKernel,omitempty"` + + // RawDisk: The raw disk image parameters. + RawDisk *ImageRawDisk `json:"rawDisk,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SourceType: Must be "RAW"; provided by the client when the disk image + // is created. + SourceType string `json:"sourceType,omitempty"` + + // Status: Status of the image (output only). It will be one of the + // following READY - after image has been successfully created and is + // ready for use FAILED - if creating the image fails for some reason + // PENDING - the image creation is in progress An image can be used to + // create other resources suck as instances only after the image has + // been successfully created and the status is set to READY. + Status string `json:"status,omitempty"` +} + +type ImageRawDisk struct { + // ContainerType: The format used to encode and transmit the block + // device. Should be TAR. This is just a container and transmission + // format and not a runtime format. Provided by the client when the disk + // image is created. + ContainerType string `json:"containerType,omitempty"` + + // Sha1Checksum: An optional SHA1 checksum of the disk image before + // unpackaging; provided by the client when the disk image is created. + Sha1Checksum string `json:"sha1Checksum,omitempty"` + + // Source: The full Google Cloud Storage URL where the disk image is + // stored; provided by the client when the disk image is created. + Source string `json:"source,omitempty"` +} + +type ImageList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The disk image resources. + Items []*Image `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Instance struct { + // CanIpForward: Allows this instance to send packets with source IP + // addresses other than its own and receive packets with destination IP + // addresses other than its own. If this instance will be used as an IP + // gateway or it will be set as the next-hop in a Route resource, say + // true. If unsure, leave this set to false. + CanIpForward bool `json:"canIpForward,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Disks: Array of disks associated with this instance. Persistent disks + // must be created before you can assign them. + Disks []*AttachedDisk `json:"disks,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Image: An optional URL of the disk image resource to be installed on + // this instance; provided by the client when the instance is created. + // Alternatively to passing the image, the client may choose to boot + // from a persistent disk, by setting boot=true flag on one of the + // entries in disks[] collection. + Image string `json:"image,omitempty"` + + // Kernel: URL of the kernel resource to use when booting. In case of + // booting from persistent disk, this parameter is required. When + // booting from a disk image, it is optional, but may be provided to use + // a different kernel than the one associated with the image. + Kernel string `json:"kernel,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MachineType: URL of the machine type resource describing which + // machine type to use to host the instance; provided by the client when + // the instance is created. + MachineType string `json:"machineType,omitempty"` + + // Metadata: Metadata key/value pairs assigned to this instance. + // Consists of custom metadata or predefined keys; see Instance + // documentation for more information. + Metadata *Metadata `json:"metadata,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // NetworkInterfaces: Array of configurations for this interface. This + // specifies how this interface is configured to interact with other + // network services, such as connecting to the internet. Currently, + // ONE_TO_ONE_NAT is the only access config supported. If there are no + // accessConfigs specified, then this instance will have no external + // internet access. + NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"` + + // Scheduling: Scheduling options for this instance. + Scheduling *Scheduling `json:"scheduling,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // ServiceAccounts: A list of service accounts each with specified + // scopes, for which access tokens are to be made available to the + // instance through metadata queries. + ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"` + + // Status: Instance status. One of the following values: "PROVISIONING", + // "STAGING", "RUNNING", "STOPPING", "STOPPED", "TERMINATED" (output + // only). + Status string `json:"status,omitempty"` + + // StatusMessage: An optional, human-readable explanation of the status + // (output only). + StatusMessage string `json:"statusMessage,omitempty"` + + // Tags: A list of tags to be applied to this instance. Used to identify + // valid sources or targets for network firewalls. Provided by the + // client on instance creation. The tags can be later modified by the + // setTags method. Each tag within the list must comply with RFC1035. + Tags *Tags `json:"tags,omitempty"` + + // Zone: URL of the zone where the instance resides (output only). + Zone string `json:"zone,omitempty"` +} + +type InstanceAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped instance lists. + Items *InstanceAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type InstanceAggregatedListItems struct { +} + +type InstanceList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A list of instance resources. + Items []*Instance `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type InstanceReference struct { + Instance string `json:"instance,omitempty"` +} + +type InstancesScopedList struct { + // Instances: List of instances contained in this scope. + Instances []*Instance `json:"instances,omitempty"` + + // Warning: Informational warning which replaces the list of instances + // when the list is empty. + Warning *InstancesScopedListWarning `json:"warning,omitempty"` +} + +type InstancesScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*InstancesScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type InstancesScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type Kernel struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this kernel. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type KernelList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The kernel resources. + Items []*Kernel `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type MachineType struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this machine type. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // GuestCpus: Count of CPUs exposed to the instance. + GuestCpus int64 `json:"guestCpus,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // ImageSpaceGb: Space allotted for the image, defined in GB. + ImageSpaceGb int64 `json:"imageSpaceGb,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MaximumPersistentDisks: Maximum persistent disks allowed. + MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"` + + // MaximumPersistentDisksSizeGb: Maximum total persistent disks size + // (GB) allowed. + MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"` + + // MemoryMb: Physical memory assigned to the instance, defined in MB. + MemoryMb int64 `json:"memoryMb,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // ScratchDisks: List of extended scratch disks assigned to the + // instance. + ScratchDisks []*MachineTypeScratchDisks `json:"scratchDisks,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Zone: Url of the zone where the machine type resides (output only). + Zone string `json:"zone,omitempty"` +} + +type MachineTypeScratchDisks struct { + // DiskGb: Size of the scratch disk, defined in GB. + DiskGb int64 `json:"diskGb,omitempty"` +} + +type MachineTypeAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped machine type lists. + Items *MachineTypeAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type MachineTypeAggregatedListItems struct { +} + +type MachineTypeList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The machine type resources. + Items []*MachineType `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type MachineTypesScopedList struct { + // MachineTypes: List of machine types contained in this scope. + MachineTypes []*MachineType `json:"machineTypes,omitempty"` + + // Warning: Informational warning which replaces the list of machine + // types when the list is empty. + Warning *MachineTypesScopedListWarning `json:"warning,omitempty"` +} + +type MachineTypesScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*MachineTypesScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type MachineTypesScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type Metadata struct { + // Fingerprint: Fingerprint of this resource. A hash of the metadata's + // contents. This field is used for optimistic locking. An up-to-date + // metadata fingerprint must be provided in order to modify metadata. + Fingerprint string `json:"fingerprint,omitempty"` + + // Items: Array of key/value pairs. The total size of all keys and + // values must be less than 512 KB. + Items []*MetadataItems `json:"items,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` +} + +type MetadataItems struct { + // Key: Key for the metadata entry. Keys must conform to the following + // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is + // reflected as part of a URL in the metadata server. Additionally, to + // avoid ambiguity, keys must not conflict with any other metadata keys + // for the project. + Key string `json:"key,omitempty"` + + // Value: Value for the metadata entry. These are free-form strings, and + // only have meaning as interpreted by the image running in the + // instance. The only restriction placed on values is that their size + // must be less than or equal to 32768 bytes. + Value string `json:"value,omitempty"` +} + +type Network struct { + // IPv4Range: Required; The range of internal addresses that are legal + // on this network. This range is a CIDR specification, for example: + // 192.168.0.0/16. Provided by the client when the network is created. + IPv4Range string `json:"IPv4Range,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // GatewayIPv4: An optional address that is used for default routing to + // other networks. This must be within the range specified by IPv4Range, + // and is typically the first usable address in that range. If not + // specified, the default value is the first usable address in + // IPv4Range. + GatewayIPv4 string `json:"gatewayIPv4,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type NetworkInterface struct { + // AccessConfigs: Array of configurations for this interface. This + // specifies how this interface is configured to interact with other + // network services, such as connecting to the internet. Currently, + // ONE_TO_ONE_NAT is the only access config supported. If there are no + // accessConfigs specified, then this instance will have no external + // internet access. + AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"` + + // Name: Name of the network interface, determined by the server; for + // network devices, these are e.g. eth0, eth1, etc. (output only). + Name string `json:"name,omitempty"` + + // Network: URL of the network resource attached to this interface. + Network string `json:"network,omitempty"` + + // NetworkIP: An optional IPV4 internal network address assigned to the + // instance for this network interface (output only). + NetworkIP string `json:"networkIP,omitempty"` +} + +type NetworkList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The network resources. + Items []*Network `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Operation struct { + // ClientOperationId: An optional identifier specified by the client + // when the mutation was initiated. Must be unique for all operation + // resources in the project (output only). + ClientOperationId string `json:"clientOperationId,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // EndTime: The time that this operation was completed. This is in RFC + // 3339 format (output only). + EndTime string `json:"endTime,omitempty"` + + // Error: If errors occurred during processing of this operation, this + // field will be populated (output only). + Error *OperationError `json:"error,omitempty"` + + // HttpErrorMessage: If operation fails, the HTTP error message + // returned, e.g. NOT FOUND. (output only). + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + // HttpErrorStatusCode: If operation fails, the HTTP error status code + // returned, e.g. 404. (output only). + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: The time that this operation was requested. This is in + // RFC 3339 format (output only). + InsertTime string `json:"insertTime,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource (output only). + Name string `json:"name,omitempty"` + + // OperationType: Type of the operation. Examples include "insert", + // "update", and "delete" (output only). + OperationType string `json:"operationType,omitempty"` + + // Progress: An optional progress indicator that ranges from 0 to 100. + // There is no requirement that this be linear or support any + // granularity of operations. This should not be used to guess at when + // the operation will be complete. This number should be monotonically + // increasing as the operation progresses (output only). + Progress int64 `json:"progress,omitempty"` + + // Region: URL of the region where the operation resides (output only). + Region string `json:"region,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // StartTime: The time that this operation was started by the server. + // This is in RFC 3339 format (output only). + StartTime string `json:"startTime,omitempty"` + + // Status: Status of the operation. Can be one of the following: + // "PENDING", "RUNNING", or "DONE" (output only). + Status string `json:"status,omitempty"` + + // StatusMessage: An optional textual description of the current status + // of the operation (output only). + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetId: Unique target id which identifies a particular incarnation + // of the target (output only). + TargetId uint64 `json:"targetId,omitempty,string"` + + // TargetLink: URL of the resource the operation is mutating (output + // only). + TargetLink string `json:"targetLink,omitempty"` + + // User: User who requested the operation, for example + // "user@example.com" (output only). + User string `json:"user,omitempty"` + + // Warnings: If warning messages generated during processing of this + // operation, this field will be populated (output only). + Warnings []*OperationWarnings `json:"warnings,omitempty"` + + // Zone: URL of the zone where the operation resides (output only). + Zone string `json:"zone,omitempty"` +} + +type OperationError struct { + // Errors: The array of errors encountered while processing this + // operation. + Errors []*OperationErrorErrors `json:"errors,omitempty"` +} + +type OperationErrorErrors struct { + // Code: The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: Indicates the field in the request which caused the error. + // This property is optional. + Location string `json:"location,omitempty"` + + // Message: An optional, human-readable error message. + Message string `json:"message,omitempty"` +} + +type OperationWarnings struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*OperationWarningsData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type OperationWarningsData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type OperationAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped operation lists. + Items *OperationAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type OperationAggregatedListItems struct { +} + +type OperationList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The operation resources. + Items []*Operation `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type OperationsScopedList struct { + // Operations: List of operations contained in this scope. + Operations []*Operation `json:"operations,omitempty"` + + // Warning: Informational warning which replaces the list of operations + // when the list is empty. + Warning *OperationsScopedListWarning `json:"warning,omitempty"` +} + +type OperationsScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*OperationsScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type OperationsScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type Project struct { + // CommonInstanceMetadata: Metadata key/value pairs available to all + // instances contained in this project. + CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // Quotas: Quotas assigned to this project. + Quotas []*Quota `json:"quotas,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Quota struct { + // Limit: Quota limit for this metric. + Limit float64 `json:"limit,omitempty"` + + // Metric: Name of the quota metric. + Metric string `json:"metric,omitempty"` + + // Usage: Current usage of this metric. + Usage float64 `json:"usage,omitempty"` +} + +type Region struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this region. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: Textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // Quotas: Quotas assigned to this region. + Quotas []*Quota `json:"quotas,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Status: Status of the region, "UP" or "DOWN". + Status string `json:"status,omitempty"` + + // Zones: A list of zones homed in this region, in the form of resource + // URLs. + Zones []string `json:"zones,omitempty"` +} + +type RegionList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The region resources. + Items []*Region `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Route struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // DestRange: Which packets does this route apply to? + DestRange string `json:"destRange,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Network: URL of the network to which this route is applied; provided + // by the client when the route is created. + Network string `json:"network,omitempty"` + + // NextHopGateway: The URL to a gateway that should handle matching + // packets. + NextHopGateway string `json:"nextHopGateway,omitempty"` + + // NextHopInstance: The URL to an instance that should handle matching + // packets. + NextHopInstance string `json:"nextHopInstance,omitempty"` + + // NextHopIp: The network IP address of an instance that should handle + // matching packets. + NextHopIp string `json:"nextHopIp,omitempty"` + + // NextHopNetwork: The URL of the local network if it should handle + // matching packets. + NextHopNetwork string `json:"nextHopNetwork,omitempty"` + + // Priority: Breaks ties between Routes of equal specificity. Routes + // with smaller values win when tied with routes with larger values. + Priority int64 `json:"priority,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Tags: A list of instance tags to which this route applies. + Tags []string `json:"tags,omitempty"` + + // Warnings: If potential misconfigurations are detected for this route, + // this field will be populated with warning messages. + Warnings []*RouteWarnings `json:"warnings,omitempty"` +} + +type RouteWarnings struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*RouteWarningsData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type RouteWarningsData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type RouteList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The route resources. + Items []*Route `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Scheduling struct { + // AutomaticRestart: Whether the Instance should be automatically + // restarted whenever it is terminated by Compute Engine (not terminated + // by user). + AutomaticRestart bool `json:"automaticRestart,omitempty"` + + // OnHostMaintenance: How the instance should behave when the host + // machine undergoes maintenance that may temporarily impact instance + // performance. + OnHostMaintenance string `json:"onHostMaintenance,omitempty"` +} + +type SerialPortOutput struct { + // Contents: The contents of the console output. + Contents string `json:"contents,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type ServiceAccount struct { + // Email: Email address of the service account. + Email string `json:"email,omitempty"` + + // Scopes: The list of scopes to be made available for this service + // account. + Scopes []string `json:"scopes,omitempty"` +} + +type Snapshot struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // DiskSizeGb: Size of the persistent disk snapshot, specified in GB + // (output only). + DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SourceDisk: The source disk used to create this snapshot. Once the + // source disk has been deleted from the system, this field will be + // cleared, and will not be set even if a disk with the same name has + // been re-created (output only). + SourceDisk string `json:"sourceDisk,omitempty"` + + // SourceDiskId: The 'id' value of the disk used to create this + // snapshot. This value may be used to determine whether the snapshot + // was taken from the current or a previous instance of a given disk + // name. + SourceDiskId string `json:"sourceDiskId,omitempty"` + + // Status: The status of the persistent disk snapshot (output only). + Status string `json:"status,omitempty"` + + // StorageBytes: A size of the the storage used by the snapshot. As + // snapshots share storage this number is expected to change with + // snapshot creation/deletion. + StorageBytes int64 `json:"storageBytes,omitempty,string"` + + // StorageBytesStatus: An indicator whether storageBytes is in a stable + // state, or it is being adjusted as a result of shared storage + // reallocation. + StorageBytesStatus string `json:"storageBytesStatus,omitempty"` +} + +type SnapshotList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The persistent snapshot resources. + Items []*Snapshot `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type Tags struct { + // Fingerprint: Fingerprint of this resource. A hash of the tags stored + // in this object. This field is used optimistic locking. An up-to-date + // tags fingerprint must be provided in order to modify tags. + Fingerprint string `json:"fingerprint,omitempty"` + + // Items: An array of tags. Each tag must be 1-63 characters long, and + // comply with RFC1035. + Items []string `json:"items,omitempty"` +} + +type TargetPool struct { + // BackupPool: This field is applicable only when the containing target + // pool is serving a forwarding rule as the primary pool, and its + // 'failoverRatio' field is properly set to a value between [0, + // 1]. + // + // 'backupPool' and 'failoverRatio' together define the fallback + // behavior of the primary target pool: if the ratio of the healthy VMs + // in the primary pool is at or below 'failoverRatio', traffic arriving + // at the load-balanced IP will be directed to the backup pool. + // + // In case + // where 'failoverRatio' and 'backupPool' are not set, or all the VMs in + // the backup pool are unhealthy, the traffic will be directed back to + // the primary pool in the "force" mode, where traffic will be spread to + // the healthy VMs with the best effort, or to all VMs when no VM is + // healthy. + BackupPool string `json:"backupPool,omitempty"` + + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // FailoverRatio: This field is applicable only when the containing + // target pool is serving a forwarding rule as the primary pool (i.e., + // not as a backup pool to some other target pool). The value of the + // field must be in [0, 1]. + // + // If set, 'backupPool' must also be set. They + // together define the fallback behavior of the primary target pool: if + // the ratio of the healthy VMs in the primary pool is at or below this + // number, traffic arriving at the load-balanced IP will be directed to + // the backup pool. + // + // In case where 'failoverRatio' is not set or all the + // VMs in the backup pool are unhealthy, the traffic will be directed + // back to the primary pool in the "force" mode, where traffic will be + // spread to the healthy VMs with the best effort, or to all VMs when no + // VM is healthy. + FailoverRatio float64 `json:"failoverRatio,omitempty"` + + // HealthChecks: A list of URLs to the HttpHealthCheck resource. A + // member VM in this pool is considered healthy if and only if all + // specified health checks pass. An empty list means all member VMs will + // be considered healthy at all times. + HealthChecks []string `json:"healthChecks,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Instances: A list of resource URLs to the member VMs serving this + // pool. They must live in zones contained in the same region as this + // pool. + Instances []string `json:"instances,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. + Name string `json:"name,omitempty"` + + // Region: URL of the region where the target pool resides (output + // only). + Region string `json:"region,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // SessionAffinity: Sesssion affinity option, must be one of the + // following values: 'NONE': Connections from the same client IP may go + // to any VM in the pool; 'CLIENT_IP': Connections from the same client + // IP will go to the same VM in the pool while that VM remains healthy. + // 'CLIENT_IP_PROTO': Connections from the same client IP with the same + // IP protocol will go to the same VM in the pool while that VM remains + // healthy. + SessionAffinity string `json:"sessionAffinity,omitempty"` +} + +type TargetPoolAggregatedList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: A map of scoped target pool lists. + Items *TargetPoolAggregatedListItems `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type TargetPoolAggregatedListItems struct { +} + +type TargetPoolInstanceHealth struct { + HealthStatus []*HealthStatus `json:"healthStatus,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` +} + +type TargetPoolList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The TargetPool resources. + Items []*TargetPool `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +type TargetPoolsAddHealthCheckRequest struct { + // HealthChecks: Health check URLs to be added to targetPool. + HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"` +} + +type TargetPoolsAddInstanceRequest struct { + // Instances: URLs of the instances to be added to targetPool. + Instances []*InstanceReference `json:"instances,omitempty"` +} + +type TargetPoolsRemoveHealthCheckRequest struct { + // HealthChecks: Health check URLs to be removed from targetPool. + HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"` +} + +type TargetPoolsRemoveInstanceRequest struct { + // Instances: URLs of the instances to be removed from targetPool. + Instances []*InstanceReference `json:"instances,omitempty"` +} + +type TargetPoolsScopedList struct { + // TargetPools: List of target pools contained in this scope. + TargetPools []*TargetPool `json:"targetPools,omitempty"` + + // Warning: Informational warning which replaces the list of addresses + // when the list is empty. + Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"` +} + +type TargetPoolsScopedListWarning struct { + // Code: The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: Metadata for this warning in 'key: value' format. + Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"` + + // Message: Optional human-readable details for this warning. + Message string `json:"message,omitempty"` +} + +type TargetPoolsScopedListWarningData struct { + // Key: A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: A warning data value corresponding to the key. + Value string `json:"value,omitempty"` +} + +type TargetReference struct { + Target string `json:"target,omitempty"` +} + +type Zone struct { + // CreationTimestamp: Creation timestamp in RFC3339 text format (output + // only). + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: The deprecation status associated with this zone. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: Textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MaintenanceWindows: Scheduled maintenance windows for the zone. When + // the zone is in a maintenance window, all resources which reside in + // the zone will be unavailable. + MaintenanceWindows []*ZoneMaintenanceWindows `json:"maintenanceWindows,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // Region: Full URL reference to the region which hosts the zone (output + // only). + Region string `json:"region,omitempty"` + + // SelfLink: Server defined URL for the resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // Status: Status of the zone. "UP" or "DOWN". + Status string `json:"status,omitempty"` +} + +type ZoneMaintenanceWindows struct { + // BeginTime: Begin time of the maintenance window, in RFC 3339 format. + BeginTime string `json:"beginTime,omitempty"` + + // Description: Textual description of the maintenance window. + Description string `json:"description,omitempty"` + + // EndTime: End time of the maintenance window, in RFC 3339 format. + EndTime string `json:"endTime,omitempty"` + + // Name: Name of the maintenance window. + Name string `json:"name,omitempty"` +} + +type ZoneList struct { + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Items: The zone resources. + Items []*Zone `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request + // (output only). + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` +} + +// method id "compute.addresses.aggregatedList": + +type AddressesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of addresses grouped by scope. +func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall { + c := &AddressesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AddressesAggregatedListCall) Do() (*AddressAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/aggregated/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AddressAggregatedList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of addresses grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.addresses.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/addresses", + // "response": { + // "$ref": "AddressAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.addresses.delete": + +type AddressesDeleteCall struct { + s *Service + project string + region string + address string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified address resource. +func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall { + c := &AddressesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.address = address + return c +} + +func (c *AddressesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/addresses/{address}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{address}", url.QueryEscape(c.address), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified address resource.", + // "httpMethod": "DELETE", + // "id": "compute.addresses.delete", + // "parameterOrder": [ + // "project", + // "region", + // "address" + // ], + // "parameters": { + // "address": { + // "description": "Name of the address resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/addresses/{address}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.addresses.get": + +type AddressesGetCall struct { + s *Service + project string + region string + address string + opt_ map[string]interface{} +} + +// Get: Returns the specified address resource. +func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall { + c := &AddressesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.address = address + return c +} + +func (c *AddressesGetCall) Do() (*Address, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/addresses/{address}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{address}", url.QueryEscape(c.address), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Address) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified address resource.", + // "httpMethod": "GET", + // "id": "compute.addresses.get", + // "parameterOrder": [ + // "project", + // "region", + // "address" + // ], + // "parameters": { + // "address": { + // "description": "Name of the address resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/addresses/{address}", + // "response": { + // "$ref": "Address" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.addresses.insert": + +type AddressesInsertCall struct { + s *Service + project string + region string + address *Address + opt_ map[string]interface{} +} + +// Insert: Creates an address resource in the specified project using +// the data included in the request. +func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall { + c := &AddressesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.address = address + return c +} + +func (c *AddressesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.address) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an address resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.addresses.insert", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/addresses", + // "request": { + // "$ref": "Address" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.addresses.list": + +type AddressesListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} +} + +// List: Retrieves the list of address resources contained within the +// specified region. +func (r *AddressesService) List(project string, region string) *AddressesListCall { + c := &AddressesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *AddressesListCall) Filter(filter string) *AddressesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AddressesListCall) Do() (*AddressList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AddressList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of address resources contained within the specified region.", + // "httpMethod": "GET", + // "id": "compute.addresses.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/addresses", + // "response": { + // "$ref": "AddressList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.disks.aggregatedList": + +type DisksAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of disks grouped by scope. +func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall { + c := &DisksAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *DisksAggregatedListCall) Do() (*DiskAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/aggregated/disks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DiskAggregatedList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of disks grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.disks.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/disks", + // "response": { + // "$ref": "DiskAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.disks.createSnapshot": + +type DisksCreateSnapshotCall struct { + s *Service + project string + zone string + disk string + snapshot *Snapshot + opt_ map[string]interface{} +} + +// CreateSnapshot: +func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall { + c := &DisksCreateSnapshotCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.disk = disk + c.snapshot = snapshot + return c +} + +func (c *DisksCreateSnapshotCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/disks/{disk}/createSnapshot") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{disk}", url.QueryEscape(c.disk), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "POST", + // "id": "compute.disks.createSnapshot", + // "parameterOrder": [ + // "project", + // "zone", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk resource to snapshot.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot", + // "request": { + // "$ref": "Snapshot" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.disks.delete": + +type DisksDeleteCall struct { + s *Service + project string + zone string + disk string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified persistent disk resource. +func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall { + c := &DisksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.disk = disk + return c +} + +func (c *DisksDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/disks/{disk}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{disk}", url.QueryEscape(c.disk), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified persistent disk resource.", + // "httpMethod": "DELETE", + // "id": "compute.disks.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks/{disk}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.disks.get": + +type DisksGetCall struct { + s *Service + project string + zone string + disk string + opt_ map[string]interface{} +} + +// Get: Returns the specified persistent disk resource. +func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall { + c := &DisksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.disk = disk + return c +} + +func (c *DisksGetCall) Do() (*Disk, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/disks/{disk}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{disk}", url.QueryEscape(c.disk), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Disk) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified persistent disk resource.", + // "httpMethod": "GET", + // "id": "compute.disks.get", + // "parameterOrder": [ + // "project", + // "zone", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks/{disk}", + // "response": { + // "$ref": "Disk" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.disks.insert": + +type DisksInsertCall struct { + s *Service + project string + zone string + disk *Disk + opt_ map[string]interface{} +} + +// Insert: Creates a persistent disk resource in the specified project +// using the data included in the request. +func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall { + c := &DisksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.disk = disk + return c +} + +// SourceImage sets the optional parameter "sourceImage": Source image +// to restore onto a disk. +func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall { + c.opt_["sourceImage"] = sourceImage + return c +} + +func (c *DisksInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["sourceImage"]; ok { + params.Set("sourceImage", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/disks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a persistent disk resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.disks.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "sourceImage": { + // "description": "Optional. Source image to restore onto a disk.", + // "location": "query", + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks", + // "request": { + // "$ref": "Disk" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.disks.list": + +type DisksListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// List: Retrieves the list of persistent disk resources contained +// within the specified zone. +func (r *DisksService) List(project string, zone string) *DisksListCall { + c := &DisksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *DisksListCall) Filter(filter string) *DisksListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *DisksListCall) PageToken(pageToken string) *DisksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *DisksListCall) Do() (*DiskList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/disks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DiskList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of persistent disk resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.disks.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/disks", + // "response": { + // "$ref": "DiskList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.firewalls.delete": + +type FirewallsDeleteCall struct { + s *Service + project string + firewall string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified firewall resource. +func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall { + c := &FirewallsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + return c +} + +func (c *FirewallsDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{firewall}", url.QueryEscape(c.firewall), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified firewall resource.", + // "httpMethod": "DELETE", + // "id": "compute.firewalls.delete", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls/{firewall}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.get": + +type FirewallsGetCall struct { + s *Service + project string + firewall string + opt_ map[string]interface{} +} + +// Get: Returns the specified firewall resource. +func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall { + c := &FirewallsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + return c +} + +func (c *FirewallsGetCall) Do() (*Firewall, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{firewall}", url.QueryEscape(c.firewall), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Firewall) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified firewall resource.", + // "httpMethod": "GET", + // "id": "compute.firewalls.get", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls/{firewall}", + // "response": { + // "$ref": "Firewall" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.firewalls.insert": + +type FirewallsInsertCall struct { + s *Service + project string + firewall *Firewall + opt_ map[string]interface{} +} + +// Insert: Creates a firewall resource in the specified project using +// the data included in the request. +func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall { + c := &FirewallsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + return c +} + +func (c *FirewallsInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/firewalls") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a firewall resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.firewalls.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls", + // "request": { + // "$ref": "Firewall" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.list": + +type FirewallsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of firewall resources available to the +// specified project. +func (r *FirewallsService) List(project string) *FirewallsListCall { + c := &FirewallsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *FirewallsListCall) Do() (*FirewallList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/firewalls") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(FirewallList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of firewall resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.firewalls.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls", + // "response": { + // "$ref": "FirewallList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.firewalls.patch": + +type FirewallsPatchCall struct { + s *Service + project string + firewall string + firewall2 *Firewall + opt_ map[string]interface{} +} + +// Patch: Updates the specified firewall resource with the data included +// in the request. This method supports patch semantics. +func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall { + c := &FirewallsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + c.firewall2 = firewall2 + return c +} + +func (c *FirewallsPatchCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{firewall}", url.QueryEscape(c.firewall), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified firewall resource with the data included in the request. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "compute.firewalls.patch", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls/{firewall}", + // "request": { + // "$ref": "Firewall" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.update": + +type FirewallsUpdateCall struct { + s *Service + project string + firewall string + firewall2 *Firewall + opt_ map[string]interface{} +} + +// Update: Updates the specified firewall resource with the data +// included in the request. +func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall { + c := &FirewallsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.firewall = firewall + c.firewall2 = firewall2 + return c +} + +func (c *FirewallsUpdateCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{firewall}", url.QueryEscape(c.firewall), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified firewall resource with the data included in the request.", + // "httpMethod": "PUT", + // "id": "compute.firewalls.update", + // "parameterOrder": [ + // "project", + // "firewall" + // ], + // "parameters": { + // "firewall": { + // "description": "Name of the firewall resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/firewalls/{firewall}", + // "request": { + // "$ref": "Firewall" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.forwardingRules.aggregatedList": + +type ForwardingRulesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of forwarding rules grouped by +// scope. +func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall { + c := &ForwardingRulesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ForwardingRulesAggregatedListCall) Do() (*ForwardingRuleAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/aggregated/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ForwardingRuleAggregatedList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of forwarding rules grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.forwardingRules.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/forwardingRules", + // "response": { + // "$ref": "ForwardingRuleAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.forwardingRules.delete": + +type ForwardingRulesDeleteCall struct { + s *Service + project string + region string + forwardingRule string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified ForwardingRule resource. +func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall { + c := &ForwardingRulesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.forwardingRule = forwardingRule + return c +} + +func (c *ForwardingRulesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/forwardingRules/{forwardingRule}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{forwardingRule}", url.QueryEscape(c.forwardingRule), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified ForwardingRule resource.", + // "httpMethod": "DELETE", + // "id": "compute.forwardingRules.delete", + // "parameterOrder": [ + // "project", + // "region", + // "forwardingRule" + // ], + // "parameters": { + // "forwardingRule": { + // "description": "Name of the ForwardingRule resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.forwardingRules.get": + +type ForwardingRulesGetCall struct { + s *Service + project string + region string + forwardingRule string + opt_ map[string]interface{} +} + +// Get: Returns the specified ForwardingRule resource. +func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall { + c := &ForwardingRulesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.forwardingRule = forwardingRule + return c +} + +func (c *ForwardingRulesGetCall) Do() (*ForwardingRule, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/forwardingRules/{forwardingRule}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{forwardingRule}", url.QueryEscape(c.forwardingRule), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ForwardingRule) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified ForwardingRule resource.", + // "httpMethod": "GET", + // "id": "compute.forwardingRules.get", + // "parameterOrder": [ + // "project", + // "region", + // "forwardingRule" + // ], + // "parameters": { + // "forwardingRule": { + // "description": "Name of the ForwardingRule resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}", + // "response": { + // "$ref": "ForwardingRule" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.forwardingRules.insert": + +type ForwardingRulesInsertCall struct { + s *Service + project string + region string + forwardingrule *ForwardingRule + opt_ map[string]interface{} +} + +// Insert: Creates a ForwardingRule resource in the specified project +// and region using the data included in the request. +func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall { + c := &ForwardingRulesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.forwardingrule = forwardingrule + return c +} + +func (c *ForwardingRulesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.forwardingRules.insert", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/forwardingRules", + // "request": { + // "$ref": "ForwardingRule" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.forwardingRules.list": + +type ForwardingRulesListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} +} + +// List: Retrieves the list of ForwardingRule resources available to the +// specified project and region. +func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall { + c := &ForwardingRulesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ForwardingRulesListCall) Do() (*ForwardingRuleList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ForwardingRuleList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of ForwardingRule resources available to the specified project and region.", + // "httpMethod": "GET", + // "id": "compute.forwardingRules.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/forwardingRules", + // "response": { + // "$ref": "ForwardingRuleList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.forwardingRules.setTarget": + +type ForwardingRulesSetTargetCall struct { + s *Service + project string + region string + forwardingRule string + targetreference *TargetReference + opt_ map[string]interface{} +} + +// SetTarget: Changes target url for forwarding rule. +func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall { + c := &ForwardingRulesSetTargetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.forwardingRule = forwardingRule + c.targetreference = targetreference + return c +} + +func (c *ForwardingRulesSetTargetCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{forwardingRule}", url.QueryEscape(c.forwardingRule), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Changes target url for forwarding rule.", + // "httpMethod": "POST", + // "id": "compute.forwardingRules.setTarget", + // "parameterOrder": [ + // "project", + // "region", + // "forwardingRule" + // ], + // "parameters": { + // "forwardingRule": { + // "description": "Name of the ForwardingRule resource in which target is to be set.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget", + // "request": { + // "$ref": "TargetReference" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalOperations.aggregatedList": + +type GlobalOperationsAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of all operations grouped by +// scope. +func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall { + c := &GlobalOperationsAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *GlobalOperationsAggregatedListCall) Do() (*OperationAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/aggregated/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OperationAggregatedList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of all operations grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.globalOperations.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/operations", + // "response": { + // "$ref": "OperationAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.globalOperations.delete": + +type GlobalOperationsDeleteCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified operation resource. +func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall { + c := &GlobalOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +func (c *GlobalOperationsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified operation resource.", + // "httpMethod": "DELETE", + // "id": "compute.globalOperations.delete", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/operations/{operation}", + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalOperations.get": + +type GlobalOperationsGetCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} +} + +// Get: Retrieves the specified operation resource. +func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall { + c := &GlobalOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +func (c *GlobalOperationsGetCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified operation resource.", + // "httpMethod": "GET", + // "id": "compute.globalOperations.get", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/operations/{operation}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.globalOperations.list": + +type GlobalOperationsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of operation resources contained within the +// specified project. +func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall { + c := &GlobalOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *GlobalOperationsListCall) Do() (*OperationList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OperationList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.globalOperations.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/operations", + // "response": { + // "$ref": "OperationList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.httpHealthChecks.delete": + +type HttpHealthChecksDeleteCall struct { + s *Service + project string + httpHealthCheck string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified HttpHealthCheck resource. +func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall { + c := &HttpHealthChecksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpHealthCheck = httpHealthCheck + return c +} + +func (c *HttpHealthChecksDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{httpHealthCheck}", url.QueryEscape(c.httpHealthCheck), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified HttpHealthCheck resource.", + // "httpMethod": "DELETE", + // "id": "compute.httpHealthChecks.delete", + // "parameterOrder": [ + // "project", + // "httpHealthCheck" + // ], + // "parameters": { + // "httpHealthCheck": { + // "description": "Name of the HttpHealthCheck resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpHealthChecks.get": + +type HttpHealthChecksGetCall struct { + s *Service + project string + httpHealthCheck string + opt_ map[string]interface{} +} + +// Get: Returns the specified HttpHealthCheck resource. +func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall { + c := &HttpHealthChecksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpHealthCheck = httpHealthCheck + return c +} + +func (c *HttpHealthChecksGetCall) Do() (*HttpHealthCheck, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{httpHealthCheck}", url.QueryEscape(c.httpHealthCheck), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(HttpHealthCheck) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified HttpHealthCheck resource.", + // "httpMethod": "GET", + // "id": "compute.httpHealthChecks.get", + // "parameterOrder": [ + // "project", + // "httpHealthCheck" + // ], + // "parameters": { + // "httpHealthCheck": { + // "description": "Name of the HttpHealthCheck resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + // "response": { + // "$ref": "HttpHealthCheck" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.httpHealthChecks.insert": + +type HttpHealthChecksInsertCall struct { + s *Service + project string + httphealthcheck *HttpHealthCheck + opt_ map[string]interface{} +} + +// Insert: Creates a HttpHealthCheck resource in the specified project +// using the data included in the request. +func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall { + c := &HttpHealthChecksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httphealthcheck = httphealthcheck + return c +} + +func (c *HttpHealthChecksInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/httpHealthChecks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.httpHealthChecks.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpHealthChecks", + // "request": { + // "$ref": "HttpHealthCheck" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpHealthChecks.list": + +type HttpHealthChecksListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of HttpHealthCheck resources available to +// the specified project. +func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall { + c := &HttpHealthChecksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *HttpHealthChecksListCall) Do() (*HttpHealthCheckList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/httpHealthChecks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(HttpHealthCheckList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.httpHealthChecks.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpHealthChecks", + // "response": { + // "$ref": "HttpHealthCheckList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.httpHealthChecks.patch": + +type HttpHealthChecksPatchCall struct { + s *Service + project string + httpHealthCheck string + httphealthcheck *HttpHealthCheck + opt_ map[string]interface{} +} + +// Patch: Updates a HttpHealthCheck resource in the specified project +// using the data included in the request. This method supports patch +// semantics. +func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall { + c := &HttpHealthChecksPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpHealthCheck = httpHealthCheck + c.httphealthcheck = httphealthcheck + return c +} + +func (c *HttpHealthChecksPatchCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{httpHealthCheck}", url.QueryEscape(c.httpHealthCheck), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "compute.httpHealthChecks.patch", + // "parameterOrder": [ + // "project", + // "httpHealthCheck" + // ], + // "parameters": { + // "httpHealthCheck": { + // "description": "Name of the HttpHealthCheck resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + // "request": { + // "$ref": "HttpHealthCheck" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpHealthChecks.update": + +type HttpHealthChecksUpdateCall struct { + s *Service + project string + httpHealthCheck string + httphealthcheck *HttpHealthCheck + opt_ map[string]interface{} +} + +// Update: Updates a HttpHealthCheck resource in the specified project +// using the data included in the request. +func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall { + c := &HttpHealthChecksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpHealthCheck = httpHealthCheck + c.httphealthcheck = httphealthcheck + return c +} + +func (c *HttpHealthChecksUpdateCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{httpHealthCheck}", url.QueryEscape(c.httpHealthCheck), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.", + // "httpMethod": "PUT", + // "id": "compute.httpHealthChecks.update", + // "parameterOrder": [ + // "project", + // "httpHealthCheck" + // ], + // "parameters": { + // "httpHealthCheck": { + // "description": "Name of the HttpHealthCheck resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", + // "request": { + // "$ref": "HttpHealthCheck" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.delete": + +type ImagesDeleteCall struct { + s *Service + project string + image string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified image resource. +func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall { + c := &ImagesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + return c +} + +func (c *ImagesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/images/{image}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{image}", url.QueryEscape(c.image), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified image resource.", + // "httpMethod": "DELETE", + // "id": "compute.images.delete", + // "parameterOrder": [ + // "project", + // "image" + // ], + // "parameters": { + // "image": { + // "description": "Name of the image resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images/{image}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.deprecate": + +type ImagesDeprecateCall struct { + s *Service + project string + image string + deprecationstatus *DeprecationStatus + opt_ map[string]interface{} +} + +// Deprecate: Sets the deprecation status of an image. If no message +// body is given, clears the deprecation status instead. +func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall { + c := &ImagesDeprecateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + c.deprecationstatus = deprecationstatus + return c +} + +func (c *ImagesDeprecateCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/images/{image}/deprecate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{image}", url.QueryEscape(c.image), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the deprecation status of an image. If no message body is given, clears the deprecation status instead.", + // "httpMethod": "POST", + // "id": "compute.images.deprecate", + // "parameterOrder": [ + // "project", + // "image" + // ], + // "parameters": { + // "image": { + // "description": "Image name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images/{image}/deprecate", + // "request": { + // "$ref": "DeprecationStatus" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.get": + +type ImagesGetCall struct { + s *Service + project string + image string + opt_ map[string]interface{} +} + +// Get: Returns the specified image resource. +func (r *ImagesService) Get(project string, image string) *ImagesGetCall { + c := &ImagesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + return c +} + +func (c *ImagesGetCall) Do() (*Image, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/images/{image}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{image}", url.QueryEscape(c.image), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Image) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified image resource.", + // "httpMethod": "GET", + // "id": "compute.images.get", + // "parameterOrder": [ + // "project", + // "image" + // ], + // "parameters": { + // "image": { + // "description": "Name of the image resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images/{image}", + // "response": { + // "$ref": "Image" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.images.insert": + +type ImagesInsertCall struct { + s *Service + project string + image *Image + opt_ map[string]interface{} +} + +// Insert: Creates an image resource in the specified project using the +// data included in the request. +func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall { + c := &ImagesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.image = image + return c +} + +func (c *ImagesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.image) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/images") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an image resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.images.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images", + // "request": { + // "$ref": "Image" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "compute.images.list": + +type ImagesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of image resources available to the +// specified project. +func (r *ImagesService) List(project string) *ImagesListCall { + c := &ImagesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ImagesListCall) Filter(filter string) *ImagesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ImagesListCall) Do() (*ImageList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/images") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ImageList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of image resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.images.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/images", + // "response": { + // "$ref": "ImageList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.addAccessConfig": + +type InstancesAddAccessConfigCall struct { + s *Service + project string + zone string + instance string + networkInterface string + accessconfig *AccessConfig + opt_ map[string]interface{} +} + +// AddAccessConfig: Adds an access config to an instance's network +// interface. +func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall { + c := &InstancesAddAccessConfigCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.networkInterface = networkInterface + c.accessconfig = accessconfig + return c +} + +func (c *InstancesAddAccessConfigCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + params.Set("networkInterface", fmt.Sprintf("%v", c.networkInterface)) + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/instances/{instance}/addAccessConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds an access config to an instance's network interface.", + // "httpMethod": "POST", + // "id": "compute.instances.addAccessConfig", + // "parameterOrder": [ + // "project", + // "zone", + // "instance", + // "networkInterface" + // ], + // "parameters": { + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "networkInterface": { + // "description": "Network interface name.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig", + // "request": { + // "$ref": "AccessConfig" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.aggregatedList": + +type InstancesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: +func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall { + c := &InstancesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *InstancesAggregatedListCall) Do() (*InstanceAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/aggregated/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstanceAggregatedList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "compute.instances.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/instances", + // "response": { + // "$ref": "InstanceAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.attachDisk": + +type InstancesAttachDiskCall struct { + s *Service + project string + zone string + instance string + attacheddisk *AttachedDisk + opt_ map[string]interface{} +} + +// AttachDisk: Attaches a disk resource to an instance. +func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall { + c := &InstancesAttachDiskCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.attacheddisk = attacheddisk + return c +} + +func (c *InstancesAttachDiskCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/instances/{instance}/attachDisk") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Attaches a disk resource to an instance.", + // "httpMethod": "POST", + // "id": "compute.instances.attachDisk", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/attachDisk", + // "request": { + // "$ref": "AttachedDisk" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.delete": + +type InstancesDeleteCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified instance resource. +func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall { + c := &InstancesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified instance resource.", + // "httpMethod": "DELETE", + // "id": "compute.instances.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.deleteAccessConfig": + +type InstancesDeleteAccessConfigCall struct { + s *Service + project string + zone string + instance string + accessConfig string + networkInterface string + opt_ map[string]interface{} +} + +// DeleteAccessConfig: Deletes an access config from an instance's +// network interface. +func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall { + c := &InstancesDeleteAccessConfigCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.accessConfig = accessConfig + c.networkInterface = networkInterface + return c +} + +func (c *InstancesDeleteAccessConfigCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("accessConfig", fmt.Sprintf("%v", c.accessConfig)) + params.Set("networkInterface", fmt.Sprintf("%v", c.networkInterface)) + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes an access config from an instance's network interface.", + // "httpMethod": "POST", + // "id": "compute.instances.deleteAccessConfig", + // "parameterOrder": [ + // "project", + // "zone", + // "instance", + // "accessConfig", + // "networkInterface" + // ], + // "parameters": { + // "accessConfig": { + // "description": "Access config name.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "networkInterface": { + // "description": "Network interface name.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.detachDisk": + +type InstancesDetachDiskCall struct { + s *Service + project string + zone string + instance string + deviceName string + opt_ map[string]interface{} +} + +// DetachDisk: Detaches a disk from an instance. +func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall { + c := &InstancesDetachDiskCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.deviceName = deviceName + return c +} + +func (c *InstancesDetachDiskCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("deviceName", fmt.Sprintf("%v", c.deviceName)) + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/instances/{instance}/detachDisk") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Detaches a disk from an instance.", + // "httpMethod": "POST", + // "id": "compute.instances.detachDisk", + // "parameterOrder": [ + // "project", + // "zone", + // "instance", + // "deviceName" + // ], + // "parameters": { + // "deviceName": { + // "description": "Disk device name to detach.", + // "location": "query", + // "pattern": "\\w[\\w.-]{0,254}", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/detachDisk", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.get": + +type InstancesGetCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} +} + +// Get: Returns the specified instance resource. +func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall { + c := &InstancesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesGetCall) Do() (*Instance, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Instance) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified instance resource.", + // "httpMethod": "GET", + // "id": "compute.instances.get", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}", + // "response": { + // "$ref": "Instance" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.getSerialPortOutput": + +type InstancesGetSerialPortOutputCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} +} + +// GetSerialPortOutput: Returns the specified instance's serial port +// output. +func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall { + c := &InstancesGetSerialPortOutputCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesGetSerialPortOutputCall) Do() (*SerialPortOutput, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/instances/{instance}/serialPort") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SerialPortOutput) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified instance's serial port output.", + // "httpMethod": "GET", + // "id": "compute.instances.getSerialPortOutput", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/serialPort", + // "response": { + // "$ref": "SerialPortOutput" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.insert": + +type InstancesInsertCall struct { + s *Service + project string + zone string + instance *Instance + opt_ map[string]interface{} +} + +// Insert: Creates an instance resource in the specified project using +// the data included in the request. +func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall { + c := &InstancesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an instance resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.instances.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances", + // "request": { + // "$ref": "Instance" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.list": + +type InstancesListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// List: Retrieves the list of instance resources contained within the +// specified zone. +func (r *InstancesService) List(project string, zone string) *InstancesListCall { + c := &InstancesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *InstancesListCall) Filter(filter string) *InstancesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *InstancesListCall) Do() (*InstanceList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstanceList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of instance resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.instances.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances", + // "response": { + // "$ref": "InstanceList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instances.reset": + +type InstancesResetCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} +} + +// Reset: Performs a hard reset on the instance. +func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall { + c := &InstancesResetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +func (c *InstancesResetCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/instances/{instance}/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Performs a hard reset on the instance.", + // "httpMethod": "POST", + // "id": "compute.instances.reset", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/reset", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.setMetadata": + +type InstancesSetMetadataCall struct { + s *Service + project string + zone string + instance string + metadata *Metadata + opt_ map[string]interface{} +} + +// SetMetadata: Sets metadata for the specified instance to the data +// included in the request. +func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall { + c := &InstancesSetMetadataCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.metadata = metadata + return c +} + +func (c *InstancesSetMetadataCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/instances/{instance}/setMetadata") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets metadata for the specified instance to the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.instances.setMetadata", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/setMetadata", + // "request": { + // "$ref": "Metadata" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.setScheduling": + +type InstancesSetSchedulingCall struct { + s *Service + project string + zone string + instance string + scheduling *Scheduling + opt_ map[string]interface{} +} + +// SetScheduling: Sets an instance's scheduling options. +func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall { + c := &InstancesSetSchedulingCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.scheduling = scheduling + return c +} + +func (c *InstancesSetSchedulingCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/instances/{instance}/setScheduling") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets an instance's scheduling options.", + // "httpMethod": "POST", + // "id": "compute.instances.setScheduling", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project name.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/setScheduling", + // "request": { + // "$ref": "Scheduling" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.setTags": + +type InstancesSetTagsCall struct { + s *Service + project string + zone string + instance string + tags *Tags + opt_ map[string]interface{} +} + +// SetTags: Sets tags for the specified instance to the data included in +// the request. +func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall { + c := &InstancesSetTagsCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.tags = tags + return c +} + +func (c *InstancesSetTagsCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/instances/{instance}/setTags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets tags for the specified instance to the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.instances.setTags", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instances/{instance}/setTags", + // "request": { + // "$ref": "Tags" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.kernels.get": + +type KernelsGetCall struct { + s *Service + project string + kernel string + opt_ map[string]interface{} +} + +// Get: Returns the specified kernel resource. +func (r *KernelsService) Get(project string, kernel string) *KernelsGetCall { + c := &KernelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.kernel = kernel + return c +} + +func (c *KernelsGetCall) Do() (*Kernel, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/kernels/{kernel}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{kernel}", url.QueryEscape(c.kernel), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Kernel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified kernel resource.", + // "httpMethod": "GET", + // "id": "compute.kernels.get", + // "parameterOrder": [ + // "project", + // "kernel" + // ], + // "parameters": { + // "kernel": { + // "description": "Name of the kernel resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/kernels/{kernel}", + // "response": { + // "$ref": "Kernel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.kernels.list": + +type KernelsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of kernel resources available to the +// specified project. +func (r *KernelsService) List(project string) *KernelsListCall { + c := &KernelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *KernelsListCall) Filter(filter string) *KernelsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *KernelsListCall) MaxResults(maxResults int64) *KernelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *KernelsListCall) PageToken(pageToken string) *KernelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *KernelsListCall) Do() (*KernelList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/kernels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(KernelList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of kernel resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.kernels.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/kernels", + // "response": { + // "$ref": "KernelList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.machineTypes.aggregatedList": + +type MachineTypesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of machine type resources grouped +// by scope. +func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall { + c := &MachineTypesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *MachineTypesAggregatedListCall) Do() (*MachineTypeAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/aggregated/machineTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(MachineTypeAggregatedList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of machine type resources grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/machineTypes", + // "response": { + // "$ref": "MachineTypeAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.machineTypes.get": + +type MachineTypesGetCall struct { + s *Service + project string + zone string + machineType string + opt_ map[string]interface{} +} + +// Get: Returns the specified machine type resource. +func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall { + c := &MachineTypesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.machineType = machineType + return c +} + +func (c *MachineTypesGetCall) Do() (*MachineType, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/machineTypes/{machineType}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{machineType}", url.QueryEscape(c.machineType), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(MachineType) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified machine type resource.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.get", + // "parameterOrder": [ + // "project", + // "zone", + // "machineType" + // ], + // "parameters": { + // "machineType": { + // "description": "Name of the machine type resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/machineTypes/{machineType}", + // "response": { + // "$ref": "MachineType" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.machineTypes.list": + +type MachineTypesListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// List: Retrieves the list of machine type resources available to the +// specified project. +func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall { + c := &MachineTypesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *MachineTypesListCall) Do() (*MachineTypeList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/machineTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(MachineTypeList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of machine type resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/machineTypes", + // "response": { + // "$ref": "MachineTypeList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.networks.delete": + +type NetworksDeleteCall struct { + s *Service + project string + network string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified network resource. +func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall { + c := &NetworksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.network = network + return c +} + +func (c *NetworksDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/networks/{network}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{network}", url.QueryEscape(c.network), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified network resource.", + // "httpMethod": "DELETE", + // "id": "compute.networks.delete", + // "parameterOrder": [ + // "project", + // "network" + // ], + // "parameters": { + // "network": { + // "description": "Name of the network resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/networks/{network}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.networks.get": + +type NetworksGetCall struct { + s *Service + project string + network string + opt_ map[string]interface{} +} + +// Get: Returns the specified network resource. +func (r *NetworksService) Get(project string, network string) *NetworksGetCall { + c := &NetworksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.network = network + return c +} + +func (c *NetworksGetCall) Do() (*Network, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/networks/{network}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{network}", url.QueryEscape(c.network), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Network) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified network resource.", + // "httpMethod": "GET", + // "id": "compute.networks.get", + // "parameterOrder": [ + // "project", + // "network" + // ], + // "parameters": { + // "network": { + // "description": "Name of the network resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/networks/{network}", + // "response": { + // "$ref": "Network" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.networks.insert": + +type NetworksInsertCall struct { + s *Service + project string + network *Network + opt_ map[string]interface{} +} + +// Insert: Creates a network resource in the specified project using the +// data included in the request. +func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall { + c := &NetworksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.network = network + return c +} + +func (c *NetworksInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.network) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/networks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a network resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.networks.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/networks", + // "request": { + // "$ref": "Network" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.networks.list": + +type NetworksListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of network resources available to the +// specified project. +func (r *NetworksService) List(project string) *NetworksListCall { + c := &NetworksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *NetworksListCall) Filter(filter string) *NetworksListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *NetworksListCall) Do() (*NetworkList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/networks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(NetworkList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of network resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.networks.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/networks", + // "response": { + // "$ref": "NetworkList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.projects.get": + +type ProjectsGetCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// Get: Returns the specified project resource. +func (r *ProjectsService) Get(project string) *ProjectsGetCall { + c := &ProjectsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +func (c *ProjectsGetCall) Do() (*Project, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Project) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified project resource.", + // "httpMethod": "GET", + // "id": "compute.projects.get", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project resource to retrieve.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}", + // "response": { + // "$ref": "Project" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.projects.setCommonInstanceMetadata": + +type ProjectsSetCommonInstanceMetadataCall struct { + s *Service + project string + metadata *Metadata + opt_ map[string]interface{} +} + +// SetCommonInstanceMetadata: Sets metadata common to all instances +// within the specified project using the data included in the request. +func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall { + c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.metadata = metadata + return c +} + +func (c *ProjectsSetCommonInstanceMetadataCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/setCommonInstanceMetadata") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets metadata common to all instances within the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.projects.setCommonInstanceMetadata", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/setCommonInstanceMetadata", + // "request": { + // "$ref": "Metadata" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.regionOperations.delete": + +type RegionOperationsDeleteCall struct { + s *Service + project string + region string + operation string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified region-specific operation resource. +func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall { + c := &RegionOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.operation = operation + return c +} + +func (c *RegionOperationsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified region-specific operation resource.", + // "httpMethod": "DELETE", + // "id": "compute.regionOperations.delete", + // "parameterOrder": [ + // "project", + // "region", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/operations/{operation}", + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.regionOperations.get": + +type RegionOperationsGetCall struct { + s *Service + project string + region string + operation string + opt_ map[string]interface{} +} + +// Get: Retrieves the specified region-specific operation resource. +func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall { + c := &RegionOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.operation = operation + return c +} + +func (c *RegionOperationsGetCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified region-specific operation resource.", + // "httpMethod": "GET", + // "id": "compute.regionOperations.get", + // "parameterOrder": [ + // "project", + // "region", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/operations/{operation}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.regionOperations.list": + +type RegionOperationsListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} +} + +// List: Retrieves the list of operation resources contained within the +// specified region. +func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall { + c := &RegionOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *RegionOperationsListCall) Do() (*OperationList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OperationList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified region.", + // "httpMethod": "GET", + // "id": "compute.regionOperations.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/operations", + // "response": { + // "$ref": "OperationList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.regions.get": + +type RegionsGetCall struct { + s *Service + project string + region string + opt_ map[string]interface{} +} + +// Get: Returns the specified region resource. +func (r *RegionsService) Get(project string, region string) *RegionsGetCall { + c := &RegionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +func (c *RegionsGetCall) Do() (*Region, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Region) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified region resource.", + // "httpMethod": "GET", + // "id": "compute.regions.get", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}", + // "response": { + // "$ref": "Region" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.regions.list": + +type RegionsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of region resources available to the +// specified project. +func (r *RegionsService) List(project string) *RegionsListCall { + c := &RegionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *RegionsListCall) Filter(filter string) *RegionsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *RegionsListCall) Do() (*RegionList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RegionList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of region resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.regions.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions", + // "response": { + // "$ref": "RegionList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.routes.delete": + +type RoutesDeleteCall struct { + s *Service + project string + route string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified route resource. +func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall { + c := &RoutesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.route = route + return c +} + +func (c *RoutesDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/routes/{route}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{route}", url.QueryEscape(c.route), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified route resource.", + // "httpMethod": "DELETE", + // "id": "compute.routes.delete", + // "parameterOrder": [ + // "project", + // "route" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "route": { + // "description": "Name of the route resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/routes/{route}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.routes.get": + +type RoutesGetCall struct { + s *Service + project string + route string + opt_ map[string]interface{} +} + +// Get: Returns the specified route resource. +func (r *RoutesService) Get(project string, route string) *RoutesGetCall { + c := &RoutesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.route = route + return c +} + +func (c *RoutesGetCall) Do() (*Route, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/routes/{route}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{route}", url.QueryEscape(c.route), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Route) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified route resource.", + // "httpMethod": "GET", + // "id": "compute.routes.get", + // "parameterOrder": [ + // "project", + // "route" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "route": { + // "description": "Name of the route resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/routes/{route}", + // "response": { + // "$ref": "Route" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.routes.insert": + +type RoutesInsertCall struct { + s *Service + project string + route *Route + opt_ map[string]interface{} +} + +// Insert: Creates a route resource in the specified project using the +// data included in the request. +func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall { + c := &RoutesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.route = route + return c +} + +func (c *RoutesInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.route) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/routes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a route resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.routes.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/routes", + // "request": { + // "$ref": "Route" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.routes.list": + +type RoutesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of route resources available to the +// specified project. +func (r *RoutesService) List(project string) *RoutesListCall { + c := &RoutesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *RoutesListCall) Filter(filter string) *RoutesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *RoutesListCall) Do() (*RouteList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/routes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RouteList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of route resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.routes.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/routes", + // "response": { + // "$ref": "RouteList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.snapshots.delete": + +type SnapshotsDeleteCall struct { + s *Service + project string + snapshot string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified persistent disk snapshot resource. +func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall { + c := &SnapshotsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.snapshot = snapshot + return c +} + +func (c *SnapshotsDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/snapshots/{snapshot}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{snapshot}", url.QueryEscape(c.snapshot), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified persistent disk snapshot resource.", + // "httpMethod": "DELETE", + // "id": "compute.snapshots.delete", + // "parameterOrder": [ + // "project", + // "snapshot" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "snapshot": { + // "description": "Name of the persistent disk snapshot resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/snapshots/{snapshot}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.snapshots.get": + +type SnapshotsGetCall struct { + s *Service + project string + snapshot string + opt_ map[string]interface{} +} + +// Get: Returns the specified persistent disk snapshot resource. +func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall { + c := &SnapshotsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.snapshot = snapshot + return c +} + +func (c *SnapshotsGetCall) Do() (*Snapshot, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/snapshots/{snapshot}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{snapshot}", url.QueryEscape(c.snapshot), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Snapshot) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified persistent disk snapshot resource.", + // "httpMethod": "GET", + // "id": "compute.snapshots.get", + // "parameterOrder": [ + // "project", + // "snapshot" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "snapshot": { + // "description": "Name of the persistent disk snapshot resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/snapshots/{snapshot}", + // "response": { + // "$ref": "Snapshot" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.snapshots.list": + +type SnapshotsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of persistent disk snapshot resources +// contained within the specified project. +func (r *SnapshotsService) List(project string) *SnapshotsListCall { + c := &SnapshotsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *SnapshotsListCall) Do() (*SnapshotList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/global/snapshots") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SnapshotList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of persistent disk snapshot resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.snapshots.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/snapshots", + // "response": { + // "$ref": "SnapshotList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetPools.addHealthCheck": + +type TargetPoolsAddHealthCheckCall struct { + s *Service + project string + region string + targetPool string + targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest + opt_ map[string]interface{} +} + +// AddHealthCheck: Adds health check URL to targetPool. +func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest) *TargetPoolsAddHealthCheckCall { + c := &TargetPoolsAddHealthCheckCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + c.targetpoolsaddhealthcheckrequest = targetpoolsaddhealthcheckrequest + return c +} + +func (c *TargetPoolsAddHealthCheckCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds health check URL to targetPool.", + // "httpMethod": "POST", + // "id": "compute.targetPools.addHealthCheck", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to which health_check_url is to be added.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck", + // "request": { + // "$ref": "TargetPoolsAddHealthCheckRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.addInstance": + +type TargetPoolsAddInstanceCall struct { + s *Service + project string + region string + targetPool string + targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest + opt_ map[string]interface{} +} + +// AddInstance: Adds instance url to targetPool. +func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest) *TargetPoolsAddInstanceCall { + c := &TargetPoolsAddInstanceCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + c.targetpoolsaddinstancerequest = targetpoolsaddinstancerequest + return c +} + +func (c *TargetPoolsAddInstanceCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/targetPools/{targetPool}/addInstance") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds instance url to targetPool.", + // "httpMethod": "POST", + // "id": "compute.targetPools.addInstance", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to which instance_url is to be added.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance", + // "request": { + // "$ref": "TargetPoolsAddInstanceRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.aggregatedList": + +type TargetPoolsAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// AggregatedList: Retrieves the list of target pools grouped by scope. +func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall { + c := &TargetPoolsAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *TargetPoolsAggregatedListCall) Do() (*TargetPoolAggregatedList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/aggregated/targetPools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TargetPoolAggregatedList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of target pools grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.targetPools.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/targetPools", + // "response": { + // "$ref": "TargetPoolAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetPools.delete": + +type TargetPoolsDeleteCall struct { + s *Service + project string + region string + targetPool string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified TargetPool resource. +func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall { + c := &TargetPoolsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + return c +} + +func (c *TargetPoolsDeleteCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/targetPools/{targetPool}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified TargetPool resource.", + // "httpMethod": "DELETE", + // "id": "compute.targetPools.delete", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.get": + +type TargetPoolsGetCall struct { + s *Service + project string + region string + targetPool string + opt_ map[string]interface{} +} + +// Get: Returns the specified TargetPool resource. +func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall { + c := &TargetPoolsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + return c +} + +func (c *TargetPoolsGetCall) Do() (*TargetPool, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/targetPools/{targetPool}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TargetPool) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified TargetPool resource.", + // "httpMethod": "GET", + // "id": "compute.targetPools.get", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}", + // "response": { + // "$ref": "TargetPool" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetPools.getHealth": + +type TargetPoolsGetHealthCall struct { + s *Service + project string + region string + targetPool string + instancereference *InstanceReference + opt_ map[string]interface{} +} + +// GetHealth: Gets the most recent health check results for each IP for +// the given instance that is referenced by given TargetPool. +func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall { + c := &TargetPoolsGetHealthCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + c.instancereference = instancereference + return c +} + +func (c *TargetPoolsGetHealthCall) Do() (*TargetPoolInstanceHealth, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/targetPools/{targetPool}/getHealth") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TargetPoolInstanceHealth) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the most recent health check results for each IP for the given instance that is referenced by given TargetPool.", + // "httpMethod": "POST", + // "id": "compute.targetPools.getHealth", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to which the queried instance belongs.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth", + // "request": { + // "$ref": "InstanceReference" + // }, + // "response": { + // "$ref": "TargetPoolInstanceHealth" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetPools.insert": + +type TargetPoolsInsertCall struct { + s *Service + project string + region string + targetpool *TargetPool + opt_ map[string]interface{} +} + +// Insert: Creates a TargetPool resource in the specified project and +// region using the data included in the request. +func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall { + c := &TargetPoolsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetpool = targetpool + return c +} + +func (c *TargetPoolsInsertCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/targetPools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a TargetPool resource in the specified project and region using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.targetPools.insert", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools", + // "request": { + // "$ref": "TargetPool" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.list": + +type TargetPoolsListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} +} + +// List: Retrieves the list of TargetPool resources available to the +// specified project and region. +func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall { + c := &TargetPoolsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *TargetPoolsListCall) Do() (*TargetPoolList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/targetPools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TargetPoolList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of TargetPool resources available to the specified project and region.", + // "httpMethod": "GET", + // "id": "compute.targetPools.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools", + // "response": { + // "$ref": "TargetPoolList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetPools.removeHealthCheck": + +type TargetPoolsRemoveHealthCheckCall struct { + s *Service + project string + region string + targetPool string + targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest + opt_ map[string]interface{} +} + +// RemoveHealthCheck: Removes health check URL from targetPool. +func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest) *TargetPoolsRemoveHealthCheckCall { + c := &TargetPoolsRemoveHealthCheckCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + c.targetpoolsremovehealthcheckrequest = targetpoolsremovehealthcheckrequest + return c +} + +func (c *TargetPoolsRemoveHealthCheckCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes health check URL from targetPool.", + // "httpMethod": "POST", + // "id": "compute.targetPools.removeHealthCheck", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to which health_check_url is to be removed.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck", + // "request": { + // "$ref": "TargetPoolsRemoveHealthCheckRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.removeInstance": + +type TargetPoolsRemoveInstanceCall struct { + s *Service + project string + region string + targetPool string + targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest + opt_ map[string]interface{} +} + +// RemoveInstance: Removes instance URL from targetPool. +func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest) *TargetPoolsRemoveInstanceCall { + c := &TargetPoolsRemoveInstanceCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + c.targetpoolsremoveinstancerequest = targetpoolsremoveinstancerequest + return c +} + +func (c *TargetPoolsRemoveInstanceCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/targetPools/{targetPool}/removeInstance") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes instance URL from targetPool.", + // "httpMethod": "POST", + // "id": "compute.targetPools.removeInstance", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource to which instance_url is to be removed.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance", + // "request": { + // "$ref": "TargetPoolsRemoveInstanceRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.setBackup": + +type TargetPoolsSetBackupCall struct { + s *Service + project string + region string + targetPool string + targetreference *TargetReference + opt_ map[string]interface{} +} + +// SetBackup: Changes backup pool configurations. +func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall { + c := &TargetPoolsSetBackupCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetPool = targetPool + c.targetreference = targetreference + return c +} + +// FailoverRatio sets the optional parameter "failoverRatio": New +// failoverRatio value for the containing target pool. +func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall { + c.opt_["failoverRatio"] = failoverRatio + return c +} + +func (c *TargetPoolsSetBackupCall) Do() (*Operation, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["failoverRatio"]; ok { + params.Set("failoverRatio", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/regions/{region}/targetPools/{targetPool}/setBackup") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{region}", url.QueryEscape(c.region), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{targetPool}", url.QueryEscape(c.targetPool), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Changes backup pool configurations.", + // "httpMethod": "POST", + // "id": "compute.targetPools.setBackup", + // "parameterOrder": [ + // "project", + // "region", + // "targetPool" + // ], + // "parameters": { + // "failoverRatio": { + // "description": "New failoverRatio value for the containing target pool.", + // "format": "float", + // "location": "query", + // "type": "number" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetPool": { + // "description": "Name of the TargetPool resource for which the backup is to be set.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup", + // "request": { + // "$ref": "TargetReference" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.zoneOperations.delete": + +type ZoneOperationsDeleteCall struct { + s *Service + project string + zone string + operation string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified zone-specific operation resource. +func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall { + c := &ZoneOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.operation = operation + return c +} + +func (c *ZoneOperationsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified zone-specific operation resource.", + // "httpMethod": "DELETE", + // "id": "compute.zoneOperations.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/operations/{operation}", + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.zoneOperations.get": + +type ZoneOperationsGetCall struct { + s *Service + project string + zone string + operation string + opt_ map[string]interface{} +} + +// Get: Retrieves the specified zone-specific operation resource. +func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall { + c := &ZoneOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.operation = operation + return c +} + +func (c *ZoneOperationsGetCall) Do() (*Operation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Operation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified zone-specific operation resource.", + // "httpMethod": "GET", + // "id": "compute.zoneOperations.get", + // "parameterOrder": [ + // "project", + // "zone", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/operations/{operation}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.zoneOperations.list": + +type ZoneOperationsListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// List: Retrieves the list of operation resources contained within the +// specified zone. +func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall { + c := &ZoneOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ZoneOperationsListCall) Do() (*OperationList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OperationList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.zoneOperations.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/operations", + // "response": { + // "$ref": "OperationList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.zones.get": + +type ZonesGetCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} +} + +// Get: Returns the specified zone resource. +func (r *ZonesService) Get(project string, zone string) *ZonesGetCall { + c := &ZonesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +func (c *ZonesGetCall) Do() (*Zone, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones/{zone}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Zone) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified zone resource.", + // "httpMethod": "GET", + // "id": "compute.zones.get", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}", + // "response": { + // "$ref": "Zone" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.zones.list": + +type ZonesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Retrieves the list of zone resources available to the specified +// project. +func (r *ZonesService) List(project string) *ZonesListCall { + c := &ZonesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *ZonesListCall) Filter(filter string) *ZonesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Maximum value is 500 and default value is +// 500. +func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Tag returned by a +// previous list request truncated by maxResults. Used to continue a +// previous list request. +func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ZonesListCall) Do() (*ZoneList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/compute/v1beta16/projects/", "{project}/zones") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ZoneList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of zone resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.zones.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter expression for filtering listed resources.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "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])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones", + // "response": { + // "$ref": "ZoneList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/coordinate/v1/coordinate-api.json b/third_party/src/code.google.com/p/google-api-go-client/coordinate/v1/coordinate-api.json new file mode 100644 index 0000000000000..2e62a938dd62c --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/coordinate/v1/coordinate-api.json @@ -0,0 +1,1090 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/PS-rvsWcMt99OOrOfl1upLydS0Y\"", + "discoveryVersion": "v1", + "id": "coordinate:v1", + "name": "coordinate", + "version": "v1", + "title": "Google Maps Coordinate API", + "description": "Lets you view and manage jobs in a Coordinate team.", + "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/coordinate/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/coordinate/v1/teams/", + "basePath": "/coordinate/v1/teams/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "coordinate/v1/teams/", + "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/coordinate": { + "description": "View and manage your Google Maps Coordinate jobs" + }, + "https://www.googleapis.com/auth/coordinate.readonly": { + "description": "View your Google Coordinate jobs" + } + } + } + }, + "schemas": { + "CustomField": { + "id": "CustomField", + "type": "object", + "description": "Custom field.", + "properties": { + "customFieldId": { + "type": "string", + "description": "Custom field id.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies this object as a custom field.", + "default": "coordinate#customField" + }, + "value": { + "type": "string", + "description": "Custom field value." + } + } + }, + "CustomFieldDef": { + "id": "CustomFieldDef", + "type": "object", + "description": "Custom field definition.", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether the field is enabled." + }, + "id": { + "type": "string", + "description": "Custom field id.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies this object as a custom field definition.", + "default": "coordinate#customFieldDef" + }, + "name": { + "type": "string", + "description": "Custom field name." + }, + "requiredForCheckout": { + "type": "boolean", + "description": "Whether the field is required for checkout." + }, + "type": { + "type": "string", + "description": "Custom field type." + } + } + }, + "CustomFieldDefListResponse": { + "id": "CustomFieldDefListResponse", + "type": "object", + "description": "Collection of custom field definitions for a team.", + "properties": { + "items": { + "type": "array", + "description": "Collection of custom field definitions in a team.", + "items": { + "$ref": "CustomFieldDef" + } + }, + "kind": { + "type": "string", + "description": "Identifies this object as a collection of custom field definitions in a team.", + "default": "coordinate#customFieldDefList" + } + } + }, + "CustomFields": { + "id": "CustomFields", + "type": "object", + "description": "Collection of custom fields.", + "properties": { + "customField": { + "type": "array", + "description": "Collection of custom fields.", + "items": { + "$ref": "CustomField" + } + }, + "kind": { + "type": "string", + "description": "Identifies this object as a collection of custom fields.", + "default": "coordinate#customFields" + } + } + }, + "Job": { + "id": "Job", + "type": "object", + "description": "A job.", + "properties": { + "id": { + "type": "string", + "description": "Job id.", + "format": "uint64" + }, + "jobChange": { + "type": "array", + "description": "List of job changes since it was created. The first change corresponds to the state of the job when it was created.", + "items": { + "$ref": "JobChange" + } + }, + "kind": { + "type": "string", + "description": "Identifies this object as a job.", + "default": "coordinate#job" + }, + "state": { + "$ref": "JobState", + "description": "Current job state." + } + } + }, + "JobChange": { + "id": "JobChange", + "type": "object", + "description": "Change to a job. For example assigning the job to a different worker.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies this object as a job change.", + "default": "coordinate#jobChange" + }, + "state": { + "$ref": "JobState", + "description": "Change applied to the job. Only the fields that were changed are set." + }, + "timestamp": { + "type": "string", + "description": "Time at which this change was applied.", + "format": "uint64" + } + } + }, + "JobListResponse": { + "id": "JobListResponse", + "type": "object", + "description": "Response from a List Jobs request.", + "properties": { + "items": { + "type": "array", + "description": "Jobs in the collection.", + "items": { + "$ref": "Job" + } + }, + "kind": { + "type": "string", + "description": "Identifies this object as a list of jobs.", + "default": "coordinate#jobList" + }, + "nextPageToken": { + "type": "string", + "description": "A token to provide to get the next page of results." + } + } + }, + "JobState": { + "id": "JobState", + "type": "object", + "description": "Current state of a job.", + "properties": { + "assignee": { + "type": "string", + "description": "Email address of the assignee." + }, + "customFields": { + "$ref": "CustomFields", + "description": "Custom fields." + }, + "customerName": { + "type": "string", + "description": "Customer name." + }, + "customerPhoneNumber": { + "type": "string", + "description": "Customer phone number." + }, + "kind": { + "type": "string", + "description": "Identifies this object as a job state.", + "default": "coordinate#jobState" + }, + "location": { + "$ref": "Location", + "description": "Job location." + }, + "note": { + "type": "array", + "description": "Note added to the job.", + "items": { + "type": "string" + } + }, + "progress": { + "type": "string", + "description": "Job progress." + }, + "title": { + "type": "string", + "description": "Job title." + } + } + }, + "Location": { + "id": "Location", + "type": "object", + "description": "Location of a job.", + "properties": { + "addressLine": { + "type": "array", + "description": "Address.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "Identifies this object as a location.", + "default": "coordinate#location" + }, + "lat": { + "type": "number", + "description": "Latitude.", + "format": "double" + }, + "lng": { + "type": "number", + "description": "Longitude.", + "format": "double" + } + } + }, + "LocationListResponse": { + "id": "LocationListResponse", + "type": "object", + "description": "Response from a List Locations request.", + "properties": { + "items": { + "type": "array", + "description": "Locations in the collection.", + "items": { + "$ref": "LocationRecord" + } + }, + "kind": { + "type": "string", + "description": "Identifies this object as a list of locations.", + "default": "coordinate#locationList" + }, + "nextPageToken": { + "type": "string", + "description": "A token to provide to get the next page of results." + }, + "tokenPagination": { + "$ref": "TokenPagination", + "description": "Pagination information for token pagination." + } + } + }, + "LocationRecord": { + "id": "LocationRecord", + "type": "object", + "description": "Recorded location of a worker.", + "properties": { + "collectionTime": { + "type": "string", + "description": "The collection time in milliseconds since the epoch.", + "format": "int64" + }, + "confidenceRadius": { + "type": "number", + "description": "The location accuracy in meters. This is the radius of a 95% confidence interval around the location measurement.", + "format": "double" + }, + "kind": { + "type": "string", + "description": "Identifies this object as a location.", + "default": "coordinate#locationRecord" + }, + "latitude": { + "type": "number", + "description": "Latitude.", + "format": "double" + }, + "longitude": { + "type": "number", + "description": "Longitude.", + "format": "double" + } + } + }, + "Schedule": { + "id": "Schedule", + "type": "object", + "description": "Job schedule.", + "properties": { + "allDay": { + "type": "boolean", + "description": "Whether the job is scheduled for the whole day. Time of day in start/end times is ignored if this is true." + }, + "duration": { + "type": "string", + "description": "Job duration in milliseconds.", + "format": "uint64" + }, + "endTime": { + "type": "string", + "description": "Scheduled end time in milliseconds since epoch.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Identifies this object as a job schedule.", + "default": "coordinate#schedule" + }, + "startTime": { + "type": "string", + "description": "Scheduled start time in milliseconds since epoch.", + "format": "uint64" + } + } + }, + "TokenPagination": { + "id": "TokenPagination", + "type": "object", + "description": "Pagination information.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies this object as pagination information.", + "default": "coordinate#tokenPagination" + }, + "nextPageToken": { + "type": "string", + "description": "A token to provide to get the next page of results." + }, + "previousPageToken": { + "type": "string", + "description": "A token to provide to get the previous page of results." + } + } + }, + "Worker": { + "id": "Worker", + "type": "object", + "description": "A worker in a Coordinate team.", + "properties": { + "id": { + "type": "string", + "description": "Worker email address." + }, + "kind": { + "type": "string", + "description": "Identifies this object as a worker.", + "default": "coordinate#worker" + } + } + }, + "WorkerListResponse": { + "id": "WorkerListResponse", + "type": "object", + "description": "Response from a List Workers request.", + "properties": { + "items": { + "type": "array", + "description": "Workers in the collection.", + "items": { + "$ref": "Worker" + } + }, + "kind": { + "type": "string", + "description": "Identifies this object as a list of workers.", + "default": "coordinate#workerList" + } + } + } + }, + "resources": { + "customFieldDef": { + "methods": { + "list": { + "id": "coordinate.customFieldDef.list", + "path": "{teamId}/custom_fields", + "httpMethod": "GET", + "description": "Retrieves a list of custom field definitions for a team.", + "parameters": { + "teamId": { + "type": "string", + "description": "Team ID", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "teamId" + ], + "response": { + "$ref": "CustomFieldDefListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/coordinate", + "https://www.googleapis.com/auth/coordinate.readonly" + ] + } + } + }, + "jobs": { + "methods": { + "get": { + "id": "coordinate.jobs.get", + "path": "{teamId}/jobs/{jobId}", + "httpMethod": "GET", + "description": "Retrieves a job, including all the changes made to the job.", + "parameters": { + "jobId": { + "type": "string", + "description": "Job number", + "required": true, + "format": "uint64", + "location": "path" + }, + "teamId": { + "type": "string", + "description": "Team ID", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "teamId", + "jobId" + ], + "response": { + "$ref": "Job" + }, + "scopes": [ + "https://www.googleapis.com/auth/coordinate", + "https://www.googleapis.com/auth/coordinate.readonly" + ] + }, + "insert": { + "id": "coordinate.jobs.insert", + "path": "{teamId}/jobs", + "httpMethod": "POST", + "description": "Inserts a new job. Only the state field of the job should be set.", + "parameters": { + "address": { + "type": "string", + "description": "Job address as newline (Unix) separated string", + "required": true, + "location": "query" + }, + "assignee": { + "type": "string", + "description": "Assignee email address, or empty string to unassign.", + "location": "query" + }, + "customField": { + "type": "string", + "description": "Map from custom field id (from /team//custom_fields) to the field value. For example '123=Alice'", + "repeated": true, + "location": "query" + }, + "customerName": { + "type": "string", + "description": "Customer name", + "location": "query" + }, + "customerPhoneNumber": { + "type": "string", + "description": "Customer phone number", + "location": "query" + }, + "lat": { + "type": "number", + "description": "The latitude coordinate of this job's location.", + "required": true, + "format": "double", + "location": "query" + }, + "lng": { + "type": "number", + "description": "The longitude coordinate of this job's location.", + "required": true, + "format": "double", + "location": "query" + }, + "note": { + "type": "string", + "description": "Job note as newline (Unix) separated string", + "location": "query" + }, + "teamId": { + "type": "string", + "description": "Team ID", + "required": true, + "location": "path" + }, + "title": { + "type": "string", + "description": "Job title", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "teamId", + "address", + "lat", + "lng", + "title" + ], + "request": { + "$ref": "Job" + }, + "response": { + "$ref": "Job" + }, + "scopes": [ + "https://www.googleapis.com/auth/coordinate" + ] + }, + "list": { + "id": "coordinate.jobs.list", + "path": "{teamId}/jobs", + "httpMethod": "GET", + "description": "Retrieves jobs created or modified since the given timestamp.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return in one page.", + "format": "uint32", + "location": "query" + }, + "minModifiedTimestampMs": { + "type": "string", + "description": "Minimum time a job was modified in milliseconds since epoch.", + "format": "uint64", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Continuation token", + "location": "query" + }, + "teamId": { + "type": "string", + "description": "Team ID", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "teamId" + ], + "response": { + "$ref": "JobListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/coordinate", + "https://www.googleapis.com/auth/coordinate.readonly" + ] + }, + "patch": { + "id": "coordinate.jobs.patch", + "path": "{teamId}/jobs/{jobId}", + "httpMethod": "PATCH", + "description": "Updates a job. Fields that are set in the job state will be updated. This method supports patch semantics.", + "parameters": { + "address": { + "type": "string", + "description": "Job address as newline (Unix) separated string", + "location": "query" + }, + "assignee": { + "type": "string", + "description": "Assignee email address, or empty string to unassign.", + "location": "query" + }, + "customField": { + "type": "string", + "description": "Map from custom field id (from /team//custom_fields) to the field value. For example '123=Alice'", + "repeated": true, + "location": "query" + }, + "customerName": { + "type": "string", + "description": "Customer name", + "location": "query" + }, + "customerPhoneNumber": { + "type": "string", + "description": "Customer phone number", + "location": "query" + }, + "jobId": { + "type": "string", + "description": "Job number", + "required": true, + "format": "uint64", + "location": "path" + }, + "lat": { + "type": "number", + "description": "The latitude coordinate of this job's location.", + "format": "double", + "location": "query" + }, + "lng": { + "type": "number", + "description": "The longitude coordinate of this job's location.", + "format": "double", + "location": "query" + }, + "note": { + "type": "string", + "description": "Job note as newline (Unix) separated string", + "location": "query" + }, + "progress": { + "type": "string", + "description": "Job progress", + "enum": [ + "COMPLETED", + "IN_PROGRESS", + "NOT_ACCEPTED", + "NOT_STARTED", + "OBSOLETE" + ], + "enumDescriptions": [ + "Completed", + "In progress", + "Not accepted", + "Not started", + "Obsolete" + ], + "location": "query" + }, + "teamId": { + "type": "string", + "description": "Team ID", + "required": true, + "location": "path" + }, + "title": { + "type": "string", + "description": "Job title", + "location": "query" + } + }, + "parameterOrder": [ + "teamId", + "jobId" + ], + "request": { + "$ref": "Job" + }, + "response": { + "$ref": "Job" + }, + "scopes": [ + "https://www.googleapis.com/auth/coordinate" + ] + }, + "update": { + "id": "coordinate.jobs.update", + "path": "{teamId}/jobs/{jobId}", + "httpMethod": "PUT", + "description": "Updates a job. Fields that are set in the job state will be updated.", + "parameters": { + "address": { + "type": "string", + "description": "Job address as newline (Unix) separated string", + "location": "query" + }, + "assignee": { + "type": "string", + "description": "Assignee email address, or empty string to unassign.", + "location": "query" + }, + "customField": { + "type": "string", + "description": "Map from custom field id (from /team//custom_fields) to the field value. For example '123=Alice'", + "repeated": true, + "location": "query" + }, + "customerName": { + "type": "string", + "description": "Customer name", + "location": "query" + }, + "customerPhoneNumber": { + "type": "string", + "description": "Customer phone number", + "location": "query" + }, + "jobId": { + "type": "string", + "description": "Job number", + "required": true, + "format": "uint64", + "location": "path" + }, + "lat": { + "type": "number", + "description": "The latitude coordinate of this job's location.", + "format": "double", + "location": "query" + }, + "lng": { + "type": "number", + "description": "The longitude coordinate of this job's location.", + "format": "double", + "location": "query" + }, + "note": { + "type": "string", + "description": "Job note as newline (Unix) separated string", + "location": "query" + }, + "progress": { + "type": "string", + "description": "Job progress", + "enum": [ + "COMPLETED", + "IN_PROGRESS", + "NOT_ACCEPTED", + "NOT_STARTED", + "OBSOLETE" + ], + "enumDescriptions": [ + "Completed", + "In progress", + "Not accepted", + "Not started", + "Obsolete" + ], + "location": "query" + }, + "teamId": { + "type": "string", + "description": "Team ID", + "required": true, + "location": "path" + }, + "title": { + "type": "string", + "description": "Job title", + "location": "query" + } + }, + "parameterOrder": [ + "teamId", + "jobId" + ], + "request": { + "$ref": "Job" + }, + "response": { + "$ref": "Job" + }, + "scopes": [ + "https://www.googleapis.com/auth/coordinate" + ] + } + } + }, + "location": { + "methods": { + "list": { + "id": "coordinate.location.list", + "path": "{teamId}/workers/{workerEmail}/locations", + "httpMethod": "GET", + "description": "Retrieves a list of locations for a worker.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return in one page.", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Continuation token", + "location": "query" + }, + "startTimestampMs": { + "type": "string", + "description": "Start timestamp in milliseconds since the epoch.", + "required": true, + "format": "uint64", + "location": "query" + }, + "teamId": { + "type": "string", + "description": "Team ID", + "required": true, + "location": "path" + }, + "workerEmail": { + "type": "string", + "description": "Worker email address.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "teamId", + "workerEmail", + "startTimestampMs" + ], + "response": { + "$ref": "LocationListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/coordinate", + "https://www.googleapis.com/auth/coordinate.readonly" + ] + } + } + }, + "schedule": { + "methods": { + "get": { + "id": "coordinate.schedule.get", + "path": "{teamId}/jobs/{jobId}/schedule", + "httpMethod": "GET", + "description": "Retrieves the schedule for a job.", + "parameters": { + "jobId": { + "type": "string", + "description": "Job number", + "required": true, + "format": "uint64", + "location": "path" + }, + "teamId": { + "type": "string", + "description": "Team ID", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "teamId", + "jobId" + ], + "response": { + "$ref": "Schedule" + }, + "scopes": [ + "https://www.googleapis.com/auth/coordinate", + "https://www.googleapis.com/auth/coordinate.readonly" + ] + }, + "patch": { + "id": "coordinate.schedule.patch", + "path": "{teamId}/jobs/{jobId}/schedule", + "httpMethod": "PATCH", + "description": "Replaces the schedule of a job with the provided schedule. This method supports patch semantics.", + "parameters": { + "allDay": { + "type": "boolean", + "description": "Whether the job is scheduled for the whole day. Time of day in start/end times is ignored if this is true.", + "location": "query" + }, + "duration": { + "type": "string", + "description": "Job duration in milliseconds.", + "format": "uint64", + "location": "query" + }, + "endTime": { + "type": "string", + "description": "Scheduled end time in milliseconds since epoch.", + "format": "uint64", + "location": "query" + }, + "jobId": { + "type": "string", + "description": "Job number", + "required": true, + "format": "uint64", + "location": "path" + }, + "startTime": { + "type": "string", + "description": "Scheduled start time in milliseconds since epoch.", + "format": "uint64", + "location": "query" + }, + "teamId": { + "type": "string", + "description": "Team ID", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "teamId", + "jobId" + ], + "request": { + "$ref": "Schedule" + }, + "response": { + "$ref": "Schedule" + }, + "scopes": [ + "https://www.googleapis.com/auth/coordinate" + ] + }, + "update": { + "id": "coordinate.schedule.update", + "path": "{teamId}/jobs/{jobId}/schedule", + "httpMethod": "PUT", + "description": "Replaces the schedule of a job with the provided schedule.", + "parameters": { + "allDay": { + "type": "boolean", + "description": "Whether the job is scheduled for the whole day. Time of day in start/end times is ignored if this is true.", + "location": "query" + }, + "duration": { + "type": "string", + "description": "Job duration in milliseconds.", + "format": "uint64", + "location": "query" + }, + "endTime": { + "type": "string", + "description": "Scheduled end time in milliseconds since epoch.", + "format": "uint64", + "location": "query" + }, + "jobId": { + "type": "string", + "description": "Job number", + "required": true, + "format": "uint64", + "location": "path" + }, + "startTime": { + "type": "string", + "description": "Scheduled start time in milliseconds since epoch.", + "format": "uint64", + "location": "query" + }, + "teamId": { + "type": "string", + "description": "Team ID", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "teamId", + "jobId" + ], + "request": { + "$ref": "Schedule" + }, + "response": { + "$ref": "Schedule" + }, + "scopes": [ + "https://www.googleapis.com/auth/coordinate" + ] + } + } + }, + "worker": { + "methods": { + "list": { + "id": "coordinate.worker.list", + "path": "{teamId}/workers", + "httpMethod": "GET", + "description": "Retrieves a list of workers in a team.", + "parameters": { + "teamId": { + "type": "string", + "description": "Team ID", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "teamId" + ], + "response": { + "$ref": "WorkerListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/coordinate", + "https://www.googleapis.com/auth/coordinate.readonly" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/coordinate/v1/coordinate-gen.go b/third_party/src/code.google.com/p/google-api-go-client/coordinate/v1/coordinate-gen.go new file mode 100644 index 0000000000000..86f0b09f379a3 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/coordinate/v1/coordinate-gen.go @@ -0,0 +1,1841 @@ +// Package coordinate provides access to the Google Maps Coordinate API. +// +// See https://developers.google.com/coordinate/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/coordinate/v1" +// ... +// coordinateService, err := coordinate.New(oauthHttpClient) +package coordinate + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "coordinate:v1" +const apiName = "coordinate" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/coordinate/v1/teams/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Google Maps Coordinate jobs + CoordinateScope = "https://www.googleapis.com/auth/coordinate" + + // View your Google Coordinate jobs + CoordinateReadonlyScope = "https://www.googleapis.com/auth/coordinate.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.CustomFieldDef = NewCustomFieldDefService(s) + s.Jobs = NewJobsService(s) + s.Location = NewLocationService(s) + s.Schedule = NewScheduleService(s) + s.Worker = NewWorkerService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + CustomFieldDef *CustomFieldDefService + + Jobs *JobsService + + Location *LocationService + + Schedule *ScheduleService + + Worker *WorkerService +} + +func NewCustomFieldDefService(s *Service) *CustomFieldDefService { + rs := &CustomFieldDefService{s: s} + return rs +} + +type CustomFieldDefService struct { + s *Service +} + +func NewJobsService(s *Service) *JobsService { + rs := &JobsService{s: s} + return rs +} + +type JobsService struct { + s *Service +} + +func NewLocationService(s *Service) *LocationService { + rs := &LocationService{s: s} + return rs +} + +type LocationService struct { + s *Service +} + +func NewScheduleService(s *Service) *ScheduleService { + rs := &ScheduleService{s: s} + return rs +} + +type ScheduleService struct { + s *Service +} + +func NewWorkerService(s *Service) *WorkerService { + rs := &WorkerService{s: s} + return rs +} + +type WorkerService struct { + s *Service +} + +type CustomField struct { + // CustomFieldId: Custom field id. + CustomFieldId int64 `json:"customFieldId,omitempty,string"` + + // Kind: Identifies this object as a custom field. + Kind string `json:"kind,omitempty"` + + // Value: Custom field value. + Value string `json:"value,omitempty"` +} + +type CustomFieldDef struct { + // Enabled: Whether the field is enabled. + Enabled bool `json:"enabled,omitempty"` + + // Id: Custom field id. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies this object as a custom field definition. + Kind string `json:"kind,omitempty"` + + // Name: Custom field name. + Name string `json:"name,omitempty"` + + // RequiredForCheckout: Whether the field is required for checkout. + RequiredForCheckout bool `json:"requiredForCheckout,omitempty"` + + // Type: Custom field type. + Type string `json:"type,omitempty"` +} + +type CustomFieldDefListResponse struct { + // Items: Collection of custom field definitions in a team. + Items []*CustomFieldDef `json:"items,omitempty"` + + // Kind: Identifies this object as a collection of custom field + // definitions in a team. + Kind string `json:"kind,omitempty"` +} + +type CustomFields struct { + // CustomField: Collection of custom fields. + CustomField []*CustomField `json:"customField,omitempty"` + + // Kind: Identifies this object as a collection of custom fields. + Kind string `json:"kind,omitempty"` +} + +type Job struct { + // Id: Job id. + Id uint64 `json:"id,omitempty,string"` + + // JobChange: List of job changes since it was created. The first change + // corresponds to the state of the job when it was created. + JobChange []*JobChange `json:"jobChange,omitempty"` + + // Kind: Identifies this object as a job. + Kind string `json:"kind,omitempty"` + + // State: Current job state. + State *JobState `json:"state,omitempty"` +} + +type JobChange struct { + // Kind: Identifies this object as a job change. + Kind string `json:"kind,omitempty"` + + // State: Change applied to the job. Only the fields that were changed + // are set. + State *JobState `json:"state,omitempty"` + + // Timestamp: Time at which this change was applied. + Timestamp uint64 `json:"timestamp,omitempty,string"` +} + +type JobListResponse struct { + // Items: Jobs in the collection. + Items []*Job `json:"items,omitempty"` + + // Kind: Identifies this object as a list of jobs. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token to provide to get the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type JobState struct { + // Assignee: Email address of the assignee. + Assignee string `json:"assignee,omitempty"` + + // CustomFields: Custom fields. + CustomFields *CustomFields `json:"customFields,omitempty"` + + // CustomerName: Customer name. + CustomerName string `json:"customerName,omitempty"` + + // CustomerPhoneNumber: Customer phone number. + CustomerPhoneNumber string `json:"customerPhoneNumber,omitempty"` + + // Kind: Identifies this object as a job state. + Kind string `json:"kind,omitempty"` + + // Location: Job location. + Location *Location `json:"location,omitempty"` + + // Note: Note added to the job. + Note []string `json:"note,omitempty"` + + // Progress: Job progress. + Progress string `json:"progress,omitempty"` + + // Title: Job title. + Title string `json:"title,omitempty"` +} + +type Location struct { + // AddressLine: Address. + AddressLine []string `json:"addressLine,omitempty"` + + // Kind: Identifies this object as a location. + Kind string `json:"kind,omitempty"` + + // Lat: Latitude. + Lat float64 `json:"lat,omitempty"` + + // Lng: Longitude. + Lng float64 `json:"lng,omitempty"` +} + +type LocationListResponse struct { + // Items: Locations in the collection. + Items []*LocationRecord `json:"items,omitempty"` + + // Kind: Identifies this object as a list of locations. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token to provide to get the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TokenPagination: Pagination information for token pagination. + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` +} + +type LocationRecord struct { + // CollectionTime: The collection time in milliseconds since the epoch. + CollectionTime int64 `json:"collectionTime,omitempty,string"` + + // ConfidenceRadius: The location accuracy in meters. This is the radius + // of a 95% confidence interval around the location measurement. + ConfidenceRadius float64 `json:"confidenceRadius,omitempty"` + + // Kind: Identifies this object as a location. + Kind string `json:"kind,omitempty"` + + // Latitude: Latitude. + Latitude float64 `json:"latitude,omitempty"` + + // Longitude: Longitude. + Longitude float64 `json:"longitude,omitempty"` +} + +type Schedule struct { + // AllDay: Whether the job is scheduled for the whole day. Time of day + // in start/end times is ignored if this is true. + AllDay bool `json:"allDay,omitempty"` + + // Duration: Job duration in milliseconds. + Duration uint64 `json:"duration,omitempty,string"` + + // EndTime: Scheduled end time in milliseconds since epoch. + EndTime uint64 `json:"endTime,omitempty,string"` + + // Kind: Identifies this object as a job schedule. + Kind string `json:"kind,omitempty"` + + // StartTime: Scheduled start time in milliseconds since epoch. + StartTime uint64 `json:"startTime,omitempty,string"` +} + +type TokenPagination struct { + // Kind: Identifies this object as pagination information. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token to provide to get the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // PreviousPageToken: A token to provide to get the previous page of + // results. + PreviousPageToken string `json:"previousPageToken,omitempty"` +} + +type Worker struct { + // Id: Worker email address. + Id string `json:"id,omitempty"` + + // Kind: Identifies this object as a worker. + Kind string `json:"kind,omitempty"` +} + +type WorkerListResponse struct { + // Items: Workers in the collection. + Items []*Worker `json:"items,omitempty"` + + // Kind: Identifies this object as a list of workers. + Kind string `json:"kind,omitempty"` +} + +// method id "coordinate.customFieldDef.list": + +type CustomFieldDefListCall struct { + s *Service + teamId string + opt_ map[string]interface{} +} + +// List: Retrieves a list of custom field definitions for a team. +func (r *CustomFieldDefService) List(teamId string) *CustomFieldDefListCall { + c := &CustomFieldDefListCall{s: r.s, opt_: make(map[string]interface{})} + c.teamId = teamId + return c +} + +func (c *CustomFieldDefListCall) Do() (*CustomFieldDefListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/custom_fields") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{teamId}", url.QueryEscape(c.teamId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CustomFieldDefListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of custom field definitions for a team.", + // "httpMethod": "GET", + // "id": "coordinate.customFieldDef.list", + // "parameterOrder": [ + // "teamId" + // ], + // "parameters": { + // "teamId": { + // "description": "Team ID", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{teamId}/custom_fields", + // "response": { + // "$ref": "CustomFieldDefListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/coordinate", + // "https://www.googleapis.com/auth/coordinate.readonly" + // ] + // } + +} + +// method id "coordinate.jobs.get": + +type JobsGetCall struct { + s *Service + teamId string + jobId uint64 + opt_ map[string]interface{} +} + +// Get: Retrieves a job, including all the changes made to the job. +func (r *JobsService) Get(teamId string, jobId uint64) *JobsGetCall { + c := &JobsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.teamId = teamId + c.jobId = jobId + return c +} + +func (c *JobsGetCall) Do() (*Job, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/jobs/{jobId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{teamId}", url.QueryEscape(c.teamId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{jobId}", strconv.FormatUint(c.jobId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Job) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a job, including all the changes made to the job.", + // "httpMethod": "GET", + // "id": "coordinate.jobs.get", + // "parameterOrder": [ + // "teamId", + // "jobId" + // ], + // "parameters": { + // "jobId": { + // "description": "Job number", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "teamId": { + // "description": "Team ID", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{teamId}/jobs/{jobId}", + // "response": { + // "$ref": "Job" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/coordinate", + // "https://www.googleapis.com/auth/coordinate.readonly" + // ] + // } + +} + +// method id "coordinate.jobs.insert": + +type JobsInsertCall struct { + s *Service + teamId string + address string + lat float64 + lng float64 + title string + job *Job + opt_ map[string]interface{} +} + +// Insert: Inserts a new job. Only the state field of the job should be +// set. +func (r *JobsService) Insert(teamId string, address string, lat float64, lng float64, title string, job *Job) *JobsInsertCall { + c := &JobsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.teamId = teamId + c.address = address + c.lat = lat + c.lng = lng + c.title = title + c.job = job + return c +} + +// Assignee sets the optional parameter "assignee": Assignee email +// address, or empty string to unassign. +func (c *JobsInsertCall) Assignee(assignee string) *JobsInsertCall { + c.opt_["assignee"] = assignee + return c +} + +// CustomField sets the optional parameter "customField": Map from +// custom field id (from /team//custom_fields) to the field value. For +// example '123=Alice' +func (c *JobsInsertCall) CustomField(customField string) *JobsInsertCall { + c.opt_["customField"] = customField + return c +} + +// CustomerName sets the optional parameter "customerName": Customer +// name +func (c *JobsInsertCall) CustomerName(customerName string) *JobsInsertCall { + c.opt_["customerName"] = customerName + return c +} + +// CustomerPhoneNumber sets the optional parameter +// "customerPhoneNumber": Customer phone number +func (c *JobsInsertCall) CustomerPhoneNumber(customerPhoneNumber string) *JobsInsertCall { + c.opt_["customerPhoneNumber"] = customerPhoneNumber + return c +} + +// Note sets the optional parameter "note": Job note as newline (Unix) +// separated string +func (c *JobsInsertCall) Note(note string) *JobsInsertCall { + c.opt_["note"] = note + return c +} + +func (c *JobsInsertCall) Do() (*Job, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + params.Set("address", fmt.Sprintf("%v", c.address)) + params.Set("lat", fmt.Sprintf("%v", c.lat)) + params.Set("lng", fmt.Sprintf("%v", c.lng)) + params.Set("title", fmt.Sprintf("%v", c.title)) + if v, ok := c.opt_["assignee"]; ok { + params.Set("assignee", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["customField"]; ok { + params.Set("customField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["customerName"]; ok { + params.Set("customerName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["customerPhoneNumber"]; ok { + params.Set("customerPhoneNumber", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["note"]; ok { + params.Set("note", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/jobs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{teamId}", url.QueryEscape(c.teamId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Job) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new job. Only the state field of the job should be set.", + // "httpMethod": "POST", + // "id": "coordinate.jobs.insert", + // "parameterOrder": [ + // "teamId", + // "address", + // "lat", + // "lng", + // "title" + // ], + // "parameters": { + // "address": { + // "description": "Job address as newline (Unix) separated string", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "assignee": { + // "description": "Assignee email address, or empty string to unassign.", + // "location": "query", + // "type": "string" + // }, + // "customField": { + // "description": "Map from custom field id (from /team//custom_fields) to the field value. For example '123=Alice'", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "customerName": { + // "description": "Customer name", + // "location": "query", + // "type": "string" + // }, + // "customerPhoneNumber": { + // "description": "Customer phone number", + // "location": "query", + // "type": "string" + // }, + // "lat": { + // "description": "The latitude coordinate of this job's location.", + // "format": "double", + // "location": "query", + // "required": true, + // "type": "number" + // }, + // "lng": { + // "description": "The longitude coordinate of this job's location.", + // "format": "double", + // "location": "query", + // "required": true, + // "type": "number" + // }, + // "note": { + // "description": "Job note as newline (Unix) separated string", + // "location": "query", + // "type": "string" + // }, + // "teamId": { + // "description": "Team ID", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "title": { + // "description": "Job title", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{teamId}/jobs", + // "request": { + // "$ref": "Job" + // }, + // "response": { + // "$ref": "Job" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/coordinate" + // ] + // } + +} + +// method id "coordinate.jobs.list": + +type JobsListCall struct { + s *Service + teamId string + opt_ map[string]interface{} +} + +// List: Retrieves jobs created or modified since the given timestamp. +func (r *JobsService) List(teamId string) *JobsListCall { + c := &JobsListCall{s: r.s, opt_: make(map[string]interface{})} + c.teamId = teamId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return in one page. +func (c *JobsListCall) MaxResults(maxResults int64) *JobsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// MinModifiedTimestampMs sets the optional parameter +// "minModifiedTimestampMs": Minimum time a job was modified in +// milliseconds since epoch. +func (c *JobsListCall) MinModifiedTimestampMs(minModifiedTimestampMs uint64) *JobsListCall { + c.opt_["minModifiedTimestampMs"] = minModifiedTimestampMs + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +func (c *JobsListCall) PageToken(pageToken string) *JobsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *JobsListCall) Do() (*JobListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minModifiedTimestampMs"]; ok { + params.Set("minModifiedTimestampMs", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/jobs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{teamId}", url.QueryEscape(c.teamId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(JobListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves jobs created or modified since the given timestamp.", + // "httpMethod": "GET", + // "id": "coordinate.jobs.list", + // "parameterOrder": [ + // "teamId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return in one page.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "minModifiedTimestampMs": { + // "description": "Minimum time a job was modified in milliseconds since epoch.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Continuation token", + // "location": "query", + // "type": "string" + // }, + // "teamId": { + // "description": "Team ID", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{teamId}/jobs", + // "response": { + // "$ref": "JobListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/coordinate", + // "https://www.googleapis.com/auth/coordinate.readonly" + // ] + // } + +} + +// method id "coordinate.jobs.patch": + +type JobsPatchCall struct { + s *Service + teamId string + jobId uint64 + job *Job + opt_ map[string]interface{} +} + +// Patch: Updates a job. Fields that are set in the job state will be +// updated. This method supports patch semantics. +func (r *JobsService) Patch(teamId string, jobId uint64, job *Job) *JobsPatchCall { + c := &JobsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.teamId = teamId + c.jobId = jobId + c.job = job + return c +} + +// Address sets the optional parameter "address": Job address as newline +// (Unix) separated string +func (c *JobsPatchCall) Address(address string) *JobsPatchCall { + c.opt_["address"] = address + return c +} + +// Assignee sets the optional parameter "assignee": Assignee email +// address, or empty string to unassign. +func (c *JobsPatchCall) Assignee(assignee string) *JobsPatchCall { + c.opt_["assignee"] = assignee + return c +} + +// CustomField sets the optional parameter "customField": Map from +// custom field id (from /team//custom_fields) to the field value. For +// example '123=Alice' +func (c *JobsPatchCall) CustomField(customField string) *JobsPatchCall { + c.opt_["customField"] = customField + return c +} + +// CustomerName sets the optional parameter "customerName": Customer +// name +func (c *JobsPatchCall) CustomerName(customerName string) *JobsPatchCall { + c.opt_["customerName"] = customerName + return c +} + +// CustomerPhoneNumber sets the optional parameter +// "customerPhoneNumber": Customer phone number +func (c *JobsPatchCall) CustomerPhoneNumber(customerPhoneNumber string) *JobsPatchCall { + c.opt_["customerPhoneNumber"] = customerPhoneNumber + return c +} + +// Lat sets the optional parameter "lat": The latitude coordinate of +// this job's location. +func (c *JobsPatchCall) Lat(lat float64) *JobsPatchCall { + c.opt_["lat"] = lat + return c +} + +// Lng sets the optional parameter "lng": The longitude coordinate of +// this job's location. +func (c *JobsPatchCall) Lng(lng float64) *JobsPatchCall { + c.opt_["lng"] = lng + return c +} + +// Note sets the optional parameter "note": Job note as newline (Unix) +// separated string +func (c *JobsPatchCall) Note(note string) *JobsPatchCall { + c.opt_["note"] = note + return c +} + +// Progress sets the optional parameter "progress": Job progress +func (c *JobsPatchCall) Progress(progress string) *JobsPatchCall { + c.opt_["progress"] = progress + return c +} + +// Title sets the optional parameter "title": Job title +func (c *JobsPatchCall) Title(title string) *JobsPatchCall { + c.opt_["title"] = title + return c +} + +func (c *JobsPatchCall) Do() (*Job, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["address"]; ok { + params.Set("address", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["assignee"]; ok { + params.Set("assignee", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["customField"]; ok { + params.Set("customField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["customerName"]; ok { + params.Set("customerName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["customerPhoneNumber"]; ok { + params.Set("customerPhoneNumber", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["lat"]; ok { + params.Set("lat", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["lng"]; ok { + params.Set("lng", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["note"]; ok { + params.Set("note", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["progress"]; ok { + params.Set("progress", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["title"]; ok { + params.Set("title", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/jobs/{jobId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{teamId}", url.QueryEscape(c.teamId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{jobId}", strconv.FormatUint(c.jobId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Job) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a job. Fields that are set in the job state will be updated. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "coordinate.jobs.patch", + // "parameterOrder": [ + // "teamId", + // "jobId" + // ], + // "parameters": { + // "address": { + // "description": "Job address as newline (Unix) separated string", + // "location": "query", + // "type": "string" + // }, + // "assignee": { + // "description": "Assignee email address, or empty string to unassign.", + // "location": "query", + // "type": "string" + // }, + // "customField": { + // "description": "Map from custom field id (from /team//custom_fields) to the field value. For example '123=Alice'", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "customerName": { + // "description": "Customer name", + // "location": "query", + // "type": "string" + // }, + // "customerPhoneNumber": { + // "description": "Customer phone number", + // "location": "query", + // "type": "string" + // }, + // "jobId": { + // "description": "Job number", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "lat": { + // "description": "The latitude coordinate of this job's location.", + // "format": "double", + // "location": "query", + // "type": "number" + // }, + // "lng": { + // "description": "The longitude coordinate of this job's location.", + // "format": "double", + // "location": "query", + // "type": "number" + // }, + // "note": { + // "description": "Job note as newline (Unix) separated string", + // "location": "query", + // "type": "string" + // }, + // "progress": { + // "description": "Job progress", + // "enum": [ + // "COMPLETED", + // "IN_PROGRESS", + // "NOT_ACCEPTED", + // "NOT_STARTED", + // "OBSOLETE" + // ], + // "enumDescriptions": [ + // "Completed", + // "In progress", + // "Not accepted", + // "Not started", + // "Obsolete" + // ], + // "location": "query", + // "type": "string" + // }, + // "teamId": { + // "description": "Team ID", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "title": { + // "description": "Job title", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{teamId}/jobs/{jobId}", + // "request": { + // "$ref": "Job" + // }, + // "response": { + // "$ref": "Job" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/coordinate" + // ] + // } + +} + +// method id "coordinate.jobs.update": + +type JobsUpdateCall struct { + s *Service + teamId string + jobId uint64 + job *Job + opt_ map[string]interface{} +} + +// Update: Updates a job. Fields that are set in the job state will be +// updated. +func (r *JobsService) Update(teamId string, jobId uint64, job *Job) *JobsUpdateCall { + c := &JobsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.teamId = teamId + c.jobId = jobId + c.job = job + return c +} + +// Address sets the optional parameter "address": Job address as newline +// (Unix) separated string +func (c *JobsUpdateCall) Address(address string) *JobsUpdateCall { + c.opt_["address"] = address + return c +} + +// Assignee sets the optional parameter "assignee": Assignee email +// address, or empty string to unassign. +func (c *JobsUpdateCall) Assignee(assignee string) *JobsUpdateCall { + c.opt_["assignee"] = assignee + return c +} + +// CustomField sets the optional parameter "customField": Map from +// custom field id (from /team//custom_fields) to the field value. For +// example '123=Alice' +func (c *JobsUpdateCall) CustomField(customField string) *JobsUpdateCall { + c.opt_["customField"] = customField + return c +} + +// CustomerName sets the optional parameter "customerName": Customer +// name +func (c *JobsUpdateCall) CustomerName(customerName string) *JobsUpdateCall { + c.opt_["customerName"] = customerName + return c +} + +// CustomerPhoneNumber sets the optional parameter +// "customerPhoneNumber": Customer phone number +func (c *JobsUpdateCall) CustomerPhoneNumber(customerPhoneNumber string) *JobsUpdateCall { + c.opt_["customerPhoneNumber"] = customerPhoneNumber + return c +} + +// Lat sets the optional parameter "lat": The latitude coordinate of +// this job's location. +func (c *JobsUpdateCall) Lat(lat float64) *JobsUpdateCall { + c.opt_["lat"] = lat + return c +} + +// Lng sets the optional parameter "lng": The longitude coordinate of +// this job's location. +func (c *JobsUpdateCall) Lng(lng float64) *JobsUpdateCall { + c.opt_["lng"] = lng + return c +} + +// Note sets the optional parameter "note": Job note as newline (Unix) +// separated string +func (c *JobsUpdateCall) Note(note string) *JobsUpdateCall { + c.opt_["note"] = note + return c +} + +// Progress sets the optional parameter "progress": Job progress +func (c *JobsUpdateCall) Progress(progress string) *JobsUpdateCall { + c.opt_["progress"] = progress + return c +} + +// Title sets the optional parameter "title": Job title +func (c *JobsUpdateCall) Title(title string) *JobsUpdateCall { + c.opt_["title"] = title + return c +} + +func (c *JobsUpdateCall) Do() (*Job, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["address"]; ok { + params.Set("address", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["assignee"]; ok { + params.Set("assignee", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["customField"]; ok { + params.Set("customField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["customerName"]; ok { + params.Set("customerName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["customerPhoneNumber"]; ok { + params.Set("customerPhoneNumber", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["lat"]; ok { + params.Set("lat", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["lng"]; ok { + params.Set("lng", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["note"]; ok { + params.Set("note", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["progress"]; ok { + params.Set("progress", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["title"]; ok { + params.Set("title", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/jobs/{jobId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{teamId}", url.QueryEscape(c.teamId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{jobId}", strconv.FormatUint(c.jobId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Job) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a job. Fields that are set in the job state will be updated.", + // "httpMethod": "PUT", + // "id": "coordinate.jobs.update", + // "parameterOrder": [ + // "teamId", + // "jobId" + // ], + // "parameters": { + // "address": { + // "description": "Job address as newline (Unix) separated string", + // "location": "query", + // "type": "string" + // }, + // "assignee": { + // "description": "Assignee email address, or empty string to unassign.", + // "location": "query", + // "type": "string" + // }, + // "customField": { + // "description": "Map from custom field id (from /team//custom_fields) to the field value. For example '123=Alice'", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "customerName": { + // "description": "Customer name", + // "location": "query", + // "type": "string" + // }, + // "customerPhoneNumber": { + // "description": "Customer phone number", + // "location": "query", + // "type": "string" + // }, + // "jobId": { + // "description": "Job number", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "lat": { + // "description": "The latitude coordinate of this job's location.", + // "format": "double", + // "location": "query", + // "type": "number" + // }, + // "lng": { + // "description": "The longitude coordinate of this job's location.", + // "format": "double", + // "location": "query", + // "type": "number" + // }, + // "note": { + // "description": "Job note as newline (Unix) separated string", + // "location": "query", + // "type": "string" + // }, + // "progress": { + // "description": "Job progress", + // "enum": [ + // "COMPLETED", + // "IN_PROGRESS", + // "NOT_ACCEPTED", + // "NOT_STARTED", + // "OBSOLETE" + // ], + // "enumDescriptions": [ + // "Completed", + // "In progress", + // "Not accepted", + // "Not started", + // "Obsolete" + // ], + // "location": "query", + // "type": "string" + // }, + // "teamId": { + // "description": "Team ID", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "title": { + // "description": "Job title", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{teamId}/jobs/{jobId}", + // "request": { + // "$ref": "Job" + // }, + // "response": { + // "$ref": "Job" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/coordinate" + // ] + // } + +} + +// method id "coordinate.location.list": + +type LocationListCall struct { + s *Service + teamId string + workerEmail string + startTimestampMs uint64 + opt_ map[string]interface{} +} + +// List: Retrieves a list of locations for a worker. +func (r *LocationService) List(teamId string, workerEmail string, startTimestampMs uint64) *LocationListCall { + c := &LocationListCall{s: r.s, opt_: make(map[string]interface{})} + c.teamId = teamId + c.workerEmail = workerEmail + c.startTimestampMs = startTimestampMs + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return in one page. +func (c *LocationListCall) MaxResults(maxResults int64) *LocationListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +func (c *LocationListCall) PageToken(pageToken string) *LocationListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *LocationListCall) Do() (*LocationListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("startTimestampMs", fmt.Sprintf("%v", c.startTimestampMs)) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/workers/{workerEmail}/locations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{teamId}", url.QueryEscape(c.teamId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{workerEmail}", url.QueryEscape(c.workerEmail), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(LocationListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of locations for a worker.", + // "httpMethod": "GET", + // "id": "coordinate.location.list", + // "parameterOrder": [ + // "teamId", + // "workerEmail", + // "startTimestampMs" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return in one page.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token", + // "location": "query", + // "type": "string" + // }, + // "startTimestampMs": { + // "description": "Start timestamp in milliseconds since the epoch.", + // "format": "uint64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "teamId": { + // "description": "Team ID", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "workerEmail": { + // "description": "Worker email address.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{teamId}/workers/{workerEmail}/locations", + // "response": { + // "$ref": "LocationListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/coordinate", + // "https://www.googleapis.com/auth/coordinate.readonly" + // ] + // } + +} + +// method id "coordinate.schedule.get": + +type ScheduleGetCall struct { + s *Service + teamId string + jobId uint64 + opt_ map[string]interface{} +} + +// Get: Retrieves the schedule for a job. +func (r *ScheduleService) Get(teamId string, jobId uint64) *ScheduleGetCall { + c := &ScheduleGetCall{s: r.s, opt_: make(map[string]interface{})} + c.teamId = teamId + c.jobId = jobId + return c +} + +func (c *ScheduleGetCall) Do() (*Schedule, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/jobs/{jobId}/schedule") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{teamId}", url.QueryEscape(c.teamId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{jobId}", strconv.FormatUint(c.jobId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Schedule) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the schedule for a job.", + // "httpMethod": "GET", + // "id": "coordinate.schedule.get", + // "parameterOrder": [ + // "teamId", + // "jobId" + // ], + // "parameters": { + // "jobId": { + // "description": "Job number", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "teamId": { + // "description": "Team ID", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{teamId}/jobs/{jobId}/schedule", + // "response": { + // "$ref": "Schedule" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/coordinate", + // "https://www.googleapis.com/auth/coordinate.readonly" + // ] + // } + +} + +// method id "coordinate.schedule.patch": + +type SchedulePatchCall struct { + s *Service + teamId string + jobId uint64 + schedule *Schedule + opt_ map[string]interface{} +} + +// Patch: Replaces the schedule of a job with the provided schedule. +// This method supports patch semantics. +func (r *ScheduleService) Patch(teamId string, jobId uint64, schedule *Schedule) *SchedulePatchCall { + c := &SchedulePatchCall{s: r.s, opt_: make(map[string]interface{})} + c.teamId = teamId + c.jobId = jobId + c.schedule = schedule + return c +} + +// AllDay sets the optional parameter "allDay": Whether the job is +// scheduled for the whole day. Time of day in start/end times is +// ignored if this is true. +func (c *SchedulePatchCall) AllDay(allDay bool) *SchedulePatchCall { + c.opt_["allDay"] = allDay + return c +} + +// Duration sets the optional parameter "duration": Job duration in +// milliseconds. +func (c *SchedulePatchCall) Duration(duration uint64) *SchedulePatchCall { + c.opt_["duration"] = duration + return c +} + +// EndTime sets the optional parameter "endTime": Scheduled end time in +// milliseconds since epoch. +func (c *SchedulePatchCall) EndTime(endTime uint64) *SchedulePatchCall { + c.opt_["endTime"] = endTime + return c +} + +// StartTime sets the optional parameter "startTime": Scheduled start +// time in milliseconds since epoch. +func (c *SchedulePatchCall) StartTime(startTime uint64) *SchedulePatchCall { + c.opt_["startTime"] = startTime + return c +} + +func (c *SchedulePatchCall) Do() (*Schedule, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.schedule) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["allDay"]; ok { + params.Set("allDay", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["duration"]; ok { + params.Set("duration", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["endTime"]; ok { + params.Set("endTime", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startTime"]; ok { + params.Set("startTime", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/jobs/{jobId}/schedule") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{teamId}", url.QueryEscape(c.teamId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{jobId}", strconv.FormatUint(c.jobId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Schedule) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Replaces the schedule of a job with the provided schedule. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "coordinate.schedule.patch", + // "parameterOrder": [ + // "teamId", + // "jobId" + // ], + // "parameters": { + // "allDay": { + // "description": "Whether the job is scheduled for the whole day. Time of day in start/end times is ignored if this is true.", + // "location": "query", + // "type": "boolean" + // }, + // "duration": { + // "description": "Job duration in milliseconds.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "endTime": { + // "description": "Scheduled end time in milliseconds since epoch.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "jobId": { + // "description": "Job number", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startTime": { + // "description": "Scheduled start time in milliseconds since epoch.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "teamId": { + // "description": "Team ID", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{teamId}/jobs/{jobId}/schedule", + // "request": { + // "$ref": "Schedule" + // }, + // "response": { + // "$ref": "Schedule" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/coordinate" + // ] + // } + +} + +// method id "coordinate.schedule.update": + +type ScheduleUpdateCall struct { + s *Service + teamId string + jobId uint64 + schedule *Schedule + opt_ map[string]interface{} +} + +// Update: Replaces the schedule of a job with the provided schedule. +func (r *ScheduleService) Update(teamId string, jobId uint64, schedule *Schedule) *ScheduleUpdateCall { + c := &ScheduleUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.teamId = teamId + c.jobId = jobId + c.schedule = schedule + return c +} + +// AllDay sets the optional parameter "allDay": Whether the job is +// scheduled for the whole day. Time of day in start/end times is +// ignored if this is true. +func (c *ScheduleUpdateCall) AllDay(allDay bool) *ScheduleUpdateCall { + c.opt_["allDay"] = allDay + return c +} + +// Duration sets the optional parameter "duration": Job duration in +// milliseconds. +func (c *ScheduleUpdateCall) Duration(duration uint64) *ScheduleUpdateCall { + c.opt_["duration"] = duration + return c +} + +// EndTime sets the optional parameter "endTime": Scheduled end time in +// milliseconds since epoch. +func (c *ScheduleUpdateCall) EndTime(endTime uint64) *ScheduleUpdateCall { + c.opt_["endTime"] = endTime + return c +} + +// StartTime sets the optional parameter "startTime": Scheduled start +// time in milliseconds since epoch. +func (c *ScheduleUpdateCall) StartTime(startTime uint64) *ScheduleUpdateCall { + c.opt_["startTime"] = startTime + return c +} + +func (c *ScheduleUpdateCall) Do() (*Schedule, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.schedule) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["allDay"]; ok { + params.Set("allDay", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["duration"]; ok { + params.Set("duration", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["endTime"]; ok { + params.Set("endTime", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startTime"]; ok { + params.Set("startTime", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/jobs/{jobId}/schedule") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{teamId}", url.QueryEscape(c.teamId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{jobId}", strconv.FormatUint(c.jobId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Schedule) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Replaces the schedule of a job with the provided schedule.", + // "httpMethod": "PUT", + // "id": "coordinate.schedule.update", + // "parameterOrder": [ + // "teamId", + // "jobId" + // ], + // "parameters": { + // "allDay": { + // "description": "Whether the job is scheduled for the whole day. Time of day in start/end times is ignored if this is true.", + // "location": "query", + // "type": "boolean" + // }, + // "duration": { + // "description": "Job duration in milliseconds.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "endTime": { + // "description": "Scheduled end time in milliseconds since epoch.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "jobId": { + // "description": "Job number", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startTime": { + // "description": "Scheduled start time in milliseconds since epoch.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "teamId": { + // "description": "Team ID", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{teamId}/jobs/{jobId}/schedule", + // "request": { + // "$ref": "Schedule" + // }, + // "response": { + // "$ref": "Schedule" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/coordinate" + // ] + // } + +} + +// method id "coordinate.worker.list": + +type WorkerListCall struct { + s *Service + teamId string + opt_ map[string]interface{} +} + +// List: Retrieves a list of workers in a team. +func (r *WorkerService) List(teamId string) *WorkerListCall { + c := &WorkerListCall{s: r.s, opt_: make(map[string]interface{})} + c.teamId = teamId + return c +} + +func (c *WorkerListCall) Do() (*WorkerListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/workers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{teamId}", url.QueryEscape(c.teamId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(WorkerListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of workers in a team.", + // "httpMethod": "GET", + // "id": "coordinate.worker.list", + // "parameterOrder": [ + // "teamId" + // ], + // "parameters": { + // "teamId": { + // "description": "Team ID", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{teamId}/workers", + // "response": { + // "$ref": "WorkerListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/coordinate", + // "https://www.googleapis.com/auth/coordinate.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/customsearch/v1/customsearch-api.json b/third_party/src/code.google.com/p/google-api-go-client/customsearch/v1/customsearch-api.json new file mode 100644 index 0000000000000..17c3f4f1b5bf0 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/customsearch/v1/customsearch-api.json @@ -0,0 +1,813 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/5fAOCCT-EMDzKZ0hPKCYdJUAc9k\"", + "discoveryVersion": "v1", + "id": "customsearch:v1", + "name": "customsearch", + "version": "v1", + "title": "CustomSearch API", + "description": "Lets you search over a website or collection of websites", + "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/custom-search/v1/using_rest", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/customsearch/", + "basePath": "/customsearch/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "customsearch/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "atom", + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/atom+xml", + "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" + } + }, + "schemas": { + "Context": { + "id": "Context", + "type": "object", + "properties": { + "facets": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "anchor": { + "type": "string" + }, + "label": { + "type": "string" + }, + "label_with_op": { + "type": "string" + } + } + } + } + }, + "title": { + "type": "string" + } + } + }, + "Promotion": { + "id": "Promotion", + "type": "object", + "properties": { + "bodyLines": { + "type": "array", + "items": { + "type": "object", + "properties": { + "htmlTitle": { + "type": "string" + }, + "link": { + "type": "string" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + } + } + }, + "displayLink": { + "type": "string" + }, + "htmlTitle": { + "type": "string" + }, + "image": { + "type": "object", + "properties": { + "height": { + "type": "integer", + "format": "int32" + }, + "source": { + "type": "string" + }, + "width": { + "type": "integer", + "format": "int32" + } + } + }, + "link": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "Query": { + "id": "Query", + "type": "object", + "properties": { + "count": { + "type": "integer", + "format": "int32" + }, + "cr": { + "type": "string" + }, + "cref": { + "type": "string" + }, + "cx": { + "type": "string" + }, + "dateRestrict": { + "type": "string" + }, + "disableCnTwTranslation": { + "type": "string" + }, + "exactTerms": { + "type": "string" + }, + "excludeTerms": { + "type": "string" + }, + "fileType": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "gl": { + "type": "string" + }, + "googleHost": { + "type": "string" + }, + "highRange": { + "type": "string" + }, + "hl": { + "type": "string" + }, + "hq": { + "type": "string" + }, + "imgColorType": { + "type": "string" + }, + "imgDominantColor": { + "type": "string" + }, + "imgSize": { + "type": "string" + }, + "imgType": { + "type": "string" + }, + "inputEncoding": { + "type": "string" + }, + "language": { + "type": "string" + }, + "linkSite": { + "type": "string" + }, + "lowRange": { + "type": "string" + }, + "orTerms": { + "type": "string" + }, + "outputEncoding": { + "type": "string" + }, + "relatedSite": { + "type": "string" + }, + "rights": { + "type": "string" + }, + "safe": { + "type": "string" + }, + "searchTerms": { + "type": "string" + }, + "searchType": { + "type": "string" + }, + "siteSearch": { + "type": "string" + }, + "siteSearchFilter": { + "type": "string" + }, + "sort": { + "type": "string" + }, + "startIndex": { + "type": "integer", + "format": "int32" + }, + "startPage": { + "type": "integer", + "format": "int32" + }, + "title": { + "type": "string" + }, + "totalResults": { + "type": "string", + "format": "int64" + } + } + }, + "Result": { + "id": "Result", + "type": "object", + "properties": { + "cacheId": { + "type": "string" + }, + "displayLink": { + "type": "string" + }, + "fileFormat": { + "type": "string" + }, + "formattedUrl": { + "type": "string" + }, + "htmlFormattedUrl": { + "type": "string" + }, + "htmlSnippet": { + "type": "string" + }, + "htmlTitle": { + "type": "string" + }, + "image": { + "type": "object", + "properties": { + "byteSize": { + "type": "integer", + "format": "int32" + }, + "contextLink": { + "type": "string" + }, + "height": { + "type": "integer", + "format": "int32" + }, + "thumbnailHeight": { + "type": "integer", + "format": "int32" + }, + "thumbnailLink": { + "type": "string" + }, + "thumbnailWidth": { + "type": "integer", + "format": "int32" + }, + "width": { + "type": "integer", + "format": "int32" + } + } + }, + "kind": { + "type": "string", + "default": "customsearch#result" + }, + "labels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "displayName": { + "type": "string" + }, + "label_with_op": { + "type": "string" + }, + "name": { + "type": "string" + } + } + } + }, + "link": { + "type": "string" + }, + "mime": { + "type": "string" + }, + "pagemap": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "any" + } + } + } + }, + "snippet": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "Search": { + "id": "Search", + "type": "object", + "properties": { + "context": { + "$ref": "Context" + }, + "items": { + "type": "array", + "items": { + "$ref": "Result" + } + }, + "kind": { + "type": "string", + "default": "customsearch#search" + }, + "promotions": { + "type": "array", + "items": { + "$ref": "Promotion" + } + }, + "queries": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "Query" + } + } + }, + "searchInformation": { + "type": "object", + "properties": { + "formattedSearchTime": { + "type": "string" + }, + "formattedTotalResults": { + "type": "string" + }, + "searchTime": { + "type": "number", + "format": "double" + }, + "totalResults": { + "type": "string", + "format": "int64" + } + } + }, + "spelling": { + "type": "object", + "properties": { + "correctedQuery": { + "type": "string" + }, + "htmlCorrectedQuery": { + "type": "string" + } + } + }, + "url": { + "type": "object", + "properties": { + "template": { + "type": "string", + "default": "https://www.googleapis.com/customsearch/v1?q={searchTerms}&num={count?}&start={startIndex?}&lr={language?}&safe={safe?}&cx={cx?}&cref={cref?}&sort={sort?}&filter={filter?}&gl={gl?}&cr={cr?}&googlehost={googleHost?}&c2coff={disableCnTwTranslation?}&hq={hq?}&hl={hl?}&siteSearch={siteSearch?}&siteSearchFilter={siteSearchFilter?}&exactTerms={exactTerms?}&excludeTerms={excludeTerms?}&linkSite={linkSite?}&orTerms={orTerms?}&relatedSite={relatedSite?}&dateRestrict={dateRestrict?}&lowRange={lowRange?}&highRange={highRange?}&searchType={searchType}&fileType={fileType?}&rights={rights?}&imgSize={imgSize?}&imgType={imgType?}&imgColorType={imgColorType?}&imgDominantColor={imgDominantColor?}&alt=json" + }, + "type": { + "type": "string", + "default": "application/json" + } + } + } + } + } + }, + "resources": { + "cse": { + "methods": { + "list": { + "id": "search.cse.list", + "path": "v1", + "httpMethod": "GET", + "description": "Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results.", + "parameters": { + "c2coff": { + "type": "string", + "description": "Turns off the translation between zh-CN and zh-TW.", + "location": "query" + }, + "cr": { + "type": "string", + "description": "Country restrict(s).", + "location": "query" + }, + "cref": { + "type": "string", + "description": "The URL of a linked custom search engine", + "location": "query" + }, + "cx": { + "type": "string", + "description": "The custom search engine ID to scope this search query", + "location": "query" + }, + "dateRestrict": { + "type": "string", + "description": "Specifies all search results are from a time period", + "location": "query" + }, + "exactTerms": { + "type": "string", + "description": "Identifies a phrase that all documents in the search results must contain", + "location": "query" + }, + "excludeTerms": { + "type": "string", + "description": "Identifies a word or phrase that should not appear in any documents in the search results", + "location": "query" + }, + "fileType": { + "type": "string", + "description": "Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ...", + "location": "query" + }, + "filter": { + "type": "string", + "description": "Controls turning on or off the duplicate content filter.", + "enum": [ + "0", + "1" + ], + "enumDescriptions": [ + "Turns off duplicate content filter.", + "Turns on duplicate content filter." + ], + "location": "query" + }, + "gl": { + "type": "string", + "description": "Geolocation of end user.", + "location": "query" + }, + "googlehost": { + "type": "string", + "description": "The local Google domain to use to perform the search.", + "location": "query" + }, + "highRange": { + "type": "string", + "description": "Creates a range in form as_nlo value..as_nhi value and attempts to append it to query", + "location": "query" + }, + "hl": { + "type": "string", + "description": "Sets the user interface language.", + "location": "query" + }, + "hq": { + "type": "string", + "description": "Appends the extra query terms to the query.", + "location": "query" + }, + "imgColorType": { + "type": "string", + "description": "Returns black and white, grayscale, or color images: mono, gray, and color.", + "enum": [ + "color", + "gray", + "mono" + ], + "enumDescriptions": [ + "color", + "gray", + "mono" + ], + "location": "query" + }, + "imgDominantColor": { + "type": "string", + "description": "Returns images of a specific dominant color: yellow, green, teal, blue, purple, pink, white, gray, black and brown.", + "enum": [ + "black", + "blue", + "brown", + "gray", + "green", + "pink", + "purple", + "teal", + "white", + "yellow" + ], + "enumDescriptions": [ + "black", + "blue", + "brown", + "gray", + "green", + "pink", + "purple", + "teal", + "white", + "yellow" + ], + "location": "query" + }, + "imgSize": { + "type": "string", + "description": "Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge.", + "enum": [ + "huge", + "icon", + "large", + "medium", + "small", + "xlarge", + "xxlarge" + ], + "enumDescriptions": [ + "huge", + "icon", + "large", + "medium", + "small", + "xlarge", + "xxlarge" + ], + "location": "query" + }, + "imgType": { + "type": "string", + "description": "Returns images of a type, which can be one of: clipart, face, lineart, news, and photo.", + "enum": [ + "clipart", + "face", + "lineart", + "news", + "photo" + ], + "enumDescriptions": [ + "clipart", + "face", + "lineart", + "news", + "photo" + ], + "location": "query" + }, + "linkSite": { + "type": "string", + "description": "Specifies that all search results should contain a link to a particular URL", + "location": "query" + }, + "lowRange": { + "type": "string", + "description": "Creates a range in form as_nlo value..as_nhi value and attempts to append it to query", + "location": "query" + }, + "lr": { + "type": "string", + "description": "The language restriction for the search results", + "enum": [ + "lang_ar", + "lang_bg", + "lang_ca", + "lang_cs", + "lang_da", + "lang_de", + "lang_el", + "lang_en", + "lang_es", + "lang_et", + "lang_fi", + "lang_fr", + "lang_hr", + "lang_hu", + "lang_id", + "lang_is", + "lang_it", + "lang_iw", + "lang_ja", + "lang_ko", + "lang_lt", + "lang_lv", + "lang_nl", + "lang_no", + "lang_pl", + "lang_pt", + "lang_ro", + "lang_ru", + "lang_sk", + "lang_sl", + "lang_sr", + "lang_sv", + "lang_tr", + "lang_zh-CN", + "lang_zh-TW" + ], + "enumDescriptions": [ + "Arabic", + "Bulgarian", + "Catalan", + "Czech", + "Danish", + "German", + "Greek", + "English", + "Spanish", + "Estonian", + "Finnish", + "French", + "Croatian", + "Hungarian", + "Indonesian", + "Icelandic", + "Italian", + "Hebrew", + "Japanese", + "Korean", + "Lithuanian", + "Latvian", + "Dutch", + "Norwegian", + "Polish", + "Portuguese", + "Romanian", + "Russian", + "Slovak", + "Slovenian", + "Serbian", + "Swedish", + "Turkish", + "Chinese (Simplified)", + "Chinese (Traditional)" + ], + "location": "query" + }, + "num": { + "type": "integer", + "description": "Number of search results to return", + "default": "10", + "format": "uint32", + "location": "query" + }, + "orTerms": { + "type": "string", + "description": "Provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional search terms", + "location": "query" + }, + "q": { + "type": "string", + "description": "Query", + "required": true, + "location": "query" + }, + "relatedSite": { + "type": "string", + "description": "Specifies that all search results should be pages that are related to the specified URL", + "location": "query" + }, + "rights": { + "type": "string", + "description": "Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these.", + "location": "query" + }, + "safe": { + "type": "string", + "description": "Search safety level", + "default": "off", + "enum": [ + "high", + "medium", + "off" + ], + "enumDescriptions": [ + "Enables highest level of safe search filtering.", + "Enables moderate safe search filtering.", + "Disables safe search filtering." + ], + "location": "query" + }, + "searchType": { + "type": "string", + "description": "Specifies the search type: image.", + "enum": [ + "image" + ], + "enumDescriptions": [ + "custom image search" + ], + "location": "query" + }, + "siteSearch": { + "type": "string", + "description": "Specifies all search results should be pages from a given site", + "location": "query" + }, + "siteSearchFilter": { + "type": "string", + "description": "Controls whether to include or exclude results from the site named in the as_sitesearch parameter", + "enum": [ + "e", + "i" + ], + "enumDescriptions": [ + "exclude", + "include" + ], + "location": "query" + }, + "sort": { + "type": "string", + "description": "The sort expression to apply to the results", + "location": "query" + }, + "start": { + "type": "integer", + "description": "The index of the first result to return", + "format": "uint32", + "location": "query" + } + }, + "parameterOrder": [ + "q" + ], + "response": { + "$ref": "Search" + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/customsearch/v1/customsearch-gen.go b/third_party/src/code.google.com/p/google-api-go-client/customsearch/v1/customsearch-gen.go new file mode 100644 index 0000000000000..eb62d25c235bf --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/customsearch/v1/customsearch-gen.go @@ -0,0 +1,999 @@ +// Package customsearch provides access to the CustomSearch API. +// +// See https://developers.google.com/custom-search/v1/using_rest +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/customsearch/v1" +// ... +// customsearchService, err := customsearch.New(oauthHttpClient) +package customsearch + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "customsearch:v1" +const apiName = "customsearch" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/customsearch/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Cse = NewCseService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Cse *CseService +} + +func NewCseService(s *Service) *CseService { + rs := &CseService{s: s} + return rs +} + +type CseService struct { + s *Service +} + +type Context struct { + Facets [][]*ContextFacetsItem `json:"facets,omitempty"` + + Title string `json:"title,omitempty"` +} + +type ContextFacetsItem struct { + Anchor string `json:"anchor,omitempty"` + + Label string `json:"label,omitempty"` + + Label_with_op string `json:"label_with_op,omitempty"` +} + +type Promotion struct { + BodyLines []*PromotionBodyLines `json:"bodyLines,omitempty"` + + DisplayLink string `json:"displayLink,omitempty"` + + HtmlTitle string `json:"htmlTitle,omitempty"` + + Image *PromotionImage `json:"image,omitempty"` + + Link string `json:"link,omitempty"` + + Title string `json:"title,omitempty"` +} + +type PromotionBodyLines struct { + HtmlTitle string `json:"htmlTitle,omitempty"` + + Link string `json:"link,omitempty"` + + Title string `json:"title,omitempty"` + + Url string `json:"url,omitempty"` +} + +type PromotionImage struct { + Height int64 `json:"height,omitempty"` + + Source string `json:"source,omitempty"` + + Width int64 `json:"width,omitempty"` +} + +type Query struct { + Count int64 `json:"count,omitempty"` + + Cr string `json:"cr,omitempty"` + + Cref string `json:"cref,omitempty"` + + Cx string `json:"cx,omitempty"` + + DateRestrict string `json:"dateRestrict,omitempty"` + + DisableCnTwTranslation string `json:"disableCnTwTranslation,omitempty"` + + ExactTerms string `json:"exactTerms,omitempty"` + + ExcludeTerms string `json:"excludeTerms,omitempty"` + + FileType string `json:"fileType,omitempty"` + + Filter string `json:"filter,omitempty"` + + Gl string `json:"gl,omitempty"` + + GoogleHost string `json:"googleHost,omitempty"` + + HighRange string `json:"highRange,omitempty"` + + Hl string `json:"hl,omitempty"` + + Hq string `json:"hq,omitempty"` + + ImgColorType string `json:"imgColorType,omitempty"` + + ImgDominantColor string `json:"imgDominantColor,omitempty"` + + ImgSize string `json:"imgSize,omitempty"` + + ImgType string `json:"imgType,omitempty"` + + InputEncoding string `json:"inputEncoding,omitempty"` + + Language string `json:"language,omitempty"` + + LinkSite string `json:"linkSite,omitempty"` + + LowRange string `json:"lowRange,omitempty"` + + OrTerms string `json:"orTerms,omitempty"` + + OutputEncoding string `json:"outputEncoding,omitempty"` + + RelatedSite string `json:"relatedSite,omitempty"` + + Rights string `json:"rights,omitempty"` + + Safe string `json:"safe,omitempty"` + + SearchTerms string `json:"searchTerms,omitempty"` + + SearchType string `json:"searchType,omitempty"` + + SiteSearch string `json:"siteSearch,omitempty"` + + SiteSearchFilter string `json:"siteSearchFilter,omitempty"` + + Sort string `json:"sort,omitempty"` + + StartIndex int64 `json:"startIndex,omitempty"` + + StartPage int64 `json:"startPage,omitempty"` + + Title string `json:"title,omitempty"` + + TotalResults int64 `json:"totalResults,omitempty,string"` +} + +type Result struct { + CacheId string `json:"cacheId,omitempty"` + + DisplayLink string `json:"displayLink,omitempty"` + + FileFormat string `json:"fileFormat,omitempty"` + + FormattedUrl string `json:"formattedUrl,omitempty"` + + HtmlFormattedUrl string `json:"htmlFormattedUrl,omitempty"` + + HtmlSnippet string `json:"htmlSnippet,omitempty"` + + HtmlTitle string `json:"htmlTitle,omitempty"` + + Image *ResultImage `json:"image,omitempty"` + + Kind string `json:"kind,omitempty"` + + Labels []*ResultLabels `json:"labels,omitempty"` + + Link string `json:"link,omitempty"` + + Mime string `json:"mime,omitempty"` + + Pagemap *ResultPagemap `json:"pagemap,omitempty"` + + Snippet string `json:"snippet,omitempty"` + + Title string `json:"title,omitempty"` +} + +type ResultImage struct { + ByteSize int64 `json:"byteSize,omitempty"` + + ContextLink string `json:"contextLink,omitempty"` + + Height int64 `json:"height,omitempty"` + + ThumbnailHeight int64 `json:"thumbnailHeight,omitempty"` + + ThumbnailLink string `json:"thumbnailLink,omitempty"` + + ThumbnailWidth int64 `json:"thumbnailWidth,omitempty"` + + Width int64 `json:"width,omitempty"` +} + +type ResultLabels struct { + DisplayName string `json:"displayName,omitempty"` + + Label_with_op string `json:"label_with_op,omitempty"` + + Name string `json:"name,omitempty"` +} + +type ResultPagemap struct { +} + +type Search struct { + Context *Context `json:"context,omitempty"` + + Items []*Result `json:"items,omitempty"` + + Kind string `json:"kind,omitempty"` + + Promotions []*Promotion `json:"promotions,omitempty"` + + Queries *SearchQueries `json:"queries,omitempty"` + + SearchInformation *SearchSearchInformation `json:"searchInformation,omitempty"` + + Spelling *SearchSpelling `json:"spelling,omitempty"` + + Url *SearchUrl `json:"url,omitempty"` +} + +type SearchQueries struct { +} + +type SearchSearchInformation struct { + FormattedSearchTime string `json:"formattedSearchTime,omitempty"` + + FormattedTotalResults string `json:"formattedTotalResults,omitempty"` + + SearchTime float64 `json:"searchTime,omitempty"` + + TotalResults int64 `json:"totalResults,omitempty,string"` +} + +type SearchSpelling struct { + CorrectedQuery string `json:"correctedQuery,omitempty"` + + HtmlCorrectedQuery string `json:"htmlCorrectedQuery,omitempty"` +} + +type SearchUrl struct { + Template string `json:"template,omitempty"` + + Type string `json:"type,omitempty"` +} + +// method id "search.cse.list": + +type CseListCall struct { + s *Service + q string + opt_ map[string]interface{} +} + +// List: Returns metadata about the search performed, metadata about the +// custom search engine used for the search, and the search results. +func (r *CseService) List(q string) *CseListCall { + c := &CseListCall{s: r.s, opt_: make(map[string]interface{})} + c.q = q + return c +} + +// C2coff sets the optional parameter "c2coff": Turns off the +// translation between zh-CN and zh-TW. +func (c *CseListCall) C2coff(c2coff string) *CseListCall { + c.opt_["c2coff"] = c2coff + return c +} + +// Cr sets the optional parameter "cr": Country restrict(s). +func (c *CseListCall) Cr(cr string) *CseListCall { + c.opt_["cr"] = cr + return c +} + +// Cref sets the optional parameter "cref": The URL of a linked custom +// search engine +func (c *CseListCall) Cref(cref string) *CseListCall { + c.opt_["cref"] = cref + return c +} + +// Cx sets the optional parameter "cx": The custom search engine ID to +// scope this search query +func (c *CseListCall) Cx(cx string) *CseListCall { + c.opt_["cx"] = cx + return c +} + +// DateRestrict sets the optional parameter "dateRestrict": Specifies +// all search results are from a time period +func (c *CseListCall) DateRestrict(dateRestrict string) *CseListCall { + c.opt_["dateRestrict"] = dateRestrict + return c +} + +// ExactTerms sets the optional parameter "exactTerms": Identifies a +// phrase that all documents in the search results must contain +func (c *CseListCall) ExactTerms(exactTerms string) *CseListCall { + c.opt_["exactTerms"] = exactTerms + return c +} + +// ExcludeTerms sets the optional parameter "excludeTerms": Identifies a +// word or phrase that should not appear in any documents in the search +// results +func (c *CseListCall) ExcludeTerms(excludeTerms string) *CseListCall { + c.opt_["excludeTerms"] = excludeTerms + return c +} + +// FileType sets the optional parameter "fileType": Returns images of a +// specified type. Some of the allowed values are: bmp, gif, png, jpg, +// svg, pdf, ... +func (c *CseListCall) FileType(fileType string) *CseListCall { + c.opt_["fileType"] = fileType + return c +} + +// Filter sets the optional parameter "filter": Controls turning on or +// off the duplicate content filter. +func (c *CseListCall) Filter(filter string) *CseListCall { + c.opt_["filter"] = filter + return c +} + +// Gl sets the optional parameter "gl": Geolocation of end user. +func (c *CseListCall) Gl(gl string) *CseListCall { + c.opt_["gl"] = gl + return c +} + +// Googlehost sets the optional parameter "googlehost": The local Google +// domain to use to perform the search. +func (c *CseListCall) Googlehost(googlehost string) *CseListCall { + c.opt_["googlehost"] = googlehost + return c +} + +// HighRange sets the optional parameter "highRange": Creates a range in +// form as_nlo value..as_nhi value and attempts to append it to query +func (c *CseListCall) HighRange(highRange string) *CseListCall { + c.opt_["highRange"] = highRange + return c +} + +// Hl sets the optional parameter "hl": Sets the user interface +// language. +func (c *CseListCall) Hl(hl string) *CseListCall { + c.opt_["hl"] = hl + return c +} + +// Hq sets the optional parameter "hq": Appends the extra query terms to +// the query. +func (c *CseListCall) Hq(hq string) *CseListCall { + c.opt_["hq"] = hq + return c +} + +// ImgColorType sets the optional parameter "imgColorType": Returns +// black and white, grayscale, or color images: mono, gray, and color. +func (c *CseListCall) ImgColorType(imgColorType string) *CseListCall { + c.opt_["imgColorType"] = imgColorType + return c +} + +// ImgDominantColor sets the optional parameter "imgDominantColor": +// Returns images of a specific dominant color: yellow, green, teal, +// blue, purple, pink, white, gray, black and brown. +func (c *CseListCall) ImgDominantColor(imgDominantColor string) *CseListCall { + c.opt_["imgDominantColor"] = imgDominantColor + return c +} + +// ImgSize sets the optional parameter "imgSize": Returns images of a +// specified size, where size can be one of: icon, small, medium, large, +// xlarge, xxlarge, and huge. +func (c *CseListCall) ImgSize(imgSize string) *CseListCall { + c.opt_["imgSize"] = imgSize + return c +} + +// ImgType sets the optional parameter "imgType": Returns images of a +// type, which can be one of: clipart, face, lineart, news, and photo. +func (c *CseListCall) ImgType(imgType string) *CseListCall { + c.opt_["imgType"] = imgType + return c +} + +// LinkSite sets the optional parameter "linkSite": Specifies that all +// search results should contain a link to a particular URL +func (c *CseListCall) LinkSite(linkSite string) *CseListCall { + c.opt_["linkSite"] = linkSite + return c +} + +// LowRange sets the optional parameter "lowRange": Creates a range in +// form as_nlo value..as_nhi value and attempts to append it to query +func (c *CseListCall) LowRange(lowRange string) *CseListCall { + c.opt_["lowRange"] = lowRange + return c +} + +// Lr sets the optional parameter "lr": The language restriction for the +// search results +func (c *CseListCall) Lr(lr string) *CseListCall { + c.opt_["lr"] = lr + return c +} + +// Num sets the optional parameter "num": Number of search results to +// return +func (c *CseListCall) Num(num int64) *CseListCall { + c.opt_["num"] = num + return c +} + +// OrTerms sets the optional parameter "orTerms": Provides additional +// search terms to check for in a document, where each document in the +// search results must contain at least one of the additional search +// terms +func (c *CseListCall) OrTerms(orTerms string) *CseListCall { + c.opt_["orTerms"] = orTerms + return c +} + +// RelatedSite sets the optional parameter "relatedSite": Specifies that +// all search results should be pages that are related to the specified +// URL +func (c *CseListCall) RelatedSite(relatedSite string) *CseListCall { + c.opt_["relatedSite"] = relatedSite + return c +} + +// Rights sets the optional parameter "rights": Filters based on +// licensing. Supported values include: cc_publicdomain, cc_attribute, +// cc_sharealike, cc_noncommercial, cc_nonderived and combinations of +// these. +func (c *CseListCall) Rights(rights string) *CseListCall { + c.opt_["rights"] = rights + return c +} + +// Safe sets the optional parameter "safe": Search safety level +func (c *CseListCall) Safe(safe string) *CseListCall { + c.opt_["safe"] = safe + return c +} + +// SearchType sets the optional parameter "searchType": Specifies the +// search type: image. +func (c *CseListCall) SearchType(searchType string) *CseListCall { + c.opt_["searchType"] = searchType + return c +} + +// SiteSearch sets the optional parameter "siteSearch": Specifies all +// search results should be pages from a given site +func (c *CseListCall) SiteSearch(siteSearch string) *CseListCall { + c.opt_["siteSearch"] = siteSearch + return c +} + +// SiteSearchFilter sets the optional parameter "siteSearchFilter": +// Controls whether to include or exclude results from the site named in +// the as_sitesearch parameter +func (c *CseListCall) SiteSearchFilter(siteSearchFilter string) *CseListCall { + c.opt_["siteSearchFilter"] = siteSearchFilter + return c +} + +// Sort sets the optional parameter "sort": The sort expression to apply +// to the results +func (c *CseListCall) Sort(sort string) *CseListCall { + c.opt_["sort"] = sort + return c +} + +// Start sets the optional parameter "start": The index of the first +// result to return +func (c *CseListCall) Start(start int64) *CseListCall { + c.opt_["start"] = start + return c +} + +func (c *CseListCall) Do() (*Search, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("q", fmt.Sprintf("%v", c.q)) + if v, ok := c.opt_["c2coff"]; ok { + params.Set("c2coff", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["cr"]; ok { + params.Set("cr", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["cref"]; ok { + params.Set("cref", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["cx"]; ok { + params.Set("cx", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dateRestrict"]; ok { + params.Set("dateRestrict", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["exactTerms"]; ok { + params.Set("exactTerms", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["excludeTerms"]; ok { + params.Set("excludeTerms", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fileType"]; ok { + params.Set("fileType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["gl"]; ok { + params.Set("gl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["googlehost"]; ok { + params.Set("googlehost", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["highRange"]; ok { + params.Set("highRange", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["hl"]; ok { + params.Set("hl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["hq"]; ok { + params.Set("hq", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["imgColorType"]; ok { + params.Set("imgColorType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["imgDominantColor"]; ok { + params.Set("imgDominantColor", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["imgSize"]; ok { + params.Set("imgSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["imgType"]; ok { + params.Set("imgType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["linkSite"]; ok { + params.Set("linkSite", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["lowRange"]; ok { + params.Set("lowRange", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["lr"]; ok { + params.Set("lr", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["num"]; ok { + params.Set("num", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orTerms"]; ok { + params.Set("orTerms", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["relatedSite"]; ok { + params.Set("relatedSite", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["rights"]; ok { + params.Set("rights", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["safe"]; ok { + params.Set("safe", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchType"]; ok { + params.Set("searchType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["siteSearch"]; ok { + params.Set("siteSearch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["siteSearchFilter"]; ok { + params.Set("siteSearchFilter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start"]; ok { + params.Set("start", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Search) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results.", + // "httpMethod": "GET", + // "id": "search.cse.list", + // "parameterOrder": [ + // "q" + // ], + // "parameters": { + // "c2coff": { + // "description": "Turns off the translation between zh-CN and zh-TW.", + // "location": "query", + // "type": "string" + // }, + // "cr": { + // "description": "Country restrict(s).", + // "location": "query", + // "type": "string" + // }, + // "cref": { + // "description": "The URL of a linked custom search engine", + // "location": "query", + // "type": "string" + // }, + // "cx": { + // "description": "The custom search engine ID to scope this search query", + // "location": "query", + // "type": "string" + // }, + // "dateRestrict": { + // "description": "Specifies all search results are from a time period", + // "location": "query", + // "type": "string" + // }, + // "exactTerms": { + // "description": "Identifies a phrase that all documents in the search results must contain", + // "location": "query", + // "type": "string" + // }, + // "excludeTerms": { + // "description": "Identifies a word or phrase that should not appear in any documents in the search results", + // "location": "query", + // "type": "string" + // }, + // "fileType": { + // "description": "Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ...", + // "location": "query", + // "type": "string" + // }, + // "filter": { + // "description": "Controls turning on or off the duplicate content filter.", + // "enum": [ + // "0", + // "1" + // ], + // "enumDescriptions": [ + // "Turns off duplicate content filter.", + // "Turns on duplicate content filter." + // ], + // "location": "query", + // "type": "string" + // }, + // "gl": { + // "description": "Geolocation of end user.", + // "location": "query", + // "type": "string" + // }, + // "googlehost": { + // "description": "The local Google domain to use to perform the search.", + // "location": "query", + // "type": "string" + // }, + // "highRange": { + // "description": "Creates a range in form as_nlo value..as_nhi value and attempts to append it to query", + // "location": "query", + // "type": "string" + // }, + // "hl": { + // "description": "Sets the user interface language.", + // "location": "query", + // "type": "string" + // }, + // "hq": { + // "description": "Appends the extra query terms to the query.", + // "location": "query", + // "type": "string" + // }, + // "imgColorType": { + // "description": "Returns black and white, grayscale, or color images: mono, gray, and color.", + // "enum": [ + // "color", + // "gray", + // "mono" + // ], + // "enumDescriptions": [ + // "color", + // "gray", + // "mono" + // ], + // "location": "query", + // "type": "string" + // }, + // "imgDominantColor": { + // "description": "Returns images of a specific dominant color: yellow, green, teal, blue, purple, pink, white, gray, black and brown.", + // "enum": [ + // "black", + // "blue", + // "brown", + // "gray", + // "green", + // "pink", + // "purple", + // "teal", + // "white", + // "yellow" + // ], + // "enumDescriptions": [ + // "black", + // "blue", + // "brown", + // "gray", + // "green", + // "pink", + // "purple", + // "teal", + // "white", + // "yellow" + // ], + // "location": "query", + // "type": "string" + // }, + // "imgSize": { + // "description": "Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge.", + // "enum": [ + // "huge", + // "icon", + // "large", + // "medium", + // "small", + // "xlarge", + // "xxlarge" + // ], + // "enumDescriptions": [ + // "huge", + // "icon", + // "large", + // "medium", + // "small", + // "xlarge", + // "xxlarge" + // ], + // "location": "query", + // "type": "string" + // }, + // "imgType": { + // "description": "Returns images of a type, which can be one of: clipart, face, lineart, news, and photo.", + // "enum": [ + // "clipart", + // "face", + // "lineart", + // "news", + // "photo" + // ], + // "enumDescriptions": [ + // "clipart", + // "face", + // "lineart", + // "news", + // "photo" + // ], + // "location": "query", + // "type": "string" + // }, + // "linkSite": { + // "description": "Specifies that all search results should contain a link to a particular URL", + // "location": "query", + // "type": "string" + // }, + // "lowRange": { + // "description": "Creates a range in form as_nlo value..as_nhi value and attempts to append it to query", + // "location": "query", + // "type": "string" + // }, + // "lr": { + // "description": "The language restriction for the search results", + // "enum": [ + // "lang_ar", + // "lang_bg", + // "lang_ca", + // "lang_cs", + // "lang_da", + // "lang_de", + // "lang_el", + // "lang_en", + // "lang_es", + // "lang_et", + // "lang_fi", + // "lang_fr", + // "lang_hr", + // "lang_hu", + // "lang_id", + // "lang_is", + // "lang_it", + // "lang_iw", + // "lang_ja", + // "lang_ko", + // "lang_lt", + // "lang_lv", + // "lang_nl", + // "lang_no", + // "lang_pl", + // "lang_pt", + // "lang_ro", + // "lang_ru", + // "lang_sk", + // "lang_sl", + // "lang_sr", + // "lang_sv", + // "lang_tr", + // "lang_zh-CN", + // "lang_zh-TW" + // ], + // "enumDescriptions": [ + // "Arabic", + // "Bulgarian", + // "Catalan", + // "Czech", + // "Danish", + // "German", + // "Greek", + // "English", + // "Spanish", + // "Estonian", + // "Finnish", + // "French", + // "Croatian", + // "Hungarian", + // "Indonesian", + // "Icelandic", + // "Italian", + // "Hebrew", + // "Japanese", + // "Korean", + // "Lithuanian", + // "Latvian", + // "Dutch", + // "Norwegian", + // "Polish", + // "Portuguese", + // "Romanian", + // "Russian", + // "Slovak", + // "Slovenian", + // "Serbian", + // "Swedish", + // "Turkish", + // "Chinese (Simplified)", + // "Chinese (Traditional)" + // ], + // "location": "query", + // "type": "string" + // }, + // "num": { + // "default": "10", + // "description": "Number of search results to return", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "orTerms": { + // "description": "Provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional search terms", + // "location": "query", + // "type": "string" + // }, + // "q": { + // "description": "Query", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "relatedSite": { + // "description": "Specifies that all search results should be pages that are related to the specified URL", + // "location": "query", + // "type": "string" + // }, + // "rights": { + // "description": "Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these.", + // "location": "query", + // "type": "string" + // }, + // "safe": { + // "default": "off", + // "description": "Search safety level", + // "enum": [ + // "high", + // "medium", + // "off" + // ], + // "enumDescriptions": [ + // "Enables highest level of safe search filtering.", + // "Enables moderate safe search filtering.", + // "Disables safe search filtering." + // ], + // "location": "query", + // "type": "string" + // }, + // "searchType": { + // "description": "Specifies the search type: image.", + // "enum": [ + // "image" + // ], + // "enumDescriptions": [ + // "custom image search" + // ], + // "location": "query", + // "type": "string" + // }, + // "siteSearch": { + // "description": "Specifies all search results should be pages from a given site", + // "location": "query", + // "type": "string" + // }, + // "siteSearchFilter": { + // "description": "Controls whether to include or exclude results from the site named in the as_sitesearch parameter", + // "enum": [ + // "e", + // "i" + // ], + // "enumDescriptions": [ + // "exclude", + // "include" + // ], + // "location": "query", + // "type": "string" + // }, + // "sort": { + // "description": "The sort expression to apply to the results", + // "location": "query", + // "type": "string" + // }, + // "start": { + // "description": "The index of the first result to return", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // } + // }, + // "path": "v1", + // "response": { + // "$ref": "Search" + // } + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/datastore/v1beta1/datastore-api.json b/third_party/src/code.google.com/p/google-api-go-client/datastore/v1beta1/datastore-api.json new file mode 100644 index 0000000000000..4f7c64db390bd --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/datastore/v1beta1/datastore-api.json @@ -0,0 +1,991 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/YrLZoq09n__afr7YsPCxL5HrUUs\"", + "discoveryVersion": "v1", + "id": "datastore:v1beta1", + "name": "datastore", + "version": "v1beta1", + "title": "Google Cloud Datastore API", + "description": "API for accessing Google Cloud Datastore.", + "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/datastore/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/datastore/v1beta1/datasets/", + "basePath": "/datastore/v1beta1/datasets/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "datastore/v1beta1/datasets/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "proto", + "enum": [ + "json", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Responses with Content-Type of application/x-protobuf" + ], + "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/datastore": { + "description": "View and manage your Google Cloud Datastore data" + }, + "https://www.googleapis.com/auth/userinfo.email": { + "description": "View your email address" + } + } + } + }, + "schemas": { + "AllocateIdsRequest": { + "id": "AllocateIdsRequest", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.AllocateIdsRequest", + "properties": { + "keys": { + "type": "array", + "description": "A list of keys with incomplete key paths to allocate IDs for. No key may be reserved/read-only.", + "items": { + "$ref": "Key" + } + } + } + }, + "AllocateIdsResponse": { + "id": "AllocateIdsResponse", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.AllocateIdsResponse", + "properties": { + "header": { + "$ref": "ResponseHeader" + }, + "keys": { + "type": "array", + "description": "The keys specified in the request (in the same order), each with its key path completed with a newly allocated ID.", + "items": { + "$ref": "Key" + } + } + } + }, + "BeginTransactionRequest": { + "id": "BeginTransactionRequest", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.BeginTransactionRequest", + "properties": { + "isolationLevel": { + "type": "string", + "description": "The transaction isolation level. Either snapshot or serializable. The default isolation level is snapshot isolation, which means that another transaction may not concurrently modify the data that is modified by this transaction. Optionally, a transaction can request to be made serializable which means that another transaction cannot concurrently modify the data that is read or modified by this transaction." + } + } + }, + "BeginTransactionResponse": { + "id": "BeginTransactionResponse", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.BeginTransactionResponse", + "properties": { + "header": { + "$ref": "ResponseHeader" + }, + "transaction": { + "type": "string", + "description": "The transaction identifier (always present).", + "format": "byte" + } + } + }, + "BlindWriteRequest": { + "id": "BlindWriteRequest", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.BlindWriteRequest", + "properties": { + "mutation": { + "$ref": "Mutation", + "description": "The mutation to perform." + } + } + }, + "BlindWriteResponse": { + "id": "BlindWriteResponse", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.BlindWriteResponse", + "properties": { + "header": { + "$ref": "ResponseHeader" + }, + "mutationResult": { + "$ref": "MutationResult", + "description": "The result of performing the mutation (always present)." + } + } + }, + "CommitRequest": { + "id": "CommitRequest", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.CommitRequest", + "properties": { + "mutation": { + "$ref": "Mutation", + "description": "The mutation to perform. Optional." + }, + "transaction": { + "type": "string", + "description": "The transaction identifier, returned by a call to beginTransaction. Must be set when mode is TRANSACTIONAL.", + "format": "byte" + } + } + }, + "CommitResponse": { + "id": "CommitResponse", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.CommitResponse", + "properties": { + "header": { + "$ref": "ResponseHeader" + }, + "mutationResult": { + "$ref": "MutationResult", + "description": "The result of performing the mutation (if any)." + } + } + }, + "CompositeFilter": { + "id": "CompositeFilter", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.CompositeFilter", + "properties": { + "filters": { + "type": "array", + "description": "The list of filters to combine. Must contain at least one filter.", + "items": { + "$ref": "Filter" + } + }, + "operator": { + "type": "string", + "description": "The operator for combining multiple filters. Only \"and\" is currently supported." + } + } + }, + "Entity": { + "id": "Entity", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.Entity", + "properties": { + "key": { + "$ref": "Key", + "description": "The entity's key.\n\nAn entity must have a key, unless otherwise documented (for example, an entity in Value.entityValue may have no key). An entity's kind is its key's path's last element's kind, or null if it has no key." + }, + "properties": { + "type": "object", + "description": "The entity's properties.", + "additionalProperties": { + "$ref": "Property", + "description": "The name of the property. Properties with names matching regex \"__.*__\" are reserved. A reserved property name is forbidden in certain documented contexts. The name cannot be \"\"." + } + } + } + }, + "EntityResult": { + "id": "EntityResult", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.EntityResult", + "properties": { + "entity": { + "$ref": "Entity", + "description": "The resulting entity." + } + } + }, + "Filter": { + "id": "Filter", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.Filter", + "properties": { + "compositeFilter": { + "$ref": "CompositeFilter", + "description": "A composite filter." + }, + "propertyFilter": { + "$ref": "PropertyFilter", + "description": "A filter on a property." + } + } + }, + "GqlQuery": { + "id": "GqlQuery", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.GqlQuery", + "properties": { + "allowLiteral": { + "type": "boolean", + "description": "When false, the query string must not contain a literal." + }, + "nameArgs": { + "type": "array", + "description": "A named argument must set field GqlQueryArg.name. No two named arguments may have the same name. For each non-reserved named binding site in the query string, there must be a named argument with that name, but not necessarily the inverse.", + "items": { + "$ref": "GqlQueryArg" + } + }, + "numberArgs": { + "type": "array", + "description": "Numbered binding site @1 references the first numbered argument, effectively using 1-based indexing, rather than the usual 0. A numbered argument must NOT set field GqlQueryArg.name. For each binding site numbered i in query_string, there must be an ith numbered argument. The inverse must also be true.", + "items": { + "$ref": "GqlQueryArg" + } + }, + "queryString": { + "type": "string" + } + } + }, + "GqlQueryArg": { + "id": "GqlQueryArg", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.GqlQueryArg", + "properties": { + "cursor": { + "type": "string", + "format": "byte" + }, + "name": { + "type": "string", + "description": "Must match regex \"[A-Za-z_$][A-Za-z_$0-9]*\". Must not match regex \"__.*__\". Must not be \"\"." + }, + "value": { + "$ref": "Value" + } + } + }, + "Key": { + "id": "Key", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.Key", + "properties": { + "partitionId": { + "$ref": "PartitionId", + "description": "Entities are partitioned into subsets, currently identified by a dataset (usually implicitly specified by the project) and namespace ID. Queries are scoped to a single partition." + }, + "path": { + "type": "array", + "description": "The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: ALL of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. A path can never be empty.", + "items": { + "$ref": "KeyPathElement" + } + } + } + }, + "KeyPathElement": { + "id": "KeyPathElement", + "type": "object", + "description": "A (kind, ID/name) pair used to construct a key path.\n\nAt most one of name or ID may be set. If either is set, the element is complete. If neither is set, the element is incomplete.", + "externalTypeName": "apphosting.client.datastoreservice.proto.Key.PathElement", + "properties": { + "id": { + "type": "string", + "description": "The ID of the entity. Always \u003e 0.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "The kind of the entity. Kinds matching regex \"__.*__\" are reserved/read-only. Cannot be \"\"." + }, + "name": { + "type": "string", + "description": "The name of the entity. Names matching regex \"__.*__\" are reserved/read-only. Cannot be \"\"." + } + } + }, + "KindExpression": { + "id": "KindExpression", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.KindExpression", + "properties": { + "name": { + "type": "string", + "description": "The name of the kind." + } + } + }, + "LookupRequest": { + "id": "LookupRequest", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.LookupRequest", + "properties": { + "keys": { + "type": "array", + "description": "Keys of entities to look up from the datastore.", + "items": { + "$ref": "Key" + } + }, + "readOptions": { + "$ref": "ReadOptions", + "description": "Options for this lookup request. Optional." + } + } + }, + "LookupResponse": { + "id": "LookupResponse", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.LookupResponse", + "properties": { + "deferred": { + "type": "array", + "description": "A list of keys that were not looked up due to resource constraints.", + "items": { + "$ref": "Key" + } + }, + "found": { + "type": "array", + "description": "Entities found.", + "items": { + "$ref": "EntityResult" + } + }, + "header": { + "$ref": "ResponseHeader" + }, + "missing": { + "type": "array", + "description": "Entities not found, with only the key populated.", + "items": { + "$ref": "EntityResult" + } + } + } + }, + "Mutation": { + "id": "Mutation", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.Mutation", + "properties": { + "delete": { + "type": "array", + "description": "Keys of entities to delete. Each key must have a complete key path and must not be reserved/read-only.", + "items": { + "$ref": "Key" + } + }, + "force": { + "type": "boolean", + "description": "Ignore a user specified read-only period. Optional." + }, + "insert": { + "type": "array", + "description": "Entities to insert. Each inserted entity's key must have a complete path and must not be reserved/read-only.", + "items": { + "$ref": "Entity" + } + }, + "insertAutoId": { + "type": "array", + "description": "Insert entities with a newly allocated ID. Each inserted entity's key must omit the final identifier in its path and must not be reserved/read-only.", + "items": { + "$ref": "Entity" + } + }, + "update": { + "type": "array", + "description": "Entities to update. Each updated entity's key must have a complete path and must not be reserved/read-only.", + "items": { + "$ref": "Entity" + } + }, + "upsert": { + "type": "array", + "description": "Entities to upsert. Each upserted entity's key must have a complete path and must not be reserved/read-only.", + "items": { + "$ref": "Entity" + } + } + } + }, + "MutationResult": { + "id": "MutationResult", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.MutationResult", + "properties": { + "indexUpdates": { + "type": "integer", + "description": "Number of index writes.", + "format": "int32" + }, + "insertAutoIdKeys": { + "type": "array", + "description": "Keys for insertAutoId entities. One per entity from the request, in the same order.", + "items": { + "$ref": "Key" + } + } + } + }, + "PartitionId": { + "id": "PartitionId", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.PartitionId", + "properties": { + "datasetId": { + "type": "string", + "description": "The dataset ID." + }, + "namespace": { + "type": "string", + "description": "The namespace." + } + } + }, + "Property": { + "id": "Property", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.Property", + "properties": { + "multi": { + "type": "boolean", + "description": "If this property contains a list of values. Input values may explicitly set multi to false, but otherwise false is always represented by omitting multi." + }, + "values": { + "type": "array", + "description": "The value(s) of the property. When multi is false there is always exactly one value. When multi is true there are always one or more values. Each value can have only one value property populated. For example, you cannot have a values list of { values: [ { integerValue: 22, stringValue: \"a\" } ] }, but you can have { multi: true, values: [ { integerValue: 22 }, { stringValue: \"a\" } ] }.", + "items": { + "$ref": "Value" + } + } + } + }, + "PropertyExpression": { + "id": "PropertyExpression", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.PropertyExpression", + "properties": { + "aggregationFunction": { + "type": "string", + "description": "The aggregation function to apply to the property. Optional. Can only be used when grouping by at least one property. Must then be set on all properties in the projection that are not being grouped by. Aggregation functions: first selects the first result as determined by the query's order." + }, + "property": { + "$ref": "PropertyReference", + "description": "The property to project." + } + } + }, + "PropertyFilter": { + "id": "PropertyFilter", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.PropertyFilter", + "properties": { + "operator": { + "type": "string", + "description": "The operator to filter by. One of lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual, equal, or hasAncestor." + }, + "property": { + "$ref": "PropertyReference", + "description": "The property to filter by." + }, + "value": { + "$ref": "Value", + "description": "The value to compare the property to." + } + } + }, + "PropertyOrder": { + "id": "PropertyOrder", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.PropertyOrder", + "properties": { + "direction": { + "type": "string", + "description": "The direction to order by. One of ascending or descending. Optional, defaults to ascending." + }, + "property": { + "$ref": "PropertyReference", + "description": "The property to order by." + } + } + }, + "PropertyReference": { + "id": "PropertyReference", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.PropertyReference", + "properties": { + "name": { + "type": "string", + "description": "The name of the property." + } + } + }, + "Query": { + "id": "Query", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.Query", + "properties": { + "endCursor": { + "type": "string", + "description": "An ending point for the query results. Optional. Query cursors are returned in query result batches.", + "format": "byte" + }, + "filter": { + "$ref": "Filter", + "description": "The filter to apply (optional)." + }, + "groupBy": { + "type": "array", + "description": "The properties to group by (if empty, no grouping is applied to the result set).", + "items": { + "$ref": "PropertyReference" + } + }, + "kinds": { + "type": "array", + "description": "The kinds to query (if empty, returns entities from all kinds).", + "items": { + "$ref": "KindExpression" + } + }, + "limit": { + "type": "integer", + "description": "The maximum number of results to return. Applies after all other constraints. Optional.", + "format": "int32" + }, + "offset": { + "type": "integer", + "description": "The number of results to skip. Applies before limit, but after all other constraints (optional, defaults to 0).", + "format": "int32" + }, + "order": { + "type": "array", + "description": "The order to apply to the query results (if empty, order is unspecified).", + "items": { + "$ref": "PropertyOrder" + } + }, + "projection": { + "type": "array", + "description": "The projection to return. If not set the entire entity is returned.", + "items": { + "$ref": "PropertyExpression" + } + }, + "startCursor": { + "type": "string", + "description": "A starting point for the query results. Optional. Query cursors are returned in query result batches.", + "format": "byte" + } + } + }, + "QueryResultBatch": { + "id": "QueryResultBatch", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.QueryResultBatch", + "properties": { + "endCursor": { + "type": "string", + "description": "A cursor that points to the position after the last result in the batch. May be absent.", + "format": "byte" + }, + "entityResultType": { + "type": "string", + "description": "The result type for every entity in entityResults. full for full entities, projection for entities with only projected properties, keyOnly for entities with only a key." + }, + "entityResults": { + "type": "array", + "description": "The results for this batch.", + "items": { + "$ref": "EntityResult" + } + }, + "moreResults": { + "type": "string", + "description": "The state of the query after the current batch. One of notFinished, moreResultsAfterLimit, noMoreResults." + }, + "skippedResults": { + "type": "integer", + "description": "The number of results skipped because of Query.offset.", + "format": "int32" + } + } + }, + "ReadOptions": { + "id": "ReadOptions", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.ReadOptions", + "properties": { + "readConsistency": { + "type": "string", + "description": "The read consistency to use. One of default, strong, or eventual. Cannot be set when transaction is set. Lookup and ancestor queries default to strong, global queries default to eventual and cannot be set to strong. Optional. Default is default." + }, + "transaction": { + "type": "string", + "description": "The transaction to use. Optional.", + "format": "byte" + } + } + }, + "ResponseHeader": { + "id": "ResponseHeader", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.ResponseHeader", + "properties": { + "kind": { + "type": "string", + "description": "The kind, fixed to \"datastore#responseHeader\".", + "default": "datastore#responseHeader" + } + } + }, + "RollbackRequest": { + "id": "RollbackRequest", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.RollbackRequest", + "properties": { + "transaction": { + "type": "string", + "description": "The transaction identifier, returned by a call to beginTransaction.", + "format": "byte" + } + } + }, + "RollbackResponse": { + "id": "RollbackResponse", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.RollbackResponse", + "properties": { + "header": { + "$ref": "ResponseHeader" + } + } + }, + "RunQueryRequest": { + "id": "RunQueryRequest", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.RunQueryRequest", + "properties": { + "gqlQuery": { + "$ref": "GqlQuery", + "description": "The GQL query to run. Either this field or field query must be set, but not both." + }, + "partitionId": { + "$ref": "PartitionId", + "description": "Entities are partitioned into subsets, identified by a dataset (usually implicitly specified by the project) and namespace ID. Queries are scoped to a single partition." + }, + "query": { + "$ref": "Query", + "description": "The query to run. Either this field or field gql_query must be set, but not both." + }, + "readOptions": { + "$ref": "ReadOptions", + "description": "The options for this query." + } + } + }, + "RunQueryResponse": { + "id": "RunQueryResponse", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.RunQueryResponse", + "properties": { + "batch": { + "$ref": "QueryResultBatch", + "description": "A batch of query results (always present)." + }, + "header": { + "$ref": "ResponseHeader" + } + } + }, + "Value": { + "id": "Value", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.Value", + "properties": { + "blobKeyValue": { + "type": "string", + "description": "A blob key value." + }, + "blobValue": { + "type": "string", + "description": "A blob value.", + "format": "byte" + }, + "booleanValue": { + "type": "boolean", + "description": "A boolean value." + }, + "dateTimeValue": { + "type": "string", + "description": "A timestamp value.", + "format": "date-time" + }, + "doubleValue": { + "type": "number", + "description": "A double value.", + "format": "double" + }, + "entityValue": { + "$ref": "Entity", + "description": "An entity value. May have no key. May have a key with an incomplete key path. May have a reserved/read-only key." + }, + "indexed": { + "type": "boolean", + "description": "If the value should be indexed.\n\nThe indexed property may be set for a null value. When indexed is true, stringValue is limited to 500 characters and the blob value is limited to 500 bytes. Input values by default have indexed set to true; however, you can explicitly set indexed to true if you want. (An output value never has indexed explicitly set to true.) If a value is itself an entity, it cannot have indexed set to true." + }, + "integerValue": { + "type": "string", + "description": "An integer value.", + "format": "int64" + }, + "keyValue": { + "$ref": "Key", + "description": "A key value." + }, + "meaning": { + "type": "integer", + "description": "The meaning field is reserved and should not be used.", + "format": "int32" + }, + "stringValue": { + "type": "string", + "description": "A UTF-8 encoded string value." + } + } + } + }, + "resources": { + "datasets": { + "methods": { + "allocateIds": { + "id": "datastore.datasets.allocateIds", + "path": "{datasetId}/allocateIds", + "httpMethod": "POST", + "description": "Allocate IDs for incomplete keys (useful for referencing an entity before it is inserted).", + "parameters": { + "datasetId": { + "type": "string", + "description": "Identifies the dataset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "AllocateIdsRequest" + }, + "response": { + "$ref": "AllocateIdsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/datastore", + "https://www.googleapis.com/auth/userinfo.email" + ] + }, + "beginTransaction": { + "id": "datastore.datasets.beginTransaction", + "path": "{datasetId}/beginTransaction", + "httpMethod": "POST", + "description": "Begin a new transaction.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Identifies the dataset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "BeginTransactionRequest" + }, + "response": { + "$ref": "BeginTransactionResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/datastore", + "https://www.googleapis.com/auth/userinfo.email" + ] + }, + "blindWrite": { + "id": "datastore.datasets.blindWrite", + "path": "{datasetId}/blindWrite", + "httpMethod": "POST", + "description": "Create, delete or modify some entities outside a transaction.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Identifies the dataset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "BlindWriteRequest" + }, + "response": { + "$ref": "BlindWriteResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/datastore", + "https://www.googleapis.com/auth/userinfo.email" + ] + }, + "commit": { + "id": "datastore.datasets.commit", + "path": "{datasetId}/commit", + "httpMethod": "POST", + "description": "Commit a transaction, optionally creating, deleting or modifying some entities.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Identifies the dataset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "CommitRequest" + }, + "response": { + "$ref": "CommitResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/datastore", + "https://www.googleapis.com/auth/userinfo.email" + ] + }, + "lookup": { + "id": "datastore.datasets.lookup", + "path": "{datasetId}/lookup", + "httpMethod": "POST", + "description": "Look up some entities by key.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Identifies the dataset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "LookupRequest" + }, + "response": { + "$ref": "LookupResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/datastore", + "https://www.googleapis.com/auth/userinfo.email" + ] + }, + "rollback": { + "id": "datastore.datasets.rollback", + "path": "{datasetId}/rollback", + "httpMethod": "POST", + "description": "Roll back a transaction.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Identifies the dataset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "RollbackRequest" + }, + "response": { + "$ref": "RollbackResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/datastore", + "https://www.googleapis.com/auth/userinfo.email" + ] + }, + "runQuery": { + "id": "datastore.datasets.runQuery", + "path": "{datasetId}/runQuery", + "httpMethod": "POST", + "description": "Query for entities.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Identifies the dataset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "RunQueryRequest" + }, + "response": { + "$ref": "RunQueryResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/datastore", + "https://www.googleapis.com/auth/userinfo.email" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/datastore/v1beta1/datastore-gen.go b/third_party/src/code.google.com/p/google-api-go-client/datastore/v1beta1/datastore-gen.go new file mode 100644 index 0000000000000..3aee8cea53c0b --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/datastore/v1beta1/datastore-gen.go @@ -0,0 +1,1051 @@ +// Package datastore provides access to the Google Cloud Datastore API. +// +// See https://developers.google.com/datastore/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/datastore/v1beta1" +// ... +// datastoreService, err := datastore.New(oauthHttpClient) +package datastore + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "datastore:v1beta1" +const apiName = "datastore" +const apiVersion = "v1beta1" +const basePath = "https://www.googleapis.com/datastore/v1beta1/datasets/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Google Cloud Datastore data + DatastoreScope = "https://www.googleapis.com/auth/datastore" + + // View your email address + UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Datasets = NewDatasetsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Datasets *DatasetsService +} + +func NewDatasetsService(s *Service) *DatasetsService { + rs := &DatasetsService{s: s} + return rs +} + +type DatasetsService struct { + s *Service +} + +type AllocateIdsRequest struct { + // Keys: A list of keys with incomplete key paths to allocate IDs for. + // No key may be reserved/read-only. + Keys []*Key `json:"keys,omitempty"` +} + +type AllocateIdsResponse struct { + Header *ResponseHeader `json:"header,omitempty"` + + // Keys: The keys specified in the request (in the same order), each + // with its key path completed with a newly allocated ID. + Keys []*Key `json:"keys,omitempty"` +} + +type BeginTransactionRequest struct { + // IsolationLevel: The transaction isolation level. Either snapshot or + // serializable. The default isolation level is snapshot isolation, + // which means that another transaction may not concurrently modify the + // data that is modified by this transaction. Optionally, a transaction + // can request to be made serializable which means that another + // transaction cannot concurrently modify the data that is read or + // modified by this transaction. + IsolationLevel string `json:"isolationLevel,omitempty"` +} + +type BeginTransactionResponse struct { + Header *ResponseHeader `json:"header,omitempty"` + + // Transaction: The transaction identifier (always present). + Transaction string `json:"transaction,omitempty"` +} + +type BlindWriteRequest struct { + // Mutation: The mutation to perform. + Mutation *Mutation `json:"mutation,omitempty"` +} + +type BlindWriteResponse struct { + Header *ResponseHeader `json:"header,omitempty"` + + // MutationResult: The result of performing the mutation (always + // present). + MutationResult *MutationResult `json:"mutationResult,omitempty"` +} + +type CommitRequest struct { + // Mutation: The mutation to perform. Optional. + Mutation *Mutation `json:"mutation,omitempty"` + + // Transaction: The transaction identifier, returned by a call to + // beginTransaction. Must be set when mode is TRANSACTIONAL. + Transaction string `json:"transaction,omitempty"` +} + +type CommitResponse struct { + Header *ResponseHeader `json:"header,omitempty"` + + // MutationResult: The result of performing the mutation (if any). + MutationResult *MutationResult `json:"mutationResult,omitempty"` +} + +type CompositeFilter struct { + // Filters: The list of filters to combine. Must contain at least one + // filter. + Filters []*Filter `json:"filters,omitempty"` + + // Operator: The operator for combining multiple filters. Only "and" is + // currently supported. + Operator string `json:"operator,omitempty"` +} + +type Entity struct { + // Key: The entity's key. + // + // An entity must have a key, unless otherwise + // documented (for example, an entity in Value.entityValue may have no + // key). An entity's kind is its key's path's last element's kind, or + // null if it has no key. + Key *Key `json:"key,omitempty"` + + // Properties: The entity's properties. + Properties *EntityProperties `json:"properties,omitempty"` +} + +type EntityProperties struct { +} + +type EntityResult struct { + // Entity: The resulting entity. + Entity *Entity `json:"entity,omitempty"` +} + +type Filter struct { + // CompositeFilter: A composite filter. + CompositeFilter *CompositeFilter `json:"compositeFilter,omitempty"` + + // PropertyFilter: A filter on a property. + PropertyFilter *PropertyFilter `json:"propertyFilter,omitempty"` +} + +type GqlQuery struct { + // AllowLiteral: When false, the query string must not contain a + // literal. + AllowLiteral bool `json:"allowLiteral,omitempty"` + + // NameArgs: A named argument must set field GqlQueryArg.name. No two + // named arguments may have the same name. For each non-reserved named + // binding site in the query string, there must be a named argument with + // that name, but not necessarily the inverse. + NameArgs []*GqlQueryArg `json:"nameArgs,omitempty"` + + // NumberArgs: Numbered binding site @1 references the first numbered + // argument, effectively using 1-based indexing, rather than the usual + // 0. A numbered argument must NOT set field GqlQueryArg.name. For each + // binding site numbered i in query_string, there must be an ith + // numbered argument. The inverse must also be true. + NumberArgs []*GqlQueryArg `json:"numberArgs,omitempty"` + + QueryString string `json:"queryString,omitempty"` +} + +type GqlQueryArg struct { + Cursor string `json:"cursor,omitempty"` + + // Name: Must match regex "[A-Za-z_$][A-Za-z_$0-9]*". Must not match + // regex "__.*__". Must not be "". + Name string `json:"name,omitempty"` + + Value *Value `json:"value,omitempty"` +} + +type Key struct { + // PartitionId: Entities are partitioned into subsets, currently + // identified by a dataset (usually implicitly specified by the project) + // and namespace ID. Queries are scoped to a single partition. + PartitionId *PartitionId `json:"partitionId,omitempty"` + + // Path: The entity path. An entity path consists of one or more + // elements composed of a kind and a string or numerical identifier, + // which identify entities. The first element identifies a root entity, + // the second element identifies a child of the root entity, the third + // element a child of the second entity, and so forth. The entities + // identified by all prefixes of the path are called the element's + // ancestors. An entity path is always fully complete: ALL of the + // entity's ancestors are required to be in the path along with the + // entity identifier itself. The only exception is that in some + // documented cases, the identifier in the last path element (for the + // entity) itself may be omitted. A path can never be empty. + Path []*KeyPathElement `json:"path,omitempty"` +} + +type KeyPathElement struct { + // Id: The ID of the entity. Always > 0. + Id int64 `json:"id,omitempty,string"` + + // Kind: The kind of the entity. Kinds matching regex "__.*__" are + // reserved/read-only. Cannot be "". + Kind string `json:"kind,omitempty"` + + // Name: The name of the entity. Names matching regex "__.*__" are + // reserved/read-only. Cannot be "". + Name string `json:"name,omitempty"` +} + +type KindExpression struct { + // Name: The name of the kind. + Name string `json:"name,omitempty"` +} + +type LookupRequest struct { + // Keys: Keys of entities to look up from the datastore. + Keys []*Key `json:"keys,omitempty"` + + // ReadOptions: Options for this lookup request. Optional. + ReadOptions *ReadOptions `json:"readOptions,omitempty"` +} + +type LookupResponse struct { + // Deferred: A list of keys that were not looked up due to resource + // constraints. + Deferred []*Key `json:"deferred,omitempty"` + + // Found: Entities found. + Found []*EntityResult `json:"found,omitempty"` + + Header *ResponseHeader `json:"header,omitempty"` + + // Missing: Entities not found, with only the key populated. + Missing []*EntityResult `json:"missing,omitempty"` +} + +type Mutation struct { + // Delete: Keys of entities to delete. Each key must have a complete key + // path and must not be reserved/read-only. + Delete []*Key `json:"delete,omitempty"` + + // Force: Ignore a user specified read-only period. Optional. + Force bool `json:"force,omitempty"` + + // Insert: Entities to insert. Each inserted entity's key must have a + // complete path and must not be reserved/read-only. + Insert []*Entity `json:"insert,omitempty"` + + // InsertAutoId: Insert entities with a newly allocated ID. Each + // inserted entity's key must omit the final identifier in its path and + // must not be reserved/read-only. + InsertAutoId []*Entity `json:"insertAutoId,omitempty"` + + // Update: Entities to update. Each updated entity's key must have a + // complete path and must not be reserved/read-only. + Update []*Entity `json:"update,omitempty"` + + // Upsert: Entities to upsert. Each upserted entity's key must have a + // complete path and must not be reserved/read-only. + Upsert []*Entity `json:"upsert,omitempty"` +} + +type MutationResult struct { + // IndexUpdates: Number of index writes. + IndexUpdates int64 `json:"indexUpdates,omitempty"` + + // InsertAutoIdKeys: Keys for insertAutoId entities. One per entity from + // the request, in the same order. + InsertAutoIdKeys []*Key `json:"insertAutoIdKeys,omitempty"` +} + +type PartitionId struct { + // DatasetId: The dataset ID. + DatasetId string `json:"datasetId,omitempty"` + + // Namespace: The namespace. + Namespace string `json:"namespace,omitempty"` +} + +type Property struct { + // Multi: If this property contains a list of values. Input values may + // explicitly set multi to false, but otherwise false is always + // represented by omitting multi. + Multi bool `json:"multi,omitempty"` + + // Values: The value(s) of the property. When multi is false there is + // always exactly one value. When multi is true there are always one or + // more values. Each value can have only one value property populated. + // For example, you cannot have a values list of { values: [ { + // integerValue: 22, stringValue: "a" } ] }, but you can have { multi: + // true, values: [ { integerValue: 22 }, { stringValue: "a" } ] }. + Values []*Value `json:"values,omitempty"` +} + +type PropertyExpression struct { + // AggregationFunction: The aggregation function to apply to the + // property. Optional. Can only be used when grouping by at least one + // property. Must then be set on all properties in the projection that + // are not being grouped by. Aggregation functions: first selects the + // first result as determined by the query's order. + AggregationFunction string `json:"aggregationFunction,omitempty"` + + // Property: The property to project. + Property *PropertyReference `json:"property,omitempty"` +} + +type PropertyFilter struct { + // Operator: The operator to filter by. One of lessThan, + // lessThanOrEqual, greaterThan, greaterThanOrEqual, equal, or + // hasAncestor. + Operator string `json:"operator,omitempty"` + + // Property: The property to filter by. + Property *PropertyReference `json:"property,omitempty"` + + // Value: The value to compare the property to. + Value *Value `json:"value,omitempty"` +} + +type PropertyOrder struct { + // Direction: The direction to order by. One of ascending or descending. + // Optional, defaults to ascending. + Direction string `json:"direction,omitempty"` + + // Property: The property to order by. + Property *PropertyReference `json:"property,omitempty"` +} + +type PropertyReference struct { + // Name: The name of the property. + Name string `json:"name,omitempty"` +} + +type Query struct { + // EndCursor: An ending point for the query results. Optional. Query + // cursors are returned in query result batches. + EndCursor string `json:"endCursor,omitempty"` + + // Filter: The filter to apply (optional). + Filter *Filter `json:"filter,omitempty"` + + // GroupBy: The properties to group by (if empty, no grouping is applied + // to the result set). + GroupBy []*PropertyReference `json:"groupBy,omitempty"` + + // Kinds: The kinds to query (if empty, returns entities from all + // kinds). + Kinds []*KindExpression `json:"kinds,omitempty"` + + // Limit: The maximum number of results to return. Applies after all + // other constraints. Optional. + Limit int64 `json:"limit,omitempty"` + + // Offset: The number of results to skip. Applies before limit, but + // after all other constraints (optional, defaults to 0). + Offset int64 `json:"offset,omitempty"` + + // Order: The order to apply to the query results (if empty, order is + // unspecified). + Order []*PropertyOrder `json:"order,omitempty"` + + // Projection: The projection to return. If not set the entire entity is + // returned. + Projection []*PropertyExpression `json:"projection,omitempty"` + + // StartCursor: A starting point for the query results. Optional. Query + // cursors are returned in query result batches. + StartCursor string `json:"startCursor,omitempty"` +} + +type QueryResultBatch struct { + // EndCursor: A cursor that points to the position after the last result + // in the batch. May be absent. + EndCursor string `json:"endCursor,omitempty"` + + // EntityResultType: The result type for every entity in entityResults. + // full for full entities, projection for entities with only projected + // properties, keyOnly for entities with only a key. + EntityResultType string `json:"entityResultType,omitempty"` + + // EntityResults: The results for this batch. + EntityResults []*EntityResult `json:"entityResults,omitempty"` + + // MoreResults: The state of the query after the current batch. One of + // notFinished, moreResultsAfterLimit, noMoreResults. + MoreResults string `json:"moreResults,omitempty"` + + // SkippedResults: The number of results skipped because of + // Query.offset. + SkippedResults int64 `json:"skippedResults,omitempty"` +} + +type ReadOptions struct { + // ReadConsistency: The read consistency to use. One of default, strong, + // or eventual. Cannot be set when transaction is set. Lookup and + // ancestor queries default to strong, global queries default to + // eventual and cannot be set to strong. Optional. Default is default. + ReadConsistency string `json:"readConsistency,omitempty"` + + // Transaction: The transaction to use. Optional. + Transaction string `json:"transaction,omitempty"` +} + +type ResponseHeader struct { + // Kind: The kind, fixed to "datastore#responseHeader". + Kind string `json:"kind,omitempty"` +} + +type RollbackRequest struct { + // Transaction: The transaction identifier, returned by a call to + // beginTransaction. + Transaction string `json:"transaction,omitempty"` +} + +type RollbackResponse struct { + Header *ResponseHeader `json:"header,omitempty"` +} + +type RunQueryRequest struct { + // GqlQuery: The GQL query to run. Either this field or field query must + // be set, but not both. + GqlQuery *GqlQuery `json:"gqlQuery,omitempty"` + + // PartitionId: Entities are partitioned into subsets, identified by a + // dataset (usually implicitly specified by the project) and namespace + // ID. Queries are scoped to a single partition. + PartitionId *PartitionId `json:"partitionId,omitempty"` + + // Query: The query to run. Either this field or field gql_query must be + // set, but not both. + Query *Query `json:"query,omitempty"` + + // ReadOptions: The options for this query. + ReadOptions *ReadOptions `json:"readOptions,omitempty"` +} + +type RunQueryResponse struct { + // Batch: A batch of query results (always present). + Batch *QueryResultBatch `json:"batch,omitempty"` + + Header *ResponseHeader `json:"header,omitempty"` +} + +type Value struct { + // BlobKeyValue: A blob key value. + BlobKeyValue string `json:"blobKeyValue,omitempty"` + + // BlobValue: A blob value. + BlobValue string `json:"blobValue,omitempty"` + + // BooleanValue: A boolean value. + BooleanValue bool `json:"booleanValue,omitempty"` + + // DateTimeValue: A timestamp value. + DateTimeValue string `json:"dateTimeValue,omitempty"` + + // DoubleValue: A double value. + DoubleValue float64 `json:"doubleValue,omitempty"` + + // EntityValue: An entity value. May have no key. May have a key with an + // incomplete key path. May have a reserved/read-only key. + EntityValue *Entity `json:"entityValue,omitempty"` + + // Indexed: If the value should be indexed. + // + // The indexed property may be + // set for a null value. When indexed is true, stringValue is limited to + // 500 characters and the blob value is limited to 500 bytes. Input + // values by default have indexed set to true; however, you can + // explicitly set indexed to true if you want. (An output value never + // has indexed explicitly set to true.) If a value is itself an entity, + // it cannot have indexed set to true. + Indexed bool `json:"indexed,omitempty"` + + // IntegerValue: An integer value. + IntegerValue int64 `json:"integerValue,omitempty,string"` + + // KeyValue: A key value. + KeyValue *Key `json:"keyValue,omitempty"` + + // Meaning: The meaning field is reserved and should not be used. + Meaning int64 `json:"meaning,omitempty"` + + // StringValue: A UTF-8 encoded string value. + StringValue string `json:"stringValue,omitempty"` +} + +// method id "datastore.datasets.allocateIds": + +type DatasetsAllocateIdsCall struct { + s *Service + datasetId string + allocateidsrequest *AllocateIdsRequest + opt_ map[string]interface{} +} + +// AllocateIds: Allocate IDs for incomplete keys (useful for referencing +// an entity before it is inserted). +func (r *DatasetsService) AllocateIds(datasetId string, allocateidsrequest *AllocateIdsRequest) *DatasetsAllocateIdsCall { + c := &DatasetsAllocateIdsCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + c.allocateidsrequest = allocateidsrequest + return c +} + +func (c *DatasetsAllocateIdsCall) Do() (*AllocateIdsResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocateidsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/allocateIds") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AllocateIdsResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Allocate IDs for incomplete keys (useful for referencing an entity before it is inserted).", + // "httpMethod": "POST", + // "id": "datastore.datasets.allocateIds", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Identifies the dataset.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{datasetId}/allocateIds", + // "request": { + // "$ref": "AllocateIdsRequest" + // }, + // "response": { + // "$ref": "AllocateIdsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/datastore", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} + +// method id "datastore.datasets.beginTransaction": + +type DatasetsBeginTransactionCall struct { + s *Service + datasetId string + begintransactionrequest *BeginTransactionRequest + opt_ map[string]interface{} +} + +// BeginTransaction: Begin a new transaction. +func (r *DatasetsService) BeginTransaction(datasetId string, begintransactionrequest *BeginTransactionRequest) *DatasetsBeginTransactionCall { + c := &DatasetsBeginTransactionCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + c.begintransactionrequest = begintransactionrequest + return c +} + +func (c *DatasetsBeginTransactionCall) Do() (*BeginTransactionResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.begintransactionrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/beginTransaction") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BeginTransactionResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Begin a new transaction.", + // "httpMethod": "POST", + // "id": "datastore.datasets.beginTransaction", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Identifies the dataset.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{datasetId}/beginTransaction", + // "request": { + // "$ref": "BeginTransactionRequest" + // }, + // "response": { + // "$ref": "BeginTransactionResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/datastore", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} + +// method id "datastore.datasets.blindWrite": + +type DatasetsBlindWriteCall struct { + s *Service + datasetId string + blindwriterequest *BlindWriteRequest + opt_ map[string]interface{} +} + +// BlindWrite: Create, delete or modify some entities outside a +// transaction. +func (r *DatasetsService) BlindWrite(datasetId string, blindwriterequest *BlindWriteRequest) *DatasetsBlindWriteCall { + c := &DatasetsBlindWriteCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + c.blindwriterequest = blindwriterequest + return c +} + +func (c *DatasetsBlindWriteCall) Do() (*BlindWriteResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.blindwriterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/blindWrite") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BlindWriteResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create, delete or modify some entities outside a transaction.", + // "httpMethod": "POST", + // "id": "datastore.datasets.blindWrite", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Identifies the dataset.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{datasetId}/blindWrite", + // "request": { + // "$ref": "BlindWriteRequest" + // }, + // "response": { + // "$ref": "BlindWriteResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/datastore", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} + +// method id "datastore.datasets.commit": + +type DatasetsCommitCall struct { + s *Service + datasetId string + commitrequest *CommitRequest + opt_ map[string]interface{} +} + +// Commit: Commit a transaction, optionally creating, deleting or +// modifying some entities. +func (r *DatasetsService) Commit(datasetId string, commitrequest *CommitRequest) *DatasetsCommitCall { + c := &DatasetsCommitCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + c.commitrequest = commitrequest + return c +} + +func (c *DatasetsCommitCall) Do() (*CommitResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/commit") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommitResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Commit a transaction, optionally creating, deleting or modifying some entities.", + // "httpMethod": "POST", + // "id": "datastore.datasets.commit", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Identifies the dataset.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{datasetId}/commit", + // "request": { + // "$ref": "CommitRequest" + // }, + // "response": { + // "$ref": "CommitResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/datastore", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} + +// method id "datastore.datasets.lookup": + +type DatasetsLookupCall struct { + s *Service + datasetId string + lookuprequest *LookupRequest + opt_ map[string]interface{} +} + +// Lookup: Look up some entities by key. +func (r *DatasetsService) Lookup(datasetId string, lookuprequest *LookupRequest) *DatasetsLookupCall { + c := &DatasetsLookupCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + c.lookuprequest = lookuprequest + return c +} + +func (c *DatasetsLookupCall) Do() (*LookupResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.lookuprequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/lookup") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(LookupResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Look up some entities by key.", + // "httpMethod": "POST", + // "id": "datastore.datasets.lookup", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Identifies the dataset.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{datasetId}/lookup", + // "request": { + // "$ref": "LookupRequest" + // }, + // "response": { + // "$ref": "LookupResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/datastore", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} + +// method id "datastore.datasets.rollback": + +type DatasetsRollbackCall struct { + s *Service + datasetId string + rollbackrequest *RollbackRequest + opt_ map[string]interface{} +} + +// Rollback: Roll back a transaction. +func (r *DatasetsService) Rollback(datasetId string, rollbackrequest *RollbackRequest) *DatasetsRollbackCall { + c := &DatasetsRollbackCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + c.rollbackrequest = rollbackrequest + return c +} + +func (c *DatasetsRollbackCall) Do() (*RollbackResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/rollback") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RollbackResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Roll back a transaction.", + // "httpMethod": "POST", + // "id": "datastore.datasets.rollback", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Identifies the dataset.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{datasetId}/rollback", + // "request": { + // "$ref": "RollbackRequest" + // }, + // "response": { + // "$ref": "RollbackResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/datastore", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} + +// method id "datastore.datasets.runQuery": + +type DatasetsRunQueryCall struct { + s *Service + datasetId string + runqueryrequest *RunQueryRequest + opt_ map[string]interface{} +} + +// RunQuery: Query for entities. +func (r *DatasetsService) RunQuery(datasetId string, runqueryrequest *RunQueryRequest) *DatasetsRunQueryCall { + c := &DatasetsRunQueryCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + c.runqueryrequest = runqueryrequest + return c +} + +func (c *DatasetsRunQueryCall) Do() (*RunQueryResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.runqueryrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/runQuery") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RunQueryResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Query for entities.", + // "httpMethod": "POST", + // "id": "datastore.datasets.runQuery", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Identifies the dataset.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{datasetId}/runQuery", + // "request": { + // "$ref": "RunQueryRequest" + // }, + // "response": { + // "$ref": "RunQueryResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/datastore", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/datastore/v1beta2/datastore-api.json b/third_party/src/code.google.com/p/google-api-go-client/datastore/v1beta2/datastore-api.json new file mode 100644 index 0000000000000..c493f385e98ad --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/datastore/v1beta2/datastore-api.json @@ -0,0 +1,1077 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/-F8QVVz5h8Pedx8KHkOr-HeXpnU\"", + "discoveryVersion": "v1", + "id": "datastore:v1beta2", + "name": "datastore", + "version": "v1beta2", + "title": "Google Cloud Datastore API", + "description": "API for accessing Google Cloud Datastore.", + "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/datastore/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/datastore/v1beta2/datasets/", + "basePath": "/datastore/v1beta2/datasets/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "datastore/v1beta2/datasets/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "proto", + "enum": [ + "json", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Responses with Content-Type of application/x-protobuf" + ], + "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/datastore": { + "description": "View and manage your Google Cloud Datastore data" + }, + "https://www.googleapis.com/auth/userinfo.email": { + "description": "View your email address" + } + } + } + }, + "schemas": { + "AllocateIdsRequest": { + "id": "AllocateIdsRequest", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.AllocateIdsRequest", + "properties": { + "keys": { + "type": "array", + "description": "A list of keys with incomplete key paths to allocate IDs for. No key may be reserved/read-only.", + "items": { + "$ref": "Key" + } + } + } + }, + "AllocateIdsResponse": { + "id": "AllocateIdsResponse", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.AllocateIdsResponse", + "properties": { + "header": { + "$ref": "ResponseHeader" + }, + "keys": { + "type": "array", + "description": "The keys specified in the request (in the same order), each with its key path completed with a newly allocated ID.", + "items": { + "$ref": "Key" + } + } + } + }, + "BeginTransactionRequest": { + "id": "BeginTransactionRequest", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.BeginTransactionRequest", + "properties": { + "isolationLevel": { + "type": "string", + "description": "The transaction isolation level. Either snapshot or serializable. The default isolation level is snapshot isolation, which means that another transaction may not concurrently modify the data that is modified by this transaction. Optionally, a transaction can request to be made serializable which means that another transaction cannot concurrently modify the data that is read or modified by this transaction.", + "enum": [ + "SERIALIZABLE", + "SNAPSHOT" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "BeginTransactionResponse": { + "id": "BeginTransactionResponse", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.BeginTransactionResponse", + "properties": { + "header": { + "$ref": "ResponseHeader" + }, + "transaction": { + "type": "string", + "description": "The transaction identifier (always present).", + "format": "byte" + } + } + }, + "CommitRequest": { + "id": "CommitRequest", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.CommitRequest", + "properties": { + "mode": { + "type": "string", + "description": "The type of commit to perform. Either TRANSACTIONAL or NON_TRANSACTIONAL.", + "enum": [ + "NON_TRANSACTIONAL", + "TRANSACTIONAL" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "mutation": { + "$ref": "Mutation", + "description": "The mutation to perform. Optional." + }, + "transaction": { + "type": "string", + "description": "The transaction identifier, returned by a call to beginTransaction. Must be set when mode is TRANSACTIONAL.", + "format": "byte" + } + } + }, + "CommitResponse": { + "id": "CommitResponse", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.CommitResponse", + "properties": { + "header": { + "$ref": "ResponseHeader" + }, + "mutationResult": { + "$ref": "MutationResult", + "description": "The result of performing the mutation (if any)." + } + } + }, + "CompositeFilter": { + "id": "CompositeFilter", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.CompositeFilter", + "properties": { + "filters": { + "type": "array", + "description": "The list of filters to combine. Must contain at least one filter.", + "items": { + "$ref": "Filter" + } + }, + "operator": { + "type": "string", + "description": "The operator for combining multiple filters. Only \"and\" is currently supported.", + "enum": [ + "AND" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "Entity": { + "id": "Entity", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.Entity", + "properties": { + "key": { + "$ref": "Key", + "description": "The entity's key.\n\nAn entity must have a key, unless otherwise documented (for example, an entity in Value.entityValue may have no key). An entity's kind is its key's path's last element's kind, or null if it has no key." + }, + "properties": { + "type": "object", + "description": "The entity's properties.", + "additionalProperties": { + "$ref": "Property", + "description": "The name of the property. Properties with names matching regex \"__.*__\" are reserved. A reserved property name is forbidden in certain documented contexts. The name cannot be \"\"." + } + } + } + }, + "EntityResult": { + "id": "EntityResult", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.EntityResult", + "properties": { + "entity": { + "$ref": "Entity", + "description": "The resulting entity." + } + } + }, + "Filter": { + "id": "Filter", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.Filter", + "properties": { + "compositeFilter": { + "$ref": "CompositeFilter", + "description": "A composite filter." + }, + "propertyFilter": { + "$ref": "PropertyFilter", + "description": "A filter on a property." + } + } + }, + "GqlQuery": { + "id": "GqlQuery", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.GqlQuery", + "properties": { + "allowLiteral": { + "type": "boolean", + "description": "When false, the query string must not contain a literal." + }, + "nameArgs": { + "type": "array", + "description": "A named argument must set field GqlQueryArg.name. No two named arguments may have the same name. For each non-reserved named binding site in the query string, there must be a named argument with that name, but not necessarily the inverse.", + "items": { + "$ref": "GqlQueryArg" + } + }, + "numberArgs": { + "type": "array", + "description": "Numbered binding site @1 references the first numbered argument, effectively using 1-based indexing, rather than the usual 0. A numbered argument must NOT set field GqlQueryArg.name. For each binding site numbered i in query_string, there must be an ith numbered argument. The inverse must also be true.", + "items": { + "$ref": "GqlQueryArg" + } + }, + "queryString": { + "type": "string" + } + } + }, + "GqlQueryArg": { + "id": "GqlQueryArg", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.GqlQueryArg", + "properties": { + "cursor": { + "type": "string", + "format": "byte" + }, + "name": { + "type": "string", + "description": "Must match regex \"[A-Za-z_$][A-Za-z_$0-9]*\". Must not match regex \"__.*__\". Must not be \"\"." + }, + "value": { + "$ref": "Value" + } + } + }, + "Key": { + "id": "Key", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.Key", + "properties": { + "partitionId": { + "$ref": "PartitionId", + "description": "Entities are partitioned into subsets, currently identified by a dataset (usually implicitly specified by the project) and namespace ID. Queries are scoped to a single partition." + }, + "path": { + "type": "array", + "description": "The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: ALL of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. A path can never be empty.", + "items": { + "$ref": "KeyPathElement" + } + } + } + }, + "KeyPathElement": { + "id": "KeyPathElement", + "type": "object", + "description": "A (kind, ID/name) pair used to construct a key path.\n\nAt most one of name or ID may be set. If either is set, the element is complete. If neither is set, the element is incomplete.", + "externalTypeName": "apphosting.client.datastoreservice.proto.Key.PathElement", + "properties": { + "id": { + "type": "string", + "description": "The ID of the entity. Always \u003e 0.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "The kind of the entity. Kinds matching regex \"__.*__\" are reserved/read-only. Cannot be \"\"." + }, + "name": { + "type": "string", + "description": "The name of the entity. Names matching regex \"__.*__\" are reserved/read-only. Cannot be \"\"." + } + } + }, + "KindExpression": { + "id": "KindExpression", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.KindExpression", + "properties": { + "name": { + "type": "string", + "description": "The name of the kind." + } + } + }, + "LookupRequest": { + "id": "LookupRequest", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.LookupRequest", + "properties": { + "keys": { + "type": "array", + "description": "Keys of entities to look up from the datastore.", + "items": { + "$ref": "Key" + } + }, + "readOptions": { + "$ref": "ReadOptions", + "description": "Options for this lookup request. Optional." + } + } + }, + "LookupResponse": { + "id": "LookupResponse", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.LookupResponse", + "properties": { + "deferred": { + "type": "array", + "description": "A list of keys that were not looked up due to resource constraints.", + "items": { + "$ref": "Key" + } + }, + "found": { + "type": "array", + "description": "Entities found.", + "items": { + "$ref": "EntityResult" + } + }, + "header": { + "$ref": "ResponseHeader" + }, + "missing": { + "type": "array", + "description": "Entities not found, with only the key populated.", + "items": { + "$ref": "EntityResult" + } + } + } + }, + "Mutation": { + "id": "Mutation", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.Mutation", + "properties": { + "delete": { + "type": "array", + "description": "Keys of entities to delete. Each key must have a complete key path and must not be reserved/read-only.", + "items": { + "$ref": "Key" + } + }, + "force": { + "type": "boolean", + "description": "Ignore a user specified read-only period. Optional." + }, + "insert": { + "type": "array", + "description": "Entities to insert. Each inserted entity's key must have a complete path and must not be reserved/read-only.", + "items": { + "$ref": "Entity" + } + }, + "insertAutoId": { + "type": "array", + "description": "Insert entities with a newly allocated ID. Each inserted entity's key must omit the final identifier in its path and must not be reserved/read-only.", + "items": { + "$ref": "Entity" + } + }, + "update": { + "type": "array", + "description": "Entities to update. Each updated entity's key must have a complete path and must not be reserved/read-only.", + "items": { + "$ref": "Entity" + } + }, + "upsert": { + "type": "array", + "description": "Entities to upsert. Each upserted entity's key must have a complete path and must not be reserved/read-only.", + "items": { + "$ref": "Entity" + } + } + } + }, + "MutationResult": { + "id": "MutationResult", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.MutationResult", + "properties": { + "indexUpdates": { + "type": "integer", + "description": "Number of index writes.", + "format": "int32" + }, + "insertAutoIdKeys": { + "type": "array", + "description": "Keys for insertAutoId entities. One per entity from the request, in the same order.", + "items": { + "$ref": "Key" + } + } + } + }, + "PartitionId": { + "id": "PartitionId", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.PartitionId", + "properties": { + "datasetId": { + "type": "string", + "description": "The dataset ID." + }, + "namespace": { + "type": "string", + "description": "The namespace." + } + } + }, + "Property": { + "id": "Property", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.Property", + "properties": { + "blobKeyValue": { + "type": "string", + "description": "A blob key value." + }, + "blobValue": { + "type": "string", + "description": "A blob value.", + "format": "byte" + }, + "booleanValue": { + "type": "boolean", + "description": "A boolean value." + }, + "dateTimeValue": { + "type": "string", + "description": "A timestamp value.", + "format": "date-time" + }, + "doubleValue": { + "type": "number", + "description": "A double value.", + "format": "double" + }, + "entityValue": { + "$ref": "Entity", + "description": "An entity value. May have no key. May have a key with an incomplete key path. May have a reserved/read-only key." + }, + "indexed": { + "type": "boolean", + "description": "If the value should be indexed.\n\nThe indexed property may be set for a null value. When indexed is true, stringValue is limited to 500 characters and the blob value is limited to 500 bytes. Input values by default have indexed set to true; however, you can explicitly set indexed to true if you want. (An output value never has indexed explicitly set to true.) If a value is itself an entity, it cannot have indexed set to true." + }, + "integerValue": { + "type": "string", + "description": "An integer value.", + "format": "int64" + }, + "keyValue": { + "$ref": "Key", + "description": "A key value." + }, + "listValue": { + "type": "array", + "description": "A list value. Cannot contain another list value. Cannot also have a meaning and indexing set.", + "items": { + "$ref": "Value" + } + }, + "meaning": { + "type": "integer", + "description": "The meaning field is reserved and should not be used.", + "format": "int32" + }, + "stringValue": { + "type": "string", + "description": "A UTF-8 encoded string value." + } + } + }, + "PropertyExpression": { + "id": "PropertyExpression", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.PropertyExpression", + "properties": { + "aggregationFunction": { + "type": "string", + "description": "The aggregation function to apply to the property. Optional. Can only be used when grouping by at least one property. Must then be set on all properties in the projection that are not being grouped by. Aggregation functions: first selects the first result as determined by the query's order.", + "enum": [ + "FIRST" + ], + "enumDescriptions": [ + "" + ] + }, + "property": { + "$ref": "PropertyReference", + "description": "The property to project." + } + } + }, + "PropertyFilter": { + "id": "PropertyFilter", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.PropertyFilter", + "properties": { + "operator": { + "type": "string", + "description": "The operator to filter by. One of lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual, equal, or hasAncestor.", + "enum": [ + "EQUAL", + "GREATER_THAN", + "GREATER_THAN_OR_EQUAL", + "HAS_ANCESTOR", + "LESS_THAN", + "LESS_THAN_OR_EQUAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "property": { + "$ref": "PropertyReference", + "description": "The property to filter by." + }, + "value": { + "$ref": "Value", + "description": "The value to compare the property to." + } + } + }, + "PropertyOrder": { + "id": "PropertyOrder", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.PropertyOrder", + "properties": { + "direction": { + "type": "string", + "description": "The direction to order by. One of ascending or descending. Optional, defaults to ascending.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "property": { + "$ref": "PropertyReference", + "description": "The property to order by." + } + } + }, + "PropertyReference": { + "id": "PropertyReference", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.PropertyReference", + "properties": { + "name": { + "type": "string", + "description": "The name of the property." + } + } + }, + "Query": { + "id": "Query", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.Query", + "properties": { + "endCursor": { + "type": "string", + "description": "An ending point for the query results. Optional. Query cursors are returned in query result batches.", + "format": "byte" + }, + "filter": { + "$ref": "Filter", + "description": "The filter to apply (optional)." + }, + "groupBy": { + "type": "array", + "description": "The properties to group by (if empty, no grouping is applied to the result set).", + "items": { + "$ref": "PropertyReference" + } + }, + "kinds": { + "type": "array", + "description": "The kinds to query (if empty, returns entities from all kinds).", + "items": { + "$ref": "KindExpression" + } + }, + "limit": { + "type": "integer", + "description": "The maximum number of results to return. Applies after all other constraints. Optional.", + "format": "int32" + }, + "offset": { + "type": "integer", + "description": "The number of results to skip. Applies before limit, but after all other constraints (optional, defaults to 0).", + "format": "int32" + }, + "order": { + "type": "array", + "description": "The order to apply to the query results (if empty, order is unspecified).", + "items": { + "$ref": "PropertyOrder" + } + }, + "projection": { + "type": "array", + "description": "The projection to return. If not set the entire entity is returned.", + "items": { + "$ref": "PropertyExpression" + } + }, + "startCursor": { + "type": "string", + "description": "A starting point for the query results. Optional. Query cursors are returned in query result batches.", + "format": "byte" + } + } + }, + "QueryResultBatch": { + "id": "QueryResultBatch", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.QueryResultBatch", + "properties": { + "endCursor": { + "type": "string", + "description": "A cursor that points to the position after the last result in the batch. May be absent.", + "format": "byte" + }, + "entityResultType": { + "type": "string", + "description": "The result type for every entity in entityResults. full for full entities, projection for entities with only projected properties, keyOnly for entities with only a key.", + "enum": [ + "FULL", + "KEY_ONLY", + "PROJECTION" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "entityResults": { + "type": "array", + "description": "The results for this batch.", + "items": { + "$ref": "EntityResult" + } + }, + "moreResults": { + "type": "string", + "description": "The state of the query after the current batch. One of notFinished, moreResultsAfterLimit, noMoreResults.", + "enum": [ + "MORE_RESULTS_AFTER_LIMIT", + "NOT_FINISHED", + "NO_MORE_RESULTS" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "skippedResults": { + "type": "integer", + "description": "The number of results skipped because of Query.offset.", + "format": "int32" + } + } + }, + "ReadOptions": { + "id": "ReadOptions", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.ReadOptions", + "properties": { + "readConsistency": { + "type": "string", + "description": "The read consistency to use. One of default, strong, or eventual. Cannot be set when transaction is set. Lookup and ancestor queries default to strong, global queries default to eventual and cannot be set to strong. Optional. Default is default.", + "enum": [ + "DEFAULT", + "EVENTUAL", + "STRONG" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "transaction": { + "type": "string", + "description": "The transaction to use. Optional.", + "format": "byte" + } + } + }, + "ResponseHeader": { + "id": "ResponseHeader", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.ResponseHeader", + "properties": { + "kind": { + "type": "string", + "description": "The kind, fixed to \"datastore#responseHeader\".", + "default": "datastore#responseHeader" + } + } + }, + "RollbackRequest": { + "id": "RollbackRequest", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.RollbackRequest", + "properties": { + "transaction": { + "type": "string", + "description": "The transaction identifier, returned by a call to beginTransaction.", + "format": "byte" + } + } + }, + "RollbackResponse": { + "id": "RollbackResponse", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.RollbackResponse", + "properties": { + "header": { + "$ref": "ResponseHeader" + } + } + }, + "RunQueryRequest": { + "id": "RunQueryRequest", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.RunQueryRequest", + "properties": { + "gqlQuery": { + "$ref": "GqlQuery", + "description": "The GQL query to run. Either this field or field query must be set, but not both." + }, + "partitionId": { + "$ref": "PartitionId", + "description": "Entities are partitioned into subsets, identified by a dataset (usually implicitly specified by the project) and namespace ID. Queries are scoped to a single partition." + }, + "query": { + "$ref": "Query", + "description": "The query to run. Either this field or field gql_query must be set, but not both." + }, + "readOptions": { + "$ref": "ReadOptions", + "description": "The options for this query." + } + } + }, + "RunQueryResponse": { + "id": "RunQueryResponse", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.RunQueryResponse", + "properties": { + "batch": { + "$ref": "QueryResultBatch", + "description": "A batch of query results (always present)." + }, + "header": { + "$ref": "ResponseHeader" + } + } + }, + "Value": { + "id": "Value", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.Value", + "properties": { + "blobKeyValue": { + "type": "string", + "description": "A blob key value." + }, + "blobValue": { + "type": "string", + "description": "A blob value.", + "format": "byte" + }, + "booleanValue": { + "type": "boolean", + "description": "A boolean value." + }, + "dateTimeValue": { + "type": "string", + "description": "A timestamp value.", + "format": "date-time" + }, + "doubleValue": { + "type": "number", + "description": "A double value.", + "format": "double" + }, + "entityValue": { + "$ref": "Entity", + "description": "An entity value. May have no key. May have a key with an incomplete key path. May have a reserved/read-only key." + }, + "indexed": { + "type": "boolean", + "description": "If the value should be indexed.\n\nThe indexed property may be set for a null value. When indexed is true, stringValue is limited to 500 characters and the blob value is limited to 500 bytes. Input values by default have indexed set to true; however, you can explicitly set indexed to true if you want. (An output value never has indexed explicitly set to true.) If a value is itself an entity, it cannot have indexed set to true." + }, + "integerValue": { + "type": "string", + "description": "An integer value.", + "format": "int64" + }, + "keyValue": { + "$ref": "Key", + "description": "A key value." + }, + "listValue": { + "type": "array", + "description": "A list value. Cannot contain another list value. Cannot also have a meaning and indexing set.", + "items": { + "$ref": "Value" + } + }, + "meaning": { + "type": "integer", + "description": "The meaning field is reserved and should not be used.", + "format": "int32" + }, + "stringValue": { + "type": "string", + "description": "A UTF-8 encoded string value." + } + } + } + }, + "resources": { + "datasets": { + "methods": { + "allocateIds": { + "id": "datastore.datasets.allocateIds", + "path": "{datasetId}/allocateIds", + "httpMethod": "POST", + "description": "Allocate IDs for incomplete keys (useful for referencing an entity before it is inserted).", + "parameters": { + "datasetId": { + "type": "string", + "description": "Identifies the dataset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "AllocateIdsRequest" + }, + "response": { + "$ref": "AllocateIdsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/datastore", + "https://www.googleapis.com/auth/userinfo.email" + ] + }, + "beginTransaction": { + "id": "datastore.datasets.beginTransaction", + "path": "{datasetId}/beginTransaction", + "httpMethod": "POST", + "description": "Begin a new transaction.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Identifies the dataset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "BeginTransactionRequest" + }, + "response": { + "$ref": "BeginTransactionResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/datastore", + "https://www.googleapis.com/auth/userinfo.email" + ] + }, + "commit": { + "id": "datastore.datasets.commit", + "path": "{datasetId}/commit", + "httpMethod": "POST", + "description": "Commit a transaction, optionally creating, deleting or modifying some entities.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Identifies the dataset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "CommitRequest" + }, + "response": { + "$ref": "CommitResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/datastore", + "https://www.googleapis.com/auth/userinfo.email" + ] + }, + "lookup": { + "id": "datastore.datasets.lookup", + "path": "{datasetId}/lookup", + "httpMethod": "POST", + "description": "Look up some entities by key.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Identifies the dataset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "LookupRequest" + }, + "response": { + "$ref": "LookupResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/datastore", + "https://www.googleapis.com/auth/userinfo.email" + ] + }, + "rollback": { + "id": "datastore.datasets.rollback", + "path": "{datasetId}/rollback", + "httpMethod": "POST", + "description": "Roll back a transaction.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Identifies the dataset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "RollbackRequest" + }, + "response": { + "$ref": "RollbackResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/datastore", + "https://www.googleapis.com/auth/userinfo.email" + ] + }, + "runQuery": { + "id": "datastore.datasets.runQuery", + "path": "{datasetId}/runQuery", + "httpMethod": "POST", + "description": "Query for entities.", + "parameters": { + "datasetId": { + "type": "string", + "description": "Identifies the dataset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "RunQueryRequest" + }, + "response": { + "$ref": "RunQueryResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/datastore", + "https://www.googleapis.com/auth/userinfo.email" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/datastore/v1beta2/datastore-gen.go b/third_party/src/code.google.com/p/google-api-go-client/datastore/v1beta2/datastore-gen.go new file mode 100644 index 0000000000000..274b1ad67186b --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/datastore/v1beta2/datastore-gen.go @@ -0,0 +1,1002 @@ +// Package datastore provides access to the Google Cloud Datastore API. +// +// See https://developers.google.com/datastore/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/datastore/v1beta2" +// ... +// datastoreService, err := datastore.New(oauthHttpClient) +package datastore + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "datastore:v1beta2" +const apiName = "datastore" +const apiVersion = "v1beta2" +const basePath = "https://www.googleapis.com/datastore/v1beta2/datasets/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Google Cloud Datastore data + DatastoreScope = "https://www.googleapis.com/auth/datastore" + + // View your email address + UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Datasets = NewDatasetsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Datasets *DatasetsService +} + +func NewDatasetsService(s *Service) *DatasetsService { + rs := &DatasetsService{s: s} + return rs +} + +type DatasetsService struct { + s *Service +} + +type AllocateIdsRequest struct { + // Keys: A list of keys with incomplete key paths to allocate IDs for. + // No key may be reserved/read-only. + Keys []*Key `json:"keys,omitempty"` +} + +type AllocateIdsResponse struct { + Header *ResponseHeader `json:"header,omitempty"` + + // Keys: The keys specified in the request (in the same order), each + // with its key path completed with a newly allocated ID. + Keys []*Key `json:"keys,omitempty"` +} + +type BeginTransactionRequest struct { + // IsolationLevel: The transaction isolation level. Either snapshot or + // serializable. The default isolation level is snapshot isolation, + // which means that another transaction may not concurrently modify the + // data that is modified by this transaction. Optionally, a transaction + // can request to be made serializable which means that another + // transaction cannot concurrently modify the data that is read or + // modified by this transaction. + IsolationLevel string `json:"isolationLevel,omitempty"` +} + +type BeginTransactionResponse struct { + Header *ResponseHeader `json:"header,omitempty"` + + // Transaction: The transaction identifier (always present). + Transaction string `json:"transaction,omitempty"` +} + +type CommitRequest struct { + // Mode: The type of commit to perform. Either TRANSACTIONAL or + // NON_TRANSACTIONAL. + Mode string `json:"mode,omitempty"` + + // Mutation: The mutation to perform. Optional. + Mutation *Mutation `json:"mutation,omitempty"` + + // Transaction: The transaction identifier, returned by a call to + // beginTransaction. Must be set when mode is TRANSACTIONAL. + Transaction string `json:"transaction,omitempty"` +} + +type CommitResponse struct { + Header *ResponseHeader `json:"header,omitempty"` + + // MutationResult: The result of performing the mutation (if any). + MutationResult *MutationResult `json:"mutationResult,omitempty"` +} + +type CompositeFilter struct { + // Filters: The list of filters to combine. Must contain at least one + // filter. + Filters []*Filter `json:"filters,omitempty"` + + // Operator: The operator for combining multiple filters. Only "and" is + // currently supported. + Operator string `json:"operator,omitempty"` +} + +type Entity struct { + // Key: The entity's key. + // + // An entity must have a key, unless otherwise + // documented (for example, an entity in Value.entityValue may have no + // key). An entity's kind is its key's path's last element's kind, or + // null if it has no key. + Key *Key `json:"key,omitempty"` + + // Properties: The entity's properties. + Properties *EntityProperties `json:"properties,omitempty"` +} + +type EntityProperties struct { +} + +type EntityResult struct { + // Entity: The resulting entity. + Entity *Entity `json:"entity,omitempty"` +} + +type Filter struct { + // CompositeFilter: A composite filter. + CompositeFilter *CompositeFilter `json:"compositeFilter,omitempty"` + + // PropertyFilter: A filter on a property. + PropertyFilter *PropertyFilter `json:"propertyFilter,omitempty"` +} + +type GqlQuery struct { + // AllowLiteral: When false, the query string must not contain a + // literal. + AllowLiteral bool `json:"allowLiteral,omitempty"` + + // NameArgs: A named argument must set field GqlQueryArg.name. No two + // named arguments may have the same name. For each non-reserved named + // binding site in the query string, there must be a named argument with + // that name, but not necessarily the inverse. + NameArgs []*GqlQueryArg `json:"nameArgs,omitempty"` + + // NumberArgs: Numbered binding site @1 references the first numbered + // argument, effectively using 1-based indexing, rather than the usual + // 0. A numbered argument must NOT set field GqlQueryArg.name. For each + // binding site numbered i in query_string, there must be an ith + // numbered argument. The inverse must also be true. + NumberArgs []*GqlQueryArg `json:"numberArgs,omitempty"` + + QueryString string `json:"queryString,omitempty"` +} + +type GqlQueryArg struct { + Cursor string `json:"cursor,omitempty"` + + // Name: Must match regex "[A-Za-z_$][A-Za-z_$0-9]*". Must not match + // regex "__.*__". Must not be "". + Name string `json:"name,omitempty"` + + Value *Value `json:"value,omitempty"` +} + +type Key struct { + // PartitionId: Entities are partitioned into subsets, currently + // identified by a dataset (usually implicitly specified by the project) + // and namespace ID. Queries are scoped to a single partition. + PartitionId *PartitionId `json:"partitionId,omitempty"` + + // Path: The entity path. An entity path consists of one or more + // elements composed of a kind and a string or numerical identifier, + // which identify entities. The first element identifies a root entity, + // the second element identifies a child of the root entity, the third + // element a child of the second entity, and so forth. The entities + // identified by all prefixes of the path are called the element's + // ancestors. An entity path is always fully complete: ALL of the + // entity's ancestors are required to be in the path along with the + // entity identifier itself. The only exception is that in some + // documented cases, the identifier in the last path element (for the + // entity) itself may be omitted. A path can never be empty. + Path []*KeyPathElement `json:"path,omitempty"` +} + +type KeyPathElement struct { + // Id: The ID of the entity. Always > 0. + Id int64 `json:"id,omitempty,string"` + + // Kind: The kind of the entity. Kinds matching regex "__.*__" are + // reserved/read-only. Cannot be "". + Kind string `json:"kind,omitempty"` + + // Name: The name of the entity. Names matching regex "__.*__" are + // reserved/read-only. Cannot be "". + Name string `json:"name,omitempty"` +} + +type KindExpression struct { + // Name: The name of the kind. + Name string `json:"name,omitempty"` +} + +type LookupRequest struct { + // Keys: Keys of entities to look up from the datastore. + Keys []*Key `json:"keys,omitempty"` + + // ReadOptions: Options for this lookup request. Optional. + ReadOptions *ReadOptions `json:"readOptions,omitempty"` +} + +type LookupResponse struct { + // Deferred: A list of keys that were not looked up due to resource + // constraints. + Deferred []*Key `json:"deferred,omitempty"` + + // Found: Entities found. + Found []*EntityResult `json:"found,omitempty"` + + Header *ResponseHeader `json:"header,omitempty"` + + // Missing: Entities not found, with only the key populated. + Missing []*EntityResult `json:"missing,omitempty"` +} + +type Mutation struct { + // Delete: Keys of entities to delete. Each key must have a complete key + // path and must not be reserved/read-only. + Delete []*Key `json:"delete,omitempty"` + + // Force: Ignore a user specified read-only period. Optional. + Force bool `json:"force,omitempty"` + + // Insert: Entities to insert. Each inserted entity's key must have a + // complete path and must not be reserved/read-only. + Insert []*Entity `json:"insert,omitempty"` + + // InsertAutoId: Insert entities with a newly allocated ID. Each + // inserted entity's key must omit the final identifier in its path and + // must not be reserved/read-only. + InsertAutoId []*Entity `json:"insertAutoId,omitempty"` + + // Update: Entities to update. Each updated entity's key must have a + // complete path and must not be reserved/read-only. + Update []*Entity `json:"update,omitempty"` + + // Upsert: Entities to upsert. Each upserted entity's key must have a + // complete path and must not be reserved/read-only. + Upsert []*Entity `json:"upsert,omitempty"` +} + +type MutationResult struct { + // IndexUpdates: Number of index writes. + IndexUpdates int64 `json:"indexUpdates,omitempty"` + + // InsertAutoIdKeys: Keys for insertAutoId entities. One per entity from + // the request, in the same order. + InsertAutoIdKeys []*Key `json:"insertAutoIdKeys,omitempty"` +} + +type PartitionId struct { + // DatasetId: The dataset ID. + DatasetId string `json:"datasetId,omitempty"` + + // Namespace: The namespace. + Namespace string `json:"namespace,omitempty"` +} + +type Property struct { + // BlobKeyValue: A blob key value. + BlobKeyValue string `json:"blobKeyValue,omitempty"` + + // BlobValue: A blob value. + BlobValue string `json:"blobValue,omitempty"` + + // BooleanValue: A boolean value. + BooleanValue bool `json:"booleanValue,omitempty"` + + // DateTimeValue: A timestamp value. + DateTimeValue string `json:"dateTimeValue,omitempty"` + + // DoubleValue: A double value. + DoubleValue float64 `json:"doubleValue,omitempty"` + + // EntityValue: An entity value. May have no key. May have a key with an + // incomplete key path. May have a reserved/read-only key. + EntityValue *Entity `json:"entityValue,omitempty"` + + // Indexed: If the value should be indexed. + // + // The indexed property may be + // set for a null value. When indexed is true, stringValue is limited to + // 500 characters and the blob value is limited to 500 bytes. Input + // values by default have indexed set to true; however, you can + // explicitly set indexed to true if you want. (An output value never + // has indexed explicitly set to true.) If a value is itself an entity, + // it cannot have indexed set to true. + Indexed bool `json:"indexed,omitempty"` + + // IntegerValue: An integer value. + IntegerValue int64 `json:"integerValue,omitempty,string"` + + // KeyValue: A key value. + KeyValue *Key `json:"keyValue,omitempty"` + + // ListValue: A list value. Cannot contain another list value. Cannot + // also have a meaning and indexing set. + ListValue []*Value `json:"listValue,omitempty"` + + // Meaning: The meaning field is reserved and should not be used. + Meaning int64 `json:"meaning,omitempty"` + + // StringValue: A UTF-8 encoded string value. + StringValue string `json:"stringValue,omitempty"` +} + +type PropertyExpression struct { + // AggregationFunction: The aggregation function to apply to the + // property. Optional. Can only be used when grouping by at least one + // property. Must then be set on all properties in the projection that + // are not being grouped by. Aggregation functions: first selects the + // first result as determined by the query's order. + AggregationFunction string `json:"aggregationFunction,omitempty"` + + // Property: The property to project. + Property *PropertyReference `json:"property,omitempty"` +} + +type PropertyFilter struct { + // Operator: The operator to filter by. One of lessThan, + // lessThanOrEqual, greaterThan, greaterThanOrEqual, equal, or + // hasAncestor. + Operator string `json:"operator,omitempty"` + + // Property: The property to filter by. + Property *PropertyReference `json:"property,omitempty"` + + // Value: The value to compare the property to. + Value *Value `json:"value,omitempty"` +} + +type PropertyOrder struct { + // Direction: The direction to order by. One of ascending or descending. + // Optional, defaults to ascending. + Direction string `json:"direction,omitempty"` + + // Property: The property to order by. + Property *PropertyReference `json:"property,omitempty"` +} + +type PropertyReference struct { + // Name: The name of the property. + Name string `json:"name,omitempty"` +} + +type Query struct { + // EndCursor: An ending point for the query results. Optional. Query + // cursors are returned in query result batches. + EndCursor string `json:"endCursor,omitempty"` + + // Filter: The filter to apply (optional). + Filter *Filter `json:"filter,omitempty"` + + // GroupBy: The properties to group by (if empty, no grouping is applied + // to the result set). + GroupBy []*PropertyReference `json:"groupBy,omitempty"` + + // Kinds: The kinds to query (if empty, returns entities from all + // kinds). + Kinds []*KindExpression `json:"kinds,omitempty"` + + // Limit: The maximum number of results to return. Applies after all + // other constraints. Optional. + Limit int64 `json:"limit,omitempty"` + + // Offset: The number of results to skip. Applies before limit, but + // after all other constraints (optional, defaults to 0). + Offset int64 `json:"offset,omitempty"` + + // Order: The order to apply to the query results (if empty, order is + // unspecified). + Order []*PropertyOrder `json:"order,omitempty"` + + // Projection: The projection to return. If not set the entire entity is + // returned. + Projection []*PropertyExpression `json:"projection,omitempty"` + + // StartCursor: A starting point for the query results. Optional. Query + // cursors are returned in query result batches. + StartCursor string `json:"startCursor,omitempty"` +} + +type QueryResultBatch struct { + // EndCursor: A cursor that points to the position after the last result + // in the batch. May be absent. + EndCursor string `json:"endCursor,omitempty"` + + // EntityResultType: The result type for every entity in entityResults. + // full for full entities, projection for entities with only projected + // properties, keyOnly for entities with only a key. + EntityResultType string `json:"entityResultType,omitempty"` + + // EntityResults: The results for this batch. + EntityResults []*EntityResult `json:"entityResults,omitempty"` + + // MoreResults: The state of the query after the current batch. One of + // notFinished, moreResultsAfterLimit, noMoreResults. + MoreResults string `json:"moreResults,omitempty"` + + // SkippedResults: The number of results skipped because of + // Query.offset. + SkippedResults int64 `json:"skippedResults,omitempty"` +} + +type ReadOptions struct { + // ReadConsistency: The read consistency to use. One of default, strong, + // or eventual. Cannot be set when transaction is set. Lookup and + // ancestor queries default to strong, global queries default to + // eventual and cannot be set to strong. Optional. Default is default. + ReadConsistency string `json:"readConsistency,omitempty"` + + // Transaction: The transaction to use. Optional. + Transaction string `json:"transaction,omitempty"` +} + +type ResponseHeader struct { + // Kind: The kind, fixed to "datastore#responseHeader". + Kind string `json:"kind,omitempty"` +} + +type RollbackRequest struct { + // Transaction: The transaction identifier, returned by a call to + // beginTransaction. + Transaction string `json:"transaction,omitempty"` +} + +type RollbackResponse struct { + Header *ResponseHeader `json:"header,omitempty"` +} + +type RunQueryRequest struct { + // GqlQuery: The GQL query to run. Either this field or field query must + // be set, but not both. + GqlQuery *GqlQuery `json:"gqlQuery,omitempty"` + + // PartitionId: Entities are partitioned into subsets, identified by a + // dataset (usually implicitly specified by the project) and namespace + // ID. Queries are scoped to a single partition. + PartitionId *PartitionId `json:"partitionId,omitempty"` + + // Query: The query to run. Either this field or field gql_query must be + // set, but not both. + Query *Query `json:"query,omitempty"` + + // ReadOptions: The options for this query. + ReadOptions *ReadOptions `json:"readOptions,omitempty"` +} + +type RunQueryResponse struct { + // Batch: A batch of query results (always present). + Batch *QueryResultBatch `json:"batch,omitempty"` + + Header *ResponseHeader `json:"header,omitempty"` +} + +type Value struct { + // BlobKeyValue: A blob key value. + BlobKeyValue string `json:"blobKeyValue,omitempty"` + + // BlobValue: A blob value. + BlobValue string `json:"blobValue,omitempty"` + + // BooleanValue: A boolean value. + BooleanValue bool `json:"booleanValue,omitempty"` + + // DateTimeValue: A timestamp value. + DateTimeValue string `json:"dateTimeValue,omitempty"` + + // DoubleValue: A double value. + DoubleValue float64 `json:"doubleValue,omitempty"` + + // EntityValue: An entity value. May have no key. May have a key with an + // incomplete key path. May have a reserved/read-only key. + EntityValue *Entity `json:"entityValue,omitempty"` + + // Indexed: If the value should be indexed. + // + // The indexed property may be + // set for a null value. When indexed is true, stringValue is limited to + // 500 characters and the blob value is limited to 500 bytes. Input + // values by default have indexed set to true; however, you can + // explicitly set indexed to true if you want. (An output value never + // has indexed explicitly set to true.) If a value is itself an entity, + // it cannot have indexed set to true. + Indexed bool `json:"indexed,omitempty"` + + // IntegerValue: An integer value. + IntegerValue int64 `json:"integerValue,omitempty,string"` + + // KeyValue: A key value. + KeyValue *Key `json:"keyValue,omitempty"` + + // ListValue: A list value. Cannot contain another list value. Cannot + // also have a meaning and indexing set. + ListValue []*Value `json:"listValue,omitempty"` + + // Meaning: The meaning field is reserved and should not be used. + Meaning int64 `json:"meaning,omitempty"` + + // StringValue: A UTF-8 encoded string value. + StringValue string `json:"stringValue,omitempty"` +} + +// method id "datastore.datasets.allocateIds": + +type DatasetsAllocateIdsCall struct { + s *Service + datasetId string + allocateidsrequest *AllocateIdsRequest + opt_ map[string]interface{} +} + +// AllocateIds: Allocate IDs for incomplete keys (useful for referencing +// an entity before it is inserted). +func (r *DatasetsService) AllocateIds(datasetId string, allocateidsrequest *AllocateIdsRequest) *DatasetsAllocateIdsCall { + c := &DatasetsAllocateIdsCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + c.allocateidsrequest = allocateidsrequest + return c +} + +func (c *DatasetsAllocateIdsCall) Do() (*AllocateIdsResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocateidsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/allocateIds") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AllocateIdsResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Allocate IDs for incomplete keys (useful for referencing an entity before it is inserted).", + // "httpMethod": "POST", + // "id": "datastore.datasets.allocateIds", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Identifies the dataset.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{datasetId}/allocateIds", + // "request": { + // "$ref": "AllocateIdsRequest" + // }, + // "response": { + // "$ref": "AllocateIdsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/datastore", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} + +// method id "datastore.datasets.beginTransaction": + +type DatasetsBeginTransactionCall struct { + s *Service + datasetId string + begintransactionrequest *BeginTransactionRequest + opt_ map[string]interface{} +} + +// BeginTransaction: Begin a new transaction. +func (r *DatasetsService) BeginTransaction(datasetId string, begintransactionrequest *BeginTransactionRequest) *DatasetsBeginTransactionCall { + c := &DatasetsBeginTransactionCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + c.begintransactionrequest = begintransactionrequest + return c +} + +func (c *DatasetsBeginTransactionCall) Do() (*BeginTransactionResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.begintransactionrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/beginTransaction") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BeginTransactionResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Begin a new transaction.", + // "httpMethod": "POST", + // "id": "datastore.datasets.beginTransaction", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Identifies the dataset.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{datasetId}/beginTransaction", + // "request": { + // "$ref": "BeginTransactionRequest" + // }, + // "response": { + // "$ref": "BeginTransactionResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/datastore", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} + +// method id "datastore.datasets.commit": + +type DatasetsCommitCall struct { + s *Service + datasetId string + commitrequest *CommitRequest + opt_ map[string]interface{} +} + +// Commit: Commit a transaction, optionally creating, deleting or +// modifying some entities. +func (r *DatasetsService) Commit(datasetId string, commitrequest *CommitRequest) *DatasetsCommitCall { + c := &DatasetsCommitCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + c.commitrequest = commitrequest + return c +} + +func (c *DatasetsCommitCall) Do() (*CommitResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/commit") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommitResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Commit a transaction, optionally creating, deleting or modifying some entities.", + // "httpMethod": "POST", + // "id": "datastore.datasets.commit", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Identifies the dataset.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{datasetId}/commit", + // "request": { + // "$ref": "CommitRequest" + // }, + // "response": { + // "$ref": "CommitResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/datastore", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} + +// method id "datastore.datasets.lookup": + +type DatasetsLookupCall struct { + s *Service + datasetId string + lookuprequest *LookupRequest + opt_ map[string]interface{} +} + +// Lookup: Look up some entities by key. +func (r *DatasetsService) Lookup(datasetId string, lookuprequest *LookupRequest) *DatasetsLookupCall { + c := &DatasetsLookupCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + c.lookuprequest = lookuprequest + return c +} + +func (c *DatasetsLookupCall) Do() (*LookupResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.lookuprequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/lookup") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(LookupResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Look up some entities by key.", + // "httpMethod": "POST", + // "id": "datastore.datasets.lookup", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Identifies the dataset.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{datasetId}/lookup", + // "request": { + // "$ref": "LookupRequest" + // }, + // "response": { + // "$ref": "LookupResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/datastore", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} + +// method id "datastore.datasets.rollback": + +type DatasetsRollbackCall struct { + s *Service + datasetId string + rollbackrequest *RollbackRequest + opt_ map[string]interface{} +} + +// Rollback: Roll back a transaction. +func (r *DatasetsService) Rollback(datasetId string, rollbackrequest *RollbackRequest) *DatasetsRollbackCall { + c := &DatasetsRollbackCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + c.rollbackrequest = rollbackrequest + return c +} + +func (c *DatasetsRollbackCall) Do() (*RollbackResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/rollback") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RollbackResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Roll back a transaction.", + // "httpMethod": "POST", + // "id": "datastore.datasets.rollback", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Identifies the dataset.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{datasetId}/rollback", + // "request": { + // "$ref": "RollbackRequest" + // }, + // "response": { + // "$ref": "RollbackResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/datastore", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} + +// method id "datastore.datasets.runQuery": + +type DatasetsRunQueryCall struct { + s *Service + datasetId string + runqueryrequest *RunQueryRequest + opt_ map[string]interface{} +} + +// RunQuery: Query for entities. +func (r *DatasetsService) RunQuery(datasetId string, runqueryrequest *RunQueryRequest) *DatasetsRunQueryCall { + c := &DatasetsRunQueryCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + c.runqueryrequest = runqueryrequest + return c +} + +func (c *DatasetsRunQueryCall) Do() (*RunQueryResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.runqueryrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/runQuery") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{datasetId}", url.QueryEscape(c.datasetId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RunQueryResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Query for entities.", + // "httpMethod": "POST", + // "id": "datastore.datasets.runQuery", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "Identifies the dataset.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{datasetId}/runQuery", + // "request": { + // "$ref": "RunQueryRequest" + // }, + // "response": { + // "$ref": "RunQueryResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/datastore", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1.1/dfareporting-api.json b/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1.1/dfareporting-api.json new file mode 100644 index 0000000000000..26c52c1f2511b --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1.1/dfareporting-api.json @@ -0,0 +1,1520 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/YdK1I3o4ZOUVUrD_2k7BkdHqzyQ\"", + "discoveryVersion": "v1", + "id": "dfareporting:v1.1", + "name": "dfareporting", + "version": "v1.1", + "title": "DFA Reporting API", + "description": "Lets you create, run and download reports.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "http://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/doubleclick-advertisers/reporting/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/dfareporting/v1.1/", + "basePath": "/dfareporting/v1.1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "dfareporting/v1.1/", + "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/dfareporting": { + "description": "View and manage DoubleClick for Advertisers reports" + } + } + } + }, + "schemas": { + "Activities": { + "id": "Activities", + "type": "object", + "description": "Represents an activity group.", + "properties": { + "filters": { + "type": "array", + "description": "List of activity filters. The dimension values need to be all either of type \"dfa:activity\" or \"dfa:activityGroup\".", + "items": { + "$ref": "DimensionValue" + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#activities.", + "default": "dfareporting#activities" + }, + "metricNames": { + "type": "array", + "description": "List of names of floodlight activity metrics.", + "items": { + "type": "string" + } + } + } + }, + "CustomRichMediaEvents": { + "id": "CustomRichMediaEvents", + "type": "object", + "description": "Represents a Custom Rich Media Events group.", + "properties": { + "filteredEventIds": { + "type": "array", + "description": "List of custom rich media event IDs. Dimension values must be all of type dfa:richMediaEventTypeIdAndName.", + "items": { + "$ref": "DimensionValue" + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#customRichMediaEvents.", + "default": "dfareporting#customRichMediaEvents" + } + } + }, + "DateRange": { + "id": "DateRange", + "type": "object", + "description": "Represents a date range.", + "properties": { + "endDate": { + "type": "string", + "description": "The end date of the date range, inclusive. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#dateRange.", + "default": "dfareporting#dateRange" + }, + "relativeDateRange": { + "type": "string", + "description": "The date range relative to the date of when the report is run, one of: \n- \"TODAY\" \n- \"YESTERDAY\" \n- \"WEEK_TO_DATE\" \n- \"MONTH_TO_DATE\" \n- \"QUARTER_TO_DATE\" \n- \"YEAR_TO_DATE\" \n- \"PREVIOUS_WEEK\" \n- \"PREVIOUS_MONTH\" \n- \"PREVIOUS_QUARTER\" \n- \"PREVIOUS_YEAR\" \n- \"LAST_7_DAYS\" \n- \"LAST_30_DAYS\" \n- \"LAST_90_DAYS\" \n- \"LAST_365_DAYS\" \n- \"LAST_24_MONTHS\"" + }, + "startDate": { + "type": "string", + "description": "The start date of the date range, inclusive. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + } + } + }, + "DimensionFilter": { + "id": "DimensionFilter", + "type": "object", + "description": "Represents a dimension filter.", + "properties": { + "dimensionName": { + "type": "string", + "description": "The name of the dimension to filter." + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#dimensionFilter.", + "default": "dfareporting#dimensionFilter" + }, + "value": { + "type": "string", + "description": "The value of the dimension to filter." + } + } + }, + "DimensionValue": { + "id": "DimensionValue", + "type": "object", + "description": "Represents a DimensionValue resource.", + "properties": { + "dimensionName": { + "type": "string", + "description": "The name of the dimension." + }, + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID associated with the value if available." + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#dimensionValue.", + "default": "dfareporting#dimensionValue" + }, + "value": { + "type": "string", + "description": "The value of the dimension." + } + } + }, + "DimensionValueList": { + "id": "DimensionValueList", + "type": "object", + "description": "Represents the list of DimensionValue resources.", + "properties": { + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The dimension values returned in this response.", + "items": { + "$ref": "DimensionValue" + } + }, + "kind": { + "type": "string", + "description": "The kind of list this is, in this case dfareporting#dimensionValueList.", + "default": "dfareporting#dimensionValueList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through dimension values. To retrieve the next page of results, set the next request's \"pageToken\" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted." + } + } + }, + "DimensionValueRequest": { + "id": "DimensionValueRequest", + "type": "object", + "description": "Represents a DimensionValuesRequest.", + "properties": { + "dimensionName": { + "type": "string", + "description": "The name of the dimension for which values should be requested." + }, + "endDate": { + "type": "string", + "description": "The end date of the date range for which to retrieve dimension values. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + }, + "filters": { + "type": "array", + "description": "The list of filters by which to filter values. The filters are ANDed.", + "items": { + "$ref": "DimensionFilter" + } + }, + "kind": { + "type": "string", + "description": "The kind of request this is, in this case dfareporting#dimensionValueRequest.", + "default": "dfareporting#dimensionValueRequest" + }, + "startDate": { + "type": "string", + "description": "The start date of the date range for which to retrieve dimension values. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + } + } + }, + "File": { + "id": "File", + "type": "object", + "description": "Represents a File resource. A File contains the meta-data for a report run. It shows the status of the run and holds the urls to the generated report data if the run is finished and the status is \"REPORT_AVAILABLE\".", + "properties": { + "dateRange": { + "$ref": "DateRange", + "description": "The date range for which the file has report data. The date range will always be the absolute date range for which the report is run." + }, + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "fileName": { + "type": "string", + "description": "The file name of the file." + }, + "format": { + "type": "string", + "description": "The output format of the report. Only available once the file is available." + }, + "id": { + "type": "string", + "description": "The unique ID of this report file.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#file.", + "default": "dfareporting#file" + }, + "lastModifiedTime": { + "type": "string", + "description": "The timestamp in milliseconds since epoch when this file was last modified.", + "format": "int64" + }, + "reportId": { + "type": "string", + "description": "The ID of the report this file was generated from.", + "format": "int64" + }, + "status": { + "type": "string", + "description": "The status of the report file, one of: \n- \"PROCESSING\" \n- \"REPORT_AVAILABLE\" \n- \"FAILED\" \n- \"CANCELLED\"" + }, + "urls": { + "type": "object", + "description": "The urls where the completed report file can be downloaded.", + "properties": { + "apiUrl": { + "type": "string", + "description": "The url for downloading the report data through the API." + }, + "browserUrl": { + "type": "string", + "description": "The url for downloading the report data through a browser." + } + } + } + } + }, + "FileList": { + "id": "FileList", + "type": "object", + "description": "Represents the list of File resources.", + "properties": { + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The files returned in this response.", + "items": { + "$ref": "File" + } + }, + "kind": { + "type": "string", + "description": "The kind of list this is, in this case dfareporting#fileList.", + "default": "dfareporting#fileList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through files. To retrieve the next page of results, set the next request's \"pageToken\" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted." + } + } + }, + "Recipient": { + "id": "Recipient", + "type": "object", + "description": "Represents a recipient.", + "properties": { + "deliveryType": { + "type": "string", + "description": "The delivery type for the recipient, one of: \n- \"ATTACHMENT\" \n- \"LINK\"", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "email": { + "type": "string", + "description": "The email address of the recipient.", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#recipient.", + "default": "dfareporting#recipient" + } + } + }, + "Report": { + "id": "Report", + "type": "object", + "description": "Represents a Report resource.", + "properties": { + "accountId": { + "type": "string", + "description": "The account ID to which this report belongs.", + "format": "int64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "activeGrpCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"ACTIVE_GRP\".", + "properties": { + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.\nFilters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed.\nA valid active GRP report needs to have exactly one DimensionValue for the United States in addition to any advertiser or campaign dimension values.", + "items": { + "$ref": "DimensionValue" + } + }, + "dimensions": { + "type": "array", + "description": "The list of dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + } + } + }, + "criteria": { + "type": "object", + "description": "The report criteria for a report of type \"STANDARD\".", + "properties": { + "activities": { + "$ref": "Activities", + "description": "Activity group." + }, + "customRichMediaEvents": { + "$ref": "CustomRichMediaEvents", + "description": "Custom Rich Media Events group." + }, + "dateRange": { + "$ref": "DateRange", + "description": "The date range for which this report should be run." + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.\nFilters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed.", + "items": { + "$ref": "DimensionValue" + } + }, + "dimensions": { + "type": "array", + "description": "The list of standard dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + } + } + }, + "crossDimensionReachCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"CROSS_DIMENSION_REACH\".", + "properties": { + "breakdown": { + "type": "array", + "description": "The list of dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "dimension": { + "type": "string", + "description": "The dimension option, one of: \n- \"ADVERTISER\" \n- \"CAMPAIGN\" \n- \"SITE_BY_ADVERTISER\" \n- \"SITE_BY_CAMPAIGN\"" + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.", + "items": { + "$ref": "DimensionValue" + } + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + }, + "overlapMetricNames": { + "type": "array", + "description": "The list of names of overlap metrics the report should include.", + "items": { + "type": "string" + } + }, + "pivoted": { + "type": "boolean", + "description": "Whether the report is pivoted or not. Defaults to true." + } + } + }, + "delivery": { + "type": "object", + "description": "The report's email delivery settings.", + "properties": { + "emailOwner": { + "type": "boolean", + "description": "Whether the report should be emailed to the report owner." + }, + "emailOwnerDeliveryType": { + "type": "string", + "description": "The type of delivery for the owner to receive, if enabled. One of: \n- \"ATTACHMENT\" \n- \"LINK\"" + }, + "message": { + "type": "string", + "description": "The message to be sent with each email." + }, + "recipients": { + "type": "array", + "description": "The list of recipients to which to email the report.", + "items": { + "$ref": "Recipient" + } + } + } + }, + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "fileName": { + "type": "string", + "description": "The file name used when generating report files for this report." + }, + "floodlightCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"FLOODLIGHT\".", + "properties": { + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.\nFilters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed.", + "items": { + "$ref": "DimensionValue" + } + }, + "dimensions": { + "type": "array", + "description": "The list of dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "floodlightConfigId": { + "$ref": "DimensionValue", + "description": "The floodlight ID for which to show data in this report. All advertisers associated with that ID will automatically be added. The dimension of the value needs to be 'dfa:floodlightConfigId'." + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + }, + "reportProperties": { + "type": "object", + "description": "The properties of the report.", + "properties": { + "includeAttributedIPConversions": { + "type": "boolean", + "description": "Include conversions that have no cookie, but do have an exposure path." + }, + "includeUnattributedCookieConversions": { + "type": "boolean", + "description": "Include conversions of users with a DoubleClick cookie but without an exposure. That means the user did not click or see an ad from the advertiser within the Floodlight group, or that the interaction happened outside the lookback window." + }, + "includeUnattributedIPConversions": { + "type": "boolean", + "description": "Include conversions that have no associated cookies and no exposures. It’s therefore impossible to know how the user was exposed to your ads during the lookback window prior to a conversion." + } + } + } + } + }, + "format": { + "type": "string", + "description": "The output format of the report, one of: \n- \"CSV\" \n- \"EXCEL\" If not specified, default format is \"CSV\". Note that the actual format in the completed report file might differ if for instance the report's size exceeds the format's capabilities. \"CSV\" will then be the fallback format." + }, + "id": { + "type": "string", + "description": "The unique ID identifying this report resource.", + "format": "int64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#report.", + "default": "dfareporting#report" + }, + "lastModifiedTime": { + "type": "string", + "description": "The timestamp (in milliseconds since epoch) of when this report was last modified.", + "format": "uint64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "name": { + "type": "string", + "description": "The name of the report.", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "ownerProfileId": { + "type": "string", + "description": "The user profile id of the owner of this report.", + "format": "int64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "pathToConversionCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"PATH_TO_CONVERSION\".", + "properties": { + "activityFilters": { + "type": "array", + "description": "The list of 'dfa:activity' values to filter on.", + "items": { + "$ref": "DimensionValue" + } + }, + "conversionDimensions": { + "type": "array", + "description": "The list of conversion dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "customFloodlightVariables": { + "type": "array", + "description": "The list of custom floodlight variables the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "floodlightConfigId": { + "$ref": "DimensionValue", + "description": "The floodlight ID for which to show data in this report. All advertisers associated with that ID will automatically be added. The dimension of the value needs to be 'dfa:floodlightConfigId'." + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + }, + "perInteractionDimensions": { + "type": "array", + "description": "The list of per interaction dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "reportProperties": { + "type": "object", + "description": "The properties of the report.", + "properties": { + "clicksLookbackWindow": { + "type": "integer", + "description": "DFA checks to see if a click interaction occurred within the specified period of time before a conversion. By default the value is pulled from Floodlight or you can manually enter a custom value. Valid values: 1-90.", + "format": "int32" + }, + "impressionsLookbackWindow": { + "type": "integer", + "description": "DFA checks to see if an impression interaction occurred within the specified period of time before a conversion. By default the value is pulled from Floodlight or you can manually enter a custom value. Valid values: 1-90.", + "format": "int32" + }, + "includeAttributedIPConversions": { + "type": "boolean", + "description": "Include conversions that have no cookie, but do have an exposure path." + }, + "includeUnattributedCookieConversions": { + "type": "boolean", + "description": "Include conversions of users with a DoubleClick cookie but without an exposure. That means the user did not click or see an ad from the advertiser within the Floodlight group, or that the interaction happened outside the lookback window." + }, + "includeUnattributedIPConversions": { + "type": "boolean", + "description": "Include conversions that have no associated cookies and no exposures. It’s therefore impossible to know how the user was exposed to your ads during the lookback window prior to a conversion." + }, + "maximumClickInteractions": { + "type": "integer", + "description": "The maximum number of click interactions to include in the report. Advertisers currently paying for E2C reports get up to 200 (100 clicks, 100 impressions). If another advertiser in your network is paying for E2C, you can have up to 5 total exposures per report.", + "format": "int32" + }, + "maximumImpressionInteractions": { + "type": "integer", + "description": "The maximum number of click interactions to include in the report. Advertisers currently paying for E2C reports get up to 200 (100 clicks, 100 impressions). If another advertiser in your network is paying for E2C, you can have up to 5 total exposures per report.", + "format": "int32" + }, + "maximumInteractionGap": { + "type": "integer", + "description": "The maximum amount of time that can take place between interactions (clicks or impressions) by the same user. Valid values: 1-90.", + "format": "int32" + }, + "pivotOnInteractionPath": { + "type": "boolean", + "description": "Enable pivoting on interaction path." + } + } + } + } + }, + "reachCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"REACH\".", + "properties": { + "activities": { + "$ref": "Activities", + "description": "Activity group." + }, + "customRichMediaEvents": { + "$ref": "CustomRichMediaEvents", + "description": "Custom Rich Media Events group." + }, + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.\nFilters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed.", + "items": { + "$ref": "DimensionValue" + } + }, + "dimensions": { + "type": "array", + "description": "The list of dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + }, + "reachByFrequencyMetricNames": { + "type": "array", + "description": "The list of names of Reach By Frequency metrics the report should include.", + "items": { + "type": "string" + } + } + } + }, + "schedule": { + "type": "object", + "description": "The report's schedule. Can only be set if the report's 'dateRange' is a relative date range and the relative date range is not \"TODAY\".", + "properties": { + "active": { + "type": "boolean", + "description": "Whether the schedule is active or not. Must be set to either true or false.", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "every": { + "type": "integer", + "description": "Defines every how many days, weeks or months the report should be run. Needs to be set when \"repeats\" is either \"DAILY\", \"WEEKLY\" or \"MONTHLY\".", + "format": "int32" + }, + "expirationDate": { + "type": "string", + "description": "The expiration date when the scheduled report stops running.", + "format": "date", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "repeats": { + "type": "string", + "description": "The interval for which the report is repeated, one of: \n- \"DAILY\", also requires field \"every\" to be set. \n- \"WEEKLY\", also requires fields \"every\" and \"repeatsOnWeekDays\" to be set. \n- \"TWICE_A_MONTH\" \n- \"MONTHLY\", also requires fields \"every\" and \"runsOnDayOfMonth\" to be set. \n- \"QUARTERLY\" \n- \"YEARLY\"", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "repeatsOnWeekDays": { + "type": "array", + "description": "List of week days \"WEEKLY\" on which scheduled reports should run.", + "items": { + "type": "string" + } + }, + "runsOnDayOfMonth": { + "type": "string", + "description": "Enum to define for \"MONTHLY\" scheduled reports whether reports should be repeated on the same day of the month as \"startDate\" or the same day of the week of the month. Possible values are: \n- DAY_OF_MONTH \n- WEEK_OF_MONTH \nExample: If 'startDate' is Monday, April 2nd 2012 (2012-04-02), \"DAY_OF_MONTH\" would run subsequent reports on the 2nd of every Month, and \"WEEK_OF_MONTH\" would run subsequent reports on the first Monday of the month." + }, + "startDate": { + "type": "string", + "description": "Start date of date range for which scheduled reports should be run.", + "format": "date", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + } + } + }, + "subAccountId": { + "type": "string", + "description": "The subbaccount ID to which this report belongs if applicable.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "The type of the report, one of: \n- STANDARD \n- REACH \n- ACTIVE_GRP \n- PATH_TO_CONVERSION \n- FLOODLIGHT \n- CROSS_DIMENSION_REACH", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + } + } + }, + "ReportList": { + "id": "ReportList", + "type": "object", + "description": "Represents the list of reports.", + "properties": { + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The reports returned in this response.", + "items": { + "$ref": "Report" + } + }, + "kind": { + "type": "string", + "description": "The kind of list this is, in this case dfareporting#reportList.", + "default": "dfareporting#reportList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through reports. To retrieve the next page of results, set the next request's \"pageToken\" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted." + } + } + }, + "SortedDimension": { + "id": "SortedDimension", + "type": "object", + "description": "Represents a sorted dimension.", + "properties": { + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#sortedDimension.", + "default": "dfareporting#sortedDimension" + }, + "name": { + "type": "string", + "description": "The name of the dimension." + }, + "sortOrder": { + "type": "string", + "description": "An optional sort order for the dimension column, one of: \n- \"ASCENDING\" \n- \"DESCENDING\"" + } + } + }, + "UserProfile": { + "id": "UserProfile", + "type": "object", + "description": "Represents a UserProfile resource.", + "properties": { + "accountId": { + "type": "string", + "description": "The account ID to which this profile belongs.", + "format": "int64" + }, + "accountName": { + "type": "string", + "description": "The account name this profile belongs to." + }, + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#userProfile.", + "default": "dfareporting#userProfile" + }, + "profileId": { + "type": "string", + "description": "The unique ID of the user profile.", + "format": "int64" + }, + "subAccountId": { + "type": "string", + "description": "The sub account ID this profile belongs to if applicable.", + "format": "int64" + }, + "subAccountName": { + "type": "string", + "description": "The sub account name this profile belongs to if applicable." + }, + "userName": { + "type": "string", + "description": "The user name." + } + } + }, + "UserProfileList": { + "id": "UserProfileList", + "type": "object", + "description": "Represents the list of user profiles.", + "properties": { + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The user profiles returned in this response.", + "items": { + "$ref": "UserProfile" + } + }, + "kind": { + "type": "string", + "description": "The kind of list this is, in this case dfareporting#userProfileList.", + "default": "dfareporting#userProfileList" + } + } + } + }, + "resources": { + "dimensionValues": { + "methods": { + "query": { + "id": "dfareporting.dimensionValues.query", + "path": "userprofiles/{profileId}/dimensionvalues/query", + "httpMethod": "POST", + "description": "Retrieves list of report dimension values for a list of filters.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "DimensionValueRequest" + }, + "response": { + "$ref": "DimensionValueList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + }, + "files": { + "methods": { + "list": { + "id": "dfareporting.files.list", + "path": "userprofiles/{profileId}/files", + "httpMethod": "GET", + "description": "Lists files for a user profile.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "minimum": "0", + "maximum": "10", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortField": { + "type": "string", + "description": "The field by which to sort the list.", + "default": "LAST_MODIFIED_TIME", + "enum": [ + "ID", + "LAST_MODIFIED_TIME" + ], + "enumDescriptions": [ + "Sort by file ID.", + "Sort by 'lastmodifiedAt' field." + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is 'DESCENDING'.", + "default": "DESCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FileList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + }, + "reports": { + "methods": { + "delete": { + "id": "dfareporting.reports.delete", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "DELETE", + "description": "Deletes a report by its ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "get": { + "id": "dfareporting.reports.get", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "GET", + "description": "Retrieves a report by its ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "insert": { + "id": "dfareporting.reports.insert", + "path": "userprofiles/{profileId}/reports", + "httpMethod": "POST", + "description": "Creates a report.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Report" + }, + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "list": { + "id": "dfareporting.reports.list", + "path": "userprofiles/{profileId}/reports", + "httpMethod": "GET", + "description": "Retrieves list of reports.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "minimum": "0", + "maximum": "10", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortField": { + "type": "string", + "description": "The field by which to sort the list.", + "default": "LAST_MODIFIED_TIME", + "enum": [ + "ID", + "LAST_MODIFIED_TIME", + "NAME" + ], + "enumDescriptions": [ + "Sort by report ID.", + "Sort by 'lastModifiedTime' field.", + "Sort by name of reports." + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is 'DESCENDING'.", + "default": "DESCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ReportList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "patch": { + "id": "dfareporting.reports.patch", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "PATCH", + "description": "Updates a report. This method supports patch semantics.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "request": { + "$ref": "Report" + }, + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "run": { + "id": "dfareporting.reports.run", + "path": "userprofiles/{profileId}/reports/{reportId}/run", + "httpMethod": "POST", + "description": "Runs a report.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + }, + "synchronous": { + "type": "boolean", + "description": "If set and true, tries to run the report synchronously.", + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "update": { + "id": "dfareporting.reports.update", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "PUT", + "description": "Updates a report.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "request": { + "$ref": "Report" + }, + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + }, + "resources": { + "files": { + "methods": { + "get": { + "id": "dfareporting.reports.files.get", + "path": "userprofiles/{profileId}/reports/{reportId}/files/{fileId}", + "httpMethod": "GET", + "description": "Retrieves a report file.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the report file.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "The DFA profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId", + "fileId" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "list": { + "id": "dfareporting.reports.files.list", + "path": "userprofiles/{profileId}/reports/{reportId}/files", + "httpMethod": "GET", + "description": "Lists files for a report.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "minimum": "0", + "maximum": "10", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the parent report.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortField": { + "type": "string", + "description": "The field by which to sort the list.", + "default": "LAST_MODIFIED_TIME", + "enum": [ + "ID", + "LAST_MODIFIED_TIME" + ], + "enumDescriptions": [ + "Sort by file ID.", + "Sort by 'lastmodifiedAt' field." + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is 'DESCENDING'.", + "default": "DESCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "response": { + "$ref": "FileList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + } + } + }, + "userProfiles": { + "methods": { + "get": { + "id": "dfareporting.userProfiles.get", + "path": "userprofiles/{profileId}", + "httpMethod": "GET", + "description": "Gets one user profile by ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "The user profile ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "UserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "list": { + "id": "dfareporting.userProfiles.list", + "path": "userprofiles", + "httpMethod": "GET", + "description": "Retrieves list of user profiles for a user.", + "response": { + "$ref": "UserProfileList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1.1/dfareporting-gen.go b/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1.1/dfareporting-gen.go new file mode 100644 index 0000000000000..4caccdea8cbdc --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1.1/dfareporting-gen.go @@ -0,0 +1,2031 @@ +// Package dfareporting provides access to the DFA Reporting API. +// +// See https://developers.google.com/doubleclick-advertisers/reporting/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/dfareporting/v1.1" +// ... +// dfareportingService, err := dfareporting.New(oauthHttpClient) +package dfareporting + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "dfareporting:v1.1" +const apiName = "dfareporting" +const apiVersion = "v1.1" +const basePath = "https://www.googleapis.com/dfareporting/v1.1/" + +// OAuth2 scopes used by this API. +const ( + // View and manage DoubleClick for Advertisers reports + DfareportingScope = "https://www.googleapis.com/auth/dfareporting" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.DimensionValues = NewDimensionValuesService(s) + s.Files = NewFilesService(s) + s.Reports = NewReportsService(s) + s.UserProfiles = NewUserProfilesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + DimensionValues *DimensionValuesService + + Files *FilesService + + Reports *ReportsService + + UserProfiles *UserProfilesService +} + +func NewDimensionValuesService(s *Service) *DimensionValuesService { + rs := &DimensionValuesService{s: s} + return rs +} + +type DimensionValuesService struct { + s *Service +} + +func NewFilesService(s *Service) *FilesService { + rs := &FilesService{s: s} + return rs +} + +type FilesService struct { + s *Service +} + +func NewReportsService(s *Service) *ReportsService { + rs := &ReportsService{s: s} + rs.Files = NewReportsFilesService(s) + return rs +} + +type ReportsService struct { + s *Service + + Files *ReportsFilesService +} + +func NewReportsFilesService(s *Service) *ReportsFilesService { + rs := &ReportsFilesService{s: s} + return rs +} + +type ReportsFilesService struct { + s *Service +} + +func NewUserProfilesService(s *Service) *UserProfilesService { + rs := &UserProfilesService{s: s} + return rs +} + +type UserProfilesService struct { + s *Service +} + +type Activities struct { + // Filters: List of activity filters. The dimension values need to be + // all either of type "dfa:activity" or "dfa:activityGroup". + Filters []*DimensionValue `json:"filters,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#activities. + Kind string `json:"kind,omitempty"` + + // MetricNames: List of names of floodlight activity metrics. + MetricNames []string `json:"metricNames,omitempty"` +} + +type CustomRichMediaEvents struct { + // FilteredEventIds: List of custom rich media event IDs. Dimension + // values must be all of type dfa:richMediaEventTypeIdAndName. + FilteredEventIds []*DimensionValue `json:"filteredEventIds,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#customRichMediaEvents. + Kind string `json:"kind,omitempty"` +} + +type DateRange struct { + // EndDate: The end date of the date range, inclusive. A string of the + // format: "yyyy-MM-dd". + EndDate string `json:"endDate,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#dateRange. + Kind string `json:"kind,omitempty"` + + // RelativeDateRange: The date range relative to the date of when the + // report is run, one of: + // - "TODAY" + // - "YESTERDAY" + // - "WEEK_TO_DATE" + // + // - "MONTH_TO_DATE" + // - "QUARTER_TO_DATE" + // - "YEAR_TO_DATE" + // - + // "PREVIOUS_WEEK" + // - "PREVIOUS_MONTH" + // - "PREVIOUS_QUARTER" + // - + // "PREVIOUS_YEAR" + // - "LAST_7_DAYS" + // - "LAST_30_DAYS" + // - "LAST_90_DAYS" + // + // - "LAST_365_DAYS" + // - "LAST_24_MONTHS" + RelativeDateRange string `json:"relativeDateRange,omitempty"` + + // StartDate: The start date of the date range, inclusive. A string of + // the format: "yyyy-MM-dd". + StartDate string `json:"startDate,omitempty"` +} + +type DimensionFilter struct { + // DimensionName: The name of the dimension to filter. + DimensionName string `json:"dimensionName,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#dimensionFilter. + Kind string `json:"kind,omitempty"` + + // Value: The value of the dimension to filter. + Value string `json:"value,omitempty"` +} + +type DimensionValue struct { + // DimensionName: The name of the dimension. + DimensionName string `json:"dimensionName,omitempty"` + + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Id: The ID associated with the value if available. + Id string `json:"id,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#dimensionValue. + Kind string `json:"kind,omitempty"` + + // Value: The value of the dimension. + Value string `json:"value,omitempty"` +} + +type DimensionValueList struct { + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The dimension values returned in this response. + Items []*DimensionValue `json:"items,omitempty"` + + // Kind: The kind of list this is, in this case + // dfareporting#dimensionValueList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through dimension + // values. To retrieve the next page of results, set the next request's + // "pageToken" to the value of this field. The page token is only valid + // for a limited amount of time and should not be persisted. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type DimensionValueRequest struct { + // DimensionName: The name of the dimension for which values should be + // requested. + DimensionName string `json:"dimensionName,omitempty"` + + // EndDate: The end date of the date range for which to retrieve + // dimension values. A string of the format: "yyyy-MM-dd". + EndDate string `json:"endDate,omitempty"` + + // Filters: The list of filters by which to filter values. The filters + // are ANDed. + Filters []*DimensionFilter `json:"filters,omitempty"` + + // Kind: The kind of request this is, in this case + // dfareporting#dimensionValueRequest. + Kind string `json:"kind,omitempty"` + + // StartDate: The start date of the date range for which to retrieve + // dimension values. A string of the format: "yyyy-MM-dd". + StartDate string `json:"startDate,omitempty"` +} + +type File struct { + // DateRange: The date range for which the file has report data. The + // date range will always be the absolute date range for which the + // report is run. + DateRange *DateRange `json:"dateRange,omitempty"` + + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // FileName: The file name of the file. + FileName string `json:"fileName,omitempty"` + + // Format: The output format of the report. Only available once the file + // is available. + Format string `json:"format,omitempty"` + + // Id: The unique ID of this report file. + Id int64 `json:"id,omitempty,string"` + + // Kind: The kind of resource this is, in this case dfareporting#file. + Kind string `json:"kind,omitempty"` + + // LastModifiedTime: The timestamp in milliseconds since epoch when this + // file was last modified. + LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"` + + // ReportId: The ID of the report this file was generated from. + ReportId int64 `json:"reportId,omitempty,string"` + + // Status: The status of the report file, one of: + // - "PROCESSING" + // - + // "REPORT_AVAILABLE" + // - "FAILED" + // - "CANCELLED" + Status string `json:"status,omitempty"` + + // Urls: The urls where the completed report file can be downloaded. + Urls *FileUrls `json:"urls,omitempty"` +} + +type FileUrls struct { + // ApiUrl: The url for downloading the report data through the API. + ApiUrl string `json:"apiUrl,omitempty"` + + // BrowserUrl: The url for downloading the report data through a + // browser. + BrowserUrl string `json:"browserUrl,omitempty"` +} + +type FileList struct { + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The files returned in this response. + Items []*File `json:"items,omitempty"` + + // Kind: The kind of list this is, in this case dfareporting#fileList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through files. To + // retrieve the next page of results, set the next request's "pageToken" + // to the value of this field. The page token is only valid for a + // limited amount of time and should not be persisted. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Recipient struct { + // DeliveryType: The delivery type for the recipient, one of: + // - + // "ATTACHMENT" + // - "LINK" + DeliveryType string `json:"deliveryType,omitempty"` + + // Email: The email address of the recipient. + Email string `json:"email,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#recipient. + Kind string `json:"kind,omitempty"` +} + +type Report struct { + // AccountId: The account ID to which this report belongs. + AccountId int64 `json:"accountId,omitempty,string"` + + // ActiveGrpCriteria: The report criteria for a report of type + // "ACTIVE_GRP". + ActiveGrpCriteria *ReportActiveGrpCriteria `json:"activeGrpCriteria,omitempty"` + + // Criteria: The report criteria for a report of type "STANDARD". + Criteria *ReportCriteria `json:"criteria,omitempty"` + + // CrossDimensionReachCriteria: The report criteria for a report of type + // "CROSS_DIMENSION_REACH". + CrossDimensionReachCriteria *ReportCrossDimensionReachCriteria `json:"crossDimensionReachCriteria,omitempty"` + + // Delivery: The report's email delivery settings. + Delivery *ReportDelivery `json:"delivery,omitempty"` + + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // FileName: The file name used when generating report files for this + // report. + FileName string `json:"fileName,omitempty"` + + // FloodlightCriteria: The report criteria for a report of type + // "FLOODLIGHT". + FloodlightCriteria *ReportFloodlightCriteria `json:"floodlightCriteria,omitempty"` + + // Format: The output format of the report, one of: + // - "CSV" + // - "EXCEL" + // If not specified, default format is "CSV". Note that the actual + // format in the completed report file might differ if for instance the + // report's size exceeds the format's capabilities. "CSV" will then be + // the fallback format. + Format string `json:"format,omitempty"` + + // Id: The unique ID identifying this report resource. + Id int64 `json:"id,omitempty,string"` + + // Kind: The kind of resource this is, in this case dfareporting#report. + Kind string `json:"kind,omitempty"` + + // LastModifiedTime: The timestamp (in milliseconds since epoch) of when + // this report was last modified. + LastModifiedTime uint64 `json:"lastModifiedTime,omitempty,string"` + + // Name: The name of the report. + Name string `json:"name,omitempty"` + + // OwnerProfileId: The user profile id of the owner of this report. + OwnerProfileId int64 `json:"ownerProfileId,omitempty,string"` + + // PathToConversionCriteria: The report criteria for a report of type + // "PATH_TO_CONVERSION". + PathToConversionCriteria *ReportPathToConversionCriteria `json:"pathToConversionCriteria,omitempty"` + + // ReachCriteria: The report criteria for a report of type "REACH". + ReachCriteria *ReportReachCriteria `json:"reachCriteria,omitempty"` + + // Schedule: The report's schedule. Can only be set if the report's + // 'dateRange' is a relative date range and the relative date range is + // not "TODAY". + Schedule *ReportSchedule `json:"schedule,omitempty"` + + // SubAccountId: The subbaccount ID to which this report belongs if + // applicable. + SubAccountId int64 `json:"subAccountId,omitempty,string"` + + // Type: The type of the report, one of: + // - STANDARD + // - REACH + // - + // ACTIVE_GRP + // - PATH_TO_CONVERSION + // - FLOODLIGHT + // - + // CROSS_DIMENSION_REACH + Type string `json:"type,omitempty"` +} + +type ReportActiveGrpCriteria struct { + // DateRange: The date range this report should be run for. + DateRange *DateRange `json:"dateRange,omitempty"` + + // DimensionFilters: The list of filters on which dimensions are + // filtered. + // Filters for different dimensions are ANDed, filters for the + // same dimension are grouped together and ORed. + // A valid active GRP + // report needs to have exactly one DimensionValue for the United States + // in addition to any advertiser or campaign dimension values. + DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"` + + // Dimensions: The list of dimensions the report should include. + Dimensions []*SortedDimension `json:"dimensions,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` +} + +type ReportCriteria struct { + // Activities: Activity group. + Activities *Activities `json:"activities,omitempty"` + + // CustomRichMediaEvents: Custom Rich Media Events group. + CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"` + + // DateRange: The date range for which this report should be run. + DateRange *DateRange `json:"dateRange,omitempty"` + + // DimensionFilters: The list of filters on which dimensions are + // filtered. + // Filters for different dimensions are ANDed, filters for the + // same dimension are grouped together and ORed. + DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"` + + // Dimensions: The list of standard dimensions the report should + // include. + Dimensions []*SortedDimension `json:"dimensions,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` +} + +type ReportCrossDimensionReachCriteria struct { + // Breakdown: The list of dimensions the report should include. + Breakdown []*SortedDimension `json:"breakdown,omitempty"` + + // DateRange: The date range this report should be run for. + DateRange *DateRange `json:"dateRange,omitempty"` + + // Dimension: The dimension option, one of: + // - "ADVERTISER" + // - + // "CAMPAIGN" + // - "SITE_BY_ADVERTISER" + // - "SITE_BY_CAMPAIGN" + Dimension string `json:"dimension,omitempty"` + + // DimensionFilters: The list of filters on which dimensions are + // filtered. + DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` + + // OverlapMetricNames: The list of names of overlap metrics the report + // should include. + OverlapMetricNames []string `json:"overlapMetricNames,omitempty"` + + // Pivoted: Whether the report is pivoted or not. Defaults to true. + Pivoted bool `json:"pivoted,omitempty"` +} + +type ReportDelivery struct { + // EmailOwner: Whether the report should be emailed to the report owner. + EmailOwner bool `json:"emailOwner,omitempty"` + + // EmailOwnerDeliveryType: The type of delivery for the owner to + // receive, if enabled. One of: + // - "ATTACHMENT" + // - "LINK" + EmailOwnerDeliveryType string `json:"emailOwnerDeliveryType,omitempty"` + + // Message: The message to be sent with each email. + Message string `json:"message,omitempty"` + + // Recipients: The list of recipients to which to email the report. + Recipients []*Recipient `json:"recipients,omitempty"` +} + +type ReportFloodlightCriteria struct { + // DateRange: The date range this report should be run for. + DateRange *DateRange `json:"dateRange,omitempty"` + + // DimensionFilters: The list of filters on which dimensions are + // filtered. + // Filters for different dimensions are ANDed, filters for the + // same dimension are grouped together and ORed. + DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"` + + // Dimensions: The list of dimensions the report should include. + Dimensions []*SortedDimension `json:"dimensions,omitempty"` + + // FloodlightConfigId: The floodlight ID for which to show data in this + // report. All advertisers associated with that ID will automatically be + // added. The dimension of the value needs to be + // 'dfa:floodlightConfigId'. + FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` + + // ReportProperties: The properties of the report. + ReportProperties *ReportFloodlightCriteriaReportProperties `json:"reportProperties,omitempty"` +} + +type ReportFloodlightCriteriaReportProperties struct { + // IncludeAttributedIPConversions: Include conversions that have no + // cookie, but do have an exposure path. + IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"` + + // IncludeUnattributedCookieConversions: Include conversions of users + // with a DoubleClick cookie but without an exposure. That means the + // user did not click or see an ad from the advertiser within the + // Floodlight group, or that the interaction happened outside the + // lookback window. + IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"` + + // IncludeUnattributedIPConversions: Include conversions that have no + // associated cookies and no exposures. It’s therefore impossible to + // know how the user was exposed to your ads during the lookback window + // prior to a conversion. + IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"` +} + +type ReportPathToConversionCriteria struct { + // ActivityFilters: The list of 'dfa:activity' values to filter on. + ActivityFilters []*DimensionValue `json:"activityFilters,omitempty"` + + // ConversionDimensions: The list of conversion dimensions the report + // should include. + ConversionDimensions []*SortedDimension `json:"conversionDimensions,omitempty"` + + // CustomFloodlightVariables: The list of custom floodlight variables + // the report should include. + CustomFloodlightVariables []*SortedDimension `json:"customFloodlightVariables,omitempty"` + + // DateRange: The date range this report should be run for. + DateRange *DateRange `json:"dateRange,omitempty"` + + // FloodlightConfigId: The floodlight ID for which to show data in this + // report. All advertisers associated with that ID will automatically be + // added. The dimension of the value needs to be + // 'dfa:floodlightConfigId'. + FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` + + // PerInteractionDimensions: The list of per interaction dimensions the + // report should include. + PerInteractionDimensions []*SortedDimension `json:"perInteractionDimensions,omitempty"` + + // ReportProperties: The properties of the report. + ReportProperties *ReportPathToConversionCriteriaReportProperties `json:"reportProperties,omitempty"` +} + +type ReportPathToConversionCriteriaReportProperties struct { + // ClicksLookbackWindow: DFA checks to see if a click interaction + // occurred within the specified period of time before a conversion. By + // default the value is pulled from Floodlight or you can manually enter + // a custom value. Valid values: 1-90. + ClicksLookbackWindow int64 `json:"clicksLookbackWindow,omitempty"` + + // ImpressionsLookbackWindow: DFA checks to see if an impression + // interaction occurred within the specified period of time before a + // conversion. By default the value is pulled from Floodlight or you can + // manually enter a custom value. Valid values: 1-90. + ImpressionsLookbackWindow int64 `json:"impressionsLookbackWindow,omitempty"` + + // IncludeAttributedIPConversions: Include conversions that have no + // cookie, but do have an exposure path. + IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"` + + // IncludeUnattributedCookieConversions: Include conversions of users + // with a DoubleClick cookie but without an exposure. That means the + // user did not click or see an ad from the advertiser within the + // Floodlight group, or that the interaction happened outside the + // lookback window. + IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"` + + // IncludeUnattributedIPConversions: Include conversions that have no + // associated cookies and no exposures. It’s therefore impossible to + // know how the user was exposed to your ads during the lookback window + // prior to a conversion. + IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"` + + // MaximumClickInteractions: The maximum number of click interactions to + // include in the report. Advertisers currently paying for E2C reports + // get up to 200 (100 clicks, 100 impressions). If another advertiser in + // your network is paying for E2C, you can have up to 5 total exposures + // per report. + MaximumClickInteractions int64 `json:"maximumClickInteractions,omitempty"` + + // MaximumImpressionInteractions: The maximum number of click + // interactions to include in the report. Advertisers currently paying + // for E2C reports get up to 200 (100 clicks, 100 impressions). If + // another advertiser in your network is paying for E2C, you can have up + // to 5 total exposures per report. + MaximumImpressionInteractions int64 `json:"maximumImpressionInteractions,omitempty"` + + // MaximumInteractionGap: The maximum amount of time that can take place + // between interactions (clicks or impressions) by the same user. Valid + // values: 1-90. + MaximumInteractionGap int64 `json:"maximumInteractionGap,omitempty"` + + // PivotOnInteractionPath: Enable pivoting on interaction path. + PivotOnInteractionPath bool `json:"pivotOnInteractionPath,omitempty"` +} + +type ReportReachCriteria struct { + // Activities: Activity group. + Activities *Activities `json:"activities,omitempty"` + + // CustomRichMediaEvents: Custom Rich Media Events group. + CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"` + + // DateRange: The date range this report should be run for. + DateRange *DateRange `json:"dateRange,omitempty"` + + // DimensionFilters: The list of filters on which dimensions are + // filtered. + // Filters for different dimensions are ANDed, filters for the + // same dimension are grouped together and ORed. + DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"` + + // Dimensions: The list of dimensions the report should include. + Dimensions []*SortedDimension `json:"dimensions,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` + + // ReachByFrequencyMetricNames: The list of names of Reach By Frequency + // metrics the report should include. + ReachByFrequencyMetricNames []string `json:"reachByFrequencyMetricNames,omitempty"` +} + +type ReportSchedule struct { + // Active: Whether the schedule is active or not. Must be set to either + // true or false. + Active bool `json:"active,omitempty"` + + // Every: Defines every how many days, weeks or months the report should + // be run. Needs to be set when "repeats" is either "DAILY", "WEEKLY" or + // "MONTHLY". + Every int64 `json:"every,omitempty"` + + // ExpirationDate: The expiration date when the scheduled report stops + // running. + ExpirationDate string `json:"expirationDate,omitempty"` + + // Repeats: The interval for which the report is repeated, one of: + // - + // "DAILY", also requires field "every" to be set. + // - "WEEKLY", also + // requires fields "every" and "repeatsOnWeekDays" to be set. + // - + // "TWICE_A_MONTH" + // - "MONTHLY", also requires fields "every" and + // "runsOnDayOfMonth" to be set. + // - "QUARTERLY" + // - "YEARLY" + Repeats string `json:"repeats,omitempty"` + + // RepeatsOnWeekDays: List of week days "WEEKLY" on which scheduled + // reports should run. + RepeatsOnWeekDays []string `json:"repeatsOnWeekDays,omitempty"` + + // RunsOnDayOfMonth: Enum to define for "MONTHLY" scheduled reports + // whether reports should be repeated on the same day of the month as + // "startDate" or the same day of the week of the month. Possible values + // are: + // - DAY_OF_MONTH + // - WEEK_OF_MONTH + // Example: If 'startDate' is + // Monday, April 2nd 2012 (2012-04-02), "DAY_OF_MONTH" would run + // subsequent reports on the 2nd of every Month, and "WEEK_OF_MONTH" + // would run subsequent reports on the first Monday of the month. + RunsOnDayOfMonth string `json:"runsOnDayOfMonth,omitempty"` + + // StartDate: Start date of date range for which scheduled reports + // should be run. + StartDate string `json:"startDate,omitempty"` +} + +type ReportList struct { + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The reports returned in this response. + Items []*Report `json:"items,omitempty"` + + // Kind: The kind of list this is, in this case dfareporting#reportList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through reports. To + // retrieve the next page of results, set the next request's "pageToken" + // to the value of this field. The page token is only valid for a + // limited amount of time and should not be persisted. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type SortedDimension struct { + // Kind: The kind of resource this is, in this case + // dfareporting#sortedDimension. + Kind string `json:"kind,omitempty"` + + // Name: The name of the dimension. + Name string `json:"name,omitempty"` + + // SortOrder: An optional sort order for the dimension column, one of: + // + // - "ASCENDING" + // - "DESCENDING" + SortOrder string `json:"sortOrder,omitempty"` +} + +type UserProfile struct { + // AccountId: The account ID to which this profile belongs. + AccountId int64 `json:"accountId,omitempty,string"` + + // AccountName: The account name this profile belongs to. + AccountName string `json:"accountName,omitempty"` + + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#userProfile. + Kind string `json:"kind,omitempty"` + + // ProfileId: The unique ID of the user profile. + ProfileId int64 `json:"profileId,omitempty,string"` + + // SubAccountId: The sub account ID this profile belongs to if + // applicable. + SubAccountId int64 `json:"subAccountId,omitempty,string"` + + // SubAccountName: The sub account name this profile belongs to if + // applicable. + SubAccountName string `json:"subAccountName,omitempty"` + + // UserName: The user name. + UserName string `json:"userName,omitempty"` +} + +type UserProfileList struct { + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The user profiles returned in this response. + Items []*UserProfile `json:"items,omitempty"` + + // Kind: The kind of list this is, in this case + // dfareporting#userProfileList. + Kind string `json:"kind,omitempty"` +} + +// method id "dfareporting.dimensionValues.query": + +type DimensionValuesQueryCall struct { + s *Service + profileId int64 + dimensionvaluerequest *DimensionValueRequest + opt_ map[string]interface{} +} + +// Query: Retrieves list of report dimension values for a list of +// filters. +func (r *DimensionValuesService) Query(profileId int64, dimensionvaluerequest *DimensionValueRequest) *DimensionValuesQueryCall { + c := &DimensionValuesQueryCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.dimensionvaluerequest = dimensionvaluerequest + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *DimensionValuesQueryCall) MaxResults(maxResults int64) *DimensionValuesQueryCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous result page. +func (c *DimensionValuesQueryCall) PageToken(pageToken string) *DimensionValuesQueryCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *DimensionValuesQueryCall) Do() (*DimensionValueList, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.dimensionvaluerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DimensionValueList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves list of report dimension values for a list of filters.", + // "httpMethod": "POST", + // "id": "dfareporting.dimensionValues.query", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/dimensionvalues/query", + // "request": { + // "$ref": "DimensionValueRequest" + // }, + // "response": { + // "$ref": "DimensionValueList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.files.list": + +type FilesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} +} + +// List: Lists files for a user profile. +func (r *FilesService) List(profileId int64) *FilesListCall { + c := &FilesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *FilesListCall) MaxResults(maxResults int64) *FilesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous result page. +func (c *FilesListCall) PageToken(pageToken string) *FilesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortField sets the optional parameter "sortField": The field by which +// to sort the list. +func (c *FilesListCall) SortField(sortField string) *FilesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is 'DESCENDING'. +func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *FilesListCall) Do() (*FileList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortField"]; ok { + params.Set("sortField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(FileList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists files for a user profile.", + // "httpMethod": "GET", + // "id": "dfareporting.files.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "maximum": "10", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sortField": { + // "default": "LAST_MODIFIED_TIME", + // "description": "The field by which to sort the list.", + // "enum": [ + // "ID", + // "LAST_MODIFIED_TIME" + // ], + // "enumDescriptions": [ + // "Sort by file ID.", + // "Sort by 'lastmodifiedAt' field." + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "default": "DESCENDING", + // "description": "Order of sorted results, default is 'DESCENDING'.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "Ascending order.", + // "Descending order." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/files", + // "response": { + // "$ref": "FileList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.delete": + +type ReportsDeleteCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} +} + +// Delete: Deletes a report by its ID. +func (r *ReportsService) Delete(profileId int64, reportId int64) *ReportsDeleteCall { + c := &ReportsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + return c +} + +func (c *ReportsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a report by its ID.", + // "httpMethod": "DELETE", + // "id": "dfareporting.reports.delete", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.get": + +type ReportsGetCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} +} + +// Get: Retrieves a report by its ID. +func (r *ReportsService) Get(profileId int64, reportId int64) *ReportsGetCall { + c := &ReportsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + return c +} + +func (c *ReportsGetCall) Do() (*Report, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a report by its ID.", + // "httpMethod": "GET", + // "id": "dfareporting.reports.get", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}", + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.insert": + +type ReportsInsertCall struct { + s *Service + profileId int64 + report *Report + opt_ map[string]interface{} +} + +// Insert: Creates a report. +func (r *ReportsService) Insert(profileId int64, report *Report) *ReportsInsertCall { + c := &ReportsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.report = report + return c +} + +func (c *ReportsInsertCall) Do() (*Report, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a report.", + // "httpMethod": "POST", + // "id": "dfareporting.reports.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports", + // "request": { + // "$ref": "Report" + // }, + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.list": + +type ReportsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} +} + +// List: Retrieves list of reports. +func (r *ReportsService) List(profileId int64) *ReportsListCall { + c := &ReportsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *ReportsListCall) MaxResults(maxResults int64) *ReportsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous result page. +func (c *ReportsListCall) PageToken(pageToken string) *ReportsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortField sets the optional parameter "sortField": The field by which +// to sort the list. +func (c *ReportsListCall) SortField(sortField string) *ReportsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is 'DESCENDING'. +func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *ReportsListCall) Do() (*ReportList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortField"]; ok { + params.Set("sortField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ReportList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves list of reports.", + // "httpMethod": "GET", + // "id": "dfareporting.reports.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "maximum": "10", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sortField": { + // "default": "LAST_MODIFIED_TIME", + // "description": "The field by which to sort the list.", + // "enum": [ + // "ID", + // "LAST_MODIFIED_TIME", + // "NAME" + // ], + // "enumDescriptions": [ + // "Sort by report ID.", + // "Sort by 'lastModifiedTime' field.", + // "Sort by name of reports." + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "default": "DESCENDING", + // "description": "Order of sorted results, default is 'DESCENDING'.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "Ascending order.", + // "Descending order." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports", + // "response": { + // "$ref": "ReportList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.patch": + +type ReportsPatchCall struct { + s *Service + profileId int64 + reportId int64 + report *Report + opt_ map[string]interface{} +} + +// Patch: Updates a report. This method supports patch semantics. +func (r *ReportsService) Patch(profileId int64, reportId int64, report *Report) *ReportsPatchCall { + c := &ReportsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + c.report = report + return c +} + +func (c *ReportsPatchCall) Do() (*Report, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a report. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.reports.patch", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}", + // "request": { + // "$ref": "Report" + // }, + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.run": + +type ReportsRunCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} +} + +// Run: Runs a report. +func (r *ReportsService) Run(profileId int64, reportId int64) *ReportsRunCall { + c := &ReportsRunCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + return c +} + +// Synchronous sets the optional parameter "synchronous": If set and +// true, tries to run the report synchronously. +func (c *ReportsRunCall) Synchronous(synchronous bool) *ReportsRunCall { + c.opt_["synchronous"] = synchronous + return c +} + +func (c *ReportsRunCall) Do() (*File, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["synchronous"]; ok { + params.Set("synchronous", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Runs a report.", + // "httpMethod": "POST", + // "id": "dfareporting.reports.run", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "synchronous": { + // "description": "If set and true, tries to run the report synchronously.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}/run", + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.update": + +type ReportsUpdateCall struct { + s *Service + profileId int64 + reportId int64 + report *Report + opt_ map[string]interface{} +} + +// Update: Updates a report. +func (r *ReportsService) Update(profileId int64, reportId int64, report *Report) *ReportsUpdateCall { + c := &ReportsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + c.report = report + return c +} + +func (c *ReportsUpdateCall) Do() (*Report, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a report.", + // "httpMethod": "PUT", + // "id": "dfareporting.reports.update", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}", + // "request": { + // "$ref": "Report" + // }, + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.files.get": + +type ReportsFilesGetCall struct { + s *Service + profileId int64 + reportId int64 + fileId int64 + opt_ map[string]interface{} +} + +// Get: Retrieves a report file. +func (r *ReportsFilesService) Get(profileId int64, reportId int64, fileId int64) *ReportsFilesGetCall { + c := &ReportsFilesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + c.fileId = fileId + return c +} + +func (c *ReportsFilesGetCall) Do() (*File, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", strconv.FormatInt(c.fileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a report file.", + // "httpMethod": "GET", + // "id": "dfareporting.reports.files.get", + // "parameterOrder": [ + // "profileId", + // "reportId", + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the report file.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}/files/{fileId}", + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.files.list": + +type ReportsFilesListCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} +} + +// List: Lists files for a report. +func (r *ReportsFilesService) List(profileId int64, reportId int64) *ReportsFilesListCall { + c := &ReportsFilesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *ReportsFilesListCall) MaxResults(maxResults int64) *ReportsFilesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous result page. +func (c *ReportsFilesListCall) PageToken(pageToken string) *ReportsFilesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortField sets the optional parameter "sortField": The field by which +// to sort the list. +func (c *ReportsFilesListCall) SortField(sortField string) *ReportsFilesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is 'DESCENDING'. +func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *ReportsFilesListCall) Do() (*FileList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortField"]; ok { + params.Set("sortField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(FileList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists files for a report.", + // "httpMethod": "GET", + // "id": "dfareporting.reports.files.list", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "maximum": "10", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the parent report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sortField": { + // "default": "LAST_MODIFIED_TIME", + // "description": "The field by which to sort the list.", + // "enum": [ + // "ID", + // "LAST_MODIFIED_TIME" + // ], + // "enumDescriptions": [ + // "Sort by file ID.", + // "Sort by 'lastmodifiedAt' field." + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "default": "DESCENDING", + // "description": "Order of sorted results, default is 'DESCENDING'.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "Ascending order.", + // "Descending order." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}/files", + // "response": { + // "$ref": "FileList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.userProfiles.get": + +type UserProfilesGetCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} +} + +// Get: Gets one user profile by ID. +func (r *UserProfilesService) Get(profileId int64) *UserProfilesGetCall { + c := &UserProfilesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +func (c *UserProfilesGetCall) Do() (*UserProfile, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UserProfile) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one user profile by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.userProfiles.get", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "The user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}", + // "response": { + // "$ref": "UserProfile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.userProfiles.list": + +type UserProfilesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves list of user profiles for a user. +func (r *UserProfilesService) List() *UserProfilesListCall { + c := &UserProfilesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *UserProfilesListCall) Do() (*UserProfileList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UserProfileList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves list of user profiles for a user.", + // "httpMethod": "GET", + // "id": "dfareporting.userProfiles.list", + // "path": "userprofiles", + // "response": { + // "$ref": "UserProfileList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1.2/dfareporting-api.json b/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1.2/dfareporting-api.json new file mode 100644 index 0000000000000..73b159a6be33c --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1.2/dfareporting-api.json @@ -0,0 +1,1588 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/qvRmv3vpF4CuJWK6RzcX1h-stNI\"", + "discoveryVersion": "v1", + "id": "dfareporting:v1.2", + "name": "dfareporting", + "version": "v1.2", + "title": "DFA Reporting API", + "description": "Lets you create, run and download reports.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "http://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/doubleclick-advertisers/reporting/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/dfareporting/v1.2/", + "basePath": "/dfareporting/v1.2/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "dfareporting/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/dfareporting": { + "description": "View and manage DoubleClick for Advertisers reports" + } + } + } + }, + "schemas": { + "Activities": { + "id": "Activities", + "type": "object", + "description": "Represents an activity group.", + "properties": { + "filters": { + "type": "array", + "description": "List of activity filters. The dimension values need to be all either of type \"dfa:activity\" or \"dfa:activityGroup\".", + "items": { + "$ref": "DimensionValue" + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#activities.", + "default": "dfareporting#activities" + }, + "metricNames": { + "type": "array", + "description": "List of names of floodlight activity metrics.", + "items": { + "type": "string" + } + } + } + }, + "CustomRichMediaEvents": { + "id": "CustomRichMediaEvents", + "type": "object", + "description": "Represents a Custom Rich Media Events group.", + "properties": { + "filteredEventIds": { + "type": "array", + "description": "List of custom rich media event IDs. Dimension values must be all of type dfa:richMediaEventTypeIdAndName.", + "items": { + "$ref": "DimensionValue" + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#customRichMediaEvents.", + "default": "dfareporting#customRichMediaEvents" + } + } + }, + "DateRange": { + "id": "DateRange", + "type": "object", + "description": "Represents a date range.", + "properties": { + "endDate": { + "type": "string", + "description": "The end date of the date range, inclusive. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#dateRange.", + "default": "dfareporting#dateRange" + }, + "relativeDateRange": { + "type": "string", + "description": "The date range relative to the date of when the report is run, one of: \n- \"TODAY\" \n- \"YESTERDAY\" \n- \"WEEK_TO_DATE\" \n- \"MONTH_TO_DATE\" \n- \"QUARTER_TO_DATE\" \n- \"YEAR_TO_DATE\" \n- \"PREVIOUS_WEEK\" \n- \"PREVIOUS_MONTH\" \n- \"PREVIOUS_QUARTER\" \n- \"PREVIOUS_YEAR\" \n- \"LAST_7_DAYS\" \n- \"LAST_30_DAYS\" \n- \"LAST_90_DAYS\" \n- \"LAST_365_DAYS\" \n- \"LAST_24_MONTHS\"" + }, + "startDate": { + "type": "string", + "description": "The start date of the date range, inclusive. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + } + } + }, + "DimensionFilter": { + "id": "DimensionFilter", + "type": "object", + "description": "Represents a dimension filter.", + "properties": { + "dimensionName": { + "type": "string", + "description": "The name of the dimension to filter." + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#dimensionFilter.", + "default": "dfareporting#dimensionFilter" + }, + "value": { + "type": "string", + "description": "The value of the dimension to filter." + } + } + }, + "DimensionValue": { + "id": "DimensionValue", + "type": "object", + "description": "Represents a DimensionValue resource.", + "properties": { + "dimensionName": { + "type": "string", + "description": "The name of the dimension." + }, + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID associated with the value if available." + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#dimensionValue.", + "default": "dfareporting#dimensionValue" + }, + "matchType": { + "type": "string", + "description": "Determines how the 'value' field is matched when filtering. One of: \n- EXACT (default if not specified) \n- CONTAINS \n- BEGINS_WITH \n- WILDCARD_EXPRESSION (allowing '*' as a placeholder for variable length character sequences, it can be escaped with a backslash.) Note, only paid search dimensions ('dfa:paidSearch*') allow a matchType other than EXACT." + }, + "value": { + "type": "string", + "description": "The value of the dimension." + } + } + }, + "DimensionValueList": { + "id": "DimensionValueList", + "type": "object", + "description": "Represents the list of DimensionValue resources.", + "properties": { + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The dimension values returned in this response.", + "items": { + "$ref": "DimensionValue" + } + }, + "kind": { + "type": "string", + "description": "The kind of list this is, in this case dfareporting#dimensionValueList.", + "default": "dfareporting#dimensionValueList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through dimension values. To retrieve the next page of results, set the next request's \"pageToken\" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted." + } + } + }, + "DimensionValueRequest": { + "id": "DimensionValueRequest", + "type": "object", + "description": "Represents a DimensionValuesRequest.", + "properties": { + "dimensionName": { + "type": "string", + "description": "The name of the dimension for which values should be requested." + }, + "endDate": { + "type": "string", + "description": "The end date of the date range for which to retrieve dimension values. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + }, + "filters": { + "type": "array", + "description": "The list of filters by which to filter values. The filters are ANDed.", + "items": { + "$ref": "DimensionFilter" + } + }, + "kind": { + "type": "string", + "description": "The kind of request this is, in this case dfareporting#dimensionValueRequest.", + "default": "dfareporting#dimensionValueRequest" + }, + "startDate": { + "type": "string", + "description": "The start date of the date range for which to retrieve dimension values. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + } + } + }, + "File": { + "id": "File", + "type": "object", + "description": "Represents a File resource. A File contains the meta-data for a report run. It shows the status of the run and holds the urls to the generated report data if the run is finished and the status is \"REPORT_AVAILABLE\".", + "properties": { + "dateRange": { + "$ref": "DateRange", + "description": "The date range for which the file has report data. The date range will always be the absolute date range for which the report is run." + }, + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "fileName": { + "type": "string", + "description": "The file name of the file." + }, + "format": { + "type": "string", + "description": "The output format of the report. Only available once the file is available." + }, + "id": { + "type": "string", + "description": "The unique ID of this report file.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#file.", + "default": "dfareporting#file" + }, + "lastModifiedTime": { + "type": "string", + "description": "The timestamp in milliseconds since epoch when this file was last modified.", + "format": "int64" + }, + "reportId": { + "type": "string", + "description": "The ID of the report this file was generated from.", + "format": "int64" + }, + "status": { + "type": "string", + "description": "The status of the report file, one of: \n- \"PROCESSING\" \n- \"REPORT_AVAILABLE\" \n- \"FAILED\" \n- \"CANCELLED\"" + }, + "urls": { + "type": "object", + "description": "The urls where the completed report file can be downloaded.", + "properties": { + "apiUrl": { + "type": "string", + "description": "The url for downloading the report data through the API." + }, + "browserUrl": { + "type": "string", + "description": "The url for downloading the report data through a browser." + } + } + } + } + }, + "FileList": { + "id": "FileList", + "type": "object", + "description": "Represents the list of File resources.", + "properties": { + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The files returned in this response.", + "items": { + "$ref": "File" + } + }, + "kind": { + "type": "string", + "description": "The kind of list this is, in this case dfareporting#fileList.", + "default": "dfareporting#fileList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through files. To retrieve the next page of results, set the next request's \"pageToken\" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted." + } + } + }, + "Recipient": { + "id": "Recipient", + "type": "object", + "description": "Represents a recipient.", + "properties": { + "deliveryType": { + "type": "string", + "description": "The delivery type for the recipient, one of: \n- \"ATTACHMENT\" \n- \"LINK\"", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "email": { + "type": "string", + "description": "The email address of the recipient.", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#recipient.", + "default": "dfareporting#recipient" + } + } + }, + "Report": { + "id": "Report", + "type": "object", + "description": "Represents a Report resource.", + "properties": { + "accountId": { + "type": "string", + "description": "The account ID to which this report belongs.", + "format": "int64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "activeGrpCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"ACTIVE_GRP\".", + "properties": { + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.\nFilters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed.\nA valid active GRP report needs to have exactly one DimensionValue for the United States in addition to any advertiser or campaign dimension values.", + "items": { + "$ref": "DimensionValue" + } + }, + "dimensions": { + "type": "array", + "description": "The list of dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + } + } + }, + "criteria": { + "type": "object", + "description": "The report criteria for a report of type \"STANDARD\".", + "properties": { + "activities": { + "$ref": "Activities", + "description": "Activity group." + }, + "customRichMediaEvents": { + "$ref": "CustomRichMediaEvents", + "description": "Custom Rich Media Events group." + }, + "dateRange": { + "$ref": "DateRange", + "description": "The date range for which this report should be run." + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.\nFilters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed.", + "items": { + "$ref": "DimensionValue" + } + }, + "dimensions": { + "type": "array", + "description": "The list of standard dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + } + } + }, + "crossDimensionReachCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"CROSS_DIMENSION_REACH\".", + "properties": { + "breakdown": { + "type": "array", + "description": "The list of dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "dimension": { + "type": "string", + "description": "The dimension option, one of: \n- \"ADVERTISER\" \n- \"CAMPAIGN\" \n- \"SITE_BY_ADVERTISER\" \n- \"SITE_BY_CAMPAIGN\"" + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.", + "items": { + "$ref": "DimensionValue" + } + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + }, + "overlapMetricNames": { + "type": "array", + "description": "The list of names of overlap metrics the report should include.", + "items": { + "type": "string" + } + }, + "pivoted": { + "type": "boolean", + "description": "Whether the report is pivoted or not. Defaults to true." + } + } + }, + "delivery": { + "type": "object", + "description": "The report's email delivery settings.", + "properties": { + "emailOwner": { + "type": "boolean", + "description": "Whether the report should be emailed to the report owner." + }, + "emailOwnerDeliveryType": { + "type": "string", + "description": "The type of delivery for the owner to receive, if enabled. One of: \n- \"ATTACHMENT\" \n- \"LINK\"" + }, + "message": { + "type": "string", + "description": "The message to be sent with each email." + }, + "recipients": { + "type": "array", + "description": "The list of recipients to which to email the report.", + "items": { + "$ref": "Recipient" + } + } + } + }, + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "fileName": { + "type": "string", + "description": "The file name used when generating report files for this report." + }, + "floodlightCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"FLOODLIGHT\".", + "properties": { + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.\nFilters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed.", + "items": { + "$ref": "DimensionValue" + } + }, + "dimensions": { + "type": "array", + "description": "The list of dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "floodlightConfigId": { + "$ref": "DimensionValue", + "description": "The floodlight ID for which to show data in this report. All advertisers associated with that ID will automatically be added. The dimension of the value needs to be 'dfa:floodlightConfigId'." + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + }, + "reportProperties": { + "type": "object", + "description": "The properties of the report.", + "properties": { + "includeAttributedIPConversions": { + "type": "boolean", + "description": "Include conversions that have no cookie, but do have an exposure path." + }, + "includeUnattributedCookieConversions": { + "type": "boolean", + "description": "Include conversions of users with a DoubleClick cookie but without an exposure. That means the user did not click or see an ad from the advertiser within the Floodlight group, or that the interaction happened outside the lookback window." + }, + "includeUnattributedIPConversions": { + "type": "boolean", + "description": "Include conversions that have no associated cookies and no exposures. It’s therefore impossible to know how the user was exposed to your ads during the lookback window prior to a conversion." + } + } + } + } + }, + "format": { + "type": "string", + "description": "The output format of the report, one of: \n- \"CSV\" \n- \"EXCEL\" If not specified, default format is \"CSV\". Note that the actual format in the completed report file might differ if for instance the report's size exceeds the format's capabilities. \"CSV\" will then be the fallback format." + }, + "id": { + "type": "string", + "description": "The unique ID identifying this report resource.", + "format": "int64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#report.", + "default": "dfareporting#report" + }, + "lastModifiedTime": { + "type": "string", + "description": "The timestamp (in milliseconds since epoch) of when this report was last modified.", + "format": "uint64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "name": { + "type": "string", + "description": "The name of the report.", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "ownerProfileId": { + "type": "string", + "description": "The user profile id of the owner of this report.", + "format": "int64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "pathToConversionCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"PATH_TO_CONVERSION\".", + "properties": { + "activityFilters": { + "type": "array", + "description": "The list of 'dfa:activity' values to filter on.", + "items": { + "$ref": "DimensionValue" + } + }, + "conversionDimensions": { + "type": "array", + "description": "The list of conversion dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "customFloodlightVariables": { + "type": "array", + "description": "The list of custom floodlight variables the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "floodlightConfigId": { + "$ref": "DimensionValue", + "description": "The floodlight ID for which to show data in this report. All advertisers associated with that ID will automatically be added. The dimension of the value needs to be 'dfa:floodlightConfigId'." + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + }, + "perInteractionDimensions": { + "type": "array", + "description": "The list of per interaction dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "reportProperties": { + "type": "object", + "description": "The properties of the report.", + "properties": { + "clicksLookbackWindow": { + "type": "integer", + "description": "DFA checks to see if a click interaction occurred within the specified period of time before a conversion. By default the value is pulled from Floodlight or you can manually enter a custom value. Valid values: 1-90.", + "format": "int32" + }, + "impressionsLookbackWindow": { + "type": "integer", + "description": "DFA checks to see if an impression interaction occurred within the specified period of time before a conversion. By default the value is pulled from Floodlight or you can manually enter a custom value. Valid values: 1-90.", + "format": "int32" + }, + "includeAttributedIPConversions": { + "type": "boolean", + "description": "Include conversions that have no cookie, but do have an exposure path." + }, + "includeUnattributedCookieConversions": { + "type": "boolean", + "description": "Include conversions of users with a DoubleClick cookie but without an exposure. That means the user did not click or see an ad from the advertiser within the Floodlight group, or that the interaction happened outside the lookback window." + }, + "includeUnattributedIPConversions": { + "type": "boolean", + "description": "Include conversions that have no associated cookies and no exposures. It’s therefore impossible to know how the user was exposed to your ads during the lookback window prior to a conversion." + }, + "maximumClickInteractions": { + "type": "integer", + "description": "The maximum number of click interactions to include in the report. Advertisers currently paying for E2C reports get up to 200 (100 clicks, 100 impressions). If another advertiser in your network is paying for E2C, you can have up to 5 total exposures per report.", + "format": "int32" + }, + "maximumImpressionInteractions": { + "type": "integer", + "description": "The maximum number of click interactions to include in the report. Advertisers currently paying for E2C reports get up to 200 (100 clicks, 100 impressions). If another advertiser in your network is paying for E2C, you can have up to 5 total exposures per report.", + "format": "int32" + }, + "maximumInteractionGap": { + "type": "integer", + "description": "The maximum amount of time that can take place between interactions (clicks or impressions) by the same user. Valid values: 1-90.", + "format": "int32" + }, + "pivotOnInteractionPath": { + "type": "boolean", + "description": "Enable pivoting on interaction path." + } + } + } + } + }, + "reachCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"REACH\".", + "properties": { + "activities": { + "$ref": "Activities", + "description": "Activity group." + }, + "customRichMediaEvents": { + "$ref": "CustomRichMediaEvents", + "description": "Custom Rich Media Events group." + }, + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.\nFilters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed.", + "items": { + "$ref": "DimensionValue" + } + }, + "dimensions": { + "type": "array", + "description": "The list of dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + }, + "reachByFrequencyMetricNames": { + "type": "array", + "description": "The list of names of Reach By Frequency metrics the report should include.", + "items": { + "type": "string" + } + } + } + }, + "schedule": { + "type": "object", + "description": "The report's schedule. Can only be set if the report's 'dateRange' is a relative date range and the relative date range is not \"TODAY\".", + "properties": { + "active": { + "type": "boolean", + "description": "Whether the schedule is active or not. Must be set to either true or false.", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "every": { + "type": "integer", + "description": "Defines every how many days, weeks or months the report should be run. Needs to be set when \"repeats\" is either \"DAILY\", \"WEEKLY\" or \"MONTHLY\".", + "format": "int32" + }, + "expirationDate": { + "type": "string", + "description": "The expiration date when the scheduled report stops running.", + "format": "date", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "repeats": { + "type": "string", + "description": "The interval for which the report is repeated, one of: \n- \"DAILY\", also requires field \"every\" to be set. \n- \"WEEKLY\", also requires fields \"every\" and \"repeatsOnWeekDays\" to be set. \n- \"TWICE_A_MONTH\" \n- \"MONTHLY\", also requires fields \"every\" and \"runsOnDayOfMonth\" to be set. \n- \"QUARTERLY\" \n- \"YEARLY\"", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "repeatsOnWeekDays": { + "type": "array", + "description": "List of week days \"WEEKLY\" on which scheduled reports should run.", + "items": { + "type": "string" + } + }, + "runsOnDayOfMonth": { + "type": "string", + "description": "Enum to define for \"MONTHLY\" scheduled reports whether reports should be repeated on the same day of the month as \"startDate\" or the same day of the week of the month. Possible values are: \n- DAY_OF_MONTH \n- WEEK_OF_MONTH \nExample: If 'startDate' is Monday, April 2nd 2012 (2012-04-02), \"DAY_OF_MONTH\" would run subsequent reports on the 2nd of every Month, and \"WEEK_OF_MONTH\" would run subsequent reports on the first Monday of the month." + }, + "startDate": { + "type": "string", + "description": "Start date of date range for which scheduled reports should be run.", + "format": "date", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + } + } + }, + "subAccountId": { + "type": "string", + "description": "The subbaccount ID to which this report belongs if applicable.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "The type of the report, one of: \n- STANDARD \n- REACH \n- ACTIVE_GRP \n- PATH_TO_CONVERSION \n- FLOODLIGHT \n- CROSS_DIMENSION_REACH", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + } + } + }, + "ReportList": { + "id": "ReportList", + "type": "object", + "description": "Represents the list of reports.", + "properties": { + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The reports returned in this response.", + "items": { + "$ref": "Report" + } + }, + "kind": { + "type": "string", + "description": "The kind of list this is, in this case dfareporting#reportList.", + "default": "dfareporting#reportList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through reports. To retrieve the next page of results, set the next request's \"pageToken\" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted." + } + } + }, + "SortedDimension": { + "id": "SortedDimension", + "type": "object", + "description": "Represents a sorted dimension.", + "properties": { + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#sortedDimension.", + "default": "dfareporting#sortedDimension" + }, + "name": { + "type": "string", + "description": "The name of the dimension." + }, + "sortOrder": { + "type": "string", + "description": "An optional sort order for the dimension column, one of: \n- \"ASCENDING\" \n- \"DESCENDING\"" + } + } + }, + "UserProfile": { + "id": "UserProfile", + "type": "object", + "description": "Represents a UserProfile resource.", + "properties": { + "accountId": { + "type": "string", + "description": "The account ID to which this profile belongs.", + "format": "int64" + }, + "accountName": { + "type": "string", + "description": "The account name this profile belongs to." + }, + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#userProfile.", + "default": "dfareporting#userProfile" + }, + "profileId": { + "type": "string", + "description": "The unique ID of the user profile.", + "format": "int64" + }, + "subAccountId": { + "type": "string", + "description": "The sub account ID this profile belongs to if applicable.", + "format": "int64" + }, + "subAccountName": { + "type": "string", + "description": "The sub account name this profile belongs to if applicable." + }, + "userName": { + "type": "string", + "description": "The user name." + } + } + }, + "UserProfileList": { + "id": "UserProfileList", + "type": "object", + "description": "Represents the list of user profiles.", + "properties": { + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The user profiles returned in this response.", + "items": { + "$ref": "UserProfile" + } + }, + "kind": { + "type": "string", + "description": "The kind of list this is, in this case dfareporting#userProfileList.", + "default": "dfareporting#userProfileList" + } + } + } + }, + "resources": { + "dimensionValues": { + "methods": { + "query": { + "id": "dfareporting.dimensionValues.query", + "path": "userprofiles/{profileId}/dimensionvalues/query", + "httpMethod": "POST", + "description": "Retrieves list of report dimension values for a list of filters.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "DimensionValueRequest" + }, + "response": { + "$ref": "DimensionValueList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + }, + "files": { + "methods": { + "get": { + "id": "dfareporting.files.get", + "path": "reports/{reportId}/files/{fileId}", + "httpMethod": "GET", + "description": "Retrieves a report file by its report ID and file ID.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the report file.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "reportId", + "fileId" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ], + "supportsMediaDownload": true + }, + "list": { + "id": "dfareporting.files.list", + "path": "userprofiles/{profileId}/files", + "httpMethod": "GET", + "description": "Lists files for a user profile.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "minimum": "0", + "maximum": "10", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "scope": { + "type": "string", + "description": "The scope that defines which results are returned, default is 'MINE'.", + "default": "MINE", + "enum": [ + "ALL", + "MINE", + "SHARED_WITH_ME" + ], + "enumDescriptions": [ + "All files in account.", + "My files.", + "Files shared with me." + ], + "location": "query" + }, + "sortField": { + "type": "string", + "description": "The field by which to sort the list.", + "default": "LAST_MODIFIED_TIME", + "enum": [ + "ID", + "LAST_MODIFIED_TIME" + ], + "enumDescriptions": [ + "Sort by file ID.", + "Sort by 'lastmodifiedAt' field." + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is 'DESCENDING'.", + "default": "DESCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FileList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + }, + "reports": { + "methods": { + "delete": { + "id": "dfareporting.reports.delete", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "DELETE", + "description": "Deletes a report by its ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "get": { + "id": "dfareporting.reports.get", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "GET", + "description": "Retrieves a report by its ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "insert": { + "id": "dfareporting.reports.insert", + "path": "userprofiles/{profileId}/reports", + "httpMethod": "POST", + "description": "Creates a report.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Report" + }, + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "list": { + "id": "dfareporting.reports.list", + "path": "userprofiles/{profileId}/reports", + "httpMethod": "GET", + "description": "Retrieves list of reports.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "minimum": "0", + "maximum": "10", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "scope": { + "type": "string", + "description": "The scope that defines which results are returned, default is 'MINE'.", + "default": "MINE", + "enum": [ + "ALL", + "MINE" + ], + "enumDescriptions": [ + "All reports in account.", + "My reports." + ], + "location": "query" + }, + "sortField": { + "type": "string", + "description": "The field by which to sort the list.", + "default": "LAST_MODIFIED_TIME", + "enum": [ + "ID", + "LAST_MODIFIED_TIME", + "NAME" + ], + "enumDescriptions": [ + "Sort by report ID.", + "Sort by 'lastModifiedTime' field.", + "Sort by name of reports." + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is 'DESCENDING'.", + "default": "DESCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ReportList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "patch": { + "id": "dfareporting.reports.patch", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "PATCH", + "description": "Updates a report. This method supports patch semantics.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "request": { + "$ref": "Report" + }, + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "run": { + "id": "dfareporting.reports.run", + "path": "userprofiles/{profileId}/reports/{reportId}/run", + "httpMethod": "POST", + "description": "Runs a report.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + }, + "synchronous": { + "type": "boolean", + "description": "If set and true, tries to run the report synchronously.", + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "update": { + "id": "dfareporting.reports.update", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "PUT", + "description": "Updates a report.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "request": { + "$ref": "Report" + }, + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + }, + "resources": { + "files": { + "methods": { + "get": { + "id": "dfareporting.reports.files.get", + "path": "userprofiles/{profileId}/reports/{reportId}/files/{fileId}", + "httpMethod": "GET", + "description": "Retrieves a report file.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the report file.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "The DFA profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId", + "fileId" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ], + "supportsMediaDownload": true + }, + "list": { + "id": "dfareporting.reports.files.list", + "path": "userprofiles/{profileId}/reports/{reportId}/files", + "httpMethod": "GET", + "description": "Lists files for a report.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "minimum": "0", + "maximum": "10", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the parent report.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortField": { + "type": "string", + "description": "The field by which to sort the list.", + "default": "LAST_MODIFIED_TIME", + "enum": [ + "ID", + "LAST_MODIFIED_TIME" + ], + "enumDescriptions": [ + "Sort by file ID.", + "Sort by 'lastmodifiedAt' field." + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is 'DESCENDING'.", + "default": "DESCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "response": { + "$ref": "FileList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + } + } + }, + "userProfiles": { + "methods": { + "get": { + "id": "dfareporting.userProfiles.get", + "path": "userprofiles/{profileId}", + "httpMethod": "GET", + "description": "Gets one user profile by ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "The user profile ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "UserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "list": { + "id": "dfareporting.userProfiles.list", + "path": "userprofiles", + "httpMethod": "GET", + "description": "Retrieves list of user profiles for a user.", + "response": { + "$ref": "UserProfileList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1.2/dfareporting-gen.go b/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1.2/dfareporting-gen.go new file mode 100644 index 0000000000000..5a1a8e503bdbb --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1.2/dfareporting-gen.go @@ -0,0 +1,2171 @@ +// Package dfareporting provides access to the DFA Reporting API. +// +// See https://developers.google.com/doubleclick-advertisers/reporting/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/dfareporting/v1.2" +// ... +// dfareportingService, err := dfareporting.New(oauthHttpClient) +package dfareporting + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "dfareporting:v1.2" +const apiName = "dfareporting" +const apiVersion = "v1.2" +const basePath = "https://www.googleapis.com/dfareporting/v1.2/" + +// OAuth2 scopes used by this API. +const ( + // View and manage DoubleClick for Advertisers reports + DfareportingScope = "https://www.googleapis.com/auth/dfareporting" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.DimensionValues = NewDimensionValuesService(s) + s.Files = NewFilesService(s) + s.Reports = NewReportsService(s) + s.UserProfiles = NewUserProfilesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + DimensionValues *DimensionValuesService + + Files *FilesService + + Reports *ReportsService + + UserProfiles *UserProfilesService +} + +func NewDimensionValuesService(s *Service) *DimensionValuesService { + rs := &DimensionValuesService{s: s} + return rs +} + +type DimensionValuesService struct { + s *Service +} + +func NewFilesService(s *Service) *FilesService { + rs := &FilesService{s: s} + return rs +} + +type FilesService struct { + s *Service +} + +func NewReportsService(s *Service) *ReportsService { + rs := &ReportsService{s: s} + rs.Files = NewReportsFilesService(s) + return rs +} + +type ReportsService struct { + s *Service + + Files *ReportsFilesService +} + +func NewReportsFilesService(s *Service) *ReportsFilesService { + rs := &ReportsFilesService{s: s} + return rs +} + +type ReportsFilesService struct { + s *Service +} + +func NewUserProfilesService(s *Service) *UserProfilesService { + rs := &UserProfilesService{s: s} + return rs +} + +type UserProfilesService struct { + s *Service +} + +type Activities struct { + // Filters: List of activity filters. The dimension values need to be + // all either of type "dfa:activity" or "dfa:activityGroup". + Filters []*DimensionValue `json:"filters,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#activities. + Kind string `json:"kind,omitempty"` + + // MetricNames: List of names of floodlight activity metrics. + MetricNames []string `json:"metricNames,omitempty"` +} + +type CustomRichMediaEvents struct { + // FilteredEventIds: List of custom rich media event IDs. Dimension + // values must be all of type dfa:richMediaEventTypeIdAndName. + FilteredEventIds []*DimensionValue `json:"filteredEventIds,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#customRichMediaEvents. + Kind string `json:"kind,omitempty"` +} + +type DateRange struct { + // EndDate: The end date of the date range, inclusive. A string of the + // format: "yyyy-MM-dd". + EndDate string `json:"endDate,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#dateRange. + Kind string `json:"kind,omitempty"` + + // RelativeDateRange: The date range relative to the date of when the + // report is run, one of: + // - "TODAY" + // - "YESTERDAY" + // - "WEEK_TO_DATE" + // + // - "MONTH_TO_DATE" + // - "QUARTER_TO_DATE" + // - "YEAR_TO_DATE" + // - + // "PREVIOUS_WEEK" + // - "PREVIOUS_MONTH" + // - "PREVIOUS_QUARTER" + // - + // "PREVIOUS_YEAR" + // - "LAST_7_DAYS" + // - "LAST_30_DAYS" + // - "LAST_90_DAYS" + // + // - "LAST_365_DAYS" + // - "LAST_24_MONTHS" + RelativeDateRange string `json:"relativeDateRange,omitempty"` + + // StartDate: The start date of the date range, inclusive. A string of + // the format: "yyyy-MM-dd". + StartDate string `json:"startDate,omitempty"` +} + +type DimensionFilter struct { + // DimensionName: The name of the dimension to filter. + DimensionName string `json:"dimensionName,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#dimensionFilter. + Kind string `json:"kind,omitempty"` + + // Value: The value of the dimension to filter. + Value string `json:"value,omitempty"` +} + +type DimensionValue struct { + // DimensionName: The name of the dimension. + DimensionName string `json:"dimensionName,omitempty"` + + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Id: The ID associated with the value if available. + Id string `json:"id,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#dimensionValue. + Kind string `json:"kind,omitempty"` + + // MatchType: Determines how the 'value' field is matched when + // filtering. One of: + // - EXACT (default if not specified) + // - CONTAINS + // + // - BEGINS_WITH + // - WILDCARD_EXPRESSION (allowing '*' as a placeholder + // for variable length character sequences, it can be escaped with a + // backslash.) Note, only paid search dimensions ('dfa:paidSearch*') + // allow a matchType other than EXACT. + MatchType string `json:"matchType,omitempty"` + + // Value: The value of the dimension. + Value string `json:"value,omitempty"` +} + +type DimensionValueList struct { + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The dimension values returned in this response. + Items []*DimensionValue `json:"items,omitempty"` + + // Kind: The kind of list this is, in this case + // dfareporting#dimensionValueList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through dimension + // values. To retrieve the next page of results, set the next request's + // "pageToken" to the value of this field. The page token is only valid + // for a limited amount of time and should not be persisted. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type DimensionValueRequest struct { + // DimensionName: The name of the dimension for which values should be + // requested. + DimensionName string `json:"dimensionName,omitempty"` + + // EndDate: The end date of the date range for which to retrieve + // dimension values. A string of the format: "yyyy-MM-dd". + EndDate string `json:"endDate,omitempty"` + + // Filters: The list of filters by which to filter values. The filters + // are ANDed. + Filters []*DimensionFilter `json:"filters,omitempty"` + + // Kind: The kind of request this is, in this case + // dfareporting#dimensionValueRequest. + Kind string `json:"kind,omitempty"` + + // StartDate: The start date of the date range for which to retrieve + // dimension values. A string of the format: "yyyy-MM-dd". + StartDate string `json:"startDate,omitempty"` +} + +type File struct { + // DateRange: The date range for which the file has report data. The + // date range will always be the absolute date range for which the + // report is run. + DateRange *DateRange `json:"dateRange,omitempty"` + + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // FileName: The file name of the file. + FileName string `json:"fileName,omitempty"` + + // Format: The output format of the report. Only available once the file + // is available. + Format string `json:"format,omitempty"` + + // Id: The unique ID of this report file. + Id int64 `json:"id,omitempty,string"` + + // Kind: The kind of resource this is, in this case dfareporting#file. + Kind string `json:"kind,omitempty"` + + // LastModifiedTime: The timestamp in milliseconds since epoch when this + // file was last modified. + LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"` + + // ReportId: The ID of the report this file was generated from. + ReportId int64 `json:"reportId,omitempty,string"` + + // Status: The status of the report file, one of: + // - "PROCESSING" + // - + // "REPORT_AVAILABLE" + // - "FAILED" + // - "CANCELLED" + Status string `json:"status,omitempty"` + + // Urls: The urls where the completed report file can be downloaded. + Urls *FileUrls `json:"urls,omitempty"` +} + +type FileUrls struct { + // ApiUrl: The url for downloading the report data through the API. + ApiUrl string `json:"apiUrl,omitempty"` + + // BrowserUrl: The url for downloading the report data through a + // browser. + BrowserUrl string `json:"browserUrl,omitempty"` +} + +type FileList struct { + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The files returned in this response. + Items []*File `json:"items,omitempty"` + + // Kind: The kind of list this is, in this case dfareporting#fileList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through files. To + // retrieve the next page of results, set the next request's "pageToken" + // to the value of this field. The page token is only valid for a + // limited amount of time and should not be persisted. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Recipient struct { + // DeliveryType: The delivery type for the recipient, one of: + // - + // "ATTACHMENT" + // - "LINK" + DeliveryType string `json:"deliveryType,omitempty"` + + // Email: The email address of the recipient. + Email string `json:"email,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#recipient. + Kind string `json:"kind,omitempty"` +} + +type Report struct { + // AccountId: The account ID to which this report belongs. + AccountId int64 `json:"accountId,omitempty,string"` + + // ActiveGrpCriteria: The report criteria for a report of type + // "ACTIVE_GRP". + ActiveGrpCriteria *ReportActiveGrpCriteria `json:"activeGrpCriteria,omitempty"` + + // Criteria: The report criteria for a report of type "STANDARD". + Criteria *ReportCriteria `json:"criteria,omitempty"` + + // CrossDimensionReachCriteria: The report criteria for a report of type + // "CROSS_DIMENSION_REACH". + CrossDimensionReachCriteria *ReportCrossDimensionReachCriteria `json:"crossDimensionReachCriteria,omitempty"` + + // Delivery: The report's email delivery settings. + Delivery *ReportDelivery `json:"delivery,omitempty"` + + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // FileName: The file name used when generating report files for this + // report. + FileName string `json:"fileName,omitempty"` + + // FloodlightCriteria: The report criteria for a report of type + // "FLOODLIGHT". + FloodlightCriteria *ReportFloodlightCriteria `json:"floodlightCriteria,omitempty"` + + // Format: The output format of the report, one of: + // - "CSV" + // - "EXCEL" + // If not specified, default format is "CSV". Note that the actual + // format in the completed report file might differ if for instance the + // report's size exceeds the format's capabilities. "CSV" will then be + // the fallback format. + Format string `json:"format,omitempty"` + + // Id: The unique ID identifying this report resource. + Id int64 `json:"id,omitempty,string"` + + // Kind: The kind of resource this is, in this case dfareporting#report. + Kind string `json:"kind,omitempty"` + + // LastModifiedTime: The timestamp (in milliseconds since epoch) of when + // this report was last modified. + LastModifiedTime uint64 `json:"lastModifiedTime,omitempty,string"` + + // Name: The name of the report. + Name string `json:"name,omitempty"` + + // OwnerProfileId: The user profile id of the owner of this report. + OwnerProfileId int64 `json:"ownerProfileId,omitempty,string"` + + // PathToConversionCriteria: The report criteria for a report of type + // "PATH_TO_CONVERSION". + PathToConversionCriteria *ReportPathToConversionCriteria `json:"pathToConversionCriteria,omitempty"` + + // ReachCriteria: The report criteria for a report of type "REACH". + ReachCriteria *ReportReachCriteria `json:"reachCriteria,omitempty"` + + // Schedule: The report's schedule. Can only be set if the report's + // 'dateRange' is a relative date range and the relative date range is + // not "TODAY". + Schedule *ReportSchedule `json:"schedule,omitempty"` + + // SubAccountId: The subbaccount ID to which this report belongs if + // applicable. + SubAccountId int64 `json:"subAccountId,omitempty,string"` + + // Type: The type of the report, one of: + // - STANDARD + // - REACH + // - + // ACTIVE_GRP + // - PATH_TO_CONVERSION + // - FLOODLIGHT + // - + // CROSS_DIMENSION_REACH + Type string `json:"type,omitempty"` +} + +type ReportActiveGrpCriteria struct { + // DateRange: The date range this report should be run for. + DateRange *DateRange `json:"dateRange,omitempty"` + + // DimensionFilters: The list of filters on which dimensions are + // filtered. + // Filters for different dimensions are ANDed, filters for the + // same dimension are grouped together and ORed. + // A valid active GRP + // report needs to have exactly one DimensionValue for the United States + // in addition to any advertiser or campaign dimension values. + DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"` + + // Dimensions: The list of dimensions the report should include. + Dimensions []*SortedDimension `json:"dimensions,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` +} + +type ReportCriteria struct { + // Activities: Activity group. + Activities *Activities `json:"activities,omitempty"` + + // CustomRichMediaEvents: Custom Rich Media Events group. + CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"` + + // DateRange: The date range for which this report should be run. + DateRange *DateRange `json:"dateRange,omitempty"` + + // DimensionFilters: The list of filters on which dimensions are + // filtered. + // Filters for different dimensions are ANDed, filters for the + // same dimension are grouped together and ORed. + DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"` + + // Dimensions: The list of standard dimensions the report should + // include. + Dimensions []*SortedDimension `json:"dimensions,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` +} + +type ReportCrossDimensionReachCriteria struct { + // Breakdown: The list of dimensions the report should include. + Breakdown []*SortedDimension `json:"breakdown,omitempty"` + + // DateRange: The date range this report should be run for. + DateRange *DateRange `json:"dateRange,omitempty"` + + // Dimension: The dimension option, one of: + // - "ADVERTISER" + // - + // "CAMPAIGN" + // - "SITE_BY_ADVERTISER" + // - "SITE_BY_CAMPAIGN" + Dimension string `json:"dimension,omitempty"` + + // DimensionFilters: The list of filters on which dimensions are + // filtered. + DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` + + // OverlapMetricNames: The list of names of overlap metrics the report + // should include. + OverlapMetricNames []string `json:"overlapMetricNames,omitempty"` + + // Pivoted: Whether the report is pivoted or not. Defaults to true. + Pivoted bool `json:"pivoted,omitempty"` +} + +type ReportDelivery struct { + // EmailOwner: Whether the report should be emailed to the report owner. + EmailOwner bool `json:"emailOwner,omitempty"` + + // EmailOwnerDeliveryType: The type of delivery for the owner to + // receive, if enabled. One of: + // - "ATTACHMENT" + // - "LINK" + EmailOwnerDeliveryType string `json:"emailOwnerDeliveryType,omitempty"` + + // Message: The message to be sent with each email. + Message string `json:"message,omitempty"` + + // Recipients: The list of recipients to which to email the report. + Recipients []*Recipient `json:"recipients,omitempty"` +} + +type ReportFloodlightCriteria struct { + // DateRange: The date range this report should be run for. + DateRange *DateRange `json:"dateRange,omitempty"` + + // DimensionFilters: The list of filters on which dimensions are + // filtered. + // Filters for different dimensions are ANDed, filters for the + // same dimension are grouped together and ORed. + DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"` + + // Dimensions: The list of dimensions the report should include. + Dimensions []*SortedDimension `json:"dimensions,omitempty"` + + // FloodlightConfigId: The floodlight ID for which to show data in this + // report. All advertisers associated with that ID will automatically be + // added. The dimension of the value needs to be + // 'dfa:floodlightConfigId'. + FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` + + // ReportProperties: The properties of the report. + ReportProperties *ReportFloodlightCriteriaReportProperties `json:"reportProperties,omitempty"` +} + +type ReportFloodlightCriteriaReportProperties struct { + // IncludeAttributedIPConversions: Include conversions that have no + // cookie, but do have an exposure path. + IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"` + + // IncludeUnattributedCookieConversions: Include conversions of users + // with a DoubleClick cookie but without an exposure. That means the + // user did not click or see an ad from the advertiser within the + // Floodlight group, or that the interaction happened outside the + // lookback window. + IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"` + + // IncludeUnattributedIPConversions: Include conversions that have no + // associated cookies and no exposures. It’s therefore impossible to + // know how the user was exposed to your ads during the lookback window + // prior to a conversion. + IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"` +} + +type ReportPathToConversionCriteria struct { + // ActivityFilters: The list of 'dfa:activity' values to filter on. + ActivityFilters []*DimensionValue `json:"activityFilters,omitempty"` + + // ConversionDimensions: The list of conversion dimensions the report + // should include. + ConversionDimensions []*SortedDimension `json:"conversionDimensions,omitempty"` + + // CustomFloodlightVariables: The list of custom floodlight variables + // the report should include. + CustomFloodlightVariables []*SortedDimension `json:"customFloodlightVariables,omitempty"` + + // DateRange: The date range this report should be run for. + DateRange *DateRange `json:"dateRange,omitempty"` + + // FloodlightConfigId: The floodlight ID for which to show data in this + // report. All advertisers associated with that ID will automatically be + // added. The dimension of the value needs to be + // 'dfa:floodlightConfigId'. + FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` + + // PerInteractionDimensions: The list of per interaction dimensions the + // report should include. + PerInteractionDimensions []*SortedDimension `json:"perInteractionDimensions,omitempty"` + + // ReportProperties: The properties of the report. + ReportProperties *ReportPathToConversionCriteriaReportProperties `json:"reportProperties,omitempty"` +} + +type ReportPathToConversionCriteriaReportProperties struct { + // ClicksLookbackWindow: DFA checks to see if a click interaction + // occurred within the specified period of time before a conversion. By + // default the value is pulled from Floodlight or you can manually enter + // a custom value. Valid values: 1-90. + ClicksLookbackWindow int64 `json:"clicksLookbackWindow,omitempty"` + + // ImpressionsLookbackWindow: DFA checks to see if an impression + // interaction occurred within the specified period of time before a + // conversion. By default the value is pulled from Floodlight or you can + // manually enter a custom value. Valid values: 1-90. + ImpressionsLookbackWindow int64 `json:"impressionsLookbackWindow,omitempty"` + + // IncludeAttributedIPConversions: Include conversions that have no + // cookie, but do have an exposure path. + IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"` + + // IncludeUnattributedCookieConversions: Include conversions of users + // with a DoubleClick cookie but without an exposure. That means the + // user did not click or see an ad from the advertiser within the + // Floodlight group, or that the interaction happened outside the + // lookback window. + IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"` + + // IncludeUnattributedIPConversions: Include conversions that have no + // associated cookies and no exposures. It’s therefore impossible to + // know how the user was exposed to your ads during the lookback window + // prior to a conversion. + IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"` + + // MaximumClickInteractions: The maximum number of click interactions to + // include in the report. Advertisers currently paying for E2C reports + // get up to 200 (100 clicks, 100 impressions). If another advertiser in + // your network is paying for E2C, you can have up to 5 total exposures + // per report. + MaximumClickInteractions int64 `json:"maximumClickInteractions,omitempty"` + + // MaximumImpressionInteractions: The maximum number of click + // interactions to include in the report. Advertisers currently paying + // for E2C reports get up to 200 (100 clicks, 100 impressions). If + // another advertiser in your network is paying for E2C, you can have up + // to 5 total exposures per report. + MaximumImpressionInteractions int64 `json:"maximumImpressionInteractions,omitempty"` + + // MaximumInteractionGap: The maximum amount of time that can take place + // between interactions (clicks or impressions) by the same user. Valid + // values: 1-90. + MaximumInteractionGap int64 `json:"maximumInteractionGap,omitempty"` + + // PivotOnInteractionPath: Enable pivoting on interaction path. + PivotOnInteractionPath bool `json:"pivotOnInteractionPath,omitempty"` +} + +type ReportReachCriteria struct { + // Activities: Activity group. + Activities *Activities `json:"activities,omitempty"` + + // CustomRichMediaEvents: Custom Rich Media Events group. + CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"` + + // DateRange: The date range this report should be run for. + DateRange *DateRange `json:"dateRange,omitempty"` + + // DimensionFilters: The list of filters on which dimensions are + // filtered. + // Filters for different dimensions are ANDed, filters for the + // same dimension are grouped together and ORed. + DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"` + + // Dimensions: The list of dimensions the report should include. + Dimensions []*SortedDimension `json:"dimensions,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` + + // ReachByFrequencyMetricNames: The list of names of Reach By Frequency + // metrics the report should include. + ReachByFrequencyMetricNames []string `json:"reachByFrequencyMetricNames,omitempty"` +} + +type ReportSchedule struct { + // Active: Whether the schedule is active or not. Must be set to either + // true or false. + Active bool `json:"active,omitempty"` + + // Every: Defines every how many days, weeks or months the report should + // be run. Needs to be set when "repeats" is either "DAILY", "WEEKLY" or + // "MONTHLY". + Every int64 `json:"every,omitempty"` + + // ExpirationDate: The expiration date when the scheduled report stops + // running. + ExpirationDate string `json:"expirationDate,omitempty"` + + // Repeats: The interval for which the report is repeated, one of: + // - + // "DAILY", also requires field "every" to be set. + // - "WEEKLY", also + // requires fields "every" and "repeatsOnWeekDays" to be set. + // - + // "TWICE_A_MONTH" + // - "MONTHLY", also requires fields "every" and + // "runsOnDayOfMonth" to be set. + // - "QUARTERLY" + // - "YEARLY" + Repeats string `json:"repeats,omitempty"` + + // RepeatsOnWeekDays: List of week days "WEEKLY" on which scheduled + // reports should run. + RepeatsOnWeekDays []string `json:"repeatsOnWeekDays,omitempty"` + + // RunsOnDayOfMonth: Enum to define for "MONTHLY" scheduled reports + // whether reports should be repeated on the same day of the month as + // "startDate" or the same day of the week of the month. Possible values + // are: + // - DAY_OF_MONTH + // - WEEK_OF_MONTH + // Example: If 'startDate' is + // Monday, April 2nd 2012 (2012-04-02), "DAY_OF_MONTH" would run + // subsequent reports on the 2nd of every Month, and "WEEK_OF_MONTH" + // would run subsequent reports on the first Monday of the month. + RunsOnDayOfMonth string `json:"runsOnDayOfMonth,omitempty"` + + // StartDate: Start date of date range for which scheduled reports + // should be run. + StartDate string `json:"startDate,omitempty"` +} + +type ReportList struct { + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The reports returned in this response. + Items []*Report `json:"items,omitempty"` + + // Kind: The kind of list this is, in this case dfareporting#reportList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through reports. To + // retrieve the next page of results, set the next request's "pageToken" + // to the value of this field. The page token is only valid for a + // limited amount of time and should not be persisted. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type SortedDimension struct { + // Kind: The kind of resource this is, in this case + // dfareporting#sortedDimension. + Kind string `json:"kind,omitempty"` + + // Name: The name of the dimension. + Name string `json:"name,omitempty"` + + // SortOrder: An optional sort order for the dimension column, one of: + // + // - "ASCENDING" + // - "DESCENDING" + SortOrder string `json:"sortOrder,omitempty"` +} + +type UserProfile struct { + // AccountId: The account ID to which this profile belongs. + AccountId int64 `json:"accountId,omitempty,string"` + + // AccountName: The account name this profile belongs to. + AccountName string `json:"accountName,omitempty"` + + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#userProfile. + Kind string `json:"kind,omitempty"` + + // ProfileId: The unique ID of the user profile. + ProfileId int64 `json:"profileId,omitempty,string"` + + // SubAccountId: The sub account ID this profile belongs to if + // applicable. + SubAccountId int64 `json:"subAccountId,omitempty,string"` + + // SubAccountName: The sub account name this profile belongs to if + // applicable. + SubAccountName string `json:"subAccountName,omitempty"` + + // UserName: The user name. + UserName string `json:"userName,omitempty"` +} + +type UserProfileList struct { + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The user profiles returned in this response. + Items []*UserProfile `json:"items,omitempty"` + + // Kind: The kind of list this is, in this case + // dfareporting#userProfileList. + Kind string `json:"kind,omitempty"` +} + +// method id "dfareporting.dimensionValues.query": + +type DimensionValuesQueryCall struct { + s *Service + profileId int64 + dimensionvaluerequest *DimensionValueRequest + opt_ map[string]interface{} +} + +// Query: Retrieves list of report dimension values for a list of +// filters. +func (r *DimensionValuesService) Query(profileId int64, dimensionvaluerequest *DimensionValueRequest) *DimensionValuesQueryCall { + c := &DimensionValuesQueryCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.dimensionvaluerequest = dimensionvaluerequest + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *DimensionValuesQueryCall) MaxResults(maxResults int64) *DimensionValuesQueryCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous result page. +func (c *DimensionValuesQueryCall) PageToken(pageToken string) *DimensionValuesQueryCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *DimensionValuesQueryCall) Do() (*DimensionValueList, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.dimensionvaluerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DimensionValueList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves list of report dimension values for a list of filters.", + // "httpMethod": "POST", + // "id": "dfareporting.dimensionValues.query", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/dimensionvalues/query", + // "request": { + // "$ref": "DimensionValueRequest" + // }, + // "response": { + // "$ref": "DimensionValueList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.files.get": + +type FilesGetCall struct { + s *Service + reportId int64 + fileId int64 + opt_ map[string]interface{} +} + +// Get: Retrieves a report file by its report ID and file ID. +func (r *FilesService) Get(reportId int64, fileId int64) *FilesGetCall { + c := &FilesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.reportId = reportId + c.fileId = fileId + return c +} + +func (c *FilesGetCall) Do() (*File, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", strconv.FormatInt(c.fileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a report file by its report ID and file ID.", + // "httpMethod": "GET", + // "id": "dfareporting.files.get", + // "parameterOrder": [ + // "reportId", + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the report file.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "reports/{reportId}/files/{fileId}", + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "dfareporting.files.list": + +type FilesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} +} + +// List: Lists files for a user profile. +func (r *FilesService) List(profileId int64) *FilesListCall { + c := &FilesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *FilesListCall) MaxResults(maxResults int64) *FilesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous result page. +func (c *FilesListCall) PageToken(pageToken string) *FilesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Scope sets the optional parameter "scope": The scope that defines +// which results are returned, default is 'MINE'. +func (c *FilesListCall) Scope(scope string) *FilesListCall { + c.opt_["scope"] = scope + return c +} + +// SortField sets the optional parameter "sortField": The field by which +// to sort the list. +func (c *FilesListCall) SortField(sortField string) *FilesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is 'DESCENDING'. +func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *FilesListCall) Do() (*FileList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["scope"]; ok { + params.Set("scope", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortField"]; ok { + params.Set("sortField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(FileList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists files for a user profile.", + // "httpMethod": "GET", + // "id": "dfareporting.files.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "maximum": "10", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "scope": { + // "default": "MINE", + // "description": "The scope that defines which results are returned, default is 'MINE'.", + // "enum": [ + // "ALL", + // "MINE", + // "SHARED_WITH_ME" + // ], + // "enumDescriptions": [ + // "All files in account.", + // "My files.", + // "Files shared with me." + // ], + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "default": "LAST_MODIFIED_TIME", + // "description": "The field by which to sort the list.", + // "enum": [ + // "ID", + // "LAST_MODIFIED_TIME" + // ], + // "enumDescriptions": [ + // "Sort by file ID.", + // "Sort by 'lastmodifiedAt' field." + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "default": "DESCENDING", + // "description": "Order of sorted results, default is 'DESCENDING'.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "Ascending order.", + // "Descending order." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/files", + // "response": { + // "$ref": "FileList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.delete": + +type ReportsDeleteCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} +} + +// Delete: Deletes a report by its ID. +func (r *ReportsService) Delete(profileId int64, reportId int64) *ReportsDeleteCall { + c := &ReportsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + return c +} + +func (c *ReportsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a report by its ID.", + // "httpMethod": "DELETE", + // "id": "dfareporting.reports.delete", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.get": + +type ReportsGetCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} +} + +// Get: Retrieves a report by its ID. +func (r *ReportsService) Get(profileId int64, reportId int64) *ReportsGetCall { + c := &ReportsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + return c +} + +func (c *ReportsGetCall) Do() (*Report, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a report by its ID.", + // "httpMethod": "GET", + // "id": "dfareporting.reports.get", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}", + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.insert": + +type ReportsInsertCall struct { + s *Service + profileId int64 + report *Report + opt_ map[string]interface{} +} + +// Insert: Creates a report. +func (r *ReportsService) Insert(profileId int64, report *Report) *ReportsInsertCall { + c := &ReportsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.report = report + return c +} + +func (c *ReportsInsertCall) Do() (*Report, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a report.", + // "httpMethod": "POST", + // "id": "dfareporting.reports.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports", + // "request": { + // "$ref": "Report" + // }, + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.list": + +type ReportsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} +} + +// List: Retrieves list of reports. +func (r *ReportsService) List(profileId int64) *ReportsListCall { + c := &ReportsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *ReportsListCall) MaxResults(maxResults int64) *ReportsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous result page. +func (c *ReportsListCall) PageToken(pageToken string) *ReportsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Scope sets the optional parameter "scope": The scope that defines +// which results are returned, default is 'MINE'. +func (c *ReportsListCall) Scope(scope string) *ReportsListCall { + c.opt_["scope"] = scope + return c +} + +// SortField sets the optional parameter "sortField": The field by which +// to sort the list. +func (c *ReportsListCall) SortField(sortField string) *ReportsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is 'DESCENDING'. +func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *ReportsListCall) Do() (*ReportList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["scope"]; ok { + params.Set("scope", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortField"]; ok { + params.Set("sortField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ReportList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves list of reports.", + // "httpMethod": "GET", + // "id": "dfareporting.reports.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "maximum": "10", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "scope": { + // "default": "MINE", + // "description": "The scope that defines which results are returned, default is 'MINE'.", + // "enum": [ + // "ALL", + // "MINE" + // ], + // "enumDescriptions": [ + // "All reports in account.", + // "My reports." + // ], + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "default": "LAST_MODIFIED_TIME", + // "description": "The field by which to sort the list.", + // "enum": [ + // "ID", + // "LAST_MODIFIED_TIME", + // "NAME" + // ], + // "enumDescriptions": [ + // "Sort by report ID.", + // "Sort by 'lastModifiedTime' field.", + // "Sort by name of reports." + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "default": "DESCENDING", + // "description": "Order of sorted results, default is 'DESCENDING'.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "Ascending order.", + // "Descending order." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports", + // "response": { + // "$ref": "ReportList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.patch": + +type ReportsPatchCall struct { + s *Service + profileId int64 + reportId int64 + report *Report + opt_ map[string]interface{} +} + +// Patch: Updates a report. This method supports patch semantics. +func (r *ReportsService) Patch(profileId int64, reportId int64, report *Report) *ReportsPatchCall { + c := &ReportsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + c.report = report + return c +} + +func (c *ReportsPatchCall) Do() (*Report, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a report. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.reports.patch", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}", + // "request": { + // "$ref": "Report" + // }, + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.run": + +type ReportsRunCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} +} + +// Run: Runs a report. +func (r *ReportsService) Run(profileId int64, reportId int64) *ReportsRunCall { + c := &ReportsRunCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + return c +} + +// Synchronous sets the optional parameter "synchronous": If set and +// true, tries to run the report synchronously. +func (c *ReportsRunCall) Synchronous(synchronous bool) *ReportsRunCall { + c.opt_["synchronous"] = synchronous + return c +} + +func (c *ReportsRunCall) Do() (*File, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["synchronous"]; ok { + params.Set("synchronous", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Runs a report.", + // "httpMethod": "POST", + // "id": "dfareporting.reports.run", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "synchronous": { + // "description": "If set and true, tries to run the report synchronously.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}/run", + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.update": + +type ReportsUpdateCall struct { + s *Service + profileId int64 + reportId int64 + report *Report + opt_ map[string]interface{} +} + +// Update: Updates a report. +func (r *ReportsService) Update(profileId int64, reportId int64, report *Report) *ReportsUpdateCall { + c := &ReportsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + c.report = report + return c +} + +func (c *ReportsUpdateCall) Do() (*Report, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a report.", + // "httpMethod": "PUT", + // "id": "dfareporting.reports.update", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}", + // "request": { + // "$ref": "Report" + // }, + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.files.get": + +type ReportsFilesGetCall struct { + s *Service + profileId int64 + reportId int64 + fileId int64 + opt_ map[string]interface{} +} + +// Get: Retrieves a report file. +func (r *ReportsFilesService) Get(profileId int64, reportId int64, fileId int64) *ReportsFilesGetCall { + c := &ReportsFilesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + c.fileId = fileId + return c +} + +func (c *ReportsFilesGetCall) Do() (*File, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", strconv.FormatInt(c.fileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a report file.", + // "httpMethod": "GET", + // "id": "dfareporting.reports.files.get", + // "parameterOrder": [ + // "profileId", + // "reportId", + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the report file.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}/files/{fileId}", + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "dfareporting.reports.files.list": + +type ReportsFilesListCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} +} + +// List: Lists files for a report. +func (r *ReportsFilesService) List(profileId int64, reportId int64) *ReportsFilesListCall { + c := &ReportsFilesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *ReportsFilesListCall) MaxResults(maxResults int64) *ReportsFilesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous result page. +func (c *ReportsFilesListCall) PageToken(pageToken string) *ReportsFilesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortField sets the optional parameter "sortField": The field by which +// to sort the list. +func (c *ReportsFilesListCall) SortField(sortField string) *ReportsFilesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is 'DESCENDING'. +func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *ReportsFilesListCall) Do() (*FileList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortField"]; ok { + params.Set("sortField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(FileList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists files for a report.", + // "httpMethod": "GET", + // "id": "dfareporting.reports.files.list", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "maximum": "10", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the parent report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sortField": { + // "default": "LAST_MODIFIED_TIME", + // "description": "The field by which to sort the list.", + // "enum": [ + // "ID", + // "LAST_MODIFIED_TIME" + // ], + // "enumDescriptions": [ + // "Sort by file ID.", + // "Sort by 'lastmodifiedAt' field." + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "default": "DESCENDING", + // "description": "Order of sorted results, default is 'DESCENDING'.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "Ascending order.", + // "Descending order." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}/files", + // "response": { + // "$ref": "FileList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.userProfiles.get": + +type UserProfilesGetCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} +} + +// Get: Gets one user profile by ID. +func (r *UserProfilesService) Get(profileId int64) *UserProfilesGetCall { + c := &UserProfilesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +func (c *UserProfilesGetCall) Do() (*UserProfile, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UserProfile) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one user profile by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.userProfiles.get", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "The user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}", + // "response": { + // "$ref": "UserProfile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.userProfiles.list": + +type UserProfilesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves list of user profiles for a user. +func (r *UserProfilesService) List() *UserProfilesListCall { + c := &UserProfilesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *UserProfilesListCall) Do() (*UserProfileList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UserProfileList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves list of user profiles for a user.", + // "httpMethod": "GET", + // "id": "dfareporting.userProfiles.list", + // "path": "userprofiles", + // "response": { + // "$ref": "UserProfileList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1.3/dfareporting-api.json b/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1.3/dfareporting-api.json new file mode 100644 index 0000000000000..2a192bfce802f --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1.3/dfareporting-api.json @@ -0,0 +1,1912 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/bg8eKhQkwGnobYThDWedv2Ar2Io\"", + "discoveryVersion": "v1", + "id": "dfareporting:v1.3", + "name": "dfareporting", + "version": "v1.3", + "title": "DFA Reporting API", + "description": "Lets you create, run and download reports.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "http://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/doubleclick-advertisers/reporting/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/dfareporting/v1.3/", + "basePath": "/dfareporting/v1.3/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "dfareporting/v1.3/", + "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/dfareporting": { + "description": "View and manage DoubleClick for Advertisers reports" + } + } + } + }, + "schemas": { + "Activities": { + "id": "Activities", + "type": "object", + "description": "Represents an activity group.", + "properties": { + "filters": { + "type": "array", + "description": "List of activity filters. The dimension values need to be all either of type \"dfa:activity\" or \"dfa:activityGroup\".", + "items": { + "$ref": "DimensionValue" + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#activities.", + "default": "dfareporting#activities" + }, + "metricNames": { + "type": "array", + "description": "List of names of floodlight activity metrics.", + "items": { + "type": "string" + } + } + } + }, + "CompatibleFields": { + "id": "CompatibleFields", + "type": "object", + "description": "Represents a response to the queryCompatibleFields method.", + "properties": { + "crossDimensionReachReportCompatibleFields": { + "$ref": "CrossDimensionReachReportCompatibleFields", + "description": "Contains items that are compatible to be selected for a report of type \"CROSS_DIMENSION_REACH\"." + }, + "floodlightReportCompatibleFields": { + "$ref": "FloodlightReportCompatibleFields", + "description": "Contains items that are compatible to be selected for a report of type \"FLOODLIGHT\"." + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#compatibleFields.", + "default": "dfareporting#compatibleFields" + }, + "pathToConversionReportCompatibleFields": { + "$ref": "PathToConversionReportCompatibleFields", + "description": "Contains items that are compatible to be selected for a report of type \"PATH_TO_CONVERSION\"." + }, + "reachReportCompatibleFields": { + "$ref": "ReachReportCompatibleFields", + "description": "Contains items that are compatible to be selected for a report of type \"REACH\"." + }, + "reportCompatibleFields": { + "$ref": "ReportCompatibleFields", + "description": "Contains items that are compatible to be selected for a report of type \"STANDARD\"." + } + } + }, + "CrossDimensionReachReportCompatibleFields": { + "id": "CrossDimensionReachReportCompatibleFields", + "type": "object", + "description": "Represents fields that are compatible to be selected for a report of type \"CROSS_DIMENSION_REACH\".", + "properties": { + "breakdown": { + "type": "array", + "description": "Dimensions which are compatible to be selected in the \"breakdown\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "dimensionFilters": { + "type": "array", + "description": "Dimensions which are compatible to be selected in the \"dimensionFilters\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#crossDimensionReachReportCompatibleFields.", + "default": "dfareporting#crossDimensionReachReportCompatibleFields" + }, + "metrics": { + "type": "array", + "description": "Metrics which are compatible to be selected in the \"metricNames\" section of the report.", + "items": { + "$ref": "Metric" + } + }, + "overlapMetrics": { + "type": "array", + "description": "Metrics which are compatible to be selected in the \"overlapMetricNames\" section of the report.", + "items": { + "$ref": "Metric" + } + } + } + }, + "CustomRichMediaEvents": { + "id": "CustomRichMediaEvents", + "type": "object", + "description": "Represents a Custom Rich Media Events group.", + "properties": { + "filteredEventIds": { + "type": "array", + "description": "List of custom rich media event IDs. Dimension values must be all of type dfa:richMediaEventTypeIdAndName.", + "items": { + "$ref": "DimensionValue" + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#customRichMediaEvents.", + "default": "dfareporting#customRichMediaEvents" + } + } + }, + "DateRange": { + "id": "DateRange", + "type": "object", + "description": "Represents a date range.", + "properties": { + "endDate": { + "type": "string", + "description": "The end date of the date range, inclusive. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#dateRange.", + "default": "dfareporting#dateRange" + }, + "relativeDateRange": { + "type": "string", + "description": "The date range relative to the date of when the report is run, one of: \n- \"TODAY\" \n- \"YESTERDAY\" \n- \"WEEK_TO_DATE\" \n- \"MONTH_TO_DATE\" \n- \"QUARTER_TO_DATE\" \n- \"YEAR_TO_DATE\" \n- \"PREVIOUS_WEEK\" \n- \"PREVIOUS_MONTH\" \n- \"PREVIOUS_QUARTER\" \n- \"PREVIOUS_YEAR\" \n- \"LAST_7_DAYS\" \n- \"LAST_30_DAYS\" \n- \"LAST_90_DAYS\" \n- \"LAST_365_DAYS\" \n- \"LAST_24_MONTHS\"" + }, + "startDate": { + "type": "string", + "description": "The start date of the date range, inclusive. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + } + } + }, + "Dimension": { + "id": "Dimension", + "type": "object", + "description": "Represents a dimension.", + "properties": { + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#dimension.", + "default": "dfareporting#dimension" + }, + "name": { + "type": "string", + "description": "The dimension name, e.g. dfa:advertiser" + } + } + }, + "DimensionFilter": { + "id": "DimensionFilter", + "type": "object", + "description": "Represents a dimension filter.", + "properties": { + "dimensionName": { + "type": "string", + "description": "The name of the dimension to filter." + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#dimensionFilter.", + "default": "dfareporting#dimensionFilter" + }, + "value": { + "type": "string", + "description": "The value of the dimension to filter." + } + } + }, + "DimensionValue": { + "id": "DimensionValue", + "type": "object", + "description": "Represents a DimensionValue resource.", + "properties": { + "dimensionName": { + "type": "string", + "description": "The name of the dimension." + }, + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID associated with the value if available." + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#dimensionValue.", + "default": "dfareporting#dimensionValue" + }, + "matchType": { + "type": "string", + "description": "Determines how the 'value' field is matched when filtering. One of: \n- EXACT (default if not specified) \n- CONTAINS \n- BEGINS_WITH \n- WILDCARD_EXPRESSION (allowing '*' as a placeholder for variable length character sequences, it can be escaped with a backslash.) Note, only paid search dimensions ('dfa:paidSearch*') allow a matchType other than EXACT." + }, + "value": { + "type": "string", + "description": "The value of the dimension." + } + } + }, + "DimensionValueList": { + "id": "DimensionValueList", + "type": "object", + "description": "Represents the list of DimensionValue resources.", + "properties": { + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The dimension values returned in this response.", + "items": { + "$ref": "DimensionValue" + } + }, + "kind": { + "type": "string", + "description": "The kind of list this is, in this case dfareporting#dimensionValueList.", + "default": "dfareporting#dimensionValueList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through dimension values. To retrieve the next page of results, set the next request's \"pageToken\" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted." + } + } + }, + "DimensionValueRequest": { + "id": "DimensionValueRequest", + "type": "object", + "description": "Represents a DimensionValuesRequest.", + "properties": { + "dimensionName": { + "type": "string", + "description": "The name of the dimension for which values should be requested.", + "annotations": { + "required": [ + "dfareporting.dimensionValues.query" + ] + } + }, + "endDate": { + "type": "string", + "description": "The end date of the date range for which to retrieve dimension values. A string of the format: \"yyyy-MM-dd\".", + "format": "date", + "annotations": { + "required": [ + "dfareporting.dimensionValues.query" + ] + } + }, + "filters": { + "type": "array", + "description": "The list of filters by which to filter values. The filters are ANDed.", + "items": { + "$ref": "DimensionFilter" + } + }, + "kind": { + "type": "string", + "description": "The kind of request this is, in this case dfareporting#dimensionValueRequest.", + "default": "dfareporting#dimensionValueRequest" + }, + "startDate": { + "type": "string", + "description": "The start date of the date range for which to retrieve dimension values. A string of the format: \"yyyy-MM-dd\".", + "format": "date", + "annotations": { + "required": [ + "dfareporting.dimensionValues.query" + ] + } + } + } + }, + "File": { + "id": "File", + "type": "object", + "description": "Represents a File resource. A File contains the meta-data for a report run. It shows the status of the run and holds the urls to the generated report data if the run is finished and the status is \"REPORT_AVAILABLE\".", + "properties": { + "dateRange": { + "$ref": "DateRange", + "description": "The date range for which the file has report data. The date range will always be the absolute date range for which the report is run." + }, + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "fileName": { + "type": "string", + "description": "The file name of the file." + }, + "format": { + "type": "string", + "description": "The output format of the report. Only available once the file is available." + }, + "id": { + "type": "string", + "description": "The unique ID of this report file.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#file.", + "default": "dfareporting#file" + }, + "lastModifiedTime": { + "type": "string", + "description": "The timestamp in milliseconds since epoch when this file was last modified.", + "format": "int64" + }, + "reportId": { + "type": "string", + "description": "The ID of the report this file was generated from.", + "format": "int64" + }, + "status": { + "type": "string", + "description": "The status of the report file, one of: \n- \"PROCESSING\" \n- \"REPORT_AVAILABLE\" \n- \"FAILED\" \n- \"CANCELLED\"" + }, + "urls": { + "type": "object", + "description": "The urls where the completed report file can be downloaded.", + "properties": { + "apiUrl": { + "type": "string", + "description": "The url for downloading the report data through the API." + }, + "browserUrl": { + "type": "string", + "description": "The url for downloading the report data through a browser." + } + } + } + } + }, + "FileList": { + "id": "FileList", + "type": "object", + "description": "Represents the list of File resources.", + "properties": { + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The files returned in this response.", + "items": { + "$ref": "File" + } + }, + "kind": { + "type": "string", + "description": "The kind of list this is, in this case dfareporting#fileList.", + "default": "dfareporting#fileList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through files. To retrieve the next page of results, set the next request's \"pageToken\" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted." + } + } + }, + "FloodlightReportCompatibleFields": { + "id": "FloodlightReportCompatibleFields", + "type": "object", + "description": "Represents fields that are compatible to be selected for a report of type \"FlOODLIGHT\".", + "properties": { + "dimensionFilters": { + "type": "array", + "description": "Dimensions which are compatible to be selected in the \"dimensionFilters\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "dimensions": { + "type": "array", + "description": "Dimensions which are compatible to be selected in the \"dimensions\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#floodlightReportCompatibleFields.", + "default": "dfareporting#floodlightReportCompatibleFields" + }, + "metrics": { + "type": "array", + "description": "Metrics which are compatible to be selected in the \"metricNames\" section of the report.", + "items": { + "$ref": "Metric" + } + } + } + }, + "Metric": { + "id": "Metric", + "type": "object", + "description": "Represents a metric.", + "properties": { + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#metric.", + "default": "dfareporting#metric" + }, + "name": { + "type": "string", + "description": "The metric name, e.g. dfa:impressions" + } + } + }, + "PathToConversionReportCompatibleFields": { + "id": "PathToConversionReportCompatibleFields", + "type": "object", + "description": "Represents fields that are compatible to be selected for a report of type \"PATH_TO_CONVERSION\".", + "properties": { + "conversionDimensions": { + "type": "array", + "description": "Conversion dimensions which are compatible to be selected in the \"conversionDimensions\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "customFloodlightVariables": { + "type": "array", + "description": "Custom floodlight variables which are compatible to be selected in the \"customFloodlightVariables\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#pathToConversionReportCompatibleFields.", + "default": "dfareporting#pathToConversionReportCompatibleFields" + }, + "metrics": { + "type": "array", + "description": "Metrics which are compatible to be selected in the \"metricNames\" section of the report.", + "items": { + "$ref": "Metric" + } + }, + "perInteractionDimensions": { + "type": "array", + "description": "Per-interaction dimensions which are compatible to be selected in the \"perInteractionDimensions\" section of the report.", + "items": { + "$ref": "Dimension" + } + } + } + }, + "ReachReportCompatibleFields": { + "id": "ReachReportCompatibleFields", + "type": "object", + "description": "Represents fields that are compatible to be selected for a report of type \"REACH\".", + "properties": { + "dimensionFilters": { + "type": "array", + "description": "Dimensions which are compatible to be selected in the \"dimensionFilters\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "dimensions": { + "type": "array", + "description": "Dimensions which are compatible to be selected in the \"dimensions\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#reachReportCompatibleFields.", + "default": "dfareporting#reachReportCompatibleFields" + }, + "metrics": { + "type": "array", + "description": "Metrics which are compatible to be selected in the \"metricNames\" section of the report.", + "items": { + "$ref": "Metric" + } + }, + "pivotedActivityMetrics": { + "type": "array", + "description": "Metrics which are compatible to be selected as activity metrics to pivot on in the \"activities\" section of the report.", + "items": { + "$ref": "Metric" + } + }, + "reachByFrequencyMetrics": { + "type": "array", + "description": "Metrics which are compatible to be selected in the \"reachByFrequencyMetricNames\" section of the report.", + "items": { + "$ref": "Metric" + } + } + } + }, + "Recipient": { + "id": "Recipient", + "type": "object", + "description": "Represents a recipient.", + "properties": { + "deliveryType": { + "type": "string", + "description": "The delivery type for the recipient, one of: \n- \"ATTACHMENT\" \n- \"LINK\"", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "email": { + "type": "string", + "description": "The email address of the recipient.", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#recipient.", + "default": "dfareporting#recipient" + } + } + }, + "Report": { + "id": "Report", + "type": "object", + "description": "Represents a Report resource.", + "properties": { + "accountId": { + "type": "string", + "description": "The account ID to which this report belongs.", + "format": "int64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "activeGrpCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"ACTIVE_GRP\".", + "properties": { + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.\nFilters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed.\nA valid active GRP report needs to have exactly one DimensionValue for the United States in addition to any advertiser or campaign dimension values.", + "items": { + "$ref": "DimensionValue" + } + }, + "dimensions": { + "type": "array", + "description": "The list of dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + } + } + }, + "criteria": { + "type": "object", + "description": "The report criteria for a report of type \"STANDARD\".", + "properties": { + "activities": { + "$ref": "Activities", + "description": "Activity group." + }, + "customRichMediaEvents": { + "$ref": "CustomRichMediaEvents", + "description": "Custom Rich Media Events group." + }, + "dateRange": { + "$ref": "DateRange", + "description": "The date range for which this report should be run." + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.\nFilters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed.", + "items": { + "$ref": "DimensionValue" + } + }, + "dimensions": { + "type": "array", + "description": "The list of standard dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + } + } + }, + "crossDimensionReachCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"CROSS_DIMENSION_REACH\".", + "properties": { + "breakdown": { + "type": "array", + "description": "The list of dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "dimension": { + "type": "string", + "description": "The dimension option, one of: \n- \"ADVERTISER\" \n- \"CAMPAIGN\" \n- \"SITE_BY_ADVERTISER\" \n- \"SITE_BY_CAMPAIGN\"" + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.", + "items": { + "$ref": "DimensionValue" + } + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + }, + "overlapMetricNames": { + "type": "array", + "description": "The list of names of overlap metrics the report should include.", + "items": { + "type": "string" + } + }, + "pivoted": { + "type": "boolean", + "description": "Whether the report is pivoted or not. Defaults to true." + } + } + }, + "delivery": { + "type": "object", + "description": "The report's email delivery settings.", + "properties": { + "emailOwner": { + "type": "boolean", + "description": "Whether the report should be emailed to the report owner." + }, + "emailOwnerDeliveryType": { + "type": "string", + "description": "The type of delivery for the owner to receive, if enabled. One of: \n- \"ATTACHMENT\" \n- \"LINK\"" + }, + "message": { + "type": "string", + "description": "The message to be sent with each email." + }, + "recipients": { + "type": "array", + "description": "The list of recipients to which to email the report.", + "items": { + "$ref": "Recipient" + } + } + } + }, + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "fileName": { + "type": "string", + "description": "The file name used when generating report files for this report." + }, + "floodlightCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"FLOODLIGHT\".", + "properties": { + "customRichMediaEvents": { + "type": "array", + "description": "The list of custom rich media events to include.", + "items": { + "$ref": "DimensionValue" + } + }, + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.\nFilters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed.", + "items": { + "$ref": "DimensionValue" + } + }, + "dimensions": { + "type": "array", + "description": "The list of dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "floodlightConfigId": { + "$ref": "DimensionValue", + "description": "The floodlight ID for which to show data in this report. All advertisers associated with that ID will automatically be added. The dimension of the value needs to be 'dfa:floodlightConfigId'." + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + }, + "reportProperties": { + "type": "object", + "description": "The properties of the report.", + "properties": { + "includeAttributedIPConversions": { + "type": "boolean", + "description": "Include conversions that have no cookie, but do have an exposure path." + }, + "includeUnattributedCookieConversions": { + "type": "boolean", + "description": "Include conversions of users with a DoubleClick cookie but without an exposure. That means the user did not click or see an ad from the advertiser within the Floodlight group, or that the interaction happened outside the lookback window." + }, + "includeUnattributedIPConversions": { + "type": "boolean", + "description": "Include conversions that have no associated cookies and no exposures. It’s therefore impossible to know how the user was exposed to your ads during the lookback window prior to a conversion." + } + } + } + } + }, + "format": { + "type": "string", + "description": "The output format of the report, one of: \n- \"CSV\" \n- \"EXCEL\" If not specified, default format is \"CSV\". Note that the actual format in the completed report file might differ if for instance the report's size exceeds the format's capabilities. \"CSV\" will then be the fallback format." + }, + "id": { + "type": "string", + "description": "The unique ID identifying this report resource.", + "format": "int64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#report.", + "default": "dfareporting#report" + }, + "lastModifiedTime": { + "type": "string", + "description": "The timestamp (in milliseconds since epoch) of when this report was last modified.", + "format": "uint64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "name": { + "type": "string", + "description": "The name of the report.", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "ownerProfileId": { + "type": "string", + "description": "The user profile id of the owner of this report.", + "format": "int64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "pathToConversionCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"PATH_TO_CONVERSION\".", + "properties": { + "activityFilters": { + "type": "array", + "description": "The list of 'dfa:activity' values to filter on.", + "items": { + "$ref": "DimensionValue" + } + }, + "conversionDimensions": { + "type": "array", + "description": "The list of conversion dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "customFloodlightVariables": { + "type": "array", + "description": "The list of custom floodlight variables the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "customRichMediaEvents": { + "type": "array", + "description": "The list of custom rich media events to include.", + "items": { + "$ref": "DimensionValue" + } + }, + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "floodlightConfigId": { + "$ref": "DimensionValue", + "description": "The floodlight ID for which to show data in this report. All advertisers associated with that ID will automatically be added. The dimension of the value needs to be 'dfa:floodlightConfigId'." + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + }, + "perInteractionDimensions": { + "type": "array", + "description": "The list of per interaction dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "reportProperties": { + "type": "object", + "description": "The properties of the report.", + "properties": { + "clicksLookbackWindow": { + "type": "integer", + "description": "DFA checks to see if a click interaction occurred within the specified period of time before a conversion. By default the value is pulled from Floodlight or you can manually enter a custom value. Valid values: 1-90.", + "format": "int32" + }, + "impressionsLookbackWindow": { + "type": "integer", + "description": "DFA checks to see if an impression interaction occurred within the specified period of time before a conversion. By default the value is pulled from Floodlight or you can manually enter a custom value. Valid values: 1-90.", + "format": "int32" + }, + "includeAttributedIPConversions": { + "type": "boolean", + "description": "Deprecated: has no effect." + }, + "includeUnattributedCookieConversions": { + "type": "boolean", + "description": "Include conversions of users with a DoubleClick cookie but without an exposure. That means the user did not click or see an ad from the advertiser within the Floodlight group, or that the interaction happened outside the lookback window." + }, + "includeUnattributedIPConversions": { + "type": "boolean", + "description": "Include conversions that have no associated cookies and no exposures. It’s therefore impossible to know how the user was exposed to your ads during the lookback window prior to a conversion." + }, + "maximumClickInteractions": { + "type": "integer", + "description": "The maximum number of click interactions to include in the report. Advertisers currently paying for E2C reports get up to 200 (100 clicks, 100 impressions). If another advertiser in your network is paying for E2C, you can have up to 5 total exposures per report.", + "format": "int32" + }, + "maximumImpressionInteractions": { + "type": "integer", + "description": "The maximum number of click interactions to include in the report. Advertisers currently paying for E2C reports get up to 200 (100 clicks, 100 impressions). If another advertiser in your network is paying for E2C, you can have up to 5 total exposures per report.", + "format": "int32" + }, + "maximumInteractionGap": { + "type": "integer", + "description": "The maximum amount of time that can take place between interactions (clicks or impressions) by the same user. Valid values: 1-90.", + "format": "int32" + }, + "pivotOnInteractionPath": { + "type": "boolean", + "description": "Enable pivoting on interaction path." + } + } + } + } + }, + "reachCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"REACH\".", + "properties": { + "activities": { + "$ref": "Activities", + "description": "Activity group." + }, + "customRichMediaEvents": { + "$ref": "CustomRichMediaEvents", + "description": "Custom Rich Media Events group." + }, + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.\nFilters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed.", + "items": { + "$ref": "DimensionValue" + } + }, + "dimensions": { + "type": "array", + "description": "The list of dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + }, + "reachByFrequencyMetricNames": { + "type": "array", + "description": "The list of names of Reach By Frequency metrics the report should include.", + "items": { + "type": "string" + } + } + } + }, + "schedule": { + "type": "object", + "description": "The report's schedule. Can only be set if the report's 'dateRange' is a relative date range and the relative date range is not \"TODAY\".", + "properties": { + "active": { + "type": "boolean", + "description": "Whether the schedule is active or not. Must be set to either true or false.", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "every": { + "type": "integer", + "description": "Defines every how many days, weeks or months the report should be run. Needs to be set when \"repeats\" is either \"DAILY\", \"WEEKLY\" or \"MONTHLY\".", + "format": "int32" + }, + "expirationDate": { + "type": "string", + "description": "The expiration date when the scheduled report stops running.", + "format": "date", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "repeats": { + "type": "string", + "description": "The interval for which the report is repeated, one of: \n- \"DAILY\", also requires field \"every\" to be set. \n- \"WEEKLY\", also requires fields \"every\" and \"repeatsOnWeekDays\" to be set. \n- \"TWICE_A_MONTH\" \n- \"MONTHLY\", also requires fields \"every\" and \"runsOnDayOfMonth\" to be set. \n- \"QUARTERLY\" \n- \"YEARLY\"", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "repeatsOnWeekDays": { + "type": "array", + "description": "List of week days \"WEEKLY\" on which scheduled reports should run.", + "items": { + "type": "string" + } + }, + "runsOnDayOfMonth": { + "type": "string", + "description": "Enum to define for \"MONTHLY\" scheduled reports whether reports should be repeated on the same day of the month as \"startDate\" or the same day of the week of the month. Possible values are: \n- DAY_OF_MONTH \n- WEEK_OF_MONTH \nExample: If 'startDate' is Monday, April 2nd 2012 (2012-04-02), \"DAY_OF_MONTH\" would run subsequent reports on the 2nd of every Month, and \"WEEK_OF_MONTH\" would run subsequent reports on the first Monday of the month." + }, + "startDate": { + "type": "string", + "description": "Start date of date range for which scheduled reports should be run.", + "format": "date", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + } + } + }, + "subAccountId": { + "type": "string", + "description": "The subbaccount ID to which this report belongs if applicable.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "The type of the report, one of: \n- STANDARD \n- REACH \n- ACTIVE_GRP \n- PATH_TO_CONVERSION \n- FLOODLIGHT \n- CROSS_DIMENSION_REACH", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + } + } + }, + "ReportCompatibleFields": { + "id": "ReportCompatibleFields", + "type": "object", + "description": "Represents fields that are compatible to be selected for a report of type \"STANDARD\".", + "properties": { + "dimensionFilters": { + "type": "array", + "description": "Dimensions which are compatible to be selected in the \"dimensionFilters\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "dimensions": { + "type": "array", + "description": "Dimensions which are compatible to be selected in the \"dimensions\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#reportCompatibleFields.", + "default": "dfareporting#reportCompatibleFields" + }, + "metrics": { + "type": "array", + "description": "Metrics which are compatible to be selected in the \"metricNames\" section of the report.", + "items": { + "$ref": "Metric" + } + }, + "pivotedActivityMetrics": { + "type": "array", + "description": "Metrics which are compatible to be selected as activity metrics to pivot on in the \"activities\" section of the report.", + "items": { + "$ref": "Metric" + } + } + } + }, + "ReportList": { + "id": "ReportList", + "type": "object", + "description": "Represents the list of reports.", + "properties": { + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The reports returned in this response.", + "items": { + "$ref": "Report" + } + }, + "kind": { + "type": "string", + "description": "The kind of list this is, in this case dfareporting#reportList.", + "default": "dfareporting#reportList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through reports. To retrieve the next page of results, set the next request's \"pageToken\" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted." + } + } + }, + "SortedDimension": { + "id": "SortedDimension", + "type": "object", + "description": "Represents a sorted dimension.", + "properties": { + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#sortedDimension.", + "default": "dfareporting#sortedDimension" + }, + "name": { + "type": "string", + "description": "The name of the dimension." + }, + "sortOrder": { + "type": "string", + "description": "An optional sort order for the dimension column, one of: \n- \"ASCENDING\" \n- \"DESCENDING\"" + } + } + }, + "UserProfile": { + "id": "UserProfile", + "type": "object", + "description": "Represents a UserProfile resource.", + "properties": { + "accountId": { + "type": "string", + "description": "The account ID to which this profile belongs.", + "format": "int64" + }, + "accountName": { + "type": "string", + "description": "The account name this profile belongs to." + }, + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#userProfile.", + "default": "dfareporting#userProfile" + }, + "profileId": { + "type": "string", + "description": "The unique ID of the user profile.", + "format": "int64" + }, + "subAccountId": { + "type": "string", + "description": "The sub account ID this profile belongs to if applicable.", + "format": "int64" + }, + "subAccountName": { + "type": "string", + "description": "The sub account name this profile belongs to if applicable." + }, + "userName": { + "type": "string", + "description": "The user name." + } + } + }, + "UserProfileList": { + "id": "UserProfileList", + "type": "object", + "description": "Represents the list of user profiles.", + "properties": { + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The user profiles returned in this response.", + "items": { + "$ref": "UserProfile" + } + }, + "kind": { + "type": "string", + "description": "The kind of list this is, in this case dfareporting#userProfileList.", + "default": "dfareporting#userProfileList" + } + } + } + }, + "resources": { + "dimensionValues": { + "methods": { + "query": { + "id": "dfareporting.dimensionValues.query", + "path": "userprofiles/{profileId}/dimensionvalues/query", + "httpMethod": "POST", + "description": "Retrieves list of report dimension values for a list of filters.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "DimensionValueRequest" + }, + "response": { + "$ref": "DimensionValueList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + }, + "files": { + "methods": { + "get": { + "id": "dfareporting.files.get", + "path": "reports/{reportId}/files/{fileId}", + "httpMethod": "GET", + "description": "Retrieves a report file by its report ID and file ID.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the report file.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "reportId", + "fileId" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ], + "supportsMediaDownload": true + }, + "list": { + "id": "dfareporting.files.list", + "path": "userprofiles/{profileId}/files", + "httpMethod": "GET", + "description": "Lists files for a user profile.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "minimum": "0", + "maximum": "10", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "scope": { + "type": "string", + "description": "The scope that defines which results are returned, default is 'MINE'.", + "default": "MINE", + "enum": [ + "ALL", + "MINE", + "SHARED_WITH_ME" + ], + "enumDescriptions": [ + "All files in account.", + "My files.", + "Files shared with me." + ], + "location": "query" + }, + "sortField": { + "type": "string", + "description": "The field by which to sort the list.", + "default": "LAST_MODIFIED_TIME", + "enum": [ + "ID", + "LAST_MODIFIED_TIME" + ], + "enumDescriptions": [ + "Sort by file ID.", + "Sort by 'lastmodifiedAt' field." + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is 'DESCENDING'.", + "default": "DESCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FileList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + }, + "reports": { + "methods": { + "delete": { + "id": "dfareporting.reports.delete", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "DELETE", + "description": "Deletes a report by its ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "get": { + "id": "dfareporting.reports.get", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "GET", + "description": "Retrieves a report by its ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "insert": { + "id": "dfareporting.reports.insert", + "path": "userprofiles/{profileId}/reports", + "httpMethod": "POST", + "description": "Creates a report.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Report" + }, + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "list": { + "id": "dfareporting.reports.list", + "path": "userprofiles/{profileId}/reports", + "httpMethod": "GET", + "description": "Retrieves list of reports.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "minimum": "0", + "maximum": "10", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "scope": { + "type": "string", + "description": "The scope that defines which results are returned, default is 'MINE'.", + "default": "MINE", + "enum": [ + "ALL", + "MINE" + ], + "enumDescriptions": [ + "All reports in account.", + "My reports." + ], + "location": "query" + }, + "sortField": { + "type": "string", + "description": "The field by which to sort the list.", + "default": "LAST_MODIFIED_TIME", + "enum": [ + "ID", + "LAST_MODIFIED_TIME", + "NAME" + ], + "enumDescriptions": [ + "Sort by report ID.", + "Sort by 'lastModifiedTime' field.", + "Sort by name of reports." + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is 'DESCENDING'.", + "default": "DESCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ReportList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "patch": { + "id": "dfareporting.reports.patch", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "PATCH", + "description": "Updates a report. This method supports patch semantics.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "request": { + "$ref": "Report" + }, + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "run": { + "id": "dfareporting.reports.run", + "path": "userprofiles/{profileId}/reports/{reportId}/run", + "httpMethod": "POST", + "description": "Runs a report.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + }, + "synchronous": { + "type": "boolean", + "description": "If set and true, tries to run the report synchronously.", + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "update": { + "id": "dfareporting.reports.update", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "PUT", + "description": "Updates a report.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "request": { + "$ref": "Report" + }, + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + }, + "resources": { + "compatibleFields": { + "methods": { + "query": { + "id": "dfareporting.reports.compatibleFields.query", + "path": "userprofiles/{profileId}/reports/compatiblefields/query", + "httpMethod": "POST", + "description": "Returns the fields that are compatible to be selected in the respective sections of a report criteria, given the fields already selected in the input report and user permissions.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Report" + }, + "response": { + "$ref": "CompatibleFields" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + }, + "files": { + "methods": { + "get": { + "id": "dfareporting.reports.files.get", + "path": "userprofiles/{profileId}/reports/{reportId}/files/{fileId}", + "httpMethod": "GET", + "description": "Retrieves a report file.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the report file.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "The DFA profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId", + "fileId" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ], + "supportsMediaDownload": true + }, + "list": { + "id": "dfareporting.reports.files.list", + "path": "userprofiles/{profileId}/reports/{reportId}/files", + "httpMethod": "GET", + "description": "Lists files for a report.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "minimum": "0", + "maximum": "10", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the parent report.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortField": { + "type": "string", + "description": "The field by which to sort the list.", + "default": "LAST_MODIFIED_TIME", + "enum": [ + "ID", + "LAST_MODIFIED_TIME" + ], + "enumDescriptions": [ + "Sort by file ID.", + "Sort by 'lastmodifiedAt' field." + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is 'DESCENDING'.", + "default": "DESCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "response": { + "$ref": "FileList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + } + } + }, + "userProfiles": { + "methods": { + "get": { + "id": "dfareporting.userProfiles.get", + "path": "userprofiles/{profileId}", + "httpMethod": "GET", + "description": "Gets one user profile by ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "The user profile ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "UserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "list": { + "id": "dfareporting.userProfiles.list", + "path": "userprofiles", + "httpMethod": "GET", + "description": "Retrieves list of user profiles for a user.", + "response": { + "$ref": "UserProfileList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1.3/dfareporting-gen.go b/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1.3/dfareporting-gen.go new file mode 100644 index 0000000000000..7d1a949b01528 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1.3/dfareporting-gen.go @@ -0,0 +1,2426 @@ +// Package dfareporting provides access to the DFA Reporting API. +// +// See https://developers.google.com/doubleclick-advertisers/reporting/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/dfareporting/v1.3" +// ... +// dfareportingService, err := dfareporting.New(oauthHttpClient) +package dfareporting + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "dfareporting:v1.3" +const apiName = "dfareporting" +const apiVersion = "v1.3" +const basePath = "https://www.googleapis.com/dfareporting/v1.3/" + +// OAuth2 scopes used by this API. +const ( + // View and manage DoubleClick for Advertisers reports + DfareportingScope = "https://www.googleapis.com/auth/dfareporting" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.DimensionValues = NewDimensionValuesService(s) + s.Files = NewFilesService(s) + s.Reports = NewReportsService(s) + s.UserProfiles = NewUserProfilesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + DimensionValues *DimensionValuesService + + Files *FilesService + + Reports *ReportsService + + UserProfiles *UserProfilesService +} + +func NewDimensionValuesService(s *Service) *DimensionValuesService { + rs := &DimensionValuesService{s: s} + return rs +} + +type DimensionValuesService struct { + s *Service +} + +func NewFilesService(s *Service) *FilesService { + rs := &FilesService{s: s} + return rs +} + +type FilesService struct { + s *Service +} + +func NewReportsService(s *Service) *ReportsService { + rs := &ReportsService{s: s} + rs.CompatibleFields = NewReportsCompatibleFieldsService(s) + rs.Files = NewReportsFilesService(s) + return rs +} + +type ReportsService struct { + s *Service + + CompatibleFields *ReportsCompatibleFieldsService + + Files *ReportsFilesService +} + +func NewReportsCompatibleFieldsService(s *Service) *ReportsCompatibleFieldsService { + rs := &ReportsCompatibleFieldsService{s: s} + return rs +} + +type ReportsCompatibleFieldsService struct { + s *Service +} + +func NewReportsFilesService(s *Service) *ReportsFilesService { + rs := &ReportsFilesService{s: s} + return rs +} + +type ReportsFilesService struct { + s *Service +} + +func NewUserProfilesService(s *Service) *UserProfilesService { + rs := &UserProfilesService{s: s} + return rs +} + +type UserProfilesService struct { + s *Service +} + +type Activities struct { + // Filters: List of activity filters. The dimension values need to be + // all either of type "dfa:activity" or "dfa:activityGroup". + Filters []*DimensionValue `json:"filters,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#activities. + Kind string `json:"kind,omitempty"` + + // MetricNames: List of names of floodlight activity metrics. + MetricNames []string `json:"metricNames,omitempty"` +} + +type CompatibleFields struct { + // CrossDimensionReachReportCompatibleFields: Contains items that are + // compatible to be selected for a report of type + // "CROSS_DIMENSION_REACH". + CrossDimensionReachReportCompatibleFields *CrossDimensionReachReportCompatibleFields `json:"crossDimensionReachReportCompatibleFields,omitempty"` + + // FloodlightReportCompatibleFields: Contains items that are compatible + // to be selected for a report of type "FLOODLIGHT". + FloodlightReportCompatibleFields *FloodlightReportCompatibleFields `json:"floodlightReportCompatibleFields,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#compatibleFields. + Kind string `json:"kind,omitempty"` + + // PathToConversionReportCompatibleFields: Contains items that are + // compatible to be selected for a report of type "PATH_TO_CONVERSION". + PathToConversionReportCompatibleFields *PathToConversionReportCompatibleFields `json:"pathToConversionReportCompatibleFields,omitempty"` + + // ReachReportCompatibleFields: Contains items that are compatible to be + // selected for a report of type "REACH". + ReachReportCompatibleFields *ReachReportCompatibleFields `json:"reachReportCompatibleFields,omitempty"` + + // ReportCompatibleFields: Contains items that are compatible to be + // selected for a report of type "STANDARD". + ReportCompatibleFields *ReportCompatibleFields `json:"reportCompatibleFields,omitempty"` +} + +type CrossDimensionReachReportCompatibleFields struct { + // Breakdown: Dimensions which are compatible to be selected in the + // "breakdown" section of the report. + Breakdown []*Dimension `json:"breakdown,omitempty"` + + // DimensionFilters: Dimensions which are compatible to be selected in + // the "dimensionFilters" section of the report. + DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#crossDimensionReachReportCompatibleFields. + Kind string `json:"kind,omitempty"` + + // Metrics: Metrics which are compatible to be selected in the + // "metricNames" section of the report. + Metrics []*Metric `json:"metrics,omitempty"` + + // OverlapMetrics: Metrics which are compatible to be selected in the + // "overlapMetricNames" section of the report. + OverlapMetrics []*Metric `json:"overlapMetrics,omitempty"` +} + +type CustomRichMediaEvents struct { + // FilteredEventIds: List of custom rich media event IDs. Dimension + // values must be all of type dfa:richMediaEventTypeIdAndName. + FilteredEventIds []*DimensionValue `json:"filteredEventIds,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#customRichMediaEvents. + Kind string `json:"kind,omitempty"` +} + +type DateRange struct { + // EndDate: The end date of the date range, inclusive. A string of the + // format: "yyyy-MM-dd". + EndDate string `json:"endDate,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#dateRange. + Kind string `json:"kind,omitempty"` + + // RelativeDateRange: The date range relative to the date of when the + // report is run, one of: + // - "TODAY" + // - "YESTERDAY" + // - "WEEK_TO_DATE" + // + // - "MONTH_TO_DATE" + // - "QUARTER_TO_DATE" + // - "YEAR_TO_DATE" + // - + // "PREVIOUS_WEEK" + // - "PREVIOUS_MONTH" + // - "PREVIOUS_QUARTER" + // - + // "PREVIOUS_YEAR" + // - "LAST_7_DAYS" + // - "LAST_30_DAYS" + // - "LAST_90_DAYS" + // + // - "LAST_365_DAYS" + // - "LAST_24_MONTHS" + RelativeDateRange string `json:"relativeDateRange,omitempty"` + + // StartDate: The start date of the date range, inclusive. A string of + // the format: "yyyy-MM-dd". + StartDate string `json:"startDate,omitempty"` +} + +type Dimension struct { + // Kind: The kind of resource this is, in this case + // dfareporting#dimension. + Kind string `json:"kind,omitempty"` + + // Name: The dimension name, e.g. dfa:advertiser + Name string `json:"name,omitempty"` +} + +type DimensionFilter struct { + // DimensionName: The name of the dimension to filter. + DimensionName string `json:"dimensionName,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#dimensionFilter. + Kind string `json:"kind,omitempty"` + + // Value: The value of the dimension to filter. + Value string `json:"value,omitempty"` +} + +type DimensionValue struct { + // DimensionName: The name of the dimension. + DimensionName string `json:"dimensionName,omitempty"` + + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Id: The ID associated with the value if available. + Id string `json:"id,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#dimensionValue. + Kind string `json:"kind,omitempty"` + + // MatchType: Determines how the 'value' field is matched when + // filtering. One of: + // - EXACT (default if not specified) + // - CONTAINS + // + // - BEGINS_WITH + // - WILDCARD_EXPRESSION (allowing '*' as a placeholder + // for variable length character sequences, it can be escaped with a + // backslash.) Note, only paid search dimensions ('dfa:paidSearch*') + // allow a matchType other than EXACT. + MatchType string `json:"matchType,omitempty"` + + // Value: The value of the dimension. + Value string `json:"value,omitempty"` +} + +type DimensionValueList struct { + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The dimension values returned in this response. + Items []*DimensionValue `json:"items,omitempty"` + + // Kind: The kind of list this is, in this case + // dfareporting#dimensionValueList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through dimension + // values. To retrieve the next page of results, set the next request's + // "pageToken" to the value of this field. The page token is only valid + // for a limited amount of time and should not be persisted. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type DimensionValueRequest struct { + // DimensionName: The name of the dimension for which values should be + // requested. + DimensionName string `json:"dimensionName,omitempty"` + + // EndDate: The end date of the date range for which to retrieve + // dimension values. A string of the format: "yyyy-MM-dd". + EndDate string `json:"endDate,omitempty"` + + // Filters: The list of filters by which to filter values. The filters + // are ANDed. + Filters []*DimensionFilter `json:"filters,omitempty"` + + // Kind: The kind of request this is, in this case + // dfareporting#dimensionValueRequest. + Kind string `json:"kind,omitempty"` + + // StartDate: The start date of the date range for which to retrieve + // dimension values. A string of the format: "yyyy-MM-dd". + StartDate string `json:"startDate,omitempty"` +} + +type File struct { + // DateRange: The date range for which the file has report data. The + // date range will always be the absolute date range for which the + // report is run. + DateRange *DateRange `json:"dateRange,omitempty"` + + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // FileName: The file name of the file. + FileName string `json:"fileName,omitempty"` + + // Format: The output format of the report. Only available once the file + // is available. + Format string `json:"format,omitempty"` + + // Id: The unique ID of this report file. + Id int64 `json:"id,omitempty,string"` + + // Kind: The kind of resource this is, in this case dfareporting#file. + Kind string `json:"kind,omitempty"` + + // LastModifiedTime: The timestamp in milliseconds since epoch when this + // file was last modified. + LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"` + + // ReportId: The ID of the report this file was generated from. + ReportId int64 `json:"reportId,omitempty,string"` + + // Status: The status of the report file, one of: + // - "PROCESSING" + // - + // "REPORT_AVAILABLE" + // - "FAILED" + // - "CANCELLED" + Status string `json:"status,omitempty"` + + // Urls: The urls where the completed report file can be downloaded. + Urls *FileUrls `json:"urls,omitempty"` +} + +type FileUrls struct { + // ApiUrl: The url for downloading the report data through the API. + ApiUrl string `json:"apiUrl,omitempty"` + + // BrowserUrl: The url for downloading the report data through a + // browser. + BrowserUrl string `json:"browserUrl,omitempty"` +} + +type FileList struct { + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The files returned in this response. + Items []*File `json:"items,omitempty"` + + // Kind: The kind of list this is, in this case dfareporting#fileList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through files. To + // retrieve the next page of results, set the next request's "pageToken" + // to the value of this field. The page token is only valid for a + // limited amount of time and should not be persisted. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type FloodlightReportCompatibleFields struct { + // DimensionFilters: Dimensions which are compatible to be selected in + // the "dimensionFilters" section of the report. + DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"` + + // Dimensions: Dimensions which are compatible to be selected in the + // "dimensions" section of the report. + Dimensions []*Dimension `json:"dimensions,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#floodlightReportCompatibleFields. + Kind string `json:"kind,omitempty"` + + // Metrics: Metrics which are compatible to be selected in the + // "metricNames" section of the report. + Metrics []*Metric `json:"metrics,omitempty"` +} + +type Metric struct { + // Kind: The kind of resource this is, in this case dfareporting#metric. + Kind string `json:"kind,omitempty"` + + // Name: The metric name, e.g. dfa:impressions + Name string `json:"name,omitempty"` +} + +type PathToConversionReportCompatibleFields struct { + // ConversionDimensions: Conversion dimensions which are compatible to + // be selected in the "conversionDimensions" section of the report. + ConversionDimensions []*Dimension `json:"conversionDimensions,omitempty"` + + // CustomFloodlightVariables: Custom floodlight variables which are + // compatible to be selected in the "customFloodlightVariables" section + // of the report. + CustomFloodlightVariables []*Dimension `json:"customFloodlightVariables,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#pathToConversionReportCompatibleFields. + Kind string `json:"kind,omitempty"` + + // Metrics: Metrics which are compatible to be selected in the + // "metricNames" section of the report. + Metrics []*Metric `json:"metrics,omitempty"` + + // PerInteractionDimensions: Per-interaction dimensions which are + // compatible to be selected in the "perInteractionDimensions" section + // of the report. + PerInteractionDimensions []*Dimension `json:"perInteractionDimensions,omitempty"` +} + +type ReachReportCompatibleFields struct { + // DimensionFilters: Dimensions which are compatible to be selected in + // the "dimensionFilters" section of the report. + DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"` + + // Dimensions: Dimensions which are compatible to be selected in the + // "dimensions" section of the report. + Dimensions []*Dimension `json:"dimensions,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#reachReportCompatibleFields. + Kind string `json:"kind,omitempty"` + + // Metrics: Metrics which are compatible to be selected in the + // "metricNames" section of the report. + Metrics []*Metric `json:"metrics,omitempty"` + + // PivotedActivityMetrics: Metrics which are compatible to be selected + // as activity metrics to pivot on in the "activities" section of the + // report. + PivotedActivityMetrics []*Metric `json:"pivotedActivityMetrics,omitempty"` + + // ReachByFrequencyMetrics: Metrics which are compatible to be selected + // in the "reachByFrequencyMetricNames" section of the report. + ReachByFrequencyMetrics []*Metric `json:"reachByFrequencyMetrics,omitempty"` +} + +type Recipient struct { + // DeliveryType: The delivery type for the recipient, one of: + // - + // "ATTACHMENT" + // - "LINK" + DeliveryType string `json:"deliveryType,omitempty"` + + // Email: The email address of the recipient. + Email string `json:"email,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#recipient. + Kind string `json:"kind,omitempty"` +} + +type Report struct { + // AccountId: The account ID to which this report belongs. + AccountId int64 `json:"accountId,omitempty,string"` + + // ActiveGrpCriteria: The report criteria for a report of type + // "ACTIVE_GRP". + ActiveGrpCriteria *ReportActiveGrpCriteria `json:"activeGrpCriteria,omitempty"` + + // Criteria: The report criteria for a report of type "STANDARD". + Criteria *ReportCriteria `json:"criteria,omitempty"` + + // CrossDimensionReachCriteria: The report criteria for a report of type + // "CROSS_DIMENSION_REACH". + CrossDimensionReachCriteria *ReportCrossDimensionReachCriteria `json:"crossDimensionReachCriteria,omitempty"` + + // Delivery: The report's email delivery settings. + Delivery *ReportDelivery `json:"delivery,omitempty"` + + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // FileName: The file name used when generating report files for this + // report. + FileName string `json:"fileName,omitempty"` + + // FloodlightCriteria: The report criteria for a report of type + // "FLOODLIGHT". + FloodlightCriteria *ReportFloodlightCriteria `json:"floodlightCriteria,omitempty"` + + // Format: The output format of the report, one of: + // - "CSV" + // - "EXCEL" + // If not specified, default format is "CSV". Note that the actual + // format in the completed report file might differ if for instance the + // report's size exceeds the format's capabilities. "CSV" will then be + // the fallback format. + Format string `json:"format,omitempty"` + + // Id: The unique ID identifying this report resource. + Id int64 `json:"id,omitempty,string"` + + // Kind: The kind of resource this is, in this case dfareporting#report. + Kind string `json:"kind,omitempty"` + + // LastModifiedTime: The timestamp (in milliseconds since epoch) of when + // this report was last modified. + LastModifiedTime uint64 `json:"lastModifiedTime,omitempty,string"` + + // Name: The name of the report. + Name string `json:"name,omitempty"` + + // OwnerProfileId: The user profile id of the owner of this report. + OwnerProfileId int64 `json:"ownerProfileId,omitempty,string"` + + // PathToConversionCriteria: The report criteria for a report of type + // "PATH_TO_CONVERSION". + PathToConversionCriteria *ReportPathToConversionCriteria `json:"pathToConversionCriteria,omitempty"` + + // ReachCriteria: The report criteria for a report of type "REACH". + ReachCriteria *ReportReachCriteria `json:"reachCriteria,omitempty"` + + // Schedule: The report's schedule. Can only be set if the report's + // 'dateRange' is a relative date range and the relative date range is + // not "TODAY". + Schedule *ReportSchedule `json:"schedule,omitempty"` + + // SubAccountId: The subbaccount ID to which this report belongs if + // applicable. + SubAccountId int64 `json:"subAccountId,omitempty,string"` + + // Type: The type of the report, one of: + // - STANDARD + // - REACH + // - + // ACTIVE_GRP + // - PATH_TO_CONVERSION + // - FLOODLIGHT + // - + // CROSS_DIMENSION_REACH + Type string `json:"type,omitempty"` +} + +type ReportActiveGrpCriteria struct { + // DateRange: The date range this report should be run for. + DateRange *DateRange `json:"dateRange,omitempty"` + + // DimensionFilters: The list of filters on which dimensions are + // filtered. + // Filters for different dimensions are ANDed, filters for the + // same dimension are grouped together and ORed. + // A valid active GRP + // report needs to have exactly one DimensionValue for the United States + // in addition to any advertiser or campaign dimension values. + DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"` + + // Dimensions: The list of dimensions the report should include. + Dimensions []*SortedDimension `json:"dimensions,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` +} + +type ReportCriteria struct { + // Activities: Activity group. + Activities *Activities `json:"activities,omitempty"` + + // CustomRichMediaEvents: Custom Rich Media Events group. + CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"` + + // DateRange: The date range for which this report should be run. + DateRange *DateRange `json:"dateRange,omitempty"` + + // DimensionFilters: The list of filters on which dimensions are + // filtered. + // Filters for different dimensions are ANDed, filters for the + // same dimension are grouped together and ORed. + DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"` + + // Dimensions: The list of standard dimensions the report should + // include. + Dimensions []*SortedDimension `json:"dimensions,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` +} + +type ReportCrossDimensionReachCriteria struct { + // Breakdown: The list of dimensions the report should include. + Breakdown []*SortedDimension `json:"breakdown,omitempty"` + + // DateRange: The date range this report should be run for. + DateRange *DateRange `json:"dateRange,omitempty"` + + // Dimension: The dimension option, one of: + // - "ADVERTISER" + // - + // "CAMPAIGN" + // - "SITE_BY_ADVERTISER" + // - "SITE_BY_CAMPAIGN" + Dimension string `json:"dimension,omitempty"` + + // DimensionFilters: The list of filters on which dimensions are + // filtered. + DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` + + // OverlapMetricNames: The list of names of overlap metrics the report + // should include. + OverlapMetricNames []string `json:"overlapMetricNames,omitempty"` + + // Pivoted: Whether the report is pivoted or not. Defaults to true. + Pivoted bool `json:"pivoted,omitempty"` +} + +type ReportDelivery struct { + // EmailOwner: Whether the report should be emailed to the report owner. + EmailOwner bool `json:"emailOwner,omitempty"` + + // EmailOwnerDeliveryType: The type of delivery for the owner to + // receive, if enabled. One of: + // - "ATTACHMENT" + // - "LINK" + EmailOwnerDeliveryType string `json:"emailOwnerDeliveryType,omitempty"` + + // Message: The message to be sent with each email. + Message string `json:"message,omitempty"` + + // Recipients: The list of recipients to which to email the report. + Recipients []*Recipient `json:"recipients,omitempty"` +} + +type ReportFloodlightCriteria struct { + // CustomRichMediaEvents: The list of custom rich media events to + // include. + CustomRichMediaEvents []*DimensionValue `json:"customRichMediaEvents,omitempty"` + + // DateRange: The date range this report should be run for. + DateRange *DateRange `json:"dateRange,omitempty"` + + // DimensionFilters: The list of filters on which dimensions are + // filtered. + // Filters for different dimensions are ANDed, filters for the + // same dimension are grouped together and ORed. + DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"` + + // Dimensions: The list of dimensions the report should include. + Dimensions []*SortedDimension `json:"dimensions,omitempty"` + + // FloodlightConfigId: The floodlight ID for which to show data in this + // report. All advertisers associated with that ID will automatically be + // added. The dimension of the value needs to be + // 'dfa:floodlightConfigId'. + FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` + + // ReportProperties: The properties of the report. + ReportProperties *ReportFloodlightCriteriaReportProperties `json:"reportProperties,omitempty"` +} + +type ReportFloodlightCriteriaReportProperties struct { + // IncludeAttributedIPConversions: Include conversions that have no + // cookie, but do have an exposure path. + IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"` + + // IncludeUnattributedCookieConversions: Include conversions of users + // with a DoubleClick cookie but without an exposure. That means the + // user did not click or see an ad from the advertiser within the + // Floodlight group, or that the interaction happened outside the + // lookback window. + IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"` + + // IncludeUnattributedIPConversions: Include conversions that have no + // associated cookies and no exposures. It’s therefore impossible to + // know how the user was exposed to your ads during the lookback window + // prior to a conversion. + IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"` +} + +type ReportPathToConversionCriteria struct { + // ActivityFilters: The list of 'dfa:activity' values to filter on. + ActivityFilters []*DimensionValue `json:"activityFilters,omitempty"` + + // ConversionDimensions: The list of conversion dimensions the report + // should include. + ConversionDimensions []*SortedDimension `json:"conversionDimensions,omitempty"` + + // CustomFloodlightVariables: The list of custom floodlight variables + // the report should include. + CustomFloodlightVariables []*SortedDimension `json:"customFloodlightVariables,omitempty"` + + // CustomRichMediaEvents: The list of custom rich media events to + // include. + CustomRichMediaEvents []*DimensionValue `json:"customRichMediaEvents,omitempty"` + + // DateRange: The date range this report should be run for. + DateRange *DateRange `json:"dateRange,omitempty"` + + // FloodlightConfigId: The floodlight ID for which to show data in this + // report. All advertisers associated with that ID will automatically be + // added. The dimension of the value needs to be + // 'dfa:floodlightConfigId'. + FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` + + // PerInteractionDimensions: The list of per interaction dimensions the + // report should include. + PerInteractionDimensions []*SortedDimension `json:"perInteractionDimensions,omitempty"` + + // ReportProperties: The properties of the report. + ReportProperties *ReportPathToConversionCriteriaReportProperties `json:"reportProperties,omitempty"` +} + +type ReportPathToConversionCriteriaReportProperties struct { + // ClicksLookbackWindow: DFA checks to see if a click interaction + // occurred within the specified period of time before a conversion. By + // default the value is pulled from Floodlight or you can manually enter + // a custom value. Valid values: 1-90. + ClicksLookbackWindow int64 `json:"clicksLookbackWindow,omitempty"` + + // ImpressionsLookbackWindow: DFA checks to see if an impression + // interaction occurred within the specified period of time before a + // conversion. By default the value is pulled from Floodlight or you can + // manually enter a custom value. Valid values: 1-90. + ImpressionsLookbackWindow int64 `json:"impressionsLookbackWindow,omitempty"` + + // IncludeAttributedIPConversions: Deprecated: has no effect. + IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"` + + // IncludeUnattributedCookieConversions: Include conversions of users + // with a DoubleClick cookie but without an exposure. That means the + // user did not click or see an ad from the advertiser within the + // Floodlight group, or that the interaction happened outside the + // lookback window. + IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"` + + // IncludeUnattributedIPConversions: Include conversions that have no + // associated cookies and no exposures. It’s therefore impossible to + // know how the user was exposed to your ads during the lookback window + // prior to a conversion. + IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"` + + // MaximumClickInteractions: The maximum number of click interactions to + // include in the report. Advertisers currently paying for E2C reports + // get up to 200 (100 clicks, 100 impressions). If another advertiser in + // your network is paying for E2C, you can have up to 5 total exposures + // per report. + MaximumClickInteractions int64 `json:"maximumClickInteractions,omitempty"` + + // MaximumImpressionInteractions: The maximum number of click + // interactions to include in the report. Advertisers currently paying + // for E2C reports get up to 200 (100 clicks, 100 impressions). If + // another advertiser in your network is paying for E2C, you can have up + // to 5 total exposures per report. + MaximumImpressionInteractions int64 `json:"maximumImpressionInteractions,omitempty"` + + // MaximumInteractionGap: The maximum amount of time that can take place + // between interactions (clicks or impressions) by the same user. Valid + // values: 1-90. + MaximumInteractionGap int64 `json:"maximumInteractionGap,omitempty"` + + // PivotOnInteractionPath: Enable pivoting on interaction path. + PivotOnInteractionPath bool `json:"pivotOnInteractionPath,omitempty"` +} + +type ReportReachCriteria struct { + // Activities: Activity group. + Activities *Activities `json:"activities,omitempty"` + + // CustomRichMediaEvents: Custom Rich Media Events group. + CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"` + + // DateRange: The date range this report should be run for. + DateRange *DateRange `json:"dateRange,omitempty"` + + // DimensionFilters: The list of filters on which dimensions are + // filtered. + // Filters for different dimensions are ANDed, filters for the + // same dimension are grouped together and ORed. + DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"` + + // Dimensions: The list of dimensions the report should include. + Dimensions []*SortedDimension `json:"dimensions,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` + + // ReachByFrequencyMetricNames: The list of names of Reach By Frequency + // metrics the report should include. + ReachByFrequencyMetricNames []string `json:"reachByFrequencyMetricNames,omitempty"` +} + +type ReportSchedule struct { + // Active: Whether the schedule is active or not. Must be set to either + // true or false. + Active bool `json:"active,omitempty"` + + // Every: Defines every how many days, weeks or months the report should + // be run. Needs to be set when "repeats" is either "DAILY", "WEEKLY" or + // "MONTHLY". + Every int64 `json:"every,omitempty"` + + // ExpirationDate: The expiration date when the scheduled report stops + // running. + ExpirationDate string `json:"expirationDate,omitempty"` + + // Repeats: The interval for which the report is repeated, one of: + // - + // "DAILY", also requires field "every" to be set. + // - "WEEKLY", also + // requires fields "every" and "repeatsOnWeekDays" to be set. + // - + // "TWICE_A_MONTH" + // - "MONTHLY", also requires fields "every" and + // "runsOnDayOfMonth" to be set. + // - "QUARTERLY" + // - "YEARLY" + Repeats string `json:"repeats,omitempty"` + + // RepeatsOnWeekDays: List of week days "WEEKLY" on which scheduled + // reports should run. + RepeatsOnWeekDays []string `json:"repeatsOnWeekDays,omitempty"` + + // RunsOnDayOfMonth: Enum to define for "MONTHLY" scheduled reports + // whether reports should be repeated on the same day of the month as + // "startDate" or the same day of the week of the month. Possible values + // are: + // - DAY_OF_MONTH + // - WEEK_OF_MONTH + // Example: If 'startDate' is + // Monday, April 2nd 2012 (2012-04-02), "DAY_OF_MONTH" would run + // subsequent reports on the 2nd of every Month, and "WEEK_OF_MONTH" + // would run subsequent reports on the first Monday of the month. + RunsOnDayOfMonth string `json:"runsOnDayOfMonth,omitempty"` + + // StartDate: Start date of date range for which scheduled reports + // should be run. + StartDate string `json:"startDate,omitempty"` +} + +type ReportCompatibleFields struct { + // DimensionFilters: Dimensions which are compatible to be selected in + // the "dimensionFilters" section of the report. + DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"` + + // Dimensions: Dimensions which are compatible to be selected in the + // "dimensions" section of the report. + Dimensions []*Dimension `json:"dimensions,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#reportCompatibleFields. + Kind string `json:"kind,omitempty"` + + // Metrics: Metrics which are compatible to be selected in the + // "metricNames" section of the report. + Metrics []*Metric `json:"metrics,omitempty"` + + // PivotedActivityMetrics: Metrics which are compatible to be selected + // as activity metrics to pivot on in the "activities" section of the + // report. + PivotedActivityMetrics []*Metric `json:"pivotedActivityMetrics,omitempty"` +} + +type ReportList struct { + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The reports returned in this response. + Items []*Report `json:"items,omitempty"` + + // Kind: The kind of list this is, in this case dfareporting#reportList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through reports. To + // retrieve the next page of results, set the next request's "pageToken" + // to the value of this field. The page token is only valid for a + // limited amount of time and should not be persisted. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type SortedDimension struct { + // Kind: The kind of resource this is, in this case + // dfareporting#sortedDimension. + Kind string `json:"kind,omitempty"` + + // Name: The name of the dimension. + Name string `json:"name,omitempty"` + + // SortOrder: An optional sort order for the dimension column, one of: + // + // - "ASCENDING" + // - "DESCENDING" + SortOrder string `json:"sortOrder,omitempty"` +} + +type UserProfile struct { + // AccountId: The account ID to which this profile belongs. + AccountId int64 `json:"accountId,omitempty,string"` + + // AccountName: The account name this profile belongs to. + AccountName string `json:"accountName,omitempty"` + + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Kind: The kind of resource this is, in this case + // dfareporting#userProfile. + Kind string `json:"kind,omitempty"` + + // ProfileId: The unique ID of the user profile. + ProfileId int64 `json:"profileId,omitempty,string"` + + // SubAccountId: The sub account ID this profile belongs to if + // applicable. + SubAccountId int64 `json:"subAccountId,omitempty,string"` + + // SubAccountName: The sub account name this profile belongs to if + // applicable. + SubAccountName string `json:"subAccountName,omitempty"` + + // UserName: The user name. + UserName string `json:"userName,omitempty"` +} + +type UserProfileList struct { + // Etag: The eTag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The user profiles returned in this response. + Items []*UserProfile `json:"items,omitempty"` + + // Kind: The kind of list this is, in this case + // dfareporting#userProfileList. + Kind string `json:"kind,omitempty"` +} + +// method id "dfareporting.dimensionValues.query": + +type DimensionValuesQueryCall struct { + s *Service + profileId int64 + dimensionvaluerequest *DimensionValueRequest + opt_ map[string]interface{} +} + +// Query: Retrieves list of report dimension values for a list of +// filters. +func (r *DimensionValuesService) Query(profileId int64, dimensionvaluerequest *DimensionValueRequest) *DimensionValuesQueryCall { + c := &DimensionValuesQueryCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.dimensionvaluerequest = dimensionvaluerequest + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *DimensionValuesQueryCall) MaxResults(maxResults int64) *DimensionValuesQueryCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous result page. +func (c *DimensionValuesQueryCall) PageToken(pageToken string) *DimensionValuesQueryCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *DimensionValuesQueryCall) Do() (*DimensionValueList, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.dimensionvaluerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DimensionValueList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves list of report dimension values for a list of filters.", + // "httpMethod": "POST", + // "id": "dfareporting.dimensionValues.query", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/dimensionvalues/query", + // "request": { + // "$ref": "DimensionValueRequest" + // }, + // "response": { + // "$ref": "DimensionValueList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.files.get": + +type FilesGetCall struct { + s *Service + reportId int64 + fileId int64 + opt_ map[string]interface{} +} + +// Get: Retrieves a report file by its report ID and file ID. +func (r *FilesService) Get(reportId int64, fileId int64) *FilesGetCall { + c := &FilesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.reportId = reportId + c.fileId = fileId + return c +} + +func (c *FilesGetCall) Do() (*File, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", strconv.FormatInt(c.fileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a report file by its report ID and file ID.", + // "httpMethod": "GET", + // "id": "dfareporting.files.get", + // "parameterOrder": [ + // "reportId", + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the report file.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "reports/{reportId}/files/{fileId}", + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "dfareporting.files.list": + +type FilesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} +} + +// List: Lists files for a user profile. +func (r *FilesService) List(profileId int64) *FilesListCall { + c := &FilesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *FilesListCall) MaxResults(maxResults int64) *FilesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous result page. +func (c *FilesListCall) PageToken(pageToken string) *FilesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Scope sets the optional parameter "scope": The scope that defines +// which results are returned, default is 'MINE'. +func (c *FilesListCall) Scope(scope string) *FilesListCall { + c.opt_["scope"] = scope + return c +} + +// SortField sets the optional parameter "sortField": The field by which +// to sort the list. +func (c *FilesListCall) SortField(sortField string) *FilesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is 'DESCENDING'. +func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *FilesListCall) Do() (*FileList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["scope"]; ok { + params.Set("scope", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortField"]; ok { + params.Set("sortField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(FileList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists files for a user profile.", + // "httpMethod": "GET", + // "id": "dfareporting.files.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "maximum": "10", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "scope": { + // "default": "MINE", + // "description": "The scope that defines which results are returned, default is 'MINE'.", + // "enum": [ + // "ALL", + // "MINE", + // "SHARED_WITH_ME" + // ], + // "enumDescriptions": [ + // "All files in account.", + // "My files.", + // "Files shared with me." + // ], + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "default": "LAST_MODIFIED_TIME", + // "description": "The field by which to sort the list.", + // "enum": [ + // "ID", + // "LAST_MODIFIED_TIME" + // ], + // "enumDescriptions": [ + // "Sort by file ID.", + // "Sort by 'lastmodifiedAt' field." + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "default": "DESCENDING", + // "description": "Order of sorted results, default is 'DESCENDING'.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "Ascending order.", + // "Descending order." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/files", + // "response": { + // "$ref": "FileList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.delete": + +type ReportsDeleteCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} +} + +// Delete: Deletes a report by its ID. +func (r *ReportsService) Delete(profileId int64, reportId int64) *ReportsDeleteCall { + c := &ReportsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + return c +} + +func (c *ReportsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a report by its ID.", + // "httpMethod": "DELETE", + // "id": "dfareporting.reports.delete", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.get": + +type ReportsGetCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} +} + +// Get: Retrieves a report by its ID. +func (r *ReportsService) Get(profileId int64, reportId int64) *ReportsGetCall { + c := &ReportsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + return c +} + +func (c *ReportsGetCall) Do() (*Report, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a report by its ID.", + // "httpMethod": "GET", + // "id": "dfareporting.reports.get", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}", + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.insert": + +type ReportsInsertCall struct { + s *Service + profileId int64 + report *Report + opt_ map[string]interface{} +} + +// Insert: Creates a report. +func (r *ReportsService) Insert(profileId int64, report *Report) *ReportsInsertCall { + c := &ReportsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.report = report + return c +} + +func (c *ReportsInsertCall) Do() (*Report, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a report.", + // "httpMethod": "POST", + // "id": "dfareporting.reports.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports", + // "request": { + // "$ref": "Report" + // }, + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.list": + +type ReportsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} +} + +// List: Retrieves list of reports. +func (r *ReportsService) List(profileId int64) *ReportsListCall { + c := &ReportsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *ReportsListCall) MaxResults(maxResults int64) *ReportsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous result page. +func (c *ReportsListCall) PageToken(pageToken string) *ReportsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Scope sets the optional parameter "scope": The scope that defines +// which results are returned, default is 'MINE'. +func (c *ReportsListCall) Scope(scope string) *ReportsListCall { + c.opt_["scope"] = scope + return c +} + +// SortField sets the optional parameter "sortField": The field by which +// to sort the list. +func (c *ReportsListCall) SortField(sortField string) *ReportsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is 'DESCENDING'. +func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *ReportsListCall) Do() (*ReportList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["scope"]; ok { + params.Set("scope", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortField"]; ok { + params.Set("sortField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ReportList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves list of reports.", + // "httpMethod": "GET", + // "id": "dfareporting.reports.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "maximum": "10", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "scope": { + // "default": "MINE", + // "description": "The scope that defines which results are returned, default is 'MINE'.", + // "enum": [ + // "ALL", + // "MINE" + // ], + // "enumDescriptions": [ + // "All reports in account.", + // "My reports." + // ], + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "default": "LAST_MODIFIED_TIME", + // "description": "The field by which to sort the list.", + // "enum": [ + // "ID", + // "LAST_MODIFIED_TIME", + // "NAME" + // ], + // "enumDescriptions": [ + // "Sort by report ID.", + // "Sort by 'lastModifiedTime' field.", + // "Sort by name of reports." + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "default": "DESCENDING", + // "description": "Order of sorted results, default is 'DESCENDING'.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "Ascending order.", + // "Descending order." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports", + // "response": { + // "$ref": "ReportList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.patch": + +type ReportsPatchCall struct { + s *Service + profileId int64 + reportId int64 + report *Report + opt_ map[string]interface{} +} + +// Patch: Updates a report. This method supports patch semantics. +func (r *ReportsService) Patch(profileId int64, reportId int64, report *Report) *ReportsPatchCall { + c := &ReportsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + c.report = report + return c +} + +func (c *ReportsPatchCall) Do() (*Report, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a report. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.reports.patch", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}", + // "request": { + // "$ref": "Report" + // }, + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.run": + +type ReportsRunCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} +} + +// Run: Runs a report. +func (r *ReportsService) Run(profileId int64, reportId int64) *ReportsRunCall { + c := &ReportsRunCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + return c +} + +// Synchronous sets the optional parameter "synchronous": If set and +// true, tries to run the report synchronously. +func (c *ReportsRunCall) Synchronous(synchronous bool) *ReportsRunCall { + c.opt_["synchronous"] = synchronous + return c +} + +func (c *ReportsRunCall) Do() (*File, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["synchronous"]; ok { + params.Set("synchronous", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Runs a report.", + // "httpMethod": "POST", + // "id": "dfareporting.reports.run", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "synchronous": { + // "description": "If set and true, tries to run the report synchronously.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}/run", + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.update": + +type ReportsUpdateCall struct { + s *Service + profileId int64 + reportId int64 + report *Report + opt_ map[string]interface{} +} + +// Update: Updates a report. +func (r *ReportsService) Update(profileId int64, reportId int64, report *Report) *ReportsUpdateCall { + c := &ReportsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + c.report = report + return c +} + +func (c *ReportsUpdateCall) Do() (*Report, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a report.", + // "httpMethod": "PUT", + // "id": "dfareporting.reports.update", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}", + // "request": { + // "$ref": "Report" + // }, + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.compatibleFields.query": + +type ReportsCompatibleFieldsQueryCall struct { + s *Service + profileId int64 + report *Report + opt_ map[string]interface{} +} + +// Query: Returns the fields that are compatible to be selected in the +// respective sections of a report criteria, given the fields already +// selected in the input report and user permissions. +func (r *ReportsCompatibleFieldsService) Query(profileId int64, report *Report) *ReportsCompatibleFieldsQueryCall { + c := &ReportsCompatibleFieldsQueryCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.report = report + return c +} + +func (c *ReportsCompatibleFieldsQueryCall) Do() (*CompatibleFields, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/compatiblefields/query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CompatibleFields) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the fields that are compatible to be selected in the respective sections of a report criteria, given the fields already selected in the input report and user permissions.", + // "httpMethod": "POST", + // "id": "dfareporting.reports.compatibleFields.query", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/compatiblefields/query", + // "request": { + // "$ref": "Report" + // }, + // "response": { + // "$ref": "CompatibleFields" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.files.get": + +type ReportsFilesGetCall struct { + s *Service + profileId int64 + reportId int64 + fileId int64 + opt_ map[string]interface{} +} + +// Get: Retrieves a report file. +func (r *ReportsFilesService) Get(profileId int64, reportId int64, fileId int64) *ReportsFilesGetCall { + c := &ReportsFilesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + c.fileId = fileId + return c +} + +func (c *ReportsFilesGetCall) Do() (*File, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", strconv.FormatInt(c.fileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a report file.", + // "httpMethod": "GET", + // "id": "dfareporting.reports.files.get", + // "parameterOrder": [ + // "profileId", + // "reportId", + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the report file.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}/files/{fileId}", + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "dfareporting.reports.files.list": + +type ReportsFilesListCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} +} + +// List: Lists files for a report. +func (r *ReportsFilesService) List(profileId int64, reportId int64) *ReportsFilesListCall { + c := &ReportsFilesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *ReportsFilesListCall) MaxResults(maxResults int64) *ReportsFilesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous result page. +func (c *ReportsFilesListCall) PageToken(pageToken string) *ReportsFilesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortField sets the optional parameter "sortField": The field by which +// to sort the list. +func (c *ReportsFilesListCall) SortField(sortField string) *ReportsFilesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is 'DESCENDING'. +func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *ReportsFilesListCall) Do() (*FileList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortField"]; ok { + params.Set("sortField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(FileList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists files for a report.", + // "httpMethod": "GET", + // "id": "dfareporting.reports.files.list", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "maximum": "10", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The ID of the parent report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sortField": { + // "default": "LAST_MODIFIED_TIME", + // "description": "The field by which to sort the list.", + // "enum": [ + // "ID", + // "LAST_MODIFIED_TIME" + // ], + // "enumDescriptions": [ + // "Sort by file ID.", + // "Sort by 'lastmodifiedAt' field." + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "default": "DESCENDING", + // "description": "Order of sorted results, default is 'DESCENDING'.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "Ascending order.", + // "Descending order." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}/files", + // "response": { + // "$ref": "FileList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.userProfiles.get": + +type UserProfilesGetCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} +} + +// Get: Gets one user profile by ID. +func (r *UserProfilesService) Get(profileId int64) *UserProfilesGetCall { + c := &UserProfilesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +func (c *UserProfilesGetCall) Do() (*UserProfile, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UserProfile) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one user profile by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.userProfiles.get", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "The user profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}", + // "response": { + // "$ref": "UserProfile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.userProfiles.list": + +type UserProfilesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves list of user profiles for a user. +func (r *UserProfilesService) List() *UserProfilesListCall { + c := &UserProfilesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *UserProfilesListCall) Do() (*UserProfileList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UserProfileList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves list of user profiles for a user.", + // "httpMethod": "GET", + // "id": "dfareporting.userProfiles.list", + // "path": "userprofiles", + // "response": { + // "$ref": "UserProfileList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1/dfareporting-api.json b/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1/dfareporting-api.json new file mode 100644 index 0000000000000..5ffae72758551 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1/dfareporting-api.json @@ -0,0 +1,1171 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/Km2zbuxZrnAbsnnH2v5x6aMXpTA\"", + "discoveryVersion": "v1", + "id": "dfareporting:v1", + "name": "dfareporting", + "version": "v1", + "title": "DFA Reporting API", + "description": "Lets you create, run and download reports.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "http://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/doubleclick-advertisers/reporting/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/dfareporting/v1/", + "basePath": "/dfareporting/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "dfareporting/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/dfareporting": { + "description": "View and manage DoubleClick for Advertisers reports" + } + } + } + }, + "schemas": { + "DimensionFilter": { + "id": "DimensionFilter", + "type": "object", + "description": "Represents a dimension filter.", + "properties": { + "dimensionName": { + "type": "string", + "description": "The name of the dimension to filter." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case dfareporting#dimensionFilter.", + "default": "dfareporting#dimensionFilter" + }, + "value": { + "type": "string", + "description": "The value of the dimension to filter for." + } + } + }, + "DimensionValue": { + "id": "DimensionValue", + "type": "object", + "description": "Represents a DimensionValue resource.", + "properties": { + "dimensionName": { + "type": "string", + "description": "Name of the dimension." + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID associated with the value if available." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case dfareporting#dimensionValue.", + "default": "dfareporting#dimensionValue" + }, + "value": { + "type": "string", + "description": "The value of the dimension." + } + } + }, + "DimensionValueList": { + "id": "DimensionValueList", + "type": "object", + "description": "Represents the list of DimensionValue resources.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The dimension values returned in this response.", + "items": { + "$ref": "DimensionValue" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case dfareporting#dimensionValueList.", + "default": "dfareporting#dimensionValueList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through dimension values. To retrieve the next page of results, set the next request's \"pageToken\" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted." + } + } + }, + "DimensionValueRequest": { + "id": "DimensionValueRequest", + "type": "object", + "description": "Represents a DimensionValuesRequest.", + "properties": { + "dimensionName": { + "type": "string", + "description": "The name of the dimension values should be requested for." + }, + "endDate": { + "type": "string", + "description": "The end date of the date range for which to retrieve dimension values. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + }, + "filters": { + "type": "array", + "description": "List of filters to filter values by. The filters are ANDed.", + "items": { + "$ref": "DimensionFilter" + } + }, + "kind": { + "type": "string", + "description": "Kind of request this is, in this case dfareporting#dimensionValueRequest.", + "default": "dfareporting#dimensionValueRequest" + }, + "startDate": { + "type": "string", + "description": "The start date of the date range for which to retrieve dimension values. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + } + } + }, + "File": { + "id": "File", + "type": "object", + "description": "Represents a File resource. A File contains the meta-data for a report run. It shows the status of the run and holds the urls to the generated report data if the run is finished and the status is \"REPORT_AVAILABLE\".", + "properties": { + "dateRange": { + "type": "object", + "description": "The date range for which the file has report data.", + "properties": { + "endDate": { + "type": "string", + "description": "The end date of the date range, inclusive. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + }, + "startDate": { + "type": "string", + "description": "The start date of the date range, inclusive. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + } + } + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "fileName": { + "type": "string", + "description": "The file name of the file." + }, + "id": { + "type": "string", + "description": "The unique ID of this report file.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case dfareporting#file.", + "default": "dfareporting#file" + }, + "lastModifiedTime": { + "type": "string", + "description": "The timestamp in milliseconds since epoch when this file was last modified.", + "format": "int64" + }, + "reportId": { + "type": "string", + "description": "The ID of the report this file was generated from.", + "format": "int64" + }, + "status": { + "type": "string", + "description": "The status of the report file, one of: \n- \"PROCESSING\" \n- \"REPORT_AVAILABLE\" \n- \"FAILED\" \n- \"CANCELLED\"" + }, + "urls": { + "type": "object", + "description": "The urls where the completed report file can be downloaded.", + "properties": { + "csv": { + "type": "object", + "description": "Urls for generated CSV data.", + "properties": { + "apiUrl": { + "type": "string", + "description": "The url for downloading the report data through the API." + }, + "browserUrl": { + "type": "string", + "description": "The url for downloading the report data through a browser." + } + } + } + } + } + } + }, + "FileList": { + "id": "FileList", + "type": "object", + "description": "Represents the list of File resources.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The files returned in this response.", + "items": { + "$ref": "File" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case dfareporting#fileList.", + "default": "dfareporting#fileList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through files. To retrieve the next page of results, set the next request's \"pageToken\" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted." + } + } + }, + "Report": { + "id": "Report", + "type": "object", + "description": "Represents a Report resource.", + "properties": { + "accountId": { + "type": "string", + "description": "The account id this report belongs to.", + "format": "int64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "criteria": { + "type": "object", + "description": "The report criteria.", + "properties": { + "activities": { + "type": "object", + "description": "Activity group.", + "properties": { + "filters": { + "type": "array", + "description": "List of activity filters. The dimension values need to be all either of type \"dfa:activity\" or \"dfa:activityGroup\".", + "items": { + "$ref": "DimensionValue" + } + }, + "metricNames": { + "type": "array", + "description": "List of names of floodlight activity metrics.", + "items": { + "type": "string" + } + } + } + }, + "customRichMediaEvents": { + "type": "object", + "description": "Custom Rich Media Events group.", + "properties": { + "filteredEventIds": { + "type": "array", + "description": "List of custom rich media event IDs. Dimension values must be all of type dfa:richMediaEventTypeIdAndName.", + "items": { + "$ref": "DimensionValue" + } + } + } + }, + "dateRange": { + "type": "object", + "description": "The date range this report should be run for.", + "properties": { + "endDate": { + "type": "string", + "description": "The end date of the date range, inclusive. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + }, + "relativeDateRange": { + "type": "string", + "description": "The date range relative to the date of when the report is run, one of: \n- \"TODAY\" \n- \"YESTERDAY\" \n- \"WEEK_TO_DATE\" \n- \"MONTH_TO_DATE\" \n- \"QUARTER_TO_DATE\" \n- \"YEAR_TO_DATE\" \n- \"PREVIOUS_WEEK\" \n- \"PREVIOUS_MONTH\" \n- \"PREVIOUS_QUARTER\" \n- \"PREVIOUS_YEAR\" \n- \"LAST_7_DAYS\" \n- \"LAST_30_DAYS\" \n- \"LAST_90_DAYS\" \n- \"LAST_365_DAYS\" \n- \"LAST_24_MONTHS\"" + }, + "startDate": { + "type": "string", + "description": "The start date of the date range, inclusive. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + } + } + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters dimensions are filtered on.\nFilters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed.", + "items": { + "$ref": "DimensionValue" + } + }, + "dimensions": { + "type": "array", + "description": "The list of dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + } + } + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "fileName": { + "type": "string", + "description": "The file name used when generating report files for this report." + }, + "id": { + "type": "string", + "description": "The unique ID identifying this report resource.", + "format": "int64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case dfareporting#report.", + "default": "dfareporting#report" + }, + "lastModifiedTime": { + "type": "string", + "description": "The timestamp (in milliseconds since epoch) of when this report was last modified.", + "format": "uint64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "name": { + "type": "string", + "description": "The name of the report.", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "ownerProfileId": { + "type": "string", + "description": "The user profile id of the owner of this report.", + "format": "int64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "schedule": { + "type": "object", + "description": "The report's schedule. Can only be set if the report's 'dateRange' is a relative date range and the relative date range is not \"TODAY\".", + "properties": { + "active": { + "type": "boolean", + "description": "Whether the schedule is active or not. Must be set to either true or false.", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "every": { + "type": "integer", + "description": "Defines every how many days, weeks or months the report should be run. Needs to be set when \"repeats\" is either \"DAILY\", \"WEEKLY\" or \"MONTHLY\".", + "format": "int32" + }, + "expirationDate": { + "type": "string", + "description": "The expiration date when the scheduled report stops running.", + "format": "date", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "repeats": { + "type": "string", + "description": "The interval the report is repeated for, one of: \n- \"DAILY\", also requires field \"every\" to be set. \n- \"WEEKLY\", also requires fields \"every\" and \"repeatsOnWeekDays\" to be set. \n- \"TWICE_A_MONTH\" \n- \"MONTHLY\", also requires fields \"every\" and \"runsOnDayOfMonth\" to be set. \n- \"QUARTERLY\" \n- \"YEARLY\"", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "repeatsOnWeekDays": { + "type": "array", + "description": "List of week days \"WEEKLY\" scheduled reports should run on.", + "items": { + "type": "string" + } + }, + "runsOnDayOfMonth": { + "type": "string", + "description": "Enum to define for \"MONTHLY\" scheduled reports whether reports should be repeated on the same day of the month as \"startDate\" or the same day of the week of the month. Possible values are: \n- DAY_OF_MONTH \n- WEEK_OF_MONTH \nExample: If 'startDate' is Monday, April 2nd 2012 (2012-04-02), \"DAY_OF_MONTH\" would run subsequent reports on the 2nd of every Month, and \"WEEK_OF_MONTH\" would run subsequent reports on the first Monday of the month." + }, + "startDate": { + "type": "string", + "description": "Start date of date range for which scheduled reports should be run.", + "format": "date", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + } + } + }, + "subAccountId": { + "type": "string", + "description": "The subbaccount id this report belongs to if applicable.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "The type of the report, currently only \"STANDARD\" is supported.", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + } + } + }, + "ReportList": { + "id": "ReportList", + "type": "object", + "description": "Represents the list of reports.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The reports returned in this response.", + "items": { + "$ref": "Report" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case dfareporting#reportList.", + "default": "dfareporting#reportList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through reports. To retrieve the next page of results, set the next request's \"pageToken\" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted." + } + } + }, + "SortedDimension": { + "id": "SortedDimension", + "type": "object", + "description": "Represents a sorted dimension.", + "properties": { + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case dfareporting#sortedDimension.", + "default": "dfareporting#sortedDimension" + }, + "name": { + "type": "string", + "description": "The name of the dimension." + }, + "sortOrder": { + "type": "string", + "description": "An optional sort order for the dimension column, one of: \n- \"ASCENDING\" \n- \"DESCENDING\"" + } + } + }, + "UserProfile": { + "id": "UserProfile", + "type": "object", + "description": "Represents a UserProfile resource.", + "properties": { + "accountId": { + "type": "string", + "description": "The account ID this profile belongs to.", + "format": "int64" + }, + "accountName": { + "type": "string", + "description": "The account name this profile belongs to." + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case dfareporting#userProfile.", + "default": "dfareporting#userProfile" + }, + "profileId": { + "type": "string", + "description": "The unique ID of the user profile.", + "format": "int64" + }, + "subAccountId": { + "type": "string", + "description": "The sub account ID this profile belongs to if applicable.", + "format": "int64" + }, + "subAccountName": { + "type": "string", + "description": "The sub account name this profile belongs to if applicable." + }, + "userName": { + "type": "string", + "description": "The user name." + } + } + }, + "UserProfileList": { + "id": "UserProfileList", + "type": "object", + "description": "Represents the list of user profiles.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The user profiles returned in this response.", + "items": { + "$ref": "UserProfile" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case dfareporting#userProfileList.", + "default": "dfareporting#userProfileList" + } + } + } + }, + "resources": { + "dimensionValues": { + "methods": { + "query": { + "id": "dfareporting.dimensionValues.query", + "path": "userprofiles/{profileId}/dimensionvalues/query", + "httpMethod": "POST", + "description": "Retrieves list of report dimension values for a list of filters.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA user profile id.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "DimensionValueRequest" + }, + "response": { + "$ref": "DimensionValueList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + }, + "files": { + "methods": { + "list": { + "id": "dfareporting.files.list", + "path": "userprofiles/{profileId}/files", + "httpMethod": "GET", + "description": "Lists files for a user profile.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "minimum": "0", + "maximum": "10", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA profile id.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortField": { + "type": "string", + "description": "The field to sort the list by.", + "default": "LAST_MODIFIED_TIME", + "enum": [ + "ID", + "LAST_MODIFIED_TIME" + ], + "enumDescriptions": [ + "Sort by file id.", + "Sort by 'lastmodifiedAt' field." + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is 'DESCENDING'.", + "default": "DESCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FileList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + }, + "reports": { + "methods": { + "delete": { + "id": "dfareporting.reports.delete", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "DELETE", + "description": "Deletes a report by its id.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile id.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The id of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "get": { + "id": "dfareporting.reports.get", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "GET", + "description": "Retrieves a report by its id.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile id.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The id of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "insert": { + "id": "dfareporting.reports.insert", + "path": "userprofiles/{profileId}/reports", + "httpMethod": "POST", + "description": "Creates a report.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile id.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Report" + }, + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "list": { + "id": "dfareporting.reports.list", + "path": "userprofiles/{profileId}/reports", + "httpMethod": "GET", + "description": "Retrieves list of reports.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "minimum": "0", + "maximum": "10", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA user profile id.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortField": { + "type": "string", + "description": "The field to sort the list by.", + "default": "LAST_MODIFIED_TIME", + "enum": [ + "ID", + "LAST_MODIFIED_TIME", + "NAME" + ], + "enumDescriptions": [ + "Sort by report id.", + "Sort by 'lastModifiedTime' field.", + "Sort by display name of reports." + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is 'DESCENDING'.", + "default": "DESCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ReportList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "patch": { + "id": "dfareporting.reports.patch", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "PATCH", + "description": "Updates a report. This method supports patch semantics.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile id.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The id of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "request": { + "$ref": "Report" + }, + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "run": { + "id": "dfareporting.reports.run", + "path": "userprofiles/{profileId}/reports/{reportId}/run", + "httpMethod": "POST", + "description": "Runs a report.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA profile id.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The id of the report.", + "required": true, + "format": "int64", + "location": "path" + }, + "synchronous": { + "type": "boolean", + "description": "If set and true, tries to run the report synchronously.", + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "update": { + "id": "dfareporting.reports.update", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "PUT", + "description": "Updates a report.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile id.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The id of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "request": { + "$ref": "Report" + }, + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + }, + "resources": { + "files": { + "methods": { + "get": { + "id": "dfareporting.reports.files.get", + "path": "userprofiles/{profileId}/reports/{reportId}/files/{fileId}", + "httpMethod": "GET", + "description": "Retrieves a report file.", + "parameters": { + "fileId": { + "type": "string", + "description": "The id of the report file.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "The DFA profile id.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The id of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId", + "fileId" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "list": { + "id": "dfareporting.reports.files.list", + "path": "userprofiles/{profileId}/reports/{reportId}/files", + "httpMethod": "GET", + "description": "Lists files for a report.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "minimum": "0", + "maximum": "10", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA profile id.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The id of the parent report.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortField": { + "type": "string", + "description": "The field to sort the list by.", + "default": "LAST_MODIFIED_TIME", + "enum": [ + "ID", + "LAST_MODIFIED_TIME" + ], + "enumDescriptions": [ + "Sort by file id.", + "Sort by 'lastmodifiedAt' field." + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is 'DESCENDING'.", + "default": "DESCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "response": { + "$ref": "FileList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + } + } + }, + "userProfiles": { + "methods": { + "get": { + "id": "dfareporting.userProfiles.get", + "path": "userprofiles/{profileId}", + "httpMethod": "GET", + "description": "Gets one user profile by id.", + "parameters": { + "profileId": { + "type": "string", + "description": "The user profile id.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "UserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "list": { + "id": "dfareporting.userProfiles.list", + "path": "userprofiles", + "httpMethod": "GET", + "description": "Retrieves list of user profiles for a user.", + "response": { + "$ref": "UserProfileList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1/dfareporting-gen.go b/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1/dfareporting-gen.go new file mode 100644 index 0000000000000..f6de129e7bd2a --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/dfareporting/v1/dfareporting-gen.go @@ -0,0 +1,1748 @@ +// Package dfareporting provides access to the DFA Reporting API. +// +// See https://developers.google.com/doubleclick-advertisers/reporting/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/dfareporting/v1" +// ... +// dfareportingService, err := dfareporting.New(oauthHttpClient) +package dfareporting + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "dfareporting:v1" +const apiName = "dfareporting" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/dfareporting/v1/" + +// OAuth2 scopes used by this API. +const ( + // View and manage DoubleClick for Advertisers reports + DfareportingScope = "https://www.googleapis.com/auth/dfareporting" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.DimensionValues = NewDimensionValuesService(s) + s.Files = NewFilesService(s) + s.Reports = NewReportsService(s) + s.UserProfiles = NewUserProfilesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + DimensionValues *DimensionValuesService + + Files *FilesService + + Reports *ReportsService + + UserProfiles *UserProfilesService +} + +func NewDimensionValuesService(s *Service) *DimensionValuesService { + rs := &DimensionValuesService{s: s} + return rs +} + +type DimensionValuesService struct { + s *Service +} + +func NewFilesService(s *Service) *FilesService { + rs := &FilesService{s: s} + return rs +} + +type FilesService struct { + s *Service +} + +func NewReportsService(s *Service) *ReportsService { + rs := &ReportsService{s: s} + rs.Files = NewReportsFilesService(s) + return rs +} + +type ReportsService struct { + s *Service + + Files *ReportsFilesService +} + +func NewReportsFilesService(s *Service) *ReportsFilesService { + rs := &ReportsFilesService{s: s} + return rs +} + +type ReportsFilesService struct { + s *Service +} + +func NewUserProfilesService(s *Service) *UserProfilesService { + rs := &UserProfilesService{s: s} + return rs +} + +type UserProfilesService struct { + s *Service +} + +type DimensionFilter struct { + // DimensionName: The name of the dimension to filter. + DimensionName string `json:"dimensionName,omitempty"` + + // Kind: Kind of resource this is, in this case + // dfareporting#dimensionFilter. + Kind string `json:"kind,omitempty"` + + // Value: The value of the dimension to filter for. + Value string `json:"value,omitempty"` +} + +type DimensionValue struct { + // DimensionName: Name of the dimension. + DimensionName string `json:"dimensionName,omitempty"` + + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Id: The ID associated with the value if available. + Id string `json:"id,omitempty"` + + // Kind: Kind of resource this is, in this case + // dfareporting#dimensionValue. + Kind string `json:"kind,omitempty"` + + // Value: The value of the dimension. + Value string `json:"value,omitempty"` +} + +type DimensionValueList struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The dimension values returned in this response. + Items []*DimensionValue `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case + // dfareporting#dimensionValueList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through dimension + // values. To retrieve the next page of results, set the next request's + // "pageToken" to the value of this field. The page token is only valid + // for a limited amount of time and should not be persisted. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type DimensionValueRequest struct { + // DimensionName: The name of the dimension values should be requested + // for. + DimensionName string `json:"dimensionName,omitempty"` + + // EndDate: The end date of the date range for which to retrieve + // dimension values. A string of the format: "yyyy-MM-dd". + EndDate string `json:"endDate,omitempty"` + + // Filters: List of filters to filter values by. The filters are ANDed. + Filters []*DimensionFilter `json:"filters,omitempty"` + + // Kind: Kind of request this is, in this case + // dfareporting#dimensionValueRequest. + Kind string `json:"kind,omitempty"` + + // StartDate: The start date of the date range for which to retrieve + // dimension values. A string of the format: "yyyy-MM-dd". + StartDate string `json:"startDate,omitempty"` +} + +type File struct { + // DateRange: The date range for which the file has report data. + DateRange *FileDateRange `json:"dateRange,omitempty"` + + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // FileName: The file name of the file. + FileName string `json:"fileName,omitempty"` + + // Id: The unique ID of this report file. + Id int64 `json:"id,omitempty,string"` + + // Kind: Kind of resource this is, in this case dfareporting#file. + Kind string `json:"kind,omitempty"` + + // LastModifiedTime: The timestamp in milliseconds since epoch when this + // file was last modified. + LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"` + + // ReportId: The ID of the report this file was generated from. + ReportId int64 `json:"reportId,omitempty,string"` + + // Status: The status of the report file, one of: + // - "PROCESSING" + // - + // "REPORT_AVAILABLE" + // - "FAILED" + // - "CANCELLED" + Status string `json:"status,omitempty"` + + // Urls: The urls where the completed report file can be downloaded. + Urls *FileUrls `json:"urls,omitempty"` +} + +type FileDateRange struct { + // EndDate: The end date of the date range, inclusive. A string of the + // format: "yyyy-MM-dd". + EndDate string `json:"endDate,omitempty"` + + // StartDate: The start date of the date range, inclusive. A string of + // the format: "yyyy-MM-dd". + StartDate string `json:"startDate,omitempty"` +} + +type FileUrls struct { + // Csv: Urls for generated CSV data. + Csv *FileUrlsCsv `json:"csv,omitempty"` +} + +type FileUrlsCsv struct { + // ApiUrl: The url for downloading the report data through the API. + ApiUrl string `json:"apiUrl,omitempty"` + + // BrowserUrl: The url for downloading the report data through a + // browser. + BrowserUrl string `json:"browserUrl,omitempty"` +} + +type FileList struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The files returned in this response. + Items []*File `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case dfareporting#fileList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through files. To + // retrieve the next page of results, set the next request's "pageToken" + // to the value of this field. The page token is only valid for a + // limited amount of time and should not be persisted. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Report struct { + // AccountId: The account id this report belongs to. + AccountId int64 `json:"accountId,omitempty,string"` + + // Criteria: The report criteria. + Criteria *ReportCriteria `json:"criteria,omitempty"` + + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // FileName: The file name used when generating report files for this + // report. + FileName string `json:"fileName,omitempty"` + + // Id: The unique ID identifying this report resource. + Id int64 `json:"id,omitempty,string"` + + // Kind: Kind of resource this is, in this case dfareporting#report. + Kind string `json:"kind,omitempty"` + + // LastModifiedTime: The timestamp (in milliseconds since epoch) of when + // this report was last modified. + LastModifiedTime uint64 `json:"lastModifiedTime,omitempty,string"` + + // Name: The name of the report. + Name string `json:"name,omitempty"` + + // OwnerProfileId: The user profile id of the owner of this report. + OwnerProfileId int64 `json:"ownerProfileId,omitempty,string"` + + // Schedule: The report's schedule. Can only be set if the report's + // 'dateRange' is a relative date range and the relative date range is + // not "TODAY". + Schedule *ReportSchedule `json:"schedule,omitempty"` + + // SubAccountId: The subbaccount id this report belongs to if + // applicable. + SubAccountId int64 `json:"subAccountId,omitempty,string"` + + // Type: The type of the report, currently only "STANDARD" is supported. + Type string `json:"type,omitempty"` +} + +type ReportCriteria struct { + // Activities: Activity group. + Activities *ReportCriteriaActivities `json:"activities,omitempty"` + + // CustomRichMediaEvents: Custom Rich Media Events group. + CustomRichMediaEvents *ReportCriteriaCustomRichMediaEvents `json:"customRichMediaEvents,omitempty"` + + // DateRange: The date range this report should be run for. + DateRange *ReportCriteriaDateRange `json:"dateRange,omitempty"` + + // DimensionFilters: The list of filters dimensions are filtered + // on. + // Filters for different dimensions are ANDed, filters for the same + // dimension are grouped together and ORed. + DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"` + + // Dimensions: The list of dimensions the report should include. + Dimensions []*SortedDimension `json:"dimensions,omitempty"` + + // MetricNames: The list of names of metrics the report should include. + MetricNames []string `json:"metricNames,omitempty"` +} + +type ReportCriteriaActivities struct { + // Filters: List of activity filters. The dimension values need to be + // all either of type "dfa:activity" or "dfa:activityGroup". + Filters []*DimensionValue `json:"filters,omitempty"` + + // MetricNames: List of names of floodlight activity metrics. + MetricNames []string `json:"metricNames,omitempty"` +} + +type ReportCriteriaCustomRichMediaEvents struct { + // FilteredEventIds: List of custom rich media event IDs. Dimension + // values must be all of type dfa:richMediaEventTypeIdAndName. + FilteredEventIds []*DimensionValue `json:"filteredEventIds,omitempty"` +} + +type ReportCriteriaDateRange struct { + // EndDate: The end date of the date range, inclusive. A string of the + // format: "yyyy-MM-dd". + EndDate string `json:"endDate,omitempty"` + + // RelativeDateRange: The date range relative to the date of when the + // report is run, one of: + // - "TODAY" + // - "YESTERDAY" + // - "WEEK_TO_DATE" + // + // - "MONTH_TO_DATE" + // - "QUARTER_TO_DATE" + // - "YEAR_TO_DATE" + // - + // "PREVIOUS_WEEK" + // - "PREVIOUS_MONTH" + // - "PREVIOUS_QUARTER" + // - + // "PREVIOUS_YEAR" + // - "LAST_7_DAYS" + // - "LAST_30_DAYS" + // - "LAST_90_DAYS" + // + // - "LAST_365_DAYS" + // - "LAST_24_MONTHS" + RelativeDateRange string `json:"relativeDateRange,omitempty"` + + // StartDate: The start date of the date range, inclusive. A string of + // the format: "yyyy-MM-dd". + StartDate string `json:"startDate,omitempty"` +} + +type ReportSchedule struct { + // Active: Whether the schedule is active or not. Must be set to either + // true or false. + Active bool `json:"active,omitempty"` + + // Every: Defines every how many days, weeks or months the report should + // be run. Needs to be set when "repeats" is either "DAILY", "WEEKLY" or + // "MONTHLY". + Every int64 `json:"every,omitempty"` + + // ExpirationDate: The expiration date when the scheduled report stops + // running. + ExpirationDate string `json:"expirationDate,omitempty"` + + // Repeats: The interval the report is repeated for, one of: + // - + // "DAILY", also requires field "every" to be set. + // - "WEEKLY", also + // requires fields "every" and "repeatsOnWeekDays" to be set. + // - + // "TWICE_A_MONTH" + // - "MONTHLY", also requires fields "every" and + // "runsOnDayOfMonth" to be set. + // - "QUARTERLY" + // - "YEARLY" + Repeats string `json:"repeats,omitempty"` + + // RepeatsOnWeekDays: List of week days "WEEKLY" scheduled reports + // should run on. + RepeatsOnWeekDays []string `json:"repeatsOnWeekDays,omitempty"` + + // RunsOnDayOfMonth: Enum to define for "MONTHLY" scheduled reports + // whether reports should be repeated on the same day of the month as + // "startDate" or the same day of the week of the month. Possible values + // are: + // - DAY_OF_MONTH + // - WEEK_OF_MONTH + // Example: If 'startDate' is + // Monday, April 2nd 2012 (2012-04-02), "DAY_OF_MONTH" would run + // subsequent reports on the 2nd of every Month, and "WEEK_OF_MONTH" + // would run subsequent reports on the first Monday of the month. + RunsOnDayOfMonth string `json:"runsOnDayOfMonth,omitempty"` + + // StartDate: Start date of date range for which scheduled reports + // should be run. + StartDate string `json:"startDate,omitempty"` +} + +type ReportList struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The reports returned in this response. + Items []*Report `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case dfareporting#reportList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token used to page through reports. To + // retrieve the next page of results, set the next request's "pageToken" + // to the value of this field. The page token is only valid for a + // limited amount of time and should not be persisted. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type SortedDimension struct { + // Kind: Kind of resource this is, in this case + // dfareporting#sortedDimension. + Kind string `json:"kind,omitempty"` + + // Name: The name of the dimension. + Name string `json:"name,omitempty"` + + // SortOrder: An optional sort order for the dimension column, one of: + // + // - "ASCENDING" + // - "DESCENDING" + SortOrder string `json:"sortOrder,omitempty"` +} + +type UserProfile struct { + // AccountId: The account ID this profile belongs to. + AccountId int64 `json:"accountId,omitempty,string"` + + // AccountName: The account name this profile belongs to. + AccountName string `json:"accountName,omitempty"` + + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Kind: Kind of resource this is, in this case + // dfareporting#userProfile. + Kind string `json:"kind,omitempty"` + + // ProfileId: The unique ID of the user profile. + ProfileId int64 `json:"profileId,omitempty,string"` + + // SubAccountId: The sub account ID this profile belongs to if + // applicable. + SubAccountId int64 `json:"subAccountId,omitempty,string"` + + // SubAccountName: The sub account name this profile belongs to if + // applicable. + SubAccountName string `json:"subAccountName,omitempty"` + + // UserName: The user name. + UserName string `json:"userName,omitempty"` +} + +type UserProfileList struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The user profiles returned in this response. + Items []*UserProfile `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case + // dfareporting#userProfileList. + Kind string `json:"kind,omitempty"` +} + +// method id "dfareporting.dimensionValues.query": + +type DimensionValuesQueryCall struct { + s *Service + profileId int64 + dimensionvaluerequest *DimensionValueRequest + opt_ map[string]interface{} +} + +// Query: Retrieves list of report dimension values for a list of +// filters. +func (r *DimensionValuesService) Query(profileId int64, dimensionvaluerequest *DimensionValueRequest) *DimensionValuesQueryCall { + c := &DimensionValuesQueryCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.dimensionvaluerequest = dimensionvaluerequest + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *DimensionValuesQueryCall) MaxResults(maxResults int64) *DimensionValuesQueryCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous result page. +func (c *DimensionValuesQueryCall) PageToken(pageToken string) *DimensionValuesQueryCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *DimensionValuesQueryCall) Do() (*DimensionValueList, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.dimensionvaluerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DimensionValueList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves list of report dimension values for a list of filters.", + // "httpMethod": "POST", + // "id": "dfareporting.dimensionValues.query", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA user profile id.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/dimensionvalues/query", + // "request": { + // "$ref": "DimensionValueRequest" + // }, + // "response": { + // "$ref": "DimensionValueList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.files.list": + +type FilesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} +} + +// List: Lists files for a user profile. +func (r *FilesService) List(profileId int64) *FilesListCall { + c := &FilesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *FilesListCall) MaxResults(maxResults int64) *FilesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous result page. +func (c *FilesListCall) PageToken(pageToken string) *FilesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortField sets the optional parameter "sortField": The field to sort +// the list by. +func (c *FilesListCall) SortField(sortField string) *FilesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is 'DESCENDING'. +func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *FilesListCall) Do() (*FileList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortField"]; ok { + params.Set("sortField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(FileList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists files for a user profile.", + // "httpMethod": "GET", + // "id": "dfareporting.files.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "maximum": "10", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA profile id.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sortField": { + // "default": "LAST_MODIFIED_TIME", + // "description": "The field to sort the list by.", + // "enum": [ + // "ID", + // "LAST_MODIFIED_TIME" + // ], + // "enumDescriptions": [ + // "Sort by file id.", + // "Sort by 'lastmodifiedAt' field." + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "default": "DESCENDING", + // "description": "Order of sorted results, default is 'DESCENDING'.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "Ascending order.", + // "Descending order." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/files", + // "response": { + // "$ref": "FileList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.delete": + +type ReportsDeleteCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} +} + +// Delete: Deletes a report by its id. +func (r *ReportsService) Delete(profileId int64, reportId int64) *ReportsDeleteCall { + c := &ReportsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + return c +} + +func (c *ReportsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a report by its id.", + // "httpMethod": "DELETE", + // "id": "dfareporting.reports.delete", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile id.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The id of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.get": + +type ReportsGetCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} +} + +// Get: Retrieves a report by its id. +func (r *ReportsService) Get(profileId int64, reportId int64) *ReportsGetCall { + c := &ReportsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + return c +} + +func (c *ReportsGetCall) Do() (*Report, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a report by its id.", + // "httpMethod": "GET", + // "id": "dfareporting.reports.get", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile id.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The id of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}", + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.insert": + +type ReportsInsertCall struct { + s *Service + profileId int64 + report *Report + opt_ map[string]interface{} +} + +// Insert: Creates a report. +func (r *ReportsService) Insert(profileId int64, report *Report) *ReportsInsertCall { + c := &ReportsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.report = report + return c +} + +func (c *ReportsInsertCall) Do() (*Report, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a report.", + // "httpMethod": "POST", + // "id": "dfareporting.reports.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile id.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports", + // "request": { + // "$ref": "Report" + // }, + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.list": + +type ReportsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} +} + +// List: Retrieves list of reports. +func (r *ReportsService) List(profileId int64) *ReportsListCall { + c := &ReportsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *ReportsListCall) MaxResults(maxResults int64) *ReportsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous result page. +func (c *ReportsListCall) PageToken(pageToken string) *ReportsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortField sets the optional parameter "sortField": The field to sort +// the list by. +func (c *ReportsListCall) SortField(sortField string) *ReportsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is 'DESCENDING'. +func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *ReportsListCall) Do() (*ReportList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortField"]; ok { + params.Set("sortField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ReportList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves list of reports.", + // "httpMethod": "GET", + // "id": "dfareporting.reports.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "maximum": "10", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA user profile id.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sortField": { + // "default": "LAST_MODIFIED_TIME", + // "description": "The field to sort the list by.", + // "enum": [ + // "ID", + // "LAST_MODIFIED_TIME", + // "NAME" + // ], + // "enumDescriptions": [ + // "Sort by report id.", + // "Sort by 'lastModifiedTime' field.", + // "Sort by display name of reports." + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "default": "DESCENDING", + // "description": "Order of sorted results, default is 'DESCENDING'.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "Ascending order.", + // "Descending order." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports", + // "response": { + // "$ref": "ReportList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.patch": + +type ReportsPatchCall struct { + s *Service + profileId int64 + reportId int64 + report *Report + opt_ map[string]interface{} +} + +// Patch: Updates a report. This method supports patch semantics. +func (r *ReportsService) Patch(profileId int64, reportId int64, report *Report) *ReportsPatchCall { + c := &ReportsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + c.report = report + return c +} + +func (c *ReportsPatchCall) Do() (*Report, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a report. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.reports.patch", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile id.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The id of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}", + // "request": { + // "$ref": "Report" + // }, + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.run": + +type ReportsRunCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} +} + +// Run: Runs a report. +func (r *ReportsService) Run(profileId int64, reportId int64) *ReportsRunCall { + c := &ReportsRunCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + return c +} + +// Synchronous sets the optional parameter "synchronous": If set and +// true, tries to run the report synchronously. +func (c *ReportsRunCall) Synchronous(synchronous bool) *ReportsRunCall { + c.opt_["synchronous"] = synchronous + return c +} + +func (c *ReportsRunCall) Do() (*File, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["synchronous"]; ok { + params.Set("synchronous", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Runs a report.", + // "httpMethod": "POST", + // "id": "dfareporting.reports.run", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA profile id.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The id of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "synchronous": { + // "description": "If set and true, tries to run the report synchronously.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}/run", + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.update": + +type ReportsUpdateCall struct { + s *Service + profileId int64 + reportId int64 + report *Report + opt_ map[string]interface{} +} + +// Update: Updates a report. +func (r *ReportsService) Update(profileId int64, reportId int64, report *Report) *ReportsUpdateCall { + c := &ReportsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + c.report = report + return c +} + +func (c *ReportsUpdateCall) Do() (*Report, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.report) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a report.", + // "httpMethod": "PUT", + // "id": "dfareporting.reports.update", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "profileId": { + // "description": "The DFA user profile id.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The id of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}", + // "request": { + // "$ref": "Report" + // }, + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.files.get": + +type ReportsFilesGetCall struct { + s *Service + profileId int64 + reportId int64 + fileId int64 + opt_ map[string]interface{} +} + +// Get: Retrieves a report file. +func (r *ReportsFilesService) Get(profileId int64, reportId int64, fileId int64) *ReportsFilesGetCall { + c := &ReportsFilesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + c.fileId = fileId + return c +} + +func (c *ReportsFilesGetCall) Do() (*File, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", strconv.FormatInt(c.fileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a report file.", + // "httpMethod": "GET", + // "id": "dfareporting.reports.files.get", + // "parameterOrder": [ + // "profileId", + // "reportId", + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The id of the report file.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA profile id.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The id of the report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}/files/{fileId}", + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.reports.files.list": + +type ReportsFilesListCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} +} + +// List: Lists files for a report. +func (r *ReportsFilesService) List(profileId int64, reportId int64) *ReportsFilesListCall { + c := &ReportsFilesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.reportId = reportId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *ReportsFilesListCall) MaxResults(maxResults int64) *ReportsFilesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous result page. +func (c *ReportsFilesListCall) PageToken(pageToken string) *ReportsFilesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortField sets the optional parameter "sortField": The field to sort +// the list by. +func (c *ReportsFilesListCall) SortField(sortField string) *ReportsFilesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is 'DESCENDING'. +func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *ReportsFilesListCall) Do() (*FileList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortField"]; ok { + params.Set("sortField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(FileList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists files for a report.", + // "httpMethod": "GET", + // "id": "dfareporting.reports.files.list", + // "parameterOrder": [ + // "profileId", + // "reportId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "maximum": "10", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "The DFA profile id.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "reportId": { + // "description": "The id of the parent report.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sortField": { + // "default": "LAST_MODIFIED_TIME", + // "description": "The field to sort the list by.", + // "enum": [ + // "ID", + // "LAST_MODIFIED_TIME" + // ], + // "enumDescriptions": [ + // "Sort by file id.", + // "Sort by 'lastmodifiedAt' field." + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "default": "DESCENDING", + // "description": "Order of sorted results, default is 'DESCENDING'.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "Ascending order.", + // "Descending order." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/reports/{reportId}/files", + // "response": { + // "$ref": "FileList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.userProfiles.get": + +type UserProfilesGetCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} +} + +// Get: Gets one user profile by id. +func (r *UserProfilesService) Get(profileId int64) *UserProfilesGetCall { + c := &UserProfilesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +func (c *UserProfilesGetCall) Do() (*UserProfile, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UserProfile) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one user profile by id.", + // "httpMethod": "GET", + // "id": "dfareporting.userProfiles.get", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "The user profile id.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}", + // "response": { + // "$ref": "UserProfile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} + +// method id "dfareporting.userProfiles.list": + +type UserProfilesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves list of user profiles for a user. +func (r *UserProfilesService) List() *UserProfilesListCall { + c := &UserProfilesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *UserProfilesListCall) Do() (*UserProfileList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UserProfileList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves list of user profiles for a user.", + // "httpMethod": "GET", + // "id": "dfareporting.userProfiles.list", + // "path": "userprofiles", + // "response": { + // "$ref": "UserProfileList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfareporting" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/discovery/v1/discovery-api.json b/third_party/src/code.google.com/p/google-api-go-client/discovery/v1/discovery-api.json new file mode 100644 index 0000000000000..200602e90ba48 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/discovery/v1/discovery-api.json @@ -0,0 +1,674 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/UNFMI_ENJ3hAFRWSi4GLSerTeFg\"", + "discoveryVersion": "v1", + "id": "discovery:v1", + "name": "discovery", + "version": "v1", + "title": "APIs Discovery Service", + "description": "Lets you discover information about other Google APIs, such as what APIs are available, the resource and method details for each API.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/feature/filing_cabinet_search-g16.png", + "x32": "http://www.google.com/images/icons/feature/filing_cabinet_search-g32.png" + }, + "documentationLink": "https://developers.google.com/discovery/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/discovery/v1/", + "basePath": "/discovery/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "discovery/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" + } + }, + "schemas": { + "DirectoryList": { + "id": "DirectoryList", + "type": "object", + "properties": { + "discoveryVersion": { + "type": "string", + "description": "Indicate the version of the Discovery API used to generate this doc.", + "default": "v1" + }, + "items": { + "type": "array", + "description": "The individual directory entries. One entry per api/version pair.", + "items": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "The description of this API." + }, + "discoveryLink": { + "type": "string", + "description": "A link to the discovery document." + }, + "discoveryRestUrl": { + "type": "string", + "description": "The URL for the discovery REST document." + }, + "documentationLink": { + "type": "string", + "description": "A link to human readable documentation for the API." + }, + "icons": { + "type": "object", + "description": "Links to 16x16 and 32x32 icons representing the API.", + "properties": { + "x16": { + "type": "string", + "description": "The URL of the 16x16 icon." + }, + "x32": { + "type": "string", + "description": "The URL of the 32x32 icon." + } + } + }, + "id": { + "type": "string", + "description": "The id of this API." + }, + "kind": { + "type": "string", + "description": "The kind for this response.", + "default": "discovery#directoryItem" + }, + "labels": { + "type": "array", + "description": "Labels for the status of this API, such as labs or deprecated.", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "description": "The name of the API." + }, + "preferred": { + "type": "boolean", + "description": "True if this version is the preferred version to use." + }, + "title": { + "type": "string", + "description": "The title of this API." + }, + "version": { + "type": "string", + "description": "The version of the API." + } + } + } + }, + "kind": { + "type": "string", + "description": "The kind for this response.", + "default": "discovery#directoryList" + } + } + }, + "JsonSchema": { + "id": "JsonSchema", + "type": "object", + "properties": { + "$ref": { + "type": "string", + "description": "A reference to another schema. The value of this property is the \"id\" of another schema." + }, + "additionalProperties": { + "$ref": "JsonSchema", + "description": "If this is a schema for an object, this property is the schema for any additional properties with dynamic keys on this object." + }, + "annotations": { + "type": "object", + "description": "Additional information about this property.", + "properties": { + "required": { + "type": "array", + "description": "A list of methods for which this property is required on requests.", + "items": { + "type": "string" + } + } + } + }, + "default": { + "type": "string", + "description": "The default value of this property (if one exists)." + }, + "description": { + "type": "string", + "description": "A description of this object." + }, + "enum": { + "type": "array", + "description": "Values this parameter may take (if it is an enum).", + "items": { + "type": "string" + } + }, + "enumDescriptions": { + "type": "array", + "description": "The descriptions for the enums. Each position maps to the corresponding value in the \"enum\" array.", + "items": { + "type": "string" + } + }, + "format": { + "type": "string", + "description": "An additional regular expression or key that helps constrain the value. For more details see: http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.23" + }, + "id": { + "type": "string", + "description": "Unique identifier for this schema." + }, + "items": { + "$ref": "JsonSchema", + "description": "If this is a schema for an array, this property is the schema for each element in the array." + }, + "location": { + "type": "string", + "description": "Whether this parameter goes in the query or the path for REST requests." + }, + "maximum": { + "type": "string", + "description": "The maximum value of this parameter." + }, + "minimum": { + "type": "string", + "description": "The minimum value of this parameter." + }, + "pattern": { + "type": "string", + "description": "The regular expression this parameter must conform to. Uses Java 6 regex format: http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html" + }, + "properties": { + "type": "object", + "description": "If this is a schema for an object, list the schema for each property of this object.", + "additionalProperties": { + "$ref": "JsonSchema", + "description": "A single property of this object. The value is itself a JSON Schema object describing this property." + } + }, + "readOnly": { + "type": "boolean", + "description": "The value is read-only, generated by the service. The value cannot be modified by the client. If the value is included in a POST, PUT, or PATCH request, it is ignored by the service." + }, + "repeated": { + "type": "boolean", + "description": "Whether this parameter may appear multiple times." + }, + "required": { + "type": "boolean", + "description": "Whether the parameter is required." + }, + "type": { + "type": "string", + "description": "The value type for this schema. A list of values can be found here: http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1" + }, + "variant": { + "type": "object", + "description": "In a variant data type, the value of one property is used to determine how to interpret the entire entity. Its value must exist in a map of descriminant values to schema names.", + "properties": { + "discriminant": { + "type": "string", + "description": "The name of the type discriminant property." + }, + "map": { + "type": "array", + "description": "The map of discriminant value to schema to use for parsing..", + "items": { + "type": "object", + "properties": { + "$ref": { + "type": "string" + }, + "type_value": { + "type": "string" + } + } + } + } + } + } + } + }, + "RestDescription": { + "id": "RestDescription", + "type": "object", + "properties": { + "auth": { + "type": "object", + "description": "Authentication information.", + "properties": { + "oauth2": { + "type": "object", + "description": "OAuth 2.0 authentication information.", + "properties": { + "scopes": { + "type": "object", + "description": "Available OAuth 2.0 scopes.", + "additionalProperties": { + "type": "object", + "description": "The scope value.", + "properties": { + "description": { + "type": "string", + "description": "Description of scope." + } + } + } + } + } + } + } + }, + "basePath": { + "type": "string", + "description": "[DEPRECATED] The base path for REST requests." + }, + "baseUrl": { + "type": "string", + "description": "[DEPRECATED] The base URL for REST requests." + }, + "batchPath": { + "type": "string", + "description": "The path for REST batch requests.", + "default": "batch" + }, + "canonicalName": { + "type": "string", + "description": "Indicates how the API name should be capitalized and split into various parts. Useful for generating pretty class names." + }, + "description": { + "type": "string", + "description": "The description of this API." + }, + "discoveryVersion": { + "type": "string", + "description": "Indicate the version of the Discovery API used to generate this doc.", + "default": "v1" + }, + "documentationLink": { + "type": "string", + "description": "A link to human readable documentation for the API." + }, + "etag": { + "type": "string", + "description": "The ETag for this response.", + "readOnly": true + }, + "features": { + "type": "array", + "description": "A list of supported features for this API.", + "items": { + "type": "string" + } + }, + "icons": { + "type": "object", + "description": "Links to 16x16 and 32x32 icons representing the API.", + "properties": { + "x16": { + "type": "string", + "description": "The URL of the 16x16 icon." + }, + "x32": { + "type": "string", + "description": "The URL of the 32x32 icon." + } + } + }, + "id": { + "type": "string", + "description": "The ID of this API." + }, + "kind": { + "type": "string", + "description": "The kind for this response.", + "default": "discovery#restDescription" + }, + "labels": { + "type": "array", + "description": "Labels for the status of this API, such as labs or deprecated.", + "items": { + "type": "string" + } + }, + "methods": { + "type": "object", + "description": "API-level methods for this API.", + "additionalProperties": { + "$ref": "RestMethod", + "description": "An individual method description." + } + }, + "name": { + "type": "string", + "description": "The name of this API." + }, + "ownerDomain": { + "type": "string", + "description": "The domain of the owner of this API. Together with the ownerName and a packagePath values, this can be used to generate a library for this API which would have a unique fully qualified name." + }, + "ownerName": { + "type": "string", + "description": "The name of the owner of this API. See ownerDomain." + }, + "packagePath": { + "type": "string", + "description": "The package of the owner of this API. See ownerDomain." + }, + "parameters": { + "type": "object", + "description": "Common parameters that apply across all apis.", + "additionalProperties": { + "$ref": "JsonSchema", + "description": "Description of a single parameter." + } + }, + "protocol": { + "type": "string", + "description": "The protocol described by this document.", + "default": "rest" + }, + "resources": { + "type": "object", + "description": "The resources in this API.", + "additionalProperties": { + "$ref": "RestResource", + "description": "An individual resource description. Contains methods and sub-resources related to this resource." + } + }, + "revision": { + "type": "string", + "description": "The version of this API." + }, + "rootUrl": { + "type": "string", + "description": "The root URL under which all API services live." + }, + "schemas": { + "type": "object", + "description": "The schemas for this API.", + "additionalProperties": { + "$ref": "JsonSchema", + "description": "An individual schema description." + } + }, + "servicePath": { + "type": "string", + "description": "The base path for all REST requests." + }, + "title": { + "type": "string", + "description": "The title of this API." + }, + "version": { + "type": "string", + "description": "The version of this API." + } + } + }, + "RestMethod": { + "id": "RestMethod", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Description of this method." + }, + "etagRequired": { + "type": "boolean", + "description": "Whether this method requires an ETag to be specified. The ETag is sent as an HTTP If-Match or If-None-Match header." + }, + "httpMethod": { + "type": "string", + "description": "HTTP method used by this method." + }, + "id": { + "type": "string", + "description": "A unique ID for this method. This property can be used to match methods between different versions of Discovery." + }, + "mediaUpload": { + "type": "object", + "description": "Media upload parameters.", + "properties": { + "accept": { + "type": "array", + "description": "MIME Media Ranges for acceptable media uploads to this method.", + "items": { + "type": "string" + } + }, + "maxSize": { + "type": "string", + "description": "Maximum size of a media upload, such as \"1MB\", \"2GB\" or \"3TB\"." + }, + "protocols": { + "type": "object", + "description": "Supported upload protocols.", + "properties": { + "resumable": { + "type": "object", + "description": "Supports the Resumable Media Upload protocol.", + "properties": { + "multipart": { + "type": "boolean", + "description": "True if this endpoint supports uploading multipart media.", + "default": "true" + }, + "path": { + "type": "string", + "description": "The URI path to be used for upload. Should be used in conjunction with the basePath property at the api-level." + } + } + }, + "simple": { + "type": "object", + "description": "Supports uploading as a single HTTP request.", + "properties": { + "multipart": { + "type": "boolean", + "description": "True if this endpoint supports upload multipart media.", + "default": "true" + }, + "path": { + "type": "string", + "description": "The URI path to be used for upload. Should be used in conjunction with the basePath property at the api-level." + } + } + } + } + } + } + }, + "parameterOrder": { + "type": "array", + "description": "Ordered list of required parameters, serves as a hint to clients on how to structure their method signatures. The array is ordered such that the \"most-significant\" parameter appears first.", + "items": { + "type": "string" + } + }, + "parameters": { + "type": "object", + "description": "Details for all parameters in this method.", + "additionalProperties": { + "$ref": "JsonSchema", + "description": "Details for a single parameter in this method." + } + }, + "path": { + "type": "string", + "description": "The URI path of this REST method. Should be used in conjunction with the basePath property at the api-level." + }, + "request": { + "type": "object", + "description": "The schema for the request.", + "properties": { + "$ref": { + "type": "string", + "description": "Schema ID for the request schema." + }, + "parameterName": { + "type": "string", + "description": "parameter name." + } + } + }, + "response": { + "type": "object", + "description": "The schema for the response.", + "properties": { + "$ref": { + "type": "string", + "description": "Schema ID for the response schema." + } + } + }, + "scopes": { + "type": "array", + "description": "OAuth 2.0 scopes applicable to this method.", + "items": { + "type": "string" + } + }, + "supportsMediaDownload": { + "type": "boolean", + "description": "Whether this method supports media downloads." + }, + "supportsMediaUpload": { + "type": "boolean", + "description": "Whether this method supports media uploads." + }, + "supportsSubscription": { + "type": "boolean", + "description": "Whether this method supports subscriptions." + } + } + }, + "RestResource": { + "id": "RestResource", + "type": "object", + "properties": { + "methods": { + "type": "object", + "description": "Methods on this resource.", + "additionalProperties": { + "$ref": "RestMethod", + "description": "Description for any methods on this resource." + } + }, + "resources": { + "type": "object", + "description": "Sub-resources on this resource.", + "additionalProperties": { + "$ref": "RestResource", + "description": "Description for any sub-resources on this resource." + } + } + } + } + }, + "resources": { + "apis": { + "methods": { + "getRest": { + "id": "discovery.apis.getRest", + "path": "apis/{api}/{version}/rest", + "httpMethod": "GET", + "description": "Retrieve the description of a particular version of an api.", + "parameters": { + "api": { + "type": "string", + "description": "The name of the API.", + "required": true, + "location": "path" + }, + "version": { + "type": "string", + "description": "The version of the API.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "api", + "version" + ], + "response": { + "$ref": "RestDescription" + } + }, + "list": { + "id": "discovery.apis.list", + "path": "apis", + "httpMethod": "GET", + "description": "Retrieve the list of APIs supported at this endpoint.", + "parameters": { + "name": { + "type": "string", + "description": "Only include APIs with the given name.", + "location": "query" + }, + "preferred": { + "type": "boolean", + "description": "Return only the preferred version of an API.", + "default": "false", + "location": "query" + } + }, + "response": { + "$ref": "DirectoryList" + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/discovery/v1/discovery-gen.go b/third_party/src/code.google.com/p/google-api-go-client/discovery/v1/discovery-gen.go new file mode 100644 index 0000000000000..f2d7dd7725942 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/discovery/v1/discovery-gen.go @@ -0,0 +1,621 @@ +// Package discovery provides access to the APIs Discovery Service. +// +// See https://developers.google.com/discovery/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/discovery/v1" +// ... +// discoveryService, err := discovery.New(oauthHttpClient) +package discovery + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "discovery:v1" +const apiName = "discovery" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/discovery/v1/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Apis = NewApisService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Apis *ApisService +} + +func NewApisService(s *Service) *ApisService { + rs := &ApisService{s: s} + return rs +} + +type ApisService struct { + s *Service +} + +type DirectoryList struct { + // DiscoveryVersion: Indicate the version of the Discovery API used to + // generate this doc. + DiscoveryVersion string `json:"discoveryVersion,omitempty"` + + // Items: The individual directory entries. One entry per api/version + // pair. + Items []*DirectoryListItems `json:"items,omitempty"` + + // Kind: The kind for this response. + Kind string `json:"kind,omitempty"` +} + +type DirectoryListItems struct { + // Description: The description of this API. + Description string `json:"description,omitempty"` + + // DiscoveryLink: A link to the discovery document. + DiscoveryLink string `json:"discoveryLink,omitempty"` + + // DiscoveryRestUrl: The URL for the discovery REST document. + DiscoveryRestUrl string `json:"discoveryRestUrl,omitempty"` + + // DocumentationLink: A link to human readable documentation for the + // API. + DocumentationLink string `json:"documentationLink,omitempty"` + + // Icons: Links to 16x16 and 32x32 icons representing the API. + Icons *DirectoryListItemsIcons `json:"icons,omitempty"` + + // Id: The id of this API. + Id string `json:"id,omitempty"` + + // Kind: The kind for this response. + Kind string `json:"kind,omitempty"` + + // Labels: Labels for the status of this API, such as labs or + // deprecated. + Labels []string `json:"labels,omitempty"` + + // Name: The name of the API. + Name string `json:"name,omitempty"` + + // Preferred: True if this version is the preferred version to use. + Preferred bool `json:"preferred,omitempty"` + + // Title: The title of this API. + Title string `json:"title,omitempty"` + + // Version: The version of the API. + Version string `json:"version,omitempty"` +} + +type DirectoryListItemsIcons struct { + // X16: The URL of the 16x16 icon. + X16 string `json:"x16,omitempty"` + + // X32: The URL of the 32x32 icon. + X32 string `json:"x32,omitempty"` +} + +type JsonSchema struct { + // Ref: A reference to another schema. The value of this property is the + // "id" of another schema. + Ref string `json:"$ref,omitempty"` + + // AdditionalProperties: If this is a schema for an object, this + // property is the schema for any additional properties with dynamic + // keys on this object. + AdditionalProperties *JsonSchema `json:"additionalProperties,omitempty"` + + // Annotations: Additional information about this property. + Annotations *JsonSchemaAnnotations `json:"annotations,omitempty"` + + // Default: The default value of this property (if one exists). + Default string `json:"default,omitempty"` + + // Description: A description of this object. + Description string `json:"description,omitempty"` + + // Enum: Values this parameter may take (if it is an enum). + Enum []string `json:"enum,omitempty"` + + // EnumDescriptions: The descriptions for the enums. Each position maps + // to the corresponding value in the "enum" array. + EnumDescriptions []string `json:"enumDescriptions,omitempty"` + + // Format: An additional regular expression or key that helps constrain + // the value. For more details see: + // http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.23 + Format string `json:"format,omitempty"` + + // Id: Unique identifier for this schema. + Id string `json:"id,omitempty"` + + // Items: If this is a schema for an array, this property is the schema + // for each element in the array. + Items *JsonSchema `json:"items,omitempty"` + + // Location: Whether this parameter goes in the query or the path for + // REST requests. + Location string `json:"location,omitempty"` + + // Maximum: The maximum value of this parameter. + Maximum string `json:"maximum,omitempty"` + + // Minimum: The minimum value of this parameter. + Minimum string `json:"minimum,omitempty"` + + // Pattern: The regular expression this parameter must conform to. Uses + // Java 6 regex format: + // http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html + Pattern string `json:"pattern,omitempty"` + + // Properties: If this is a schema for an object, list the schema for + // each property of this object. + Properties *JsonSchemaProperties `json:"properties,omitempty"` + + // ReadOnly: The value is read-only, generated by the service. The value + // cannot be modified by the client. If the value is included in a POST, + // PUT, or PATCH request, it is ignored by the service. + ReadOnly bool `json:"readOnly,omitempty"` + + // Repeated: Whether this parameter may appear multiple times. + Repeated bool `json:"repeated,omitempty"` + + // Required: Whether the parameter is required. + Required bool `json:"required,omitempty"` + + // Type: The value type for this schema. A list of values can be found + // here: http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1 + Type string `json:"type,omitempty"` + + // Variant: In a variant data type, the value of one property is used to + // determine how to interpret the entire entity. Its value must exist in + // a map of descriminant values to schema names. + Variant *JsonSchemaVariant `json:"variant,omitempty"` +} + +type JsonSchemaAnnotations struct { + // Required: A list of methods for which this property is required on + // requests. + Required []string `json:"required,omitempty"` +} + +type JsonSchemaProperties struct { +} + +type JsonSchemaVariant struct { + // Discriminant: The name of the type discriminant property. + Discriminant string `json:"discriminant,omitempty"` + + // Map: The map of discriminant value to schema to use for parsing.. + Map []*JsonSchemaVariantMap `json:"map,omitempty"` +} + +type JsonSchemaVariantMap struct { + Ref string `json:"$ref,omitempty"` + + Type_value string `json:"type_value,omitempty"` +} + +type RestDescription struct { + // Auth: Authentication information. + Auth *RestDescriptionAuth `json:"auth,omitempty"` + + // BasePath: [DEPRECATED] The base path for REST requests. + BasePath string `json:"basePath,omitempty"` + + // BaseUrl: [DEPRECATED] The base URL for REST requests. + BaseUrl string `json:"baseUrl,omitempty"` + + // BatchPath: The path for REST batch requests. + BatchPath string `json:"batchPath,omitempty"` + + // CanonicalName: Indicates how the API name should be capitalized and + // split into various parts. Useful for generating pretty class names. + CanonicalName string `json:"canonicalName,omitempty"` + + // Description: The description of this API. + Description string `json:"description,omitempty"` + + // DiscoveryVersion: Indicate the version of the Discovery API used to + // generate this doc. + DiscoveryVersion string `json:"discoveryVersion,omitempty"` + + // DocumentationLink: A link to human readable documentation for the + // API. + DocumentationLink string `json:"documentationLink,omitempty"` + + // Etag: The ETag for this response. + Etag string `json:"etag,omitempty"` + + // Features: A list of supported features for this API. + Features []string `json:"features,omitempty"` + + // Icons: Links to 16x16 and 32x32 icons representing the API. + Icons *RestDescriptionIcons `json:"icons,omitempty"` + + // Id: The ID of this API. + Id string `json:"id,omitempty"` + + // Kind: The kind for this response. + Kind string `json:"kind,omitempty"` + + // Labels: Labels for the status of this API, such as labs or + // deprecated. + Labels []string `json:"labels,omitempty"` + + // Methods: API-level methods for this API. + Methods *RestDescriptionMethods `json:"methods,omitempty"` + + // Name: The name of this API. + Name string `json:"name,omitempty"` + + // OwnerDomain: The domain of the owner of this API. Together with the + // ownerName and a packagePath values, this can be used to generate a + // library for this API which would have a unique fully qualified name. + OwnerDomain string `json:"ownerDomain,omitempty"` + + // OwnerName: The name of the owner of this API. See ownerDomain. + OwnerName string `json:"ownerName,omitempty"` + + // PackagePath: The package of the owner of this API. See ownerDomain. + PackagePath string `json:"packagePath,omitempty"` + + // Parameters: Common parameters that apply across all apis. + Parameters *RestDescriptionParameters `json:"parameters,omitempty"` + + // Protocol: The protocol described by this document. + Protocol string `json:"protocol,omitempty"` + + // Resources: The resources in this API. + Resources *RestDescriptionResources `json:"resources,omitempty"` + + // Revision: The version of this API. + Revision string `json:"revision,omitempty"` + + // RootUrl: The root URL under which all API services live. + RootUrl string `json:"rootUrl,omitempty"` + + // Schemas: The schemas for this API. + Schemas *RestDescriptionSchemas `json:"schemas,omitempty"` + + // ServicePath: The base path for all REST requests. + ServicePath string `json:"servicePath,omitempty"` + + // Title: The title of this API. + Title string `json:"title,omitempty"` + + // Version: The version of this API. + Version string `json:"version,omitempty"` +} + +type RestDescriptionAuth struct { + // Oauth2: OAuth 2.0 authentication information. + Oauth2 *RestDescriptionAuthOauth2 `json:"oauth2,omitempty"` +} + +type RestDescriptionAuthOauth2 struct { + // Scopes: Available OAuth 2.0 scopes. + Scopes *RestDescriptionAuthOauth2Scopes `json:"scopes,omitempty"` +} + +type RestDescriptionAuthOauth2Scopes struct { +} + +type RestDescriptionIcons struct { + // X16: The URL of the 16x16 icon. + X16 string `json:"x16,omitempty"` + + // X32: The URL of the 32x32 icon. + X32 string `json:"x32,omitempty"` +} + +type RestDescriptionMethods struct { +} + +type RestDescriptionParameters struct { +} + +type RestDescriptionResources struct { +} + +type RestDescriptionSchemas struct { +} + +type RestMethod struct { + // Description: Description of this method. + Description string `json:"description,omitempty"` + + // EtagRequired: Whether this method requires an ETag to be specified. + // The ETag is sent as an HTTP If-Match or If-None-Match header. + EtagRequired bool `json:"etagRequired,omitempty"` + + // HttpMethod: HTTP method used by this method. + HttpMethod string `json:"httpMethod,omitempty"` + + // Id: A unique ID for this method. This property can be used to match + // methods between different versions of Discovery. + Id string `json:"id,omitempty"` + + // MediaUpload: Media upload parameters. + MediaUpload *RestMethodMediaUpload `json:"mediaUpload,omitempty"` + + // ParameterOrder: Ordered list of required parameters, serves as a hint + // to clients on how to structure their method signatures. The array is + // ordered such that the "most-significant" parameter appears first. + ParameterOrder []string `json:"parameterOrder,omitempty"` + + // Parameters: Details for all parameters in this method. + Parameters *RestMethodParameters `json:"parameters,omitempty"` + + // Path: The URI path of this REST method. Should be used in conjunction + // with the basePath property at the api-level. + Path string `json:"path,omitempty"` + + // Request: The schema for the request. + Request *RestMethodRequest `json:"request,omitempty"` + + // Response: The schema for the response. + Response *RestMethodResponse `json:"response,omitempty"` + + // Scopes: OAuth 2.0 scopes applicable to this method. + Scopes []string `json:"scopes,omitempty"` + + // SupportsMediaDownload: Whether this method supports media downloads. + SupportsMediaDownload bool `json:"supportsMediaDownload,omitempty"` + + // SupportsMediaUpload: Whether this method supports media uploads. + SupportsMediaUpload bool `json:"supportsMediaUpload,omitempty"` + + // SupportsSubscription: Whether this method supports subscriptions. + SupportsSubscription bool `json:"supportsSubscription,omitempty"` +} + +type RestMethodMediaUpload struct { + // Accept: MIME Media Ranges for acceptable media uploads to this + // method. + Accept []string `json:"accept,omitempty"` + + // MaxSize: Maximum size of a media upload, such as "1MB", "2GB" or + // "3TB". + MaxSize string `json:"maxSize,omitempty"` + + // Protocols: Supported upload protocols. + Protocols *RestMethodMediaUploadProtocols `json:"protocols,omitempty"` +} + +type RestMethodMediaUploadProtocols struct { + // Resumable: Supports the Resumable Media Upload protocol. + Resumable *RestMethodMediaUploadProtocolsResumable `json:"resumable,omitempty"` + + // Simple: Supports uploading as a single HTTP request. + Simple *RestMethodMediaUploadProtocolsSimple `json:"simple,omitempty"` +} + +type RestMethodMediaUploadProtocolsResumable struct { + // Multipart: True if this endpoint supports uploading multipart media. + Multipart bool `json:"multipart,omitempty"` + + // Path: The URI path to be used for upload. Should be used in + // conjunction with the basePath property at the api-level. + Path string `json:"path,omitempty"` +} + +type RestMethodMediaUploadProtocolsSimple struct { + // Multipart: True if this endpoint supports upload multipart media. + Multipart bool `json:"multipart,omitempty"` + + // Path: The URI path to be used for upload. Should be used in + // conjunction with the basePath property at the api-level. + Path string `json:"path,omitempty"` +} + +type RestMethodParameters struct { +} + +type RestMethodRequest struct { + // Ref: Schema ID for the request schema. + Ref string `json:"$ref,omitempty"` + + // ParameterName: parameter name. + ParameterName string `json:"parameterName,omitempty"` +} + +type RestMethodResponse struct { + // Ref: Schema ID for the response schema. + Ref string `json:"$ref,omitempty"` +} + +type RestResource struct { + // Methods: Methods on this resource. + Methods *RestResourceMethods `json:"methods,omitempty"` + + // Resources: Sub-resources on this resource. + Resources *RestResourceResources `json:"resources,omitempty"` +} + +type RestResourceMethods struct { +} + +type RestResourceResources struct { +} + +// method id "discovery.apis.getRest": + +type ApisGetRestCall struct { + s *Service + api string + version string + opt_ map[string]interface{} +} + +// GetRest: Retrieve the description of a particular version of an api. +func (r *ApisService) GetRest(api string, version string) *ApisGetRestCall { + c := &ApisGetRestCall{s: r.s, opt_: make(map[string]interface{})} + c.api = api + c.version = version + return c +} + +func (c *ApisGetRestCall) Do() (*RestDescription, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "apis/{api}/{version}/rest") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{api}", url.QueryEscape(c.api), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{version}", url.QueryEscape(c.version), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RestDescription) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve the description of a particular version of an api.", + // "httpMethod": "GET", + // "id": "discovery.apis.getRest", + // "parameterOrder": [ + // "api", + // "version" + // ], + // "parameters": { + // "api": { + // "description": "The name of the API.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "version": { + // "description": "The version of the API.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "apis/{api}/{version}/rest", + // "response": { + // "$ref": "RestDescription" + // } + // } + +} + +// method id "discovery.apis.list": + +type ApisListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieve the list of APIs supported at this endpoint. +func (r *ApisService) List() *ApisListCall { + c := &ApisListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Name sets the optional parameter "name": Only include APIs with the +// given name. +func (c *ApisListCall) Name(name string) *ApisListCall { + c.opt_["name"] = name + return c +} + +// Preferred sets the optional parameter "preferred": Return only the +// preferred version of an API. +func (c *ApisListCall) Preferred(preferred bool) *ApisListCall { + c.opt_["preferred"] = preferred + return c +} + +func (c *ApisListCall) Do() (*DirectoryList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["name"]; ok { + params.Set("name", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["preferred"]; ok { + params.Set("preferred", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "apis") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DirectoryList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve the list of APIs supported at this endpoint.", + // "httpMethod": "GET", + // "id": "discovery.apis.list", + // "parameters": { + // "name": { + // "description": "Only include APIs with the given name.", + // "location": "query", + // "type": "string" + // }, + // "preferred": { + // "default": "false", + // "description": "Return only the preferred version of an API.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "apis", + // "response": { + // "$ref": "DirectoryList" + // } + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/dns/v1beta1/dns-api.json b/third_party/src/code.google.com/p/google-api-go-client/dns/v1beta1/dns-api.json new file mode 100644 index 0000000000000..83b306596cd70 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/dns/v1beta1/dns-api.json @@ -0,0 +1,681 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/vvbATqxd_pTRqr3zlWrA5ydszy4\"", + "discoveryVersion": "v1", + "id": "dns:v1beta1", + "name": "dns", + "version": "v1beta1", + "title": "Google Cloud DNS API", + "description": "The Google Cloud DNS API provides services for configuring and serving authoritative DNS records.", + "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/cloud-dns", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/dns/v1beta1/projects/", + "basePath": "/dns/v1beta1/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "dns/v1beta1/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/ndev.clouddns.readonly": { + "description": "View your DNS records hosted by Google Cloud DNS" + }, + "https://www.googleapis.com/auth/ndev.clouddns.readwrite": { + "description": "View and manage your DNS records hosted by Google Cloud DNS" + } + } + } + }, + "schemas": { + "Change": { + "id": "Change", + "type": "object", + "description": "An atomic update to a collection of ResourceRecordSets.", + "properties": { + "additions": { + "type": "array", + "description": "Which ResourceRecordSets to add?", + "items": { + "$ref": "ResourceRecordSet" + } + }, + "deletions": { + "type": "array", + "description": "Which ResourceRecordSets to remove? Must match existing data exactly.", + "items": { + "$ref": "ResourceRecordSet" + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dns#change\".", + "default": "dns#change" + }, + "startTime": { + "type": "string", + "description": "The time that this operation was started by the server. This is in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "Status of the operation. Can be one of the following: \"PENDING\" or \"DONE\" (output only)." + } + } + }, + "ChangesListResponse": { + "id": "ChangesListResponse", + "type": "object", + "description": "The response to a request to enumerate Changes to a ResourceRecordSets collection.", + "properties": { + "changes": { + "type": "array", + "description": "The requested changes.", + "items": { + "$ref": "Change" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "dns#changesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The presence of this field indicates that there exist more results following your last page of results in pagination order. To fetch them, make another list request using this value as your pagination token.\n\nIn this way you can retrieve the complete contents of even very large collections one page at a time. However, if the contents of the collection change between the first and last paginated list request, the set of all elements returned will be an inconsistent view of the collection. There is no way to retrieve a \"snapshot\" of collections larger than the maximum page size." + } + } + }, + "ManagedZone": { + "id": "ManagedZone", + "type": "object", + "description": "A zone is a subtree of the DNS namespace under one administrative responsibility. A ManagedZone is a resource that represents a DNS zone hosted by the Cloud DNS service.", + "properties": { + "creationTime": { + "type": "string", + "description": "The time that this resource was created on the server. This is in RFC3339 text format. Output only." + }, + "description": { + "type": "string", + "description": "A string to associate with this resource for the user's convenience. Has no effect on the managed zone's function." + }, + "dnsName": { + "type": "string", + "description": "The DNS name of this managed zone, for instance \"example.com.\"." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dns#managedZone\".", + "default": "dns#managedZone" + }, + "name": { + "type": "string", + "description": "User assigned name for this resource. Must be unique within the project." + }, + "nameServers": { + "type": "array", + "description": "Delegate your managed_zone to these virtual name servers; defined by the server (output only)", + "items": { + "type": "string" + } + } + } + }, + "ManagedZonesListResponse": { + "id": "ManagedZonesListResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "dns#managedZonesListResponse" + }, + "managedZones": { + "type": "array", + "description": "The managed zone resources.", + "items": { + "$ref": "ManagedZone" + } + }, + "nextPageToken": { + "type": "string", + "description": "The presence of this field indicates that there exist more results following your last page of results in pagination order. To fetch them, make another list request using this value as your page token.\n\nIn this way you can retrieve the complete contents of even very large collections one page at a time. However, if the contents of the collection change between the first and last paginated list request, the set of all elements returned will be an inconsistent view of the collection. There is no way to retrieve a consistent snapshot of a collection larger than the maximum page size." + } + } + }, + "Project": { + "id": "Project", + "type": "object", + "description": "A project resource. The project is a top level container for resources including Cloud DNS ManagedZones. Projects can be created only in the APIs console.", + "properties": { + "id": { + "type": "string", + "description": "User assigned unique identifier for the resource (output only)." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dns#project\".", + "default": "dns#project" + }, + "number": { + "type": "string", + "description": "Unique numeric identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "quota": { + "$ref": "Quota", + "description": "Quotas assigned to this project (output only)." + } + } + }, + "Quota": { + "id": "Quota", + "type": "object", + "description": "Limits associated with a Project.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dns#quota\".", + "default": "dns#quota" + }, + "managedZones": { + "type": "integer", + "description": "Maximum allowed number of managed zones in the project.", + "format": "int32" + }, + "resourceRecordsPerRrset": { + "type": "integer", + "description": "Maximum allowed number of ResourceRecords per ResourceRecordSet.", + "format": "int32" + }, + "rrsetAdditionsPerChange": { + "type": "integer", + "description": "Maximum allowed number of ResourceRecordSets to add per ChangesCreateRequest.", + "format": "int32" + }, + "rrsetDeletionsPerChange": { + "type": "integer", + "description": "Maximum allowed number of ResourceRecordSets to delete per ChangesCreateRequest.", + "format": "int32" + }, + "rrsetsPerManagedZone": { + "type": "integer", + "description": "Maximum allowed number of ResourceRecordSets per zone in the project.", + "format": "int32" + }, + "totalRrdataSizePerChange": { + "type": "integer", + "description": "Maximum allowed size for total rrdata in one ChangesCreateRequest in bytes.", + "format": "int32" + } + } + }, + "ResourceRecordSet": { + "id": "ResourceRecordSet", + "type": "object", + "description": "A unit of data that will be returned by the DNS servers.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dns#resourceRecordSet\".", + "default": "dns#resourceRecordSet" + }, + "name": { + "type": "string", + "description": "For example, www.example.com." + }, + "rrdatas": { + "type": "array", + "description": "As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1)", + "items": { + "type": "string" + } + }, + "ttl": { + "type": "integer", + "description": "Number of seconds that this ResourceRecordSet can be cached by resolvers.", + "format": "int32" + }, + "type": { + "type": "string", + "description": "One of A, AAAA, SOA, MX, NS, TXT" + } + } + }, + "ResourceRecordSetsListResponse": { + "id": "ResourceRecordSetsListResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "dns#resourceRecordSetsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The presence of this field indicates that there exist more results following your last page of results in pagination order. To fetch them, make another list request using this value as your pagination token.\n\nIn this way you can retrieve the complete contents of even very large collections one page at a time. However, if the contents of the collection change between the first and last paginated list request, the set of all elements returned will be an inconsistent view of the collection. There is no way to retrieve a consistent snapshot of a collection larger than the maximum page size." + }, + "rrsets": { + "type": "array", + "description": "The resource record set resources.", + "items": { + "$ref": "ResourceRecordSet" + } + } + } + } + }, + "resources": { + "changes": { + "methods": { + "create": { + "id": "dns.changes.create", + "path": "{project}/managedZones/{managedZone}/changes", + "httpMethod": "POST", + "description": "Atomically update the ResourceRecordSet collection.", + "parameters": { + "managedZone": { + "type": "string", + "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "managedZone" + ], + "request": { + "$ref": "Change" + }, + "response": { + "$ref": "Change" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + }, + "get": { + "id": "dns.changes.get", + "path": "{project}/managedZones/{managedZone}/changes/{changeId}", + "httpMethod": "GET", + "description": "Fetch the representation of an existing Change.", + "parameters": { + "changeId": { + "type": "string", + "description": "The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse.", + "required": true, + "location": "path" + }, + "managedZone": { + "type": "string", + "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "managedZone", + "changeId" + ], + "response": { + "$ref": "Change" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.clouddns.readonly", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + }, + "list": { + "id": "dns.changes.list", + "path": "{project}/managedZones/{managedZone}/changes", + "httpMethod": "GET", + "description": "Enumerate Changes to a ResourceRecordSet collection.", + "parameters": { + "managedZone": { + "type": "string", + "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + }, + "sortBy": { + "type": "string", + "description": "Sorting criterion. The only supported value is change sequence.", + "default": "changeSequence", + "enum": [ + "changeSequence" + ], + "enumDescriptions": [ + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Sorting order direction: 'ascending' or 'descending'.", + "location": "query" + } + }, + "parameterOrder": [ + "project", + "managedZone" + ], + "response": { + "$ref": "ChangesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.clouddns.readonly", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + } + } + }, + "managedZones": { + "methods": { + "create": { + "id": "dns.managedZones.create", + "path": "{project}/managedZones", + "httpMethod": "POST", + "description": "Create a new ManagedZone.", + "parameters": { + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "ManagedZone" + }, + "response": { + "$ref": "ManagedZone" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + }, + "delete": { + "id": "dns.managedZones.delete", + "path": "{project}/managedZones/{managedZone}", + "httpMethod": "DELETE", + "description": "Delete a previously created ManagedZone.", + "parameters": { + "managedZone": { + "type": "string", + "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "managedZone" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + }, + "get": { + "id": "dns.managedZones.get", + "path": "{project}/managedZones/{managedZone}", + "httpMethod": "GET", + "description": "Fetch the representation of an existing ManagedZone.", + "parameters": { + "managedZone": { + "type": "string", + "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "managedZone" + ], + "response": { + "$ref": "ManagedZone" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.clouddns.readonly", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + }, + "list": { + "id": "dns.managedZones.list", + "path": "{project}/managedZones", + "httpMethod": "GET", + "description": "Enumerate ManagedZones that have been created but not yet deleted.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "ManagedZonesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.clouddns.readonly", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + } + } + }, + "projects": { + "methods": { + "get": { + "id": "dns.projects.get", + "path": "{project}", + "httpMethod": "GET", + "description": "Fetch the representation of an existing Project.", + "parameters": { + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.clouddns.readonly", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + } + } + }, + "resourceRecordSets": { + "methods": { + "list": { + "id": "dns.resourceRecordSets.list", + "path": "{project}/managedZones/{managedZone}/rrsets", + "httpMethod": "GET", + "description": "Enumerate ResourceRecordSets that have been created but not yet deleted.", + "parameters": { + "managedZone": { + "type": "string", + "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.", + "format": "int32", + "location": "query" + }, + "name": { + "type": "string", + "description": "Restricts the list to return only records with this fully qualified domain name.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + }, + "type": { + "type": "string", + "description": "Restricts the list to return only records of this type. If present, the \"name\" parameter must also be present.", + "location": "query" + } + }, + "parameterOrder": [ + "project", + "managedZone" + ], + "response": { + "$ref": "ResourceRecordSetsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.clouddns.readonly", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/dns/v1beta1/dns-gen.go b/third_party/src/code.google.com/p/google-api-go-client/dns/v1beta1/dns-gen.go new file mode 100644 index 0000000000000..308dd04397c8a --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/dns/v1beta1/dns-gen.go @@ -0,0 +1,1143 @@ +// Package dns provides access to the Google Cloud DNS API. +// +// See https://developers.google.com/cloud-dns +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/dns/v1beta1" +// ... +// dnsService, err := dns.New(oauthHttpClient) +package dns + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "dns:v1beta1" +const apiName = "dns" +const apiVersion = "v1beta1" +const basePath = "https://www.googleapis.com/dns/v1beta1/projects/" + +// 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" + + // View your DNS records hosted by Google Cloud DNS + NdevClouddnsReadonlyScope = "https://www.googleapis.com/auth/ndev.clouddns.readonly" + + // View and manage your DNS records hosted by Google Cloud DNS + NdevClouddnsReadwriteScope = "https://www.googleapis.com/auth/ndev.clouddns.readwrite" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Changes = NewChangesService(s) + s.ManagedZones = NewManagedZonesService(s) + s.Projects = NewProjectsService(s) + s.ResourceRecordSets = NewResourceRecordSetsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Changes *ChangesService + + ManagedZones *ManagedZonesService + + Projects *ProjectsService + + ResourceRecordSets *ResourceRecordSetsService +} + +func NewChangesService(s *Service) *ChangesService { + rs := &ChangesService{s: s} + return rs +} + +type ChangesService struct { + s *Service +} + +func NewManagedZonesService(s *Service) *ManagedZonesService { + rs := &ManagedZonesService{s: s} + return rs +} + +type ManagedZonesService struct { + s *Service +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + return rs +} + +type ProjectsService struct { + s *Service +} + +func NewResourceRecordSetsService(s *Service) *ResourceRecordSetsService { + rs := &ResourceRecordSetsService{s: s} + return rs +} + +type ResourceRecordSetsService struct { + s *Service +} + +type Change struct { + // Additions: Which ResourceRecordSets to add? + Additions []*ResourceRecordSet `json:"additions,omitempty"` + + // Deletions: Which ResourceRecordSets to remove? Must match existing + // data exactly. + Deletions []*ResourceRecordSet `json:"deletions,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only). + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dns#change". + Kind string `json:"kind,omitempty"` + + // StartTime: The time that this operation was started by the server. + // This is in RFC3339 text format. + StartTime string `json:"startTime,omitempty"` + + // Status: Status of the operation. Can be one of the following: + // "PENDING" or "DONE" (output only). + Status string `json:"status,omitempty"` +} + +type ChangesListResponse struct { + // Changes: The requested changes. + Changes []*Change `json:"changes,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The presence of this field indicates that there exist + // more results following your last page of results in pagination order. + // To fetch them, make another list request using this value as your + // pagination token. + // + // In this way you can retrieve the complete contents + // of even very large collections one page at a time. However, if the + // contents of the collection change between the first and last + // paginated list request, the set of all elements returned will be an + // inconsistent view of the collection. There is no way to retrieve a + // "snapshot" of collections larger than the maximum page size. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type ManagedZone struct { + // CreationTime: The time that this resource was created on the server. + // This is in RFC3339 text format. Output only. + CreationTime string `json:"creationTime,omitempty"` + + // Description: A string to associate with this resource for the user's + // convenience. Has no effect on the managed zone's function. + Description string `json:"description,omitempty"` + + // DnsName: The DNS name of this managed zone, for instance + // "example.com.". + DnsName string `json:"dnsName,omitempty"` + + // Id: Unique identifier for the resource; defined by the server (output + // only) + Id uint64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dns#managedZone". + Kind string `json:"kind,omitempty"` + + // Name: User assigned name for this resource. Must be unique within the + // project. + Name string `json:"name,omitempty"` + + // NameServers: Delegate your managed_zone to these virtual name + // servers; defined by the server (output only) + NameServers []string `json:"nameServers,omitempty"` +} + +type ManagedZonesListResponse struct { + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // ManagedZones: The managed zone resources. + ManagedZones []*ManagedZone `json:"managedZones,omitempty"` + + // NextPageToken: The presence of this field indicates that there exist + // more results following your last page of results in pagination order. + // To fetch them, make another list request using this value as your + // page token. + // + // In this way you can retrieve the complete contents of + // even very large collections one page at a time. However, if the + // contents of the collection change between the first and last + // paginated list request, the set of all elements returned will be an + // inconsistent view of the collection. There is no way to retrieve a + // consistent snapshot of a collection larger than the maximum page + // size. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Project struct { + // Id: User assigned unique identifier for the resource (output only). + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dns#project". + Kind string `json:"kind,omitempty"` + + // Number: Unique numeric identifier for the resource; defined by the + // server (output only). + Number uint64 `json:"number,omitempty,string"` + + // Quota: Quotas assigned to this project (output only). + Quota *Quota `json:"quota,omitempty"` +} + +type Quota struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dns#quota". + Kind string `json:"kind,omitempty"` + + // ManagedZones: Maximum allowed number of managed zones in the project. + ManagedZones int64 `json:"managedZones,omitempty"` + + // ResourceRecordsPerRrset: Maximum allowed number of ResourceRecords + // per ResourceRecordSet. + ResourceRecordsPerRrset int64 `json:"resourceRecordsPerRrset,omitempty"` + + // RrsetAdditionsPerChange: Maximum allowed number of ResourceRecordSets + // to add per ChangesCreateRequest. + RrsetAdditionsPerChange int64 `json:"rrsetAdditionsPerChange,omitempty"` + + // RrsetDeletionsPerChange: Maximum allowed number of ResourceRecordSets + // to delete per ChangesCreateRequest. + RrsetDeletionsPerChange int64 `json:"rrsetDeletionsPerChange,omitempty"` + + // RrsetsPerManagedZone: Maximum allowed number of ResourceRecordSets + // per zone in the project. + RrsetsPerManagedZone int64 `json:"rrsetsPerManagedZone,omitempty"` + + // TotalRrdataSizePerChange: Maximum allowed size for total rrdata in + // one ChangesCreateRequest in bytes. + TotalRrdataSizePerChange int64 `json:"totalRrdataSizePerChange,omitempty"` +} + +type ResourceRecordSet struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dns#resourceRecordSet". + Kind string `json:"kind,omitempty"` + + // Name: For example, www.example.com. + Name string `json:"name,omitempty"` + + // Rrdatas: As defined in RFC 1035 (section 5) and RFC 1034 (section + // 3.6.1) + Rrdatas []string `json:"rrdatas,omitempty"` + + // Ttl: Number of seconds that this ResourceRecordSet can be cached by + // resolvers. + Ttl int64 `json:"ttl,omitempty"` + + // Type: One of A, AAAA, SOA, MX, NS, TXT + Type string `json:"type,omitempty"` +} + +type ResourceRecordSetsListResponse struct { + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The presence of this field indicates that there exist + // more results following your last page of results in pagination order. + // To fetch them, make another list request using this value as your + // pagination token. + // + // In this way you can retrieve the complete contents + // of even very large collections one page at a time. However, if the + // contents of the collection change between the first and last + // paginated list request, the set of all elements returned will be an + // inconsistent view of the collection. There is no way to retrieve a + // consistent snapshot of a collection larger than the maximum page + // size. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Rrsets: The resource record set resources. + Rrsets []*ResourceRecordSet `json:"rrsets,omitempty"` +} + +// method id "dns.changes.create": + +type ChangesCreateCall struct { + s *Service + project string + managedZone string + change *Change + opt_ map[string]interface{} +} + +// Create: Atomically update the ResourceRecordSet collection. +func (r *ChangesService) Create(project string, managedZone string, change *Change) *ChangesCreateCall { + c := &ChangesCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.managedZone = managedZone + c.change = change + return c +} + +func (c *ChangesCreateCall) Do() (*Change, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.change) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{managedZone}", url.QueryEscape(c.managedZone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Change) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Atomically update the ResourceRecordSet collection.", + // "httpMethod": "POST", + // "id": "dns.changes.create", + // "parameterOrder": [ + // "project", + // "managedZone" + // ], + // "parameters": { + // "managedZone": { + // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Identifies the project addressed by this request.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/managedZones/{managedZone}/changes", + // "request": { + // "$ref": "Change" + // }, + // "response": { + // "$ref": "Change" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + // ] + // } + +} + +// method id "dns.changes.get": + +type ChangesGetCall struct { + s *Service + project string + managedZone string + changeId string + opt_ map[string]interface{} +} + +// Get: Fetch the representation of an existing Change. +func (r *ChangesService) Get(project string, managedZone string, changeId string) *ChangesGetCall { + c := &ChangesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.managedZone = managedZone + c.changeId = changeId + return c +} + +func (c *ChangesGetCall) Do() (*Change, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes/{changeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{managedZone}", url.QueryEscape(c.managedZone), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{changeId}", url.QueryEscape(c.changeId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Change) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Fetch the representation of an existing Change.", + // "httpMethod": "GET", + // "id": "dns.changes.get", + // "parameterOrder": [ + // "project", + // "managedZone", + // "changeId" + // ], + // "parameters": { + // "changeId": { + // "description": "The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "managedZone": { + // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Identifies the project addressed by this request.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/managedZones/{managedZone}/changes/{changeId}", + // "response": { + // "$ref": "Change" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.clouddns.readonly", + // "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + // ] + // } + +} + +// method id "dns.changes.list": + +type ChangesListCall struct { + s *Service + project string + managedZone string + opt_ map[string]interface{} +} + +// List: Enumerate Changes to a ResourceRecordSet collection. +func (r *ChangesService) List(project string, managedZone string) *ChangesListCall { + c := &ChangesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.managedZone = managedZone + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to be returned. If unspecified, the server will decide how +// many results to return. +func (c *ChangesListCall) MaxResults(maxResults int64) *ChangesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A tag returned by +// a previous list request that was truncated. Use this parameter to +// continue a previous list request. +func (c *ChangesListCall) PageToken(pageToken string) *ChangesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortBy sets the optional parameter "sortBy": Sorting criterion. The +// only supported value is change sequence. +func (c *ChangesListCall) SortBy(sortBy string) *ChangesListCall { + c.opt_["sortBy"] = sortBy + return c +} + +// SortOrder sets the optional parameter "sortOrder": Sorting order +// direction: 'ascending' or 'descending'. +func (c *ChangesListCall) SortOrder(sortOrder string) *ChangesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *ChangesListCall) Do() (*ChangesListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortBy"]; ok { + params.Set("sortBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{managedZone}", url.QueryEscape(c.managedZone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ChangesListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Enumerate Changes to a ResourceRecordSet collection.", + // "httpMethod": "GET", + // "id": "dns.changes.list", + // "parameterOrder": [ + // "project", + // "managedZone" + // ], + // "parameters": { + // "managedZone": { + // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Identifies the project addressed by this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sortBy": { + // "default": "changeSequence", + // "description": "Sorting criterion. The only supported value is change sequence.", + // "enum": [ + // "changeSequence" + // ], + // "enumDescriptions": [ + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Sorting order direction: 'ascending' or 'descending'.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{project}/managedZones/{managedZone}/changes", + // "response": { + // "$ref": "ChangesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.clouddns.readonly", + // "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + // ] + // } + +} + +// method id "dns.managedZones.create": + +type ManagedZonesCreateCall struct { + s *Service + project string + managedzone *ManagedZone + opt_ map[string]interface{} +} + +// Create: Create a new ManagedZone. +func (r *ManagedZonesService) Create(project string, managedzone *ManagedZone) *ManagedZonesCreateCall { + c := &ManagedZonesCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.managedzone = managedzone + return c +} + +func (c *ManagedZonesCreateCall) Do() (*ManagedZone, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ManagedZone) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a new ManagedZone.", + // "httpMethod": "POST", + // "id": "dns.managedZones.create", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Identifies the project addressed by this request.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/managedZones", + // "request": { + // "$ref": "ManagedZone" + // }, + // "response": { + // "$ref": "ManagedZone" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + // ] + // } + +} + +// method id "dns.managedZones.delete": + +type ManagedZonesDeleteCall struct { + s *Service + project string + managedZone string + opt_ map[string]interface{} +} + +// Delete: Delete a previously created ManagedZone. +func (r *ManagedZonesService) Delete(project string, managedZone string) *ManagedZonesDeleteCall { + c := &ManagedZonesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.managedZone = managedZone + return c +} + +func (c *ManagedZonesDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{managedZone}", url.QueryEscape(c.managedZone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a previously created ManagedZone.", + // "httpMethod": "DELETE", + // "id": "dns.managedZones.delete", + // "parameterOrder": [ + // "project", + // "managedZone" + // ], + // "parameters": { + // "managedZone": { + // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Identifies the project addressed by this request.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/managedZones/{managedZone}", + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + // ] + // } + +} + +// method id "dns.managedZones.get": + +type ManagedZonesGetCall struct { + s *Service + project string + managedZone string + opt_ map[string]interface{} +} + +// Get: Fetch the representation of an existing ManagedZone. +func (r *ManagedZonesService) Get(project string, managedZone string) *ManagedZonesGetCall { + c := &ManagedZonesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.managedZone = managedZone + return c +} + +func (c *ManagedZonesGetCall) Do() (*ManagedZone, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{managedZone}", url.QueryEscape(c.managedZone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ManagedZone) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Fetch the representation of an existing ManagedZone.", + // "httpMethod": "GET", + // "id": "dns.managedZones.get", + // "parameterOrder": [ + // "project", + // "managedZone" + // ], + // "parameters": { + // "managedZone": { + // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Identifies the project addressed by this request.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/managedZones/{managedZone}", + // "response": { + // "$ref": "ManagedZone" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.clouddns.readonly", + // "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + // ] + // } + +} + +// method id "dns.managedZones.list": + +type ManagedZonesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Enumerate ManagedZones that have been created but not yet +// deleted. +func (r *ManagedZonesService) List(project string) *ManagedZonesListCall { + c := &ManagedZonesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to be returned. If unspecified, the server will decide how +// many results to return. +func (c *ManagedZonesListCall) MaxResults(maxResults int64) *ManagedZonesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A tag returned by +// a previous list request that was truncated. Use this parameter to +// continue a previous list request. +func (c *ManagedZonesListCall) PageToken(pageToken string) *ManagedZonesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ManagedZonesListCall) Do() (*ManagedZonesListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ManagedZonesListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Enumerate ManagedZones that have been created but not yet deleted.", + // "httpMethod": "GET", + // "id": "dns.managedZones.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "maxResults": { + // "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Identifies the project addressed by this request.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/managedZones", + // "response": { + // "$ref": "ManagedZonesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.clouddns.readonly", + // "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + // ] + // } + +} + +// method id "dns.projects.get": + +type ProjectsGetCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// Get: Fetch the representation of an existing Project. +func (r *ProjectsService) Get(project string) *ProjectsGetCall { + c := &ProjectsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +func (c *ProjectsGetCall) Do() (*Project, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Project) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Fetch the representation of an existing Project.", + // "httpMethod": "GET", + // "id": "dns.projects.get", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Identifies the project addressed by this request.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}", + // "response": { + // "$ref": "Project" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.clouddns.readonly", + // "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + // ] + // } + +} + +// method id "dns.resourceRecordSets.list": + +type ResourceRecordSetsListCall struct { + s *Service + project string + managedZone string + opt_ map[string]interface{} +} + +// List: Enumerate ResourceRecordSets that have been created but not yet +// deleted. +func (r *ResourceRecordSetsService) List(project string, managedZone string) *ResourceRecordSetsListCall { + c := &ResourceRecordSetsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.managedZone = managedZone + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to be returned. If unspecified, the server will decide how +// many results to return. +func (c *ResourceRecordSetsListCall) MaxResults(maxResults int64) *ResourceRecordSetsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Name sets the optional parameter "name": Restricts the list to return +// only records with this fully qualified domain name. +func (c *ResourceRecordSetsListCall) Name(name string) *ResourceRecordSetsListCall { + c.opt_["name"] = name + return c +} + +// PageToken sets the optional parameter "pageToken": A tag returned by +// a previous list request that was truncated. Use this parameter to +// continue a previous list request. +func (c *ResourceRecordSetsListCall) PageToken(pageToken string) *ResourceRecordSetsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Type sets the optional parameter "type": Restricts the list to return +// only records of this type. If present, the "name" parameter must also +// be present. +func (c *ResourceRecordSetsListCall) Type(type_ string) *ResourceRecordSetsListCall { + c.opt_["type"] = type_ + return c +} + +func (c *ResourceRecordSetsListCall) Do() (*ResourceRecordSetsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["name"]; ok { + params.Set("name", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["type"]; ok { + params.Set("type", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/rrsets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{managedZone}", url.QueryEscape(c.managedZone), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ResourceRecordSetsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Enumerate ResourceRecordSets that have been created but not yet deleted.", + // "httpMethod": "GET", + // "id": "dns.resourceRecordSets.list", + // "parameterOrder": [ + // "project", + // "managedZone" + // ], + // "parameters": { + // "managedZone": { + // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "name": { + // "description": "Restricts the list to return only records with this fully qualified domain name.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Identifies the project addressed by this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "type": { + // "description": "Restricts the list to return only records of this type. If present, the \"name\" parameter must also be present.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{project}/managedZones/{managedZone}/rrsets", + // "response": { + // "$ref": "ResourceRecordSetsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.clouddns.readonly", + // "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/doubleclickbidmanager/v1/doubleclickbidmanager-api.json b/third_party/src/code.google.com/p/google-api-go-client/doubleclickbidmanager/v1/doubleclickbidmanager-api.json new file mode 100644 index 0000000000000..dafb2fd2ead53 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/doubleclickbidmanager/v1/doubleclickbidmanager-api.json @@ -0,0 +1,1497 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/cHDQkg0ZsK0EYoFanzGijdDo1Q4\"", + "discoveryVersion": "v1", + "id": "doubleclickbidmanager:v1", + "name": "doubleclickbidmanager", + "canonicalName": "DoubleClick Bid Manager", + "version": "v1", + "title": "DoubleClick Bid Manager API", + "description": "API for viewing and managing your reports in DoubleClick Bid Manager.", + "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/bid-manager/", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/doubleclickbidmanager/v1/", + "basePath": "/doubleclickbidmanager/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "doubleclickbidmanager/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" + } + }, + "schemas": { + "DownloadLineItemsRequest": { + "id": "DownloadLineItemsRequest", + "type": "object", + "description": "Request to fetch stored line items.", + "properties": { + "filterIds": { + "type": "array", + "description": "Ids of the specified filter type used to filter line items to fetch. If omitted, all the line items will be returned.", + "items": { + "type": "string", + "format": "int64" + } + }, + "filterType": { + "type": "string", + "description": "Filter type used to filter line items to fetch.", + "enum": [ + "ADVERTISER_ID", + "INSERTION_ORDER_ID", + "LINE_ITEM_ID" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "format": { + "type": "string", + "description": "Format in which the line items will be returned. Default to CSV.", + "enum": [ + "CSV" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "DownloadLineItemsResponse": { + "id": "DownloadLineItemsResponse", + "type": "object", + "description": "Download line items response.", + "properties": { + "lineItems": { + "type": "string", + "description": "Retrieved line items in CSV format. Refer to Entity Write File Format for more information on file format." + } + } + }, + "FilterPair": { + "id": "FilterPair", + "type": "object", + "description": "Filter used to match traffic data in your report.", + "properties": { + "type": { + "type": "string", + "description": "Filter type.", + "enum": [ + "FILTER_ACTIVITY_ID", + "FILTER_ADVERTISER", + "FILTER_ADVERTISER_CURRENCY", + "FILTER_ADVERTISER_TIMEZONE", + "FILTER_AD_POSITION", + "FILTER_BRANDSAFE_CHANNEL_ID", + "FILTER_BROWSER", + "FILTER_CAMPAIGN_DAILY_FREQUENCY", + "FILTER_CARRIER", + "FILTER_CHANNEL_ID", + "FILTER_CITY", + "FILTER_CONVERSION_DELAY", + "FILTER_COUNTRY", + "FILTER_CREATIVE_ID", + "FILTER_CREATIVE_SIZE", + "FILTER_CREATIVE_TYPE", + "FILTER_DATA_PROVIDER", + "FILTER_DATE", + "FILTER_DAY_OF_WEEK", + "FILTER_DMA", + "FILTER_EXCHANGE_ID", + "FILTER_FLOODLIGHT_PIXEL_ID", + "FILTER_INSERTION_ORDER", + "FILTER_INVENTORY_FORMAT", + "FILTER_INVENTORY_SOURCE", + "FILTER_KEYWORD", + "FILTER_LINE_ITEM", + "FILTER_LINE_ITEM_DAILY_FREQUENCY", + "FILTER_LINE_ITEM_LIFETIME_FREQUENCY", + "FILTER_LINE_ITEM_TYPE", + "FILTER_MOBILE_DEVICE_MAKE", + "FILTER_MOBILE_DEVICE_MAKE_MODEL", + "FILTER_MOBILE_DEVICE_TYPE", + "FILTER_MONTH", + "FILTER_ORDER_ID", + "FILTER_OS", + "FILTER_PAGE_CATEGORY", + "FILTER_PAGE_LAYOUT", + "FILTER_PARTNER", + "FILTER_PARTNER_CURRENCY", + "FILTER_PUBLIC_INVENTORY", + "FILTER_REGION", + "FILTER_REGULAR_CHANNEL_ID", + "FILTER_SITE_ID", + "FILTER_SITE_LANGUAGE", + "FILTER_TARGETED_USER_LIST", + "FILTER_TIME_OF_DAY", + "FILTER_UNKNOWN", + "FILTER_USER_LIST", + "FILTER_USER_LIST_FIRST_PARTY", + "FILTER_USER_LIST_THIRD_PARTY", + "FILTER_VIDEO_AD_POSITION_IN_STREAM", + "FILTER_VIDEO_CREATIVE_DURATION", + "FILTER_VIDEO_DURATION_SECONDS", + "FILTER_VIDEO_FORMAT_SUPPORT", + "FILTER_VIDEO_INVENTORY_TYPE", + "FILTER_VIDEO_PLAYER_SIZE", + "FILTER_VIDEO_RATING_TIER", + "FILTER_VIDEO_SKIPPABLE_SUPPORT", + "FILTER_VIDEO_VPAID_SUPPORT", + "FILTER_WEEK", + "FILTER_YEAR", + "FILTER_YOUTUBE_VERTICAL", + "FILTER_ZIP_CODE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "value": { + "type": "string", + "description": "Filter value." + } + } + }, + "ListQueriesResponse": { + "id": "ListQueriesResponse", + "type": "object", + "description": "List queries response.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"doubleclickbidmanager#listQueriesResponse\".", + "default": "doubleclickbidmanager#listQueriesResponse" + }, + "queries": { + "type": "array", + "description": "Retrieved queries.", + "items": { + "$ref": "Query" + } + } + } + }, + "ListReportsResponse": { + "id": "ListReportsResponse", + "type": "object", + "description": "List reports response.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"doubleclickbidmanager#listReportsResponse\".", + "default": "doubleclickbidmanager#listReportsResponse" + }, + "reports": { + "type": "array", + "description": "Retrieved reports.", + "items": { + "$ref": "Report" + } + } + } + }, + "Parameters": { + "id": "Parameters", + "type": "object", + "description": "Parameters of a query or report.", + "properties": { + "filters": { + "type": "array", + "description": "Filters used to match traffic data in your report.", + "items": { + "$ref": "FilterPair" + } + }, + "groupBys": { + "type": "array", + "description": "Data is grouped by the filters listed in this field.", + "items": { + "type": "string", + "enum": [ + "FILTER_ACTIVITY_ID", + "FILTER_ADVERTISER", + "FILTER_ADVERTISER_CURRENCY", + "FILTER_ADVERTISER_TIMEZONE", + "FILTER_AD_POSITION", + "FILTER_BRANDSAFE_CHANNEL_ID", + "FILTER_BROWSER", + "FILTER_CAMPAIGN_DAILY_FREQUENCY", + "FILTER_CARRIER", + "FILTER_CHANNEL_ID", + "FILTER_CITY", + "FILTER_CONVERSION_DELAY", + "FILTER_COUNTRY", + "FILTER_CREATIVE_ID", + "FILTER_CREATIVE_SIZE", + "FILTER_CREATIVE_TYPE", + "FILTER_DATA_PROVIDER", + "FILTER_DATE", + "FILTER_DAY_OF_WEEK", + "FILTER_DMA", + "FILTER_EXCHANGE_ID", + "FILTER_FLOODLIGHT_PIXEL_ID", + "FILTER_INSERTION_ORDER", + "FILTER_INVENTORY_FORMAT", + "FILTER_INVENTORY_SOURCE", + "FILTER_KEYWORD", + "FILTER_LINE_ITEM", + "FILTER_LINE_ITEM_DAILY_FREQUENCY", + "FILTER_LINE_ITEM_LIFETIME_FREQUENCY", + "FILTER_LINE_ITEM_TYPE", + "FILTER_MOBILE_DEVICE_MAKE", + "FILTER_MOBILE_DEVICE_MAKE_MODEL", + "FILTER_MOBILE_DEVICE_TYPE", + "FILTER_MONTH", + "FILTER_ORDER_ID", + "FILTER_OS", + "FILTER_PAGE_CATEGORY", + "FILTER_PAGE_LAYOUT", + "FILTER_PARTNER", + "FILTER_PARTNER_CURRENCY", + "FILTER_PUBLIC_INVENTORY", + "FILTER_REGION", + "FILTER_REGULAR_CHANNEL_ID", + "FILTER_SITE_ID", + "FILTER_SITE_LANGUAGE", + "FILTER_TARGETED_USER_LIST", + "FILTER_TIME_OF_DAY", + "FILTER_UNKNOWN", + "FILTER_USER_LIST", + "FILTER_USER_LIST_FIRST_PARTY", + "FILTER_USER_LIST_THIRD_PARTY", + "FILTER_VIDEO_AD_POSITION_IN_STREAM", + "FILTER_VIDEO_CREATIVE_DURATION", + "FILTER_VIDEO_DURATION_SECONDS", + "FILTER_VIDEO_FORMAT_SUPPORT", + "FILTER_VIDEO_INVENTORY_TYPE", + "FILTER_VIDEO_PLAYER_SIZE", + "FILTER_VIDEO_RATING_TIER", + "FILTER_VIDEO_SKIPPABLE_SUPPORT", + "FILTER_VIDEO_VPAID_SUPPORT", + "FILTER_WEEK", + "FILTER_YEAR", + "FILTER_YOUTUBE_VERTICAL", + "FILTER_ZIP_CODE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "includeInviteData": { + "type": "boolean", + "description": "Whether to include data from Invite Media." + }, + "metrics": { + "type": "array", + "description": "Metrics to include as columns in your report.", + "items": { + "type": "string", + "enum": [ + "METRIC_BID_REQUESTS", + "METRIC_BILLABLE_COST_ADVERTISER", + "METRIC_BILLABLE_COST_PARTNER", + "METRIC_BILLABLE_COST_USD", + "METRIC_CLICKS", + "METRIC_CLICK_TO_POST_CLICK_CONVERSION_RATE", + "METRIC_CONVERSIONS_PER_MILLE", + "METRIC_CPM_FEE1_ADVERTISER", + "METRIC_CPM_FEE1_PARTNER", + "METRIC_CPM_FEE1_USD", + "METRIC_CPM_FEE2_ADVERTISER", + "METRIC_CPM_FEE2_PARTNER", + "METRIC_CPM_FEE2_USD", + "METRIC_CTR", + "METRIC_DATA_COST_ADVERTISER", + "METRIC_DATA_COST_PARTNER", + "METRIC_DATA_COST_USD", + "METRIC_FEE10_ADVERTISER", + "METRIC_FEE10_PARTNER", + "METRIC_FEE10_USD", + "METRIC_FEE11_ADVERTISER", + "METRIC_FEE11_PARTNER", + "METRIC_FEE11_USD", + "METRIC_FEE12_ADVERTISER", + "METRIC_FEE12_PARTNER", + "METRIC_FEE12_USD", + "METRIC_FEE13_ADVERTISER", + "METRIC_FEE13_PARTNER", + "METRIC_FEE13_USD", + "METRIC_FEE14_ADVERTISER", + "METRIC_FEE14_PARTNER", + "METRIC_FEE14_USD", + "METRIC_FEE15_ADVERTISER", + "METRIC_FEE15_PARTNER", + "METRIC_FEE15_USD", + "METRIC_FEE2_ADVERTISER", + "METRIC_FEE2_PARTNER", + "METRIC_FEE2_USD", + "METRIC_FEE3_ADVERTISER", + "METRIC_FEE3_PARTNER", + "METRIC_FEE3_USD", + "METRIC_FEE4_ADVERTISER", + "METRIC_FEE4_PARTNER", + "METRIC_FEE4_USD", + "METRIC_FEE5_ADVERTISER", + "METRIC_FEE5_PARTNER", + "METRIC_FEE5_USD", + "METRIC_FEE6_ADVERTISER", + "METRIC_FEE6_PARTNER", + "METRIC_FEE6_USD", + "METRIC_FEE7_ADVERTISER", + "METRIC_FEE7_PARTNER", + "METRIC_FEE7_USD", + "METRIC_FEE8_ADVERTISER", + "METRIC_FEE8_PARTNER", + "METRIC_FEE8_USD", + "METRIC_FEE9_ADVERTISER", + "METRIC_FEE9_PARTNER", + "METRIC_FEE9_USD", + "METRIC_IMPRESSIONS", + "METRIC_IMPRESSIONS_TO_CONVERSION_RATE", + "METRIC_LAST_CLICKS", + "METRIC_LAST_IMPRESSIONS", + "METRIC_MEDIA_COST_ADVERTISER", + "METRIC_MEDIA_COST_ECPAPC_ADVERTISER", + "METRIC_MEDIA_COST_ECPAPC_PARTNER", + "METRIC_MEDIA_COST_ECPAPC_USD", + "METRIC_MEDIA_COST_ECPAPV_ADVERTISER", + "METRIC_MEDIA_COST_ECPAPV_PARTNER", + "METRIC_MEDIA_COST_ECPAPV_USD", + "METRIC_MEDIA_COST_ECPA_ADVERTISER", + "METRIC_MEDIA_COST_ECPA_PARTNER", + "METRIC_MEDIA_COST_ECPA_USD", + "METRIC_MEDIA_COST_ECPCV_ADVERTISER", + "METRIC_MEDIA_COST_ECPCV_PARTNER", + "METRIC_MEDIA_COST_ECPCV_USD", + "METRIC_MEDIA_COST_ECPC_ADVERTISER", + "METRIC_MEDIA_COST_ECPC_PARTNER", + "METRIC_MEDIA_COST_ECPC_USD", + "METRIC_MEDIA_COST_ECPM_ADVERTISER", + "METRIC_MEDIA_COST_ECPM_PARTNER", + "METRIC_MEDIA_COST_ECPM_USD", + "METRIC_MEDIA_COST_PARTNER", + "METRIC_MEDIA_COST_USD", + "METRIC_MEDIA_FEE1_ADVERTISER", + "METRIC_MEDIA_FEE1_PARTNER", + "METRIC_MEDIA_FEE1_USD", + "METRIC_MEDIA_FEE2_ADVERTISER", + "METRIC_MEDIA_FEE2_PARTNER", + "METRIC_MEDIA_FEE2_USD", + "METRIC_PIXEL_LOADS", + "METRIC_PLATFORM_FEE_ADVERTISER", + "METRIC_PLATFORM_FEE_PARTNER", + "METRIC_PLATFORM_FEE_USD", + "METRIC_POST_CLICK_DFA_REVENUE", + "METRIC_POST_VIEW_DFA_REVENUE", + "METRIC_PROFIT_ADVERTISER", + "METRIC_PROFIT_ECPAPC_ADVERTISER", + "METRIC_PROFIT_ECPAPC_PARTNER", + "METRIC_PROFIT_ECPAPC_USD", + "METRIC_PROFIT_ECPAPV_ADVERTISER", + "METRIC_PROFIT_ECPAPV_PARTNER", + "METRIC_PROFIT_ECPAPV_USD", + "METRIC_PROFIT_ECPA_ADVERTISER", + "METRIC_PROFIT_ECPA_PARTNER", + "METRIC_PROFIT_ECPA_USD", + "METRIC_PROFIT_ECPC_ADVERTISER", + "METRIC_PROFIT_ECPC_PARTNER", + "METRIC_PROFIT_ECPC_USD", + "METRIC_PROFIT_ECPM_ADVERTISER", + "METRIC_PROFIT_ECPM_PARTNER", + "METRIC_PROFIT_ECPM_USD", + "METRIC_PROFIT_MARGIN", + "METRIC_PROFIT_PARTNER", + "METRIC_PROFIT_USD", + "METRIC_REVENUE_ADVERTISER", + "METRIC_REVENUE_ECPAPC_ADVERTISER", + "METRIC_REVENUE_ECPAPC_PARTNER", + "METRIC_REVENUE_ECPAPC_USD", + "METRIC_REVENUE_ECPAPV_ADVERTISER", + "METRIC_REVENUE_ECPAPV_PARTNER", + "METRIC_REVENUE_ECPAPV_USD", + "METRIC_REVENUE_ECPA_ADVERTISER", + "METRIC_REVENUE_ECPA_PARTNER", + "METRIC_REVENUE_ECPA_USD", + "METRIC_REVENUE_ECPCV_ADVERTISER", + "METRIC_REVENUE_ECPCV_PARTNER", + "METRIC_REVENUE_ECPCV_USD", + "METRIC_REVENUE_ECPC_ADVERTISER", + "METRIC_REVENUE_ECPC_PARTNER", + "METRIC_REVENUE_ECPC_USD", + "METRIC_REVENUE_ECPM_ADVERTISER", + "METRIC_REVENUE_ECPM_PARTNER", + "METRIC_REVENUE_ECPM_USD", + "METRIC_REVENUE_PARTNER", + "METRIC_REVENUE_USD", + "METRIC_RICH_MEDIA_VIDEO_COMPLETIONS", + "METRIC_RICH_MEDIA_VIDEO_FIRST_QUARTILE_COMPLETES", + "METRIC_RICH_MEDIA_VIDEO_FULL_SCREENS", + "METRIC_RICH_MEDIA_VIDEO_MIDPOINTS", + "METRIC_RICH_MEDIA_VIDEO_MUTES", + "METRIC_RICH_MEDIA_VIDEO_PAUSES", + "METRIC_RICH_MEDIA_VIDEO_PLAYS", + "METRIC_RICH_MEDIA_VIDEO_SKIPS", + "METRIC_RICH_MEDIA_VIDEO_THIRD_QUARTILE_COMPLETES", + "METRIC_TOTAL_CONVERSIONS", + "METRIC_TOTAL_MEDIA_COST_ADVERTISER", + "METRIC_TOTAL_MEDIA_COST_ECPAPC_ADVERTISER", + "METRIC_TOTAL_MEDIA_COST_ECPAPC_PARTNER", + "METRIC_TOTAL_MEDIA_COST_ECPAPC_USD", + "METRIC_TOTAL_MEDIA_COST_ECPAPV_ADVERTISER", + "METRIC_TOTAL_MEDIA_COST_ECPAPV_PARTNER", + "METRIC_TOTAL_MEDIA_COST_ECPAPV_USD", + "METRIC_TOTAL_MEDIA_COST_ECPA_ADVERTISER", + "METRIC_TOTAL_MEDIA_COST_ECPA_PARTNER", + "METRIC_TOTAL_MEDIA_COST_ECPA_USD", + "METRIC_TOTAL_MEDIA_COST_ECPCV_ADVERTISER", + "METRIC_TOTAL_MEDIA_COST_ECPCV_PARTNER", + "METRIC_TOTAL_MEDIA_COST_ECPCV_USD", + "METRIC_TOTAL_MEDIA_COST_ECPC_ADVERTISER", + "METRIC_TOTAL_MEDIA_COST_ECPC_PARTNER", + "METRIC_TOTAL_MEDIA_COST_ECPC_USD", + "METRIC_TOTAL_MEDIA_COST_ECPM_ADVERTISER", + "METRIC_TOTAL_MEDIA_COST_ECPM_PARTNER", + "METRIC_TOTAL_MEDIA_COST_ECPM_USD", + "METRIC_TOTAL_MEDIA_COST_PARTNER", + "METRIC_TOTAL_MEDIA_COST_USD", + "METRIC_UNIQUE_VISITORS_COOKIES", + "METRIC_UNKNOWN", + "METRIC_VIDEO_COMPLETION_RATE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "type": { + "type": "string", + "description": "Report type.", + "enum": [ + "TYPE_ACTIVE_GRP", + "TYPE_AUDIENCE_COMPOSITION", + "TYPE_AUDIENCE_PERFORMANCE", + "TYPE_CLIENT_SAFE", + "TYPE_CROSS_FEE", + "TYPE_CROSS_PARTNER", + "TYPE_CROSS_PARTNER_THIRD_PARTY_DATA_PROVIDER", + "TYPE_FEE", + "TYPE_GENERAL", + "TYPE_INVENTORY_AVAILABILITY", + "TYPE_KEYWORD", + "TYPE_ORDER_ID", + "TYPE_PAGE_CATEGORY", + "TYPE_PIXEL_LOAD", + "TYPE_THIRD_PARTY_DATA_PROVIDER", + "TYPE_YOUTUBE_VERTICAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "Query": { + "id": "Query", + "type": "object", + "description": "Represents a query.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"doubleclickbidmanager#query\".", + "default": "doubleclickbidmanager#query" + }, + "metadata": { + "$ref": "QueryMetadata", + "description": "Query metadata." + }, + "params": { + "$ref": "Parameters", + "description": "Query parameters." + }, + "queryId": { + "type": "string", + "description": "Query ID.", + "format": "int64" + }, + "reportDataEndTimeMs": { + "type": "string", + "description": "The ending time for the data that is shown in the report. Note, reportDataEndTimeMs is required if metadata.dataRange is CUSTOM_DATES and ignored otherwise.", + "format": "int64" + }, + "reportDataStartTimeMs": { + "type": "string", + "description": "The starting time for the data that is shown in the report. Note, reportDataStartTimeMs is required if metadata.dataRange is CUSTOM_DATES and ignored otherwise.", + "format": "int64" + }, + "schedule": { + "$ref": "QuerySchedule", + "description": "Information on how often and when to run a query." + }, + "timezoneCode": { + "type": "string", + "description": "Canonical timezone code for report data time. Defaults to America/New_York." + } + } + }, + "QueryMetadata": { + "id": "QueryMetadata", + "type": "object", + "description": "Query metadata.", + "properties": { + "dataRange": { + "type": "string", + "description": "Range of report data.", + "enum": [ + "ALL_TIME", + "CURRENT_DAY", + "CUSTOM_DATES", + "LAST_14_DAYS", + "LAST_30_DAYS", + "LAST_365_DAYS", + "LAST_7_DAYS", + "LAST_90_DAYS", + "MONTH_TO_DATE", + "PREVIOUS_DAY", + "PREVIOUS_HALF_MONTH", + "PREVIOUS_MONTH", + "PREVIOUS_QUARTER", + "PREVIOUS_WEEK", + "PREVIOUS_YEAR", + "QUARTER_TO_DATE", + "WEEK_TO_DATE", + "YEAR_TO_DATE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "format": { + "type": "string", + "description": "Format of the generated report.", + "enum": [ + "CSV", + "EXCEL_CSV", + "XLSX" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "googleCloudStoragePathForLatestReport": { + "type": "string", + "description": "The path to the location in Google Cloud Storage where the latest report is stored." + }, + "googleDrivePathForLatestReport": { + "type": "string", + "description": "The path in Google Drive for the latest report." + }, + "latestReportRunTimeMs": { + "type": "string", + "description": "The time when the latest report started to run.", + "format": "int64" + }, + "reportCount": { + "type": "integer", + "description": "Number of reports that have been generated for the query.", + "format": "int32" + }, + "running": { + "type": "boolean", + "description": "Whether the latest report is currently running." + }, + "sendNotification": { + "type": "boolean", + "description": "Whether to send an email notification when a report is ready. Default to false." + }, + "shareEmailAddress": { + "type": "array", + "description": "List of email addresses which are sent email notifications when the report is finished. Separate from sendNotification.", + "items": { + "type": "string" + } + }, + "title": { + "type": "string", + "description": "Query title. It is used to name the reports generated from this query." + } + } + }, + "QuerySchedule": { + "id": "QuerySchedule", + "type": "object", + "description": "Information on how frequently and when to run a query.", + "properties": { + "endTimeMs": { + "type": "string", + "description": "Datetime to periodically run the query until.", + "format": "int64" + }, + "frequency": { + "type": "string", + "description": "How often the query is run.", + "enum": [ + "DAILY", + "MONTHLY", + "ONE_TIME", + "QUARTERLY", + "SEMI_MONTHLY", + "WEEKLY" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "nextRunMinuteOfDay": { + "type": "integer", + "description": "Time of day at which a new report will be generated, represented as minutes past midnight Range is 0 to 1439. Only applies to scheduled reports.", + "format": "int32" + }, + "nextRunTimezoneCode": { + "type": "string", + "description": "Canonical timezone code for report generation time. Defaults to America/New_York." + } + } + }, + "Report": { + "id": "Report", + "type": "object", + "description": "Represents a report.", + "properties": { + "key": { + "$ref": "ReportKey", + "description": "Key used to identify a report." + }, + "metadata": { + "$ref": "ReportMetadata", + "description": "Report metadata." + }, + "params": { + "$ref": "Parameters", + "description": "Report parameters." + } + } + }, + "ReportFailure": { + "id": "ReportFailure", + "type": "object", + "description": "An explanation of a report failure.", + "properties": { + "errorCode": { + "type": "string", + "description": "Error code that shows why the report was not created.", + "enum": [ + "AUTHENTICATION_ERROR", + "DEPRECATED_REPORTING_INVALID_QUERY", + "REPORTING_BUCKET_NOT_FOUND", + "REPORTING_CREATE_BUCKET_FAILED", + "REPORTING_DELETE_BUCKET_FAILED", + "REPORTING_FATAL_ERROR", + "REPORTING_ILLEGAL_FILENAME", + "REPORTING_IMCOMPATIBLE_METRICS", + "REPORTING_INVALID_QUERY_MISSING_PARTNER_AND_ADVERTISER_FILTERS", + "REPORTING_INVALID_QUERY_TITLE_MISSING", + "REPORTING_INVALID_QUERY_TOO_MANY_UNFILTERED_LARGE_GROUP_BYS", + "REPORTING_QUERY_NOT_FOUND", + "REPORTING_TRANSIENT_ERROR", + "REPORTING_UPDATE_BUCKET_PERMISSION_FAILED", + "REPORTING_WRITE_BUCKET_OBJECT_FAILED", + "SERVER_ERROR", + "UNAUTHORIZED_API_ACCESS", + "VALIDATION_ERROR" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "ReportKey": { + "id": "ReportKey", + "type": "object", + "description": "Key used to identify a report.", + "properties": { + "queryId": { + "type": "string", + "description": "Query ID.", + "format": "int64" + }, + "reportId": { + "type": "string", + "description": "Report ID.", + "format": "int64" + } + } + }, + "ReportMetadata": { + "id": "ReportMetadata", + "type": "object", + "description": "Report metadata.", + "properties": { + "googleCloudStoragePath": { + "type": "string", + "description": "The path to the location in Google Cloud Storage where the report is stored." + }, + "reportDataEndTimeMs": { + "type": "string", + "description": "The ending time for the data that is shown in the report.", + "format": "int64" + }, + "reportDataStartTimeMs": { + "type": "string", + "description": "The starting time for the data that is shown in the report.", + "format": "int64" + }, + "status": { + "$ref": "ReportStatus", + "description": "Report status." + } + } + }, + "ReportStatus": { + "id": "ReportStatus", + "type": "object", + "description": "Report status.", + "properties": { + "failure": { + "$ref": "ReportFailure", + "description": "If the report failed, this records the cause." + }, + "finishTimeMs": { + "type": "string", + "description": "The time when this report either completed successfully or failed.", + "format": "int64" + }, + "format": { + "type": "string", + "description": "The file type of the report.", + "enum": [ + "CSV", + "EXCEL_CSV", + "XLSX" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "state": { + "type": "string", + "description": "The state of the report.", + "enum": [ + "DONE", + "FAILED", + "RUNNING" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "RowStatus": { + "id": "RowStatus", + "type": "object", + "description": "Represents the upload status of a row in the request.", + "properties": { + "changed": { + "type": "boolean", + "description": "Whether the stored entity is changed as a result of upload." + }, + "entityId": { + "type": "string", + "description": "Entity Id.", + "format": "int64" + }, + "entityName": { + "type": "string", + "description": "Entity name." + }, + "errors": { + "type": "array", + "description": "Reasons why the entity can't be uploaded.", + "items": { + "type": "string" + } + }, + "persisted": { + "type": "boolean", + "description": "Whether the entity is persisted." + }, + "rowNumber": { + "type": "integer", + "description": "Row number.", + "format": "int32" + } + } + }, + "RunQueryRequest": { + "id": "RunQueryRequest", + "type": "object", + "description": "Request to run a stored query to generate a report.", + "properties": { + "dataRange": { + "type": "string", + "description": "Report data range used to generate the report.", + "enum": [ + "ALL_TIME", + "CURRENT_DAY", + "CUSTOM_DATES", + "LAST_14_DAYS", + "LAST_30_DAYS", + "LAST_365_DAYS", + "LAST_7_DAYS", + "LAST_90_DAYS", + "MONTH_TO_DATE", + "PREVIOUS_DAY", + "PREVIOUS_HALF_MONTH", + "PREVIOUS_MONTH", + "PREVIOUS_QUARTER", + "PREVIOUS_WEEK", + "PREVIOUS_YEAR", + "QUARTER_TO_DATE", + "WEEK_TO_DATE", + "YEAR_TO_DATE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "reportDataEndTimeMs": { + "type": "string", + "description": "The ending time for the data that is shown in the report. Note, reportDataEndTimeMs is required if dataRange is CUSTOM_DATES and ignored otherwise.", + "format": "int64" + }, + "reportDataStartTimeMs": { + "type": "string", + "description": "The starting time for the data that is shown in the report. Note, reportDataStartTimeMs is required if dataRange is CUSTOM_DATES and ignored otherwise.", + "format": "int64" + }, + "timezoneCode": { + "type": "string", + "description": "Canonical timezone code for report data time. Defaults to America/New_York." + } + } + }, + "UploadLineItemsRequest": { + "id": "UploadLineItemsRequest", + "type": "object", + "description": "Request to upload line items.", + "properties": { + "dryRun": { + "type": "boolean", + "description": "Set to true to get upload status without actually persisting the line items." + }, + "format": { + "type": "string", + "description": "Format the line items are in. Default to CSV.", + "enum": [ + "CSV" + ], + "enumDescriptions": [ + "" + ] + }, + "lineItems": { + "type": "string", + "description": "Line items in CSV to upload. Refer to Entity Write File Format for more information on file format." + } + } + }, + "UploadLineItemsResponse": { + "id": "UploadLineItemsResponse", + "type": "object", + "description": "Upload line items response.", + "properties": { + "uploadStatus": { + "$ref": "UploadStatus", + "description": "Status of upload." + } + } + }, + "UploadStatus": { + "id": "UploadStatus", + "type": "object", + "description": "Represents the status of upload.", + "properties": { + "errors": { + "type": "array", + "description": "Reasons why upload can't be completed.", + "items": { + "type": "string" + } + }, + "rowStatus": { + "type": "array", + "description": "Per-row upload status.", + "items": { + "$ref": "RowStatus" + } + } + } + } + }, + "resources": { + "lineitems": { + "methods": { + "downloadlineitems": { + "id": "doubleclickbidmanager.lineitems.downloadlineitems", + "path": "lineitems/downloadlineitems", + "httpMethod": "POST", + "description": "Retrieves line items in CSV format.", + "request": { + "$ref": "DownloadLineItemsRequest" + }, + "response": { + "$ref": "DownloadLineItemsResponse" + } + }, + "uploadlineitems": { + "id": "doubleclickbidmanager.lineitems.uploadlineitems", + "path": "lineitems/uploadlineitems", + "httpMethod": "POST", + "description": "Uploads line items in CSV format.", + "request": { + "$ref": "UploadLineItemsRequest" + }, + "response": { + "$ref": "UploadLineItemsResponse" + } + } + } + }, + "queries": { + "methods": { + "createquery": { + "id": "doubleclickbidmanager.queries.createquery", + "path": "query", + "httpMethod": "POST", + "description": "Creates a query.", + "request": { + "$ref": "Query" + }, + "response": { + "$ref": "Query" + } + }, + "deletequery": { + "id": "doubleclickbidmanager.queries.deletequery", + "path": "query/{queryId}", + "httpMethod": "DELETE", + "description": "Deletes a stored query as well as the associated stored reports.", + "parameters": { + "queryId": { + "type": "string", + "description": "Query ID to delete.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "queryId" + ] + }, + "getquery": { + "id": "doubleclickbidmanager.queries.getquery", + "path": "query/{queryId}", + "httpMethod": "GET", + "description": "Retrieves a stored query.", + "parameters": { + "queryId": { + "type": "string", + "description": "Query ID to retrieve.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "queryId" + ], + "response": { + "$ref": "Query" + } + }, + "listqueries": { + "id": "doubleclickbidmanager.queries.listqueries", + "path": "queries", + "httpMethod": "GET", + "description": "Retrieves stored queries.", + "response": { + "$ref": "ListQueriesResponse" + } + }, + "runquery": { + "id": "doubleclickbidmanager.queries.runquery", + "path": "query/{queryId}", + "httpMethod": "POST", + "description": "Runs a stored query to generate a report.", + "parameters": { + "queryId": { + "type": "string", + "description": "Query ID to run.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "queryId" + ], + "request": { + "$ref": "RunQueryRequest" + } + } + } + }, + "reports": { + "methods": { + "listreports": { + "id": "doubleclickbidmanager.reports.listreports", + "path": "queries/{queryId}/reports", + "httpMethod": "GET", + "description": "Retrieves stored reports.", + "parameters": { + "queryId": { + "type": "string", + "description": "Query ID with which the reports are associated.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "queryId" + ], + "response": { + "$ref": "ListReportsResponse" + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/doubleclickbidmanager/v1/doubleclickbidmanager-gen.go b/third_party/src/code.google.com/p/google-api-go-client/doubleclickbidmanager/v1/doubleclickbidmanager-gen.go new file mode 100644 index 0000000000000..c381bb000c69e --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/doubleclickbidmanager/v1/doubleclickbidmanager-gen.go @@ -0,0 +1,828 @@ +// Package doubleclickbidmanager provides access to the DoubleClick Bid Manager API. +// +// See https://developers.google.com/bid-manager/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/doubleclickbidmanager/v1" +// ... +// doubleclickbidmanagerService, err := doubleclickbidmanager.New(oauthHttpClient) +package doubleclickbidmanager + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "doubleclickbidmanager:v1" +const apiName = "doubleclickbidmanager" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/doubleclickbidmanager/v1/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Lineitems = NewLineitemsService(s) + s.Queries = NewQueriesService(s) + s.Reports = NewReportsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Lineitems *LineitemsService + + Queries *QueriesService + + Reports *ReportsService +} + +func NewLineitemsService(s *Service) *LineitemsService { + rs := &LineitemsService{s: s} + return rs +} + +type LineitemsService struct { + s *Service +} + +func NewQueriesService(s *Service) *QueriesService { + rs := &QueriesService{s: s} + return rs +} + +type QueriesService struct { + s *Service +} + +func NewReportsService(s *Service) *ReportsService { + rs := &ReportsService{s: s} + return rs +} + +type ReportsService struct { + s *Service +} + +type DownloadLineItemsRequest struct { + // FilterIds: Ids of the specified filter type used to filter line items + // to fetch. If omitted, all the line items will be returned. + FilterIds googleapi.Int64s `json:"filterIds,omitempty"` + + // FilterType: Filter type used to filter line items to fetch. + FilterType string `json:"filterType,omitempty"` + + // Format: Format in which the line items will be returned. Default to + // CSV. + Format string `json:"format,omitempty"` +} + +type DownloadLineItemsResponse struct { + // LineItems: Retrieved line items in CSV format. Refer to Entity Write + // File Format for more information on file format. + LineItems string `json:"lineItems,omitempty"` +} + +type FilterPair struct { + // Type: Filter type. + Type string `json:"type,omitempty"` + + // Value: Filter value. + Value string `json:"value,omitempty"` +} + +type ListQueriesResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "doubleclickbidmanager#listQueriesResponse". + Kind string `json:"kind,omitempty"` + + // Queries: Retrieved queries. + Queries []*Query `json:"queries,omitempty"` +} + +type ListReportsResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "doubleclickbidmanager#listReportsResponse". + Kind string `json:"kind,omitempty"` + + // Reports: Retrieved reports. + Reports []*Report `json:"reports,omitempty"` +} + +type Parameters struct { + // Filters: Filters used to match traffic data in your report. + Filters []*FilterPair `json:"filters,omitempty"` + + // GroupBys: Data is grouped by the filters listed in this field. + GroupBys []string `json:"groupBys,omitempty"` + + // IncludeInviteData: Whether to include data from Invite Media. + IncludeInviteData bool `json:"includeInviteData,omitempty"` + + // Metrics: Metrics to include as columns in your report. + Metrics []string `json:"metrics,omitempty"` + + // Type: Report type. + Type string `json:"type,omitempty"` +} + +type Query struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "doubleclickbidmanager#query". + Kind string `json:"kind,omitempty"` + + // Metadata: Query metadata. + Metadata *QueryMetadata `json:"metadata,omitempty"` + + // Params: Query parameters. + Params *Parameters `json:"params,omitempty"` + + // QueryId: Query ID. + QueryId int64 `json:"queryId,omitempty,string"` + + // ReportDataEndTimeMs: The ending time for the data that is shown in + // the report. Note, reportDataEndTimeMs is required if + // metadata.dataRange is CUSTOM_DATES and ignored otherwise. + ReportDataEndTimeMs int64 `json:"reportDataEndTimeMs,omitempty,string"` + + // ReportDataStartTimeMs: The starting time for the data that is shown + // in the report. Note, reportDataStartTimeMs is required if + // metadata.dataRange is CUSTOM_DATES and ignored otherwise. + ReportDataStartTimeMs int64 `json:"reportDataStartTimeMs,omitempty,string"` + + // Schedule: Information on how often and when to run a query. + Schedule *QuerySchedule `json:"schedule,omitempty"` + + // TimezoneCode: Canonical timezone code for report data time. Defaults + // to America/New_York. + TimezoneCode string `json:"timezoneCode,omitempty"` +} + +type QueryMetadata struct { + // DataRange: Range of report data. + DataRange string `json:"dataRange,omitempty"` + + // Format: Format of the generated report. + Format string `json:"format,omitempty"` + + // GoogleCloudStoragePathForLatestReport: The path to the location in + // Google Cloud Storage where the latest report is stored. + GoogleCloudStoragePathForLatestReport string `json:"googleCloudStoragePathForLatestReport,omitempty"` + + // GoogleDrivePathForLatestReport: The path in Google Drive for the + // latest report. + GoogleDrivePathForLatestReport string `json:"googleDrivePathForLatestReport,omitempty"` + + // LatestReportRunTimeMs: The time when the latest report started to + // run. + LatestReportRunTimeMs int64 `json:"latestReportRunTimeMs,omitempty,string"` + + // ReportCount: Number of reports that have been generated for the + // query. + ReportCount int64 `json:"reportCount,omitempty"` + + // Running: Whether the latest report is currently running. + Running bool `json:"running,omitempty"` + + // SendNotification: Whether to send an email notification when a report + // is ready. Default to false. + SendNotification bool `json:"sendNotification,omitempty"` + + // ShareEmailAddress: List of email addresses which are sent email + // notifications when the report is finished. Separate from + // sendNotification. + ShareEmailAddress []string `json:"shareEmailAddress,omitempty"` + + // Title: Query title. It is used to name the reports generated from + // this query. + Title string `json:"title,omitempty"` +} + +type QuerySchedule struct { + // EndTimeMs: Datetime to periodically run the query until. + EndTimeMs int64 `json:"endTimeMs,omitempty,string"` + + // Frequency: How often the query is run. + Frequency string `json:"frequency,omitempty"` + + // NextRunMinuteOfDay: Time of day at which a new report will be + // generated, represented as minutes past midnight Range is 0 to 1439. + // Only applies to scheduled reports. + NextRunMinuteOfDay int64 `json:"nextRunMinuteOfDay,omitempty"` + + // NextRunTimezoneCode: Canonical timezone code for report generation + // time. Defaults to America/New_York. + NextRunTimezoneCode string `json:"nextRunTimezoneCode,omitempty"` +} + +type Report struct { + // Key: Key used to identify a report. + Key *ReportKey `json:"key,omitempty"` + + // Metadata: Report metadata. + Metadata *ReportMetadata `json:"metadata,omitempty"` + + // Params: Report parameters. + Params *Parameters `json:"params,omitempty"` +} + +type ReportFailure struct { + // ErrorCode: Error code that shows why the report was not created. + ErrorCode string `json:"errorCode,omitempty"` +} + +type ReportKey struct { + // QueryId: Query ID. + QueryId int64 `json:"queryId,omitempty,string"` + + // ReportId: Report ID. + ReportId int64 `json:"reportId,omitempty,string"` +} + +type ReportMetadata struct { + // GoogleCloudStoragePath: The path to the location in Google Cloud + // Storage where the report is stored. + GoogleCloudStoragePath string `json:"googleCloudStoragePath,omitempty"` + + // ReportDataEndTimeMs: The ending time for the data that is shown in + // the report. + ReportDataEndTimeMs int64 `json:"reportDataEndTimeMs,omitempty,string"` + + // ReportDataStartTimeMs: The starting time for the data that is shown + // in the report. + ReportDataStartTimeMs int64 `json:"reportDataStartTimeMs,omitempty,string"` + + // Status: Report status. + Status *ReportStatus `json:"status,omitempty"` +} + +type ReportStatus struct { + // Failure: If the report failed, this records the cause. + Failure *ReportFailure `json:"failure,omitempty"` + + // FinishTimeMs: The time when this report either completed successfully + // or failed. + FinishTimeMs int64 `json:"finishTimeMs,omitempty,string"` + + // Format: The file type of the report. + Format string `json:"format,omitempty"` + + // State: The state of the report. + State string `json:"state,omitempty"` +} + +type RowStatus struct { + // Changed: Whether the stored entity is changed as a result of upload. + Changed bool `json:"changed,omitempty"` + + // EntityId: Entity Id. + EntityId int64 `json:"entityId,omitempty,string"` + + // EntityName: Entity name. + EntityName string `json:"entityName,omitempty"` + + // Errors: Reasons why the entity can't be uploaded. + Errors []string `json:"errors,omitempty"` + + // Persisted: Whether the entity is persisted. + Persisted bool `json:"persisted,omitempty"` + + // RowNumber: Row number. + RowNumber int64 `json:"rowNumber,omitempty"` +} + +type RunQueryRequest struct { + // DataRange: Report data range used to generate the report. + DataRange string `json:"dataRange,omitempty"` + + // ReportDataEndTimeMs: The ending time for the data that is shown in + // the report. Note, reportDataEndTimeMs is required if dataRange is + // CUSTOM_DATES and ignored otherwise. + ReportDataEndTimeMs int64 `json:"reportDataEndTimeMs,omitempty,string"` + + // ReportDataStartTimeMs: The starting time for the data that is shown + // in the report. Note, reportDataStartTimeMs is required if dataRange + // is CUSTOM_DATES and ignored otherwise. + ReportDataStartTimeMs int64 `json:"reportDataStartTimeMs,omitempty,string"` + + // TimezoneCode: Canonical timezone code for report data time. Defaults + // to America/New_York. + TimezoneCode string `json:"timezoneCode,omitempty"` +} + +type UploadLineItemsRequest struct { + // DryRun: Set to true to get upload status without actually persisting + // the line items. + DryRun bool `json:"dryRun,omitempty"` + + // Format: Format the line items are in. Default to CSV. + Format string `json:"format,omitempty"` + + // LineItems: Line items in CSV to upload. Refer to Entity Write File + // Format for more information on file format. + LineItems string `json:"lineItems,omitempty"` +} + +type UploadLineItemsResponse struct { + // UploadStatus: Status of upload. + UploadStatus *UploadStatus `json:"uploadStatus,omitempty"` +} + +type UploadStatus struct { + // Errors: Reasons why upload can't be completed. + Errors []string `json:"errors,omitempty"` + + // RowStatus: Per-row upload status. + RowStatus []*RowStatus `json:"rowStatus,omitempty"` +} + +// method id "doubleclickbidmanager.lineitems.downloadlineitems": + +type LineitemsDownloadlineitemsCall struct { + s *Service + downloadlineitemsrequest *DownloadLineItemsRequest + opt_ map[string]interface{} +} + +// Downloadlineitems: Retrieves line items in CSV format. +func (r *LineitemsService) Downloadlineitems(downloadlineitemsrequest *DownloadLineItemsRequest) *LineitemsDownloadlineitemsCall { + c := &LineitemsDownloadlineitemsCall{s: r.s, opt_: make(map[string]interface{})} + c.downloadlineitemsrequest = downloadlineitemsrequest + return c +} + +func (c *LineitemsDownloadlineitemsCall) Do() (*DownloadLineItemsResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.downloadlineitemsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "lineitems/downloadlineitems") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DownloadLineItemsResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves line items in CSV format.", + // "httpMethod": "POST", + // "id": "doubleclickbidmanager.lineitems.downloadlineitems", + // "path": "lineitems/downloadlineitems", + // "request": { + // "$ref": "DownloadLineItemsRequest" + // }, + // "response": { + // "$ref": "DownloadLineItemsResponse" + // } + // } + +} + +// method id "doubleclickbidmanager.lineitems.uploadlineitems": + +type LineitemsUploadlineitemsCall struct { + s *Service + uploadlineitemsrequest *UploadLineItemsRequest + opt_ map[string]interface{} +} + +// Uploadlineitems: Uploads line items in CSV format. +func (r *LineitemsService) Uploadlineitems(uploadlineitemsrequest *UploadLineItemsRequest) *LineitemsUploadlineitemsCall { + c := &LineitemsUploadlineitemsCall{s: r.s, opt_: make(map[string]interface{})} + c.uploadlineitemsrequest = uploadlineitemsrequest + return c +} + +func (c *LineitemsUploadlineitemsCall) Do() (*UploadLineItemsResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.uploadlineitemsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "lineitems/uploadlineitems") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UploadLineItemsResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Uploads line items in CSV format.", + // "httpMethod": "POST", + // "id": "doubleclickbidmanager.lineitems.uploadlineitems", + // "path": "lineitems/uploadlineitems", + // "request": { + // "$ref": "UploadLineItemsRequest" + // }, + // "response": { + // "$ref": "UploadLineItemsResponse" + // } + // } + +} + +// method id "doubleclickbidmanager.queries.createquery": + +type QueriesCreatequeryCall struct { + s *Service + query *Query + opt_ map[string]interface{} +} + +// Createquery: Creates a query. +func (r *QueriesService) Createquery(query *Query) *QueriesCreatequeryCall { + c := &QueriesCreatequeryCall{s: r.s, opt_: make(map[string]interface{})} + c.query = query + return c +} + +func (c *QueriesCreatequeryCall) Do() (*Query, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.query) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Query) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a query.", + // "httpMethod": "POST", + // "id": "doubleclickbidmanager.queries.createquery", + // "path": "query", + // "request": { + // "$ref": "Query" + // }, + // "response": { + // "$ref": "Query" + // } + // } + +} + +// method id "doubleclickbidmanager.queries.deletequery": + +type QueriesDeletequeryCall struct { + s *Service + queryId int64 + opt_ map[string]interface{} +} + +// Deletequery: Deletes a stored query as well as the associated stored +// reports. +func (r *QueriesService) Deletequery(queryId int64) *QueriesDeletequeryCall { + c := &QueriesDeletequeryCall{s: r.s, opt_: make(map[string]interface{})} + c.queryId = queryId + return c +} + +func (c *QueriesDeletequeryCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "query/{queryId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{queryId}", strconv.FormatInt(c.queryId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a stored query as well as the associated stored reports.", + // "httpMethod": "DELETE", + // "id": "doubleclickbidmanager.queries.deletequery", + // "parameterOrder": [ + // "queryId" + // ], + // "parameters": { + // "queryId": { + // "description": "Query ID to delete.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "query/{queryId}" + // } + +} + +// method id "doubleclickbidmanager.queries.getquery": + +type QueriesGetqueryCall struct { + s *Service + queryId int64 + opt_ map[string]interface{} +} + +// Getquery: Retrieves a stored query. +func (r *QueriesService) Getquery(queryId int64) *QueriesGetqueryCall { + c := &QueriesGetqueryCall{s: r.s, opt_: make(map[string]interface{})} + c.queryId = queryId + return c +} + +func (c *QueriesGetqueryCall) Do() (*Query, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "query/{queryId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{queryId}", strconv.FormatInt(c.queryId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Query) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a stored query.", + // "httpMethod": "GET", + // "id": "doubleclickbidmanager.queries.getquery", + // "parameterOrder": [ + // "queryId" + // ], + // "parameters": { + // "queryId": { + // "description": "Query ID to retrieve.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "query/{queryId}", + // "response": { + // "$ref": "Query" + // } + // } + +} + +// method id "doubleclickbidmanager.queries.listqueries": + +type QueriesListqueriesCall struct { + s *Service + opt_ map[string]interface{} +} + +// Listqueries: Retrieves stored queries. +func (r *QueriesService) Listqueries() *QueriesListqueriesCall { + c := &QueriesListqueriesCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *QueriesListqueriesCall) Do() (*ListQueriesResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "queries") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ListQueriesResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves stored queries.", + // "httpMethod": "GET", + // "id": "doubleclickbidmanager.queries.listqueries", + // "path": "queries", + // "response": { + // "$ref": "ListQueriesResponse" + // } + // } + +} + +// method id "doubleclickbidmanager.queries.runquery": + +type QueriesRunqueryCall struct { + s *Service + queryId int64 + runqueryrequest *RunQueryRequest + opt_ map[string]interface{} +} + +// Runquery: Runs a stored query to generate a report. +func (r *QueriesService) Runquery(queryId int64, runqueryrequest *RunQueryRequest) *QueriesRunqueryCall { + c := &QueriesRunqueryCall{s: r.s, opt_: make(map[string]interface{})} + c.queryId = queryId + c.runqueryrequest = runqueryrequest + return c +} + +func (c *QueriesRunqueryCall) Do() error { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.runqueryrequest) + if err != nil { + return err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "query/{queryId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{queryId}", strconv.FormatInt(c.queryId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Runs a stored query to generate a report.", + // "httpMethod": "POST", + // "id": "doubleclickbidmanager.queries.runquery", + // "parameterOrder": [ + // "queryId" + // ], + // "parameters": { + // "queryId": { + // "description": "Query ID to run.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "query/{queryId}", + // "request": { + // "$ref": "RunQueryRequest" + // } + // } + +} + +// method id "doubleclickbidmanager.reports.listreports": + +type ReportsListreportsCall struct { + s *Service + queryId int64 + opt_ map[string]interface{} +} + +// Listreports: Retrieves stored reports. +func (r *ReportsService) Listreports(queryId int64) *ReportsListreportsCall { + c := &ReportsListreportsCall{s: r.s, opt_: make(map[string]interface{})} + c.queryId = queryId + return c +} + +func (c *ReportsListreportsCall) Do() (*ListReportsResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "queries/{queryId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{queryId}", strconv.FormatInt(c.queryId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ListReportsResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves stored reports.", + // "httpMethod": "GET", + // "id": "doubleclickbidmanager.reports.listreports", + // "parameterOrder": [ + // "queryId" + // ], + // "parameters": { + // "queryId": { + // "description": "Query ID with which the reports are associated.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "queries/{queryId}/reports", + // "response": { + // "$ref": "ListReportsResponse" + // } + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/doubleclicksearch/v2/doubleclicksearch-api.json b/third_party/src/code.google.com/p/google-api-go-client/doubleclicksearch/v2/doubleclicksearch-api.json new file mode 100644 index 0000000000000..b1ea21ae44450 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/doubleclicksearch/v2/doubleclicksearch-api.json @@ -0,0 +1,989 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/y4JNZN6WmoC1vLC4va-8Oh8limQ\"", + "discoveryVersion": "v1", + "id": "doubleclicksearch:v2", + "name": "doubleclicksearch", + "version": "v2", + "title": "DoubleClick Search API", + "description": "Report and modify your advertising data in DoubleClick Search (for example, campaigns, ad groups, keywords, and conversions).", + "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/doubleclick-search/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/doubleclicksearch/v2/", + "basePath": "/doubleclicksearch/v2/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "doubleclicksearch/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/doubleclicksearch": { + "description": "View and manage your advertising data in DoubleClick Search" + } + } + } + }, + "schemas": { + "Availability": { + "id": "Availability", + "type": "object", + "description": "A message containing availability data relevant to DoubleClick Search.", + "properties": { + "advertiserId": { + "type": "string", + "description": "DS advertiser ID.", + "format": "int64", + "annotations": { + "required": [ + "doubleclicksearch.conversion.updateAvailability" + ] + } + }, + "agencyId": { + "type": "string", + "description": "DS agency ID.", + "format": "int64", + "annotations": { + "required": [ + "doubleclicksearch.conversion.updateAvailability" + ] + } + }, + "availabilityTimestamp": { + "type": "string", + "description": "The time by which all conversions have been uploaded, in epoch millis UTC.", + "format": "uint64", + "annotations": { + "required": [ + "doubleclicksearch.conversion.updateAvailability" + ] + } + }, + "segmentationId": { + "type": "string", + "description": "The numeric segmentation identifier (for example, DoubleClick Search Floodlight activity ID).", + "format": "int64" + }, + "segmentationName": { + "type": "string", + "description": "The friendly segmentation identifier (for example, DoubleClick Search Floodlight activity name)." + }, + "segmentationType": { + "type": "string", + "description": "The segmentation type that this availability is for (its default value is FLOODLIGHT).", + "annotations": { + "required": [ + "doubleclicksearch.conversion.updateAvailability" + ] + } + } + } + }, + "Conversion": { + "id": "Conversion", + "type": "object", + "description": "A conversion containing data relevant to DoubleClick Search.", + "properties": { + "adGroupId": { + "type": "string", + "description": "DS ad group ID.", + "format": "int64" + }, + "adId": { + "type": "string", + "description": "DS ad ID.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "DS advertiser ID.", + "format": "int64" + }, + "agencyId": { + "type": "string", + "description": "DS agency ID.", + "format": "int64" + }, + "campaignId": { + "type": "string", + "description": "DS campaign ID.", + "format": "int64" + }, + "clickId": { + "type": "string", + "description": "DS click ID for the conversion." + }, + "conversionId": { + "type": "string", + "description": "Advertiser-provided ID for the conversion, also known as the order ID.", + "annotations": { + "required": [ + "doubleclicksearch.conversion.insert" + ] + } + }, + "conversionModifiedTimestamp": { + "type": "string", + "description": "The time at which the conversion was last modified, in epoch millis UTC.", + "format": "uint64" + }, + "conversionTimestamp": { + "type": "string", + "description": "The time at which the conversion took place, in epoch millis UTC.", + "format": "uint64", + "annotations": { + "required": [ + "doubleclicksearch.conversion.insert" + ] + } + }, + "criterionId": { + "type": "string", + "description": "DS criterion (keyword) ID.", + "format": "int64" + }, + "currencyCode": { + "type": "string", + "description": "The currency code for the conversion's revenue. Should be in ISO 4217 alphabetic (3-char) format." + }, + "customDimension": { + "type": "array", + "description": "Custom dimensions for the conversion, which can be used to filter data in a report.", + "items": { + "$ref": "CustomDimension" + } + }, + "customMetric": { + "type": "array", + "description": "Custom metrics for the conversion.", + "items": { + "$ref": "CustomMetric" + } + }, + "dsConversionId": { + "type": "string", + "description": "DS conversion ID.", + "format": "int64" + }, + "engineAccountId": { + "type": "string", + "description": "DS engine account ID.", + "format": "int64" + }, + "floodlightOrderId": { + "type": "string", + "description": "The advertiser-provided order id for the conversion." + }, + "quantityMillis": { + "type": "string", + "description": "The quantity of this conversion, in millis.", + "format": "int64" + }, + "revenueMicros": { + "type": "string", + "description": "The revenue amount of this TRANSACTION conversion, in micros.", + "format": "int64" + }, + "segmentationId": { + "type": "string", + "description": "The numeric segmentation identifier (for example, DoubleClick Search Floodlight activity ID).", + "format": "int64" + }, + "segmentationName": { + "type": "string", + "description": "The friendly segmentation identifier (for example, DoubleClick Search Floodlight activity name)." + }, + "segmentationType": { + "type": "string", + "description": "The segmentation type of this conversion (for example, FLOODLIGHT).", + "annotations": { + "required": [ + "doubleclicksearch.conversion.insert" + ] + } + }, + "state": { + "type": "string", + "description": "The state of the conversion, that is, either ACTIVE or DELETED." + }, + "type": { + "type": "string", + "description": "The type of the conversion, that is, either ACTION or TRANSACTION. An ACTION conversion is an action by the user that has no monetarily quantifiable value, while a TRANSACTION conversion is an action that does have a monetarily quantifiable value. Examples are email list signups (ACTION) versus ecommerce purchases (TRANSACTION)." + } + } + }, + "ConversionList": { + "id": "ConversionList", + "type": "object", + "description": "A list of conversions.", + "properties": { + "conversion": { + "type": "array", + "description": "The conversions being requested.", + "items": { + "$ref": "Conversion" + } + }, + "kind": { + "type": "string", + "description": "Identifies this as a ConversionList resource. Value: the fixed string doubleclicksearch#conversionList.", + "default": "doubleclicksearch#conversionList" + } + } + }, + "CustomDimension": { + "id": "CustomDimension", + "type": "object", + "description": "A message containing the custome dimension.", + "properties": { + "name": { + "type": "string", + "description": "Custom dimension name." + }, + "value": { + "type": "string", + "description": "Custom dimension value." + } + } + }, + "CustomMetric": { + "id": "CustomMetric", + "type": "object", + "description": "A message containing the custome metric.", + "properties": { + "name": { + "type": "string", + "description": "Custom metric name." + }, + "value": { + "type": "number", + "description": "Custom metric numeric value.", + "format": "double" + } + } + }, + "Report": { + "id": "Report", + "type": "object", + "description": "A DoubleClick Search report. This object contains the report request, some report metadata such as currency code, and the generated report rows or report files.", + "properties": { + "files": { + "type": "array", + "description": "Asynchronous report only. Contains a list of generated report files once the report has succesfully completed.", + "items": { + "type": "object", + "properties": { + "byteCount": { + "type": "string", + "description": "The size of this report file in bytes.", + "format": "int64" + }, + "url": { + "type": "string", + "description": "Use this url to download the report file." + } + } + } + }, + "id": { + "type": "string", + "description": "Asynchronous report only. Id of the report." + }, + "isReportReady": { + "type": "boolean", + "description": "Asynchronous report only. True if and only if the report has completed successfully and the report files are ready to be downloaded." + }, + "kind": { + "type": "string", + "description": "Identifies this as a Report resource. Value: the fixed string doubleclicksearch#report.", + "default": "doubleclicksearch#report" + }, + "request": { + "$ref": "ReportRequest", + "description": "The request that created the report. Optional fields not specified in the original request are filled with default values." + }, + "rowCount": { + "type": "integer", + "description": "The number of report rows generated by the report, not including headers.", + "format": "int32" + }, + "rows": { + "type": "array", + "description": "Synchronous report only. Generated report rows.", + "items": { + "$ref": "ReportRow" + } + }, + "statisticsCurrencyCode": { + "type": "string", + "description": "The currency code of all monetary values produced in the report, including values that are set by users (e.g., keyword bid settings) and metrics (e.g., cost and revenue). The currency code of a report is determined by the statisticsCurrency field of the report request." + }, + "statisticsTimeZone": { + "type": "string", + "description": "If all statistics of the report are sourced from the same time zone, this would be it. Otherwise the field is unset." + } + } + }, + "ReportRequest": { + "id": "ReportRequest", + "type": "object", + "description": "A request object used to create a DoubleClick Search report.", + "properties": { + "columns": { + "type": "array", + "description": "The columns to include in the report. This includes both DoubleClick Search columns and saved columns. For DoubleClick Search columns, only the columnName parameter is required. For saved columns only the savedColumnName parameter is required. Both columnName and savedColumnName cannot be set in the same stanza.", + "items": { + "type": "object", + "properties": { + "columnName": { + "type": "string", + "description": "Name of a DoubleClick Search column to include in the report." + }, + "endDate": { + "type": "string", + "description": "Inclusive day in YYYY-MM-DD format. When provided, this overrides the overall time range of the report for this column only. Must be provided together with startDate." + }, + "groupByColumn": { + "type": "boolean", + "description": "Synchronous report only. Set to true to group by this column. Defaults to false.", + "default": "false" + }, + "headerText": { + "type": "string", + "description": "Text used to identify this column in the report output; defaults to columnName or savedColumnName when not specified. This can be used to prevent collisions between DoubleClick Search columns and saved columns with the same name." + }, + "savedColumnName": { + "type": "string", + "description": "Name of a saved column to include in the report. The report must be scoped at advertiser or lower, and this saved column must already be created in the DoubleClick Search UI." + }, + "startDate": { + "type": "string", + "description": "Inclusive date in YYYY-MM-DD format. When provided, this overrides the overall time range of the report for this column only. Must be provided together with endDate." + } + } + } + }, + "downloadFormat": { + "type": "string", + "description": "Format that the report should be returned in. Currently csv or tsv is supported.", + "annotations": { + "required": [ + "doubleclicksearch.reports.request" + ] + } + }, + "filters": { + "type": "array", + "description": "A list of filters to be applied to the report.", + "items": { + "type": "object", + "properties": { + "column": { + "type": "object", + "description": "Column to perform the filter on. This can be a DoubleClick Search column or a saved column.", + "properties": { + "columnName": { + "type": "string", + "description": "Name of a DoubleClick Search column to filter on." + }, + "savedColumnName": { + "type": "string", + "description": "Name of a saved column to filter on." + } + } + }, + "operator": { + "type": "string", + "description": "Operator to use in the filter. See the filter reference for a list of available operators." + }, + "values": { + "type": "array", + "description": "A list of values to filter the column value against.", + "items": { + "type": "any" + } + } + } + } + }, + "includeDeletedEntities": { + "type": "boolean", + "description": "Determines if removed entities should be included in the report. Deprecated, please use includeRemovedEntities instead. Defaults to false.", + "default": "false" + }, + "includeRemovedEntities": { + "type": "boolean", + "description": "Determines if removed entities should be included in the report. Defaults to false.", + "default": "false" + }, + "maxRowsPerFile": { + "type": "integer", + "description": "Asynchronous report only. The maximum number of rows per report file. A large report is split into many files based on this field. Acceptable values are 1000000 to 100000000, inclusive.", + "format": "int32", + "minimum": "1000000", + "maximum": "100000000", + "annotations": { + "required": [ + "doubleclicksearch.reports.request" + ] + } + }, + "orderBy": { + "type": "array", + "description": "Synchronous report only. A list of columns and directions defining sorting to be performed on the report rows.", + "items": { + "type": "object", + "properties": { + "column": { + "type": "object", + "description": "Column to perform the sort on. This can be a DoubleClick Search-defined column or a saved column.", + "properties": { + "columnName": { + "type": "string", + "description": "Name of a DoubleClick Search column to sort by." + }, + "savedColumnName": { + "type": "string", + "description": "Name of a saved column to sort by." + } + } + }, + "sortOrder": { + "type": "string", + "description": "The sort direction, which is either ascending or descending." + } + } + } + }, + "reportScope": { + "type": "object", + "description": "The reportScope is a set of IDs that are used to determine which subset of entities will be returned in the report. The full lineage of IDs from the lowest scoped level desired up through agency is required.", + "properties": { + "adGroupId": { + "type": "string", + "description": "DS ad group ID.", + "format": "int64" + }, + "adId": { + "type": "string", + "description": "DS ad ID.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "DS advertiser ID.", + "format": "int64" + }, + "agencyId": { + "type": "string", + "description": "DS agency ID.", + "format": "int64" + }, + "campaignId": { + "type": "string", + "description": "DS campaign ID.", + "format": "int64" + }, + "engineAccountId": { + "type": "string", + "description": "DS engine account ID.", + "format": "int64" + }, + "keywordId": { + "type": "string", + "description": "DS keyword ID.", + "format": "int64" + } + } + }, + "reportType": { + "type": "string", + "description": "Determines the type of rows that are returned in the report. For example, if you specify reportType: keyword, each row in the report will contain data about a keyword. See the Types of Reports reference for the columns that are available for each type.", + "annotations": { + "required": [ + "doubleclicksearch.reports.generate", + "doubleclicksearch.reports.request" + ] + } + }, + "rowCount": { + "type": "integer", + "description": "Synchronous report only. The maxinum number of rows to return; additional rows are dropped. Acceptable values are 0 to 10000, inclusive. Defaults to 10000.", + "default": "10000", + "format": "int32", + "minimum": "0", + "maximum": "10000", + "annotations": { + "required": [ + "doubleclicksearch.reports.generate" + ] + } + }, + "startRow": { + "type": "integer", + "description": "Synchronous report only. Zero-based index of the first row to return. Acceptable values are 0 to 50000, inclusive. Defaults to 0.", + "default": "0", + "format": "int32", + "minimum": "0", + "maximum": "50000", + "annotations": { + "required": [ + "doubleclicksearch.reports.generate" + ] + } + }, + "statisticsCurrency": { + "type": "string", + "description": "Specifies the currency in which monetary will be returned. Possible values are: usd, agency (valid if the report is scoped to agency or lower), advertiser (valid if the report is scoped to * advertiser or lower), or account (valid if the report is scoped to engine account or lower).", + "annotations": { + "required": [ + "doubleclicksearch.reports.generate", + "doubleclicksearch.reports.request" + ] + } + }, + "timeRange": { + "type": "object", + "description": "If metrics are requested in a report, this argument will be used to restrict the metrics to a specific time range.", + "properties": { + "changedAttributesSinceTimestamp": { + "type": "string", + "description": "Inclusive UTC timestamp in RFC format, e.g., 2013-07-16T10:16:23.555Z. See additional references on how changed attribute reports work.", + "format": "date-time" + }, + "changedMetricsSinceTimestamp": { + "type": "string", + "description": "Inclusive UTC timestamp in RFC format, e.g., 2013-07-16T10:16:23.555Z. See additional references on how changed metrics reports work.", + "format": "date-time" + }, + "endDate": { + "type": "string", + "description": "Inclusive date in YYYY-MM-DD format." + }, + "startDate": { + "type": "string", + "description": "Inclusive date in YYYY-MM-DD format." + } + } + }, + "verifySingleTimeZone": { + "type": "boolean", + "description": "If true, the report would only be created if all the requested stat data are sourced from a single timezone. Defaults to false.", + "default": "false" + } + } + }, + "ReportRow": { + "id": "ReportRow", + "type": "object", + "description": "A row in a DoubleClick Search report.", + "additionalProperties": { + "type": "any", + "description": "Indicates the columns that are represented in this row. That is, each key corresponds to a column with a non-empty cell in this row." + } + }, + "UpdateAvailabilityRequest": { + "id": "UpdateAvailabilityRequest", + "type": "object", + "description": "The request to update availability.", + "properties": { + "availabilities": { + "type": "array", + "description": "The availabilities being requested.", + "items": { + "$ref": "Availability" + } + } + } + }, + "UpdateAvailabilityResponse": { + "id": "UpdateAvailabilityResponse", + "type": "object", + "description": "The response to a update availability request.", + "properties": { + "availabilities": { + "type": "array", + "description": "The availabilities being returned.", + "items": { + "$ref": "Availability" + } + } + } + } + }, + "resources": { + "conversion": { + "methods": { + "get": { + "id": "doubleclicksearch.conversion.get", + "path": "agency/{agencyId}/advertiser/{advertiserId}/engine/{engineAccountId}/conversion", + "httpMethod": "GET", + "description": "Retrieves a list of conversions from a DoubleClick Search engine account.", + "parameters": { + "adGroupId": { + "type": "string", + "description": "Numeric ID of the ad group.", + "format": "int64", + "location": "query" + }, + "adId": { + "type": "string", + "description": "Numeric ID of the ad.", + "format": "int64", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Numeric ID of the advertiser.", + "required": true, + "format": "int64", + "location": "path" + }, + "agencyId": { + "type": "string", + "description": "Numeric ID of the agency.", + "required": true, + "format": "int64", + "location": "path" + }, + "campaignId": { + "type": "string", + "description": "Numeric ID of the campaign.", + "format": "int64", + "location": "query" + }, + "criterionId": { + "type": "string", + "description": "Numeric ID of the criterion.", + "format": "int64", + "location": "query" + }, + "endDate": { + "type": "integer", + "description": "Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd.", + "required": true, + "format": "int32", + "minimum": "20091101", + "maximum": "99991231", + "location": "query" + }, + "engineAccountId": { + "type": "string", + "description": "Numeric ID of the engine account.", + "required": true, + "format": "int64", + "location": "path" + }, + "rowCount": { + "type": "integer", + "description": "The number of conversions to return per call.", + "required": true, + "format": "int32", + "minimum": "1", + "maximum": "1000", + "location": "query" + }, + "startDate": { + "type": "integer", + "description": "First date (inclusive) on which to retrieve conversions. Format is yyyymmdd.", + "required": true, + "format": "int32", + "minimum": "20091101", + "maximum": "99991231", + "location": "query" + }, + "startRow": { + "type": "integer", + "description": "The 0-based starting index for retrieving conversions results.", + "required": true, + "format": "uint32", + "location": "query" + } + }, + "parameterOrder": [ + "agencyId", + "advertiserId", + "engineAccountId", + "endDate", + "rowCount", + "startDate", + "startRow" + ], + "response": { + "$ref": "ConversionList" + }, + "scopes": [ + "https://www.googleapis.com/auth/doubleclicksearch" + ] + }, + "insert": { + "id": "doubleclicksearch.conversion.insert", + "path": "conversion", + "httpMethod": "POST", + "description": "Inserts a batch of new conversions into DoubleClick Search.", + "request": { + "$ref": "ConversionList" + }, + "response": { + "$ref": "ConversionList" + }, + "scopes": [ + "https://www.googleapis.com/auth/doubleclicksearch" + ] + }, + "patch": { + "id": "doubleclicksearch.conversion.patch", + "path": "conversion", + "httpMethod": "PATCH", + "description": "Updates a batch of conversions in DoubleClick Search. This method supports patch semantics.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "Numeric ID of the advertiser.", + "required": true, + "format": "int64", + "location": "query" + }, + "agencyId": { + "type": "string", + "description": "Numeric ID of the agency.", + "required": true, + "format": "int64", + "location": "query" + }, + "endDate": { + "type": "integer", + "description": "Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd.", + "required": true, + "format": "int32", + "minimum": "20091101", + "maximum": "99991231", + "location": "query" + }, + "engineAccountId": { + "type": "string", + "description": "Numeric ID of the engine account.", + "required": true, + "format": "int64", + "location": "query" + }, + "rowCount": { + "type": "integer", + "description": "The number of conversions to return per call.", + "required": true, + "format": "int32", + "minimum": "1", + "maximum": "1000", + "location": "query" + }, + "startDate": { + "type": "integer", + "description": "First date (inclusive) on which to retrieve conversions. Format is yyyymmdd.", + "required": true, + "format": "int32", + "minimum": "20091101", + "maximum": "99991231", + "location": "query" + }, + "startRow": { + "type": "integer", + "description": "The 0-based starting index for retrieving conversions results.", + "required": true, + "format": "uint32", + "location": "query" + } + }, + "parameterOrder": [ + "advertiserId", + "agencyId", + "endDate", + "engineAccountId", + "rowCount", + "startDate", + "startRow" + ], + "request": { + "$ref": "ConversionList" + }, + "response": { + "$ref": "ConversionList" + }, + "scopes": [ + "https://www.googleapis.com/auth/doubleclicksearch" + ] + }, + "update": { + "id": "doubleclicksearch.conversion.update", + "path": "conversion", + "httpMethod": "PUT", + "description": "Updates a batch of conversions in DoubleClick Search.", + "request": { + "$ref": "ConversionList" + }, + "response": { + "$ref": "ConversionList" + }, + "scopes": [ + "https://www.googleapis.com/auth/doubleclicksearch" + ] + }, + "updateAvailability": { + "id": "doubleclicksearch.conversion.updateAvailability", + "path": "conversion/updateAvailability", + "httpMethod": "POST", + "description": "Updates the availabilities of a batch of floodlight activities in DoubleClick Search.", + "request": { + "$ref": "UpdateAvailabilityRequest", + "parameterName": "empty" + }, + "response": { + "$ref": "UpdateAvailabilityResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/doubleclicksearch" + ] + } + } + }, + "reports": { + "methods": { + "generate": { + "id": "doubleclicksearch.reports.generate", + "path": "reports/generate", + "httpMethod": "POST", + "description": "Generates and returns a report immediately.", + "request": { + "$ref": "ReportRequest", + "parameterName": "reportRequest" + }, + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/doubleclicksearch" + ] + }, + "get": { + "id": "doubleclicksearch.reports.get", + "path": "reports/{reportId}", + "httpMethod": "GET", + "description": "Polls for the status of a report request.", + "parameters": { + "reportId": { + "type": "string", + "description": "ID of the report request being polled.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "reportId" + ], + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/doubleclicksearch" + ] + }, + "getFile": { + "id": "doubleclicksearch.reports.getFile", + "path": "reports/{reportId}/files/{reportFragment}", + "httpMethod": "GET", + "description": "Downloads a report file.", + "parameters": { + "reportFragment": { + "type": "integer", + "description": "The index of the report fragment to download.", + "required": true, + "format": "int32", + "minimum": "0", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "ID of the report.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "reportId", + "reportFragment" + ], + "scopes": [ + "https://www.googleapis.com/auth/doubleclicksearch" + ], + "supportsMediaDownload": true + }, + "request": { + "id": "doubleclicksearch.reports.request", + "path": "reports", + "httpMethod": "POST", + "description": "Inserts a report request into the reporting system.", + "request": { + "$ref": "ReportRequest", + "parameterName": "reportRequest" + }, + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/doubleclicksearch" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/doubleclicksearch/v2/doubleclicksearch-gen.go b/third_party/src/code.google.com/p/google-api-go-client/doubleclicksearch/v2/doubleclicksearch-gen.go new file mode 100644 index 0000000000000..7588564e6ec2e --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/doubleclicksearch/v2/doubleclicksearch-gen.go @@ -0,0 +1,1256 @@ +// Package doubleclicksearch provides access to the DoubleClick Search API. +// +// See https://developers.google.com/doubleclick-search/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/doubleclicksearch/v2" +// ... +// doubleclicksearchService, err := doubleclicksearch.New(oauthHttpClient) +package doubleclicksearch + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "doubleclicksearch:v2" +const apiName = "doubleclicksearch" +const apiVersion = "v2" +const basePath = "https://www.googleapis.com/doubleclicksearch/v2/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your advertising data in DoubleClick Search + DoubleclicksearchScope = "https://www.googleapis.com/auth/doubleclicksearch" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Conversion = NewConversionService(s) + s.Reports = NewReportsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Conversion *ConversionService + + Reports *ReportsService +} + +func NewConversionService(s *Service) *ConversionService { + rs := &ConversionService{s: s} + return rs +} + +type ConversionService struct { + s *Service +} + +func NewReportsService(s *Service) *ReportsService { + rs := &ReportsService{s: s} + return rs +} + +type ReportsService struct { + s *Service +} + +type Availability struct { + // AdvertiserId: DS advertiser ID. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AgencyId: DS agency ID. + AgencyId int64 `json:"agencyId,omitempty,string"` + + // AvailabilityTimestamp: The time by which all conversions have been + // uploaded, in epoch millis UTC. + AvailabilityTimestamp uint64 `json:"availabilityTimestamp,omitempty,string"` + + // SegmentationId: The numeric segmentation identifier (for example, + // DoubleClick Search Floodlight activity ID). + SegmentationId int64 `json:"segmentationId,omitempty,string"` + + // SegmentationName: The friendly segmentation identifier (for example, + // DoubleClick Search Floodlight activity name). + SegmentationName string `json:"segmentationName,omitempty"` + + // SegmentationType: The segmentation type that this availability is for + // (its default value is FLOODLIGHT). + SegmentationType string `json:"segmentationType,omitempty"` +} + +type Conversion struct { + // AdGroupId: DS ad group ID. + AdGroupId int64 `json:"adGroupId,omitempty,string"` + + // AdId: DS ad ID. + AdId int64 `json:"adId,omitempty,string"` + + // AdvertiserId: DS advertiser ID. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AgencyId: DS agency ID. + AgencyId int64 `json:"agencyId,omitempty,string"` + + // CampaignId: DS campaign ID. + CampaignId int64 `json:"campaignId,omitempty,string"` + + // ClickId: DS click ID for the conversion. + ClickId string `json:"clickId,omitempty"` + + // ConversionId: Advertiser-provided ID for the conversion, also known + // as the order ID. + ConversionId string `json:"conversionId,omitempty"` + + // ConversionModifiedTimestamp: The time at which the conversion was + // last modified, in epoch millis UTC. + ConversionModifiedTimestamp uint64 `json:"conversionModifiedTimestamp,omitempty,string"` + + // ConversionTimestamp: The time at which the conversion took place, in + // epoch millis UTC. + ConversionTimestamp uint64 `json:"conversionTimestamp,omitempty,string"` + + // CriterionId: DS criterion (keyword) ID. + CriterionId int64 `json:"criterionId,omitempty,string"` + + // CurrencyCode: The currency code for the conversion's revenue. Should + // be in ISO 4217 alphabetic (3-char) format. + CurrencyCode string `json:"currencyCode,omitempty"` + + // CustomDimension: Custom dimensions for the conversion, which can be + // used to filter data in a report. + CustomDimension []*CustomDimension `json:"customDimension,omitempty"` + + // CustomMetric: Custom metrics for the conversion. + CustomMetric []*CustomMetric `json:"customMetric,omitempty"` + + // DsConversionId: DS conversion ID. + DsConversionId int64 `json:"dsConversionId,omitempty,string"` + + // EngineAccountId: DS engine account ID. + EngineAccountId int64 `json:"engineAccountId,omitempty,string"` + + // FloodlightOrderId: The advertiser-provided order id for the + // conversion. + FloodlightOrderId string `json:"floodlightOrderId,omitempty"` + + // QuantityMillis: The quantity of this conversion, in millis. + QuantityMillis int64 `json:"quantityMillis,omitempty,string"` + + // RevenueMicros: The revenue amount of this TRANSACTION conversion, in + // micros. + RevenueMicros int64 `json:"revenueMicros,omitempty,string"` + + // SegmentationId: The numeric segmentation identifier (for example, + // DoubleClick Search Floodlight activity ID). + SegmentationId int64 `json:"segmentationId,omitempty,string"` + + // SegmentationName: The friendly segmentation identifier (for example, + // DoubleClick Search Floodlight activity name). + SegmentationName string `json:"segmentationName,omitempty"` + + // SegmentationType: The segmentation type of this conversion (for + // example, FLOODLIGHT). + SegmentationType string `json:"segmentationType,omitempty"` + + // State: The state of the conversion, that is, either ACTIVE or + // DELETED. + State string `json:"state,omitempty"` + + // Type: The type of the conversion, that is, either ACTION or + // TRANSACTION. An ACTION conversion is an action by the user that has + // no monetarily quantifiable value, while a TRANSACTION conversion is + // an action that does have a monetarily quantifiable value. Examples + // are email list signups (ACTION) versus ecommerce purchases + // (TRANSACTION). + Type string `json:"type,omitempty"` +} + +type ConversionList struct { + // Conversion: The conversions being requested. + Conversion []*Conversion `json:"conversion,omitempty"` + + // Kind: Identifies this as a ConversionList resource. Value: the fixed + // string doubleclicksearch#conversionList. + Kind string `json:"kind,omitempty"` +} + +type CustomDimension struct { + // Name: Custom dimension name. + Name string `json:"name,omitempty"` + + // Value: Custom dimension value. + Value string `json:"value,omitempty"` +} + +type CustomMetric struct { + // Name: Custom metric name. + Name string `json:"name,omitempty"` + + // Value: Custom metric numeric value. + Value float64 `json:"value,omitempty"` +} + +type Report struct { + // Files: Asynchronous report only. Contains a list of generated report + // files once the report has succesfully completed. + Files []*ReportFiles `json:"files,omitempty"` + + // Id: Asynchronous report only. Id of the report. + Id string `json:"id,omitempty"` + + // IsReportReady: Asynchronous report only. True if and only if the + // report has completed successfully and the report files are ready to + // be downloaded. + IsReportReady bool `json:"isReportReady,omitempty"` + + // Kind: Identifies this as a Report resource. Value: the fixed string + // doubleclicksearch#report. + Kind string `json:"kind,omitempty"` + + // Request: The request that created the report. Optional fields not + // specified in the original request are filled with default values. + Request *ReportRequest `json:"request,omitempty"` + + // RowCount: The number of report rows generated by the report, not + // including headers. + RowCount int64 `json:"rowCount,omitempty"` + + // Rows: Synchronous report only. Generated report rows. + Rows []*ReportRow `json:"rows,omitempty"` + + // StatisticsCurrencyCode: The currency code of all monetary values + // produced in the report, including values that are set by users (e.g., + // keyword bid settings) and metrics (e.g., cost and revenue). The + // currency code of a report is determined by the statisticsCurrency + // field of the report request. + StatisticsCurrencyCode string `json:"statisticsCurrencyCode,omitempty"` + + // StatisticsTimeZone: If all statistics of the report are sourced from + // the same time zone, this would be it. Otherwise the field is unset. + StatisticsTimeZone string `json:"statisticsTimeZone,omitempty"` +} + +type ReportFiles struct { + // ByteCount: The size of this report file in bytes. + ByteCount int64 `json:"byteCount,omitempty,string"` + + // Url: Use this url to download the report file. + Url string `json:"url,omitempty"` +} + +type ReportRequest struct { + // Columns: The columns to include in the report. This includes both + // DoubleClick Search columns and saved columns. For DoubleClick Search + // columns, only the columnName parameter is required. For saved columns + // only the savedColumnName parameter is required. Both columnName and + // savedColumnName cannot be set in the same stanza. + Columns []*ReportRequestColumns `json:"columns,omitempty"` + + // DownloadFormat: Format that the report should be returned in. + // Currently csv or tsv is supported. + DownloadFormat string `json:"downloadFormat,omitempty"` + + // Filters: A list of filters to be applied to the report. + Filters []*ReportRequestFilters `json:"filters,omitempty"` + + // IncludeDeletedEntities: Determines if removed entities should be + // included in the report. Deprecated, please use includeRemovedEntities + // instead. Defaults to false. + IncludeDeletedEntities bool `json:"includeDeletedEntities,omitempty"` + + // IncludeRemovedEntities: Determines if removed entities should be + // included in the report. Defaults to false. + IncludeRemovedEntities bool `json:"includeRemovedEntities,omitempty"` + + // MaxRowsPerFile: Asynchronous report only. The maximum number of rows + // per report file. A large report is split into many files based on + // this field. Acceptable values are 1000000 to 100000000, inclusive. + MaxRowsPerFile int64 `json:"maxRowsPerFile,omitempty"` + + // OrderBy: Synchronous report only. A list of columns and directions + // defining sorting to be performed on the report rows. + OrderBy []*ReportRequestOrderBy `json:"orderBy,omitempty"` + + // ReportScope: The reportScope is a set of IDs that are used to + // determine which subset of entities will be returned in the report. + // The full lineage of IDs from the lowest scoped level desired up + // through agency is required. + ReportScope *ReportRequestReportScope `json:"reportScope,omitempty"` + + // ReportType: Determines the type of rows that are returned in the + // report. For example, if you specify reportType: keyword, each row in + // the report will contain data about a keyword. See the Types of + // Reports reference for the columns that are available for each type. + ReportType string `json:"reportType,omitempty"` + + // RowCount: Synchronous report only. The maxinum number of rows to + // return; additional rows are dropped. Acceptable values are 0 to + // 10000, inclusive. Defaults to 10000. + RowCount int64 `json:"rowCount,omitempty"` + + // StartRow: Synchronous report only. Zero-based index of the first row + // to return. Acceptable values are 0 to 50000, inclusive. Defaults to + // 0. + StartRow int64 `json:"startRow,omitempty"` + + // StatisticsCurrency: Specifies the currency in which monetary will be + // returned. Possible values are: usd, agency (valid if the report is + // scoped to agency or lower), advertiser (valid if the report is scoped + // to * advertiser or lower), or account (valid if the report is scoped + // to engine account or lower). + StatisticsCurrency string `json:"statisticsCurrency,omitempty"` + + // TimeRange: If metrics are requested in a report, this argument will + // be used to restrict the metrics to a specific time range. + TimeRange *ReportRequestTimeRange `json:"timeRange,omitempty"` + + // VerifySingleTimeZone: If true, the report would only be created if + // all the requested stat data are sourced from a single timezone. + // Defaults to false. + VerifySingleTimeZone bool `json:"verifySingleTimeZone,omitempty"` +} + +type ReportRequestColumns struct { + // ColumnName: Name of a DoubleClick Search column to include in the + // report. + ColumnName string `json:"columnName,omitempty"` + + // EndDate: Inclusive day in YYYY-MM-DD format. When provided, this + // overrides the overall time range of the report for this column only. + // Must be provided together with startDate. + EndDate string `json:"endDate,omitempty"` + + // GroupByColumn: Synchronous report only. Set to true to group by this + // column. Defaults to false. + GroupByColumn bool `json:"groupByColumn,omitempty"` + + // HeaderText: Text used to identify this column in the report output; + // defaults to columnName or savedColumnName when not specified. This + // can be used to prevent collisions between DoubleClick Search columns + // and saved columns with the same name. + HeaderText string `json:"headerText,omitempty"` + + // SavedColumnName: Name of a saved column to include in the report. The + // report must be scoped at advertiser or lower, and this saved column + // must already be created in the DoubleClick Search UI. + SavedColumnName string `json:"savedColumnName,omitempty"` + + // StartDate: Inclusive date in YYYY-MM-DD format. When provided, this + // overrides the overall time range of the report for this column only. + // Must be provided together with endDate. + StartDate string `json:"startDate,omitempty"` +} + +type ReportRequestFilters struct { + // Column: Column to perform the filter on. This can be a DoubleClick + // Search column or a saved column. + Column *ReportRequestFiltersColumn `json:"column,omitempty"` + + // Operator: Operator to use in the filter. See the filter reference for + // a list of available operators. + Operator string `json:"operator,omitempty"` + + // Values: A list of values to filter the column value against. + Values []interface{} `json:"values,omitempty"` +} + +type ReportRequestFiltersColumn struct { + // ColumnName: Name of a DoubleClick Search column to filter on. + ColumnName string `json:"columnName,omitempty"` + + // SavedColumnName: Name of a saved column to filter on. + SavedColumnName string `json:"savedColumnName,omitempty"` +} + +type ReportRequestOrderBy struct { + // Column: Column to perform the sort on. This can be a DoubleClick + // Search-defined column or a saved column. + Column *ReportRequestOrderByColumn `json:"column,omitempty"` + + // SortOrder: The sort direction, which is either ascending or + // descending. + SortOrder string `json:"sortOrder,omitempty"` +} + +type ReportRequestOrderByColumn struct { + // ColumnName: Name of a DoubleClick Search column to sort by. + ColumnName string `json:"columnName,omitempty"` + + // SavedColumnName: Name of a saved column to sort by. + SavedColumnName string `json:"savedColumnName,omitempty"` +} + +type ReportRequestReportScope struct { + // AdGroupId: DS ad group ID. + AdGroupId int64 `json:"adGroupId,omitempty,string"` + + // AdId: DS ad ID. + AdId int64 `json:"adId,omitempty,string"` + + // AdvertiserId: DS advertiser ID. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AgencyId: DS agency ID. + AgencyId int64 `json:"agencyId,omitempty,string"` + + // CampaignId: DS campaign ID. + CampaignId int64 `json:"campaignId,omitempty,string"` + + // EngineAccountId: DS engine account ID. + EngineAccountId int64 `json:"engineAccountId,omitempty,string"` + + // KeywordId: DS keyword ID. + KeywordId int64 `json:"keywordId,omitempty,string"` +} + +type ReportRequestTimeRange struct { + // ChangedAttributesSinceTimestamp: Inclusive UTC timestamp in RFC + // format, e.g., 2013-07-16T10:16:23.555Z. See additional references on + // how changed attribute reports work. + ChangedAttributesSinceTimestamp string `json:"changedAttributesSinceTimestamp,omitempty"` + + // ChangedMetricsSinceTimestamp: Inclusive UTC timestamp in RFC format, + // e.g., 2013-07-16T10:16:23.555Z. See additional references on how + // changed metrics reports work. + ChangedMetricsSinceTimestamp string `json:"changedMetricsSinceTimestamp,omitempty"` + + // EndDate: Inclusive date in YYYY-MM-DD format. + EndDate string `json:"endDate,omitempty"` + + // StartDate: Inclusive date in YYYY-MM-DD format. + StartDate string `json:"startDate,omitempty"` +} + +type ReportRow struct { +} + +type UpdateAvailabilityRequest struct { + // Availabilities: The availabilities being requested. + Availabilities []*Availability `json:"availabilities,omitempty"` +} + +type UpdateAvailabilityResponse struct { + // Availabilities: The availabilities being returned. + Availabilities []*Availability `json:"availabilities,omitempty"` +} + +// method id "doubleclicksearch.conversion.get": + +type ConversionGetCall struct { + s *Service + agencyId int64 + advertiserId int64 + engineAccountId int64 + endDate int64 + rowCount int64 + startDate int64 + startRow int64 + opt_ map[string]interface{} +} + +// Get: Retrieves a list of conversions from a DoubleClick Search engine +// account. +func (r *ConversionService) Get(agencyId int64, advertiserId int64, engineAccountId int64, endDate int64, rowCount int64, startDate int64, startRow int64) *ConversionGetCall { + c := &ConversionGetCall{s: r.s, opt_: make(map[string]interface{})} + c.agencyId = agencyId + c.advertiserId = advertiserId + c.engineAccountId = engineAccountId + c.endDate = endDate + c.rowCount = rowCount + c.startDate = startDate + c.startRow = startRow + return c +} + +// AdGroupId sets the optional parameter "adGroupId": Numeric ID of the +// ad group. +func (c *ConversionGetCall) AdGroupId(adGroupId int64) *ConversionGetCall { + c.opt_["adGroupId"] = adGroupId + return c +} + +// AdId sets the optional parameter "adId": Numeric ID of the ad. +func (c *ConversionGetCall) AdId(adId int64) *ConversionGetCall { + c.opt_["adId"] = adId + return c +} + +// CampaignId sets the optional parameter "campaignId": Numeric ID of +// the campaign. +func (c *ConversionGetCall) CampaignId(campaignId int64) *ConversionGetCall { + c.opt_["campaignId"] = campaignId + return c +} + +// CriterionId sets the optional parameter "criterionId": Numeric ID of +// the criterion. +func (c *ConversionGetCall) CriterionId(criterionId int64) *ConversionGetCall { + c.opt_["criterionId"] = criterionId + return c +} + +func (c *ConversionGetCall) Do() (*ConversionList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("endDate", fmt.Sprintf("%v", c.endDate)) + params.Set("rowCount", fmt.Sprintf("%v", c.rowCount)) + params.Set("startDate", fmt.Sprintf("%v", c.startDate)) + params.Set("startRow", fmt.Sprintf("%v", c.startRow)) + if v, ok := c.opt_["adGroupId"]; ok { + params.Set("adGroupId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["adId"]; ok { + params.Set("adId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignId"]; ok { + params.Set("campaignId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["criterionId"]; ok { + params.Set("criterionId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "agency/{agencyId}/advertiser/{advertiserId}/engine/{engineAccountId}/conversion") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{agencyId}", strconv.FormatInt(c.agencyId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{advertiserId}", strconv.FormatInt(c.advertiserId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{engineAccountId}", strconv.FormatInt(c.engineAccountId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ConversionList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of conversions from a DoubleClick Search engine account.", + // "httpMethod": "GET", + // "id": "doubleclicksearch.conversion.get", + // "parameterOrder": [ + // "agencyId", + // "advertiserId", + // "engineAccountId", + // "endDate", + // "rowCount", + // "startDate", + // "startRow" + // ], + // "parameters": { + // "adGroupId": { + // "description": "Numeric ID of the ad group.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "adId": { + // "description": "Numeric ID of the ad.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "advertiserId": { + // "description": "Numeric ID of the advertiser.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "agencyId": { + // "description": "Numeric ID of the agency.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "campaignId": { + // "description": "Numeric ID of the campaign.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "criterionId": { + // "description": "Numeric ID of the criterion.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "endDate": { + // "description": "Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd.", + // "format": "int32", + // "location": "query", + // "maximum": "99991231", + // "minimum": "20091101", + // "required": true, + // "type": "integer" + // }, + // "engineAccountId": { + // "description": "Numeric ID of the engine account.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "rowCount": { + // "description": "The number of conversions to return per call.", + // "format": "int32", + // "location": "query", + // "maximum": "1000", + // "minimum": "1", + // "required": true, + // "type": "integer" + // }, + // "startDate": { + // "description": "First date (inclusive) on which to retrieve conversions. Format is yyyymmdd.", + // "format": "int32", + // "location": "query", + // "maximum": "99991231", + // "minimum": "20091101", + // "required": true, + // "type": "integer" + // }, + // "startRow": { + // "description": "The 0-based starting index for retrieving conversions results.", + // "format": "uint32", + // "location": "query", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "agency/{agencyId}/advertiser/{advertiserId}/engine/{engineAccountId}/conversion", + // "response": { + // "$ref": "ConversionList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/doubleclicksearch" + // ] + // } + +} + +// method id "doubleclicksearch.conversion.insert": + +type ConversionInsertCall struct { + s *Service + conversionlist *ConversionList + opt_ map[string]interface{} +} + +// Insert: Inserts a batch of new conversions into DoubleClick Search. +func (r *ConversionService) Insert(conversionlist *ConversionList) *ConversionInsertCall { + c := &ConversionInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.conversionlist = conversionlist + return c +} + +func (c *ConversionInsertCall) Do() (*ConversionList, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionlist) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "conversion") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ConversionList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a batch of new conversions into DoubleClick Search.", + // "httpMethod": "POST", + // "id": "doubleclicksearch.conversion.insert", + // "path": "conversion", + // "request": { + // "$ref": "ConversionList" + // }, + // "response": { + // "$ref": "ConversionList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/doubleclicksearch" + // ] + // } + +} + +// method id "doubleclicksearch.conversion.patch": + +type ConversionPatchCall struct { + s *Service + advertiserId int64 + agencyId int64 + endDate int64 + engineAccountId int64 + rowCount int64 + startDate int64 + startRow int64 + conversionlist *ConversionList + opt_ map[string]interface{} +} + +// Patch: Updates a batch of conversions in DoubleClick Search. This +// method supports patch semantics. +func (r *ConversionService) Patch(advertiserId int64, agencyId int64, endDate int64, engineAccountId int64, rowCount int64, startDate int64, startRow int64, conversionlist *ConversionList) *ConversionPatchCall { + c := &ConversionPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.advertiserId = advertiserId + c.agencyId = agencyId + c.endDate = endDate + c.engineAccountId = engineAccountId + c.rowCount = rowCount + c.startDate = startDate + c.startRow = startRow + c.conversionlist = conversionlist + return c +} + +func (c *ConversionPatchCall) Do() (*ConversionList, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionlist) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + params.Set("advertiserId", fmt.Sprintf("%v", c.advertiserId)) + params.Set("agencyId", fmt.Sprintf("%v", c.agencyId)) + params.Set("endDate", fmt.Sprintf("%v", c.endDate)) + params.Set("engineAccountId", fmt.Sprintf("%v", c.engineAccountId)) + params.Set("rowCount", fmt.Sprintf("%v", c.rowCount)) + params.Set("startDate", fmt.Sprintf("%v", c.startDate)) + params.Set("startRow", fmt.Sprintf("%v", c.startRow)) + urls := googleapi.ResolveRelative(c.s.BasePath, "conversion") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ConversionList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a batch of conversions in DoubleClick Search. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "doubleclicksearch.conversion.patch", + // "parameterOrder": [ + // "advertiserId", + // "agencyId", + // "endDate", + // "engineAccountId", + // "rowCount", + // "startDate", + // "startRow" + // ], + // "parameters": { + // "advertiserId": { + // "description": "Numeric ID of the advertiser.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "agencyId": { + // "description": "Numeric ID of the agency.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "endDate": { + // "description": "Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd.", + // "format": "int32", + // "location": "query", + // "maximum": "99991231", + // "minimum": "20091101", + // "required": true, + // "type": "integer" + // }, + // "engineAccountId": { + // "description": "Numeric ID of the engine account.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "rowCount": { + // "description": "The number of conversions to return per call.", + // "format": "int32", + // "location": "query", + // "maximum": "1000", + // "minimum": "1", + // "required": true, + // "type": "integer" + // }, + // "startDate": { + // "description": "First date (inclusive) on which to retrieve conversions. Format is yyyymmdd.", + // "format": "int32", + // "location": "query", + // "maximum": "99991231", + // "minimum": "20091101", + // "required": true, + // "type": "integer" + // }, + // "startRow": { + // "description": "The 0-based starting index for retrieving conversions results.", + // "format": "uint32", + // "location": "query", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "conversion", + // "request": { + // "$ref": "ConversionList" + // }, + // "response": { + // "$ref": "ConversionList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/doubleclicksearch" + // ] + // } + +} + +// method id "doubleclicksearch.conversion.update": + +type ConversionUpdateCall struct { + s *Service + conversionlist *ConversionList + opt_ map[string]interface{} +} + +// Update: Updates a batch of conversions in DoubleClick Search. +func (r *ConversionService) Update(conversionlist *ConversionList) *ConversionUpdateCall { + c := &ConversionUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.conversionlist = conversionlist + return c +} + +func (c *ConversionUpdateCall) Do() (*ConversionList, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionlist) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "conversion") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ConversionList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a batch of conversions in DoubleClick Search.", + // "httpMethod": "PUT", + // "id": "doubleclicksearch.conversion.update", + // "path": "conversion", + // "request": { + // "$ref": "ConversionList" + // }, + // "response": { + // "$ref": "ConversionList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/doubleclicksearch" + // ] + // } + +} + +// method id "doubleclicksearch.conversion.updateAvailability": + +type ConversionUpdateAvailabilityCall struct { + s *Service + updateavailabilityrequest *UpdateAvailabilityRequest + opt_ map[string]interface{} +} + +// UpdateAvailability: Updates the availabilities of a batch of +// floodlight activities in DoubleClick Search. +func (r *ConversionService) UpdateAvailability(updateavailabilityrequest *UpdateAvailabilityRequest) *ConversionUpdateAvailabilityCall { + c := &ConversionUpdateAvailabilityCall{s: r.s, opt_: make(map[string]interface{})} + c.updateavailabilityrequest = updateavailabilityrequest + return c +} + +func (c *ConversionUpdateAvailabilityCall) Do() (*UpdateAvailabilityResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateavailabilityrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "conversion/updateAvailability") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UpdateAvailabilityResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the availabilities of a batch of floodlight activities in DoubleClick Search.", + // "httpMethod": "POST", + // "id": "doubleclicksearch.conversion.updateAvailability", + // "path": "conversion/updateAvailability", + // "request": { + // "$ref": "UpdateAvailabilityRequest", + // "parameterName": "empty" + // }, + // "response": { + // "$ref": "UpdateAvailabilityResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/doubleclicksearch" + // ] + // } + +} + +// method id "doubleclicksearch.reports.generate": + +type ReportsGenerateCall struct { + s *Service + reportrequest *ReportRequest + opt_ map[string]interface{} +} + +// Generate: Generates and returns a report immediately. +func (r *ReportsService) Generate(reportrequest *ReportRequest) *ReportsGenerateCall { + c := &ReportsGenerateCall{s: r.s, opt_: make(map[string]interface{})} + c.reportrequest = reportrequest + return c +} + +func (c *ReportsGenerateCall) Do() (*Report, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/generate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generates and returns a report immediately.", + // "httpMethod": "POST", + // "id": "doubleclicksearch.reports.generate", + // "path": "reports/generate", + // "request": { + // "$ref": "ReportRequest", + // "parameterName": "reportRequest" + // }, + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/doubleclicksearch" + // ] + // } + +} + +// method id "doubleclicksearch.reports.get": + +type ReportsGetCall struct { + s *Service + reportId string + opt_ map[string]interface{} +} + +// Get: Polls for the status of a report request. +func (r *ReportsService) Get(reportId string) *ReportsGetCall { + c := &ReportsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.reportId = reportId + return c +} + +func (c *ReportsGetCall) Do() (*Report, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", url.QueryEscape(c.reportId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Polls for the status of a report request.", + // "httpMethod": "GET", + // "id": "doubleclicksearch.reports.get", + // "parameterOrder": [ + // "reportId" + // ], + // "parameters": { + // "reportId": { + // "description": "ID of the report request being polled.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "reports/{reportId}", + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/doubleclicksearch" + // ] + // } + +} + +// method id "doubleclicksearch.reports.getFile": + +type ReportsGetFileCall struct { + s *Service + reportId string + reportFragment int64 + opt_ map[string]interface{} +} + +// GetFile: Downloads a report file. +func (r *ReportsService) GetFile(reportId string, reportFragment int64) *ReportsGetFileCall { + c := &ReportsGetFileCall{s: r.s, opt_: make(map[string]interface{})} + c.reportId = reportId + c.reportFragment = reportFragment + return c +} + +func (c *ReportsGetFileCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{reportFragment}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", url.QueryEscape(c.reportId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportFragment}", strconv.FormatInt(c.reportFragment, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Downloads a report file.", + // "httpMethod": "GET", + // "id": "doubleclicksearch.reports.getFile", + // "parameterOrder": [ + // "reportId", + // "reportFragment" + // ], + // "parameters": { + // "reportFragment": { + // "description": "The index of the report fragment to download.", + // "format": "int32", + // "location": "path", + // "minimum": "0", + // "required": true, + // "type": "integer" + // }, + // "reportId": { + // "description": "ID of the report.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "reports/{reportId}/files/{reportFragment}", + // "scopes": [ + // "https://www.googleapis.com/auth/doubleclicksearch" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "doubleclicksearch.reports.request": + +type ReportsRequestCall struct { + s *Service + reportrequest *ReportRequest + opt_ map[string]interface{} +} + +// Request: Inserts a report request into the reporting system. +func (r *ReportsService) Request(reportrequest *ReportRequest) *ReportsRequestCall { + c := &ReportsRequestCall{s: r.s, opt_: make(map[string]interface{})} + c.reportrequest = reportrequest + return c +} + +func (c *ReportsRequestCall) Do() (*Report, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a report request into the reporting system.", + // "httpMethod": "POST", + // "id": "doubleclicksearch.reports.request", + // "path": "reports", + // "request": { + // "$ref": "ReportRequest", + // "parameterName": "reportRequest" + // }, + // "response": { + // "$ref": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/doubleclicksearch" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/drive/v1/drive-api.json b/third_party/src/code.google.com/p/google-api-go-client/drive/v1/drive-api.json new file mode 100644 index 0000000000000..789bedd066836 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/drive/v1/drive-api.json @@ -0,0 +1,417 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/_OTlrhreIDbn9vfKusTrBlY5vkI\"", + "discoveryVersion": "v1", + "id": "drive:v1", + "name": "drive", + "version": "v1", + "title": "Drive API", + "description": "The API to interact with Drive.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_16.png", + "x32": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_32.png" + }, + "documentationLink": "https://developers.google.com/drive/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/drive/v1/", + "basePath": "/drive/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "drive/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/drive.file": { + "description": "View and manage Google Drive files that you have opened or created with this app" + } + } + } + }, + "schemas": { + "File": { + "id": "File", + "type": "object", + "description": "The metadata for a file.", + "properties": { + "createdDate": { + "type": "string", + "description": "Create time for this file (formatted ISO8601 timestamp).", + "format": "date-time" + }, + "description": { + "type": "string", + "description": "A short description of the file" + }, + "downloadUrl": { + "type": "string", + "description": "Short term download URL for the file. This will only be populated on files with content stored in Drive." + }, + "etag": { + "type": "string", + "description": "ETag of the file." + }, + "fileExtension": { + "type": "string", + "description": "The file extension used when downloading this file. This field is read only. To set the extension, include it on title when creating the file. This will only be populated on files with content stored in Drive." + }, + "fileSize": { + "type": "string", + "description": "The size of the file in bytes. This will only be populated on files with content stored in Drive.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "The id of the file." + }, + "indexableText": { + "type": "object", + "description": "Indexable text attributes for the file (can only be written)", + "properties": { + "text": { + "type": "string", + "description": "The text to be indexed for this file" + } + } + }, + "kind": { + "type": "string", + "description": "The type of file. This is always drive#file", + "default": "drive#file" + }, + "labels": { + "type": "object", + "description": "Labels for the file.", + "properties": { + "hidden": { + "type": "boolean", + "description": "Whether this file is hidden from the user" + }, + "starred": { + "type": "boolean", + "description": "Whether this file is starred by the user." + }, + "trashed": { + "type": "boolean", + "description": "Whether this file has been trashed." + } + } + }, + "lastViewedDate": { + "type": "string", + "description": "Last time this file was viewed by the user (formatted RFC 3339 timestamp).", + "format": "date-time" + }, + "md5Checksum": { + "type": "string", + "description": "An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive." + }, + "mimeType": { + "type": "string", + "description": "The mimetype of the file" + }, + "modifiedByMeDate": { + "type": "string", + "description": "Last time this file was modified by the user (formatted RFC 3339 timestamp).", + "format": "date-time" + }, + "modifiedDate": { + "type": "string", + "description": "Last time this file was modified by anyone (formatted RFC 3339 timestamp).", + "format": "date-time" + }, + "parentsCollection": { + "type": "array", + "description": "Collection of parent folders which contain this file.\nOn insert, setting this field will put the file in all of the provided folders. If no folders are provided, the file will be placed in the default root folder. On update, this field is ignored.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The id of this parent" + }, + "parentLink": { + "type": "string", + "description": "A link to get the metadata for this parent" + } + } + } + }, + "selfLink": { + "type": "string", + "description": "A link back to this file." + }, + "title": { + "type": "string", + "description": "The title of this file." + }, + "userPermission": { + "$ref": "Permission", + "description": "The permissions for the authenticated user on this file." + } + } + }, + "Permission": { + "id": "Permission", + "type": "object", + "description": "A single permission for a file.", + "properties": { + "additionalRoles": { + "type": "array", + "description": "Any additional roles that this permission describes.", + "items": { + "type": "string" + } + }, + "etag": { + "type": "string", + "description": "An etag for this permission." + }, + "kind": { + "type": "string", + "description": "The kind of this permission. This is always drive#permission", + "default": "drive#permission" + }, + "role": { + "type": "string", + "description": "The role that this permission describes. (For example: reader, writer, owner)" + }, + "type": { + "type": "string", + "description": "The type of permission (For example: user, group etc)." + } + } + } + }, + "resources": { + "files": { + "methods": { + "get": { + "id": "drive.files.get", + "path": "files/{id}", + "httpMethod": "GET", + "description": "Gets a file's metadata by id.", + "parameters": { + "id": { + "type": "string", + "description": "The id for the file in question.", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "This parameter is deprecated and has no function.", + "enum": [ + "BASIC", + "FULL" + ], + "enumDescriptions": [ + "Deprecated", + "Deprecated" + ], + "location": "query" + }, + "updateViewedDate": { + "type": "boolean", + "description": "Whether to update the view date after successfully retrieving the file.", + "default": "true", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive.file" + ] + }, + "insert": { + "id": "drive.files.insert", + "path": "files", + "httpMethod": "POST", + "description": "Inserts a file, and any settable metadata or blob content sent with the request.", + "request": { + "$ref": "File" + }, + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive.file" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "maxSize": "1024GB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/drive/v1/files" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/drive/v1/files" + } + } + } + }, + "patch": { + "id": "drive.files.patch", + "path": "files/{id}", + "httpMethod": "PATCH", + "description": "Updates file metadata and/or content. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "The id for the file in question.", + "required": true, + "location": "path" + }, + "newRevision": { + "type": "boolean", + "description": "Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If not set or true, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).", + "default": "true", + "location": "query" + }, + "updateModifiedDate": { + "type": "boolean", + "description": "Controls updating the modified date of the file. If true, the modified date will be updated to the current time, regardless of whether other changes are being made. If false, the modified date will only be updated to the current time if other changes are also being made (changing the title, for example).", + "default": "false", + "location": "query" + }, + "updateViewedDate": { + "type": "boolean", + "description": "Whether to update the view date after successfully updating the file.", + "default": "true", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "File" + }, + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive.file" + ] + }, + "update": { + "id": "drive.files.update", + "path": "files/{id}", + "httpMethod": "PUT", + "description": "Updates file metadata and/or content", + "parameters": { + "id": { + "type": "string", + "description": "The id for the file in question.", + "required": true, + "location": "path" + }, + "newRevision": { + "type": "boolean", + "description": "Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If not set or true, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).", + "default": "true", + "location": "query" + }, + "updateModifiedDate": { + "type": "boolean", + "description": "Controls updating the modified date of the file. If true, the modified date will be updated to the current time, regardless of whether other changes are being made. If false, the modified date will only be updated to the current time if other changes are also being made (changing the title, for example).", + "default": "false", + "location": "query" + }, + "updateViewedDate": { + "type": "boolean", + "description": "Whether to update the view date after successfully updating the file.", + "default": "true", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "File" + }, + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive.file" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "maxSize": "1024GB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/drive/v1/files/{id}" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/drive/v1/files/{id}" + } + } + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/drive/v1/drive-gen.go b/third_party/src/code.google.com/p/google-api-go-client/drive/v1/drive-gen.go new file mode 100644 index 0000000000000..101c8f2e7682f --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/drive/v1/drive-gen.go @@ -0,0 +1,675 @@ +// Package drive provides access to the Drive API. +// +// See https://developers.google.com/drive/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/drive/v1" +// ... +// driveService, err := drive.New(oauthHttpClient) +package drive + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "drive:v1" +const apiName = "drive" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/drive/v1/" + +// OAuth2 scopes used by this API. +const ( + // View and manage Google Drive files that you have opened or created + // with this app + DriveFileScope = "https://www.googleapis.com/auth/drive.file" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Files = NewFilesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Files *FilesService +} + +func NewFilesService(s *Service) *FilesService { + rs := &FilesService{s: s} + return rs +} + +type FilesService struct { + s *Service +} + +type File struct { + // CreatedDate: Create time for this file (formatted ISO8601 timestamp). + CreatedDate string `json:"createdDate,omitempty"` + + // Description: A short description of the file + Description string `json:"description,omitempty"` + + // DownloadUrl: Short term download URL for the file. This will only be + // populated on files with content stored in Drive. + DownloadUrl string `json:"downloadUrl,omitempty"` + + // Etag: ETag of the file. + Etag string `json:"etag,omitempty"` + + // FileExtension: The file extension used when downloading this file. + // This field is read only. To set the extension, include it on title + // when creating the file. This will only be populated on files with + // content stored in Drive. + FileExtension string `json:"fileExtension,omitempty"` + + // FileSize: The size of the file in bytes. This will only be populated + // on files with content stored in Drive. + FileSize int64 `json:"fileSize,omitempty,string"` + + // Id: The id of the file. + Id string `json:"id,omitempty"` + + // IndexableText: Indexable text attributes for the file (can only be + // written) + IndexableText *FileIndexableText `json:"indexableText,omitempty"` + + // Kind: The type of file. This is always drive#file + Kind string `json:"kind,omitempty"` + + // Labels: Labels for the file. + Labels *FileLabels `json:"labels,omitempty"` + + // LastViewedDate: Last time this file was viewed by the user (formatted + // RFC 3339 timestamp). + LastViewedDate string `json:"lastViewedDate,omitempty"` + + // Md5Checksum: An MD5 checksum for the content of this file. This will + // only be populated on files with content stored in Drive. + Md5Checksum string `json:"md5Checksum,omitempty"` + + // MimeType: The mimetype of the file + MimeType string `json:"mimeType,omitempty"` + + // ModifiedByMeDate: Last time this file was modified by the user + // (formatted RFC 3339 timestamp). + ModifiedByMeDate string `json:"modifiedByMeDate,omitempty"` + + // ModifiedDate: Last time this file was modified by anyone (formatted + // RFC 3339 timestamp). + ModifiedDate string `json:"modifiedDate,omitempty"` + + // ParentsCollection: Collection of parent folders which contain this + // file. + // On insert, setting this field will put the file in all of the + // provided folders. If no folders are provided, the file will be placed + // in the default root folder. On update, this field is ignored. + ParentsCollection []*FileParentsCollection `json:"parentsCollection,omitempty"` + + // SelfLink: A link back to this file. + SelfLink string `json:"selfLink,omitempty"` + + // Title: The title of this file. + Title string `json:"title,omitempty"` + + // UserPermission: The permissions for the authenticated user on this + // file. + UserPermission *Permission `json:"userPermission,omitempty"` +} + +type FileIndexableText struct { + // Text: The text to be indexed for this file + Text string `json:"text,omitempty"` +} + +type FileLabels struct { + // Hidden: Whether this file is hidden from the user + Hidden bool `json:"hidden,omitempty"` + + // Starred: Whether this file is starred by the user. + Starred bool `json:"starred,omitempty"` + + // Trashed: Whether this file has been trashed. + Trashed bool `json:"trashed,omitempty"` +} + +type FileParentsCollection struct { + // Id: The id of this parent + Id string `json:"id,omitempty"` + + // ParentLink: A link to get the metadata for this parent + ParentLink string `json:"parentLink,omitempty"` +} + +type Permission struct { + // AdditionalRoles: Any additional roles that this permission describes. + AdditionalRoles []string `json:"additionalRoles,omitempty"` + + // Etag: An etag for this permission. + Etag string `json:"etag,omitempty"` + + // Kind: The kind of this permission. This is always drive#permission + Kind string `json:"kind,omitempty"` + + // Role: The role that this permission describes. (For example: reader, + // writer, owner) + Role string `json:"role,omitempty"` + + // Type: The type of permission (For example: user, group etc). + Type string `json:"type,omitempty"` +} + +// method id "drive.files.get": + +type FilesGetCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Get: Gets a file's metadata by id. +func (r *FilesService) Get(id string) *FilesGetCall { + c := &FilesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Projection sets the optional parameter "projection": This parameter +// is deprecated and has no function. +func (c *FilesGetCall) Projection(projection string) *FilesGetCall { + c.opt_["projection"] = projection + return c +} + +// UpdateViewedDate sets the optional parameter "updateViewedDate": +// Whether to update the view date after successfully retrieving the +// file. +func (c *FilesGetCall) UpdateViewedDate(updateViewedDate bool) *FilesGetCall { + c.opt_["updateViewedDate"] = updateViewedDate + return c +} + +func (c *FilesGetCall) Do() (*File, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updateViewedDate"]; ok { + params.Set("updateViewedDate", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a file's metadata by id.", + // "httpMethod": "GET", + // "id": "drive.files.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The id for the file in question.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "This parameter is deprecated and has no function.", + // "enum": [ + // "BASIC", + // "FULL" + // ], + // "enumDescriptions": [ + // "Deprecated", + // "Deprecated" + // ], + // "location": "query", + // "type": "string" + // }, + // "updateViewedDate": { + // "default": "true", + // "description": "Whether to update the view date after successfully retrieving the file.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "files/{id}", + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.files.insert": + +type FilesInsertCall struct { + s *Service + file *File + opt_ map[string]interface{} + media_ io.Reader +} + +// Insert: Inserts a file, and any settable metadata or blob content +// sent with the request. +func (r *FilesService) Insert(file *File) *FilesInsertCall { + c := &FilesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.file = file + return c +} +func (c *FilesInsertCall) Media(r io.Reader) *FilesInsertCall { + c.media_ = r + return c +} + +func (c *FilesInsertCall) Do() (*File, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a file, and any settable metadata or blob content sent with the request.", + // "httpMethod": "POST", + // "id": "drive.files.insert", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "maxSize": "1024GB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/drive/v1/files" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/drive/v1/files" + // } + // } + // }, + // "path": "files", + // "request": { + // "$ref": "File" + // }, + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive.file" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "drive.files.patch": + +type FilesPatchCall struct { + s *Service + id string + file *File + opt_ map[string]interface{} +} + +// Patch: Updates file metadata and/or content. This method supports +// patch semantics. +func (r *FilesService) Patch(id string, file *File) *FilesPatchCall { + c := &FilesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.file = file + return c +} + +// NewRevision sets the optional parameter "newRevision": Whether a blob +// upload should create a new revision. If false, the blob data in the +// current head revision is replaced. If not set or true, a new blob is +// created as head revision, and previous revisions are preserved +// (causing increased use of the user's data storage quota). +func (c *FilesPatchCall) NewRevision(newRevision bool) *FilesPatchCall { + c.opt_["newRevision"] = newRevision + return c +} + +// UpdateModifiedDate sets the optional parameter "updateModifiedDate": +// Controls updating the modified date of the file. If true, the +// modified date will be updated to the current time, regardless of +// whether other changes are being made. If false, the modified date +// will only be updated to the current time if other changes are also +// being made (changing the title, for example). +func (c *FilesPatchCall) UpdateModifiedDate(updateModifiedDate bool) *FilesPatchCall { + c.opt_["updateModifiedDate"] = updateModifiedDate + return c +} + +// UpdateViewedDate sets the optional parameter "updateViewedDate": +// Whether to update the view date after successfully updating the file. +func (c *FilesPatchCall) UpdateViewedDate(updateViewedDate bool) *FilesPatchCall { + c.opt_["updateViewedDate"] = updateViewedDate + return c +} + +func (c *FilesPatchCall) Do() (*File, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["newRevision"]; ok { + params.Set("newRevision", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updateModifiedDate"]; ok { + params.Set("updateModifiedDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updateViewedDate"]; ok { + params.Set("updateViewedDate", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates file metadata and/or content. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "drive.files.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The id for the file in question.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "newRevision": { + // "default": "true", + // "description": "Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If not set or true, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).", + // "location": "query", + // "type": "boolean" + // }, + // "updateModifiedDate": { + // "default": "false", + // "description": "Controls updating the modified date of the file. If true, the modified date will be updated to the current time, regardless of whether other changes are being made. If false, the modified date will only be updated to the current time if other changes are also being made (changing the title, for example).", + // "location": "query", + // "type": "boolean" + // }, + // "updateViewedDate": { + // "default": "true", + // "description": "Whether to update the view date after successfully updating the file.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "files/{id}", + // "request": { + // "$ref": "File" + // }, + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.files.update": + +type FilesUpdateCall struct { + s *Service + id string + file *File + opt_ map[string]interface{} + media_ io.Reader +} + +// Update: Updates file metadata and/or content +func (r *FilesService) Update(id string, file *File) *FilesUpdateCall { + c := &FilesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.file = file + return c +} + +// NewRevision sets the optional parameter "newRevision": Whether a blob +// upload should create a new revision. If false, the blob data in the +// current head revision is replaced. If not set or true, a new blob is +// created as head revision, and previous revisions are preserved +// (causing increased use of the user's data storage quota). +func (c *FilesUpdateCall) NewRevision(newRevision bool) *FilesUpdateCall { + c.opt_["newRevision"] = newRevision + return c +} + +// UpdateModifiedDate sets the optional parameter "updateModifiedDate": +// Controls updating the modified date of the file. If true, the +// modified date will be updated to the current time, regardless of +// whether other changes are being made. If false, the modified date +// will only be updated to the current time if other changes are also +// being made (changing the title, for example). +func (c *FilesUpdateCall) UpdateModifiedDate(updateModifiedDate bool) *FilesUpdateCall { + c.opt_["updateModifiedDate"] = updateModifiedDate + return c +} + +// UpdateViewedDate sets the optional parameter "updateViewedDate": +// Whether to update the view date after successfully updating the file. +func (c *FilesUpdateCall) UpdateViewedDate(updateViewedDate bool) *FilesUpdateCall { + c.opt_["updateViewedDate"] = updateViewedDate + return c +} +func (c *FilesUpdateCall) Media(r io.Reader) *FilesUpdateCall { + c.media_ = r + return c +} + +func (c *FilesUpdateCall) Do() (*File, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["newRevision"]; ok { + params.Set("newRevision", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updateModifiedDate"]; ok { + params.Set("updateModifiedDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updateViewedDate"]; ok { + params.Set("updateViewedDate", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{id}") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates file metadata and/or content", + // "httpMethod": "PUT", + // "id": "drive.files.update", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "maxSize": "1024GB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/drive/v1/files/{id}" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/drive/v1/files/{id}" + // } + // } + // }, + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The id for the file in question.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "newRevision": { + // "default": "true", + // "description": "Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If not set or true, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).", + // "location": "query", + // "type": "boolean" + // }, + // "updateModifiedDate": { + // "default": "false", + // "description": "Controls updating the modified date of the file. If true, the modified date will be updated to the current time, regardless of whether other changes are being made. If false, the modified date will only be updated to the current time if other changes are also being made (changing the title, for example).", + // "location": "query", + // "type": "boolean" + // }, + // "updateViewedDate": { + // "default": "true", + // "description": "Whether to update the view date after successfully updating the file.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "files/{id}", + // "request": { + // "$ref": "File" + // }, + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive.file" + // ], + // "supportsMediaUpload": true + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/drive/v2/drive-api.json b/third_party/src/code.google.com/p/google-api-go-client/drive/v2/drive-api.json new file mode 100644 index 0000000000000..4d9aa78383119 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/drive/v2/drive-api.json @@ -0,0 +1,3890 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/kuOAnH89ODs6iXVpq8K9hCO3DK0\"", + "discoveryVersion": "v1", + "id": "drive:v2", + "name": "drive", + "version": "v2", + "title": "Drive API", + "description": "The API to interact with Drive.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_16.png", + "x32": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_32.png" + }, + "documentationLink": "https://developers.google.com/drive/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/drive/v2/", + "basePath": "/drive/v2/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "drive/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/drive": { + "description": "View and manage the files and documents in your Google Drive" + }, + "https://www.googleapis.com/auth/drive.appdata": { + "description": "View and manage its own configuration data in your Google Drive" + }, + "https://www.googleapis.com/auth/drive.apps.readonly": { + "description": "View your Google Drive apps" + }, + "https://www.googleapis.com/auth/drive.file": { + "description": "View and manage Google Drive files that you have opened or created with this app" + }, + "https://www.googleapis.com/auth/drive.metadata.readonly": { + "description": "View metadata for files and documents in your Google Drive" + }, + "https://www.googleapis.com/auth/drive.readonly": { + "description": "View the files and documents in your Google Drive" + }, + "https://www.googleapis.com/auth/drive.scripts": { + "description": "Modify your Google Apps Script scripts' behavior" + } + } + } + }, + "schemas": { + "About": { + "id": "About", + "type": "object", + "description": "An item with user information and settings.", + "properties": { + "additionalRoleInfo": { + "type": "array", + "description": "Information about supported additional roles per file type. The most specific type takes precedence.", + "items": { + "type": "object", + "properties": { + "roleSets": { + "type": "array", + "description": "The supported additional roles per primary role.", + "items": { + "type": "object", + "properties": { + "additionalRoles": { + "type": "array", + "description": "The supported additional roles with the primary role.", + "items": { + "type": "string" + } + }, + "primaryRole": { + "type": "string", + "description": "A primary permission role." + } + } + } + }, + "type": { + "type": "string", + "description": "The content type that this additional role info applies to." + } + } + } + }, + "domainSharingPolicy": { + "type": "string", + "description": "The domain sharing policy for the current user." + }, + "etag": { + "type": "string", + "description": "The ETag of the item." + }, + "exportFormats": { + "type": "array", + "description": "The allowable export formats.", + "items": { + "type": "object", + "properties": { + "source": { + "type": "string", + "description": "The content type to convert from." + }, + "targets": { + "type": "array", + "description": "The possible content types to convert to.", + "items": { + "type": "string" + } + } + } + } + }, + "features": { + "type": "array", + "description": "List of additional features enabled on this account.", + "items": { + "type": "object", + "properties": { + "featureName": { + "type": "string", + "description": "The name of the feature." + }, + "featureRate": { + "type": "number", + "description": "The request limit rate for this feature, in queries per second.", + "format": "double" + } + } + } + }, + "importFormats": { + "type": "array", + "description": "The allowable import formats.", + "items": { + "type": "object", + "properties": { + "source": { + "type": "string", + "description": "The imported file's content type to convert from." + }, + "targets": { + "type": "array", + "description": "The possible content types to convert to.", + "items": { + "type": "string" + } + } + } + } + }, + "isCurrentAppInstalled": { + "type": "boolean", + "description": "A boolean indicating whether the authenticated app is installed by the authenticated user." + }, + "kind": { + "type": "string", + "description": "This is always drive#about.", + "default": "drive#about" + }, + "largestChangeId": { + "type": "string", + "description": "The largest change id.", + "format": "int64" + }, + "maxUploadSizes": { + "type": "array", + "description": "List of max upload sizes for each file type. The most specific type takes precedence.", + "items": { + "type": "object", + "properties": { + "size": { + "type": "string", + "description": "The max upload size for this type.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "The file type." + } + } + } + }, + "name": { + "type": "string", + "description": "The name of the current user." + }, + "permissionId": { + "type": "string", + "description": "The current user's ID as visible in the permissions collection." + }, + "quotaBytesTotal": { + "type": "string", + "description": "The total number of quota bytes.", + "format": "int64" + }, + "quotaBytesUsed": { + "type": "string", + "description": "The number of quota bytes used by Google Drive.", + "format": "int64" + }, + "quotaBytesUsedAggregate": { + "type": "string", + "description": "The number of quota bytes used by all Google apps (Drive, Picasa, etc.).", + "format": "int64" + }, + "quotaBytesUsedInTrash": { + "type": "string", + "description": "The number of quota bytes used by trashed items.", + "format": "int64" + }, + "remainingChangeIds": { + "type": "string", + "description": "The number of remaining change ids.", + "format": "int64" + }, + "rootFolderId": { + "type": "string", + "description": "The id of the root folder." + }, + "selfLink": { + "type": "string", + "description": "A link back to this item." + }, + "user": { + "$ref": "User", + "description": "The authenticated user." + } + } + }, + "App": { + "id": "App", + "type": "object", + "description": "The apps resource provides a list of the apps that a user has installed, with information about each app's supported MIME types, file extensions, and other details.", + "properties": { + "authorized": { + "type": "boolean", + "description": "Whether the app is authorized to access data on the user's Drive." + }, + "createInFolderTemplate": { + "type": "string", + "description": "The template url to create a new file with this app in a given folder. The template will contain {folderId} to be replaced by the folder to create the new file in." + }, + "createUrl": { + "type": "string", + "description": "The url to create a new file with this app." + }, + "icons": { + "type": "array", + "description": "The various icons for the app.", + "items": { + "type": "object", + "properties": { + "category": { + "type": "string", + "description": "Category of the icon. Allowed values are: \n- application - icon for the application \n- document - icon for a file associated with the app \n- documentShared - icon for a shared file associated with the app" + }, + "iconUrl": { + "type": "string", + "description": "URL for the icon." + }, + "size": { + "type": "integer", + "description": "Size of the icon. Represented as the maximum of the width and height.", + "format": "int32" + } + } + } + }, + "id": { + "type": "string", + "description": "The ID of the app." + }, + "installed": { + "type": "boolean", + "description": "Whether the app is installed." + }, + "kind": { + "type": "string", + "description": "This is always drive#app.", + "default": "drive#app" + }, + "longDescription": { + "type": "string", + "description": "A long description of the app." + }, + "name": { + "type": "string", + "description": "The name of the app." + }, + "objectType": { + "type": "string", + "description": "The type of object this app creates (e.g. Chart). If empty, the app name should be used instead." + }, + "openUrlTemplate": { + "type": "string", + "description": "The template url for opening files with this app. The template will contain {ids} and/or {exportIds} to be replaced by the actual file ids." + }, + "primaryFileExtensions": { + "type": "array", + "description": "The list of primary file extensions.", + "items": { + "type": "string" + } + }, + "primaryMimeTypes": { + "type": "array", + "description": "The list of primary mime types.", + "items": { + "type": "string" + } + }, + "productId": { + "type": "string", + "description": "The ID of the product listing for this app." + }, + "productUrl": { + "type": "string", + "description": "A link to the product listing for this app." + }, + "secondaryFileExtensions": { + "type": "array", + "description": "The list of secondary file extensions.", + "items": { + "type": "string" + } + }, + "secondaryMimeTypes": { + "type": "array", + "description": "The list of secondary mime types.", + "items": { + "type": "string" + } + }, + "shortDescription": { + "type": "string", + "description": "A short description of the app." + }, + "supportsCreate": { + "type": "boolean", + "description": "Whether this app supports creating new objects." + }, + "supportsImport": { + "type": "boolean", + "description": "Whether this app supports importing Google Docs." + }, + "supportsMultiOpen": { + "type": "boolean", + "description": "Whether this app supports opening more than one file." + }, + "useByDefault": { + "type": "boolean", + "description": "Whether the app is selected as the default handler for the types it supports." + } + } + }, + "AppList": { + "id": "AppList", + "type": "object", + "description": "A list of third-party applications which the user has installed or given access to Google Drive.", + "properties": { + "etag": { + "type": "string", + "description": "The ETag of the list." + }, + "items": { + "type": "array", + "description": "The actual list of apps.", + "items": { + "$ref": "App" + } + }, + "kind": { + "type": "string", + "description": "This is always drive#appList.", + "default": "drive#appList" + }, + "selfLink": { + "type": "string", + "description": "A link back to this list." + } + } + }, + "Change": { + "id": "Change", + "type": "object", + "description": "Representation of a change to a file.", + "properties": { + "deleted": { + "type": "boolean", + "description": "Whether the file has been deleted." + }, + "file": { + "$ref": "File", + "description": "The updated state of the file. Present if the file has not been deleted." + }, + "fileId": { + "type": "string", + "description": "The ID of the file associated with this change." + }, + "id": { + "type": "string", + "description": "The ID of the change.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "This is always drive#change.", + "default": "drive#change" + }, + "modificationDate": { + "type": "string", + "description": "The time of this modification.", + "format": "date-time" + }, + "selfLink": { + "type": "string", + "description": "A link back to this change." + } + } + }, + "ChangeList": { + "id": "ChangeList", + "type": "object", + "description": "A list of changes for a user.", + "properties": { + "etag": { + "type": "string", + "description": "The ETag of the list." + }, + "items": { + "type": "array", + "description": "The actual list of changes.", + "items": { + "$ref": "Change" + } + }, + "kind": { + "type": "string", + "description": "This is always drive#changeList.", + "default": "drive#changeList" + }, + "largestChangeId": { + "type": "string", + "description": "The current largest change ID.", + "format": "int64" + }, + "nextLink": { + "type": "string", + "description": "A link to the next page of changes." + }, + "nextPageToken": { + "type": "string", + "description": "The page token for the next page of changes." + }, + "selfLink": { + "type": "string", + "description": "A link back to this list." + } + } + }, + "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." + } + } + }, + "ChildList": { + "id": "ChildList", + "type": "object", + "description": "A list of children of a file.", + "properties": { + "etag": { + "type": "string", + "description": "The ETag of the list." + }, + "items": { + "type": "array", + "description": "The actual list of children.", + "items": { + "$ref": "ChildReference" + } + }, + "kind": { + "type": "string", + "description": "This is always drive#childList.", + "default": "drive#childList" + }, + "nextLink": { + "type": "string", + "description": "A link to the next page of children." + }, + "nextPageToken": { + "type": "string", + "description": "The page token for the next page of children." + }, + "selfLink": { + "type": "string", + "description": "A link back to this list." + } + } + }, + "ChildReference": { + "id": "ChildReference", + "type": "object", + "description": "A reference to a folder's child.", + "properties": { + "childLink": { + "type": "string", + "description": "A link to the child." + }, + "id": { + "type": "string", + "description": "The ID of the child.", + "annotations": { + "required": [ + "drive.children.insert" + ] + } + }, + "kind": { + "type": "string", + "description": "This is always drive#childReference.", + "default": "drive#childReference" + }, + "selfLink": { + "type": "string", + "description": "A link back to this reference." + } + } + }, + "Comment": { + "id": "Comment", + "type": "object", + "description": "A JSON representation of a comment on a file in Google Drive.", + "properties": { + "anchor": { + "type": "string", + "description": "A region of the document represented as a JSON string. See anchor documentation for details on how to define and interpret anchor properties." + }, + "author": { + "$ref": "User", + "description": "The user who wrote this comment." + }, + "commentId": { + "type": "string", + "description": "The ID of the comment." + }, + "content": { + "type": "string", + "description": "The plain text content used to create this comment. This is not HTML safe and should only be used as a starting point to make edits to a comment's content.", + "annotations": { + "required": [ + "drive.comments.insert", + "drive.comments.update" + ] + } + }, + "context": { + "type": "object", + "description": "The context of the file which is being commented on.", + "properties": { + "type": { + "type": "string", + "description": "The MIME type of the context snippet." + }, + "value": { + "type": "string", + "description": "Data representation of the segment of the file being commented on. In the case of a text file for example, this would be the actual text that the comment is about." + } + } + }, + "createdDate": { + "type": "string", + "description": "The date when this comment was first created.", + "format": "date-time" + }, + "deleted": { + "type": "boolean", + "description": "Whether this comment has been deleted. If a comment has been deleted the content will be cleared and this will only represent a comment that once existed." + }, + "fileId": { + "type": "string", + "description": "The file which this comment is addressing." + }, + "fileTitle": { + "type": "string", + "description": "The title of the file which this comment is addressing." + }, + "htmlContent": { + "type": "string", + "description": "HTML formatted content for this comment." + }, + "kind": { + "type": "string", + "description": "This is always drive#comment.", + "default": "drive#comment" + }, + "modifiedDate": { + "type": "string", + "description": "The date when this comment or any of its replies were last modified.", + "format": "date-time" + }, + "replies": { + "type": "array", + "description": "Replies to this post.", + "items": { + "$ref": "CommentReply" + } + }, + "selfLink": { + "type": "string", + "description": "A link back to this comment." + }, + "status": { + "type": "string", + "description": "The status of this comment. Status can be changed by posting a reply to a comment with the desired status. \n- \"open\" - The comment is still open. \n- \"resolved\" - The comment has been resolved by one of its replies." + } + } + }, + "CommentList": { + "id": "CommentList", + "type": "object", + "description": "A JSON representation of a list of comments on a file in Google Drive.", + "properties": { + "items": { + "type": "array", + "description": "List of comments.", + "items": { + "$ref": "Comment" + } + }, + "kind": { + "type": "string", + "description": "This is always drive#commentList.", + "default": "drive#commentList" + }, + "nextLink": { + "type": "string", + "description": "A link to the next page of comments." + }, + "nextPageToken": { + "type": "string", + "description": "The token to use to request the next page of results." + }, + "selfLink": { + "type": "string", + "description": "A link back to this list." + } + } + }, + "CommentReply": { + "id": "CommentReply", + "type": "object", + "description": "A JSON representation of a reply to a comment on a file in Google Drive.", + "properties": { + "author": { + "$ref": "User", + "description": "The user who wrote this reply." + }, + "content": { + "type": "string", + "description": "The plain text content used to create this reply. This is not HTML safe and should only be used as a starting point to make edits to a reply's content. This field is required on inserts if no verb is specified (resolve/reopen).", + "annotations": { + "required": [ + "drive.replies.update" + ] + } + }, + "createdDate": { + "type": "string", + "description": "The date when this reply was first created.", + "format": "date-time" + }, + "deleted": { + "type": "boolean", + "description": "Whether this reply has been deleted. If a reply has been deleted the content will be cleared and this will only represent a reply that once existed." + }, + "htmlContent": { + "type": "string", + "description": "HTML formatted content for this reply." + }, + "kind": { + "type": "string", + "description": "This is always drive#commentReply.", + "default": "drive#commentReply" + }, + "modifiedDate": { + "type": "string", + "description": "The date when this reply was last modified.", + "format": "date-time" + }, + "replyId": { + "type": "string", + "description": "The ID of the reply." + }, + "verb": { + "type": "string", + "description": "The action this reply performed to the parent comment. When creating a new reply this is the action to be perform to the parent comment. Possible values are: \n- \"resolve\" - To resolve a comment. \n- \"reopen\" - To reopen (un-resolve) a comment." + } + } + }, + "CommentReplyList": { + "id": "CommentReplyList", + "type": "object", + "description": "A JSON representation of a list of replies to a comment on a file in Google Drive.", + "properties": { + "items": { + "type": "array", + "description": "List of reply.", + "items": { + "$ref": "CommentReply" + } + }, + "kind": { + "type": "string", + "description": "This is always drive#commentReplyList.", + "default": "drive#commentReplyList" + }, + "nextLink": { + "type": "string", + "description": "A link to the next page of replies." + }, + "nextPageToken": { + "type": "string", + "description": "The token to use to request the next page of results." + }, + "selfLink": { + "type": "string", + "description": "A link back to this list." + } + } + }, + "File": { + "id": "File", + "type": "object", + "description": "The metadata for a file.", + "properties": { + "alternateLink": { + "type": "string", + "description": "A link for opening the file in using a relevant Google editor or viewer." + }, + "appDataContents": { + "type": "boolean", + "description": "Whether this file is in the appdata folder." + }, + "copyable": { + "type": "boolean", + "description": "Whether the file can be copied by the current user." + }, + "createdDate": { + "type": "string", + "description": "Create time for this file (formatted ISO8601 timestamp).", + "format": "date-time" + }, + "defaultOpenWithLink": { + "type": "string", + "description": "A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used." + }, + "description": { + "type": "string", + "description": "A short description of the file." + }, + "downloadUrl": { + "type": "string", + "description": "Short lived download URL for the file. This is only populated for files with content stored in Drive." + }, + "editable": { + "type": "boolean", + "description": "Whether the file can be edited by the current user." + }, + "embedLink": { + "type": "string", + "description": "A link for embedding the file." + }, + "etag": { + "type": "string", + "description": "ETag of the file." + }, + "explicitlyTrashed": { + "type": "boolean", + "description": "Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed." + }, + "exportLinks": { + "type": "object", + "description": "Links for exporting Google Docs to specific formats.", + "additionalProperties": { + "type": "string", + "description": "A mapping from export format to URL" + } + }, + "fileExtension": { + "type": "string", + "description": "The file extension used when downloading this file. This field is read only. To set the extension, include it in the title when creating the file. This is only populated for files with content stored in Drive." + }, + "fileSize": { + "type": "string", + "description": "The size of the file in bytes. This is only populated for files with content stored in Drive.", + "format": "int64" + }, + "headRevisionId": { + "type": "string", + "description": "The ID of the file's head revision. This will only be populated for files with content stored in Drive." + }, + "iconLink": { + "type": "string", + "description": "A link to the file's icon." + }, + "id": { + "type": "string", + "description": "The ID of the file." + }, + "imageMediaMetadata": { + "type": "object", + "description": "Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.", + "properties": { + "aperture": { + "type": "number", + "description": "The aperture used to create the photo (f-number).", + "format": "float" + }, + "cameraMake": { + "type": "string", + "description": "The make of the camera used to create the photo." + }, + "cameraModel": { + "type": "string", + "description": "The model of the camera used to create the photo." + }, + "colorSpace": { + "type": "string", + "description": "The color space of the photo." + }, + "date": { + "type": "string", + "description": "The date and time the photo was taken (EXIF format timestamp)." + }, + "exposureBias": { + "type": "number", + "description": "The exposure bias of the photo (APEX value).", + "format": "float" + }, + "exposureMode": { + "type": "string", + "description": "The exposure mode used to create the photo." + }, + "exposureTime": { + "type": "number", + "description": "The length of the exposure, in seconds.", + "format": "float" + }, + "flashUsed": { + "type": "boolean", + "description": "Whether a flash was used to create the photo." + }, + "focalLength": { + "type": "number", + "description": "The focal length used to create the photo, in millimeters.", + "format": "float" + }, + "height": { + "type": "integer", + "description": "The height of the image in pixels.", + "format": "int32" + }, + "isoSpeed": { + "type": "integer", + "description": "The ISO speed used to create the photo.", + "format": "int32" + }, + "lens": { + "type": "string", + "description": "The lens used to create the photo." + }, + "location": { + "type": "object", + "description": "Geographic location information stored in the image.", + "properties": { + "altitude": { + "type": "number", + "description": "The altitude stored in the image.", + "format": "double" + }, + "latitude": { + "type": "number", + "description": "The latitude stored in the image.", + "format": "double" + }, + "longitude": { + "type": "number", + "description": "The longitude stored in the image.", + "format": "double" + } + } + }, + "maxApertureValue": { + "type": "number", + "description": "The smallest f-number of the lens at the focal length used to create the photo (APEX value).", + "format": "float" + }, + "meteringMode": { + "type": "string", + "description": "The metering mode used to create the photo." + }, + "rotation": { + "type": "integer", + "description": "The rotation in clockwise degrees from the image's original orientation.", + "format": "int32" + }, + "sensor": { + "type": "string", + "description": "The type of sensor used to create the photo." + }, + "subjectDistance": { + "type": "integer", + "description": "The distance to the subject of the photo, in meters.", + "format": "int32" + }, + "whiteBalance": { + "type": "string", + "description": "The white balance mode used to create the photo." + }, + "width": { + "type": "integer", + "description": "The width of the image in pixels.", + "format": "int32" + } + } + }, + "indexableText": { + "type": "object", + "description": "Indexable text attributes for the file (can only be written)", + "properties": { + "text": { + "type": "string", + "description": "The text to be indexed for this file." + } + } + }, + "kind": { + "type": "string", + "description": "The type of file. This is always drive#file.", + "default": "drive#file" + }, + "labels": { + "type": "object", + "description": "A group of labels for the file.", + "properties": { + "hidden": { + "type": "boolean", + "description": "Deprecated." + }, + "restricted": { + "type": "boolean", + "description": "Whether viewers are prevented from downloading this file." + }, + "starred": { + "type": "boolean", + "description": "Whether this file is starred by the user." + }, + "trashed": { + "type": "boolean", + "description": "Whether this file has been trashed." + }, + "viewed": { + "type": "boolean", + "description": "Whether this file has been viewed by this user." + } + } + }, + "lastModifyingUser": { + "$ref": "User", + "description": "The last user to modify this file." + }, + "lastModifyingUserName": { + "type": "string", + "description": "Name of the last user to modify this file." + }, + "lastViewedByMeDate": { + "type": "string", + "description": "Last time this file was viewed by the user (formatted RFC 3339 timestamp).", + "format": "date-time" + }, + "md5Checksum": { + "type": "string", + "description": "An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive." + }, + "mimeType": { + "type": "string", + "description": "The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type." + }, + "modifiedByMeDate": { + "type": "string", + "description": "Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.", + "format": "date-time" + }, + "modifiedDate": { + "type": "string", + "description": "Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.", + "format": "date-time" + }, + "openWithLinks": { + "type": "object", + "description": "A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.", + "additionalProperties": { + "type": "string" + } + }, + "originalFilename": { + "type": "string", + "description": "The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive." + }, + "ownerNames": { + "type": "array", + "description": "Name(s) of the owner(s) of this file.", + "items": { + "type": "string" + } + }, + "owners": { + "type": "array", + "description": "The owner(s) of this file.", + "items": { + "$ref": "User" + } + }, + "parents": { + "type": "array", + "description": "Collection of parent folders which contain this file.\nSetting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder.", + "items": { + "$ref": "ParentReference" + } + }, + "properties": { + "type": "array", + "description": "The list of properties.", + "items": { + "$ref": "Property" + } + }, + "quotaBytesUsed": { + "type": "string", + "description": "The number of quota bytes used by this file.", + "format": "int64" + }, + "selfLink": { + "type": "string", + "description": "A link back to this file." + }, + "shared": { + "type": "boolean", + "description": "Whether the file has been shared." + }, + "sharedWithMeDate": { + "type": "string", + "description": "Time at which this file was shared with the user (formatted RFC 3339 timestamp).", + "format": "date-time" + }, + "thumbnail": { + "type": "object", + "description": "Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.", + "properties": { + "image": { + "type": "string", + "description": "The URL-safe Base64 encoded bytes of the thumbnail image.", + "format": "byte" + }, + "mimeType": { + "type": "string", + "description": "The MIME type of the thumbnail." + } + } + }, + "thumbnailLink": { + "type": "string", + "description": "A link to the file's thumbnail." + }, + "title": { + "type": "string", + "description": "The title of this file." + }, + "userPermission": { + "$ref": "Permission", + "description": "The permissions for the authenticated user on this file." + }, + "webContentLink": { + "type": "string", + "description": "A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials." + }, + "webViewLink": { + "type": "string", + "description": "A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting." + }, + "writersCanShare": { + "type": "boolean", + "description": "Whether writers can share the document with other users." + } + } + }, + "FileList": { + "id": "FileList", + "type": "object", + "description": "A list of files.", + "properties": { + "etag": { + "type": "string", + "description": "The ETag of the list." + }, + "items": { + "type": "array", + "description": "The actual list of files.", + "items": { + "$ref": "File" + } + }, + "kind": { + "type": "string", + "description": "This is always drive#fileList.", + "default": "drive#fileList" + }, + "nextLink": { + "type": "string", + "description": "A link to the next page of files." + }, + "nextPageToken": { + "type": "string", + "description": "The page token for the next page of files." + }, + "selfLink": { + "type": "string", + "description": "A link back to this list." + } + } + }, + "ParentList": { + "id": "ParentList", + "type": "object", + "description": "A list of a file's parents.", + "properties": { + "etag": { + "type": "string", + "description": "The ETag of the list." + }, + "items": { + "type": "array", + "description": "The actual list of parents.", + "items": { + "$ref": "ParentReference" + } + }, + "kind": { + "type": "string", + "description": "This is always drive#parentList.", + "default": "drive#parentList" + }, + "selfLink": { + "type": "string", + "description": "A link back to this list." + } + } + }, + "ParentReference": { + "id": "ParentReference", + "type": "object", + "description": "A reference to a file's parent.", + "properties": { + "id": { + "type": "string", + "description": "The ID of the parent.", + "annotations": { + "required": [ + "drive.parents.insert" + ] + } + }, + "isRoot": { + "type": "boolean", + "description": "Whether or not the parent is the root folder." + }, + "kind": { + "type": "string", + "description": "This is always drive#parentReference.", + "default": "drive#parentReference" + }, + "parentLink": { + "type": "string", + "description": "A link to the parent." + }, + "selfLink": { + "type": "string", + "description": "A link back to this reference." + } + } + }, + "Permission": { + "id": "Permission", + "type": "object", + "description": "A permission for a file.", + "properties": { + "additionalRoles": { + "type": "array", + "description": "Additional roles for this user. Only commenter is currently allowed.", + "items": { + "type": "string" + } + }, + "authKey": { + "type": "string", + "description": "The authkey parameter required for this permission." + }, + "domain": { + "type": "string", + "description": "The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is \"user\", \"group\" or \"domain\"." + }, + "emailAddress": { + "type": "string", + "description": "The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is \"user\" and the given user's Google+ profile privacy settings allow exposing their email address." + }, + "etag": { + "type": "string", + "description": "The ETag of the permission." + }, + "id": { + "type": "string", + "description": "The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of 'id' or 'value' fields must be specified." + }, + "kind": { + "type": "string", + "description": "This is always drive#permission.", + "default": "drive#permission" + }, + "name": { + "type": "string", + "description": "The name for this permission." + }, + "photoLink": { + "type": "string", + "description": "A link to the profile photo, if available." + }, + "role": { + "type": "string", + "description": "The primary role for this user. Allowed values are: \n- owner \n- reader \n- writer", + "annotations": { + "required": [ + "drive.permissions.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "A link back to this permission." + }, + "type": { + "type": "string", + "description": "The account type. Allowed values are: \n- user \n- group \n- domain \n- anyone", + "annotations": { + "required": [ + "drive.permissions.insert" + ] + } + }, + "value": { + "type": "string", + "description": "The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of 'id' or 'value' fields must be specified." + }, + "withLink": { + "type": "boolean", + "description": "Whether the link is required for this permission." + } + } + }, + "PermissionId": { + "id": "PermissionId", + "type": "object", + "description": "An ID for a user or group as seen in Permission items.", + "properties": { + "id": { + "type": "string", + "description": "The permission ID." + }, + "kind": { + "type": "string", + "description": "This is always drive#permissionId.", + "default": "drive#permissionId" + } + } + }, + "PermissionList": { + "id": "PermissionList", + "type": "object", + "description": "A list of permissions associated with a file.", + "properties": { + "etag": { + "type": "string", + "description": "The ETag of the list." + }, + "items": { + "type": "array", + "description": "The actual list of permissions.", + "items": { + "$ref": "Permission" + } + }, + "kind": { + "type": "string", + "description": "This is always drive#permissionList.", + "default": "drive#permissionList" + }, + "selfLink": { + "type": "string", + "description": "A link back to this list." + } + } + }, + "Property": { + "id": "Property", + "type": "object", + "description": "A key-value pair that is either public or private to an application.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the property." + }, + "key": { + "type": "string", + "description": "The key of this property." + }, + "kind": { + "type": "string", + "description": "This is always drive#property.", + "default": "drive#property" + }, + "selfLink": { + "type": "string", + "description": "The link back to this property." + }, + "value": { + "type": "string", + "description": "The value of this property." + }, + "visibility": { + "type": "string", + "description": "The visibility of this property." + } + } + }, + "PropertyList": { + "id": "PropertyList", + "type": "object", + "description": "A collection of properties, key-value pairs that are either public or private to an application.", + "properties": { + "etag": { + "type": "string", + "description": "The ETag of the list." + }, + "items": { + "type": "array", + "description": "The list of properties.", + "items": { + "$ref": "Property" + } + }, + "kind": { + "type": "string", + "description": "This is always drive#propertyList.", + "default": "drive#propertyList" + }, + "selfLink": { + "type": "string", + "description": "The link back to this list." + } + } + }, + "Revision": { + "id": "Revision", + "type": "object", + "description": "A revision of a file.", + "properties": { + "downloadUrl": { + "type": "string", + "description": "Short term download URL for the file. This will only be populated on files with content stored in Drive." + }, + "etag": { + "type": "string", + "description": "The ETag of the revision." + }, + "exportLinks": { + "type": "object", + "description": "Links for exporting Google Docs to specific formats.", + "additionalProperties": { + "type": "string", + "description": "A mapping from export format to URL" + } + }, + "fileSize": { + "type": "string", + "description": "The size of the revision in bytes. This will only be populated on files with content stored in Drive.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "The ID of the revision." + }, + "kind": { + "type": "string", + "description": "This is always drive#revision.", + "default": "drive#revision" + }, + "lastModifyingUser": { + "$ref": "User", + "description": "The last user to modify this revision." + }, + "lastModifyingUserName": { + "type": "string", + "description": "Name of the last user to modify this revision." + }, + "md5Checksum": { + "type": "string", + "description": "An MD5 checksum for the content of this revision. This will only be populated on files with content stored in Drive." + }, + "mimeType": { + "type": "string", + "description": "The MIME type of the revision." + }, + "modifiedDate": { + "type": "string", + "description": "Last time this revision was modified (formatted RFC 3339 timestamp).", + "format": "date-time" + }, + "originalFilename": { + "type": "string", + "description": "The original filename when this revision was created. This will only be populated on files with content stored in Drive." + }, + "pinned": { + "type": "boolean", + "description": "Whether this revision is pinned to prevent automatic purging. This will only be populated and can only be modified on files with content stored in Drive which are not Google Docs. Revisions can also be pinned when they are created through the drive.files.insert/update/copy by using the pinned query parameter." + }, + "publishAuto": { + "type": "boolean", + "description": "Whether subsequent revisions will be automatically republished. This is only populated and can only be modified for Google Docs." + }, + "published": { + "type": "boolean", + "description": "Whether this revision is published. This is only populated and can only be modified for Google Docs." + }, + "publishedLink": { + "type": "string", + "description": "A link to the published revision." + }, + "publishedOutsideDomain": { + "type": "boolean", + "description": "Whether this revision is published outside the domain. This is only populated and can only be modified for Google Docs." + }, + "selfLink": { + "type": "string", + "description": "A link back to this revision." + } + } + }, + "RevisionList": { + "id": "RevisionList", + "type": "object", + "description": "A list of revisions of a file.", + "properties": { + "etag": { + "type": "string", + "description": "The ETag of the list." + }, + "items": { + "type": "array", + "description": "The actual list of revisions.", + "items": { + "$ref": "Revision" + } + }, + "kind": { + "type": "string", + "description": "This is always drive#revisionList.", + "default": "drive#revisionList" + }, + "selfLink": { + "type": "string", + "description": "A link back to this list." + } + } + }, + "User": { + "id": "User", + "type": "object", + "description": "The JSON template for a user.", + "properties": { + "displayName": { + "type": "string", + "description": "A plain text displayable name for this user." + }, + "isAuthenticatedUser": { + "type": "boolean", + "description": "Whether this user is the same as the authenticated user for whom the request was made." + }, + "kind": { + "type": "string", + "description": "This is always drive#user.", + "default": "drive#user" + }, + "permissionId": { + "type": "string", + "description": "The user's ID as visible in the permissions collection." + }, + "picture": { + "type": "object", + "description": "The user's profile picture.", + "properties": { + "url": { + "type": "string", + "description": "A URL that points to a profile picture of this user." + } + } + } + } + } + }, + "resources": { + "about": { + "methods": { + "get": { + "id": "drive.about.get", + "path": "about", + "httpMethod": "GET", + "description": "Gets the information about the current user along with Drive API settings", + "parameters": { + "includeSubscribed": { + "type": "boolean", + "description": "When calculating the number of remaining change IDs, whether to include shared files and public files the user has opened. When set to false, this counts only change IDs for owned files and any shared or public files that the user has explictly added to a folder in Drive.", + "default": "true", + "location": "query" + }, + "maxChangeIdCount": { + "type": "string", + "description": "Maximum number of remaining change IDs to count", + "default": "1", + "format": "int64", + "location": "query" + }, + "startChangeId": { + "type": "string", + "description": "Change ID to start counting from when calculating number of remaining change IDs", + "format": "int64", + "location": "query" + } + }, + "response": { + "$ref": "About" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + } + } + }, + "apps": { + "methods": { + "get": { + "id": "drive.apps.get", + "path": "apps/{appId}", + "httpMethod": "GET", + "description": "Gets a specific app.", + "parameters": { + "appId": { + "type": "string", + "description": "The ID of the app.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "appId" + ], + "response": { + "$ref": "App" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.apps.readonly", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "list": { + "id": "drive.apps.list", + "path": "apps", + "httpMethod": "GET", + "description": "Lists a user's installed apps.", + "response": { + "$ref": "AppList" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive.apps.readonly" + ] + } + } + }, + "changes": { + "methods": { + "get": { + "id": "drive.changes.get", + "path": "changes/{changeId}", + "httpMethod": "GET", + "description": "Gets a specific change.", + "parameters": { + "changeId": { + "type": "string", + "description": "The ID of the change.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "changeId" + ], + "response": { + "$ref": "Change" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.apps.readonly", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "list": { + "id": "drive.changes.list", + "path": "changes", + "httpMethod": "GET", + "description": "Lists the changes for a user.", + "parameters": { + "includeDeleted": { + "type": "boolean", + "description": "Whether to include deleted items.", + "default": "true", + "location": "query" + }, + "includeSubscribed": { + "type": "boolean", + "description": "Whether to include shared files and public files the user has opened. When set to false, the list will include owned files plus any shared or public files the user has explictly added to a folder in Drive.", + "default": "true", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of changes to return.", + "default": "100", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Page token for changes.", + "location": "query" + }, + "startChangeId": { + "type": "string", + "description": "Change ID to start listing changes from.", + "format": "int64", + "location": "query" + } + }, + "response": { + "$ref": "ChangeList" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.apps.readonly", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ], + "supportsSubscription": true + }, + "watch": { + "id": "drive.changes.watch", + "path": "changes/watch", + "httpMethod": "POST", + "description": "Subscribe to changes for a user.", + "parameters": { + "includeDeleted": { + "type": "boolean", + "description": "Whether to include deleted items.", + "default": "true", + "location": "query" + }, + "includeSubscribed": { + "type": "boolean", + "description": "Whether to include shared files and public files the user has opened. When set to false, the list will include owned files plus any shared or public files the user has explictly added to a folder in Drive.", + "default": "true", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of changes to return.", + "default": "100", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Page token for changes.", + "location": "query" + }, + "startChangeId": { + "type": "string", + "description": "Change ID to start listing changes from.", + "format": "int64", + "location": "query" + } + }, + "request": { + "$ref": "Channel", + "parameterName": "resource" + }, + "response": { + "$ref": "Channel" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.apps.readonly", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ], + "supportsSubscription": true + } + } + }, + "channels": { + "methods": { + "stop": { + "id": "drive.channels.stop", + "path": "channels/stop", + "httpMethod": "POST", + "description": "Stop watching resources through this channel", + "request": { + "$ref": "Channel", + "parameterName": "resource" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.apps.readonly", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + } + } + }, + "children": { + "methods": { + "delete": { + "id": "drive.children.delete", + "path": "files/{folderId}/children/{childId}", + "httpMethod": "DELETE", + "description": "Removes a child from a folder.", + "parameters": { + "childId": { + "type": "string", + "description": "The ID of the child.", + "required": true, + "location": "path" + }, + "folderId": { + "type": "string", + "description": "The ID of the folder.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "folderId", + "childId" + ], + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "get": { + "id": "drive.children.get", + "path": "files/{folderId}/children/{childId}", + "httpMethod": "GET", + "description": "Gets a specific child reference.", + "parameters": { + "childId": { + "type": "string", + "description": "The ID of the child.", + "required": true, + "location": "path" + }, + "folderId": { + "type": "string", + "description": "The ID of the folder.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "folderId", + "childId" + ], + "response": { + "$ref": "ChildReference" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "insert": { + "id": "drive.children.insert", + "path": "files/{folderId}/children", + "httpMethod": "POST", + "description": "Inserts a file into a folder.", + "parameters": { + "folderId": { + "type": "string", + "description": "The ID of the folder.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "folderId" + ], + "request": { + "$ref": "ChildReference" + }, + "response": { + "$ref": "ChildReference" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "list": { + "id": "drive.children.list", + "path": "files/{folderId}/children", + "httpMethod": "GET", + "description": "Lists a folder's children.", + "parameters": { + "folderId": { + "type": "string", + "description": "The ID of the folder.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of children to return.", + "default": "100", + "format": "int32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Page token for children.", + "location": "query" + }, + "q": { + "type": "string", + "description": "Query string for searching children.", + "location": "query" + } + }, + "parameterOrder": [ + "folderId" + ], + "response": { + "$ref": "ChildList" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + } + } + }, + "comments": { + "methods": { + "delete": { + "id": "drive.comments.delete", + "path": "files/{fileId}/comments/{commentId}", + "httpMethod": "DELETE", + "description": "Deletes a comment.", + "parameters": { + "commentId": { + "type": "string", + "description": "The ID of the comment.", + "required": true, + "location": "path" + }, + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId", + "commentId" + ], + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "get": { + "id": "drive.comments.get", + "path": "files/{fileId}/comments/{commentId}", + "httpMethod": "GET", + "description": "Gets a comment by ID.", + "parameters": { + "commentId": { + "type": "string", + "description": "The ID of the comment.", + "required": true, + "location": "path" + }, + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + }, + "includeDeleted": { + "type": "boolean", + "description": "If set, this will succeed when retrieving a deleted comment, and will include any deleted replies.", + "default": "false", + "location": "query" + } + }, + "parameterOrder": [ + "fileId", + "commentId" + ], + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "insert": { + "id": "drive.comments.insert", + "path": "files/{fileId}/comments", + "httpMethod": "POST", + "description": "Creates a new comment on the given file.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId" + ], + "request": { + "$ref": "Comment" + }, + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "list": { + "id": "drive.comments.list", + "path": "files/{fileId}/comments", + "httpMethod": "GET", + "description": "Lists a file's comments.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + }, + "includeDeleted": { + "type": "boolean", + "description": "If set, all comments and replies, including deleted comments and replies (with content stripped) will be returned.", + "default": "false", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of discussions to include in the response, used for paging.", + "default": "20", + "format": "int32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + }, + "updatedMin": { + "type": "string", + "description": "Only discussions that were updated after this timestamp will be returned. Formatted as an RFC 3339 timestamp.", + "location": "query" + } + }, + "parameterOrder": [ + "fileId" + ], + "response": { + "$ref": "CommentList" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "patch": { + "id": "drive.comments.patch", + "path": "files/{fileId}/comments/{commentId}", + "httpMethod": "PATCH", + "description": "Updates an existing comment. This method supports patch semantics.", + "parameters": { + "commentId": { + "type": "string", + "description": "The ID of the comment.", + "required": true, + "location": "path" + }, + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId", + "commentId" + ], + "request": { + "$ref": "Comment" + }, + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "update": { + "id": "drive.comments.update", + "path": "files/{fileId}/comments/{commentId}", + "httpMethod": "PUT", + "description": "Updates an existing comment.", + "parameters": { + "commentId": { + "type": "string", + "description": "The ID of the comment.", + "required": true, + "location": "path" + }, + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId", + "commentId" + ], + "request": { + "$ref": "Comment" + }, + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file" + ] + } + } + }, + "files": { + "methods": { + "copy": { + "id": "drive.files.copy", + "path": "files/{fileId}/copy", + "httpMethod": "POST", + "description": "Creates a copy of the specified file.", + "parameters": { + "convert": { + "type": "boolean", + "description": "Whether to convert this file to the corresponding Google Docs format.", + "default": "false", + "location": "query" + }, + "fileId": { + "type": "string", + "description": "The ID of the file to copy.", + "required": true, + "location": "path" + }, + "ocr": { + "type": "boolean", + "description": "Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.", + "default": "false", + "location": "query" + }, + "ocrLanguage": { + "type": "string", + "description": "If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.", + "location": "query" + }, + "pinned": { + "type": "boolean", + "description": "Whether to pin the head revision of the new copy.", + "default": "false", + "location": "query" + }, + "timedTextLanguage": { + "type": "string", + "description": "The language of the timed text.", + "location": "query" + }, + "timedTextTrackName": { + "type": "string", + "description": "The timed text track name.", + "location": "query" + }, + "visibility": { + "type": "string", + "description": "The visibility of the new file. This parameter is only relevant when the source is not a native Google Doc and convert=false.", + "default": "DEFAULT", + "enum": [ + "DEFAULT", + "PRIVATE" + ], + "enumDescriptions": [ + "The visibility of the new file is determined by the user's default visibility/sharing policies.", + "The new file will be visible to only the owner." + ], + "location": "query" + } + }, + "parameterOrder": [ + "fileId" + ], + "request": { + "$ref": "File" + }, + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.apps.readonly", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "delete": { + "id": "drive.files.delete", + "path": "files/{fileId}", + "httpMethod": "DELETE", + "description": "Permanently deletes a file by ID. Skips the trash.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file to delete.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId" + ], + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "get": { + "id": "drive.files.get", + "path": "files/{fileId}", + "httpMethod": "GET", + "description": "Gets a file's metadata by ID.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID for the file in question.", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "This parameter is deprecated and has no function.", + "enum": [ + "BASIC", + "FULL" + ], + "enumDescriptions": [ + "Deprecated", + "Deprecated" + ], + "location": "query" + }, + "updateViewedDate": { + "type": "boolean", + "description": "Whether to update the view date after successfully retrieving the file.", + "default": "false", + "location": "query" + } + }, + "parameterOrder": [ + "fileId" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.apps.readonly", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ], + "supportsSubscription": true + }, + "insert": { + "id": "drive.files.insert", + "path": "files", + "httpMethod": "POST", + "description": "Insert a new file.", + "parameters": { + "convert": { + "type": "boolean", + "description": "Whether to convert this file to the corresponding Google Docs format.", + "default": "false", + "location": "query" + }, + "ocr": { + "type": "boolean", + "description": "Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.", + "default": "false", + "location": "query" + }, + "ocrLanguage": { + "type": "string", + "description": "If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.", + "location": "query" + }, + "pinned": { + "type": "boolean", + "description": "Whether to pin the head revision of the uploaded file.", + "default": "false", + "location": "query" + }, + "timedTextLanguage": { + "type": "string", + "description": "The language of the timed text.", + "location": "query" + }, + "timedTextTrackName": { + "type": "string", + "description": "The timed text track name.", + "location": "query" + }, + "useContentAsIndexableText": { + "type": "boolean", + "description": "Whether to use the content as indexable text.", + "default": "false", + "location": "query" + }, + "visibility": { + "type": "string", + "description": "The visibility of the new file. This parameter is only relevant when convert=false.", + "default": "DEFAULT", + "enum": [ + "DEFAULT", + "PRIVATE" + ], + "enumDescriptions": [ + "The visibility of the new file is determined by the user's default visibility/sharing policies.", + "The new file will be visible to only the owner." + ], + "location": "query" + } + }, + "request": { + "$ref": "File" + }, + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.apps.readonly", + "https://www.googleapis.com/auth/drive.file" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "maxSize": "1024GB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/drive/v2/files" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/drive/v2/files" + } + } + }, + "supportsSubscription": true + }, + "list": { + "id": "drive.files.list", + "path": "files", + "httpMethod": "GET", + "description": "Lists the user's files.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of files to return.", + "default": "100", + "format": "int32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Page token for files.", + "location": "query" + }, + "projection": { + "type": "string", + "description": "This parameter is deprecated and has no function.", + "enum": [ + "BASIC", + "FULL" + ], + "enumDescriptions": [ + "Deprecated", + "Deprecated" + ], + "location": "query" + }, + "q": { + "type": "string", + "description": "Query string for searching files.", + "location": "query" + } + }, + "response": { + "$ref": "FileList" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.apps.readonly", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "patch": { + "id": "drive.files.patch", + "path": "files/{fileId}", + "httpMethod": "PATCH", + "description": "Updates file metadata and/or content. This method supports patch semantics.", + "parameters": { + "convert": { + "type": "boolean", + "description": "Whether to convert this file to the corresponding Google Docs format.", + "default": "false", + "location": "query" + }, + "fileId": { + "type": "string", + "description": "The ID of the file to update.", + "required": true, + "location": "path" + }, + "newRevision": { + "type": "boolean", + "description": "Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If not set or true, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).", + "default": "true", + "location": "query" + }, + "ocr": { + "type": "boolean", + "description": "Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.", + "default": "false", + "location": "query" + }, + "ocrLanguage": { + "type": "string", + "description": "If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.", + "location": "query" + }, + "pinned": { + "type": "boolean", + "description": "Whether to pin the new revision.", + "default": "false", + "location": "query" + }, + "setModifiedDate": { + "type": "boolean", + "description": "Whether to set the modified date with the supplied modified date.", + "default": "false", + "location": "query" + }, + "timedTextLanguage": { + "type": "string", + "description": "The language of the timed text.", + "location": "query" + }, + "timedTextTrackName": { + "type": "string", + "description": "The timed text track name.", + "location": "query" + }, + "updateViewedDate": { + "type": "boolean", + "description": "Whether to update the view date after successfully updating the file.", + "default": "true", + "location": "query" + }, + "useContentAsIndexableText": { + "type": "boolean", + "description": "Whether to use the content as indexable text.", + "default": "false", + "location": "query" + } + }, + "parameterOrder": [ + "fileId" + ], + "request": { + "$ref": "File" + }, + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.apps.readonly", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.scripts" + ] + }, + "touch": { + "id": "drive.files.touch", + "path": "files/{fileId}/touch", + "httpMethod": "POST", + "description": "Set the file's updated time to the current server time.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file to update.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.apps.readonly", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "trash": { + "id": "drive.files.trash", + "path": "files/{fileId}/trash", + "httpMethod": "POST", + "description": "Moves a file to the trash.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file to trash.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.apps.readonly", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "untrash": { + "id": "drive.files.untrash", + "path": "files/{fileId}/untrash", + "httpMethod": "POST", + "description": "Restores a file from the trash.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file to untrash.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.apps.readonly", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "update": { + "id": "drive.files.update", + "path": "files/{fileId}", + "httpMethod": "PUT", + "description": "Updates file metadata and/or content.", + "parameters": { + "convert": { + "type": "boolean", + "description": "Whether to convert this file to the corresponding Google Docs format.", + "default": "false", + "location": "query" + }, + "fileId": { + "type": "string", + "description": "The ID of the file to update.", + "required": true, + "location": "path" + }, + "newRevision": { + "type": "boolean", + "description": "Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If not set or true, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).", + "default": "true", + "location": "query" + }, + "ocr": { + "type": "boolean", + "description": "Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.", + "default": "false", + "location": "query" + }, + "ocrLanguage": { + "type": "string", + "description": "If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.", + "location": "query" + }, + "pinned": { + "type": "boolean", + "description": "Whether to pin the new revision.", + "default": "false", + "location": "query" + }, + "setModifiedDate": { + "type": "boolean", + "description": "Whether to set the modified date with the supplied modified date.", + "default": "false", + "location": "query" + }, + "timedTextLanguage": { + "type": "string", + "description": "The language of the timed text.", + "location": "query" + }, + "timedTextTrackName": { + "type": "string", + "description": "The timed text track name.", + "location": "query" + }, + "updateViewedDate": { + "type": "boolean", + "description": "Whether to update the view date after successfully updating the file.", + "default": "true", + "location": "query" + }, + "useContentAsIndexableText": { + "type": "boolean", + "description": "Whether to use the content as indexable text.", + "default": "false", + "location": "query" + } + }, + "parameterOrder": [ + "fileId" + ], + "request": { + "$ref": "File" + }, + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.apps.readonly", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.scripts" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "maxSize": "1024GB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/drive/v2/files/{fileId}" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/drive/v2/files/{fileId}" + } + } + } + }, + "watch": { + "id": "drive.files.watch", + "path": "files/{fileId}/watch", + "httpMethod": "POST", + "description": "Subscribe to changes on a file", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID for the file in question.", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "This parameter is deprecated and has no function.", + "enum": [ + "BASIC", + "FULL" + ], + "enumDescriptions": [ + "Deprecated", + "Deprecated" + ], + "location": "query" + }, + "updateViewedDate": { + "type": "boolean", + "description": "Whether to update the view date after successfully retrieving the file.", + "default": "false", + "location": "query" + } + }, + "parameterOrder": [ + "fileId" + ], + "request": { + "$ref": "Channel", + "parameterName": "resource" + }, + "response": { + "$ref": "Channel" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.apps.readonly", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ], + "supportsSubscription": true + } + } + }, + "parents": { + "methods": { + "delete": { + "id": "drive.parents.delete", + "path": "files/{fileId}/parents/{parentId}", + "httpMethod": "DELETE", + "description": "Removes a parent from a file.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + }, + "parentId": { + "type": "string", + "description": "The ID of the parent.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId", + "parentId" + ], + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "get": { + "id": "drive.parents.get", + "path": "files/{fileId}/parents/{parentId}", + "httpMethod": "GET", + "description": "Gets a specific parent reference.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + }, + "parentId": { + "type": "string", + "description": "The ID of the parent.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId", + "parentId" + ], + "response": { + "$ref": "ParentReference" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "insert": { + "id": "drive.parents.insert", + "path": "files/{fileId}/parents", + "httpMethod": "POST", + "description": "Adds a parent folder for a file.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId" + ], + "request": { + "$ref": "ParentReference" + }, + "response": { + "$ref": "ParentReference" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "list": { + "id": "drive.parents.list", + "path": "files/{fileId}/parents", + "httpMethod": "GET", + "description": "Lists a file's parents.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId" + ], + "response": { + "$ref": "ParentList" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + } + } + }, + "permissions": { + "methods": { + "delete": { + "id": "drive.permissions.delete", + "path": "files/{fileId}/permissions/{permissionId}", + "httpMethod": "DELETE", + "description": "Deletes a permission from a file.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID for the file.", + "required": true, + "location": "path" + }, + "permissionId": { + "type": "string", + "description": "The ID for the permission.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId", + "permissionId" + ], + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "get": { + "id": "drive.permissions.get", + "path": "files/{fileId}/permissions/{permissionId}", + "httpMethod": "GET", + "description": "Gets a permission by ID.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID for the file.", + "required": true, + "location": "path" + }, + "permissionId": { + "type": "string", + "description": "The ID for the permission.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId", + "permissionId" + ], + "response": { + "$ref": "Permission" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "getIdForEmail": { + "id": "drive.permissions.getIdForEmail", + "path": "permissionIds/{email}", + "httpMethod": "GET", + "description": "Returns the permission ID for an email address.", + "parameters": { + "email": { + "type": "string", + "description": "The email address for which to return a permission ID", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "email" + ], + "response": { + "$ref": "PermissionId" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.apps.readonly", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "insert": { + "id": "drive.permissions.insert", + "path": "files/{fileId}/permissions", + "httpMethod": "POST", + "description": "Inserts a permission for a file.", + "parameters": { + "emailMessage": { + "type": "string", + "description": "A custom message to include in notification emails.", + "location": "query" + }, + "fileId": { + "type": "string", + "description": "The ID for the file.", + "required": true, + "location": "path" + }, + "sendNotificationEmails": { + "type": "boolean", + "description": "Whether to send notification emails when sharing to users or groups.", + "default": "true", + "location": "query" + } + }, + "parameterOrder": [ + "fileId" + ], + "request": { + "$ref": "Permission" + }, + "response": { + "$ref": "Permission" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "list": { + "id": "drive.permissions.list", + "path": "files/{fileId}/permissions", + "httpMethod": "GET", + "description": "Lists a file's permissions.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID for the file.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId" + ], + "response": { + "$ref": "PermissionList" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "patch": { + "id": "drive.permissions.patch", + "path": "files/{fileId}/permissions/{permissionId}", + "httpMethod": "PATCH", + "description": "Updates a permission. This method supports patch semantics.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID for the file.", + "required": true, + "location": "path" + }, + "permissionId": { + "type": "string", + "description": "The ID for the permission.", + "required": true, + "location": "path" + }, + "transferOwnership": { + "type": "boolean", + "description": "Whether changing a role to 'owner' should also downgrade the current owners to writers.", + "default": "false", + "location": "query" + } + }, + "parameterOrder": [ + "fileId", + "permissionId" + ], + "request": { + "$ref": "Permission" + }, + "response": { + "$ref": "Permission" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "update": { + "id": "drive.permissions.update", + "path": "files/{fileId}/permissions/{permissionId}", + "httpMethod": "PUT", + "description": "Updates a permission.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID for the file.", + "required": true, + "location": "path" + }, + "permissionId": { + "type": "string", + "description": "The ID for the permission.", + "required": true, + "location": "path" + }, + "transferOwnership": { + "type": "boolean", + "description": "Whether changing a role to 'owner' should also downgrade the current owners to writers.", + "default": "false", + "location": "query" + } + }, + "parameterOrder": [ + "fileId", + "permissionId" + ], + "request": { + "$ref": "Permission" + }, + "response": { + "$ref": "Permission" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file" + ] + } + } + }, + "properties": { + "methods": { + "delete": { + "id": "drive.properties.delete", + "path": "files/{fileId}/properties/{propertyKey}", + "httpMethod": "DELETE", + "description": "Deletes a property.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + }, + "propertyKey": { + "type": "string", + "description": "The key of the property.", + "required": true, + "location": "path" + }, + "visibility": { + "type": "string", + "description": "The visibility of the property.", + "default": "private", + "location": "query" + } + }, + "parameterOrder": [ + "fileId", + "propertyKey" + ], + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "get": { + "id": "drive.properties.get", + "path": "files/{fileId}/properties/{propertyKey}", + "httpMethod": "GET", + "description": "Gets a property by its key.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + }, + "propertyKey": { + "type": "string", + "description": "The key of the property.", + "required": true, + "location": "path" + }, + "visibility": { + "type": "string", + "description": "The visibility of the property.", + "default": "private", + "location": "query" + } + }, + "parameterOrder": [ + "fileId", + "propertyKey" + ], + "response": { + "$ref": "Property" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "insert": { + "id": "drive.properties.insert", + "path": "files/{fileId}/properties", + "httpMethod": "POST", + "description": "Adds a property to a file.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId" + ], + "request": { + "$ref": "Property" + }, + "response": { + "$ref": "Property" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "list": { + "id": "drive.properties.list", + "path": "files/{fileId}/properties", + "httpMethod": "GET", + "description": "Lists a file's properties.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId" + ], + "response": { + "$ref": "PropertyList" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "patch": { + "id": "drive.properties.patch", + "path": "files/{fileId}/properties/{propertyKey}", + "httpMethod": "PATCH", + "description": "Updates a property. This method supports patch semantics.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + }, + "propertyKey": { + "type": "string", + "description": "The key of the property.", + "required": true, + "location": "path" + }, + "visibility": { + "type": "string", + "description": "The visibility of the property.", + "default": "private", + "location": "query" + } + }, + "parameterOrder": [ + "fileId", + "propertyKey" + ], + "request": { + "$ref": "Property" + }, + "response": { + "$ref": "Property" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "update": { + "id": "drive.properties.update", + "path": "files/{fileId}/properties/{propertyKey}", + "httpMethod": "PUT", + "description": "Updates a property.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + }, + "propertyKey": { + "type": "string", + "description": "The key of the property.", + "required": true, + "location": "path" + }, + "visibility": { + "type": "string", + "description": "The visibility of the property.", + "default": "private", + "location": "query" + } + }, + "parameterOrder": [ + "fileId", + "propertyKey" + ], + "request": { + "$ref": "Property" + }, + "response": { + "$ref": "Property" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file" + ] + } + } + }, + "realtime": { + "methods": { + "get": { + "id": "drive.realtime.get", + "path": "files/{fileId}/realtime", + "httpMethod": "GET", + "description": "Exports the contents of the Realtime API data model associated with this file as JSON.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file that the Realtime API data model is associated with.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId" + ], + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.readonly" + ], + "supportsMediaDownload": true + }, + "update": { + "id": "drive.realtime.update", + "path": "files/{fileId}/realtime", + "httpMethod": "PUT", + "description": "Overwrites the Realtime API data model associated with this file with the provided JSON data model.", + "parameters": { + "baseRevision": { + "type": "string", + "description": "The revision of the model to diff the uploaded model against. If set, the uploaded model is diffed against the provided revision and those differences are merged with any changes made to the model after the provided revision. If not set, the uploaded model replaces the current model on the server.", + "location": "query" + }, + "fileId": { + "type": "string", + "description": "The ID of the file that the Realtime API data model is associated with.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId" + ], + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "maxSize": "10MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/drive/v2/files/{fileId}/realtime" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/drive/v2/files/{fileId}/realtime" + } + } + } + } + } + }, + "replies": { + "methods": { + "delete": { + "id": "drive.replies.delete", + "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", + "httpMethod": "DELETE", + "description": "Deletes a reply.", + "parameters": { + "commentId": { + "type": "string", + "description": "The ID of the comment.", + "required": true, + "location": "path" + }, + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + }, + "replyId": { + "type": "string", + "description": "The ID of the reply.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId", + "commentId", + "replyId" + ], + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "get": { + "id": "drive.replies.get", + "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", + "httpMethod": "GET", + "description": "Gets a reply.", + "parameters": { + "commentId": { + "type": "string", + "description": "The ID of the comment.", + "required": true, + "location": "path" + }, + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + }, + "includeDeleted": { + "type": "boolean", + "description": "If set, this will succeed when retrieving a deleted reply.", + "default": "false", + "location": "query" + }, + "replyId": { + "type": "string", + "description": "The ID of the reply.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId", + "commentId", + "replyId" + ], + "response": { + "$ref": "CommentReply" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "insert": { + "id": "drive.replies.insert", + "path": "files/{fileId}/comments/{commentId}/replies", + "httpMethod": "POST", + "description": "Creates a new reply to the given comment.", + "parameters": { + "commentId": { + "type": "string", + "description": "The ID of the comment.", + "required": true, + "location": "path" + }, + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId", + "commentId" + ], + "request": { + "$ref": "CommentReply" + }, + "response": { + "$ref": "CommentReply" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "list": { + "id": "drive.replies.list", + "path": "files/{fileId}/comments/{commentId}/replies", + "httpMethod": "GET", + "description": "Lists all of the replies to a comment.", + "parameters": { + "commentId": { + "type": "string", + "description": "The ID of the comment.", + "required": true, + "location": "path" + }, + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + }, + "includeDeleted": { + "type": "boolean", + "description": "If set, all replies, including deleted replies (with content stripped) will be returned.", + "default": "false", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of replies to include in the response, used for paging.", + "default": "20", + "format": "int32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "fileId", + "commentId" + ], + "response": { + "$ref": "CommentReplyList" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "patch": { + "id": "drive.replies.patch", + "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", + "httpMethod": "PATCH", + "description": "Updates an existing reply. This method supports patch semantics.", + "parameters": { + "commentId": { + "type": "string", + "description": "The ID of the comment.", + "required": true, + "location": "path" + }, + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + }, + "replyId": { + "type": "string", + "description": "The ID of the reply.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId", + "commentId", + "replyId" + ], + "request": { + "$ref": "CommentReply" + }, + "response": { + "$ref": "CommentReply" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "update": { + "id": "drive.replies.update", + "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", + "httpMethod": "PUT", + "description": "Updates an existing reply.", + "parameters": { + "commentId": { + "type": "string", + "description": "The ID of the comment.", + "required": true, + "location": "path" + }, + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + }, + "replyId": { + "type": "string", + "description": "The ID of the reply.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId", + "commentId", + "replyId" + ], + "request": { + "$ref": "CommentReply" + }, + "response": { + "$ref": "CommentReply" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file" + ] + } + } + }, + "revisions": { + "methods": { + "delete": { + "id": "drive.revisions.delete", + "path": "files/{fileId}/revisions/{revisionId}", + "httpMethod": "DELETE", + "description": "Removes a revision.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + }, + "revisionId": { + "type": "string", + "description": "The ID of the revision.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId", + "revisionId" + ], + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "get": { + "id": "drive.revisions.get", + "path": "files/{fileId}/revisions/{revisionId}", + "httpMethod": "GET", + "description": "Gets a specific revision.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + }, + "revisionId": { + "type": "string", + "description": "The ID of the revision.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId", + "revisionId" + ], + "response": { + "$ref": "Revision" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "list": { + "id": "drive.revisions.list", + "path": "files/{fileId}/revisions", + "httpMethod": "GET", + "description": "Lists a file's revisions.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the file.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId" + ], + "response": { + "$ref": "RevisionList" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "patch": { + "id": "drive.revisions.patch", + "path": "files/{fileId}/revisions/{revisionId}", + "httpMethod": "PATCH", + "description": "Updates a revision. This method supports patch semantics.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID for the file.", + "required": true, + "location": "path" + }, + "revisionId": { + "type": "string", + "description": "The ID for the revision.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId", + "revisionId" + ], + "request": { + "$ref": "Revision" + }, + "response": { + "$ref": "Revision" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file" + ] + }, + "update": { + "id": "drive.revisions.update", + "path": "files/{fileId}/revisions/{revisionId}", + "httpMethod": "PUT", + "description": "Updates a revision.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID for the file.", + "required": true, + "location": "path" + }, + "revisionId": { + "type": "string", + "description": "The ID for the revision.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "fileId", + "revisionId" + ], + "request": { + "$ref": "Revision" + }, + "response": { + "$ref": "Revision" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/drive.file" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/drive/v2/drive-gen.go b/third_party/src/code.google.com/p/google-api-go-client/drive/v2/drive-gen.go new file mode 100644 index 0000000000000..15aed01191730 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/drive/v2/drive-gen.go @@ -0,0 +1,6948 @@ +// Package drive provides access to the Drive API. +// +// See https://developers.google.com/drive/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/drive/v2" +// ... +// driveService, err := drive.New(oauthHttpClient) +package drive + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "drive:v2" +const apiName = "drive" +const apiVersion = "v2" +const basePath = "https://www.googleapis.com/drive/v2/" + +// OAuth2 scopes used by this API. +const ( + // View and manage the files and documents in your Google Drive + DriveScope = "https://www.googleapis.com/auth/drive" + + // View and manage its own configuration data in your Google Drive + DriveAppdataScope = "https://www.googleapis.com/auth/drive.appdata" + + // View your Google Drive apps + DriveAppsReadonlyScope = "https://www.googleapis.com/auth/drive.apps.readonly" + + // View and manage Google Drive files that you have opened or created + // with this app + DriveFileScope = "https://www.googleapis.com/auth/drive.file" + + // View metadata for files and documents in your Google Drive + DriveMetadataReadonlyScope = "https://www.googleapis.com/auth/drive.metadata.readonly" + + // View the files and documents in your Google Drive + DriveReadonlyScope = "https://www.googleapis.com/auth/drive.readonly" + + // Modify your Google Apps Script scripts' behavior + DriveScriptsScope = "https://www.googleapis.com/auth/drive.scripts" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.About = NewAboutService(s) + s.Apps = NewAppsService(s) + s.Changes = NewChangesService(s) + s.Channels = NewChannelsService(s) + s.Children = NewChildrenService(s) + s.Comments = NewCommentsService(s) + s.Files = NewFilesService(s) + s.Parents = NewParentsService(s) + s.Permissions = NewPermissionsService(s) + s.Properties = NewPropertiesService(s) + s.Realtime = NewRealtimeService(s) + s.Replies = NewRepliesService(s) + s.Revisions = NewRevisionsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + About *AboutService + + Apps *AppsService + + Changes *ChangesService + + Channels *ChannelsService + + Children *ChildrenService + + Comments *CommentsService + + Files *FilesService + + Parents *ParentsService + + Permissions *PermissionsService + + Properties *PropertiesService + + Realtime *RealtimeService + + Replies *RepliesService + + Revisions *RevisionsService +} + +func NewAboutService(s *Service) *AboutService { + rs := &AboutService{s: s} + return rs +} + +type AboutService struct { + s *Service +} + +func NewAppsService(s *Service) *AppsService { + rs := &AppsService{s: s} + return rs +} + +type AppsService struct { + s *Service +} + +func NewChangesService(s *Service) *ChangesService { + rs := &ChangesService{s: s} + return rs +} + +type ChangesService struct { + s *Service +} + +func NewChannelsService(s *Service) *ChannelsService { + rs := &ChannelsService{s: s} + return rs +} + +type ChannelsService struct { + s *Service +} + +func NewChildrenService(s *Service) *ChildrenService { + rs := &ChildrenService{s: s} + return rs +} + +type ChildrenService struct { + s *Service +} + +func NewCommentsService(s *Service) *CommentsService { + rs := &CommentsService{s: s} + return rs +} + +type CommentsService struct { + s *Service +} + +func NewFilesService(s *Service) *FilesService { + rs := &FilesService{s: s} + return rs +} + +type FilesService struct { + s *Service +} + +func NewParentsService(s *Service) *ParentsService { + rs := &ParentsService{s: s} + return rs +} + +type ParentsService struct { + s *Service +} + +func NewPermissionsService(s *Service) *PermissionsService { + rs := &PermissionsService{s: s} + return rs +} + +type PermissionsService struct { + s *Service +} + +func NewPropertiesService(s *Service) *PropertiesService { + rs := &PropertiesService{s: s} + return rs +} + +type PropertiesService struct { + s *Service +} + +func NewRealtimeService(s *Service) *RealtimeService { + rs := &RealtimeService{s: s} + return rs +} + +type RealtimeService struct { + s *Service +} + +func NewRepliesService(s *Service) *RepliesService { + rs := &RepliesService{s: s} + return rs +} + +type RepliesService struct { + s *Service +} + +func NewRevisionsService(s *Service) *RevisionsService { + rs := &RevisionsService{s: s} + return rs +} + +type RevisionsService struct { + s *Service +} + +type About struct { + // AdditionalRoleInfo: Information about supported additional roles per + // file type. The most specific type takes precedence. + AdditionalRoleInfo []*AboutAdditionalRoleInfo `json:"additionalRoleInfo,omitempty"` + + // DomainSharingPolicy: The domain sharing policy for the current user. + DomainSharingPolicy string `json:"domainSharingPolicy,omitempty"` + + // Etag: The ETag of the item. + Etag string `json:"etag,omitempty"` + + // ExportFormats: The allowable export formats. + ExportFormats []*AboutExportFormats `json:"exportFormats,omitempty"` + + // Features: List of additional features enabled on this account. + Features []*AboutFeatures `json:"features,omitempty"` + + // ImportFormats: The allowable import formats. + ImportFormats []*AboutImportFormats `json:"importFormats,omitempty"` + + // IsCurrentAppInstalled: A boolean indicating whether the authenticated + // app is installed by the authenticated user. + IsCurrentAppInstalled bool `json:"isCurrentAppInstalled,omitempty"` + + // Kind: This is always drive#about. + Kind string `json:"kind,omitempty"` + + // LargestChangeId: The largest change id. + LargestChangeId int64 `json:"largestChangeId,omitempty,string"` + + // MaxUploadSizes: List of max upload sizes for each file type. The most + // specific type takes precedence. + MaxUploadSizes []*AboutMaxUploadSizes `json:"maxUploadSizes,omitempty"` + + // Name: The name of the current user. + Name string `json:"name,omitempty"` + + // PermissionId: The current user's ID as visible in the permissions + // collection. + PermissionId string `json:"permissionId,omitempty"` + + // QuotaBytesTotal: The total number of quota bytes. + QuotaBytesTotal int64 `json:"quotaBytesTotal,omitempty,string"` + + // QuotaBytesUsed: The number of quota bytes used by Google Drive. + QuotaBytesUsed int64 `json:"quotaBytesUsed,omitempty,string"` + + // QuotaBytesUsedAggregate: The number of quota bytes used by all Google + // apps (Drive, Picasa, etc.). + QuotaBytesUsedAggregate int64 `json:"quotaBytesUsedAggregate,omitempty,string"` + + // QuotaBytesUsedInTrash: The number of quota bytes used by trashed + // items. + QuotaBytesUsedInTrash int64 `json:"quotaBytesUsedInTrash,omitempty,string"` + + // RemainingChangeIds: The number of remaining change ids. + RemainingChangeIds int64 `json:"remainingChangeIds,omitempty,string"` + + // RootFolderId: The id of the root folder. + RootFolderId string `json:"rootFolderId,omitempty"` + + // SelfLink: A link back to this item. + SelfLink string `json:"selfLink,omitempty"` + + // User: The authenticated user. + User *User `json:"user,omitempty"` +} + +type AboutAdditionalRoleInfo struct { + // RoleSets: The supported additional roles per primary role. + RoleSets []*AboutAdditionalRoleInfoRoleSets `json:"roleSets,omitempty"` + + // Type: The content type that this additional role info applies to. + Type string `json:"type,omitempty"` +} + +type AboutAdditionalRoleInfoRoleSets struct { + // AdditionalRoles: The supported additional roles with the primary + // role. + AdditionalRoles []string `json:"additionalRoles,omitempty"` + + // PrimaryRole: A primary permission role. + PrimaryRole string `json:"primaryRole,omitempty"` +} + +type AboutExportFormats struct { + // Source: The content type to convert from. + Source string `json:"source,omitempty"` + + // Targets: The possible content types to convert to. + Targets []string `json:"targets,omitempty"` +} + +type AboutFeatures struct { + // FeatureName: The name of the feature. + FeatureName string `json:"featureName,omitempty"` + + // FeatureRate: The request limit rate for this feature, in queries per + // second. + FeatureRate float64 `json:"featureRate,omitempty"` +} + +type AboutImportFormats struct { + // Source: The imported file's content type to convert from. + Source string `json:"source,omitempty"` + + // Targets: The possible content types to convert to. + Targets []string `json:"targets,omitempty"` +} + +type AboutMaxUploadSizes struct { + // Size: The max upload size for this type. + Size int64 `json:"size,omitempty,string"` + + // Type: The file type. + Type string `json:"type,omitempty"` +} + +type App struct { + // Authorized: Whether the app is authorized to access data on the + // user's Drive. + Authorized bool `json:"authorized,omitempty"` + + // CreateInFolderTemplate: The template url to create a new file with + // this app in a given folder. The template will contain {folderId} to + // be replaced by the folder to create the new file in. + CreateInFolderTemplate string `json:"createInFolderTemplate,omitempty"` + + // CreateUrl: The url to create a new file with this app. + CreateUrl string `json:"createUrl,omitempty"` + + // Icons: The various icons for the app. + Icons []*AppIcons `json:"icons,omitempty"` + + // Id: The ID of the app. + Id string `json:"id,omitempty"` + + // Installed: Whether the app is installed. + Installed bool `json:"installed,omitempty"` + + // Kind: This is always drive#app. + Kind string `json:"kind,omitempty"` + + // LongDescription: A long description of the app. + LongDescription string `json:"longDescription,omitempty"` + + // Name: The name of the app. + Name string `json:"name,omitempty"` + + // ObjectType: The type of object this app creates (e.g. Chart). If + // empty, the app name should be used instead. + ObjectType string `json:"objectType,omitempty"` + + // OpenUrlTemplate: The template url for opening files with this app. + // The template will contain {ids} and/or {exportIds} to be replaced by + // the actual file ids. + OpenUrlTemplate string `json:"openUrlTemplate,omitempty"` + + // PrimaryFileExtensions: The list of primary file extensions. + PrimaryFileExtensions []string `json:"primaryFileExtensions,omitempty"` + + // PrimaryMimeTypes: The list of primary mime types. + PrimaryMimeTypes []string `json:"primaryMimeTypes,omitempty"` + + // ProductId: The ID of the product listing for this app. + ProductId string `json:"productId,omitempty"` + + // ProductUrl: A link to the product listing for this app. + ProductUrl string `json:"productUrl,omitempty"` + + // SecondaryFileExtensions: The list of secondary file extensions. + SecondaryFileExtensions []string `json:"secondaryFileExtensions,omitempty"` + + // SecondaryMimeTypes: The list of secondary mime types. + SecondaryMimeTypes []string `json:"secondaryMimeTypes,omitempty"` + + // ShortDescription: A short description of the app. + ShortDescription string `json:"shortDescription,omitempty"` + + // SupportsCreate: Whether this app supports creating new objects. + SupportsCreate bool `json:"supportsCreate,omitempty"` + + // SupportsImport: Whether this app supports importing Google Docs. + SupportsImport bool `json:"supportsImport,omitempty"` + + // SupportsMultiOpen: Whether this app supports opening more than one + // file. + SupportsMultiOpen bool `json:"supportsMultiOpen,omitempty"` + + // UseByDefault: Whether the app is selected as the default handler for + // the types it supports. + UseByDefault bool `json:"useByDefault,omitempty"` +} + +type AppIcons struct { + // Category: Category of the icon. Allowed values are: + // - application - + // icon for the application + // - document - icon for a file associated + // with the app + // - documentShared - icon for a shared file associated + // with the app + Category string `json:"category,omitempty"` + + // IconUrl: URL for the icon. + IconUrl string `json:"iconUrl,omitempty"` + + // Size: Size of the icon. Represented as the maximum of the width and + // height. + Size int64 `json:"size,omitempty"` +} + +type AppList struct { + // Etag: The ETag of the list. + Etag string `json:"etag,omitempty"` + + // Items: The actual list of apps. + Items []*App `json:"items,omitempty"` + + // Kind: This is always drive#appList. + Kind string `json:"kind,omitempty"` + + // SelfLink: A link back to this list. + SelfLink string `json:"selfLink,omitempty"` +} + +type Change struct { + // Deleted: Whether the file has been deleted. + Deleted bool `json:"deleted,omitempty"` + + // File: The updated state of the file. Present if the file has not been + // deleted. + File *File `json:"file,omitempty"` + + // FileId: The ID of the file associated with this change. + FileId string `json:"fileId,omitempty"` + + // Id: The ID of the change. + Id int64 `json:"id,omitempty,string"` + + // Kind: This is always drive#change. + Kind string `json:"kind,omitempty"` + + // ModificationDate: The time of this modification. + ModificationDate string `json:"modificationDate,omitempty"` + + // SelfLink: A link back to this change. + SelfLink string `json:"selfLink,omitempty"` +} + +type ChangeList struct { + // Etag: The ETag of the list. + Etag string `json:"etag,omitempty"` + + // Items: The actual list of changes. + Items []*Change `json:"items,omitempty"` + + // Kind: This is always drive#changeList. + Kind string `json:"kind,omitempty"` + + // LargestChangeId: The current largest change ID. + LargestChangeId int64 `json:"largestChangeId,omitempty,string"` + + // NextLink: A link to the next page of changes. + NextLink string `json:"nextLink,omitempty"` + + // NextPageToken: The page token for the next page of changes. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: A link back to this list. + SelfLink string `json:"selfLink,omitempty"` +} + +type Channel struct { + // Address: The address where notifications are delivered for this + // channel. + Address string `json:"address,omitempty"` + + // Expiration: Date and time of notification channel expiration, + // expressed as a Unix timestamp, in milliseconds. Optional. + Expiration int64 `json:"expiration,omitempty,string"` + + // Id: A UUID or similar unique string that identifies this channel. + Id string `json:"id,omitempty"` + + // Kind: Identifies this as a notification channel used to watch for + // changes to a resource. Value: the fixed string "api#channel". + Kind string `json:"kind,omitempty"` + + // Params: Additional parameters controlling delivery channel behavior. + // Optional. + Params map[string]string `json:"params,omitempty"` + + // Payload: A Boolean value to indicate whether payload is wanted. + // Optional. + Payload bool `json:"payload,omitempty"` + + // ResourceId: An opaque ID that identifies the resource being watched + // on this channel. Stable across different API versions. + ResourceId string `json:"resourceId,omitempty"` + + // ResourceUri: A version-specific identifier for the watched resource. + ResourceUri string `json:"resourceUri,omitempty"` + + // Token: An arbitrary string delivered to the target address with each + // notification delivered over this channel. Optional. + Token string `json:"token,omitempty"` + + // Type: The type of delivery mechanism used for this channel. + Type string `json:"type,omitempty"` +} + +type ChildList struct { + // Etag: The ETag of the list. + Etag string `json:"etag,omitempty"` + + // Items: The actual list of children. + Items []*ChildReference `json:"items,omitempty"` + + // Kind: This is always drive#childList. + Kind string `json:"kind,omitempty"` + + // NextLink: A link to the next page of children. + NextLink string `json:"nextLink,omitempty"` + + // NextPageToken: The page token for the next page of children. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: A link back to this list. + SelfLink string `json:"selfLink,omitempty"` +} + +type ChildReference struct { + // ChildLink: A link to the child. + ChildLink string `json:"childLink,omitempty"` + + // Id: The ID of the child. + Id string `json:"id,omitempty"` + + // Kind: This is always drive#childReference. + Kind string `json:"kind,omitempty"` + + // SelfLink: A link back to this reference. + SelfLink string `json:"selfLink,omitempty"` +} + +type Comment struct { + // Anchor: A region of the document represented as a JSON string. See + // anchor documentation for details on how to define and interpret + // anchor properties. + Anchor string `json:"anchor,omitempty"` + + // Author: The user who wrote this comment. + Author *User `json:"author,omitempty"` + + // CommentId: The ID of the comment. + CommentId string `json:"commentId,omitempty"` + + // Content: The plain text content used to create this comment. This is + // not HTML safe and should only be used as a starting point to make + // edits to a comment's content. + Content string `json:"content,omitempty"` + + // Context: The context of the file which is being commented on. + Context *CommentContext `json:"context,omitempty"` + + // CreatedDate: The date when this comment was first created. + CreatedDate string `json:"createdDate,omitempty"` + + // Deleted: Whether this comment has been deleted. If a comment has been + // deleted the content will be cleared and this will only represent a + // comment that once existed. + Deleted bool `json:"deleted,omitempty"` + + // FileId: The file which this comment is addressing. + FileId string `json:"fileId,omitempty"` + + // FileTitle: The title of the file which this comment is addressing. + FileTitle string `json:"fileTitle,omitempty"` + + // HtmlContent: HTML formatted content for this comment. + HtmlContent string `json:"htmlContent,omitempty"` + + // Kind: This is always drive#comment. + Kind string `json:"kind,omitempty"` + + // ModifiedDate: The date when this comment or any of its replies were + // last modified. + ModifiedDate string `json:"modifiedDate,omitempty"` + + // Replies: Replies to this post. + Replies []*CommentReply `json:"replies,omitempty"` + + // SelfLink: A link back to this comment. + SelfLink string `json:"selfLink,omitempty"` + + // Status: The status of this comment. Status can be changed by posting + // a reply to a comment with the desired status. + // - "open" - The + // comment is still open. + // - "resolved" - The comment has been resolved + // by one of its replies. + Status string `json:"status,omitempty"` +} + +type CommentContext struct { + // Type: The MIME type of the context snippet. + Type string `json:"type,omitempty"` + + // Value: Data representation of the segment of the file being commented + // on. In the case of a text file for example, this would be the actual + // text that the comment is about. + Value string `json:"value,omitempty"` +} + +type CommentList struct { + // Items: List of comments. + Items []*Comment `json:"items,omitempty"` + + // Kind: This is always drive#commentList. + Kind string `json:"kind,omitempty"` + + // NextLink: A link to the next page of comments. + NextLink string `json:"nextLink,omitempty"` + + // NextPageToken: The token to use to request the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: A link back to this list. + SelfLink string `json:"selfLink,omitempty"` +} + +type CommentReply struct { + // Author: The user who wrote this reply. + Author *User `json:"author,omitempty"` + + // Content: The plain text content used to create this reply. This is + // not HTML safe and should only be used as a starting point to make + // edits to a reply's content. This field is required on inserts if no + // verb is specified (resolve/reopen). + Content string `json:"content,omitempty"` + + // CreatedDate: The date when this reply was first created. + CreatedDate string `json:"createdDate,omitempty"` + + // Deleted: Whether this reply has been deleted. If a reply has been + // deleted the content will be cleared and this will only represent a + // reply that once existed. + Deleted bool `json:"deleted,omitempty"` + + // HtmlContent: HTML formatted content for this reply. + HtmlContent string `json:"htmlContent,omitempty"` + + // Kind: This is always drive#commentReply. + Kind string `json:"kind,omitempty"` + + // ModifiedDate: The date when this reply was last modified. + ModifiedDate string `json:"modifiedDate,omitempty"` + + // ReplyId: The ID of the reply. + ReplyId string `json:"replyId,omitempty"` + + // Verb: The action this reply performed to the parent comment. When + // creating a new reply this is the action to be perform to the parent + // comment. Possible values are: + // - "resolve" - To resolve a comment. + // + // - "reopen" - To reopen (un-resolve) a comment. + Verb string `json:"verb,omitempty"` +} + +type CommentReplyList struct { + // Items: List of reply. + Items []*CommentReply `json:"items,omitempty"` + + // Kind: This is always drive#commentReplyList. + Kind string `json:"kind,omitempty"` + + // NextLink: A link to the next page of replies. + NextLink string `json:"nextLink,omitempty"` + + // NextPageToken: The token to use to request the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: A link back to this list. + SelfLink string `json:"selfLink,omitempty"` +} + +type File struct { + // AlternateLink: A link for opening the file in using a relevant Google + // editor or viewer. + AlternateLink string `json:"alternateLink,omitempty"` + + // AppDataContents: Whether this file is in the appdata folder. + AppDataContents bool `json:"appDataContents,omitempty"` + + // Copyable: Whether the file can be copied by the current user. + Copyable bool `json:"copyable,omitempty"` + + // CreatedDate: Create time for this file (formatted ISO8601 timestamp). + CreatedDate string `json:"createdDate,omitempty"` + + // DefaultOpenWithLink: A link to open this file with the user's default + // app for this file. Only populated when the drive.apps.readonly scope + // is used. + DefaultOpenWithLink string `json:"defaultOpenWithLink,omitempty"` + + // Description: A short description of the file. + Description string `json:"description,omitempty"` + + // DownloadUrl: Short lived download URL for the file. This is only + // populated for files with content stored in Drive. + DownloadUrl string `json:"downloadUrl,omitempty"` + + // Editable: Whether the file can be edited by the current user. + Editable bool `json:"editable,omitempty"` + + // EmbedLink: A link for embedding the file. + EmbedLink string `json:"embedLink,omitempty"` + + // Etag: ETag of the file. + Etag string `json:"etag,omitempty"` + + // ExplicitlyTrashed: Whether this file has been explicitly trashed, as + // opposed to recursively trashed. This will only be populated if the + // file is trashed. + ExplicitlyTrashed bool `json:"explicitlyTrashed,omitempty"` + + // ExportLinks: Links for exporting Google Docs to specific formats. + ExportLinks map[string]string `json:"exportLinks,omitempty"` + + // FileExtension: The file extension used when downloading this file. + // This field is read only. To set the extension, include it in the + // title when creating the file. This is only populated for files with + // content stored in Drive. + FileExtension string `json:"fileExtension,omitempty"` + + // FileSize: The size of the file in bytes. This is only populated for + // files with content stored in Drive. + FileSize int64 `json:"fileSize,omitempty,string"` + + // HeadRevisionId: The ID of the file's head revision. This will only be + // populated for files with content stored in Drive. + HeadRevisionId string `json:"headRevisionId,omitempty"` + + // IconLink: A link to the file's icon. + IconLink string `json:"iconLink,omitempty"` + + // Id: The ID of the file. + Id string `json:"id,omitempty"` + + // ImageMediaMetadata: Metadata about image media. This will only be + // present for image types, and its contents will depend on what can be + // parsed from the image content. + ImageMediaMetadata *FileImageMediaMetadata `json:"imageMediaMetadata,omitempty"` + + // IndexableText: Indexable text attributes for the file (can only be + // written) + IndexableText *FileIndexableText `json:"indexableText,omitempty"` + + // Kind: The type of file. This is always drive#file. + Kind string `json:"kind,omitempty"` + + // Labels: A group of labels for the file. + Labels *FileLabels `json:"labels,omitempty"` + + // LastModifyingUser: The last user to modify this file. + LastModifyingUser *User `json:"lastModifyingUser,omitempty"` + + // LastModifyingUserName: Name of the last user to modify this file. + LastModifyingUserName string `json:"lastModifyingUserName,omitempty"` + + // LastViewedByMeDate: Last time this file was viewed by the user + // (formatted RFC 3339 timestamp). + LastViewedByMeDate string `json:"lastViewedByMeDate,omitempty"` + + // Md5Checksum: An MD5 checksum for the content of this file. This is + // populated only for files with content stored in Drive. + Md5Checksum string `json:"md5Checksum,omitempty"` + + // MimeType: The MIME type of the file. This is only mutable on update + // when uploading new content. This field can be left blank, and the + // mimetype will be determined from the uploaded content's MIME type. + MimeType string `json:"mimeType,omitempty"` + + // ModifiedByMeDate: Last time this file was modified by the user + // (formatted RFC 3339 timestamp). Note that setting modifiedDate will + // also update the modifiedByMe date for the user which set the date. + ModifiedByMeDate string `json:"modifiedByMeDate,omitempty"` + + // ModifiedDate: Last time this file was modified by anyone (formatted + // RFC 3339 timestamp). This is only mutable on update when the + // setModifiedDate parameter is set. + ModifiedDate string `json:"modifiedDate,omitempty"` + + // OpenWithLinks: A map of the id of each of the user's apps to a link + // to open this file with that app. Only populated when the + // drive.apps.readonly scope is used. + OpenWithLinks map[string]string `json:"openWithLinks,omitempty"` + + // OriginalFilename: The original filename if the file was uploaded + // manually, or the original title if the file was inserted through the + // API. Note that renames of the title will not change the original + // filename. This will only be populated on files with content stored in + // Drive. + OriginalFilename string `json:"originalFilename,omitempty"` + + // OwnerNames: Name(s) of the owner(s) of this file. + OwnerNames []string `json:"ownerNames,omitempty"` + + // Owners: The owner(s) of this file. + Owners []*User `json:"owners,omitempty"` + + // Parents: Collection of parent folders which contain this + // file. + // Setting this field will put the file in all of the provided + // folders. On insert, if no folders are provided, the file will be + // placed in the default root folder. + Parents []*ParentReference `json:"parents,omitempty"` + + // Properties: The list of properties. + Properties []*Property `json:"properties,omitempty"` + + // QuotaBytesUsed: The number of quota bytes used by this file. + QuotaBytesUsed int64 `json:"quotaBytesUsed,omitempty,string"` + + // SelfLink: A link back to this file. + SelfLink string `json:"selfLink,omitempty"` + + // Shared: Whether the file has been shared. + Shared bool `json:"shared,omitempty"` + + // SharedWithMeDate: Time at which this file was shared with the user + // (formatted RFC 3339 timestamp). + SharedWithMeDate string `json:"sharedWithMeDate,omitempty"` + + // Thumbnail: Thumbnail for the file. Only accepted on upload and for + // files that are not already thumbnailed by Google. + Thumbnail *FileThumbnail `json:"thumbnail,omitempty"` + + // ThumbnailLink: A link to the file's thumbnail. + ThumbnailLink string `json:"thumbnailLink,omitempty"` + + // Title: The title of this file. + Title string `json:"title,omitempty"` + + // UserPermission: The permissions for the authenticated user on this + // file. + UserPermission *Permission `json:"userPermission,omitempty"` + + // WebContentLink: A link for downloading the content of the file in a + // browser using cookie based authentication. In cases where the content + // is shared publicly, the content can be downloaded without any + // credentials. + WebContentLink string `json:"webContentLink,omitempty"` + + // WebViewLink: A link only available on public folders for viewing + // their static web assets (HTML, CSS, JS, etc) via Google Drive's + // Website Hosting. + WebViewLink string `json:"webViewLink,omitempty"` + + // WritersCanShare: Whether writers can share the document with other + // users. + WritersCanShare bool `json:"writersCanShare,omitempty"` +} + +type FileImageMediaMetadata struct { + // Aperture: The aperture used to create the photo (f-number). + Aperture float64 `json:"aperture,omitempty"` + + // CameraMake: The make of the camera used to create the photo. + CameraMake string `json:"cameraMake,omitempty"` + + // CameraModel: The model of the camera used to create the photo. + CameraModel string `json:"cameraModel,omitempty"` + + // ColorSpace: The color space of the photo. + ColorSpace string `json:"colorSpace,omitempty"` + + // Date: The date and time the photo was taken (EXIF format timestamp). + Date string `json:"date,omitempty"` + + // ExposureBias: The exposure bias of the photo (APEX value). + ExposureBias float64 `json:"exposureBias,omitempty"` + + // ExposureMode: The exposure mode used to create the photo. + ExposureMode string `json:"exposureMode,omitempty"` + + // ExposureTime: The length of the exposure, in seconds. + ExposureTime float64 `json:"exposureTime,omitempty"` + + // FlashUsed: Whether a flash was used to create the photo. + FlashUsed bool `json:"flashUsed,omitempty"` + + // FocalLength: The focal length used to create the photo, in + // millimeters. + FocalLength float64 `json:"focalLength,omitempty"` + + // Height: The height of the image in pixels. + Height int64 `json:"height,omitempty"` + + // IsoSpeed: The ISO speed used to create the photo. + IsoSpeed int64 `json:"isoSpeed,omitempty"` + + // Lens: The lens used to create the photo. + Lens string `json:"lens,omitempty"` + + // Location: Geographic location information stored in the image. + Location *FileImageMediaMetadataLocation `json:"location,omitempty"` + + // MaxApertureValue: The smallest f-number of the lens at the focal + // length used to create the photo (APEX value). + MaxApertureValue float64 `json:"maxApertureValue,omitempty"` + + // MeteringMode: The metering mode used to create the photo. + MeteringMode string `json:"meteringMode,omitempty"` + + // Rotation: The rotation in clockwise degrees from the image's original + // orientation. + Rotation int64 `json:"rotation,omitempty"` + + // Sensor: The type of sensor used to create the photo. + Sensor string `json:"sensor,omitempty"` + + // SubjectDistance: The distance to the subject of the photo, in meters. + SubjectDistance int64 `json:"subjectDistance,omitempty"` + + // WhiteBalance: The white balance mode used to create the photo. + WhiteBalance string `json:"whiteBalance,omitempty"` + + // Width: The width of the image in pixels. + Width int64 `json:"width,omitempty"` +} + +type FileImageMediaMetadataLocation struct { + // Altitude: The altitude stored in the image. + Altitude float64 `json:"altitude,omitempty"` + + // Latitude: The latitude stored in the image. + Latitude float64 `json:"latitude,omitempty"` + + // Longitude: The longitude stored in the image. + Longitude float64 `json:"longitude,omitempty"` +} + +type FileIndexableText struct { + // Text: The text to be indexed for this file. + Text string `json:"text,omitempty"` +} + +type FileLabels struct { + // Hidden: Deprecated. + Hidden bool `json:"hidden,omitempty"` + + // Restricted: Whether viewers are prevented from downloading this file. + Restricted bool `json:"restricted,omitempty"` + + // Starred: Whether this file is starred by the user. + Starred bool `json:"starred,omitempty"` + + // Trashed: Whether this file has been trashed. + Trashed bool `json:"trashed,omitempty"` + + // Viewed: Whether this file has been viewed by this user. + Viewed bool `json:"viewed,omitempty"` +} + +type FileThumbnail struct { + // Image: The URL-safe Base64 encoded bytes of the thumbnail image. + Image string `json:"image,omitempty"` + + // MimeType: The MIME type of the thumbnail. + MimeType string `json:"mimeType,omitempty"` +} + +type FileList struct { + // Etag: The ETag of the list. + Etag string `json:"etag,omitempty"` + + // Items: The actual list of files. + Items []*File `json:"items,omitempty"` + + // Kind: This is always drive#fileList. + Kind string `json:"kind,omitempty"` + + // NextLink: A link to the next page of files. + NextLink string `json:"nextLink,omitempty"` + + // NextPageToken: The page token for the next page of files. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: A link back to this list. + SelfLink string `json:"selfLink,omitempty"` +} + +type ParentList struct { + // Etag: The ETag of the list. + Etag string `json:"etag,omitempty"` + + // Items: The actual list of parents. + Items []*ParentReference `json:"items,omitempty"` + + // Kind: This is always drive#parentList. + Kind string `json:"kind,omitempty"` + + // SelfLink: A link back to this list. + SelfLink string `json:"selfLink,omitempty"` +} + +type ParentReference struct { + // Id: The ID of the parent. + Id string `json:"id,omitempty"` + + // IsRoot: Whether or not the parent is the root folder. + IsRoot bool `json:"isRoot,omitempty"` + + // Kind: This is always drive#parentReference. + Kind string `json:"kind,omitempty"` + + // ParentLink: A link to the parent. + ParentLink string `json:"parentLink,omitempty"` + + // SelfLink: A link back to this reference. + SelfLink string `json:"selfLink,omitempty"` +} + +type Permission struct { + // AdditionalRoles: Additional roles for this user. Only commenter is + // currently allowed. + AdditionalRoles []string `json:"additionalRoles,omitempty"` + + // AuthKey: The authkey parameter required for this permission. + AuthKey string `json:"authKey,omitempty"` + + // Domain: The domain name of the entity this permission refers to. This + // is an output-only field which is populated when the permission type + // is "user", "group" or "domain". + Domain string `json:"domain,omitempty"` + + // EmailAddress: The email address of the user this permission refers + // to. This is an output-only field which is populated when the + // permission type is "user" and the given user's Google+ profile + // privacy settings allow exposing their email address. + EmailAddress string `json:"emailAddress,omitempty"` + + // Etag: The ETag of the permission. + Etag string `json:"etag,omitempty"` + + // Id: The ID of the user this permission refers to, and identical to + // the permissionId in the About and Files resources. When making a + // drive.permissions.insert request, exactly one of 'id' or 'value' + // fields must be specified. + Id string `json:"id,omitempty"` + + // Kind: This is always drive#permission. + Kind string `json:"kind,omitempty"` + + // Name: The name for this permission. + Name string `json:"name,omitempty"` + + // PhotoLink: A link to the profile photo, if available. + PhotoLink string `json:"photoLink,omitempty"` + + // Role: The primary role for this user. Allowed values are: + // - owner + // + // - reader + // - writer + Role string `json:"role,omitempty"` + + // SelfLink: A link back to this permission. + SelfLink string `json:"selfLink,omitempty"` + + // Type: The account type. Allowed values are: + // - user + // - group + // - + // domain + // - anyone + Type string `json:"type,omitempty"` + + // Value: The email address or domain name for the entity. This is used + // during inserts and is not populated in responses. When making a + // drive.permissions.insert request, exactly one of 'id' or 'value' + // fields must be specified. + Value string `json:"value,omitempty"` + + // WithLink: Whether the link is required for this permission. + WithLink bool `json:"withLink,omitempty"` +} + +type PermissionId struct { + // Id: The permission ID. + Id string `json:"id,omitempty"` + + // Kind: This is always drive#permissionId. + Kind string `json:"kind,omitempty"` +} + +type PermissionList struct { + // Etag: The ETag of the list. + Etag string `json:"etag,omitempty"` + + // Items: The actual list of permissions. + Items []*Permission `json:"items,omitempty"` + + // Kind: This is always drive#permissionList. + Kind string `json:"kind,omitempty"` + + // SelfLink: A link back to this list. + SelfLink string `json:"selfLink,omitempty"` +} + +type Property struct { + // Etag: ETag of the property. + Etag string `json:"etag,omitempty"` + + // Key: The key of this property. + Key string `json:"key,omitempty"` + + // Kind: This is always drive#property. + Kind string `json:"kind,omitempty"` + + // SelfLink: The link back to this property. + SelfLink string `json:"selfLink,omitempty"` + + // Value: The value of this property. + Value string `json:"value,omitempty"` + + // Visibility: The visibility of this property. + Visibility string `json:"visibility,omitempty"` +} + +type PropertyList struct { + // Etag: The ETag of the list. + Etag string `json:"etag,omitempty"` + + // Items: The list of properties. + Items []*Property `json:"items,omitempty"` + + // Kind: This is always drive#propertyList. + Kind string `json:"kind,omitempty"` + + // SelfLink: The link back to this list. + SelfLink string `json:"selfLink,omitempty"` +} + +type Revision struct { + // DownloadUrl: Short term download URL for the file. This will only be + // populated on files with content stored in Drive. + DownloadUrl string `json:"downloadUrl,omitempty"` + + // Etag: The ETag of the revision. + Etag string `json:"etag,omitempty"` + + // ExportLinks: Links for exporting Google Docs to specific formats. + ExportLinks map[string]string `json:"exportLinks,omitempty"` + + // FileSize: The size of the revision in bytes. This will only be + // populated on files with content stored in Drive. + FileSize int64 `json:"fileSize,omitempty,string"` + + // Id: The ID of the revision. + Id string `json:"id,omitempty"` + + // Kind: This is always drive#revision. + Kind string `json:"kind,omitempty"` + + // LastModifyingUser: The last user to modify this revision. + LastModifyingUser *User `json:"lastModifyingUser,omitempty"` + + // LastModifyingUserName: Name of the last user to modify this revision. + LastModifyingUserName string `json:"lastModifyingUserName,omitempty"` + + // Md5Checksum: An MD5 checksum for the content of this revision. This + // will only be populated on files with content stored in Drive. + Md5Checksum string `json:"md5Checksum,omitempty"` + + // MimeType: The MIME type of the revision. + MimeType string `json:"mimeType,omitempty"` + + // ModifiedDate: Last time this revision was modified (formatted RFC + // 3339 timestamp). + ModifiedDate string `json:"modifiedDate,omitempty"` + + // OriginalFilename: The original filename when this revision was + // created. This will only be populated on files with content stored in + // Drive. + OriginalFilename string `json:"originalFilename,omitempty"` + + // Pinned: Whether this revision is pinned to prevent automatic purging. + // This will only be populated and can only be modified on files with + // content stored in Drive which are not Google Docs. Revisions can also + // be pinned when they are created through the + // drive.files.insert/update/copy by using the pinned query parameter. + Pinned bool `json:"pinned,omitempty"` + + // PublishAuto: Whether subsequent revisions will be automatically + // republished. This is only populated and can only be modified for + // Google Docs. + PublishAuto bool `json:"publishAuto,omitempty"` + + // Published: Whether this revision is published. This is only populated + // and can only be modified for Google Docs. + Published bool `json:"published,omitempty"` + + // PublishedLink: A link to the published revision. + PublishedLink string `json:"publishedLink,omitempty"` + + // PublishedOutsideDomain: Whether this revision is published outside + // the domain. This is only populated and can only be modified for + // Google Docs. + PublishedOutsideDomain bool `json:"publishedOutsideDomain,omitempty"` + + // SelfLink: A link back to this revision. + SelfLink string `json:"selfLink,omitempty"` +} + +type RevisionList struct { + // Etag: The ETag of the list. + Etag string `json:"etag,omitempty"` + + // Items: The actual list of revisions. + Items []*Revision `json:"items,omitempty"` + + // Kind: This is always drive#revisionList. + Kind string `json:"kind,omitempty"` + + // SelfLink: A link back to this list. + SelfLink string `json:"selfLink,omitempty"` +} + +type User struct { + // DisplayName: A plain text displayable name for this user. + DisplayName string `json:"displayName,omitempty"` + + // IsAuthenticatedUser: Whether this user is the same as the + // authenticated user for whom the request was made. + IsAuthenticatedUser bool `json:"isAuthenticatedUser,omitempty"` + + // Kind: This is always drive#user. + Kind string `json:"kind,omitempty"` + + // PermissionId: The user's ID as visible in the permissions collection. + PermissionId string `json:"permissionId,omitempty"` + + // Picture: The user's profile picture. + Picture *UserPicture `json:"picture,omitempty"` +} + +type UserPicture struct { + // Url: A URL that points to a profile picture of this user. + Url string `json:"url,omitempty"` +} + +// method id "drive.about.get": + +type AboutGetCall struct { + s *Service + opt_ map[string]interface{} +} + +// Get: Gets the information about the current user along with Drive API +// settings +func (r *AboutService) Get() *AboutGetCall { + c := &AboutGetCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// IncludeSubscribed sets the optional parameter "includeSubscribed": +// When calculating the number of remaining change IDs, whether to +// include shared files and public files the user has opened. When set +// to false, this counts only change IDs for owned files and any shared +// or public files that the user has explictly added to a folder in +// Drive. +func (c *AboutGetCall) IncludeSubscribed(includeSubscribed bool) *AboutGetCall { + c.opt_["includeSubscribed"] = includeSubscribed + return c +} + +// MaxChangeIdCount sets the optional parameter "maxChangeIdCount": +// Maximum number of remaining change IDs to count +func (c *AboutGetCall) MaxChangeIdCount(maxChangeIdCount int64) *AboutGetCall { + c.opt_["maxChangeIdCount"] = maxChangeIdCount + return c +} + +// StartChangeId sets the optional parameter "startChangeId": Change ID +// to start counting from when calculating number of remaining change +// IDs +func (c *AboutGetCall) StartChangeId(startChangeId int64) *AboutGetCall { + c.opt_["startChangeId"] = startChangeId + return c +} + +func (c *AboutGetCall) Do() (*About, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeSubscribed"]; ok { + params.Set("includeSubscribed", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxChangeIdCount"]; ok { + params.Set("maxChangeIdCount", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startChangeId"]; ok { + params.Set("startChangeId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "about") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(About) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the information about the current user along with Drive API settings", + // "httpMethod": "GET", + // "id": "drive.about.get", + // "parameters": { + // "includeSubscribed": { + // "default": "true", + // "description": "When calculating the number of remaining change IDs, whether to include shared files and public files the user has opened. When set to false, this counts only change IDs for owned files and any shared or public files that the user has explictly added to a folder in Drive.", + // "location": "query", + // "type": "boolean" + // }, + // "maxChangeIdCount": { + // "default": "1", + // "description": "Maximum number of remaining change IDs to count", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "startChangeId": { + // "description": "Change ID to start counting from when calculating number of remaining change IDs", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "about", + // "response": { + // "$ref": "About" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.apps.get": + +type AppsGetCall struct { + s *Service + appId string + opt_ map[string]interface{} +} + +// Get: Gets a specific app. +func (r *AppsService) Get(appId string) *AppsGetCall { + c := &AppsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.appId = appId + return c +} + +func (c *AppsGetCall) Do() (*App, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "apps/{appId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{appId}", url.QueryEscape(c.appId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(App) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a specific app.", + // "httpMethod": "GET", + // "id": "drive.apps.get", + // "parameterOrder": [ + // "appId" + // ], + // "parameters": { + // "appId": { + // "description": "The ID of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "apps/{appId}", + // "response": { + // "$ref": "App" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.apps.readonly", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.apps.list": + +type AppsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Lists a user's installed apps. +func (r *AppsService) List() *AppsListCall { + c := &AppsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *AppsListCall) Do() (*AppList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "apps") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AppList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists a user's installed apps.", + // "httpMethod": "GET", + // "id": "drive.apps.list", + // "path": "apps", + // "response": { + // "$ref": "AppList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive.apps.readonly" + // ] + // } + +} + +// method id "drive.changes.get": + +type ChangesGetCall struct { + s *Service + changeId string + opt_ map[string]interface{} +} + +// Get: Gets a specific change. +func (r *ChangesService) Get(changeId string) *ChangesGetCall { + c := &ChangesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.changeId = changeId + return c +} + +func (c *ChangesGetCall) Do() (*Change, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "changes/{changeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{changeId}", url.QueryEscape(c.changeId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Change) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a specific change.", + // "httpMethod": "GET", + // "id": "drive.changes.get", + // "parameterOrder": [ + // "changeId" + // ], + // "parameters": { + // "changeId": { + // "description": "The ID of the change.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "changes/{changeId}", + // "response": { + // "$ref": "Change" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.apps.readonly", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.changes.list": + +type ChangesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Lists the changes for a user. +func (r *ChangesService) List() *ChangesListCall { + c := &ChangesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// IncludeDeleted sets the optional parameter "includeDeleted": Whether +// to include deleted items. +func (c *ChangesListCall) IncludeDeleted(includeDeleted bool) *ChangesListCall { + c.opt_["includeDeleted"] = includeDeleted + return c +} + +// IncludeSubscribed sets the optional parameter "includeSubscribed": +// Whether to include shared files and public files the user has opened. +// When set to false, the list will include owned files plus any shared +// or public files the user has explictly added to a folder in Drive. +func (c *ChangesListCall) IncludeSubscribed(includeSubscribed bool) *ChangesListCall { + c.opt_["includeSubscribed"] = includeSubscribed + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of changes to return. +func (c *ChangesListCall) MaxResults(maxResults int64) *ChangesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Page token for +// changes. +func (c *ChangesListCall) PageToken(pageToken string) *ChangesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartChangeId sets the optional parameter "startChangeId": Change ID +// to start listing changes from. +func (c *ChangesListCall) StartChangeId(startChangeId int64) *ChangesListCall { + c.opt_["startChangeId"] = startChangeId + return c +} + +func (c *ChangesListCall) Do() (*ChangeList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeDeleted"]; ok { + params.Set("includeDeleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["includeSubscribed"]; ok { + params.Set("includeSubscribed", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startChangeId"]; ok { + params.Set("startChangeId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "changes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ChangeList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the changes for a user.", + // "httpMethod": "GET", + // "id": "drive.changes.list", + // "parameters": { + // "includeDeleted": { + // "default": "true", + // "description": "Whether to include deleted items.", + // "location": "query", + // "type": "boolean" + // }, + // "includeSubscribed": { + // "default": "true", + // "description": "Whether to include shared files and public files the user has opened. When set to false, the list will include owned files plus any shared or public files the user has explictly added to a folder in Drive.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "default": "100", + // "description": "Maximum number of changes to return.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Page token for changes.", + // "location": "query", + // "type": "string" + // }, + // "startChangeId": { + // "description": "Change ID to start listing changes from.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "changes", + // "response": { + // "$ref": "ChangeList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.apps.readonly", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ], + // "supportsSubscription": true + // } + +} + +// method id "drive.changes.watch": + +type ChangesWatchCall struct { + s *Service + channel *Channel + opt_ map[string]interface{} +} + +// Watch: Subscribe to changes for a user. +func (r *ChangesService) Watch(channel *Channel) *ChangesWatchCall { + c := &ChangesWatchCall{s: r.s, opt_: make(map[string]interface{})} + c.channel = channel + return c +} + +// IncludeDeleted sets the optional parameter "includeDeleted": Whether +// to include deleted items. +func (c *ChangesWatchCall) IncludeDeleted(includeDeleted bool) *ChangesWatchCall { + c.opt_["includeDeleted"] = includeDeleted + return c +} + +// IncludeSubscribed sets the optional parameter "includeSubscribed": +// Whether to include shared files and public files the user has opened. +// When set to false, the list will include owned files plus any shared +// or public files the user has explictly added to a folder in Drive. +func (c *ChangesWatchCall) IncludeSubscribed(includeSubscribed bool) *ChangesWatchCall { + c.opt_["includeSubscribed"] = includeSubscribed + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of changes to return. +func (c *ChangesWatchCall) MaxResults(maxResults int64) *ChangesWatchCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Page token for +// changes. +func (c *ChangesWatchCall) PageToken(pageToken string) *ChangesWatchCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartChangeId sets the optional parameter "startChangeId": Change ID +// to start listing changes from. +func (c *ChangesWatchCall) StartChangeId(startChangeId int64) *ChangesWatchCall { + c.opt_["startChangeId"] = startChangeId + return c +} + +func (c *ChangesWatchCall) Do() (*Channel, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeDeleted"]; ok { + params.Set("includeDeleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["includeSubscribed"]; ok { + params.Set("includeSubscribed", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startChangeId"]; ok { + params.Set("startChangeId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "changes/watch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Channel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Subscribe to changes for a user.", + // "httpMethod": "POST", + // "id": "drive.changes.watch", + // "parameters": { + // "includeDeleted": { + // "default": "true", + // "description": "Whether to include deleted items.", + // "location": "query", + // "type": "boolean" + // }, + // "includeSubscribed": { + // "default": "true", + // "description": "Whether to include shared files and public files the user has opened. When set to false, the list will include owned files plus any shared or public files the user has explictly added to a folder in Drive.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "default": "100", + // "description": "Maximum number of changes to return.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Page token for changes.", + // "location": "query", + // "type": "string" + // }, + // "startChangeId": { + // "description": "Change ID to start listing changes from.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "changes/watch", + // "request": { + // "$ref": "Channel", + // "parameterName": "resource" + // }, + // "response": { + // "$ref": "Channel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.apps.readonly", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ], + // "supportsSubscription": true + // } + +} + +// method id "drive.channels.stop": + +type ChannelsStopCall struct { + s *Service + channel *Channel + opt_ map[string]interface{} +} + +// Stop: Stop watching resources through this channel +func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall { + c := &ChannelsStopCall{s: r.s, opt_: make(map[string]interface{})} + c.channel = channel + return c +} + +func (c *ChannelsStopCall) Do() error { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + if err != nil { + return err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Stop watching resources through this channel", + // "httpMethod": "POST", + // "id": "drive.channels.stop", + // "path": "channels/stop", + // "request": { + // "$ref": "Channel", + // "parameterName": "resource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.apps.readonly", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.children.delete": + +type ChildrenDeleteCall struct { + s *Service + folderId string + childId string + opt_ map[string]interface{} +} + +// Delete: Removes a child from a folder. +func (r *ChildrenService) Delete(folderId string, childId string) *ChildrenDeleteCall { + c := &ChildrenDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.folderId = folderId + c.childId = childId + return c +} + +func (c *ChildrenDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children/{childId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{folderId}", url.QueryEscape(c.folderId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{childId}", url.QueryEscape(c.childId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Removes a child from a folder.", + // "httpMethod": "DELETE", + // "id": "drive.children.delete", + // "parameterOrder": [ + // "folderId", + // "childId" + // ], + // "parameters": { + // "childId": { + // "description": "The ID of the child.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "folderId": { + // "description": "The ID of the folder.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{folderId}/children/{childId}", + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.children.get": + +type ChildrenGetCall struct { + s *Service + folderId string + childId string + opt_ map[string]interface{} +} + +// Get: Gets a specific child reference. +func (r *ChildrenService) Get(folderId string, childId string) *ChildrenGetCall { + c := &ChildrenGetCall{s: r.s, opt_: make(map[string]interface{})} + c.folderId = folderId + c.childId = childId + return c +} + +func (c *ChildrenGetCall) Do() (*ChildReference, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children/{childId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{folderId}", url.QueryEscape(c.folderId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{childId}", url.QueryEscape(c.childId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ChildReference) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a specific child reference.", + // "httpMethod": "GET", + // "id": "drive.children.get", + // "parameterOrder": [ + // "folderId", + // "childId" + // ], + // "parameters": { + // "childId": { + // "description": "The ID of the child.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "folderId": { + // "description": "The ID of the folder.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{folderId}/children/{childId}", + // "response": { + // "$ref": "ChildReference" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.children.insert": + +type ChildrenInsertCall struct { + s *Service + folderId string + childreference *ChildReference + opt_ map[string]interface{} +} + +// Insert: Inserts a file into a folder. +func (r *ChildrenService) Insert(folderId string, childreference *ChildReference) *ChildrenInsertCall { + c := &ChildrenInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.folderId = folderId + c.childreference = childreference + return c +} + +func (c *ChildrenInsertCall) Do() (*ChildReference, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.childreference) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{folderId}", url.QueryEscape(c.folderId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ChildReference) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a file into a folder.", + // "httpMethod": "POST", + // "id": "drive.children.insert", + // "parameterOrder": [ + // "folderId" + // ], + // "parameters": { + // "folderId": { + // "description": "The ID of the folder.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{folderId}/children", + // "request": { + // "$ref": "ChildReference" + // }, + // "response": { + // "$ref": "ChildReference" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.children.list": + +type ChildrenListCall struct { + s *Service + folderId string + opt_ map[string]interface{} +} + +// List: Lists a folder's children. +func (r *ChildrenService) List(folderId string) *ChildrenListCall { + c := &ChildrenListCall{s: r.s, opt_: make(map[string]interface{})} + c.folderId = folderId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of children to return. +func (c *ChildrenListCall) MaxResults(maxResults int64) *ChildrenListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Page token for +// children. +func (c *ChildrenListCall) PageToken(pageToken string) *ChildrenListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Q sets the optional parameter "q": Query string for searching +// children. +func (c *ChildrenListCall) Q(q string) *ChildrenListCall { + c.opt_["q"] = q + return c +} + +func (c *ChildrenListCall) Do() (*ChildList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["q"]; ok { + params.Set("q", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{folderId}", url.QueryEscape(c.folderId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ChildList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists a folder's children.", + // "httpMethod": "GET", + // "id": "drive.children.list", + // "parameterOrder": [ + // "folderId" + // ], + // "parameters": { + // "folderId": { + // "description": "The ID of the folder.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Maximum number of children to return.", + // "format": "int32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Page token for children.", + // "location": "query", + // "type": "string" + // }, + // "q": { + // "description": "Query string for searching children.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "files/{folderId}/children", + // "response": { + // "$ref": "ChildList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.comments.delete": + +type CommentsDeleteCall struct { + s *Service + fileId string + commentId string + opt_ map[string]interface{} +} + +// Delete: Deletes a comment. +func (r *CommentsService) Delete(fileId string, commentId string) *CommentsDeleteCall { + c := &CommentsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.commentId = commentId + return c +} + +func (c *CommentsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a comment.", + // "httpMethod": "DELETE", + // "id": "drive.comments.delete", + // "parameterOrder": [ + // "fileId", + // "commentId" + // ], + // "parameters": { + // "commentId": { + // "description": "The ID of the comment.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/comments/{commentId}", + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.comments.get": + +type CommentsGetCall struct { + s *Service + fileId string + commentId string + opt_ map[string]interface{} +} + +// Get: Gets a comment by ID. +func (r *CommentsService) Get(fileId string, commentId string) *CommentsGetCall { + c := &CommentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.commentId = commentId + return c +} + +// IncludeDeleted sets the optional parameter "includeDeleted": If set, +// this will succeed when retrieving a deleted comment, and will include +// any deleted replies. +func (c *CommentsGetCall) IncludeDeleted(includeDeleted bool) *CommentsGetCall { + c.opt_["includeDeleted"] = includeDeleted + return c +} + +func (c *CommentsGetCall) Do() (*Comment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeDeleted"]; ok { + params.Set("includeDeleted", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a comment by ID.", + // "httpMethod": "GET", + // "id": "drive.comments.get", + // "parameterOrder": [ + // "fileId", + // "commentId" + // ], + // "parameters": { + // "commentId": { + // "description": "The ID of the comment.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeDeleted": { + // "default": "false", + // "description": "If set, this will succeed when retrieving a deleted comment, and will include any deleted replies.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "files/{fileId}/comments/{commentId}", + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.comments.insert": + +type CommentsInsertCall struct { + s *Service + fileId string + comment *Comment + opt_ map[string]interface{} +} + +// Insert: Creates a new comment on the given file. +func (r *CommentsService) Insert(fileId string, comment *Comment) *CommentsInsertCall { + c := &CommentsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.comment = comment + return c +} + +func (c *CommentsInsertCall) Do() (*Comment, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new comment on the given file.", + // "httpMethod": "POST", + // "id": "drive.comments.insert", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/comments", + // "request": { + // "$ref": "Comment" + // }, + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.comments.list": + +type CommentsListCall struct { + s *Service + fileId string + opt_ map[string]interface{} +} + +// List: Lists a file's comments. +func (r *CommentsService) List(fileId string) *CommentsListCall { + c := &CommentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + return c +} + +// IncludeDeleted sets the optional parameter "includeDeleted": If set, +// all comments and replies, including deleted comments and replies +// (with content stripped) will be returned. +func (c *CommentsListCall) IncludeDeleted(includeDeleted bool) *CommentsListCall { + c.opt_["includeDeleted"] = includeDeleted + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of discussions to include in the response, used for paging. +func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, used to page through large result sets. To get the next page +// of results, set this parameter to the value of "nextPageToken" from +// the previous response. +func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// UpdatedMin sets the optional parameter "updatedMin": Only discussions +// that were updated after this timestamp will be returned. Formatted as +// an RFC 3339 timestamp. +func (c *CommentsListCall) UpdatedMin(updatedMin string) *CommentsListCall { + c.opt_["updatedMin"] = updatedMin + return c +} + +func (c *CommentsListCall) Do() (*CommentList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeDeleted"]; ok { + params.Set("includeDeleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updatedMin"]; ok { + params.Set("updatedMin", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommentList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists a file's comments.", + // "httpMethod": "GET", + // "id": "drive.comments.list", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeDeleted": { + // "default": "false", + // "description": "If set, all comments and replies, including deleted comments and replies (with content stripped) will be returned.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "default": "20", + // "description": "The maximum number of discussions to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "updatedMin": { + // "description": "Only discussions that were updated after this timestamp will be returned. Formatted as an RFC 3339 timestamp.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "files/{fileId}/comments", + // "response": { + // "$ref": "CommentList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.comments.patch": + +type CommentsPatchCall struct { + s *Service + fileId string + commentId string + comment *Comment + opt_ map[string]interface{} +} + +// Patch: Updates an existing comment. This method supports patch +// semantics. +func (r *CommentsService) Patch(fileId string, commentId string, comment *Comment) *CommentsPatchCall { + c := &CommentsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.commentId = commentId + c.comment = comment + return c +} + +func (c *CommentsPatchCall) Do() (*Comment, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing comment. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "drive.comments.patch", + // "parameterOrder": [ + // "fileId", + // "commentId" + // ], + // "parameters": { + // "commentId": { + // "description": "The ID of the comment.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/comments/{commentId}", + // "request": { + // "$ref": "Comment" + // }, + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.comments.update": + +type CommentsUpdateCall struct { + s *Service + fileId string + commentId string + comment *Comment + opt_ map[string]interface{} +} + +// Update: Updates an existing comment. +func (r *CommentsService) Update(fileId string, commentId string, comment *Comment) *CommentsUpdateCall { + c := &CommentsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.commentId = commentId + c.comment = comment + return c +} + +func (c *CommentsUpdateCall) Do() (*Comment, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing comment.", + // "httpMethod": "PUT", + // "id": "drive.comments.update", + // "parameterOrder": [ + // "fileId", + // "commentId" + // ], + // "parameters": { + // "commentId": { + // "description": "The ID of the comment.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/comments/{commentId}", + // "request": { + // "$ref": "Comment" + // }, + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.files.copy": + +type FilesCopyCall struct { + s *Service + fileId string + file *File + opt_ map[string]interface{} +} + +// Copy: Creates a copy of the specified file. +func (r *FilesService) Copy(fileId string, file *File) *FilesCopyCall { + c := &FilesCopyCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.file = file + return c +} + +// Convert sets the optional parameter "convert": Whether to convert +// this file to the corresponding Google Docs format. +func (c *FilesCopyCall) Convert(convert bool) *FilesCopyCall { + c.opt_["convert"] = convert + return c +} + +// Ocr sets the optional parameter "ocr": Whether to attempt OCR on +// .jpg, .png, .gif, or .pdf uploads. +func (c *FilesCopyCall) Ocr(ocr bool) *FilesCopyCall { + c.opt_["ocr"] = ocr + return c +} + +// OcrLanguage sets the optional parameter "ocrLanguage": If ocr is +// true, hints at the language to use. Valid values are ISO 639-1 codes. +func (c *FilesCopyCall) OcrLanguage(ocrLanguage string) *FilesCopyCall { + c.opt_["ocrLanguage"] = ocrLanguage + return c +} + +// Pinned sets the optional parameter "pinned": Whether to pin the head +// revision of the new copy. +func (c *FilesCopyCall) Pinned(pinned bool) *FilesCopyCall { + c.opt_["pinned"] = pinned + return c +} + +// TimedTextLanguage sets the optional parameter "timedTextLanguage": +// The language of the timed text. +func (c *FilesCopyCall) TimedTextLanguage(timedTextLanguage string) *FilesCopyCall { + c.opt_["timedTextLanguage"] = timedTextLanguage + return c +} + +// TimedTextTrackName sets the optional parameter "timedTextTrackName": +// The timed text track name. +func (c *FilesCopyCall) TimedTextTrackName(timedTextTrackName string) *FilesCopyCall { + c.opt_["timedTextTrackName"] = timedTextTrackName + return c +} + +// Visibility sets the optional parameter "visibility": The visibility +// of the new file. This parameter is only relevant when the source is +// not a native Google Doc and convert=false. +func (c *FilesCopyCall) Visibility(visibility string) *FilesCopyCall { + c.opt_["visibility"] = visibility + return c +} + +func (c *FilesCopyCall) Do() (*File, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["convert"]; ok { + params.Set("convert", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ocr"]; ok { + params.Set("ocr", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ocrLanguage"]; ok { + params.Set("ocrLanguage", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pinned"]; ok { + params.Set("pinned", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timedTextLanguage"]; ok { + params.Set("timedTextLanguage", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timedTextTrackName"]; ok { + params.Set("timedTextTrackName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["visibility"]; ok { + params.Set("visibility", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/copy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a copy of the specified file.", + // "httpMethod": "POST", + // "id": "drive.files.copy", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "convert": { + // "default": "false", + // "description": "Whether to convert this file to the corresponding Google Docs format.", + // "location": "query", + // "type": "boolean" + // }, + // "fileId": { + // "description": "The ID of the file to copy.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ocr": { + // "default": "false", + // "description": "Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.", + // "location": "query", + // "type": "boolean" + // }, + // "ocrLanguage": { + // "description": "If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.", + // "location": "query", + // "type": "string" + // }, + // "pinned": { + // "default": "false", + // "description": "Whether to pin the head revision of the new copy.", + // "location": "query", + // "type": "boolean" + // }, + // "timedTextLanguage": { + // "description": "The language of the timed text.", + // "location": "query", + // "type": "string" + // }, + // "timedTextTrackName": { + // "description": "The timed text track name.", + // "location": "query", + // "type": "string" + // }, + // "visibility": { + // "default": "DEFAULT", + // "description": "The visibility of the new file. This parameter is only relevant when the source is not a native Google Doc and convert=false.", + // "enum": [ + // "DEFAULT", + // "PRIVATE" + // ], + // "enumDescriptions": [ + // "The visibility of the new file is determined by the user's default visibility/sharing policies.", + // "The new file will be visible to only the owner." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "files/{fileId}/copy", + // "request": { + // "$ref": "File" + // }, + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.apps.readonly", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.files.delete": + +type FilesDeleteCall struct { + s *Service + fileId string + opt_ map[string]interface{} +} + +// Delete: Permanently deletes a file by ID. Skips the trash. +func (r *FilesService) Delete(fileId string) *FilesDeleteCall { + c := &FilesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + return c +} + +func (c *FilesDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Permanently deletes a file by ID. Skips the trash.", + // "httpMethod": "DELETE", + // "id": "drive.files.delete", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}", + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.files.get": + +type FilesGetCall struct { + s *Service + fileId string + opt_ map[string]interface{} +} + +// Get: Gets a file's metadata by ID. +func (r *FilesService) Get(fileId string) *FilesGetCall { + c := &FilesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + return c +} + +// Projection sets the optional parameter "projection": This parameter +// is deprecated and has no function. +func (c *FilesGetCall) Projection(projection string) *FilesGetCall { + c.opt_["projection"] = projection + return c +} + +// UpdateViewedDate sets the optional parameter "updateViewedDate": +// Whether to update the view date after successfully retrieving the +// file. +func (c *FilesGetCall) UpdateViewedDate(updateViewedDate bool) *FilesGetCall { + c.opt_["updateViewedDate"] = updateViewedDate + return c +} + +func (c *FilesGetCall) Do() (*File, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updateViewedDate"]; ok { + params.Set("updateViewedDate", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a file's metadata by ID.", + // "httpMethod": "GET", + // "id": "drive.files.get", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID for the file in question.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "This parameter is deprecated and has no function.", + // "enum": [ + // "BASIC", + // "FULL" + // ], + // "enumDescriptions": [ + // "Deprecated", + // "Deprecated" + // ], + // "location": "query", + // "type": "string" + // }, + // "updateViewedDate": { + // "default": "false", + // "description": "Whether to update the view date after successfully retrieving the file.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "files/{fileId}", + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.apps.readonly", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ], + // "supportsSubscription": true + // } + +} + +// method id "drive.files.insert": + +type FilesInsertCall struct { + s *Service + file *File + opt_ map[string]interface{} + media_ io.Reader +} + +// Insert: Insert a new file. +func (r *FilesService) Insert(file *File) *FilesInsertCall { + c := &FilesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.file = file + return c +} + +// Convert sets the optional parameter "convert": Whether to convert +// this file to the corresponding Google Docs format. +func (c *FilesInsertCall) Convert(convert bool) *FilesInsertCall { + c.opt_["convert"] = convert + return c +} + +// Ocr sets the optional parameter "ocr": Whether to attempt OCR on +// .jpg, .png, .gif, or .pdf uploads. +func (c *FilesInsertCall) Ocr(ocr bool) *FilesInsertCall { + c.opt_["ocr"] = ocr + return c +} + +// OcrLanguage sets the optional parameter "ocrLanguage": If ocr is +// true, hints at the language to use. Valid values are ISO 639-1 codes. +func (c *FilesInsertCall) OcrLanguage(ocrLanguage string) *FilesInsertCall { + c.opt_["ocrLanguage"] = ocrLanguage + return c +} + +// Pinned sets the optional parameter "pinned": Whether to pin the head +// revision of the uploaded file. +func (c *FilesInsertCall) Pinned(pinned bool) *FilesInsertCall { + c.opt_["pinned"] = pinned + return c +} + +// TimedTextLanguage sets the optional parameter "timedTextLanguage": +// The language of the timed text. +func (c *FilesInsertCall) TimedTextLanguage(timedTextLanguage string) *FilesInsertCall { + c.opt_["timedTextLanguage"] = timedTextLanguage + return c +} + +// TimedTextTrackName sets the optional parameter "timedTextTrackName": +// The timed text track name. +func (c *FilesInsertCall) TimedTextTrackName(timedTextTrackName string) *FilesInsertCall { + c.opt_["timedTextTrackName"] = timedTextTrackName + return c +} + +// UseContentAsIndexableText sets the optional parameter +// "useContentAsIndexableText": Whether to use the content as indexable +// text. +func (c *FilesInsertCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesInsertCall { + c.opt_["useContentAsIndexableText"] = useContentAsIndexableText + return c +} + +// Visibility sets the optional parameter "visibility": The visibility +// of the new file. This parameter is only relevant when convert=false. +func (c *FilesInsertCall) Visibility(visibility string) *FilesInsertCall { + c.opt_["visibility"] = visibility + return c +} +func (c *FilesInsertCall) Media(r io.Reader) *FilesInsertCall { + c.media_ = r + return c +} + +func (c *FilesInsertCall) Do() (*File, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["convert"]; ok { + params.Set("convert", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ocr"]; ok { + params.Set("ocr", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ocrLanguage"]; ok { + params.Set("ocrLanguage", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pinned"]; ok { + params.Set("pinned", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timedTextLanguage"]; ok { + params.Set("timedTextLanguage", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timedTextTrackName"]; ok { + params.Set("timedTextTrackName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["useContentAsIndexableText"]; ok { + params.Set("useContentAsIndexableText", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["visibility"]; ok { + params.Set("visibility", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Insert a new file.", + // "httpMethod": "POST", + // "id": "drive.files.insert", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "maxSize": "1024GB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/drive/v2/files" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/drive/v2/files" + // } + // } + // }, + // "parameters": { + // "convert": { + // "default": "false", + // "description": "Whether to convert this file to the corresponding Google Docs format.", + // "location": "query", + // "type": "boolean" + // }, + // "ocr": { + // "default": "false", + // "description": "Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.", + // "location": "query", + // "type": "boolean" + // }, + // "ocrLanguage": { + // "description": "If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.", + // "location": "query", + // "type": "string" + // }, + // "pinned": { + // "default": "false", + // "description": "Whether to pin the head revision of the uploaded file.", + // "location": "query", + // "type": "boolean" + // }, + // "timedTextLanguage": { + // "description": "The language of the timed text.", + // "location": "query", + // "type": "string" + // }, + // "timedTextTrackName": { + // "description": "The timed text track name.", + // "location": "query", + // "type": "string" + // }, + // "useContentAsIndexableText": { + // "default": "false", + // "description": "Whether to use the content as indexable text.", + // "location": "query", + // "type": "boolean" + // }, + // "visibility": { + // "default": "DEFAULT", + // "description": "The visibility of the new file. This parameter is only relevant when convert=false.", + // "enum": [ + // "DEFAULT", + // "PRIVATE" + // ], + // "enumDescriptions": [ + // "The visibility of the new file is determined by the user's default visibility/sharing policies.", + // "The new file will be visible to only the owner." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "files", + // "request": { + // "$ref": "File" + // }, + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.apps.readonly", + // "https://www.googleapis.com/auth/drive.file" + // ], + // "supportsMediaUpload": true, + // "supportsSubscription": true + // } + +} + +// method id "drive.files.list": + +type FilesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Lists the user's files. +func (r *FilesService) List() *FilesListCall { + c := &FilesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of files to return. +func (c *FilesListCall) MaxResults(maxResults int64) *FilesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Page token for +// files. +func (c *FilesListCall) PageToken(pageToken string) *FilesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Projection sets the optional parameter "projection": This parameter +// is deprecated and has no function. +func (c *FilesListCall) Projection(projection string) *FilesListCall { + c.opt_["projection"] = projection + return c +} + +// Q sets the optional parameter "q": Query string for searching files. +func (c *FilesListCall) Q(q string) *FilesListCall { + c.opt_["q"] = q + return c +} + +func (c *FilesListCall) Do() (*FileList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["q"]; ok { + params.Set("q", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(FileList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the user's files.", + // "httpMethod": "GET", + // "id": "drive.files.list", + // "parameters": { + // "maxResults": { + // "default": "100", + // "description": "Maximum number of files to return.", + // "format": "int32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Page token for files.", + // "location": "query", + // "type": "string" + // }, + // "projection": { + // "description": "This parameter is deprecated and has no function.", + // "enum": [ + // "BASIC", + // "FULL" + // ], + // "enumDescriptions": [ + // "Deprecated", + // "Deprecated" + // ], + // "location": "query", + // "type": "string" + // }, + // "q": { + // "description": "Query string for searching files.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "files", + // "response": { + // "$ref": "FileList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.apps.readonly", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.files.patch": + +type FilesPatchCall struct { + s *Service + fileId string + file *File + opt_ map[string]interface{} +} + +// Patch: Updates file metadata and/or content. This method supports +// patch semantics. +func (r *FilesService) Patch(fileId string, file *File) *FilesPatchCall { + c := &FilesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.file = file + return c +} + +// Convert sets the optional parameter "convert": Whether to convert +// this file to the corresponding Google Docs format. +func (c *FilesPatchCall) Convert(convert bool) *FilesPatchCall { + c.opt_["convert"] = convert + return c +} + +// NewRevision sets the optional parameter "newRevision": Whether a blob +// upload should create a new revision. If false, the blob data in the +// current head revision is replaced. If not set or true, a new blob is +// created as head revision, and previous revisions are preserved +// (causing increased use of the user's data storage quota). +func (c *FilesPatchCall) NewRevision(newRevision bool) *FilesPatchCall { + c.opt_["newRevision"] = newRevision + return c +} + +// Ocr sets the optional parameter "ocr": Whether to attempt OCR on +// .jpg, .png, .gif, or .pdf uploads. +func (c *FilesPatchCall) Ocr(ocr bool) *FilesPatchCall { + c.opt_["ocr"] = ocr + return c +} + +// OcrLanguage sets the optional parameter "ocrLanguage": If ocr is +// true, hints at the language to use. Valid values are ISO 639-1 codes. +func (c *FilesPatchCall) OcrLanguage(ocrLanguage string) *FilesPatchCall { + c.opt_["ocrLanguage"] = ocrLanguage + return c +} + +// Pinned sets the optional parameter "pinned": Whether to pin the new +// revision. +func (c *FilesPatchCall) Pinned(pinned bool) *FilesPatchCall { + c.opt_["pinned"] = pinned + return c +} + +// SetModifiedDate sets the optional parameter "setModifiedDate": +// Whether to set the modified date with the supplied modified date. +func (c *FilesPatchCall) SetModifiedDate(setModifiedDate bool) *FilesPatchCall { + c.opt_["setModifiedDate"] = setModifiedDate + return c +} + +// TimedTextLanguage sets the optional parameter "timedTextLanguage": +// The language of the timed text. +func (c *FilesPatchCall) TimedTextLanguage(timedTextLanguage string) *FilesPatchCall { + c.opt_["timedTextLanguage"] = timedTextLanguage + return c +} + +// TimedTextTrackName sets the optional parameter "timedTextTrackName": +// The timed text track name. +func (c *FilesPatchCall) TimedTextTrackName(timedTextTrackName string) *FilesPatchCall { + c.opt_["timedTextTrackName"] = timedTextTrackName + return c +} + +// UpdateViewedDate sets the optional parameter "updateViewedDate": +// Whether to update the view date after successfully updating the file. +func (c *FilesPatchCall) UpdateViewedDate(updateViewedDate bool) *FilesPatchCall { + c.opt_["updateViewedDate"] = updateViewedDate + return c +} + +// UseContentAsIndexableText sets the optional parameter +// "useContentAsIndexableText": Whether to use the content as indexable +// text. +func (c *FilesPatchCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesPatchCall { + c.opt_["useContentAsIndexableText"] = useContentAsIndexableText + return c +} + +func (c *FilesPatchCall) Do() (*File, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["convert"]; ok { + params.Set("convert", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["newRevision"]; ok { + params.Set("newRevision", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ocr"]; ok { + params.Set("ocr", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ocrLanguage"]; ok { + params.Set("ocrLanguage", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pinned"]; ok { + params.Set("pinned", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["setModifiedDate"]; ok { + params.Set("setModifiedDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timedTextLanguage"]; ok { + params.Set("timedTextLanguage", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timedTextTrackName"]; ok { + params.Set("timedTextTrackName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updateViewedDate"]; ok { + params.Set("updateViewedDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["useContentAsIndexableText"]; ok { + params.Set("useContentAsIndexableText", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates file metadata and/or content. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "drive.files.patch", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "convert": { + // "default": "false", + // "description": "Whether to convert this file to the corresponding Google Docs format.", + // "location": "query", + // "type": "boolean" + // }, + // "fileId": { + // "description": "The ID of the file to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "newRevision": { + // "default": "true", + // "description": "Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If not set or true, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).", + // "location": "query", + // "type": "boolean" + // }, + // "ocr": { + // "default": "false", + // "description": "Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.", + // "location": "query", + // "type": "boolean" + // }, + // "ocrLanguage": { + // "description": "If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.", + // "location": "query", + // "type": "string" + // }, + // "pinned": { + // "default": "false", + // "description": "Whether to pin the new revision.", + // "location": "query", + // "type": "boolean" + // }, + // "setModifiedDate": { + // "default": "false", + // "description": "Whether to set the modified date with the supplied modified date.", + // "location": "query", + // "type": "boolean" + // }, + // "timedTextLanguage": { + // "description": "The language of the timed text.", + // "location": "query", + // "type": "string" + // }, + // "timedTextTrackName": { + // "description": "The timed text track name.", + // "location": "query", + // "type": "string" + // }, + // "updateViewedDate": { + // "default": "true", + // "description": "Whether to update the view date after successfully updating the file.", + // "location": "query", + // "type": "boolean" + // }, + // "useContentAsIndexableText": { + // "default": "false", + // "description": "Whether to use the content as indexable text.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "files/{fileId}", + // "request": { + // "$ref": "File" + // }, + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.apps.readonly", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.scripts" + // ] + // } + +} + +// method id "drive.files.touch": + +type FilesTouchCall struct { + s *Service + fileId string + opt_ map[string]interface{} +} + +// Touch: Set the file's updated time to the current server time. +func (r *FilesService) Touch(fileId string) *FilesTouchCall { + c := &FilesTouchCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + return c +} + +func (c *FilesTouchCall) Do() (*File, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/touch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Set the file's updated time to the current server time.", + // "httpMethod": "POST", + // "id": "drive.files.touch", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file to update.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/touch", + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.apps.readonly", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.files.trash": + +type FilesTrashCall struct { + s *Service + fileId string + opt_ map[string]interface{} +} + +// Trash: Moves a file to the trash. +func (r *FilesService) Trash(fileId string) *FilesTrashCall { + c := &FilesTrashCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + return c +} + +func (c *FilesTrashCall) Do() (*File, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/trash") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Moves a file to the trash.", + // "httpMethod": "POST", + // "id": "drive.files.trash", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file to trash.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/trash", + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.apps.readonly", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.files.untrash": + +type FilesUntrashCall struct { + s *Service + fileId string + opt_ map[string]interface{} +} + +// Untrash: Restores a file from the trash. +func (r *FilesService) Untrash(fileId string) *FilesUntrashCall { + c := &FilesUntrashCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + return c +} + +func (c *FilesUntrashCall) Do() (*File, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/untrash") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Restores a file from the trash.", + // "httpMethod": "POST", + // "id": "drive.files.untrash", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file to untrash.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/untrash", + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.apps.readonly", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.files.update": + +type FilesUpdateCall struct { + s *Service + fileId string + file *File + opt_ map[string]interface{} + media_ io.Reader +} + +// Update: Updates file metadata and/or content. +func (r *FilesService) Update(fileId string, file *File) *FilesUpdateCall { + c := &FilesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.file = file + return c +} + +// Convert sets the optional parameter "convert": Whether to convert +// this file to the corresponding Google Docs format. +func (c *FilesUpdateCall) Convert(convert bool) *FilesUpdateCall { + c.opt_["convert"] = convert + return c +} + +// NewRevision sets the optional parameter "newRevision": Whether a blob +// upload should create a new revision. If false, the blob data in the +// current head revision is replaced. If not set or true, a new blob is +// created as head revision, and previous revisions are preserved +// (causing increased use of the user's data storage quota). +func (c *FilesUpdateCall) NewRevision(newRevision bool) *FilesUpdateCall { + c.opt_["newRevision"] = newRevision + return c +} + +// Ocr sets the optional parameter "ocr": Whether to attempt OCR on +// .jpg, .png, .gif, or .pdf uploads. +func (c *FilesUpdateCall) Ocr(ocr bool) *FilesUpdateCall { + c.opt_["ocr"] = ocr + return c +} + +// OcrLanguage sets the optional parameter "ocrLanguage": If ocr is +// true, hints at the language to use. Valid values are ISO 639-1 codes. +func (c *FilesUpdateCall) OcrLanguage(ocrLanguage string) *FilesUpdateCall { + c.opt_["ocrLanguage"] = ocrLanguage + return c +} + +// Pinned sets the optional parameter "pinned": Whether to pin the new +// revision. +func (c *FilesUpdateCall) Pinned(pinned bool) *FilesUpdateCall { + c.opt_["pinned"] = pinned + return c +} + +// SetModifiedDate sets the optional parameter "setModifiedDate": +// Whether to set the modified date with the supplied modified date. +func (c *FilesUpdateCall) SetModifiedDate(setModifiedDate bool) *FilesUpdateCall { + c.opt_["setModifiedDate"] = setModifiedDate + return c +} + +// TimedTextLanguage sets the optional parameter "timedTextLanguage": +// The language of the timed text. +func (c *FilesUpdateCall) TimedTextLanguage(timedTextLanguage string) *FilesUpdateCall { + c.opt_["timedTextLanguage"] = timedTextLanguage + return c +} + +// TimedTextTrackName sets the optional parameter "timedTextTrackName": +// The timed text track name. +func (c *FilesUpdateCall) TimedTextTrackName(timedTextTrackName string) *FilesUpdateCall { + c.opt_["timedTextTrackName"] = timedTextTrackName + return c +} + +// UpdateViewedDate sets the optional parameter "updateViewedDate": +// Whether to update the view date after successfully updating the file. +func (c *FilesUpdateCall) UpdateViewedDate(updateViewedDate bool) *FilesUpdateCall { + c.opt_["updateViewedDate"] = updateViewedDate + return c +} + +// UseContentAsIndexableText sets the optional parameter +// "useContentAsIndexableText": Whether to use the content as indexable +// text. +func (c *FilesUpdateCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesUpdateCall { + c.opt_["useContentAsIndexableText"] = useContentAsIndexableText + return c +} +func (c *FilesUpdateCall) Media(r io.Reader) *FilesUpdateCall { + c.media_ = r + return c +} + +func (c *FilesUpdateCall) Do() (*File, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["convert"]; ok { + params.Set("convert", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["newRevision"]; ok { + params.Set("newRevision", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ocr"]; ok { + params.Set("ocr", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ocrLanguage"]; ok { + params.Set("ocrLanguage", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pinned"]; ok { + params.Set("pinned", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["setModifiedDate"]; ok { + params.Set("setModifiedDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timedTextLanguage"]; ok { + params.Set("timedTextLanguage", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timedTextTrackName"]; ok { + params.Set("timedTextTrackName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updateViewedDate"]; ok { + params.Set("updateViewedDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["useContentAsIndexableText"]; ok { + params.Set("useContentAsIndexableText", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(File) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates file metadata and/or content.", + // "httpMethod": "PUT", + // "id": "drive.files.update", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "maxSize": "1024GB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/drive/v2/files/{fileId}" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/drive/v2/files/{fileId}" + // } + // } + // }, + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "convert": { + // "default": "false", + // "description": "Whether to convert this file to the corresponding Google Docs format.", + // "location": "query", + // "type": "boolean" + // }, + // "fileId": { + // "description": "The ID of the file to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "newRevision": { + // "default": "true", + // "description": "Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If not set or true, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).", + // "location": "query", + // "type": "boolean" + // }, + // "ocr": { + // "default": "false", + // "description": "Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.", + // "location": "query", + // "type": "boolean" + // }, + // "ocrLanguage": { + // "description": "If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.", + // "location": "query", + // "type": "string" + // }, + // "pinned": { + // "default": "false", + // "description": "Whether to pin the new revision.", + // "location": "query", + // "type": "boolean" + // }, + // "setModifiedDate": { + // "default": "false", + // "description": "Whether to set the modified date with the supplied modified date.", + // "location": "query", + // "type": "boolean" + // }, + // "timedTextLanguage": { + // "description": "The language of the timed text.", + // "location": "query", + // "type": "string" + // }, + // "timedTextTrackName": { + // "description": "The timed text track name.", + // "location": "query", + // "type": "string" + // }, + // "updateViewedDate": { + // "default": "true", + // "description": "Whether to update the view date after successfully updating the file.", + // "location": "query", + // "type": "boolean" + // }, + // "useContentAsIndexableText": { + // "default": "false", + // "description": "Whether to use the content as indexable text.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "files/{fileId}", + // "request": { + // "$ref": "File" + // }, + // "response": { + // "$ref": "File" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.apps.readonly", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.scripts" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "drive.files.watch": + +type FilesWatchCall struct { + s *Service + fileId string + channel *Channel + opt_ map[string]interface{} +} + +// Watch: Subscribe to changes on a file +func (r *FilesService) Watch(fileId string, channel *Channel) *FilesWatchCall { + c := &FilesWatchCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.channel = channel + return c +} + +// Projection sets the optional parameter "projection": This parameter +// is deprecated and has no function. +func (c *FilesWatchCall) Projection(projection string) *FilesWatchCall { + c.opt_["projection"] = projection + return c +} + +// UpdateViewedDate sets the optional parameter "updateViewedDate": +// Whether to update the view date after successfully retrieving the +// file. +func (c *FilesWatchCall) UpdateViewedDate(updateViewedDate bool) *FilesWatchCall { + c.opt_["updateViewedDate"] = updateViewedDate + return c +} + +func (c *FilesWatchCall) Do() (*Channel, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updateViewedDate"]; ok { + params.Set("updateViewedDate", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/watch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Channel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Subscribe to changes on a file", + // "httpMethod": "POST", + // "id": "drive.files.watch", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID for the file in question.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "This parameter is deprecated and has no function.", + // "enum": [ + // "BASIC", + // "FULL" + // ], + // "enumDescriptions": [ + // "Deprecated", + // "Deprecated" + // ], + // "location": "query", + // "type": "string" + // }, + // "updateViewedDate": { + // "default": "false", + // "description": "Whether to update the view date after successfully retrieving the file.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "files/{fileId}/watch", + // "request": { + // "$ref": "Channel", + // "parameterName": "resource" + // }, + // "response": { + // "$ref": "Channel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.apps.readonly", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ], + // "supportsSubscription": true + // } + +} + +// method id "drive.parents.delete": + +type ParentsDeleteCall struct { + s *Service + fileId string + parentId string + opt_ map[string]interface{} +} + +// Delete: Removes a parent from a file. +func (r *ParentsService) Delete(fileId string, parentId string) *ParentsDeleteCall { + c := &ParentsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.parentId = parentId + return c +} + +func (c *ParentsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents/{parentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{parentId}", url.QueryEscape(c.parentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Removes a parent from a file.", + // "httpMethod": "DELETE", + // "id": "drive.parents.delete", + // "parameterOrder": [ + // "fileId", + // "parentId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "parentId": { + // "description": "The ID of the parent.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/parents/{parentId}", + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.parents.get": + +type ParentsGetCall struct { + s *Service + fileId string + parentId string + opt_ map[string]interface{} +} + +// Get: Gets a specific parent reference. +func (r *ParentsService) Get(fileId string, parentId string) *ParentsGetCall { + c := &ParentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.parentId = parentId + return c +} + +func (c *ParentsGetCall) Do() (*ParentReference, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents/{parentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{parentId}", url.QueryEscape(c.parentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ParentReference) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a specific parent reference.", + // "httpMethod": "GET", + // "id": "drive.parents.get", + // "parameterOrder": [ + // "fileId", + // "parentId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "parentId": { + // "description": "The ID of the parent.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/parents/{parentId}", + // "response": { + // "$ref": "ParentReference" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.parents.insert": + +type ParentsInsertCall struct { + s *Service + fileId string + parentreference *ParentReference + opt_ map[string]interface{} +} + +// Insert: Adds a parent folder for a file. +func (r *ParentsService) Insert(fileId string, parentreference *ParentReference) *ParentsInsertCall { + c := &ParentsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.parentreference = parentreference + return c +} + +func (c *ParentsInsertCall) Do() (*ParentReference, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.parentreference) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ParentReference) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a parent folder for a file.", + // "httpMethod": "POST", + // "id": "drive.parents.insert", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/parents", + // "request": { + // "$ref": "ParentReference" + // }, + // "response": { + // "$ref": "ParentReference" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.parents.list": + +type ParentsListCall struct { + s *Service + fileId string + opt_ map[string]interface{} +} + +// List: Lists a file's parents. +func (r *ParentsService) List(fileId string) *ParentsListCall { + c := &ParentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + return c +} + +func (c *ParentsListCall) Do() (*ParentList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ParentList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists a file's parents.", + // "httpMethod": "GET", + // "id": "drive.parents.list", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/parents", + // "response": { + // "$ref": "ParentList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.permissions.delete": + +type PermissionsDeleteCall struct { + s *Service + fileId string + permissionId string + opt_ map[string]interface{} +} + +// Delete: Deletes a permission from a file. +func (r *PermissionsService) Delete(fileId string, permissionId string) *PermissionsDeleteCall { + c := &PermissionsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.permissionId = permissionId + return c +} + +func (c *PermissionsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{permissionId}", url.QueryEscape(c.permissionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a permission from a file.", + // "httpMethod": "DELETE", + // "id": "drive.permissions.delete", + // "parameterOrder": [ + // "fileId", + // "permissionId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID for the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "permissionId": { + // "description": "The ID for the permission.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/permissions/{permissionId}", + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.permissions.get": + +type PermissionsGetCall struct { + s *Service + fileId string + permissionId string + opt_ map[string]interface{} +} + +// Get: Gets a permission by ID. +func (r *PermissionsService) Get(fileId string, permissionId string) *PermissionsGetCall { + c := &PermissionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.permissionId = permissionId + return c +} + +func (c *PermissionsGetCall) Do() (*Permission, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{permissionId}", url.QueryEscape(c.permissionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Permission) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a permission by ID.", + // "httpMethod": "GET", + // "id": "drive.permissions.get", + // "parameterOrder": [ + // "fileId", + // "permissionId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID for the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "permissionId": { + // "description": "The ID for the permission.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/permissions/{permissionId}", + // "response": { + // "$ref": "Permission" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.permissions.getIdForEmail": + +type PermissionsGetIdForEmailCall struct { + s *Service + email string + opt_ map[string]interface{} +} + +// GetIdForEmail: Returns the permission ID for an email address. +func (r *PermissionsService) GetIdForEmail(email string) *PermissionsGetIdForEmailCall { + c := &PermissionsGetIdForEmailCall{s: r.s, opt_: make(map[string]interface{})} + c.email = email + return c +} + +func (c *PermissionsGetIdForEmailCall) Do() (*PermissionId, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "permissionIds/{email}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{email}", url.QueryEscape(c.email), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PermissionId) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the permission ID for an email address.", + // "httpMethod": "GET", + // "id": "drive.permissions.getIdForEmail", + // "parameterOrder": [ + // "email" + // ], + // "parameters": { + // "email": { + // "description": "The email address for which to return a permission ID", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "permissionIds/{email}", + // "response": { + // "$ref": "PermissionId" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.apps.readonly", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.permissions.insert": + +type PermissionsInsertCall struct { + s *Service + fileId string + permission *Permission + opt_ map[string]interface{} +} + +// Insert: Inserts a permission for a file. +func (r *PermissionsService) Insert(fileId string, permission *Permission) *PermissionsInsertCall { + c := &PermissionsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.permission = permission + return c +} + +// EmailMessage sets the optional parameter "emailMessage": A custom +// message to include in notification emails. +func (c *PermissionsInsertCall) EmailMessage(emailMessage string) *PermissionsInsertCall { + c.opt_["emailMessage"] = emailMessage + return c +} + +// SendNotificationEmails sets the optional parameter +// "sendNotificationEmails": Whether to send notification emails when +// sharing to users or groups. +func (c *PermissionsInsertCall) SendNotificationEmails(sendNotificationEmails bool) *PermissionsInsertCall { + c.opt_["sendNotificationEmails"] = sendNotificationEmails + return c +} + +func (c *PermissionsInsertCall) Do() (*Permission, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["emailMessage"]; ok { + params.Set("emailMessage", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sendNotificationEmails"]; ok { + params.Set("sendNotificationEmails", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Permission) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a permission for a file.", + // "httpMethod": "POST", + // "id": "drive.permissions.insert", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "emailMessage": { + // "description": "A custom message to include in notification emails.", + // "location": "query", + // "type": "string" + // }, + // "fileId": { + // "description": "The ID for the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sendNotificationEmails": { + // "default": "true", + // "description": "Whether to send notification emails when sharing to users or groups.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "files/{fileId}/permissions", + // "request": { + // "$ref": "Permission" + // }, + // "response": { + // "$ref": "Permission" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.permissions.list": + +type PermissionsListCall struct { + s *Service + fileId string + opt_ map[string]interface{} +} + +// List: Lists a file's permissions. +func (r *PermissionsService) List(fileId string) *PermissionsListCall { + c := &PermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + return c +} + +func (c *PermissionsListCall) Do() (*PermissionList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PermissionList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists a file's permissions.", + // "httpMethod": "GET", + // "id": "drive.permissions.list", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID for the file.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/permissions", + // "response": { + // "$ref": "PermissionList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.permissions.patch": + +type PermissionsPatchCall struct { + s *Service + fileId string + permissionId string + permission *Permission + opt_ map[string]interface{} +} + +// Patch: Updates a permission. This method supports patch semantics. +func (r *PermissionsService) Patch(fileId string, permissionId string, permission *Permission) *PermissionsPatchCall { + c := &PermissionsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.permissionId = permissionId + c.permission = permission + return c +} + +// TransferOwnership sets the optional parameter "transferOwnership": +// Whether changing a role to 'owner' should also downgrade the current +// owners to writers. +func (c *PermissionsPatchCall) TransferOwnership(transferOwnership bool) *PermissionsPatchCall { + c.opt_["transferOwnership"] = transferOwnership + return c +} + +func (c *PermissionsPatchCall) Do() (*Permission, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["transferOwnership"]; ok { + params.Set("transferOwnership", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{permissionId}", url.QueryEscape(c.permissionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Permission) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a permission. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "drive.permissions.patch", + // "parameterOrder": [ + // "fileId", + // "permissionId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID for the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "permissionId": { + // "description": "The ID for the permission.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "transferOwnership": { + // "default": "false", + // "description": "Whether changing a role to 'owner' should also downgrade the current owners to writers.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "files/{fileId}/permissions/{permissionId}", + // "request": { + // "$ref": "Permission" + // }, + // "response": { + // "$ref": "Permission" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.permissions.update": + +type PermissionsUpdateCall struct { + s *Service + fileId string + permissionId string + permission *Permission + opt_ map[string]interface{} +} + +// Update: Updates a permission. +func (r *PermissionsService) Update(fileId string, permissionId string, permission *Permission) *PermissionsUpdateCall { + c := &PermissionsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.permissionId = permissionId + c.permission = permission + return c +} + +// TransferOwnership sets the optional parameter "transferOwnership": +// Whether changing a role to 'owner' should also downgrade the current +// owners to writers. +func (c *PermissionsUpdateCall) TransferOwnership(transferOwnership bool) *PermissionsUpdateCall { + c.opt_["transferOwnership"] = transferOwnership + return c +} + +func (c *PermissionsUpdateCall) Do() (*Permission, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["transferOwnership"]; ok { + params.Set("transferOwnership", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{permissionId}", url.QueryEscape(c.permissionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Permission) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a permission.", + // "httpMethod": "PUT", + // "id": "drive.permissions.update", + // "parameterOrder": [ + // "fileId", + // "permissionId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID for the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "permissionId": { + // "description": "The ID for the permission.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "transferOwnership": { + // "default": "false", + // "description": "Whether changing a role to 'owner' should also downgrade the current owners to writers.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "files/{fileId}/permissions/{permissionId}", + // "request": { + // "$ref": "Permission" + // }, + // "response": { + // "$ref": "Permission" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.properties.delete": + +type PropertiesDeleteCall struct { + s *Service + fileId string + propertyKey string + opt_ map[string]interface{} +} + +// Delete: Deletes a property. +func (r *PropertiesService) Delete(fileId string, propertyKey string) *PropertiesDeleteCall { + c := &PropertiesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.propertyKey = propertyKey + return c +} + +// Visibility sets the optional parameter "visibility": The visibility +// of the property. +func (c *PropertiesDeleteCall) Visibility(visibility string) *PropertiesDeleteCall { + c.opt_["visibility"] = visibility + return c +} + +func (c *PropertiesDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["visibility"]; ok { + params.Set("visibility", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties/{propertyKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{propertyKey}", url.QueryEscape(c.propertyKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a property.", + // "httpMethod": "DELETE", + // "id": "drive.properties.delete", + // "parameterOrder": [ + // "fileId", + // "propertyKey" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "propertyKey": { + // "description": "The key of the property.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "visibility": { + // "default": "private", + // "description": "The visibility of the property.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "files/{fileId}/properties/{propertyKey}", + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.properties.get": + +type PropertiesGetCall struct { + s *Service + fileId string + propertyKey string + opt_ map[string]interface{} +} + +// Get: Gets a property by its key. +func (r *PropertiesService) Get(fileId string, propertyKey string) *PropertiesGetCall { + c := &PropertiesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.propertyKey = propertyKey + return c +} + +// Visibility sets the optional parameter "visibility": The visibility +// of the property. +func (c *PropertiesGetCall) Visibility(visibility string) *PropertiesGetCall { + c.opt_["visibility"] = visibility + return c +} + +func (c *PropertiesGetCall) Do() (*Property, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["visibility"]; ok { + params.Set("visibility", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties/{propertyKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{propertyKey}", url.QueryEscape(c.propertyKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Property) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a property by its key.", + // "httpMethod": "GET", + // "id": "drive.properties.get", + // "parameterOrder": [ + // "fileId", + // "propertyKey" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "propertyKey": { + // "description": "The key of the property.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "visibility": { + // "default": "private", + // "description": "The visibility of the property.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "files/{fileId}/properties/{propertyKey}", + // "response": { + // "$ref": "Property" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.properties.insert": + +type PropertiesInsertCall struct { + s *Service + fileId string + property *Property + opt_ map[string]interface{} +} + +// Insert: Adds a property to a file. +func (r *PropertiesService) Insert(fileId string, property *Property) *PropertiesInsertCall { + c := &PropertiesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.property = property + return c +} + +func (c *PropertiesInsertCall) Do() (*Property, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.property) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Property) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a property to a file.", + // "httpMethod": "POST", + // "id": "drive.properties.insert", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/properties", + // "request": { + // "$ref": "Property" + // }, + // "response": { + // "$ref": "Property" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.properties.list": + +type PropertiesListCall struct { + s *Service + fileId string + opt_ map[string]interface{} +} + +// List: Lists a file's properties. +func (r *PropertiesService) List(fileId string) *PropertiesListCall { + c := &PropertiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + return c +} + +func (c *PropertiesListCall) Do() (*PropertyList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PropertyList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists a file's properties.", + // "httpMethod": "GET", + // "id": "drive.properties.list", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/properties", + // "response": { + // "$ref": "PropertyList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.properties.patch": + +type PropertiesPatchCall struct { + s *Service + fileId string + propertyKey string + property *Property + opt_ map[string]interface{} +} + +// Patch: Updates a property. This method supports patch semantics. +func (r *PropertiesService) Patch(fileId string, propertyKey string, property *Property) *PropertiesPatchCall { + c := &PropertiesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.propertyKey = propertyKey + c.property = property + return c +} + +// Visibility sets the optional parameter "visibility": The visibility +// of the property. +func (c *PropertiesPatchCall) Visibility(visibility string) *PropertiesPatchCall { + c.opt_["visibility"] = visibility + return c +} + +func (c *PropertiesPatchCall) Do() (*Property, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.property) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["visibility"]; ok { + params.Set("visibility", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties/{propertyKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{propertyKey}", url.QueryEscape(c.propertyKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Property) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a property. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "drive.properties.patch", + // "parameterOrder": [ + // "fileId", + // "propertyKey" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "propertyKey": { + // "description": "The key of the property.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "visibility": { + // "default": "private", + // "description": "The visibility of the property.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "files/{fileId}/properties/{propertyKey}", + // "request": { + // "$ref": "Property" + // }, + // "response": { + // "$ref": "Property" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.properties.update": + +type PropertiesUpdateCall struct { + s *Service + fileId string + propertyKey string + property *Property + opt_ map[string]interface{} +} + +// Update: Updates a property. +func (r *PropertiesService) Update(fileId string, propertyKey string, property *Property) *PropertiesUpdateCall { + c := &PropertiesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.propertyKey = propertyKey + c.property = property + return c +} + +// Visibility sets the optional parameter "visibility": The visibility +// of the property. +func (c *PropertiesUpdateCall) Visibility(visibility string) *PropertiesUpdateCall { + c.opt_["visibility"] = visibility + return c +} + +func (c *PropertiesUpdateCall) Do() (*Property, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.property) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["visibility"]; ok { + params.Set("visibility", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties/{propertyKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{propertyKey}", url.QueryEscape(c.propertyKey), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Property) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a property.", + // "httpMethod": "PUT", + // "id": "drive.properties.update", + // "parameterOrder": [ + // "fileId", + // "propertyKey" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "propertyKey": { + // "description": "The key of the property.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "visibility": { + // "default": "private", + // "description": "The visibility of the property.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "files/{fileId}/properties/{propertyKey}", + // "request": { + // "$ref": "Property" + // }, + // "response": { + // "$ref": "Property" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.realtime.get": + +type RealtimeGetCall struct { + s *Service + fileId string + opt_ map[string]interface{} +} + +// Get: Exports the contents of the Realtime API data model associated +// with this file as JSON. +func (r *RealtimeService) Get(fileId string) *RealtimeGetCall { + c := &RealtimeGetCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + return c +} + +func (c *RealtimeGetCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/realtime") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Exports the contents of the Realtime API data model associated with this file as JSON.", + // "httpMethod": "GET", + // "id": "drive.realtime.get", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file that the Realtime API data model is associated with.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/realtime", + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.readonly" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "drive.realtime.update": + +type RealtimeUpdateCall struct { + s *Service + fileId string + opt_ map[string]interface{} + media_ io.Reader +} + +// Update: Overwrites the Realtime API data model associated with this +// file with the provided JSON data model. +func (r *RealtimeService) Update(fileId string) *RealtimeUpdateCall { + c := &RealtimeUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + return c +} + +// BaseRevision sets the optional parameter "baseRevision": The revision +// of the model to diff the uploaded model against. If set, the uploaded +// model is diffed against the provided revision and those differences +// are merged with any changes made to the model after the provided +// revision. If not set, the uploaded model replaces the current model +// on the server. +func (c *RealtimeUpdateCall) BaseRevision(baseRevision string) *RealtimeUpdateCall { + c.opt_["baseRevision"] = baseRevision + return c +} +func (c *RealtimeUpdateCall) Media(r io.Reader) *RealtimeUpdateCall { + c.media_ = r + return c +} + +func (c *RealtimeUpdateCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["baseRevision"]; ok { + params.Set("baseRevision", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/realtime") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Overwrites the Realtime API data model associated with this file with the provided JSON data model.", + // "httpMethod": "PUT", + // "id": "drive.realtime.update", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "maxSize": "10MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/drive/v2/files/{fileId}/realtime" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/drive/v2/files/{fileId}/realtime" + // } + // } + // }, + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "baseRevision": { + // "description": "The revision of the model to diff the uploaded model against. If set, the uploaded model is diffed against the provided revision and those differences are merged with any changes made to the model after the provided revision. If not set, the uploaded model replaces the current model on the server.", + // "location": "query", + // "type": "string" + // }, + // "fileId": { + // "description": "The ID of the file that the Realtime API data model is associated with.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/realtime", + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "drive.replies.delete": + +type RepliesDeleteCall struct { + s *Service + fileId string + commentId string + replyId string + opt_ map[string]interface{} +} + +// Delete: Deletes a reply. +func (r *RepliesService) Delete(fileId string, commentId string, replyId string) *RepliesDeleteCall { + c := &RepliesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.commentId = commentId + c.replyId = replyId + return c +} + +func (c *RepliesDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{replyId}", url.QueryEscape(c.replyId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a reply.", + // "httpMethod": "DELETE", + // "id": "drive.replies.delete", + // "parameterOrder": [ + // "fileId", + // "commentId", + // "replyId" + // ], + // "parameters": { + // "commentId": { + // "description": "The ID of the comment.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "replyId": { + // "description": "The ID of the reply.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.replies.get": + +type RepliesGetCall struct { + s *Service + fileId string + commentId string + replyId string + opt_ map[string]interface{} +} + +// Get: Gets a reply. +func (r *RepliesService) Get(fileId string, commentId string, replyId string) *RepliesGetCall { + c := &RepliesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.commentId = commentId + c.replyId = replyId + return c +} + +// IncludeDeleted sets the optional parameter "includeDeleted": If set, +// this will succeed when retrieving a deleted reply. +func (c *RepliesGetCall) IncludeDeleted(includeDeleted bool) *RepliesGetCall { + c.opt_["includeDeleted"] = includeDeleted + return c +} + +func (c *RepliesGetCall) Do() (*CommentReply, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeDeleted"]; ok { + params.Set("includeDeleted", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{replyId}", url.QueryEscape(c.replyId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommentReply) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a reply.", + // "httpMethod": "GET", + // "id": "drive.replies.get", + // "parameterOrder": [ + // "fileId", + // "commentId", + // "replyId" + // ], + // "parameters": { + // "commentId": { + // "description": "The ID of the comment.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeDeleted": { + // "default": "false", + // "description": "If set, this will succeed when retrieving a deleted reply.", + // "location": "query", + // "type": "boolean" + // }, + // "replyId": { + // "description": "The ID of the reply.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", + // "response": { + // "$ref": "CommentReply" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.replies.insert": + +type RepliesInsertCall struct { + s *Service + fileId string + commentId string + commentreply *CommentReply + opt_ map[string]interface{} +} + +// Insert: Creates a new reply to the given comment. +func (r *RepliesService) Insert(fileId string, commentId string, commentreply *CommentReply) *RepliesInsertCall { + c := &RepliesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.commentId = commentId + c.commentreply = commentreply + return c +} + +func (c *RepliesInsertCall) Do() (*CommentReply, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentreply) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommentReply) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new reply to the given comment.", + // "httpMethod": "POST", + // "id": "drive.replies.insert", + // "parameterOrder": [ + // "fileId", + // "commentId" + // ], + // "parameters": { + // "commentId": { + // "description": "The ID of the comment.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/comments/{commentId}/replies", + // "request": { + // "$ref": "CommentReply" + // }, + // "response": { + // "$ref": "CommentReply" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.replies.list": + +type RepliesListCall struct { + s *Service + fileId string + commentId string + opt_ map[string]interface{} +} + +// List: Lists all of the replies to a comment. +func (r *RepliesService) List(fileId string, commentId string) *RepliesListCall { + c := &RepliesListCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.commentId = commentId + return c +} + +// IncludeDeleted sets the optional parameter "includeDeleted": If set, +// all replies, including deleted replies (with content stripped) will +// be returned. +func (c *RepliesListCall) IncludeDeleted(includeDeleted bool) *RepliesListCall { + c.opt_["includeDeleted"] = includeDeleted + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of replies to include in the response, used for paging. +func (c *RepliesListCall) MaxResults(maxResults int64) *RepliesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, used to page through large result sets. To get the next page +// of results, set this parameter to the value of "nextPageToken" from +// the previous response. +func (c *RepliesListCall) PageToken(pageToken string) *RepliesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *RepliesListCall) Do() (*CommentReplyList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeDeleted"]; ok { + params.Set("includeDeleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommentReplyList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all of the replies to a comment.", + // "httpMethod": "GET", + // "id": "drive.replies.list", + // "parameterOrder": [ + // "fileId", + // "commentId" + // ], + // "parameters": { + // "commentId": { + // "description": "The ID of the comment.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeDeleted": { + // "default": "false", + // "description": "If set, all replies, including deleted replies (with content stripped) will be returned.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "default": "20", + // "description": "The maximum number of replies to include in the response, used for paging.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "files/{fileId}/comments/{commentId}/replies", + // "response": { + // "$ref": "CommentReplyList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.replies.patch": + +type RepliesPatchCall struct { + s *Service + fileId string + commentId string + replyId string + commentreply *CommentReply + opt_ map[string]interface{} +} + +// Patch: Updates an existing reply. This method supports patch +// semantics. +func (r *RepliesService) Patch(fileId string, commentId string, replyId string, commentreply *CommentReply) *RepliesPatchCall { + c := &RepliesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.commentId = commentId + c.replyId = replyId + c.commentreply = commentreply + return c +} + +func (c *RepliesPatchCall) Do() (*CommentReply, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentreply) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{replyId}", url.QueryEscape(c.replyId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommentReply) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing reply. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "drive.replies.patch", + // "parameterOrder": [ + // "fileId", + // "commentId", + // "replyId" + // ], + // "parameters": { + // "commentId": { + // "description": "The ID of the comment.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "replyId": { + // "description": "The ID of the reply.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", + // "request": { + // "$ref": "CommentReply" + // }, + // "response": { + // "$ref": "CommentReply" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.replies.update": + +type RepliesUpdateCall struct { + s *Service + fileId string + commentId string + replyId string + commentreply *CommentReply + opt_ map[string]interface{} +} + +// Update: Updates an existing reply. +func (r *RepliesService) Update(fileId string, commentId string, replyId string, commentreply *CommentReply) *RepliesUpdateCall { + c := &RepliesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.commentId = commentId + c.replyId = replyId + c.commentreply = commentreply + return c +} + +func (c *RepliesUpdateCall) Do() (*CommentReply, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentreply) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{replyId}", url.QueryEscape(c.replyId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommentReply) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing reply.", + // "httpMethod": "PUT", + // "id": "drive.replies.update", + // "parameterOrder": [ + // "fileId", + // "commentId", + // "replyId" + // ], + // "parameters": { + // "commentId": { + // "description": "The ID of the comment.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "replyId": { + // "description": "The ID of the reply.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", + // "request": { + // "$ref": "CommentReply" + // }, + // "response": { + // "$ref": "CommentReply" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.revisions.delete": + +type RevisionsDeleteCall struct { + s *Service + fileId string + revisionId string + opt_ map[string]interface{} +} + +// Delete: Removes a revision. +func (r *RevisionsService) Delete(fileId string, revisionId string) *RevisionsDeleteCall { + c := &RevisionsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.revisionId = revisionId + return c +} + +func (c *RevisionsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{revisionId}", url.QueryEscape(c.revisionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Removes a revision.", + // "httpMethod": "DELETE", + // "id": "drive.revisions.delete", + // "parameterOrder": [ + // "fileId", + // "revisionId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "revisionId": { + // "description": "The ID of the revision.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/revisions/{revisionId}", + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.revisions.get": + +type RevisionsGetCall struct { + s *Service + fileId string + revisionId string + opt_ map[string]interface{} +} + +// Get: Gets a specific revision. +func (r *RevisionsService) Get(fileId string, revisionId string) *RevisionsGetCall { + c := &RevisionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.revisionId = revisionId + return c +} + +func (c *RevisionsGetCall) Do() (*Revision, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{revisionId}", url.QueryEscape(c.revisionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Revision) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a specific revision.", + // "httpMethod": "GET", + // "id": "drive.revisions.get", + // "parameterOrder": [ + // "fileId", + // "revisionId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "revisionId": { + // "description": "The ID of the revision.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/revisions/{revisionId}", + // "response": { + // "$ref": "Revision" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.revisions.list": + +type RevisionsListCall struct { + s *Service + fileId string + opt_ map[string]interface{} +} + +// List: Lists a file's revisions. +func (r *RevisionsService) List(fileId string) *RevisionsListCall { + c := &RevisionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + return c +} + +func (c *RevisionsListCall) Do() (*RevisionList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RevisionList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists a file's revisions.", + // "httpMethod": "GET", + // "id": "drive.revisions.list", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/revisions", + // "response": { + // "$ref": "RevisionList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.revisions.patch": + +type RevisionsPatchCall struct { + s *Service + fileId string + revisionId string + revision *Revision + opt_ map[string]interface{} +} + +// Patch: Updates a revision. This method supports patch semantics. +func (r *RevisionsService) Patch(fileId string, revisionId string, revision *Revision) *RevisionsPatchCall { + c := &RevisionsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.revisionId = revisionId + c.revision = revision + return c +} + +func (c *RevisionsPatchCall) Do() (*Revision, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.revision) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{revisionId}", url.QueryEscape(c.revisionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Revision) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a revision. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "drive.revisions.patch", + // "parameterOrder": [ + // "fileId", + // "revisionId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID for the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "revisionId": { + // "description": "The ID for the revision.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/revisions/{revisionId}", + // "request": { + // "$ref": "Revision" + // }, + // "response": { + // "$ref": "Revision" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} + +// method id "drive.revisions.update": + +type RevisionsUpdateCall struct { + s *Service + fileId string + revisionId string + revision *Revision + opt_ map[string]interface{} +} + +// Update: Updates a revision. +func (r *RevisionsService) Update(fileId string, revisionId string, revision *Revision) *RevisionsUpdateCall { + c := &RevisionsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + c.revisionId = revisionId + c.revision = revision + return c +} + +func (c *RevisionsUpdateCall) Do() (*Revision, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.revision) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{revisionId}", url.QueryEscape(c.revisionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Revision) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a revision.", + // "httpMethod": "PUT", + // "id": "drive.revisions.update", + // "parameterOrder": [ + // "fileId", + // "revisionId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID for the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "revisionId": { + // "description": "The ID for the revision.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/revisions/{revisionId}", + // "request": { + // "$ref": "Revision" + // }, + // "response": { + // "$ref": "Revision" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/drive.file" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/examples/bigquery.go b/third_party/src/code.google.com/p/google-api-go-client/examples/bigquery.go new file mode 100644 index 0000000000000..a3775b7ae1903 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/examples/bigquery.go @@ -0,0 +1,368 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "container/list" + "encoding/json" + "fmt" + "io/ioutil" + "math" + "math/rand" + "net/http" + "os" + "strconv" + "strings" + "time" + + "code.google.com/p/google-api-go-client/bigquery/v2" + "code.google.com/p/google-api-go-client/storage/v1beta2" +) + +const ( + GB = 1 << 30 + MaxBackoff = 30000 + BaseBackoff = 250 + BackoffGrowthFactor = 1.8 + BackoffGrowthDamper = 0.25 + JobStatusDone = "DONE" + DatasetAlreadyExists = "Already Exists: Dataset" + TableWriteEmptyDisposition = "WRITE_EMPTY" +) + +func init() { + scope := fmt.Sprintf("%s %s %s", bigquery.BigqueryScope, + storage.DevstorageRead_onlyScope, + "https://www.googleapis.com/auth/userinfo.profile") + registerDemo("bigquery", scope, bqMain) +} + +// This example demonstrates loading objects from Google Cloud Storage into +// BigQuery. Objects are specified by their bucket and a name prefix. Each +// object will be loaded into a new table identified by the object name minus +// any file extension. All tables are added to the specified dataset (one will +// be created if necessary). Currently, tables will not be overwritten and an +// attempt to load an object into a dataset that already contains its table +// will emit an error message indicating the table already exists. +// A schema file must be provided and it will be applied to every object/table. +// Example usage: +// go-api-demo -clientid="my-clientid" -secret="my-secret" bq myProject +// myDataBucket datafile2013070 DataFiles2013 +// ./datafile_schema.json 100 +// +// This will load all objects (e.g. all data files from July 2013) from +// gs://myDataBucket into a (possibly new) BigQuery dataset named DataFiles2013 +// using the schema file provided and allowing up to 100 bad records. Assuming +// each object is named like datafileYYYYMMDD.csv.gz and all of July's files are +// stored in the bucket, 9 tables will be created named like datafile201307DD +// where DD ranges from 01 to 09, inclusive. +// When the program completes, it will emit a results line similar to: +// +// 9 files loaded in 3m58s (18m2.708s). Size: 7.18GB Rows: 7130725 +// +// The total elapsed time from the start of first job to the end of the last job +// (effectively wall clock time) is shown. In parenthesis is the aggregate time +// taken to load all tables. +func bqMain(client *http.Client, argv []string) { + if len(argv) != 6 { + fmt.Fprintln(os.Stderr, + "Usage: bq project_id bucket prefix dataset schema max_bad_records") + return + } + + var ( + project = argv[0] + bucket = argv[1] + objPrefix = argv[2] + datasetId = argv[3] + schemaFile = argv[4] + ) + badRecords, err := strconv.ParseInt(argv[5], 10, 64) + if err != nil { + fmt.Fprintln(os.Stderr, err) + return + } + + rand.Seed(time.Now().UnixNano()) + + service, err := storage.New(client) + if err != nil { + fmt.Fprintln(os.Stderr, err) + return + } + + // Get the list of objects in the bucket matching the specified prefix. + list := service.Objects.List(bucket) + list.Prefix(objPrefix) + objects, err := list.Do() + if err != nil { + fmt.Fprintln(os.Stderr, err) + return + } + + // Create the wrapper and insert the (new) dataset. + dataset, err := newBQDataset(client, project, datasetId) + if err != nil { + fmt.Fprintln(os.Stderr, err) + return + } + if err = dataset.insert(true); err != nil { + fmt.Fprintln(os.Stderr, err) + return + } + + objectSource := &tableSource{ + maxBadRecords: badRecords, + disposition: TableWriteEmptyDisposition, + } + + // Load the schema from disk. + f, err := ioutil.ReadFile(schemaFile) + if err != nil { + fmt.Fprintln(os.Stderr, err) + return + } + if err = json.Unmarshal(f, &objectSource.schema); err != nil { + fmt.Fprintln(os.Stderr, err) + return + } + + // Assumes all objects have .csv, .csv.gz (or no) extension. + tableIdFromObject := func(name string) string { + return strings.TrimSuffix(strings.TrimSuffix(name, ".gz"), ".csv") + } + + // A jobset is way to group a collection of jobs together for monitoring. + // For this example, we just use the name of the bucket and object prefix. + jobset := fmt.Sprintf("%s:%s", bucket, objPrefix) + fmt.Fprintf(os.Stderr, "\nLoading %d objects.\n", len(objects.Items)) + + // Load each object into a dataset of the same name (minus any extension). + // A successful insert call will inject the job into our queue for monitoring. + for _, o := range objects.Items { + objectSource.id = tableIdFromObject(o.Name) + objectSource.uri = fmt.Sprintf("gs://%s/%s", o.Bucket, o.Name) + if err = dataset.load(jobset, objectSource); err != nil { + fmt.Fprintln(os.Stderr, err) + } + } + + dataset.monitor(jobset) +} + +// Wraps the BigQuery service and dataset and provides some helper functions. +type bqDataset struct { + project string + id string + bq *bigquery.Service + dataset *bigquery.Dataset + jobsets map[string]*list.List +} + +func newBQDataset(client *http.Client, dsProj string, dsId string) (*bqDataset, + error) { + + service, err := bigquery.New(client) + if err != nil { + return nil, err + } + + return &bqDataset{ + project: dsProj, + id: dsId, + bq: service, + dataset: &bigquery.Dataset{ + DatasetReference: &bigquery.DatasetReference{ + DatasetId: dsId, + ProjectId: dsProj, + }, + }, + jobsets: make(map[string]*list.List), + }, nil +} + +func (ds *bqDataset) insert(existsOK bool) error { + call := ds.bq.Datasets.Insert(ds.project, ds.dataset) + _, err := call.Do() + if err != nil && (!existsOK || !strings.Contains(err.Error(), + DatasetAlreadyExists)) { + return err + } + + return nil +} + +type tableSource struct { + id string + uri string + schema bigquery.TableSchema + maxBadRecords int64 + disposition string +} + +func (ds *bqDataset) load(jobset string, source *tableSource) error { + job := &bigquery.Job{ + Configuration: &bigquery.JobConfiguration{ + Load: &bigquery.JobConfigurationLoad{ + DestinationTable: &bigquery.TableReference{ + DatasetId: ds.dataset.DatasetReference.DatasetId, + ProjectId: ds.project, + TableId: source.id, + }, + MaxBadRecords: source.maxBadRecords, + Schema: &source.schema, + SourceUris: []string{source.uri}, + WriteDisposition: source.disposition, + }, + }, + } + + call := ds.bq.Jobs.Insert(ds.project, job) + job, err := call.Do() + if err != nil { + return err + } + + _, ok := ds.jobsets[jobset] + if !ok { + ds.jobsets[jobset] = list.New() + } + ds.jobsets[jobset].PushBack(job) + + return nil +} + +func (ds *bqDataset) getJob(id string) (*bigquery.Job, error) { + return ds.bq.Jobs.Get(ds.project, id).Do() +} + +func (ds *bqDataset) monitor(jobset string) { + jobq, ok := ds.jobsets[jobset] + if !ok { + return + } + + var backoff float64 = BaseBackoff + pause := func(grow bool) { + if grow { + backoff *= BackoffGrowthFactor + backoff -= (backoff * rand.Float64() * BackoffGrowthDamper) + backoff = math.Min(backoff, MaxBackoff) + fmt.Fprintf(os.Stderr, "[%s] Checking remaining %d jobs...\n", jobset, + 1+jobq.Len()) + } + time.Sleep(time.Duration(backoff) * time.Millisecond) + } + var stats jobStats + + // Track a 'head' pending job in queue for detecting cycling. + head := "" + // Loop until all jobs are done - with either success or error. + for jobq.Len() > 0 { + jel := jobq.Front() + job := jel.Value.(*bigquery.Job) + jobq.Remove(jel) + jid := job.JobReference.JobId + loop := false + + // Check and possibly pick a new head job id. + if len(head) == 0 { + head = jid + } else { + if jid == head { + loop = true + } + } + + // Retrieve the job's current status. + pause(loop) + j, err := ds.getJob(jid) + if err != nil { + fmt.Fprintln(os.Stderr, err) + // In this case of a transient API error, we want keep the job. + if j == nil { + jobq.PushBack(job) + } else { + // Must reset head tracker if job is discarded. + if loop { + head = "" + backoff = BaseBackoff + } + } + continue + } + + // Reassign with the updated job data (from Get). + // We don't use j here as Get might return nil for this value. + job = j + + if job.Status.State != JobStatusDone { + jobq.PushBack(job) + continue + } + + if res := job.Status.ErrorResult; res != nil { + fmt.Fprintln(os.Stderr, res.Message) + } else { + stat := job.Statistics + lstat := stat.Load + stats.files += 1 + stats.bytesIn += lstat.InputFileBytes + stats.bytesOut += lstat.OutputBytes + stats.rows += lstat.OutputRows + stats.elapsed += + time.Duration(stat.EndTime-stat.StartTime) * time.Millisecond + + if stats.start.IsZero() { + stats.start = time.Unix(stat.StartTime/1000, 0) + } else { + t := time.Unix(stat.StartTime/1000, 0) + if stats.start.Sub(t) > 0 { + stats.start = t + } + } + + if stats.finish.IsZero() { + stats.finish = time.Unix(stat.EndTime/1000, 0) + } else { + t := time.Unix(stat.EndTime/1000, 0) + if t.Sub(stats.finish) > 0 { + stats.finish = t + } + } + } + // When the head job is processed reset the backoff since the loads + // run in BQ in parallel. + if loop { + head = "" + backoff = BaseBackoff + } + } + + fmt.Fprintf(os.Stderr, "%#v\n", stats) +} + +type jobStats struct { + // Number of files (sources) loaded. + files int64 + // Bytes read from source (possibly compressed). + bytesIn int64 + // Bytes loaded into BigQuery (uncompressed). + bytesOut int64 + // Rows loaded into BigQuery. + rows int64 + // Time taken to load source into table. + elapsed time.Duration + // Start time of the job. + start time.Time + // End time of the job. + finish time.Time +} + +func (s jobStats) GoString() string { + return fmt.Sprintf("\n%d files loaded in %v (%v). Size: %.2fGB Rows: %d\n", + s.files, s.finish.Sub(s.start), s.elapsed, float64(s.bytesOut)/GB, + s.rows) +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/examples/compute.go b/third_party/src/code.google.com/p/google-api-go-client/examples/compute.go new file mode 100644 index 0000000000000..5ab157a08074d --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/examples/compute.go @@ -0,0 +1,43 @@ +package main + +import ( + "fmt" + "log" + "net/http" + "os" + + compute "code.google.com/p/google-api-go-client/compute/v1beta12" +) + +func init() { + registerDemo("compute", compute.ComputeScope, computeMain) +} + +func computeMain(client *http.Client, argv []string) { + if len(argv) != 2 { + fmt.Fprintln(os.Stderr, "Usage: compute project_id instance_name (to start an instance)") + return + } + + service, _ := compute.New(client) + projectId := argv[0] + instanceName := argv[1] + + prefix := "https://www.googleapis.com/compute/v1beta12/projects/" + projectId + instance := &compute.Instance{ + Name: instanceName, + Description: "compute sample instance", + Zone: prefix + "/zones/us-east-a", + MachineType: prefix + "/machine-types/standard-2-cpu-ephemeral-disk", + NetworkInterfaces: []*compute.NetworkInterface{ + &compute.NetworkInterface{ + AccessConfigs: []*compute.AccessConfig{ + &compute.AccessConfig{Type: "ONE_TO_ONE_NAT"}, + }, + Network: prefix + "/networks/default", + }, + }, + } + op, err := service.Instances.Insert(projectId, instance).Do() + log.Printf("Got compute.Operation, err: %#v, %v", op, err) +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/examples/debug.go b/third_party/src/code.google.com/p/google-api-go-client/examples/debug.go new file mode 100644 index 0000000000000..85b3ddf87cf7c --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/examples/debug.go @@ -0,0 +1,72 @@ +package main + +import ( + "bytes" + "fmt" + "io" + "io/ioutil" + "net/http" + "os" +) + +type logTransport struct { + rt http.RoundTripper +} + +func (t *logTransport) RoundTrip(req *http.Request) (*http.Response, error) { + var buf bytes.Buffer + + os.Stdout.Write([]byte("\n[request]\n")) + if req.Body != nil { + req.Body = ioutil.NopCloser(&readButCopy{req.Body, &buf}) + } + req.Write(os.Stdout) + if req.Body != nil { + req.Body = ioutil.NopCloser(&buf) + } + os.Stdout.Write([]byte("\n[/request]\n")) + + res, err := t.rt.RoundTrip(req) + + fmt.Printf("[response]\n") + if err != nil { + fmt.Printf("ERROR: %v", err) + } else { + body := res.Body + res.Body = nil + res.Write(os.Stdout) + if body != nil { + res.Body = ioutil.NopCloser(&echoAsRead{body}) + } + } + + return res, err +} + +type echoAsRead struct { + src io.Reader +} + +func (r *echoAsRead) Read(p []byte) (int, error) { + n, err := r.src.Read(p) + if n > 0 { + os.Stdout.Write(p[:n]) + } + if err == io.EOF { + fmt.Printf("\n[/response]\n") + } + return n, err +} + +type readButCopy struct { + src io.Reader + dst io.Writer +} + +func (r *readButCopy) Read(p []byte) (int, error) { + n, err := r.src.Read(p) + if n > 0 { + r.dst.Write(p[:n]) + } + return n, err +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/examples/drive.go b/third_party/src/code.google.com/p/google-api-go-client/examples/drive.go new file mode 100644 index 0000000000000..8465d9ff2f7aa --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/examples/drive.go @@ -0,0 +1,31 @@ +package main + +import ( + "fmt" + "log" + "net/http" + "os" + + drive "code.google.com/p/google-api-go-client/drive/v2" +) + +func init() { + registerDemo("drive", drive.DriveScope, driveMain) +} + +func driveMain(client *http.Client, argv []string) { + if len(argv) != 1 { + fmt.Fprintln(os.Stderr, "Usage: drive filename (to upload a file)") + return + } + + service, _ := drive.New(client) + filename := argv[0] + + goFile, err := os.Open(filename) + if err != nil { + log.Fatalf("error opening %q: %v", filename, err) + } + driveFile, err := service.Files.Insert(&drive.File{Title: filename}).Media(goFile).Do() + log.Printf("Got drive.File, err: %#v, %v", driveFile, err) +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/examples/gopher.png b/third_party/src/code.google.com/p/google-api-go-client/examples/gopher.png new file mode 100644 index 0000000000000..4cf1da8969e41 Binary files /dev/null and b/third_party/src/code.google.com/p/google-api-go-client/examples/gopher.png differ diff --git a/third_party/src/code.google.com/p/google-api-go-client/examples/main.go b/third_party/src/code.google.com/p/google-api-go-client/examples/main.go new file mode 100644 index 0000000000000..37b7eeb470d05 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/examples/main.go @@ -0,0 +1,219 @@ +// Copyright 2011 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "encoding/gob" + "errors" + "flag" + "fmt" + "hash/fnv" + "io/ioutil" + "log" + "net/http" + "net/http/httptest" + "net/url" + "os" + "os/exec" + "path/filepath" + "runtime" + "strings" + "time" + + "code.google.com/p/goauth2/oauth" +) + +var config = &oauth.Config{ + ClientId: "", // Set by --clientid or --clientid_file + ClientSecret: "", // Set by --secret or --secret_file + Scope: "", // filled in per-API + AuthURL: "https://accounts.google.com/o/oauth2/auth", + TokenURL: "https://accounts.google.com/o/oauth2/token", +} + +// Flags +var ( + clientId = flag.String("clientid", "", "OAuth Client ID. If non-empty, overrides --clientid_file") + clientIdFile = flag.String("clientid_file", "clientid.dat", + "Name of a file containing just the project's OAuth Client ID from https://code.google.com/apis/console/") + secret = flag.String("secret", "", "OAuth Client Secret. If non-empty, overrides --secret_file") + secretFile = flag.String("secret_file", "clientsecret.dat", + "Name of a file containing just the project's OAuth Client Secret from https://code.google.com/apis/console/") + cacheToken = flag.Bool("cachetoken", true, "cache the OAuth token") + debug = flag.Bool("debug", false, "show HTTP traffic") +) + +func usage() { + fmt.Fprintf(os.Stderr, "Usage: go-api-demo [api name args]\n\nPossible APIs:\n\n") + for n, _ := range demoFunc { + fmt.Fprintf(os.Stderr, " * %s\n", n) + } + os.Exit(2) +} + +func main() { + flag.Parse() + if flag.NArg() == 0 { + usage() + } + + name := flag.Arg(0) + demo, ok := demoFunc[name] + if !ok { + usage() + } + + config.Scope = demoScope[name] + config.ClientId = valueOrFileContents(*clientId, *clientIdFile) + config.ClientSecret = valueOrFileContents(*secret, *secretFile) + + c := getOAuthClient(config) + demo(c, flag.Args()[1:]) +} + +var ( + demoFunc = make(map[string]func(*http.Client, []string)) + demoScope = make(map[string]string) +) + +func registerDemo(name, scope string, main func(c *http.Client, argv []string)) { + if demoFunc[name] != nil { + panic(name + " already registered") + } + demoFunc[name] = main + demoScope[name] = scope +} + +func osUserCacheDir() string { + switch runtime.GOOS { + case "darwin": + return filepath.Join(os.Getenv("HOME"), "Library", "Caches") + case "linux", "freebsd": + return filepath.Join(os.Getenv("HOME"), ".cache") + } + log.Printf("TODO: osUserCacheDir on GOOS %q", runtime.GOOS) + return "." +} + +func tokenCacheFile(config *oauth.Config) string { + hash := fnv.New32a() + hash.Write([]byte(config.ClientId)) + hash.Write([]byte(config.ClientSecret)) + hash.Write([]byte(config.Scope)) + fn := fmt.Sprintf("go-api-demo-tok%v", hash.Sum32()) + return filepath.Join(osUserCacheDir(), url.QueryEscape(fn)) +} + +func tokenFromFile(file string) (*oauth.Token, error) { + if !*cacheToken { + return nil, errors.New("--cachetoken is false") + } + f, err := os.Open(file) + if err != nil { + return nil, err + } + t := new(oauth.Token) + err = gob.NewDecoder(f).Decode(t) + return t, err +} + +func saveToken(file string, token *oauth.Token) { + f, err := os.Create(file) + if err != nil { + log.Printf("Warning: failed to cache oauth token: %v", err) + return + } + defer f.Close() + gob.NewEncoder(f).Encode(token) +} + +func condDebugTransport(rt http.RoundTripper) http.RoundTripper { + if *debug { + return &logTransport{rt} + } + return rt +} + +func getOAuthClient(config *oauth.Config) *http.Client { + cacheFile := tokenCacheFile(config) + token, err := tokenFromFile(cacheFile) + if err != nil { + token = tokenFromWeb(config) + saveToken(cacheFile, token) + } else { + log.Printf("Using cached token %#v from %q", token, cacheFile) + } + + t := &oauth.Transport{ + Token: token, + Config: config, + Transport: condDebugTransport(http.DefaultTransport), + } + return t.Client() +} + +func tokenFromWeb(config *oauth.Config) *oauth.Token { + ch := make(chan string) + randState := fmt.Sprintf("st%d", time.Now().UnixNano()) + ts := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { + if req.URL.Path == "/favicon.ico" { + http.Error(rw, "", 404) + return + } + if req.FormValue("state") != randState { + log.Printf("State doesn't match: req = %#v", req) + http.Error(rw, "", 500) + return + } + if code := req.FormValue("code"); code != "" { + fmt.Fprintf(rw, "

Success

Authorized.") + rw.(http.Flusher).Flush() + ch <- code + return + } + log.Printf("no code") + http.Error(rw, "", 500) + })) + defer ts.Close() + + config.RedirectURL = ts.URL + authUrl := config.AuthCodeURL(randState) + go openUrl(authUrl) + log.Printf("Authorize this app at: %s", authUrl) + code := <-ch + log.Printf("Got code: %s", code) + + t := &oauth.Transport{ + Config: config, + Transport: condDebugTransport(http.DefaultTransport), + } + _, err := t.Exchange(code) + if err != nil { + log.Fatalf("Token exchange error: %v", err) + } + return t.Token +} + +func openUrl(url string) { + try := []string{"xdg-open", "google-chrome", "open"} + for _, bin := range try { + err := exec.Command(bin, url).Run() + if err == nil { + return + } + } + log.Printf("Error opening URL in browser.") +} + +func valueOrFileContents(value string, filename string) string { + if value != "" { + return value + } + slurp, err := ioutil.ReadFile(filename) + if err != nil { + log.Fatalf("Error reading %q: %v", filename, err) + } + return strings.TrimSpace(string(slurp)) +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/examples/orkut.go b/third_party/src/code.google.com/p/google-api-go-client/examples/orkut.go new file mode 100644 index 0000000000000..6fcecfb265f55 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/examples/orkut.go @@ -0,0 +1,36 @@ +package main + +import ( + "log" + "net/http" + + orkut "code.google.com/p/google-api-go-client/orkut/v2" +) + +func init() { + registerDemo("orkut", orkut.OrkutScope, orkutMain) +} + +func orkutMain(client *http.Client, argv []string) { + orkutapi, _ := orkut.New(client) + myBadges, err := orkutapi.Badges.List("me").Do() + if err != nil { + log.Println(err) + return + } + + log.Println("Listing my badges") + for _, badge := range myBadges.Items { + log.Printf("Got badge %v", badge.Caption) + } + + myStream, err := orkutapi.Activities.List("me", "stream").Do() + if err != nil { + log.Println(err) + return + } + log.Println("Showing my activity stream") + for _, activity := range myStream.Items { + log.Printf("Actor: %v; Content: %v", activity.Actor.DisplayName, activity.Object.Content) + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/examples/prediction.go b/third_party/src/code.google.com/p/google-api-go-client/examples/prediction.go new file mode 100644 index 0000000000000..99eb5c5da0ea3 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/examples/prediction.go @@ -0,0 +1,137 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "log" + "net/http" + "os" + "path/filepath" + "strings" + + "code.google.com/p/google-api-go-client/googleapi" + prediction "code.google.com/p/google-api-go-client/prediction/v1.6" +) + +func init() { + scopes := []string{ + prediction.DevstorageFull_controlScope, + prediction.DevstorageRead_onlyScope, + prediction.DevstorageRead_writeScope, + prediction.PredictionScope, + } + registerDemo("prediction", strings.Join(scopes, " "), predictionMain) +} + +type predictionType struct { + api *prediction.Service + projectNumber string + bucketName string + trainingFileName string + modelName string +} + +// This example demonstrates calling the Prediction API. +// Training data is uploaded to a pre-created Google Cloud Storage Bucket and +// then the Prediction API is called to train a model based on that data. +// After a few minutes, the model should be completely trained and ready +// for prediction. At that point, text is sent to the model and the Prediction +// API attempts to classify the data, and the results are printed out. +// +// To get started, follow the instructions found in the "Hello Prediction!" +// Getting Started Guide located here: +// https://developers.google.com/prediction/docs/hello_world +// +// Example usage: +// go-api-demo -clientid="my-clientid" -secret="my-secret" prediction +// my-project-number my-bucket-name my-training-filename my-model-name +// +// Example output: +// Predict result: language=Spanish +// English Score: 0.000000 +// French Score: 0.000000 +// Spanish Score: 1.000000 +// analyze: output feature text=&{157 English} +// analyze: output feature text=&{149 French} +// analyze: output feature text=&{100 Spanish} +// feature text count=406 +func predictionMain(client *http.Client, argv []string) { + if len(argv) != 4 { + fmt.Fprintln(os.Stderr, + "Usage: prediction project_number bucket training_data model_name") + return + } + + api, err := prediction.New(client) + if err != nil { + log.Fatalf("unable to create prediction API client: %v", err) + } + + t := &predictionType{ + api: api, + projectNumber: argv[0], + bucketName: argv[1], + trainingFileName: argv[2], + modelName: argv[3], + } + + t.trainModel() + t.predictModel() +} + +func (t *predictionType) trainModel() { + // First, check to see if our trained model already exists. + res, err := t.api.Trainedmodels.Get(t.projectNumber, t.modelName).Do() + if err != nil { + if ae, ok := err.(*googleapi.Error); ok && ae.Code != http.StatusNotFound { + log.Fatalf("error getting trained model: %v", err) + } + log.Printf("Training model not found, creating new model.") + res, err = t.api.Trainedmodels.Insert(t.projectNumber, &prediction.Insert{ + Id: t.modelName, + StorageDataLocation: filepath.Join(t.bucketName, t.trainingFileName), + }).Do() + if err != nil { + log.Fatalf("unable to create trained model: %v", err) + } + } + if res.TrainingStatus != "DONE" { + // Wait for the trained model to finish training. + fmt.Printf("Training model. Please wait and re-run program after a few minutes.") + os.Exit(0) + } +} + +func (t *predictionType) predictModel() { + // Model has now been trained. Predict with it. + input := &prediction.Input{ + &prediction.InputInput{ + []interface{}{ + "Hola, con quien hablo", + }, + }, + } + res, err := t.api.Trainedmodels.Predict(t.projectNumber, t.modelName, input).Do() + if err != nil { + log.Fatalf("unable to get trained prediction: %v", err) + } + fmt.Printf("Predict result: language=%v\n", res.OutputLabel) + for _, m := range res.OutputMulti { + fmt.Printf("%v Score: %v\n", m.Label, m.Score) + } + + // Now analyze the model. + an, err := t.api.Trainedmodels.Analyze(t.projectNumber, t.modelName).Do() + if err != nil { + log.Fatalf("unable to analyze trained model: %v", err) + } + for _, f := range an.DataDescription.OutputFeature.Text { + fmt.Printf("analyze: output feature text=%v\n", f) + } + for _, f := range an.DataDescription.Features { + fmt.Printf("feature text count=%v\n", f.Text.Count) + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/examples/storage.go b/third_party/src/code.google.com/p/google-api-go-client/examples/storage.go new file mode 100644 index 0000000000000..0f898e7fe1025 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/examples/storage.go @@ -0,0 +1,32 @@ +package main + +import ( + "fmt" + "log" + "net/http" + "os" + + storage "code.google.com/p/google-api-go-client/storage/v1beta1" +) + +func init() { + registerDemo("storage", storage.DevstorageRead_writeScope, storageMain) +} + +func storageMain(client *http.Client, argv []string) { + if len(argv) != 2 { + fmt.Fprintln(os.Stderr, "Usage: storage filename bucket (to upload an object)") + return + } + + service, _ := storage.New(client) + filename := argv[0] + bucket := argv[1] + + goFile, err := os.Open(filename) + if err != nil { + log.Fatalf("error opening %q: %v", filename, err) + } + storageObject, err := service.Objects.Insert(bucket, &storage.Object{Name: filename}).Media(goFile).Do() + log.Printf("Got storage.Object, err: %#v, %v", storageObject, err) +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/examples/tasks.go b/third_party/src/code.google.com/p/google-api-go-client/examples/tasks.go new file mode 100644 index 0000000000000..c648531cf8582 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/examples/tasks.go @@ -0,0 +1,22 @@ +package main + +import ( + "log" + "net/http" + + tasks "code.google.com/p/google-api-go-client/tasks/v1" +) + +func init() { + registerDemo("tasks", tasks.TasksScope, tasksMain) +} + +func tasksMain(client *http.Client, argv []string) { + taskapi, _ := tasks.New(client) + task, err := taskapi.Tasks.Insert("@default", &tasks.Task{ + Title: "finish this API code generator thing", + Notes: "ummmm", + Due: "2011-10-15T12:00:00.000Z", + }).Do() + log.Printf("Got task, err: %#v, %v", task, err) +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/examples/urlshortener.go b/third_party/src/code.google.com/p/google-api-go-client/examples/urlshortener.go new file mode 100644 index 0000000000000..47b338d993a52 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/examples/urlshortener.go @@ -0,0 +1,46 @@ +package main + +import ( + "fmt" + "log" + "net/http" + "os" + "strings" + + urlshortener "code.google.com/p/google-api-go-client/urlshortener/v1" +) + +func init() { + registerDemo("urlshortener", urlshortener.UrlshortenerScope, urlShortenerMain) +} + +func urlShortenerMain(client *http.Client, argv []string) { + if len(argv) != 1 { + fmt.Fprintf(os.Stderr, "Usage: urlshortener http://goo.gl/xxxxx (to look up details)\n") + fmt.Fprintf(os.Stderr, " urlshortener http://example.com/long (to shorten)\n") + return + } + + svc, _ := urlshortener.New(client) + urlstr := argv[0] + + // short -> long + if strings.HasPrefix(urlstr, "http://goo.gl/") || strings.HasPrefix(urlstr, "https://goo.gl/") { + url, err := svc.Url.Get(urlstr).Do() + if err != nil { + log.Fatalf("URL Get: %v", err) + } + fmt.Printf("Lookup of %s: %s\n", urlstr, url.LongUrl) + return + } + + // long -> short + url, err := svc.Url.Insert(&urlshortener.Url{ + Kind: "urlshortener#url", // Not really needed + LongUrl: urlstr, + }).Do() + if err != nil { + log.Fatalf("URL Insert: %v", err) + } + fmt.Printf("Shortened %s => %s\n", urlstr, url.Id) +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/freebase/v1-sandbox/freebase-api.json b/third_party/src/code.google.com/p/google-api-go-client/freebase/v1-sandbox/freebase-api.json new file mode 100644 index 0000000000000..73d9304235eeb --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/freebase/v1-sandbox/freebase-api.json @@ -0,0 +1,411 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/U99ZyknsLQRi0oWob1lL-8fNevE\"", + "discoveryVersion": "v1", + "id": "freebase:v1-sandbox", + "name": "freebase", + "version": "v1-sandbox", + "title": "Freebase Search", + "description": "Find Freebase entities using textual queries and other constraints.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/freebase-16.png", + "x32": "http://www.google.com/images/icons/product/freebase-32.png" + }, + "documentationLink": "https://developers.google.com/freebase/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/freebase/v1-sandbox/", + "basePath": "/freebase/v1-sandbox/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "freebase/v1-sandbox/", + "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" + } + }, + "schemas": { + "ReconcileCandidate": { + "id": "ReconcileCandidate", + "type": "object", + "properties": { + "confidence": { + "type": "number", + "description": "Percentage likelihood that this candidate is the unique matching entity. Value will be between 0.0 and 1.0", + "format": "float" + }, + "lang": { + "type": "string", + "description": "Language code that candidate and notable names are displayed in." + }, + "mid": { + "type": "string", + "description": "Freebase MID of candidate entity." + }, + "name": { + "type": "string", + "description": "Freebase name of matching entity in specified language." + }, + "notable": { + "type": "object", + "description": "Type or profession the candidate is notable for.", + "properties": { + "id": { + "type": "string", + "description": "MID of notable category." + }, + "name": { + "type": "string", + "description": "Name of notable category in specified language." + } + } + } + } + }, + "ReconcileGet": { + "id": "ReconcileGet", + "type": "object", + "properties": { + "candidate": { + "type": "array", + "description": "If filled, then the listed candidates are potential matches, and such should be evaluated by a more discerning algorithm or human. The matches are ordered by confidence.", + "items": { + "$ref": "ReconcileCandidate" + } + }, + "costs": { + "type": "object", + "description": "Server costs for reconciling.", + "properties": { + "hits": { + "type": "integer", + "description": "Total number of hits found.", + "format": "int32" + }, + "ms": { + "type": "integer", + "description": "Total milliseconds spent.", + "format": "int32" + } + } + }, + "match": { + "$ref": "ReconcileCandidate", + "description": "If filled, this entity is guaranteed to match at requested confidence probability (default 99%)." + }, + "warning": { + "type": "array", + "description": "If filled, then there were recoverable problems that affected the request. For example, some of the properties were ignored because they either are not valid Freebase predicates or are not indexed for reconciliation. The candidates returned should be considered valid results, with the caveat that sections of the request were ignored as specified by the warning text.", + "items": { + "type": "object", + "properties": { + "location": { + "type": "string", + "description": "Location of warning in the request e.g. invalid predicate." + }, + "message": { + "type": "string", + "description": "Warning message to display to the user." + }, + "reason": { + "type": "string", + "description": "Code for identifying classes of warnings." + } + } + } + } + } + } + }, + "methods": { + "reconcile": { + "id": "freebase.reconcile", + "path": "reconcile", + "httpMethod": "GET", + "description": "Reconcile entities to Freebase open data.", + "parameters": { + "confidence": { + "type": "number", + "description": "Required confidence for a candidate to match. Must be between .5 and 1.0", + "default": "0.99", + "format": "float", + "minimum": "0.0", + "maximum": "1.0", + "location": "query" + }, + "kind": { + "type": "string", + "description": "Classifications of entity e.g. type, category, title.", + "repeated": true, + "location": "query" + }, + "lang": { + "type": "string", + "description": "Languages for names and values. First language is used for display. Default is 'en'.", + "repeated": true, + "location": "query" + }, + "limit": { + "type": "integer", + "description": "Maximum number of candidates to return.", + "default": "3", + "format": "int32", + "minimum": "0", + "maximum": "25", + "location": "query" + }, + "name": { + "type": "string", + "description": "Name of entity.", + "location": "query" + }, + "prop": { + "type": "string", + "description": "Property values for entity formatted as\n:", + "repeated": true, + "location": "query" + } + }, + "response": { + "$ref": "ReconcileGet" + } + }, + "search": { + "id": "freebase.search", + "path": "search", + "httpMethod": "GET", + "description": "Search Freebase open data.", + "parameters": { + "as_of_time": { + "type": "string", + "description": "A mql as_of_time value to use with mql_output queries.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JS method name for JSONP callbacks.", + "pattern": "([A-Za-z0-9_$.]|\\[|\\])+", + "location": "query" + }, + "cursor": { + "type": "integer", + "description": "The cursor value to use for the next page of results.", + "format": "int32", + "location": "query" + }, + "domain": { + "type": "string", + "description": "Restrict to topics with this Freebase domain id.", + "repeated": true, + "location": "query" + }, + "encode": { + "type": "string", + "description": "The encoding of the response. You can use this parameter to enable html encoding.", + "default": "off", + "enum": [ + "html", + "off" + ], + "enumDescriptions": [ + "Encode certain characters in the response (such as tags and ambersands) using html encoding.", + "No encoding of the response. You should not print the results directly on an web page without html-escaping the content first." + ], + "location": "query" + }, + "exact": { + "type": "boolean", + "description": "Query on exact name and keys only.", + "location": "query" + }, + "filter": { + "type": "string", + "description": "A filter to apply to the query.", + "pattern": "^\\(.*\\)$", + "repeated": true, + "location": "query" + }, + "format": { + "type": "string", + "description": "Structural format of the json response.", + "default": "entity", + "enum": [ + "ac", + "classic", + "entity", + "guids", + "ids", + "mids" + ], + "enumDescriptions": [ + "Compact format useful for autocomplete/suggest UIs.", + "[DEPRECATED] Same format as was returned by api.freebase.com.", + "Basic information about the entities.", + "[DEPRECATED] Ordered list of a freebase guids.", + "Ordered list of freebase ids.", + "Ordered list of freebase mids." + ], + "location": "query" + }, + "help": { + "type": "string", + "description": "The keyword to request help on.", + "enum": [ + "langs", + "mappings", + "predicates" + ], + "enumDescriptions": [ + "The language codes served by the service.", + "The property/path mappings supported by the filter and output request parameters.", + "The predicates and path-terminating properties supported by the filter and output request parameters." + ], + "location": "query" + }, + "indent": { + "type": "boolean", + "description": "Whether to indent the json results or not.", + "location": "query" + }, + "lang": { + "type": "string", + "description": "The code of the language to run the query with. Default is 'en'.", + "repeated": true, + "location": "query" + }, + "limit": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "20", + "format": "int32", + "location": "query" + }, + "mid": { + "type": "string", + "description": "A mid to use instead of a query.", + "pattern": "^/[mgtx]/[0-2][0-9bcdfghjklmnpqrstvwxyz_]{1,24}$", + "repeated": true, + "location": "query" + }, + "mql_output": { + "type": "string", + "description": "The MQL query to run againist the results to extract more data.", + "location": "query" + }, + "output": { + "type": "string", + "description": "An output expression to request data from matches.", + "pattern": "^\\(.*\\)$", + "location": "query" + }, + "prefixed": { + "type": "boolean", + "description": "Prefix match against names and aliases.", + "location": "query" + }, + "query": { + "type": "string", + "description": "Query term to search for.", + "location": "query" + }, + "scoring": { + "type": "string", + "description": "Relevance scoring algorithm to use.", + "default": "entity", + "enum": [ + "entity", + "freebase", + "schema" + ], + "enumDescriptions": [ + "Use freebase and popularity entity ranking.", + "Use freebase entity ranking.", + "Use schema ranking for properties and types." + ], + "location": "query" + }, + "spell": { + "type": "string", + "description": "Request 'did you mean' suggestions", + "default": "no_spelling", + "enum": [ + "always", + "no_results", + "no_spelling" + ], + "enumDescriptions": [ + "Request spelling suggestions for any query at least three characters long.", + "Request spelling suggestions if no results were found.", + "Don't request spelling suggestions." + ], + "location": "query" + }, + "stemmed": { + "type": "boolean", + "description": "Query on stemmed names and aliases. May not be used with prefixed.", + "location": "query" + }, + "type": { + "type": "string", + "description": "Restrict to topics with this Freebase type id.", + "repeated": true, + "location": "query" + }, + "with": { + "type": "string", + "description": "A rule to match against.", + "repeated": true, + "location": "query" + }, + "without": { + "type": "string", + "description": "A rule to not match against.", + "repeated": true, + "location": "query" + } + }, + "supportsMediaDownload": true + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/freebase/v1-sandbox/freebase-gen.go b/third_party/src/code.google.com/p/google-api-go-client/freebase/v1-sandbox/freebase-gen.go new file mode 100644 index 0000000000000..9d439ca057d67 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/freebase/v1-sandbox/freebase-gen.go @@ -0,0 +1,729 @@ +// Package freebase provides access to the Freebase Search. +// +// See https://developers.google.com/freebase/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/freebase/v1-sandbox" +// ... +// freebaseService, err := freebase.New(oauthHttpClient) +package freebase + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "freebase:v1-sandbox" +const apiName = "freebase" +const apiVersion = "v1-sandbox" +const basePath = "https://www.googleapis.com/freebase/v1-sandbox/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL +} + +type ReconcileCandidate struct { + // Confidence: Percentage likelihood that this candidate is the unique + // matching entity. Value will be between 0.0 and 1.0 + Confidence float64 `json:"confidence,omitempty"` + + // Lang: Language code that candidate and notable names are displayed + // in. + Lang string `json:"lang,omitempty"` + + // Mid: Freebase MID of candidate entity. + Mid string `json:"mid,omitempty"` + + // Name: Freebase name of matching entity in specified language. + Name string `json:"name,omitempty"` + + // Notable: Type or profession the candidate is notable for. + Notable *ReconcileCandidateNotable `json:"notable,omitempty"` +} + +type ReconcileCandidateNotable struct { + // Id: MID of notable category. + Id string `json:"id,omitempty"` + + // Name: Name of notable category in specified language. + Name string `json:"name,omitempty"` +} + +type ReconcileGet struct { + // Candidate: If filled, then the listed candidates are potential + // matches, and such should be evaluated by a more discerning algorithm + // or human. The matches are ordered by confidence. + Candidate []*ReconcileCandidate `json:"candidate,omitempty"` + + // Costs: Server costs for reconciling. + Costs *ReconcileGetCosts `json:"costs,omitempty"` + + // Match: If filled, this entity is guaranteed to match at requested + // confidence probability (default 99%). + Match *ReconcileCandidate `json:"match,omitempty"` + + // Warning: If filled, then there were recoverable problems that + // affected the request. For example, some of the properties were + // ignored because they either are not valid Freebase predicates or are + // not indexed for reconciliation. The candidates returned should be + // considered valid results, with the caveat that sections of the + // request were ignored as specified by the warning text. + Warning []*ReconcileGetWarning `json:"warning,omitempty"` +} + +type ReconcileGetCosts struct { + // Hits: Total number of hits found. + Hits int64 `json:"hits,omitempty"` + + // Ms: Total milliseconds spent. + Ms int64 `json:"ms,omitempty"` +} + +type ReconcileGetWarning struct { + // Location: Location of warning in the request e.g. invalid predicate. + Location string `json:"location,omitempty"` + + // Message: Warning message to display to the user. + Message string `json:"message,omitempty"` + + // Reason: Code for identifying classes of warnings. + Reason string `json:"reason,omitempty"` +} + +// method id "freebase.reconcile": + +type ReconcileCall struct { + s *Service + opt_ map[string]interface{} +} + +// Reconcile: Reconcile entities to Freebase open data. +func (s *Service) Reconcile() *ReconcileCall { + c := &ReconcileCall{s: s, opt_: make(map[string]interface{})} + return c +} + +// Confidence sets the optional parameter "confidence": Required +// confidence for a candidate to match. Must be between .5 and 1.0 +func (c *ReconcileCall) Confidence(confidence float64) *ReconcileCall { + c.opt_["confidence"] = confidence + return c +} + +// Kind sets the optional parameter "kind": Classifications of entity +// e.g. type, category, title. +func (c *ReconcileCall) Kind(kind string) *ReconcileCall { + c.opt_["kind"] = kind + return c +} + +// Lang sets the optional parameter "lang": Languages for names and +// values. First language is used for display. Default is 'en'. +func (c *ReconcileCall) Lang(lang string) *ReconcileCall { + c.opt_["lang"] = lang + return c +} + +// Limit sets the optional parameter "limit": Maximum number of +// candidates to return. +func (c *ReconcileCall) Limit(limit int64) *ReconcileCall { + c.opt_["limit"] = limit + return c +} + +// Name sets the optional parameter "name": Name of entity. +func (c *ReconcileCall) Name(name string) *ReconcileCall { + c.opt_["name"] = name + return c +} + +// Prop sets the optional parameter "prop": Property values for entity +// formatted as +// : +func (c *ReconcileCall) Prop(prop string) *ReconcileCall { + c.opt_["prop"] = prop + return c +} + +func (c *ReconcileCall) Do() (*ReconcileGet, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["confidence"]; ok { + params.Set("confidence", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["kind"]; ok { + params.Set("kind", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["lang"]; ok { + params.Set("lang", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["limit"]; ok { + params.Set("limit", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["name"]; ok { + params.Set("name", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["prop"]; ok { + params.Set("prop", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reconcile") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ReconcileGet) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Reconcile entities to Freebase open data.", + // "httpMethod": "GET", + // "id": "freebase.reconcile", + // "parameters": { + // "confidence": { + // "default": "0.99", + // "description": "Required confidence for a candidate to match. Must be between .5 and 1.0", + // "format": "float", + // "location": "query", + // "maximum": "1.0", + // "minimum": "0.0", + // "type": "number" + // }, + // "kind": { + // "description": "Classifications of entity e.g. type, category, title.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "lang": { + // "description": "Languages for names and values. First language is used for display. Default is 'en'.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "limit": { + // "default": "3", + // "description": "Maximum number of candidates to return.", + // "format": "int32", + // "location": "query", + // "maximum": "25", + // "minimum": "0", + // "type": "integer" + // }, + // "name": { + // "description": "Name of entity.", + // "location": "query", + // "type": "string" + // }, + // "prop": { + // "description": "Property values for entity formatted as\n:", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "reconcile", + // "response": { + // "$ref": "ReconcileGet" + // } + // } + +} + +// method id "freebase.search": + +type SearchCall struct { + s *Service + opt_ map[string]interface{} +} + +// Search: Search Freebase open data. +func (s *Service) Search() *SearchCall { + c := &SearchCall{s: s, opt_: make(map[string]interface{})} + return c +} + +// As_of_time sets the optional parameter "as_of_time": A mql as_of_time +// value to use with mql_output queries. +func (c *SearchCall) As_of_time(as_of_time string) *SearchCall { + c.opt_["as_of_time"] = as_of_time + return c +} + +// Callback sets the optional parameter "callback": JS method name for +// JSONP callbacks. +func (c *SearchCall) Callback(callback string) *SearchCall { + c.opt_["callback"] = callback + return c +} + +// Cursor sets the optional parameter "cursor": The cursor value to use +// for the next page of results. +func (c *SearchCall) Cursor(cursor int64) *SearchCall { + c.opt_["cursor"] = cursor + return c +} + +// Domain sets the optional parameter "domain": Restrict to topics with +// this Freebase domain id. +func (c *SearchCall) Domain(domain string) *SearchCall { + c.opt_["domain"] = domain + return c +} + +// Encode sets the optional parameter "encode": The encoding of the +// response. You can use this parameter to enable html encoding. +func (c *SearchCall) Encode(encode string) *SearchCall { + c.opt_["encode"] = encode + return c +} + +// Exact sets the optional parameter "exact": Query on exact name and +// keys only. +func (c *SearchCall) Exact(exact bool) *SearchCall { + c.opt_["exact"] = exact + return c +} + +// Filter sets the optional parameter "filter": A filter to apply to the +// query. +func (c *SearchCall) Filter(filter string) *SearchCall { + c.opt_["filter"] = filter + return c +} + +// Format sets the optional parameter "format": Structural format of the +// json response. +func (c *SearchCall) Format(format string) *SearchCall { + c.opt_["format"] = format + return c +} + +// Help sets the optional parameter "help": The keyword to request help +// on. +func (c *SearchCall) Help(help string) *SearchCall { + c.opt_["help"] = help + return c +} + +// Indent sets the optional parameter "indent": Whether to indent the +// json results or not. +func (c *SearchCall) Indent(indent bool) *SearchCall { + c.opt_["indent"] = indent + return c +} + +// Lang sets the optional parameter "lang": The code of the language to +// run the query with. Default is 'en'. +func (c *SearchCall) Lang(lang string) *SearchCall { + c.opt_["lang"] = lang + return c +} + +// Limit sets the optional parameter "limit": Maximum number of results +// to return. +func (c *SearchCall) Limit(limit int64) *SearchCall { + c.opt_["limit"] = limit + return c +} + +// Mid sets the optional parameter "mid": A mid to use instead of a +// query. +func (c *SearchCall) Mid(mid string) *SearchCall { + c.opt_["mid"] = mid + return c +} + +// Mql_output sets the optional parameter "mql_output": The MQL query to +// run againist the results to extract more data. +func (c *SearchCall) Mql_output(mql_output string) *SearchCall { + c.opt_["mql_output"] = mql_output + return c +} + +// Output sets the optional parameter "output": An output expression to +// request data from matches. +func (c *SearchCall) Output(output string) *SearchCall { + c.opt_["output"] = output + return c +} + +// Prefixed sets the optional parameter "prefixed": Prefix match against +// names and aliases. +func (c *SearchCall) Prefixed(prefixed bool) *SearchCall { + c.opt_["prefixed"] = prefixed + return c +} + +// Query sets the optional parameter "query": Query term to search for. +func (c *SearchCall) Query(query string) *SearchCall { + c.opt_["query"] = query + return c +} + +// Scoring sets the optional parameter "scoring": Relevance scoring +// algorithm to use. +func (c *SearchCall) Scoring(scoring string) *SearchCall { + c.opt_["scoring"] = scoring + return c +} + +// Spell sets the optional parameter "spell": Request 'did you mean' +// suggestions +func (c *SearchCall) Spell(spell string) *SearchCall { + c.opt_["spell"] = spell + return c +} + +// Stemmed sets the optional parameter "stemmed": Query on stemmed names +// and aliases. May not be used with prefixed. +func (c *SearchCall) Stemmed(stemmed bool) *SearchCall { + c.opt_["stemmed"] = stemmed + return c +} + +// Type sets the optional parameter "type": Restrict to topics with this +// Freebase type id. +func (c *SearchCall) Type(type_ string) *SearchCall { + c.opt_["type"] = type_ + return c +} + +// With sets the optional parameter "with": A rule to match against. +func (c *SearchCall) With(with string) *SearchCall { + c.opt_["with"] = with + return c +} + +// Without sets the optional parameter "without": A rule to not match +// against. +func (c *SearchCall) Without(without string) *SearchCall { + c.opt_["without"] = without + return c +} + +func (c *SearchCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["as_of_time"]; ok { + params.Set("as_of_time", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["callback"]; ok { + params.Set("callback", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["cursor"]; ok { + params.Set("cursor", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["domain"]; ok { + params.Set("domain", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["encode"]; ok { + params.Set("encode", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["exact"]; ok { + params.Set("exact", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["format"]; ok { + params.Set("format", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["help"]; ok { + params.Set("help", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["indent"]; ok { + params.Set("indent", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["lang"]; ok { + params.Set("lang", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["limit"]; ok { + params.Set("limit", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["mid"]; ok { + params.Set("mid", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["mql_output"]; ok { + params.Set("mql_output", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["output"]; ok { + params.Set("output", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["prefixed"]; ok { + params.Set("prefixed", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["query"]; ok { + params.Set("query", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["scoring"]; ok { + params.Set("scoring", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["spell"]; ok { + params.Set("spell", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["stemmed"]; ok { + params.Set("stemmed", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["type"]; ok { + params.Set("type", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["with"]; ok { + params.Set("with", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["without"]; ok { + params.Set("without", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "search") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Search Freebase open data.", + // "httpMethod": "GET", + // "id": "freebase.search", + // "parameters": { + // "as_of_time": { + // "description": "A mql as_of_time value to use with mql_output queries.", + // "location": "query", + // "type": "string" + // }, + // "callback": { + // "description": "JS method name for JSONP callbacks.", + // "location": "query", + // "pattern": "([A-Za-z0-9_$.]|\\[|\\])+", + // "type": "string" + // }, + // "cursor": { + // "description": "The cursor value to use for the next page of results.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "domain": { + // "description": "Restrict to topics with this Freebase domain id.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "encode": { + // "default": "off", + // "description": "The encoding of the response. You can use this parameter to enable html encoding.", + // "enum": [ + // "html", + // "off" + // ], + // "enumDescriptions": [ + // "Encode certain characters in the response (such as tags and ambersands) using html encoding.", + // "No encoding of the response. You should not print the results directly on an web page without html-escaping the content first." + // ], + // "location": "query", + // "type": "string" + // }, + // "exact": { + // "description": "Query on exact name and keys only.", + // "location": "query", + // "type": "boolean" + // }, + // "filter": { + // "description": "A filter to apply to the query.", + // "location": "query", + // "pattern": "^\\(.*\\)$", + // "repeated": true, + // "type": "string" + // }, + // "format": { + // "default": "entity", + // "description": "Structural format of the json response.", + // "enum": [ + // "ac", + // "classic", + // "entity", + // "guids", + // "ids", + // "mids" + // ], + // "enumDescriptions": [ + // "Compact format useful for autocomplete/suggest UIs.", + // "[DEPRECATED] Same format as was returned by api.freebase.com.", + // "Basic information about the entities.", + // "[DEPRECATED] Ordered list of a freebase guids.", + // "Ordered list of freebase ids.", + // "Ordered list of freebase mids." + // ], + // "location": "query", + // "type": "string" + // }, + // "help": { + // "description": "The keyword to request help on.", + // "enum": [ + // "langs", + // "mappings", + // "predicates" + // ], + // "enumDescriptions": [ + // "The language codes served by the service.", + // "The property/path mappings supported by the filter and output request parameters.", + // "The predicates and path-terminating properties supported by the filter and output request parameters." + // ], + // "location": "query", + // "type": "string" + // }, + // "indent": { + // "description": "Whether to indent the json results or not.", + // "location": "query", + // "type": "boolean" + // }, + // "lang": { + // "description": "The code of the language to run the query with. Default is 'en'.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "limit": { + // "default": "20", + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "mid": { + // "description": "A mid to use instead of a query.", + // "location": "query", + // "pattern": "^/[mgtx]/[0-2][0-9bcdfghjklmnpqrstvwxyz_]{1,24}$", + // "repeated": true, + // "type": "string" + // }, + // "mql_output": { + // "description": "The MQL query to run againist the results to extract more data.", + // "location": "query", + // "type": "string" + // }, + // "output": { + // "description": "An output expression to request data from matches.", + // "location": "query", + // "pattern": "^\\(.*\\)$", + // "type": "string" + // }, + // "prefixed": { + // "description": "Prefix match against names and aliases.", + // "location": "query", + // "type": "boolean" + // }, + // "query": { + // "description": "Query term to search for.", + // "location": "query", + // "type": "string" + // }, + // "scoring": { + // "default": "entity", + // "description": "Relevance scoring algorithm to use.", + // "enum": [ + // "entity", + // "freebase", + // "schema" + // ], + // "enumDescriptions": [ + // "Use freebase and popularity entity ranking.", + // "Use freebase entity ranking.", + // "Use schema ranking for properties and types." + // ], + // "location": "query", + // "type": "string" + // }, + // "spell": { + // "default": "no_spelling", + // "description": "Request 'did you mean' suggestions", + // "enum": [ + // "always", + // "no_results", + // "no_spelling" + // ], + // "enumDescriptions": [ + // "Request spelling suggestions for any query at least three characters long.", + // "Request spelling suggestions if no results were found.", + // "Don't request spelling suggestions." + // ], + // "location": "query", + // "type": "string" + // }, + // "stemmed": { + // "description": "Query on stemmed names and aliases. May not be used with prefixed.", + // "location": "query", + // "type": "boolean" + // }, + // "type": { + // "description": "Restrict to topics with this Freebase type id.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "with": { + // "description": "A rule to match against.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "without": { + // "description": "A rule to not match against.", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "search", + // "supportsMediaDownload": true + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/freebase/v1/freebase-api.json b/third_party/src/code.google.com/p/google-api-go-client/freebase/v1/freebase-api.json new file mode 100644 index 0000000000000..f2e45acb9f2ff --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/freebase/v1/freebase-api.json @@ -0,0 +1,411 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/jrWF9ZghWXSXmX56XJpkx2_G8NU\"", + "discoveryVersion": "v1", + "id": "freebase:v1", + "name": "freebase", + "version": "v1", + "title": "Freebase Search", + "description": "Find Freebase entities using textual queries and other constraints.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/freebase-16.png", + "x32": "http://www.google.com/images/icons/product/freebase-32.png" + }, + "documentationLink": "https://developers.google.com/freebase/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/freebase/v1/", + "basePath": "/freebase/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "freebase/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" + } + }, + "schemas": { + "ReconcileCandidate": { + "id": "ReconcileCandidate", + "type": "object", + "properties": { + "confidence": { + "type": "number", + "description": "Percentage likelihood that this candidate is the unique matching entity. Value will be between 0.0 and 1.0", + "format": "float" + }, + "lang": { + "type": "string", + "description": "Language code that candidate and notable names are displayed in." + }, + "mid": { + "type": "string", + "description": "Freebase MID of candidate entity." + }, + "name": { + "type": "string", + "description": "Freebase name of matching entity in specified language." + }, + "notable": { + "type": "object", + "description": "Type or profession the candidate is notable for.", + "properties": { + "id": { + "type": "string", + "description": "MID of notable category." + }, + "name": { + "type": "string", + "description": "Name of notable category in specified language." + } + } + } + } + }, + "ReconcileGet": { + "id": "ReconcileGet", + "type": "object", + "properties": { + "candidate": { + "type": "array", + "description": "If filled, then the listed candidates are potential matches, and such should be evaluated by a more discerning algorithm or human. The matches are ordered by confidence.", + "items": { + "$ref": "ReconcileCandidate" + } + }, + "costs": { + "type": "object", + "description": "Server costs for reconciling.", + "properties": { + "hits": { + "type": "integer", + "description": "Total number of hits found.", + "format": "int32" + }, + "ms": { + "type": "integer", + "description": "Total milliseconds spent.", + "format": "int32" + } + } + }, + "match": { + "$ref": "ReconcileCandidate", + "description": "If filled, this entity is guaranteed to match at requested confidence probability (default 99%)." + }, + "warning": { + "type": "array", + "description": "If filled, then there were recoverable problems that affected the request. For example, some of the properties were ignored because they either are not valid Freebase predicates or are not indexed for reconciliation. The candidates returned should be considered valid results, with the caveat that sections of the request were ignored as specified by the warning text.", + "items": { + "type": "object", + "properties": { + "location": { + "type": "string", + "description": "Location of warning in the request e.g. invalid predicate." + }, + "message": { + "type": "string", + "description": "Warning message to display to the user." + }, + "reason": { + "type": "string", + "description": "Code for identifying classes of warnings." + } + } + } + } + } + } + }, + "methods": { + "reconcile": { + "id": "freebase.reconcile", + "path": "reconcile", + "httpMethod": "GET", + "description": "Reconcile entities to Freebase open data.", + "parameters": { + "confidence": { + "type": "number", + "description": "Required confidence for a candidate to match. Must be between .5 and 1.0", + "default": "0.99", + "format": "float", + "minimum": "0.0", + "maximum": "1.0", + "location": "query" + }, + "kind": { + "type": "string", + "description": "Classifications of entity e.g. type, category, title.", + "repeated": true, + "location": "query" + }, + "lang": { + "type": "string", + "description": "Languages for names and values. First language is used for display. Default is 'en'.", + "repeated": true, + "location": "query" + }, + "limit": { + "type": "integer", + "description": "Maximum number of candidates to return.", + "default": "3", + "format": "int32", + "minimum": "0", + "maximum": "25", + "location": "query" + }, + "name": { + "type": "string", + "description": "Name of entity.", + "location": "query" + }, + "prop": { + "type": "string", + "description": "Property values for entity formatted as\n:", + "repeated": true, + "location": "query" + } + }, + "response": { + "$ref": "ReconcileGet" + } + }, + "search": { + "id": "freebase.search", + "path": "search", + "httpMethod": "GET", + "description": "Search Freebase open data.", + "parameters": { + "as_of_time": { + "type": "string", + "description": "A mql as_of_time value to use with mql_output queries.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JS method name for JSONP callbacks.", + "pattern": "([A-Za-z0-9_$.]|\\[|\\])+", + "location": "query" + }, + "cursor": { + "type": "integer", + "description": "The cursor value to use for the next page of results.", + "format": "int32", + "location": "query" + }, + "domain": { + "type": "string", + "description": "Restrict to topics with this Freebase domain id.", + "repeated": true, + "location": "query" + }, + "encode": { + "type": "string", + "description": "The encoding of the response. You can use this parameter to enable html encoding.", + "default": "off", + "enum": [ + "html", + "off" + ], + "enumDescriptions": [ + "Encode certain characters in the response (such as tags and ambersands) using html encoding.", + "No encoding of the response. You should not print the results directly on an web page without html-escaping the content first." + ], + "location": "query" + }, + "exact": { + "type": "boolean", + "description": "Query on exact name and keys only.", + "location": "query" + }, + "filter": { + "type": "string", + "description": "A filter to apply to the query.", + "pattern": "^\\(.*\\)$", + "repeated": true, + "location": "query" + }, + "format": { + "type": "string", + "description": "Structural format of the json response.", + "default": "entity", + "enum": [ + "ac", + "classic", + "entity", + "guids", + "ids", + "mids" + ], + "enumDescriptions": [ + "Compact format useful for autocomplete/suggest UIs.", + "[DEPRECATED] Same format as was returned by api.freebase.com.", + "Basic information about the entities.", + "[DEPRECATED] Ordered list of a freebase guids.", + "Ordered list of freebase ids.", + "Ordered list of freebase mids." + ], + "location": "query" + }, + "help": { + "type": "string", + "description": "The keyword to request help on.", + "enum": [ + "langs", + "mappings", + "predicates" + ], + "enumDescriptions": [ + "The language codes served by the service.", + "The property/path mappings supported by the filter and output request parameters.", + "The predicates and path-terminating properties supported by the filter and output request parameters." + ], + "location": "query" + }, + "indent": { + "type": "boolean", + "description": "Whether to indent the json results or not.", + "location": "query" + }, + "lang": { + "type": "string", + "description": "The code of the language to run the query with. Default is 'en'.", + "repeated": true, + "location": "query" + }, + "limit": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "20", + "format": "int32", + "location": "query" + }, + "mid": { + "type": "string", + "description": "A mid to use instead of a query.", + "pattern": "^/[mgtx]/[0-2][0-9bcdfghjklmnpqrstvwxyz_]{1,24}$", + "repeated": true, + "location": "query" + }, + "mql_output": { + "type": "string", + "description": "The MQL query to run againist the results to extract more data.", + "location": "query" + }, + "output": { + "type": "string", + "description": "An output expression to request data from matches.", + "pattern": "^\\(.*\\)$", + "location": "query" + }, + "prefixed": { + "type": "boolean", + "description": "Prefix match against names and aliases.", + "location": "query" + }, + "query": { + "type": "string", + "description": "Query term to search for.", + "location": "query" + }, + "scoring": { + "type": "string", + "description": "Relevance scoring algorithm to use.", + "default": "entity", + "enum": [ + "entity", + "freebase", + "schema" + ], + "enumDescriptions": [ + "Use freebase and popularity entity ranking.", + "Use freebase entity ranking.", + "Use schema ranking for properties and types." + ], + "location": "query" + }, + "spell": { + "type": "string", + "description": "Request 'did you mean' suggestions", + "default": "no_spelling", + "enum": [ + "always", + "no_results", + "no_spelling" + ], + "enumDescriptions": [ + "Request spelling suggestions for any query at least three characters long.", + "Request spelling suggestions if no results were found.", + "Don't request spelling suggestions." + ], + "location": "query" + }, + "stemmed": { + "type": "boolean", + "description": "Query on stemmed names and aliases. May not be used with prefixed.", + "location": "query" + }, + "type": { + "type": "string", + "description": "Restrict to topics with this Freebase type id.", + "repeated": true, + "location": "query" + }, + "with": { + "type": "string", + "description": "A rule to match against.", + "repeated": true, + "location": "query" + }, + "without": { + "type": "string", + "description": "A rule to not match against.", + "repeated": true, + "location": "query" + } + }, + "supportsMediaDownload": true + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/freebase/v1/freebase-gen.go b/third_party/src/code.google.com/p/google-api-go-client/freebase/v1/freebase-gen.go new file mode 100644 index 0000000000000..e1dcdf0d3ab25 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/freebase/v1/freebase-gen.go @@ -0,0 +1,729 @@ +// Package freebase provides access to the Freebase Search. +// +// See https://developers.google.com/freebase/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/freebase/v1" +// ... +// freebaseService, err := freebase.New(oauthHttpClient) +package freebase + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "freebase:v1" +const apiName = "freebase" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/freebase/v1/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL +} + +type ReconcileCandidate struct { + // Confidence: Percentage likelihood that this candidate is the unique + // matching entity. Value will be between 0.0 and 1.0 + Confidence float64 `json:"confidence,omitempty"` + + // Lang: Language code that candidate and notable names are displayed + // in. + Lang string `json:"lang,omitempty"` + + // Mid: Freebase MID of candidate entity. + Mid string `json:"mid,omitempty"` + + // Name: Freebase name of matching entity in specified language. + Name string `json:"name,omitempty"` + + // Notable: Type or profession the candidate is notable for. + Notable *ReconcileCandidateNotable `json:"notable,omitempty"` +} + +type ReconcileCandidateNotable struct { + // Id: MID of notable category. + Id string `json:"id,omitempty"` + + // Name: Name of notable category in specified language. + Name string `json:"name,omitempty"` +} + +type ReconcileGet struct { + // Candidate: If filled, then the listed candidates are potential + // matches, and such should be evaluated by a more discerning algorithm + // or human. The matches are ordered by confidence. + Candidate []*ReconcileCandidate `json:"candidate,omitempty"` + + // Costs: Server costs for reconciling. + Costs *ReconcileGetCosts `json:"costs,omitempty"` + + // Match: If filled, this entity is guaranteed to match at requested + // confidence probability (default 99%). + Match *ReconcileCandidate `json:"match,omitempty"` + + // Warning: If filled, then there were recoverable problems that + // affected the request. For example, some of the properties were + // ignored because they either are not valid Freebase predicates or are + // not indexed for reconciliation. The candidates returned should be + // considered valid results, with the caveat that sections of the + // request were ignored as specified by the warning text. + Warning []*ReconcileGetWarning `json:"warning,omitempty"` +} + +type ReconcileGetCosts struct { + // Hits: Total number of hits found. + Hits int64 `json:"hits,omitempty"` + + // Ms: Total milliseconds spent. + Ms int64 `json:"ms,omitempty"` +} + +type ReconcileGetWarning struct { + // Location: Location of warning in the request e.g. invalid predicate. + Location string `json:"location,omitempty"` + + // Message: Warning message to display to the user. + Message string `json:"message,omitempty"` + + // Reason: Code for identifying classes of warnings. + Reason string `json:"reason,omitempty"` +} + +// method id "freebase.reconcile": + +type ReconcileCall struct { + s *Service + opt_ map[string]interface{} +} + +// Reconcile: Reconcile entities to Freebase open data. +func (s *Service) Reconcile() *ReconcileCall { + c := &ReconcileCall{s: s, opt_: make(map[string]interface{})} + return c +} + +// Confidence sets the optional parameter "confidence": Required +// confidence for a candidate to match. Must be between .5 and 1.0 +func (c *ReconcileCall) Confidence(confidence float64) *ReconcileCall { + c.opt_["confidence"] = confidence + return c +} + +// Kind sets the optional parameter "kind": Classifications of entity +// e.g. type, category, title. +func (c *ReconcileCall) Kind(kind string) *ReconcileCall { + c.opt_["kind"] = kind + return c +} + +// Lang sets the optional parameter "lang": Languages for names and +// values. First language is used for display. Default is 'en'. +func (c *ReconcileCall) Lang(lang string) *ReconcileCall { + c.opt_["lang"] = lang + return c +} + +// Limit sets the optional parameter "limit": Maximum number of +// candidates to return. +func (c *ReconcileCall) Limit(limit int64) *ReconcileCall { + c.opt_["limit"] = limit + return c +} + +// Name sets the optional parameter "name": Name of entity. +func (c *ReconcileCall) Name(name string) *ReconcileCall { + c.opt_["name"] = name + return c +} + +// Prop sets the optional parameter "prop": Property values for entity +// formatted as +// : +func (c *ReconcileCall) Prop(prop string) *ReconcileCall { + c.opt_["prop"] = prop + return c +} + +func (c *ReconcileCall) Do() (*ReconcileGet, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["confidence"]; ok { + params.Set("confidence", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["kind"]; ok { + params.Set("kind", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["lang"]; ok { + params.Set("lang", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["limit"]; ok { + params.Set("limit", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["name"]; ok { + params.Set("name", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["prop"]; ok { + params.Set("prop", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reconcile") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ReconcileGet) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Reconcile entities to Freebase open data.", + // "httpMethod": "GET", + // "id": "freebase.reconcile", + // "parameters": { + // "confidence": { + // "default": "0.99", + // "description": "Required confidence for a candidate to match. Must be between .5 and 1.0", + // "format": "float", + // "location": "query", + // "maximum": "1.0", + // "minimum": "0.0", + // "type": "number" + // }, + // "kind": { + // "description": "Classifications of entity e.g. type, category, title.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "lang": { + // "description": "Languages for names and values. First language is used for display. Default is 'en'.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "limit": { + // "default": "3", + // "description": "Maximum number of candidates to return.", + // "format": "int32", + // "location": "query", + // "maximum": "25", + // "minimum": "0", + // "type": "integer" + // }, + // "name": { + // "description": "Name of entity.", + // "location": "query", + // "type": "string" + // }, + // "prop": { + // "description": "Property values for entity formatted as\n:", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "reconcile", + // "response": { + // "$ref": "ReconcileGet" + // } + // } + +} + +// method id "freebase.search": + +type SearchCall struct { + s *Service + opt_ map[string]interface{} +} + +// Search: Search Freebase open data. +func (s *Service) Search() *SearchCall { + c := &SearchCall{s: s, opt_: make(map[string]interface{})} + return c +} + +// As_of_time sets the optional parameter "as_of_time": A mql as_of_time +// value to use with mql_output queries. +func (c *SearchCall) As_of_time(as_of_time string) *SearchCall { + c.opt_["as_of_time"] = as_of_time + return c +} + +// Callback sets the optional parameter "callback": JS method name for +// JSONP callbacks. +func (c *SearchCall) Callback(callback string) *SearchCall { + c.opt_["callback"] = callback + return c +} + +// Cursor sets the optional parameter "cursor": The cursor value to use +// for the next page of results. +func (c *SearchCall) Cursor(cursor int64) *SearchCall { + c.opt_["cursor"] = cursor + return c +} + +// Domain sets the optional parameter "domain": Restrict to topics with +// this Freebase domain id. +func (c *SearchCall) Domain(domain string) *SearchCall { + c.opt_["domain"] = domain + return c +} + +// Encode sets the optional parameter "encode": The encoding of the +// response. You can use this parameter to enable html encoding. +func (c *SearchCall) Encode(encode string) *SearchCall { + c.opt_["encode"] = encode + return c +} + +// Exact sets the optional parameter "exact": Query on exact name and +// keys only. +func (c *SearchCall) Exact(exact bool) *SearchCall { + c.opt_["exact"] = exact + return c +} + +// Filter sets the optional parameter "filter": A filter to apply to the +// query. +func (c *SearchCall) Filter(filter string) *SearchCall { + c.opt_["filter"] = filter + return c +} + +// Format sets the optional parameter "format": Structural format of the +// json response. +func (c *SearchCall) Format(format string) *SearchCall { + c.opt_["format"] = format + return c +} + +// Help sets the optional parameter "help": The keyword to request help +// on. +func (c *SearchCall) Help(help string) *SearchCall { + c.opt_["help"] = help + return c +} + +// Indent sets the optional parameter "indent": Whether to indent the +// json results or not. +func (c *SearchCall) Indent(indent bool) *SearchCall { + c.opt_["indent"] = indent + return c +} + +// Lang sets the optional parameter "lang": The code of the language to +// run the query with. Default is 'en'. +func (c *SearchCall) Lang(lang string) *SearchCall { + c.opt_["lang"] = lang + return c +} + +// Limit sets the optional parameter "limit": Maximum number of results +// to return. +func (c *SearchCall) Limit(limit int64) *SearchCall { + c.opt_["limit"] = limit + return c +} + +// Mid sets the optional parameter "mid": A mid to use instead of a +// query. +func (c *SearchCall) Mid(mid string) *SearchCall { + c.opt_["mid"] = mid + return c +} + +// Mql_output sets the optional parameter "mql_output": The MQL query to +// run againist the results to extract more data. +func (c *SearchCall) Mql_output(mql_output string) *SearchCall { + c.opt_["mql_output"] = mql_output + return c +} + +// Output sets the optional parameter "output": An output expression to +// request data from matches. +func (c *SearchCall) Output(output string) *SearchCall { + c.opt_["output"] = output + return c +} + +// Prefixed sets the optional parameter "prefixed": Prefix match against +// names and aliases. +func (c *SearchCall) Prefixed(prefixed bool) *SearchCall { + c.opt_["prefixed"] = prefixed + return c +} + +// Query sets the optional parameter "query": Query term to search for. +func (c *SearchCall) Query(query string) *SearchCall { + c.opt_["query"] = query + return c +} + +// Scoring sets the optional parameter "scoring": Relevance scoring +// algorithm to use. +func (c *SearchCall) Scoring(scoring string) *SearchCall { + c.opt_["scoring"] = scoring + return c +} + +// Spell sets the optional parameter "spell": Request 'did you mean' +// suggestions +func (c *SearchCall) Spell(spell string) *SearchCall { + c.opt_["spell"] = spell + return c +} + +// Stemmed sets the optional parameter "stemmed": Query on stemmed names +// and aliases. May not be used with prefixed. +func (c *SearchCall) Stemmed(stemmed bool) *SearchCall { + c.opt_["stemmed"] = stemmed + return c +} + +// Type sets the optional parameter "type": Restrict to topics with this +// Freebase type id. +func (c *SearchCall) Type(type_ string) *SearchCall { + c.opt_["type"] = type_ + return c +} + +// With sets the optional parameter "with": A rule to match against. +func (c *SearchCall) With(with string) *SearchCall { + c.opt_["with"] = with + return c +} + +// Without sets the optional parameter "without": A rule to not match +// against. +func (c *SearchCall) Without(without string) *SearchCall { + c.opt_["without"] = without + return c +} + +func (c *SearchCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["as_of_time"]; ok { + params.Set("as_of_time", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["callback"]; ok { + params.Set("callback", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["cursor"]; ok { + params.Set("cursor", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["domain"]; ok { + params.Set("domain", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["encode"]; ok { + params.Set("encode", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["exact"]; ok { + params.Set("exact", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["format"]; ok { + params.Set("format", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["help"]; ok { + params.Set("help", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["indent"]; ok { + params.Set("indent", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["lang"]; ok { + params.Set("lang", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["limit"]; ok { + params.Set("limit", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["mid"]; ok { + params.Set("mid", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["mql_output"]; ok { + params.Set("mql_output", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["output"]; ok { + params.Set("output", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["prefixed"]; ok { + params.Set("prefixed", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["query"]; ok { + params.Set("query", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["scoring"]; ok { + params.Set("scoring", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["spell"]; ok { + params.Set("spell", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["stemmed"]; ok { + params.Set("stemmed", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["type"]; ok { + params.Set("type", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["with"]; ok { + params.Set("with", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["without"]; ok { + params.Set("without", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "search") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Search Freebase open data.", + // "httpMethod": "GET", + // "id": "freebase.search", + // "parameters": { + // "as_of_time": { + // "description": "A mql as_of_time value to use with mql_output queries.", + // "location": "query", + // "type": "string" + // }, + // "callback": { + // "description": "JS method name for JSONP callbacks.", + // "location": "query", + // "pattern": "([A-Za-z0-9_$.]|\\[|\\])+", + // "type": "string" + // }, + // "cursor": { + // "description": "The cursor value to use for the next page of results.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "domain": { + // "description": "Restrict to topics with this Freebase domain id.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "encode": { + // "default": "off", + // "description": "The encoding of the response. You can use this parameter to enable html encoding.", + // "enum": [ + // "html", + // "off" + // ], + // "enumDescriptions": [ + // "Encode certain characters in the response (such as tags and ambersands) using html encoding.", + // "No encoding of the response. You should not print the results directly on an web page without html-escaping the content first." + // ], + // "location": "query", + // "type": "string" + // }, + // "exact": { + // "description": "Query on exact name and keys only.", + // "location": "query", + // "type": "boolean" + // }, + // "filter": { + // "description": "A filter to apply to the query.", + // "location": "query", + // "pattern": "^\\(.*\\)$", + // "repeated": true, + // "type": "string" + // }, + // "format": { + // "default": "entity", + // "description": "Structural format of the json response.", + // "enum": [ + // "ac", + // "classic", + // "entity", + // "guids", + // "ids", + // "mids" + // ], + // "enumDescriptions": [ + // "Compact format useful for autocomplete/suggest UIs.", + // "[DEPRECATED] Same format as was returned by api.freebase.com.", + // "Basic information about the entities.", + // "[DEPRECATED] Ordered list of a freebase guids.", + // "Ordered list of freebase ids.", + // "Ordered list of freebase mids." + // ], + // "location": "query", + // "type": "string" + // }, + // "help": { + // "description": "The keyword to request help on.", + // "enum": [ + // "langs", + // "mappings", + // "predicates" + // ], + // "enumDescriptions": [ + // "The language codes served by the service.", + // "The property/path mappings supported by the filter and output request parameters.", + // "The predicates and path-terminating properties supported by the filter and output request parameters." + // ], + // "location": "query", + // "type": "string" + // }, + // "indent": { + // "description": "Whether to indent the json results or not.", + // "location": "query", + // "type": "boolean" + // }, + // "lang": { + // "description": "The code of the language to run the query with. Default is 'en'.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "limit": { + // "default": "20", + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "mid": { + // "description": "A mid to use instead of a query.", + // "location": "query", + // "pattern": "^/[mgtx]/[0-2][0-9bcdfghjklmnpqrstvwxyz_]{1,24}$", + // "repeated": true, + // "type": "string" + // }, + // "mql_output": { + // "description": "The MQL query to run againist the results to extract more data.", + // "location": "query", + // "type": "string" + // }, + // "output": { + // "description": "An output expression to request data from matches.", + // "location": "query", + // "pattern": "^\\(.*\\)$", + // "type": "string" + // }, + // "prefixed": { + // "description": "Prefix match against names and aliases.", + // "location": "query", + // "type": "boolean" + // }, + // "query": { + // "description": "Query term to search for.", + // "location": "query", + // "type": "string" + // }, + // "scoring": { + // "default": "entity", + // "description": "Relevance scoring algorithm to use.", + // "enum": [ + // "entity", + // "freebase", + // "schema" + // ], + // "enumDescriptions": [ + // "Use freebase and popularity entity ranking.", + // "Use freebase entity ranking.", + // "Use schema ranking for properties and types." + // ], + // "location": "query", + // "type": "string" + // }, + // "spell": { + // "default": "no_spelling", + // "description": "Request 'did you mean' suggestions", + // "enum": [ + // "always", + // "no_results", + // "no_spelling" + // ], + // "enumDescriptions": [ + // "Request spelling suggestions for any query at least three characters long.", + // "Request spelling suggestions if no results were found.", + // "Don't request spelling suggestions." + // ], + // "location": "query", + // "type": "string" + // }, + // "stemmed": { + // "description": "Query on stemmed names and aliases. May not be used with prefixed.", + // "location": "query", + // "type": "boolean" + // }, + // "type": { + // "description": "Restrict to topics with this Freebase type id.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "with": { + // "description": "A rule to match against.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "without": { + // "description": "A rule to not match against.", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "search", + // "supportsMediaDownload": true + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/freebase/v1sandbox/freebase-api.json b/third_party/src/code.google.com/p/google-api-go-client/freebase/v1sandbox/freebase-api.json new file mode 100644 index 0000000000000..790465359b7a8 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/freebase/v1sandbox/freebase-api.json @@ -0,0 +1,411 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/8YSaj7jxmSfjsRrYtwnK2dHVPrQ\"", + "discoveryVersion": "v1", + "id": "freebase:v1sandbox", + "name": "freebase", + "version": "v1sandbox", + "title": "Freebase Search", + "description": "Find Freebase entities using textual queries and other constraints.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/freebase-16.png", + "x32": "http://www.google.com/images/icons/product/freebase-32.png" + }, + "documentationLink": "https://developers.google.com/freebase/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/freebase/v1sandbox/", + "basePath": "/freebase/v1sandbox/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "freebase/v1sandbox/", + "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" + } + }, + "schemas": { + "ReconcileCandidate": { + "id": "ReconcileCandidate", + "type": "object", + "properties": { + "confidence": { + "type": "number", + "description": "Percentage likelihood that this candidate is the unique matching entity. Value will be between 0.0 and 1.0", + "format": "float" + }, + "lang": { + "type": "string", + "description": "Language code that candidate and notable names are displayed in." + }, + "mid": { + "type": "string", + "description": "Freebase MID of candidate entity." + }, + "name": { + "type": "string", + "description": "Freebase name of matching entity in specified language." + }, + "notable": { + "type": "object", + "description": "Type or profession the candidate is notable for.", + "properties": { + "id": { + "type": "string", + "description": "MID of notable category." + }, + "name": { + "type": "string", + "description": "Name of notable category in specified language." + } + } + } + } + }, + "ReconcileGet": { + "id": "ReconcileGet", + "type": "object", + "properties": { + "candidate": { + "type": "array", + "description": "If filled, then the listed candidates are potential matches, and such should be evaluated by a more discerning algorithm or human. The matches are ordered by confidence.", + "items": { + "$ref": "ReconcileCandidate" + } + }, + "costs": { + "type": "object", + "description": "Server costs for reconciling.", + "properties": { + "hits": { + "type": "integer", + "description": "Total number of hits found.", + "format": "int32" + }, + "ms": { + "type": "integer", + "description": "Total milliseconds spent.", + "format": "int32" + } + } + }, + "match": { + "$ref": "ReconcileCandidate", + "description": "If filled, this entity is guaranteed to match at requested confidence probability (default 99%)." + }, + "warning": { + "type": "array", + "description": "If filled, then there were recoverable problems that affected the request. For example, some of the properties were ignored because they either are not valid Freebase predicates or are not indexed for reconciliation. The candidates returned should be considered valid results, with the caveat that sections of the request were ignored as specified by the warning text.", + "items": { + "type": "object", + "properties": { + "location": { + "type": "string", + "description": "Location of warning in the request e.g. invalid predicate." + }, + "message": { + "type": "string", + "description": "Warning message to display to the user." + }, + "reason": { + "type": "string", + "description": "Code for identifying classes of warnings." + } + } + } + } + } + } + }, + "methods": { + "reconcile": { + "id": "freebase.reconcile", + "path": "reconcile", + "httpMethod": "GET", + "description": "Reconcile entities to Freebase open data.", + "parameters": { + "confidence": { + "type": "number", + "description": "Required confidence for a candidate to match. Must be between .5 and 1.0", + "default": "0.99", + "format": "float", + "minimum": "0.0", + "maximum": "1.0", + "location": "query" + }, + "kind": { + "type": "string", + "description": "Classifications of entity e.g. type, category, title.", + "repeated": true, + "location": "query" + }, + "lang": { + "type": "string", + "description": "Languages for names and values. First language is used for display. Default is 'en'.", + "repeated": true, + "location": "query" + }, + "limit": { + "type": "integer", + "description": "Maximum number of candidates to return.", + "default": "3", + "format": "int32", + "minimum": "0", + "maximum": "25", + "location": "query" + }, + "name": { + "type": "string", + "description": "Name of entity.", + "location": "query" + }, + "prop": { + "type": "string", + "description": "Property values for entity formatted as\n:", + "repeated": true, + "location": "query" + } + }, + "response": { + "$ref": "ReconcileGet" + } + }, + "search": { + "id": "freebase.search", + "path": "search", + "httpMethod": "GET", + "description": "Search Freebase open data.", + "parameters": { + "as_of_time": { + "type": "string", + "description": "A mql as_of_time value to use with mql_output queries.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JS method name for JSONP callbacks.", + "pattern": "([A-Za-z0-9_$.]|\\[|\\])+", + "location": "query" + }, + "cursor": { + "type": "integer", + "description": "The cursor value to use for the next page of results.", + "format": "int32", + "location": "query" + }, + "domain": { + "type": "string", + "description": "Restrict to topics with this Freebase domain id.", + "repeated": true, + "location": "query" + }, + "encode": { + "type": "string", + "description": "The encoding of the response. You can use this parameter to enable html encoding.", + "default": "off", + "enum": [ + "html", + "off" + ], + "enumDescriptions": [ + "Encode certain characters in the response (such as tags and ambersands) using html encoding.", + "No encoding of the response. You should not print the results directly on an web page without html-escaping the content first." + ], + "location": "query" + }, + "exact": { + "type": "boolean", + "description": "Query on exact name and keys only.", + "location": "query" + }, + "filter": { + "type": "string", + "description": "A filter to apply to the query.", + "pattern": "^\\(.*\\)$", + "repeated": true, + "location": "query" + }, + "format": { + "type": "string", + "description": "Structural format of the json response.", + "default": "entity", + "enum": [ + "ac", + "classic", + "entity", + "guids", + "ids", + "mids" + ], + "enumDescriptions": [ + "Compact format useful for autocomplete/suggest UIs.", + "[DEPRECATED] Same format as was returned by api.freebase.com.", + "Basic information about the entities.", + "[DEPRECATED] Ordered list of a freebase guids.", + "Ordered list of freebase ids.", + "Ordered list of freebase mids." + ], + "location": "query" + }, + "help": { + "type": "string", + "description": "The keyword to request help on.", + "enum": [ + "langs", + "mappings", + "predicates" + ], + "enumDescriptions": [ + "The language codes served by the service.", + "The property/path mappings supported by the filter and output request parameters.", + "The predicates and path-terminating properties supported by the filter and output request parameters." + ], + "location": "query" + }, + "indent": { + "type": "boolean", + "description": "Whether to indent the json results or not.", + "location": "query" + }, + "lang": { + "type": "string", + "description": "The code of the language to run the query with. Default is 'en'.", + "repeated": true, + "location": "query" + }, + "limit": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "20", + "format": "int32", + "location": "query" + }, + "mid": { + "type": "string", + "description": "A mid to use instead of a query.", + "pattern": "^/[mgtx]/[0-2][0-9bcdfghjklmnpqrstvwxyz_]{1,24}$", + "repeated": true, + "location": "query" + }, + "mql_output": { + "type": "string", + "description": "The MQL query to run againist the results to extract more data.", + "location": "query" + }, + "output": { + "type": "string", + "description": "An output expression to request data from matches.", + "pattern": "^\\(.*\\)$", + "location": "query" + }, + "prefixed": { + "type": "boolean", + "description": "Prefix match against names and aliases.", + "location": "query" + }, + "query": { + "type": "string", + "description": "Query term to search for.", + "location": "query" + }, + "scoring": { + "type": "string", + "description": "Relevance scoring algorithm to use.", + "default": "entity", + "enum": [ + "entity", + "freebase", + "schema" + ], + "enumDescriptions": [ + "Use freebase and popularity entity ranking.", + "Use freebase entity ranking.", + "Use schema ranking for properties and types." + ], + "location": "query" + }, + "spell": { + "type": "string", + "description": "Request 'did you mean' suggestions", + "default": "no_spelling", + "enum": [ + "always", + "no_results", + "no_spelling" + ], + "enumDescriptions": [ + "Request spelling suggestions for any query at least three characters long.", + "Request spelling suggestions if no results were found.", + "Don't request spelling suggestions." + ], + "location": "query" + }, + "stemmed": { + "type": "boolean", + "description": "Query on stemmed names and aliases. May not be used with prefixed.", + "location": "query" + }, + "type": { + "type": "string", + "description": "Restrict to topics with this Freebase type id.", + "repeated": true, + "location": "query" + }, + "with": { + "type": "string", + "description": "A rule to match against.", + "repeated": true, + "location": "query" + }, + "without": { + "type": "string", + "description": "A rule to not match against.", + "repeated": true, + "location": "query" + } + }, + "supportsMediaDownload": true + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/freebase/v1sandbox/freebase-gen.go b/third_party/src/code.google.com/p/google-api-go-client/freebase/v1sandbox/freebase-gen.go new file mode 100644 index 0000000000000..348528956fb02 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/freebase/v1sandbox/freebase-gen.go @@ -0,0 +1,729 @@ +// Package freebase provides access to the Freebase Search. +// +// See https://developers.google.com/freebase/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/freebase/v1sandbox" +// ... +// freebaseService, err := freebase.New(oauthHttpClient) +package freebase + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "freebase:v1sandbox" +const apiName = "freebase" +const apiVersion = "v1sandbox" +const basePath = "https://www.googleapis.com/freebase/v1sandbox/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL +} + +type ReconcileCandidate struct { + // Confidence: Percentage likelihood that this candidate is the unique + // matching entity. Value will be between 0.0 and 1.0 + Confidence float64 `json:"confidence,omitempty"` + + // Lang: Language code that candidate and notable names are displayed + // in. + Lang string `json:"lang,omitempty"` + + // Mid: Freebase MID of candidate entity. + Mid string `json:"mid,omitempty"` + + // Name: Freebase name of matching entity in specified language. + Name string `json:"name,omitempty"` + + // Notable: Type or profession the candidate is notable for. + Notable *ReconcileCandidateNotable `json:"notable,omitempty"` +} + +type ReconcileCandidateNotable struct { + // Id: MID of notable category. + Id string `json:"id,omitempty"` + + // Name: Name of notable category in specified language. + Name string `json:"name,omitempty"` +} + +type ReconcileGet struct { + // Candidate: If filled, then the listed candidates are potential + // matches, and such should be evaluated by a more discerning algorithm + // or human. The matches are ordered by confidence. + Candidate []*ReconcileCandidate `json:"candidate,omitempty"` + + // Costs: Server costs for reconciling. + Costs *ReconcileGetCosts `json:"costs,omitempty"` + + // Match: If filled, this entity is guaranteed to match at requested + // confidence probability (default 99%). + Match *ReconcileCandidate `json:"match,omitempty"` + + // Warning: If filled, then there were recoverable problems that + // affected the request. For example, some of the properties were + // ignored because they either are not valid Freebase predicates or are + // not indexed for reconciliation. The candidates returned should be + // considered valid results, with the caveat that sections of the + // request were ignored as specified by the warning text. + Warning []*ReconcileGetWarning `json:"warning,omitempty"` +} + +type ReconcileGetCosts struct { + // Hits: Total number of hits found. + Hits int64 `json:"hits,omitempty"` + + // Ms: Total milliseconds spent. + Ms int64 `json:"ms,omitempty"` +} + +type ReconcileGetWarning struct { + // Location: Location of warning in the request e.g. invalid predicate. + Location string `json:"location,omitempty"` + + // Message: Warning message to display to the user. + Message string `json:"message,omitempty"` + + // Reason: Code for identifying classes of warnings. + Reason string `json:"reason,omitempty"` +} + +// method id "freebase.reconcile": + +type ReconcileCall struct { + s *Service + opt_ map[string]interface{} +} + +// Reconcile: Reconcile entities to Freebase open data. +func (s *Service) Reconcile() *ReconcileCall { + c := &ReconcileCall{s: s, opt_: make(map[string]interface{})} + return c +} + +// Confidence sets the optional parameter "confidence": Required +// confidence for a candidate to match. Must be between .5 and 1.0 +func (c *ReconcileCall) Confidence(confidence float64) *ReconcileCall { + c.opt_["confidence"] = confidence + return c +} + +// Kind sets the optional parameter "kind": Classifications of entity +// e.g. type, category, title. +func (c *ReconcileCall) Kind(kind string) *ReconcileCall { + c.opt_["kind"] = kind + return c +} + +// Lang sets the optional parameter "lang": Languages for names and +// values. First language is used for display. Default is 'en'. +func (c *ReconcileCall) Lang(lang string) *ReconcileCall { + c.opt_["lang"] = lang + return c +} + +// Limit sets the optional parameter "limit": Maximum number of +// candidates to return. +func (c *ReconcileCall) Limit(limit int64) *ReconcileCall { + c.opt_["limit"] = limit + return c +} + +// Name sets the optional parameter "name": Name of entity. +func (c *ReconcileCall) Name(name string) *ReconcileCall { + c.opt_["name"] = name + return c +} + +// Prop sets the optional parameter "prop": Property values for entity +// formatted as +// : +func (c *ReconcileCall) Prop(prop string) *ReconcileCall { + c.opt_["prop"] = prop + return c +} + +func (c *ReconcileCall) Do() (*ReconcileGet, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["confidence"]; ok { + params.Set("confidence", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["kind"]; ok { + params.Set("kind", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["lang"]; ok { + params.Set("lang", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["limit"]; ok { + params.Set("limit", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["name"]; ok { + params.Set("name", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["prop"]; ok { + params.Set("prop", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reconcile") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ReconcileGet) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Reconcile entities to Freebase open data.", + // "httpMethod": "GET", + // "id": "freebase.reconcile", + // "parameters": { + // "confidence": { + // "default": "0.99", + // "description": "Required confidence for a candidate to match. Must be between .5 and 1.0", + // "format": "float", + // "location": "query", + // "maximum": "1.0", + // "minimum": "0.0", + // "type": "number" + // }, + // "kind": { + // "description": "Classifications of entity e.g. type, category, title.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "lang": { + // "description": "Languages for names and values. First language is used for display. Default is 'en'.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "limit": { + // "default": "3", + // "description": "Maximum number of candidates to return.", + // "format": "int32", + // "location": "query", + // "maximum": "25", + // "minimum": "0", + // "type": "integer" + // }, + // "name": { + // "description": "Name of entity.", + // "location": "query", + // "type": "string" + // }, + // "prop": { + // "description": "Property values for entity formatted as\n:", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "reconcile", + // "response": { + // "$ref": "ReconcileGet" + // } + // } + +} + +// method id "freebase.search": + +type SearchCall struct { + s *Service + opt_ map[string]interface{} +} + +// Search: Search Freebase open data. +func (s *Service) Search() *SearchCall { + c := &SearchCall{s: s, opt_: make(map[string]interface{})} + return c +} + +// As_of_time sets the optional parameter "as_of_time": A mql as_of_time +// value to use with mql_output queries. +func (c *SearchCall) As_of_time(as_of_time string) *SearchCall { + c.opt_["as_of_time"] = as_of_time + return c +} + +// Callback sets the optional parameter "callback": JS method name for +// JSONP callbacks. +func (c *SearchCall) Callback(callback string) *SearchCall { + c.opt_["callback"] = callback + return c +} + +// Cursor sets the optional parameter "cursor": The cursor value to use +// for the next page of results. +func (c *SearchCall) Cursor(cursor int64) *SearchCall { + c.opt_["cursor"] = cursor + return c +} + +// Domain sets the optional parameter "domain": Restrict to topics with +// this Freebase domain id. +func (c *SearchCall) Domain(domain string) *SearchCall { + c.opt_["domain"] = domain + return c +} + +// Encode sets the optional parameter "encode": The encoding of the +// response. You can use this parameter to enable html encoding. +func (c *SearchCall) Encode(encode string) *SearchCall { + c.opt_["encode"] = encode + return c +} + +// Exact sets the optional parameter "exact": Query on exact name and +// keys only. +func (c *SearchCall) Exact(exact bool) *SearchCall { + c.opt_["exact"] = exact + return c +} + +// Filter sets the optional parameter "filter": A filter to apply to the +// query. +func (c *SearchCall) Filter(filter string) *SearchCall { + c.opt_["filter"] = filter + return c +} + +// Format sets the optional parameter "format": Structural format of the +// json response. +func (c *SearchCall) Format(format string) *SearchCall { + c.opt_["format"] = format + return c +} + +// Help sets the optional parameter "help": The keyword to request help +// on. +func (c *SearchCall) Help(help string) *SearchCall { + c.opt_["help"] = help + return c +} + +// Indent sets the optional parameter "indent": Whether to indent the +// json results or not. +func (c *SearchCall) Indent(indent bool) *SearchCall { + c.opt_["indent"] = indent + return c +} + +// Lang sets the optional parameter "lang": The code of the language to +// run the query with. Default is 'en'. +func (c *SearchCall) Lang(lang string) *SearchCall { + c.opt_["lang"] = lang + return c +} + +// Limit sets the optional parameter "limit": Maximum number of results +// to return. +func (c *SearchCall) Limit(limit int64) *SearchCall { + c.opt_["limit"] = limit + return c +} + +// Mid sets the optional parameter "mid": A mid to use instead of a +// query. +func (c *SearchCall) Mid(mid string) *SearchCall { + c.opt_["mid"] = mid + return c +} + +// Mql_output sets the optional parameter "mql_output": The MQL query to +// run againist the results to extract more data. +func (c *SearchCall) Mql_output(mql_output string) *SearchCall { + c.opt_["mql_output"] = mql_output + return c +} + +// Output sets the optional parameter "output": An output expression to +// request data from matches. +func (c *SearchCall) Output(output string) *SearchCall { + c.opt_["output"] = output + return c +} + +// Prefixed sets the optional parameter "prefixed": Prefix match against +// names and aliases. +func (c *SearchCall) Prefixed(prefixed bool) *SearchCall { + c.opt_["prefixed"] = prefixed + return c +} + +// Query sets the optional parameter "query": Query term to search for. +func (c *SearchCall) Query(query string) *SearchCall { + c.opt_["query"] = query + return c +} + +// Scoring sets the optional parameter "scoring": Relevance scoring +// algorithm to use. +func (c *SearchCall) Scoring(scoring string) *SearchCall { + c.opt_["scoring"] = scoring + return c +} + +// Spell sets the optional parameter "spell": Request 'did you mean' +// suggestions +func (c *SearchCall) Spell(spell string) *SearchCall { + c.opt_["spell"] = spell + return c +} + +// Stemmed sets the optional parameter "stemmed": Query on stemmed names +// and aliases. May not be used with prefixed. +func (c *SearchCall) Stemmed(stemmed bool) *SearchCall { + c.opt_["stemmed"] = stemmed + return c +} + +// Type sets the optional parameter "type": Restrict to topics with this +// Freebase type id. +func (c *SearchCall) Type(type_ string) *SearchCall { + c.opt_["type"] = type_ + return c +} + +// With sets the optional parameter "with": A rule to match against. +func (c *SearchCall) With(with string) *SearchCall { + c.opt_["with"] = with + return c +} + +// Without sets the optional parameter "without": A rule to not match +// against. +func (c *SearchCall) Without(without string) *SearchCall { + c.opt_["without"] = without + return c +} + +func (c *SearchCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["as_of_time"]; ok { + params.Set("as_of_time", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["callback"]; ok { + params.Set("callback", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["cursor"]; ok { + params.Set("cursor", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["domain"]; ok { + params.Set("domain", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["encode"]; ok { + params.Set("encode", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["exact"]; ok { + params.Set("exact", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["format"]; ok { + params.Set("format", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["help"]; ok { + params.Set("help", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["indent"]; ok { + params.Set("indent", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["lang"]; ok { + params.Set("lang", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["limit"]; ok { + params.Set("limit", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["mid"]; ok { + params.Set("mid", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["mql_output"]; ok { + params.Set("mql_output", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["output"]; ok { + params.Set("output", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["prefixed"]; ok { + params.Set("prefixed", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["query"]; ok { + params.Set("query", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["scoring"]; ok { + params.Set("scoring", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["spell"]; ok { + params.Set("spell", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["stemmed"]; ok { + params.Set("stemmed", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["type"]; ok { + params.Set("type", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["with"]; ok { + params.Set("with", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["without"]; ok { + params.Set("without", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "search") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Search Freebase open data.", + // "httpMethod": "GET", + // "id": "freebase.search", + // "parameters": { + // "as_of_time": { + // "description": "A mql as_of_time value to use with mql_output queries.", + // "location": "query", + // "type": "string" + // }, + // "callback": { + // "description": "JS method name for JSONP callbacks.", + // "location": "query", + // "pattern": "([A-Za-z0-9_$.]|\\[|\\])+", + // "type": "string" + // }, + // "cursor": { + // "description": "The cursor value to use for the next page of results.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "domain": { + // "description": "Restrict to topics with this Freebase domain id.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "encode": { + // "default": "off", + // "description": "The encoding of the response. You can use this parameter to enable html encoding.", + // "enum": [ + // "html", + // "off" + // ], + // "enumDescriptions": [ + // "Encode certain characters in the response (such as tags and ambersands) using html encoding.", + // "No encoding of the response. You should not print the results directly on an web page without html-escaping the content first." + // ], + // "location": "query", + // "type": "string" + // }, + // "exact": { + // "description": "Query on exact name and keys only.", + // "location": "query", + // "type": "boolean" + // }, + // "filter": { + // "description": "A filter to apply to the query.", + // "location": "query", + // "pattern": "^\\(.*\\)$", + // "repeated": true, + // "type": "string" + // }, + // "format": { + // "default": "entity", + // "description": "Structural format of the json response.", + // "enum": [ + // "ac", + // "classic", + // "entity", + // "guids", + // "ids", + // "mids" + // ], + // "enumDescriptions": [ + // "Compact format useful for autocomplete/suggest UIs.", + // "[DEPRECATED] Same format as was returned by api.freebase.com.", + // "Basic information about the entities.", + // "[DEPRECATED] Ordered list of a freebase guids.", + // "Ordered list of freebase ids.", + // "Ordered list of freebase mids." + // ], + // "location": "query", + // "type": "string" + // }, + // "help": { + // "description": "The keyword to request help on.", + // "enum": [ + // "langs", + // "mappings", + // "predicates" + // ], + // "enumDescriptions": [ + // "The language codes served by the service.", + // "The property/path mappings supported by the filter and output request parameters.", + // "The predicates and path-terminating properties supported by the filter and output request parameters." + // ], + // "location": "query", + // "type": "string" + // }, + // "indent": { + // "description": "Whether to indent the json results or not.", + // "location": "query", + // "type": "boolean" + // }, + // "lang": { + // "description": "The code of the language to run the query with. Default is 'en'.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "limit": { + // "default": "20", + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "mid": { + // "description": "A mid to use instead of a query.", + // "location": "query", + // "pattern": "^/[mgtx]/[0-2][0-9bcdfghjklmnpqrstvwxyz_]{1,24}$", + // "repeated": true, + // "type": "string" + // }, + // "mql_output": { + // "description": "The MQL query to run againist the results to extract more data.", + // "location": "query", + // "type": "string" + // }, + // "output": { + // "description": "An output expression to request data from matches.", + // "location": "query", + // "pattern": "^\\(.*\\)$", + // "type": "string" + // }, + // "prefixed": { + // "description": "Prefix match against names and aliases.", + // "location": "query", + // "type": "boolean" + // }, + // "query": { + // "description": "Query term to search for.", + // "location": "query", + // "type": "string" + // }, + // "scoring": { + // "default": "entity", + // "description": "Relevance scoring algorithm to use.", + // "enum": [ + // "entity", + // "freebase", + // "schema" + // ], + // "enumDescriptions": [ + // "Use freebase and popularity entity ranking.", + // "Use freebase entity ranking.", + // "Use schema ranking for properties and types." + // ], + // "location": "query", + // "type": "string" + // }, + // "spell": { + // "default": "no_spelling", + // "description": "Request 'did you mean' suggestions", + // "enum": [ + // "always", + // "no_results", + // "no_spelling" + // ], + // "enumDescriptions": [ + // "Request spelling suggestions for any query at least three characters long.", + // "Request spelling suggestions if no results were found.", + // "Don't request spelling suggestions." + // ], + // "location": "query", + // "type": "string" + // }, + // "stemmed": { + // "description": "Query on stemmed names and aliases. May not be used with prefixed.", + // "location": "query", + // "type": "boolean" + // }, + // "type": { + // "description": "Restrict to topics with this Freebase type id.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "with": { + // "description": "A rule to match against.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "without": { + // "description": "A rule to not match against.", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "search", + // "supportsMediaDownload": true + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/games/v1/games-api.json b/third_party/src/code.google.com/p/google-api-go-client/games/v1/games-api.json new file mode 100644 index 0000000000000..ae49e719ecea5 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/games/v1/games-api.json @@ -0,0 +1,3643 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"5M1WkxnZyJhziV-cW1kdtwscs8E/wBs-qNgKobkZmtJOx0i4cFgYtC8\"", + "discoveryVersion": "v1", + "id": "games:v1", + "name": "games", + "canonicalName": "Games", + "version": "v1", + "title": "Google Play Game Services API", + "description": "The API for Google Play Game Services.", + "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/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/games/v1/", + "basePath": "/games/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "games/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/games": { + "description": "Share your Google+ profile information and view and manage your game activity" + }, + "https://www.googleapis.com/auth/plus.login": { + "description": "Know your basic profile info and list of people in your circles." + } + } + } + }, + "schemas": { + "AchievementDefinition": { + "id": "AchievementDefinition", + "type": "object", + "description": "This is a JSON template for an achievement definition object.", + "properties": { + "achievementType": { + "type": "string", + "description": "The type of the achievement.\nPossible values are: \n- \"STANDARD\" - Achievement is either locked or unlocked. \n- \"INCREMENTAL\" - Achievement is incremental." + }, + "description": { + "type": "string", + "description": "The description of the achievement." + }, + "formattedTotalSteps": { + "type": "string", + "description": "The total steps for an incremental achievement as a string." + }, + "id": { + "type": "string", + "description": "The ID of the achievement." + }, + "initialState": { + "type": "string", + "description": "The initial state of the achievement.\nPossible values are: \n- \"HIDDEN\" - Achievement is hidden. \n- \"REVEALED\" - Achievement is revealed. \n- \"UNLOCKED\" - Achievement is unlocked." + }, + "isRevealedIconUrlDefault": { + "type": "boolean", + "description": "Indicates whether the revealed icon image being returned is a default image, or is provided by the game." + }, + "isUnlockedIconUrlDefault": { + "type": "boolean", + "description": "Indicates whether the unlocked icon image being returned is a default image, or is game-provided." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#achievementDefinition.", + "default": "games#achievementDefinition" + }, + "name": { + "type": "string", + "description": "The name of the achievement." + }, + "revealedIconUrl": { + "type": "string", + "description": "The image URL for the revealed achievement icon." + }, + "totalSteps": { + "type": "integer", + "description": "The total steps for an incremental achievement.", + "format": "int32" + }, + "unlockedIconUrl": { + "type": "string", + "description": "The image URL for the unlocked achievement icon." + } + } + }, + "AchievementDefinitionsListResponse": { + "id": "AchievementDefinitionsListResponse", + "type": "object", + "description": "This is a JSON template for a list of achievement definition objects.", + "properties": { + "items": { + "type": "array", + "description": "The achievement definitions.", + "items": { + "$ref": "AchievementDefinition" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#achievementDefinitionsListResponse.", + "default": "games#achievementDefinitionsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Token corresponding to the next page of results." + } + } + }, + "AchievementIncrementResponse": { + "id": "AchievementIncrementResponse", + "type": "object", + "description": "This is a JSON template for an achievement increment response", + "properties": { + "currentSteps": { + "type": "integer", + "description": "The current steps recorded for this incremental achievement.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#achievementIncrementResponse.", + "default": "games#achievementIncrementResponse" + }, + "newlyUnlocked": { + "type": "boolean", + "description": "Whether the the current steps for the achievement has reached the number of steps required to unlock." + } + } + }, + "AchievementRevealResponse": { + "id": "AchievementRevealResponse", + "type": "object", + "description": "This is a JSON template for an achievement reveal response", + "properties": { + "currentState": { + "type": "string", + "description": "The current state of the achievement for which a reveal was attempted. This might be UNLOCKED if the achievement was already unlocked.\nPossible values are: \n- \"REVEALED\" - Achievement is revealed. \n- \"UNLOCKED\" - Achievement is unlocked." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#achievementRevealResponse.", + "default": "games#achievementRevealResponse" + } + } + }, + "AchievementSetStepsAtLeastResponse": { + "id": "AchievementSetStepsAtLeastResponse", + "type": "object", + "description": "This is a JSON template for an achievement set steps at least response.", + "properties": { + "currentSteps": { + "type": "integer", + "description": "The current steps recorded for this incremental achievement.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#achievementSetStepsAtLeastResponse.", + "default": "games#achievementSetStepsAtLeastResponse" + }, + "newlyUnlocked": { + "type": "boolean", + "description": "Whether the the current steps for the achievement has reached the number of steps required to unlock." + } + } + }, + "AchievementUnlockResponse": { + "id": "AchievementUnlockResponse", + "type": "object", + "description": "This is a JSON template for an achievement unlock response", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUnlockResponse.", + "default": "games#achievementUnlockResponse" + }, + "newlyUnlocked": { + "type": "boolean", + "description": "Whether this achievement was newly unlocked (that is, whether the unlock request for the achievement was the first for the player)." + } + } + }, + "AchievementUpdateMultipleRequest": { + "id": "AchievementUpdateMultipleRequest", + "type": "object", + "description": "This is a JSON template for a list of achievement update requests.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateMultipleRequest.", + "default": "games#achievementUpdateMultipleRequest" + }, + "updates": { + "type": "array", + "description": "The individual achievement update requests.", + "items": { + "$ref": "AchievementUpdateRequest" + } + } + } + }, + "AchievementUpdateMultipleResponse": { + "id": "AchievementUpdateMultipleResponse", + "type": "object", + "description": "This is a JSON template for an achievement unlock response.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateListResponse.", + "default": "games#achievementUpdateMultipleResponse" + }, + "updatedAchievements": { + "type": "array", + "description": "The updated state of the achievements.", + "items": { + "$ref": "AchievementUpdateResponse" + } + } + } + }, + "AchievementUpdateRequest": { + "id": "AchievementUpdateRequest", + "type": "object", + "description": "This is a JSON template for a request to update an achievement.", + "properties": { + "achievementId": { + "type": "string", + "description": "The achievement this update is being applied to." + }, + "incrementPayload": { + "$ref": "GamesAchievementIncrement", + "description": "The payload if an update of type INCREMENT was requested for the achievement." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateRequest.", + "default": "games#achievementUpdateRequest" + }, + "setStepsAtLeastPayload": { + "$ref": "GamesAchievementSetStepsAtLeast", + "description": "The payload if an update of type SET_STEPS_AT_LEAST was requested for the achievement." + }, + "updateType": { + "type": "string", + "description": "The type of update being applied.\nPossible values are: \n- \"REVEAL\" - Achievement is revealed. \n- \"UNLOCK\" - Achievement is unlocked. \n- \"INCREMENT\" - Achievement is incremented. \n- \"SET_STEPS_AT_LEAST\" - Achievement progress is set to at least the passed value." + } + } + }, + "AchievementUpdateResponse": { + "id": "AchievementUpdateResponse", + "type": "object", + "description": "This is a JSON template for an achievement update response.", + "properties": { + "achievementId": { + "type": "string", + "description": "The achievement this update is was applied to." + }, + "currentState": { + "type": "string", + "description": "The current state of the achievement.\nPossible values are: \n- \"HIDDEN\" - Achievement is hidden. \n- \"REVEALED\" - Achievement is revealed. \n- \"UNLOCKED\" - Achievement is unlocked." + }, + "currentSteps": { + "type": "integer", + "description": "The current steps recorded for this achievement if it is incremental.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateResponse.", + "default": "games#achievementUpdateResponse" + }, + "newlyUnlocked": { + "type": "boolean", + "description": "Whether this achievement was newly unlocked (that is, whether the unlock request for the achievement was the first for the player)." + }, + "updateOccurred": { + "type": "boolean", + "description": "Whether the requested updates actually affected the achievement." + } + } + }, + "AggregateStats": { + "id": "AggregateStats", + "type": "object", + "description": "This is a JSON template for aggregate stats.", + "properties": { + "count": { + "type": "string", + "description": "The number of messages sent between a pair of peers.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#aggregateStats.", + "default": "games#aggregateStats" + }, + "max": { + "type": "string", + "description": "The maximum amount.", + "format": "int64" + }, + "min": { + "type": "string", + "description": "The minimum amount.", + "format": "int64" + }, + "sum": { + "type": "string", + "description": "The total number of bytes sent for messages between a pair of peers.", + "format": "int64" + } + } + }, + "AnonymousPlayer": { + "id": "AnonymousPlayer", + "type": "object", + "description": "This is a JSON template for an anonymous player", + "properties": { + "avatarImageUrl": { + "type": "string", + "description": "The base URL for the image to display for the anonymous player." + }, + "displayName": { + "type": "string", + "description": "The name to display for the anonymous player." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#anonymousPlayer.", + "default": "games#anonymousPlayer" + } + } + }, + "Application": { + "id": "Application", + "type": "object", + "description": "This is a JSON template for the Application resource.", + "properties": { + "achievement_count": { + "type": "integer", + "description": "The number of achievements visible to the currently authenticated player.", + "format": "int32" + }, + "assets": { + "type": "array", + "description": "The assets of the application.", + "items": { + "$ref": "ImageAsset" + } + }, + "author": { + "type": "string", + "description": "The author of the application." + }, + "category": { + "$ref": "ApplicationCategory", + "description": "The category of the application." + }, + "description": { + "type": "string", + "description": "The description of the application." + }, + "id": { + "type": "string", + "description": "The ID of the application." + }, + "instances": { + "type": "array", + "description": "The instances of the application.", + "items": { + "$ref": "Instance" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#application.", + "default": "games#application" + }, + "lastUpdatedTimestamp": { + "type": "string", + "description": "The last updated timestamp of the application.", + "format": "int64" + }, + "leaderboard_count": { + "type": "integer", + "description": "The number of leaderboards visible to the currently authenticated player.", + "format": "int32" + }, + "name": { + "type": "string", + "description": "The name of the application." + } + } + }, + "ApplicationCategory": { + "id": "ApplicationCategory", + "type": "object", + "description": "This is a JSON template for an application category object.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#applicationCategory.", + "default": "games#applicationCategory" + }, + "primary": { + "type": "string", + "description": "The primary category." + }, + "secondary": { + "type": "string", + "description": "The secondary category." + } + } + }, + "GamesAchievementIncrement": { + "id": "GamesAchievementIncrement", + "type": "object", + "description": "This is a JSON template for the payload to request to increment an achievement.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#GamesAchievementIncrement.", + "default": "games#GamesAchievementIncrement" + }, + "requestId": { + "type": "string", + "description": "The requestId associated with an increment to an achievement.", + "format": "int64" + }, + "steps": { + "type": "integer", + "description": "The number of steps to be incremented.", + "format": "int32" + } + } + }, + "GamesAchievementSetStepsAtLeast": { + "id": "GamesAchievementSetStepsAtLeast", + "type": "object", + "description": "This is a JSON template for the payload to request to increment an achievement.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#GamesAchievementSetStepsAtLeast.", + "default": "games#GamesAchievementSetStepsAtLeast" + }, + "steps": { + "type": "integer", + "description": "The minimum number of steps for the achievement to be set to.", + "format": "int32" + } + } + }, + "ImageAsset": { + "id": "ImageAsset", + "type": "object", + "description": "This is a JSON template for an image asset object.", + "properties": { + "height": { + "type": "integer", + "description": "The height of the asset.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#imageAsset.", + "default": "games#imageAsset" + }, + "name": { + "type": "string", + "description": "The name of the asset." + }, + "url": { + "type": "string", + "description": "The URL of the asset." + }, + "width": { + "type": "integer", + "description": "The width of the asset.", + "format": "int32" + } + } + }, + "Instance": { + "id": "Instance", + "type": "object", + "description": "This is a JSON template for the Instance resource.", + "properties": { + "acquisitionUri": { + "type": "string", + "description": "URI which shows where a user can acquire this instance." + }, + "androidInstance": { + "$ref": "InstanceAndroidDetails", + "description": "Platform dependent details for Android." + }, + "iosInstance": { + "$ref": "InstanceIosDetails", + "description": "Platform dependent details for iOS." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#instance.", + "default": "games#instance" + }, + "name": { + "type": "string", + "description": "Localized display name." + }, + "platformType": { + "type": "string", + "description": "The platform type.\nPossible values are: \n- \"ANDROID\" - Instance is for Android. \n- \"IOS\" - Instance is for iOS \n- \"WEB_APP\" - Instance is for Web App." + }, + "realtimePlay": { + "type": "boolean", + "description": "Flag to show if this game instance supports realtime play." + }, + "turnBasedPlay": { + "type": "boolean", + "description": "Flag to show if this game instance supports turn based play." + }, + "webInstance": { + "$ref": "InstanceWebDetails", + "description": "Platform dependent details for Web." + } + } + }, + "InstanceAndroidDetails": { + "id": "InstanceAndroidDetails", + "type": "object", + "description": "This is a JSON template for the Android instance details resource.", + "properties": { + "enablePiracyCheck": { + "type": "boolean", + "description": "Flag indicating whether the anti-piracy check is enabled." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#instanceAndroidDetails.", + "default": "games#instanceAndroidDetails" + }, + "packageName": { + "type": "string", + "description": "Android package name which maps to Google Play URL." + }, + "preferred": { + "type": "boolean", + "description": "Indicates that this instance is the default for new installations." + } + } + }, + "InstanceIosDetails": { + "id": "InstanceIosDetails", + "type": "object", + "description": "This is a JSON template for the iOS details resource.", + "properties": { + "bundleIdentifier": { + "type": "string", + "description": "Bundle identifier." + }, + "itunesAppId": { + "type": "string", + "description": "iTunes App ID." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#instanceIosDetails.", + "default": "games#instanceIosDetails" + }, + "preferredForIpad": { + "type": "boolean", + "description": "Indicates that this instance is the default for new installations on iPad devices." + }, + "preferredForIphone": { + "type": "boolean", + "description": "Indicates that this instance is the default for new installations on iPhone devices." + }, + "supportIpad": { + "type": "boolean", + "description": "Flag to indicate if this instance supports iPad." + }, + "supportIphone": { + "type": "boolean", + "description": "Flag to indicate if this instance supports iPhone." + } + } + }, + "InstanceWebDetails": { + "id": "InstanceWebDetails", + "type": "object", + "description": "This is a JSON template for the Web details resource.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#instanceWebDetails.", + "default": "games#instanceWebDetails" + }, + "launchUrl": { + "type": "string", + "description": "Launch URL for the game." + }, + "preferred": { + "type": "boolean", + "description": "Indicates that this instance is the default for new installations." + } + } + }, + "Leaderboard": { + "id": "Leaderboard", + "type": "object", + "description": "This is a JSON template for the Leaderboard resource.", + "properties": { + "iconUrl": { + "type": "string", + "description": "The icon for the leaderboard." + }, + "id": { + "type": "string", + "description": "The leaderboard ID." + }, + "isIconUrlDefault": { + "type": "boolean", + "description": "Indicates whether the icon image being returned is a default image, or is game-provided." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#leaderboard.", + "default": "games#leaderboard" + }, + "name": { + "type": "string", + "description": "The name of the leaderboard." + }, + "order": { + "type": "string", + "description": "How scores are ordered.\nPossible values are: \n- \"LARGER_IS_BETTER\" - Larger values are better; scores are sorted in descending order. \n- \"SMALLER_IS_BETTER\" - Smaller values are better; scores are sorted in ascending order." + } + } + }, + "LeaderboardEntry": { + "id": "LeaderboardEntry", + "type": "object", + "description": "This is a JSON template for the Leaderboard Entry resource.", + "properties": { + "formattedScore": { + "type": "string", + "description": "The localized string for the numerical value of this score." + }, + "formattedScoreRank": { + "type": "string", + "description": "The localized string for the rank of this score for this leaderboard." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#leaderboardEntry.", + "default": "games#leaderboardEntry" + }, + "player": { + "$ref": "Player", + "description": "The player who holds this score." + }, + "scoreRank": { + "type": "string", + "description": "The rank of this score for this leaderboard.", + "format": "int64" + }, + "scoreTag": { + "type": "string", + "description": "Additional information about the score. Values must contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986." + }, + "scoreValue": { + "type": "string", + "description": "The numerical value of this score.", + "format": "int64" + }, + "timeSpan": { + "type": "string", + "description": "The time span of this high score.\nPossible values are: \n- \"ALL_TIME\" - The score is an all-time high score. \n- \"WEEKLY\" - The score is a weekly high score. \n- \"DAILY\" - The score is a daily high score." + }, + "writeTimestampMillis": { + "type": "string", + "description": "The timestamp at which this score was recorded, in milliseconds since the epoch in UTC.", + "format": "int64" + } + } + }, + "LeaderboardListResponse": { + "id": "LeaderboardListResponse", + "type": "object", + "description": "This is a JSON template for a list of leaderboard objects.", + "properties": { + "items": { + "type": "array", + "description": "The leaderboards.", + "items": { + "$ref": "Leaderboard" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#leaderboardListResponse.", + "default": "games#leaderboardListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Token corresponding to the next page of results." + } + } + }, + "LeaderboardScoreRank": { + "id": "LeaderboardScoreRank", + "type": "object", + "description": "This is a JSON template for a score rank in a leaderboard.", + "properties": { + "formattedNumScores": { + "type": "string", + "description": "The number of scores in the leaderboard as a string." + }, + "formattedRank": { + "type": "string", + "description": "The rank in the leaderboard as a string." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#leaderboardScoreRank.", + "default": "games#leaderboardScoreRank" + }, + "numScores": { + "type": "string", + "description": "The number of scores in the leaderboard.", + "format": "int64" + }, + "rank": { + "type": "string", + "description": "The rank in the leaderboard.", + "format": "int64" + } + } + }, + "LeaderboardScores": { + "id": "LeaderboardScores", + "type": "object", + "description": "This is a JSON template for a ListScores response.", + "properties": { + "items": { + "type": "array", + "description": "The scores in the leaderboard.", + "items": { + "$ref": "LeaderboardEntry" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#leaderboardScores.", + "default": "games#leaderboardScores" + }, + "nextPageToken": { + "type": "string", + "description": "The pagination token for the next page of results." + }, + "numScores": { + "type": "string", + "description": "The total number of scores in the leaderboard.", + "format": "int64" + }, + "playerScore": { + "$ref": "LeaderboardEntry", + "description": "The score of the requesting player on the leaderboard. The player's score may appear both here and in the list of scores above. If you are viewing a public leaderboard and the player is not sharing their gameplay information publicly, the scoreRank and formattedScoreRank values will not be present." + }, + "prevPageToken": { + "type": "string", + "description": "The pagination token for the previous page of results." + } + } + }, + "NetworkDiagnostics": { + "id": "NetworkDiagnostics", + "type": "object", + "description": "This is a JSON template for network diagnostics reported for a client.", + "properties": { + "androidNetworkSubtype": { + "type": "integer", + "description": "The Android network subtype.", + "format": "int32" + }, + "androidNetworkType": { + "type": "integer", + "description": "The Android network type.", + "format": "int32" + }, + "iosNetworkType": { + "type": "integer", + "description": "iOS network type as defined in Reachability.h.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#networkDiagnostics.", + "default": "games#networkDiagnostics" + }, + "registrationLatencyMillis": { + "type": "integer", + "description": "The amount of time in milliseconds it took for the client to establish a connection with the XMPP server.", + "format": "int32" + } + } + }, + "ParticipantResult": { + "id": "ParticipantResult", + "type": "object", + "description": "This is a JSON template for a result for a match participant.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#participantResult.", + "default": "games#participantResult" + }, + "participantId": { + "type": "string", + "description": "The ID of the participant." + }, + "placing": { + "type": "integer", + "description": "The placement or ranking of the participant in the match results; a number from one to the number of participants in the match. Multiple participants may have the same placing value in case of a type.", + "format": "int32" + }, + "result": { + "type": "string", + "description": "The result of the participant for this match.\nPossible values are: \n- \"MATCH_RESULT_WIN\" - The participant won the match. \n- \"MATCH_RESULT_LOSS\" - The participant lost the match. \n- \"MATCH_RESULT_TIE\" - The participant tied the match. \n- \"MATCH_RESULT_NONE\" - There was no winner for the match (nobody wins or loses this kind of game.) \n- \"MATCH_RESULT_DISCONNECT\" - The participant disconnected / left during the match. \n- \"MATCH_RESULT_DISAGREED\" - Different clients reported different results for this participant." + } + } + }, + "PeerChannelDiagnostics": { + "id": "PeerChannelDiagnostics", + "type": "object", + "description": "This is a JSON template for peer channel diagnostics.", + "properties": { + "bytesReceived": { + "$ref": "AggregateStats", + "description": "Number of bytes received." + }, + "bytesSent": { + "$ref": "AggregateStats", + "description": "Number of bytes sent." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#peerChannelDiagnostics.", + "default": "games#peerChannelDiagnostics" + }, + "numMessagesLost": { + "type": "integer", + "description": "Number of messages lost.", + "format": "int32" + }, + "numMessagesReceived": { + "type": "integer", + "description": "Number of messages received.", + "format": "int32" + }, + "numMessagesSent": { + "type": "integer", + "description": "Number of messages sent.", + "format": "int32" + }, + "numSendFailures": { + "type": "integer", + "description": "Number of send failures.", + "format": "int32" + }, + "roundtripLatencyMillis": { + "$ref": "AggregateStats", + "description": "Roundtrip latency stats in milliseconds." + } + } + }, + "PeerSessionDiagnostics": { + "id": "PeerSessionDiagnostics", + "type": "object", + "description": "This is a JSON template for peer session diagnostics.", + "properties": { + "connectedTimestampMillis": { + "type": "string", + "description": "Connected time in milliseconds.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#peerSessionDiagnostics.", + "default": "games#peerSessionDiagnostics" + }, + "participantId": { + "type": "string", + "description": "The participant ID of the peer." + }, + "reliableChannel": { + "$ref": "PeerChannelDiagnostics", + "description": "Reliable channel diagnostics." + }, + "unreliableChannel": { + "$ref": "PeerChannelDiagnostics", + "description": "Unreliable channel diagnostics." + } + } + }, + "Played": { + "id": "Played", + "type": "object", + "description": "This is a JSON template for 3P metadata about a player playing a game.", + "properties": { + "autoMatched": { + "type": "boolean", + "description": "True if the player was auto-matched with the currently authenticated user." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#played.", + "default": "games#played" + }, + "timeMillis": { + "type": "string", + "description": "The last time the player played the game in milliseconds since the epoch in UTC.", + "format": "int64" + } + } + }, + "Player": { + "id": "Player", + "type": "object", + "description": "This is a JSON template for a Player resource.", + "properties": { + "avatarImageUrl": { + "type": "string", + "description": "The base URL for the image that represents the player." + }, + "displayName": { + "type": "string", + "description": "The name to display for the player." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#player.", + "default": "games#player" + }, + "lastPlayedWith": { + "$ref": "Played", + "description": "Details about the last time this player played a multiplayer game with the currently authenticated player. Populated for PLAYED_WITH player collection members." + }, + "name": { + "type": "object", + "description": "An object representation of the individual components of the player's name.", + "properties": { + "familyName": { + "type": "string", + "description": "The family name (last name) of this player." + }, + "givenName": { + "type": "string", + "description": "The given name (first name) of this player." + } + } + }, + "playerId": { + "type": "string", + "description": "The ID of the player." + } + } + }, + "PlayerAchievement": { + "id": "PlayerAchievement", + "type": "object", + "description": "This is a JSON template for an achievement object.", + "properties": { + "achievementState": { + "type": "string", + "description": "The state of the achievement.\nPossible values are: \n- \"HIDDEN\" - Achievement is hidden. \n- \"REVEALED\" - Achievement is revealed. \n- \"UNLOCKED\" - Achievement is unlocked." + }, + "currentSteps": { + "type": "integer", + "description": "The current steps for an incremental achievement.", + "format": "int32" + }, + "formattedCurrentStepsString": { + "type": "string", + "description": "The current steps for an incremental achievement as a string." + }, + "id": { + "type": "string", + "description": "The ID of the achievement." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#playerAchievement.", + "default": "games#playerAchievement" + }, + "lastUpdatedTimestamp": { + "type": "string", + "description": "The timestamp of the last modification to this achievement's state.", + "format": "int64" + } + } + }, + "PlayerAchievementListResponse": { + "id": "PlayerAchievementListResponse", + "type": "object", + "description": "This is a JSON template for a list of achievement objects.", + "properties": { + "items": { + "type": "array", + "description": "The achievements.", + "items": { + "$ref": "PlayerAchievement" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#playerAchievementListResponse.", + "default": "games#playerAchievementListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Token corresponding to the next page of results." + } + } + }, + "PlayerLeaderboardScore": { + "id": "PlayerLeaderboardScore", + "type": "object", + "description": "This is a JSON template for a player leaderboard score object.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#playerLeaderboardScore.", + "default": "games#playerLeaderboardScore" + }, + "leaderboard_id": { + "type": "string", + "description": "The ID of the leaderboard this score is in." + }, + "publicRank": { + "$ref": "LeaderboardScoreRank", + "description": "The public rank of the score in this leaderboard. This object will not be present if the user is not sharing their scores publicly." + }, + "scoreString": { + "type": "string", + "description": "The formatted value of this score." + }, + "scoreTag": { + "type": "string", + "description": "Additional information about the score. Values must contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986." + }, + "scoreValue": { + "type": "string", + "description": "The numerical value of this score.", + "format": "int64" + }, + "socialRank": { + "$ref": "LeaderboardScoreRank", + "description": "The social rank of the score in this leaderboard." + }, + "timeSpan": { + "type": "string", + "description": "The time span of this score.\nPossible values are: \n- \"ALL_TIME\" - The score is an all-time score. \n- \"WEEKLY\" - The score is a weekly score. \n- \"DAILY\" - The score is a daily score." + }, + "writeTimestamp": { + "type": "string", + "description": "The timestamp at which this score was recorded, in milliseconds since the epoch in UTC.", + "format": "int64" + } + } + }, + "PlayerLeaderboardScoreListResponse": { + "id": "PlayerLeaderboardScoreListResponse", + "type": "object", + "description": "This is a JSON template for a list of player leaderboard scores.", + "properties": { + "items": { + "type": "array", + "description": "The leaderboard scores.", + "items": { + "$ref": "PlayerLeaderboardScore" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#playerLeaderboardScoreListResponse.", + "default": "games#playerLeaderboardScoreListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The pagination token for the next page of results." + }, + "player": { + "$ref": "Player", + "description": "The Player resources for the owner of this score." + } + } + }, + "PlayerListResponse": { + "id": "PlayerListResponse", + "type": "object", + "description": "This is a JSON template for a third party player list response.", + "properties": { + "items": { + "type": "array", + "description": "The players.", + "items": { + "$ref": "Player" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#playerListResponse.", + "default": "games#playerListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Token corresponding to the next page of results." + } + } + }, + "PlayerScore": { + "id": "PlayerScore", + "type": "object", + "description": "This is a JSON template for a player score.", + "properties": { + "formattedScore": { + "type": "string", + "description": "The formatted score for this player score." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#playerScore.", + "default": "games#playerScore" + }, + "score": { + "type": "string", + "description": "The numerical value for this player score.", + "format": "int64" + }, + "scoreTag": { + "type": "string", + "description": "Additional information about this score. Values will contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986." + }, + "timeSpan": { + "type": "string", + "description": "The time span for this player score.\nPossible values are: \n- \"ALL_TIME\" - The score is an all-time score. \n- \"WEEKLY\" - The score is a weekly score. \n- \"DAILY\" - The score is a daily score." + } + } + }, + "PlayerScoreListResponse": { + "id": "PlayerScoreListResponse", + "type": "object", + "description": "This is a JSON template for a list of score submission statuses.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#playerScoreListResponse.", + "default": "games#playerScoreListResponse" + }, + "submittedScores": { + "type": "array", + "description": "The score submissions statuses.", + "items": { + "$ref": "PlayerScoreResponse" + } + } + } + }, + "PlayerScoreResponse": { + "id": "PlayerScoreResponse", + "type": "object", + "description": "This is a JSON template for a list of leaderboard entry resources.", + "properties": { + "beatenScoreTimeSpans": { + "type": "array", + "description": "The time spans where the submitted score is better than the existing score for that time span.\nPossible values are: \n- \"ALL_TIME\" - The score is an all-time score. \n- \"WEEKLY\" - The score is a weekly score. \n- \"DAILY\" - The score is a daily score.", + "items": { + "type": "string" + } + }, + "formattedScore": { + "type": "string", + "description": "The formatted value of the submitted score." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#playerScoreResponse.", + "default": "games#playerScoreResponse" + }, + "leaderboardId": { + "type": "string", + "description": "The leaderboard ID that this score was submitted to." + }, + "scoreTag": { + "type": "string", + "description": "Additional information about this score. Values will contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986." + }, + "unbeatenScores": { + "type": "array", + "description": "The scores in time spans that have not been beaten. As an example, the submitted score may be better than the player's DAILY score, but not better than the player's scores for the WEEKLY or ALL_TIME time spans.", + "items": { + "$ref": "PlayerScore" + } + } + } + }, + "PlayerScoreSubmissionList": { + "id": "PlayerScoreSubmissionList", + "type": "object", + "description": "This is a JSON template for a list of score submission requests", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#playerScoreSubmissionList.", + "default": "games#playerScoreSubmissionList" + }, + "scores": { + "type": "array", + "description": "The score submissions.", + "items": { + "$ref": "ScoreSubmission" + } + } + } + }, + "PushToken": { + "id": "PushToken", + "type": "object", + "description": "This is a JSON template for a push token resource.", + "properties": { + "clientRevision": { + "type": "string", + "description": "The revision of the client SDK used by your application, in the same format that's used by revisions.check. Used to send backward compatible messages. Format: [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE are: \n- IOS - Push token is for iOS" + }, + "id": { + "$ref": "PushTokenId", + "description": "Unique identifier for this push token." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#pushToken.", + "default": "games#pushToken" + }, + "language": { + "type": "string", + "description": "The preferred language for notifications that are sent using this token." + } + } + }, + "PushTokenId": { + "id": "PushTokenId", + "type": "object", + "description": "This is a JSON template for a push token ID resource.", + "properties": { + "ios": { + "type": "object", + "description": "A push token ID for iOS devices.", + "properties": { + "apns_device_token": { + "type": "string", + "description": "Device token supplied by an iOS system call to register for remote notifications. Encode this field as web-safe base64.", + "format": "byte" + }, + "apns_environment": { + "type": "string", + "description": "Use SANDBOX during development for the APNS test server at gateway.sandbox.push.apple.com or PRODUCTION for the production server at gateway.push.apple.com." + } + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#pushTokenId.", + "default": "games#pushTokenId" + } + } + }, + "RevisionCheckResponse": { + "id": "RevisionCheckResponse", + "type": "object", + "description": "This is a JSON template for the result of checking a revision.", + "properties": { + "apiVersion": { + "type": "string", + "description": "The version of the API this client revision should use when calling API methods." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#revisionCheckResponse.", + "default": "games#revisionCheckResponse" + }, + "revisionStatus": { + "type": "string", + "description": "The result of the revision check.\nPossible values are: \n- \"OK\" - The revision being used is current. \n- \"DEPRECATED\" - There is currently a newer version available, but the revision being used still works. \n- \"INVALID\" - The revision being used is not supported in any released version." + } + } + }, + "Room": { + "id": "Room", + "type": "object", + "description": "This is a JSON template for a room resource object.", + "properties": { + "applicationId": { + "type": "string", + "description": "The ID of the application being played." + }, + "autoMatchingCriteria": { + "$ref": "RoomAutoMatchingCriteria", + "description": "Criteria for auto-matching players into this room." + }, + "autoMatchingStatus": { + "$ref": "RoomAutoMatchStatus", + "description": "Auto-matching status for this room. Not set if the room is not currently in the auto-matching queue." + }, + "creationDetails": { + "$ref": "RoomModification", + "description": "Details about the room creation." + }, + "description": { + "type": "string", + "description": "This short description is generated by our servers and worded relative to the player requesting the room. It is intended to be displayed when the room is shown in a list (that is, an invitation to a room.)" + }, + "inviterId": { + "type": "string", + "description": "The ID of the participant that invited the user to the room. Not set if the user was not invited to the room." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#room.", + "default": "games#room" + }, + "lastUpdateDetails": { + "$ref": "RoomModification", + "description": "Details about the last update to the room." + }, + "participants": { + "type": "array", + "description": "The participants involved in the room, along with their statuses. Includes participants who have left or declined invitations.", + "items": { + "$ref": "RoomParticipant" + } + }, + "roomId": { + "type": "string", + "description": "Globally unique ID for a room." + }, + "roomStatusVersion": { + "type": "integer", + "description": "The version of the room status: an increasing counter, used by the client to ignore out-of-order updates to room status.", + "format": "int32" + }, + "status": { + "type": "string", + "description": "The status of the room.\nPossible values are: \n- \"ROOM_INVITING\" - One or more players have been invited and not responded. \n- \"ROOM_AUTO_MATCHING\" - One or more slots need to be filled by auto-matching. \n- \"ROOM_CONNECTING\" - Players have joined and are connecting to each other (either before or after auto-matching). \n- \"ROOM_ACTIVE\" - All players have joined and connected to each other. \n- \"ROOM_DELETED\" - The room should no longer be shown on the client. Returned in sync calls when a player joins a room (as a tombstone), or for rooms where all joined participants have left." + }, + "variant": { + "type": "integer", + "description": "The variant / mode of the application being played; can be any integer value, or left blank.", + "format": "int32" + } + } + }, + "RoomAutoMatchStatus": { + "id": "RoomAutoMatchStatus", + "type": "object", + "description": "This is a JSON template for status of room automatching that is in progress.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#roomAutoMatchStatus.", + "default": "games#roomAutoMatchStatus" + }, + "waitEstimateSeconds": { + "type": "integer", + "description": "An estimate for the amount of time (in seconds) that auto-matching is expected to take to complete.", + "format": "int32" + } + } + }, + "RoomAutoMatchingCriteria": { + "id": "RoomAutoMatchingCriteria", + "type": "object", + "description": "This is a JSON template for a room auto-match criteria object.", + "properties": { + "exclusiveBitmask": { + "type": "string", + "description": "A bitmask indicating when auto-matches are valid. When ANDed with other exclusive bitmasks, the result must be zero. Can be used to support exclusive roles within a game.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#roomAutoMatchingCriteria.", + "default": "games#roomAutoMatchingCriteria" + }, + "maxAutoMatchingPlayers": { + "type": "integer", + "description": "The maximum number of players that should be added to the room by auto-matching.", + "format": "int32" + }, + "minAutoMatchingPlayers": { + "type": "integer", + "description": "The minimum number of players that should be added to the room by auto-matching.", + "format": "int32" + } + } + }, + "RoomClientAddress": { + "id": "RoomClientAddress", + "type": "object", + "description": "This is a JSON template for the client address when setting up a room.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#roomClientAddress.", + "default": "games#roomClientAddress" + }, + "xmppAddress": { + "type": "string", + "description": "The XMPP address of the client on the Google Games XMPP network." + } + } + }, + "RoomCreateRequest": { + "id": "RoomCreateRequest", + "type": "object", + "description": "This is a JSON template for a room creation request.", + "properties": { + "autoMatchingCriteria": { + "$ref": "RoomAutoMatchingCriteria", + "description": "Criteria for auto-matching players into this room." + }, + "capabilities": { + "type": "array", + "description": "The capabilities that this client supports for realtime communication.", + "items": { + "type": "string" + } + }, + "clientAddress": { + "$ref": "RoomClientAddress", + "description": "Client address for the player creating the room." + }, + "invitedPlayerIds": { + "type": "array", + "description": "The player IDs to invite to the room.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#roomCreateRequest.", + "default": "games#roomCreateRequest" + }, + "networkDiagnostics": { + "$ref": "NetworkDiagnostics", + "description": "Network diagnostics for the client creating the room." + }, + "requestId": { + "type": "string", + "description": "A randomly generated numeric ID. This number is used at the server to ensure that the request is handled correctly across retries.", + "format": "int64" + }, + "variant": { + "type": "integer", + "description": "The variant / mode of the application to be played. This can be any integer value, or left blank. You should use a small number of variants to keep the auto-matching pool as large as possible.", + "format": "int32" + } + } + }, + "RoomJoinRequest": { + "id": "RoomJoinRequest", + "type": "object", + "description": "This is a JSON template for a join room request.", + "properties": { + "capabilities": { + "type": "array", + "description": "The capabilities that this client supports for realtime communication.", + "items": { + "type": "string" + } + }, + "clientAddress": { + "$ref": "RoomClientAddress", + "description": "Client address for the player joining the room." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#roomJoinRequest.", + "default": "games#roomJoinRequest" + }, + "networkDiagnostics": { + "$ref": "NetworkDiagnostics", + "description": "Network diagnostics for the client joining the room." + } + } + }, + "RoomLeaveDiagnostics": { + "id": "RoomLeaveDiagnostics", + "type": "object", + "description": "This is a JSON template for room leave diagnostics.", + "properties": { + "androidNetworkSubtype": { + "type": "integer", + "description": "Android network subtype. http://developer.android.com/reference/android/net/NetworkInfo.html#getSubtype()", + "format": "int32" + }, + "androidNetworkType": { + "type": "integer", + "description": "Android network type. http://developer.android.com/reference/android/net/NetworkInfo.html#getType()", + "format": "int32" + }, + "iosNetworkType": { + "type": "integer", + "description": "iOS network type as defined in Reachability.h.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#roomLeaveDiagnostics.", + "default": "games#roomLeaveDiagnostics" + }, + "peerSession": { + "type": "array", + "description": "Diagnostics about all peer sessions.", + "items": { + "$ref": "PeerSessionDiagnostics" + } + }, + "socketsUsed": { + "type": "boolean", + "description": "Whether or not sockets were used." + } + } + }, + "RoomLeaveRequest": { + "id": "RoomLeaveRequest", + "type": "object", + "description": "This is a JSON template for a leave room request.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#roomLeaveRequest.", + "default": "games#roomLeaveRequest" + }, + "leaveDiagnostics": { + "$ref": "RoomLeaveDiagnostics", + "description": "Diagnostics for a player leaving the room." + }, + "reason": { + "type": "string", + "description": "Reason for leaving the match.\nPossible values are: \n- \"PLAYER_LEFT\" - The player chose to leave the room.. \n- \"GAME_LEFT\" - The game chose to remove the player from the room. \n- \"REALTIME_ABANDONED\" - The player switched to another application and abandoned the room. \n- \"REALTIME_PEER_CONNECTION_FAILURE\" - The client was unable to establish a connection to other peer(s). \n- \"REALTIME_SERVER_CONNECTION_FAILURE\" - The client was unable to communicate with the server. \n- \"REALTIME_SERVER_ERROR\" - The client received an error response when it tried to communicate with the server. \n- \"REALTIME_TIMEOUT\" - The client timed out while waiting for a room." + } + } + }, + "RoomList": { + "id": "RoomList", + "type": "object", + "description": "This is a JSON template for a list of rooms.", + "properties": { + "items": { + "type": "array", + "description": "The rooms.", + "items": { + "$ref": "Room" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#roomList.", + "default": "games#roomList" + }, + "nextPageToken": { + "type": "string", + "description": "The pagination token for the next page of results." + } + } + }, + "RoomModification": { + "id": "RoomModification", + "type": "object", + "description": "This is a JSON template for room modification metadata.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#roomModification.", + "default": "games#roomModification" + }, + "modifiedTimestampMillis": { + "type": "string", + "description": "The timestamp at which they modified the room, in milliseconds since the epoch in UTC.", + "format": "int64" + }, + "participantId": { + "type": "string", + "description": "The ID of the participant that modified the room." + } + } + }, + "RoomP2PStatus": { + "id": "RoomP2PStatus", + "type": "object", + "description": "This is a JSON template for an update on the status of a peer in a room.", + "properties": { + "connectionSetupLatencyMillis": { + "type": "integer", + "description": "The amount of time in milliseconds it took to establish connections with this peer.", + "format": "int32" + }, + "error": { + "type": "string", + "description": "The error code in event of a failure.\nPossible values are: \n- \"P2P_FAILED\" - The client failed to establish a P2P connection with the peer. \n- \"PRESENCE_FAILED\" - The client failed to register to receive P2P connections. \n- \"RELAY_SERVER_FAILED\" - The client received an error when trying to use the relay server to establish a P2P connection with the peer." + }, + "error_reason": { + "type": "string", + "description": "More detailed diagnostic message returned in event of a failure." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#roomP2PStatus.", + "default": "games#roomP2PStatus" + }, + "participantId": { + "type": "string", + "description": "The ID of the participant." + }, + "status": { + "type": "string", + "description": "The status of the peer in the room.\nPossible values are: \n- \"CONNECTION_ESTABLISHED\" - The client established a P2P connection with the peer. \n- \"CONNECTION_FAILED\" - The client failed to establish directed presence with the peer." + }, + "unreliableRoundtripLatencyMillis": { + "type": "integer", + "description": "The amount of time in milliseconds it took to send packets back and forth on the unreliable channel with this peer.", + "format": "int32" + } + } + }, + "RoomP2PStatuses": { + "id": "RoomP2PStatuses", + "type": "object", + "description": "This is a JSON template for an update on the status of peers in a room.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#roomP2PStatuses.", + "default": "games#roomP2PStatuses" + }, + "updates": { + "type": "array", + "description": "The updates for the peers.", + "items": { + "$ref": "RoomP2PStatus" + } + } + } + }, + "RoomParticipant": { + "id": "RoomParticipant", + "type": "object", + "description": "This is a JSON template for a participant in a room.", + "properties": { + "autoMatched": { + "type": "boolean", + "description": "True if this participant was auto-matched with the requesting player." + }, + "autoMatchedPlayer": { + "$ref": "AnonymousPlayer", + "description": "Information about a player that has been anonymously auto-matched against the requesting player. (Either player or autoMatchedPlayer will be set.)" + }, + "capabilities": { + "type": "array", + "description": "The capabilities which can be used when communicating with this participant.", + "items": { + "type": "string" + } + }, + "clientAddress": { + "$ref": "RoomClientAddress", + "description": "Client address for the participant." + }, + "connected": { + "type": "boolean", + "description": "True if this participant is in the fully connected set of peers in the room." + }, + "id": { + "type": "string", + "description": "An identifier for the participant in the scope of the room. Cannot be used to identify a player across rooms or in other contexts." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#roomParticipant.", + "default": "games#roomParticipant" + }, + "leaveReason": { + "type": "string", + "description": "The reason the participant left the room; populated if the participant status is PARTICIPANT_LEFT.\nPossible values are: \n- \"PLAYER_LEFT\" - The player explicitly chose to leave the room. \n- \"GAME_LEFT\" - The game chose to remove the player from the room. \n- \"ABANDONED\" - The player switched to another application and abandoned the room.\n- \"PEER_CONNECTION_FAILURE\" - The client was unable to establish or maintain a connection to other peer(s) in the room.\n- \"SERVER_ERROR\" - The client received an error response when it tried to communicate with the server. \n- \"TIMEOUT\" - The client timed out while waiting for players to join and connect. \n- \"PRESENCE_FAILURE\" - The client's XMPP connection ended abruptly." + }, + "player": { + "$ref": "Player", + "description": "Information about the player. Not populated if this player was anonymously auto-matched against the requesting player. (Either player or autoMatchedPlayer will be set.)" + }, + "status": { + "type": "string", + "description": "The status of the participant with respect to the room.\nPossible values are: \n- \"PARTICIPANT_INVITED\" - The participant has been invited to join the room, but has not yet responded. \n- \"PARTICIPANT_JOINED\" - The participant has joined the room (either after creating it or accepting an invitation.) \n- \"PARTICIPANT_DECLINED\" - The participant declined an invitation to join the room. \n- \"PARTICIPANT_LEFT\" - The participant joined the room and then left it." + } + } + }, + "RoomStatus": { + "id": "RoomStatus", + "type": "object", + "description": "This is a JSON template for the status of a room that the player has joined.", + "properties": { + "autoMatchingStatus": { + "$ref": "RoomAutoMatchStatus", + "description": "Auto-matching status for this room. Not set if the room is not currently in the automatching queue." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#roomStatus.", + "default": "games#roomStatus" + }, + "participants": { + "type": "array", + "description": "The participants involved in the room, along with their statuses. Includes participants who have left or declined invitations.", + "items": { + "$ref": "RoomParticipant" + } + }, + "roomId": { + "type": "string", + "description": "Globally unique ID for a room." + }, + "status": { + "type": "string", + "description": "The status of the room.\nPossible values are: \n- \"ROOM_INVITING\" - One or more players have been invited and not responded. \n- \"ROOM_AUTO_MATCHING\" - One or more slots need to be filled by auto-matching. \n- \"ROOM_CONNECTING\" - Players have joined are connecting to each other (either before or after auto-matching). \n- \"ROOM_ACTIVE\" - All players have joined and connected to each other. \n- \"ROOM_DELETED\" - All joined players have left." + }, + "statusVersion": { + "type": "integer", + "description": "The version of the status for the room: an increasing counter, used by the client to ignore out-of-order updates to room status.", + "format": "int32" + } + } + }, + "ScoreSubmission": { + "id": "ScoreSubmission", + "type": "object", + "description": "This is a JSON template for a request to submit a score to leaderboards.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#scoreSubmission.", + "default": "games#scoreSubmission" + }, + "leaderboardId": { + "type": "string", + "description": "The leaderboard this score is being submitted to." + }, + "score": { + "type": "string", + "description": "The new score being submitted.", + "format": "int64" + }, + "scoreTag": { + "type": "string", + "description": "Additional information about this score. Values will contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986.", + "pattern": "[a-zA-Z0-9-._~]{0,64}" + } + } + }, + "TurnBasedAutoMatchingCriteria": { + "id": "TurnBasedAutoMatchingCriteria", + "type": "object", + "description": "This is a JSON template for an turn-based auto-match criteria object.", + "properties": { + "exclusiveBitmask": { + "type": "string", + "description": "A bitmask indicating when auto-matches are valid. When ANDed with other exclusive bitmasks, the result must be zero. Can be used to support exclusive roles within a game.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#turnBasedAutoMatchingCriteria.", + "default": "games#turnBasedAutoMatchingCriteria" + }, + "maxAutoMatchingPlayers": { + "type": "integer", + "description": "The maximum number of players that should be added to the match by auto-matching.", + "format": "int32" + }, + "minAutoMatchingPlayers": { + "type": "integer", + "description": "The minimum number of players that should be added to the match by auto-matching.", + "format": "int32" + } + } + }, + "TurnBasedMatch": { + "id": "TurnBasedMatch", + "type": "object", + "description": "This is a JSON template for a turn-based match resource object.", + "properties": { + "applicationId": { + "type": "string", + "description": "The ID of the application being played." + }, + "autoMatchingCriteria": { + "$ref": "TurnBasedAutoMatchingCriteria", + "description": "Criteria for auto-matching players into this match." + }, + "creationDetails": { + "$ref": "TurnBasedMatchModification", + "description": "Details about the match creation." + }, + "data": { + "$ref": "TurnBasedMatchData", + "description": "The data / game state for this match." + }, + "description": { + "type": "string", + "description": "This short description is generated by our servers based on turn state and is localized and worded relative to the player requesting the match. It is intended to be displayed when the match is shown in a list." + }, + "inviterId": { + "type": "string", + "description": "The ID of the participant that invited the user to the match. Not set if the user was not invited to the match." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#turnBasedMatch.", + "default": "games#turnBasedMatch" + }, + "lastUpdateDetails": { + "$ref": "TurnBasedMatchModification", + "description": "Details about the last update to the match." + }, + "matchId": { + "type": "string", + "description": "Globally unique ID for a turn-based match." + }, + "matchNumber": { + "type": "integer", + "description": "The number of the match in a chain of rematches. Will be set to 1 for the first match and incremented by 1 for each rematch.", + "format": "int32" + }, + "matchVersion": { + "type": "integer", + "description": "The version of this match: an increasing counter, used to avoid out-of-date updates to the match.", + "format": "int32" + }, + "participants": { + "type": "array", + "description": "The participants involved in the match, along with their statuses. Includes participants who have left or declined invitations.", + "items": { + "$ref": "TurnBasedMatchParticipant" + } + }, + "pendingParticipantId": { + "type": "string", + "description": "The ID of the participant that is taking a turn." + }, + "previousMatchData": { + "$ref": "TurnBasedMatchData", + "description": "The data / game state for the previous match; set for the first turn of rematches only." + }, + "rematchId": { + "type": "string", + "description": "The ID of a rematch of this match. Only set for completed matches that have been rematched." + }, + "results": { + "type": "array", + "description": "The results reported for this match.", + "items": { + "$ref": "ParticipantResult" + } + }, + "status": { + "type": "string", + "description": "The status of the match.\nPossible values are: \n- \"MATCH_AUTO_MATCHING\" - One or more slots need to be filled by auto-matching; the match cannot be established until they are filled. \n- \"MATCH_ACTIVE\" - The match has started. \n- \"MATCH_COMPLETE\" - The match has finished. \n- \"MATCH_CANCELED\" - The match was canceled. \n- \"MATCH_EXPIRED\" - The match expired due to inactivity. \n- \"MATCH_DELETED\" - The match should no longer be shown on the client. Returned only for tombstones for matches when sync is called." + }, + "userMatchStatus": { + "type": "string", + "description": "The status of the current user in the match. Derived from the match type, match status, the user's participant status, and the pending participant for the match.\nPossible values are: \n- \"USER_INVITED\" - The user has been invited to join the match and has not responded yet. \n- \"USER_AWAITING_TURN\" - The user is waiting for their turn. \n- \"USER_TURN\" - The user has an action to take in the match. \n- \"USER_MATCH_COMPLETED\" - The match has ended (it is completed, canceled, or expired.)" + }, + "variant": { + "type": "integer", + "description": "The variant / mode of the application being played; can be any integer value, or left blank.", + "format": "int32" + }, + "withParticipantId": { + "type": "string", + "description": "The ID of another participant in the match that can be used when describing the participants the user is playing with." + } + } + }, + "TurnBasedMatchCreateRequest": { + "id": "TurnBasedMatchCreateRequest", + "type": "object", + "description": "This is a JSON template for a turn-based match creation request.", + "properties": { + "autoMatchingCriteria": { + "$ref": "TurnBasedAutoMatchingCriteria", + "description": "Criteria for auto-matching players into this match." + }, + "invitedPlayerIds": { + "type": "array", + "description": "The player ids to invite to the match.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#turnBasedMatchCreateRequest.", + "default": "games#turnBasedMatchCreateRequest" + }, + "requestId": { + "type": "string", + "description": "A randomly generated numeric ID. This number is used at the server to ensure that the request is handled correctly across retries.", + "format": "int64" + }, + "variant": { + "type": "integer", + "description": "The variant / mode of the application to be played. This can be any integer value, or left blank. You should use a small number of variants to keep the auto-matching pool as large as possible.", + "format": "int32" + } + } + }, + "TurnBasedMatchData": { + "id": "TurnBasedMatchData", + "type": "object", + "description": "This is a JSON template for a turn-based match data object.", + "properties": { + "data": { + "type": "string", + "description": "The byte representation of the data (limited to 128 kB), as a Base64-encoded string with the URL_SAFE encoding option.", + "format": "byte" + }, + "dataAvailable": { + "type": "boolean", + "description": "True if this match has data available but it wasn't returned in a list response; fetching the match individually will retrieve this data." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#turnBasedMatchData.", + "default": "games#turnBasedMatchData" + } + } + }, + "TurnBasedMatchDataRequest": { + "id": "TurnBasedMatchDataRequest", + "type": "object", + "description": "This is a JSON template for sending a turn-based match data object.", + "properties": { + "data": { + "type": "string", + "description": "The byte representation of the data (limited to 128 kB), as a Base64-encoded string with the URL_SAFE encoding option.", + "format": "byte" + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#turnBasedMatchDataRequest.", + "default": "games#turnBasedMatchDataRequest" + } + } + }, + "TurnBasedMatchList": { + "id": "TurnBasedMatchList", + "type": "object", + "description": "This is a JSON template for a list of turn-based matches.", + "properties": { + "items": { + "type": "array", + "description": "The matches.", + "items": { + "$ref": "TurnBasedMatch" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#turnBasedMatchList.", + "default": "games#turnBasedMatchList" + }, + "nextPageToken": { + "type": "string", + "description": "The pagination token for the next page of results." + } + } + }, + "TurnBasedMatchModification": { + "id": "TurnBasedMatchModification", + "type": "object", + "description": "This is a JSON template for turn-based match modification metadata.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#turnBasedMatchModification.", + "default": "games#turnBasedMatchModification" + }, + "modifiedTimestampMillis": { + "type": "string", + "description": "The timestamp at which they modified the match, in milliseconds since the epoch in UTC.", + "format": "int64" + }, + "participantId": { + "type": "string", + "description": "The ID of the participant that modified the match." + } + } + }, + "TurnBasedMatchParticipant": { + "id": "TurnBasedMatchParticipant", + "type": "object", + "description": "This is a JSON template for a participant in a turn-based match.", + "properties": { + "autoMatched": { + "type": "boolean", + "description": "True if this participant was auto-matched with the requesting player." + }, + "autoMatchedPlayer": { + "$ref": "AnonymousPlayer", + "description": "Information about a player that has been anonymously auto-matched against the requesting player. (Either player or autoMatchedPlayer will be set.)" + }, + "id": { + "type": "string", + "description": "An identifier for the participant in the scope of the match. Cannot be used to identify a player across matches or in other contexts." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#turnBasedMatchParticipant.", + "default": "games#turnBasedMatchParticipant" + }, + "player": { + "$ref": "Player", + "description": "Information about the player. Not populated if this player was anonymously auto-matched against the requesting player. (Either player or autoMatchedPlayer will be set.)" + }, + "status": { + "type": "string", + "description": "The status of the participant with respect to the match.\nPossible values are: \n- \"PARTICIPANT_NOT_INVITED_YET\" - The participant is slated to be invited to the match, but the invitation has not been sent; the invite will be sent when it becomes their turn. \n- \"PARTICIPANT_INVITED\" - The participant has been invited to join the match, but has not yet responded. \n- \"PARTICIPANT_JOINED\" - The participant has joined the match (either after creating it or accepting an invitation.) \n- \"PARTICIPANT_DECLINED\" - The participant declined an invitation to join the match. \n- \"PARTICIPANT_LEFT\" - The participant joined the match and then left it. \n- \"PARTICIPANT_FINISHED\" - The participant finished playing in the match. \n- \"PARTICIPANT_UNRESPONSIVE\" - The participant did not take their turn in the allotted time." + } + } + }, + "TurnBasedMatchRematch": { + "id": "TurnBasedMatchRematch", + "type": "object", + "description": "This is a JSON template for a rematch response.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#turnBasedMatchRematch.", + "default": "games#turnBasedMatchRematch" + }, + "previousMatch": { + "$ref": "TurnBasedMatch", + "description": "The old match that the rematch was created from; will be updated such that the rematchId field will point at the new match." + }, + "rematch": { + "$ref": "TurnBasedMatch", + "description": "The newly created match; a rematch of the old match with the same participants." + } + } + }, + "TurnBasedMatchResults": { + "id": "TurnBasedMatchResults", + "type": "object", + "description": "This is a JSON template for a turn-based match results object.", + "properties": { + "data": { + "$ref": "TurnBasedMatchDataRequest", + "description": "The final match data." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#turnBasedMatchResults.", + "default": "games#turnBasedMatchResults" + }, + "matchVersion": { + "type": "integer", + "description": "The version of the match being updated.", + "format": "int32" + }, + "results": { + "type": "array", + "description": "The match results for the participants in the match.", + "items": { + "$ref": "ParticipantResult" + } + } + } + }, + "TurnBasedMatchSync": { + "id": "TurnBasedMatchSync", + "type": "object", + "description": "This is a JSON template for a list of turn-based matches returned from a sync.", + "properties": { + "items": { + "type": "array", + "description": "The matches.", + "items": { + "$ref": "TurnBasedMatch" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#turnBasedMatchSync.", + "default": "games#turnBasedMatchSync" + }, + "moreAvailable": { + "type": "boolean", + "description": "True if there were more matches available to fetch at the time the response was generated (which were not returned due to page size limits.)" + }, + "nextPageToken": { + "type": "string", + "description": "The pagination token for the next page of results." + } + } + }, + "TurnBasedMatchTurn": { + "id": "TurnBasedMatchTurn", + "type": "object", + "description": "This is a JSON template for the object representing a turn.", + "properties": { + "data": { + "$ref": "TurnBasedMatchDataRequest", + "description": "The shared game state data after the turn is over." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#turnBasedMatchTurn.", + "default": "games#turnBasedMatchTurn" + }, + "matchVersion": { + "type": "integer", + "description": "The version of this match: an increasing counter, used to avoid out-of-date updates to the match.", + "format": "int32" + }, + "pendingParticipantId": { + "type": "string", + "description": "The ID of the participant who should take their turn next. May be set to the current player's participant ID to update match state without changing the turn. If not set, the match will wait for other player(s) to join via automatching; this is only valid if automatch criteria is set on the match with remaining slots for automatched players." + }, + "results": { + "type": "array", + "description": "The match results for the participants in the match.", + "items": { + "$ref": "ParticipantResult" + } + } + } + } + }, + "resources": { + "achievementDefinitions": { + "methods": { + "list": { + "id": "games.achievementDefinitions.list", + "path": "achievements", + "httpMethod": "GET", + "description": "Lists all the achievement definitions for your application.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults.", + "format": "int32", + "minimum": "1", + "maximum": "200", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + } + }, + "response": { + "$ref": "AchievementDefinitionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + }, + "achievements": { + "methods": { + "increment": { + "id": "games.achievements.increment", + "path": "achievements/{achievementId}/increment", + "httpMethod": "POST", + "description": "Increments the steps of the achievement with the given ID for the currently authenticated player.", + "parameters": { + "achievementId": { + "type": "string", + "description": "The ID of the achievement used by this method.", + "required": true, + "location": "path" + }, + "requestId": { + "type": "string", + "description": "A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries.", + "format": "int64", + "location": "query" + }, + "stepsToIncrement": { + "type": "integer", + "description": "The number of steps to increment.", + "required": true, + "format": "int32", + "minimum": "1", + "location": "query" + } + }, + "parameterOrder": [ + "achievementId", + "stepsToIncrement" + ], + "response": { + "$ref": "AchievementIncrementResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "list": { + "id": "games.achievements.list", + "path": "players/{playerId}/achievements", + "httpMethod": "GET", + "description": "Lists the progress for all your application's achievements for the currently authenticated player.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults.", + "format": "int32", + "minimum": "1", + "maximum": "200", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + }, + "playerId": { + "type": "string", + "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", + "required": true, + "location": "path" + }, + "state": { + "type": "string", + "description": "Tells the server to return only achievements with the specified state. If this parameter isn't specified, all achievements are returned.", + "enum": [ + "ALL", + "HIDDEN", + "REVEALED", + "UNLOCKED" + ], + "enumDescriptions": [ + "List all achievements. This is the default.", + "List only hidden achievements.", + "List only revealed achievements.", + "List only unlocked achievements." + ], + "location": "query" + } + }, + "parameterOrder": [ + "playerId" + ], + "response": { + "$ref": "PlayerAchievementListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "reveal": { + "id": "games.achievements.reveal", + "path": "achievements/{achievementId}/reveal", + "httpMethod": "POST", + "description": "Sets the state of the achievement with the given ID to REVEALED for the currently authenticated player.", + "parameters": { + "achievementId": { + "type": "string", + "description": "The ID of the achievement used by this method.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "achievementId" + ], + "response": { + "$ref": "AchievementRevealResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "setStepsAtLeast": { + "id": "games.achievements.setStepsAtLeast", + "path": "achievements/{achievementId}/setStepsAtLeast", + "httpMethod": "POST", + "description": "Sets the steps for the currently authenticated player towards unlocking an achievement. If the steps parameter is less than the current number of steps that the player already gained for the achievement, the achievement is not modified.", + "parameters": { + "achievementId": { + "type": "string", + "description": "The ID of the achievement used by this method.", + "required": true, + "location": "path" + }, + "steps": { + "type": "integer", + "description": "The minimum value to set the steps to.", + "required": true, + "format": "int32", + "minimum": "1", + "location": "query" + } + }, + "parameterOrder": [ + "achievementId", + "steps" + ], + "response": { + "$ref": "AchievementSetStepsAtLeastResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "unlock": { + "id": "games.achievements.unlock", + "path": "achievements/{achievementId}/unlock", + "httpMethod": "POST", + "description": "Unlocks this achievement for the currently authenticated player.", + "parameters": { + "achievementId": { + "type": "string", + "description": "The ID of the achievement used by this method.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "achievementId" + ], + "response": { + "$ref": "AchievementUnlockResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "updateMultiple": { + "id": "games.achievements.updateMultiple", + "path": "achievements/updateMultiple", + "httpMethod": "POST", + "description": "Updates multiple achievements for the currently authenticated player.", + "request": { + "$ref": "AchievementUpdateMultipleRequest" + }, + "response": { + "$ref": "AchievementUpdateMultipleResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + }, + "applications": { + "methods": { + "get": { + "id": "games.applications.get", + "path": "applications/{applicationId}", + "httpMethod": "GET", + "description": "Retrieves the metadata of the application with the given ID. If the requested application is not available for the specified platformType, the returned response will not include any instance data.", + "parameters": { + "applicationId": { + "type": "string", + "description": "The application being requested.", + "required": true, + "location": "path" + }, + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "platformType": { + "type": "string", + "description": "Restrict application details returned to the specific platform.", + "enum": [ + "ANDROID", + "IOS", + "WEB_APP" + ], + "enumDescriptions": [ + "Retrieve applications that can be played on Android.", + "Retrieve applications that can be played on iOS.", + "Retrieve applications that can be played on desktop web." + ], + "location": "query" + } + }, + "parameterOrder": [ + "applicationId" + ], + "response": { + "$ref": "Application" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "played": { + "id": "games.applications.played", + "path": "applications/played", + "httpMethod": "POST", + "description": "Indicate that the the currently authenticated user is playing your application.", + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + }, + "leaderboards": { + "methods": { + "get": { + "id": "games.leaderboards.get", + "path": "leaderboards/{leaderboardId}", + "httpMethod": "GET", + "description": "Retrieves the metadata of the leaderboard with the given ID.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "leaderboardId": { + "type": "string", + "description": "The ID of the leaderboard.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "leaderboardId" + ], + "response": { + "$ref": "Leaderboard" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "list": { + "id": "games.leaderboards.list", + "path": "leaderboards", + "httpMethod": "GET", + "description": "Lists all the leaderboard metadata for your application.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of leaderboards to return in the response. For any response, the actual number of leaderboards returned may be less than the specified maxResults.", + "format": "int32", + "minimum": "1", + "maximum": "200", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + } + }, + "response": { + "$ref": "LeaderboardListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + }, + "players": { + "methods": { + "get": { + "id": "games.players.get", + "path": "players/{playerId}", + "httpMethod": "GET", + "description": "Retrieves the Player resource with the given ID. To retrieve the player for the currently authenticated user, set playerId to me.", + "parameters": { + "playerId": { + "type": "string", + "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "playerId" + ], + "response": { + "$ref": "Player" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "list": { + "id": "games.players.list", + "path": "players/me/players/{collection}", + "httpMethod": "GET", + "description": "Get the collection of players for the currently authenticated user.", + "parameters": { + "collection": { + "type": "string", + "description": "Collection of players being retrieved", + "required": true, + "enum": [ + "playedWith" + ], + "enumDescriptions": [ + "Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently." + ], + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of player resources to return in the response, used for paging. For any response, the actual number of player resources returned may be less than the specified maxResults.", + "format": "int32", + "minimum": "1", + "maximum": "15", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + } + }, + "parameterOrder": [ + "collection" + ], + "response": { + "$ref": "PlayerListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + }, + "pushtokens": { + "methods": { + "remove": { + "id": "games.pushtokens.remove", + "path": "pushtokens/remove", + "httpMethod": "POST", + "description": "Removes a push token for the current user and application. Removing a non-existent push token will report success.", + "request": { + "$ref": "PushTokenId" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "update": { + "id": "games.pushtokens.update", + "path": "pushtokens", + "httpMethod": "PUT", + "description": "Registers a push token for the current user and application.", + "request": { + "$ref": "PushToken" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + }, + "revisions": { + "methods": { + "check": { + "id": "games.revisions.check", + "path": "revisions/check", + "httpMethod": "GET", + "description": "Checks whether the games client is out of date.", + "parameters": { + "clientRevision": { + "type": "string", + "description": "The revision of the client SDK used by your application. Format:\n[PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE are:\n \n- \"ANDROID\" - Client is running the Android SDK. \n- \"IOS\" - Client is running the iOS SDK. \n- \"WEB_APP\" - Client is running as a Web App.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "clientRevision" + ], + "response": { + "$ref": "RevisionCheckResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + }, + "rooms": { + "methods": { + "create": { + "id": "games.rooms.create", + "path": "rooms/create", + "httpMethod": "POST", + "description": "Create a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + } + }, + "request": { + "$ref": "RoomCreateRequest" + }, + "response": { + "$ref": "Room" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "decline": { + "id": "games.rooms.decline", + "path": "rooms/{roomId}/decline", + "httpMethod": "POST", + "description": "Decline an invitation to join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", + "parameters": { + "roomId": { + "type": "string", + "description": "The ID of the room.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "roomId" + ], + "response": { + "$ref": "Room" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "dismiss": { + "id": "games.rooms.dismiss", + "path": "rooms/{roomId}/dismiss", + "httpMethod": "POST", + "description": "Dismiss an invitation to join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", + "parameters": { + "roomId": { + "type": "string", + "description": "The ID of the room.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "roomId" + ], + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "get": { + "id": "games.rooms.get", + "path": "rooms/{roomId}", + "httpMethod": "GET", + "description": "Get the data for a room.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "roomId": { + "type": "string", + "description": "The ID of the room.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "roomId" + ], + "response": { + "$ref": "Room" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "join": { + "id": "games.rooms.join", + "path": "rooms/{roomId}/join", + "httpMethod": "POST", + "description": "Join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", + "parameters": { + "roomId": { + "type": "string", + "description": "The ID of the room.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "roomId" + ], + "request": { + "$ref": "RoomJoinRequest" + }, + "response": { + "$ref": "Room" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "leave": { + "id": "games.rooms.leave", + "path": "rooms/{roomId}/leave", + "httpMethod": "POST", + "description": "Leave a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", + "parameters": { + "roomId": { + "type": "string", + "description": "The ID of the room.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "roomId" + ], + "request": { + "$ref": "RoomLeaveRequest" + }, + "response": { + "$ref": "Room" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "list": { + "id": "games.rooms.list", + "path": "rooms", + "httpMethod": "GET", + "description": "Returns invitations to join rooms.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of rooms to return in the response, used for paging. For any response, the actual number of rooms to return may be less than the specified maxResults.", + "format": "int32", + "minimum": "1", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + } + }, + "response": { + "$ref": "RoomList" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "reportStatus": { + "id": "games.rooms.reportStatus", + "path": "rooms/{roomId}/reportstatus", + "httpMethod": "POST", + "description": "Updates sent by a client reporting the status of peers in a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", + "parameters": { + "roomId": { + "type": "string", + "description": "The ID of the room.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "roomId" + ], + "request": { + "$ref": "RoomP2PStatuses" + }, + "response": { + "$ref": "RoomStatus" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + }, + "scores": { + "methods": { + "get": { + "id": "games.scores.get", + "path": "players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}", + "httpMethod": "GET", + "description": "Get high scores, and optionally ranks, in leaderboards for the currently authenticated player. For a specific time span, leaderboardId can be set to ALL to retrieve data for all leaderboards in a given time span.\nNOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same request; only one parameter may be set to 'ALL'.", + "parameters": { + "includeRankType": { + "type": "string", + "description": "The types of ranks to return. If the parameter is omitted, no ranks will be returned.", + "enum": [ + "ALL", + "PUBLIC", + "SOCIAL" + ], + "enumDescriptions": [ + "Retrieve public and social ranks.", + "Retrieve public ranks, if the player is sharing their gameplay activity publicly.", + "Retrieve the social rank." + ], + "location": "query" + }, + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "leaderboardId": { + "type": "string", + "description": "The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all leaderboards for this application.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults.", + "format": "int32", + "minimum": "1", + "maximum": "25", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + }, + "playerId": { + "type": "string", + "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", + "required": true, + "location": "path" + }, + "timeSpan": { + "type": "string", + "description": "The time span for the scores and ranks you're requesting.", + "required": true, + "enum": [ + "ALL", + "ALL_TIME", + "DAILY", + "WEEKLY" + ], + "enumDescriptions": [ + "Get the high scores for all time spans. If this is used, maxResults values will be ignored.", + "Get the all time high score.", + "List the top scores for the current day.", + "List the top scores for the current week." + ], + "location": "path" + } + }, + "parameterOrder": [ + "playerId", + "leaderboardId", + "timeSpan" + ], + "response": { + "$ref": "PlayerLeaderboardScoreListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "list": { + "id": "games.scores.list", + "path": "leaderboards/{leaderboardId}/scores/{collection}", + "httpMethod": "GET", + "description": "Lists the scores in a leaderboard, starting from the top.", + "parameters": { + "collection": { + "type": "string", + "description": "The collection of scores you're requesting.", + "required": true, + "enum": [ + "PUBLIC", + "SOCIAL" + ], + "enumDescriptions": [ + "List all scores in the public leaderboard.", + "List only social scores." + ], + "location": "path" + }, + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "leaderboardId": { + "type": "string", + "description": "The ID of the leaderboard.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults.", + "format": "int32", + "minimum": "1", + "maximum": "25", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + }, + "timeSpan": { + "type": "string", + "description": "The time span for the scores and ranks you're requesting.", + "required": true, + "enum": [ + "ALL_TIME", + "DAILY", + "WEEKLY" + ], + "enumDescriptions": [ + "List the all-time top scores.", + "List the top scores for the current day.", + "List the top scores for the current week." + ], + "location": "query" + } + }, + "parameterOrder": [ + "leaderboardId", + "collection", + "timeSpan" + ], + "response": { + "$ref": "LeaderboardScores" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "listWindow": { + "id": "games.scores.listWindow", + "path": "leaderboards/{leaderboardId}/window/{collection}", + "httpMethod": "GET", + "description": "Lists the scores in a leaderboard around (and including) a player's score.", + "parameters": { + "collection": { + "type": "string", + "description": "The collection of scores you're requesting.", + "required": true, + "enum": [ + "PUBLIC", + "SOCIAL" + ], + "enumDescriptions": [ + "List all scores in the public leaderboard.", + "List only social scores." + ], + "location": "path" + }, + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "leaderboardId": { + "type": "string", + "description": "The ID of the leaderboard.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults.", + "format": "int32", + "minimum": "1", + "maximum": "25", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + }, + "resultsAbove": { + "type": "integer", + "description": "The preferred number of scores to return above the player's score. More scores may be returned if the player is at the bottom of the leaderboard; fewer may be returned if the player is at the top. Must be less than or equal to maxResults.", + "format": "int32", + "location": "query" + }, + "returnTopIfAbsent": { + "type": "boolean", + "description": "True if the top scores should be returned when the player is not in the leaderboard. Defaults to true.", + "location": "query" + }, + "timeSpan": { + "type": "string", + "description": "The time span for the scores and ranks you're requesting.", + "required": true, + "enum": [ + "ALL_TIME", + "DAILY", + "WEEKLY" + ], + "enumDescriptions": [ + "List the all-time top scores.", + "List the top scores for the current day.", + "List the top scores for the current week." + ], + "location": "query" + } + }, + "parameterOrder": [ + "leaderboardId", + "collection", + "timeSpan" + ], + "response": { + "$ref": "LeaderboardScores" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "submit": { + "id": "games.scores.submit", + "path": "leaderboards/{leaderboardId}/scores", + "httpMethod": "POST", + "description": "Submits a score to the specified leaderboard.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "leaderboardId": { + "type": "string", + "description": "The ID of the leaderboard.", + "required": true, + "location": "path" + }, + "score": { + "type": "string", + "description": "The score you're submitting. The submitted score is ignored if it is worse than a previously submitted score, where worse depends on the leaderboard sort order. The meaning of the score value depends on the leaderboard format type. For fixed-point, the score represents the raw value. For time, the score represents elapsed time in milliseconds. For currency, the score represents a value in micro units.", + "required": true, + "format": "int64", + "location": "query" + }, + "scoreTag": { + "type": "string", + "description": "Additional information about the score you're submitting. Values must contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986.", + "pattern": "[a-zA-Z0-9-._~]{0,64}", + "location": "query" + } + }, + "parameterOrder": [ + "leaderboardId", + "score" + ], + "response": { + "$ref": "PlayerScoreResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "submitMultiple": { + "id": "games.scores.submitMultiple", + "path": "leaderboards/scores", + "httpMethod": "POST", + "description": "Submits multiple scores to leaderboards.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + } + }, + "request": { + "$ref": "PlayerScoreSubmissionList" + }, + "response": { + "$ref": "PlayerScoreListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + }, + "turnBasedMatches": { + "methods": { + "cancel": { + "id": "games.turnBasedMatches.cancel", + "path": "turnbasedmatches/{matchId}/cancel", + "httpMethod": "PUT", + "description": "Cancel a turn-based match.", + "parameters": { + "matchId": { + "type": "string", + "description": "The ID of the match.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "matchId" + ], + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "create": { + "id": "games.turnBasedMatches.create", + "path": "turnbasedmatches/create", + "httpMethod": "POST", + "description": "Create a turn-based match.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + } + }, + "request": { + "$ref": "TurnBasedMatchCreateRequest" + }, + "response": { + "$ref": "TurnBasedMatch" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "decline": { + "id": "games.turnBasedMatches.decline", + "path": "turnbasedmatches/{matchId}/decline", + "httpMethod": "PUT", + "description": "Decline an invitation to play a turn-based match.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "matchId": { + "type": "string", + "description": "The ID of the match.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "matchId" + ], + "response": { + "$ref": "TurnBasedMatch" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "dismiss": { + "id": "games.turnBasedMatches.dismiss", + "path": "turnbasedmatches/{matchId}/dismiss", + "httpMethod": "PUT", + "description": "Dismiss a turn-based match from the match list. The match will no longer show up in the list and will not generate notifications.", + "parameters": { + "matchId": { + "type": "string", + "description": "The ID of the match.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "matchId" + ], + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "finish": { + "id": "games.turnBasedMatches.finish", + "path": "turnbasedmatches/{matchId}/finish", + "httpMethod": "PUT", + "description": "Finish a turn-based match. Each player should make this call once, after all results are in. Only the player whose turn it is may make the first call to Finish, and can pass in the final match state.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "matchId": { + "type": "string", + "description": "The ID of the match.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "matchId" + ], + "request": { + "$ref": "TurnBasedMatchResults" + }, + "response": { + "$ref": "TurnBasedMatch" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "get": { + "id": "games.turnBasedMatches.get", + "path": "turnbasedmatches/{matchId}", + "httpMethod": "GET", + "description": "Get the data for a turn-based match.", + "parameters": { + "includeMatchData": { + "type": "boolean", + "description": "Get match data along with metadata.", + "location": "query" + }, + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "matchId": { + "type": "string", + "description": "The ID of the match.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "matchId" + ], + "response": { + "$ref": "TurnBasedMatch" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "join": { + "id": "games.turnBasedMatches.join", + "path": "turnbasedmatches/{matchId}/join", + "httpMethod": "PUT", + "description": "Join a turn-based match.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "matchId": { + "type": "string", + "description": "The ID of the match.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "matchId" + ], + "response": { + "$ref": "TurnBasedMatch" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "leave": { + "id": "games.turnBasedMatches.leave", + "path": "turnbasedmatches/{matchId}/leave", + "httpMethod": "PUT", + "description": "Leave a turn-based match when it is not the current player's turn, without canceling the match.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "matchId": { + "type": "string", + "description": "The ID of the match.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "matchId" + ], + "response": { + "$ref": "TurnBasedMatch" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "leaveTurn": { + "id": "games.turnBasedMatches.leaveTurn", + "path": "turnbasedmatches/{matchId}/leaveTurn", + "httpMethod": "PUT", + "description": "Leave a turn-based match during the current player's turn, without canceling the match.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "matchId": { + "type": "string", + "description": "The ID of the match.", + "required": true, + "location": "path" + }, + "matchVersion": { + "type": "integer", + "description": "The version of the match being updated.", + "required": true, + "format": "int32", + "location": "query" + }, + "pendingParticipantId": { + "type": "string", + "description": "The ID of another participant who should take their turn next. If not set, the match will wait for other player(s) to join via automatching; this is only valid if automatch criteria is set on the match with remaining slots for automatched players.", + "location": "query" + } + }, + "parameterOrder": [ + "matchId", + "matchVersion" + ], + "response": { + "$ref": "TurnBasedMatch" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "list": { + "id": "games.turnBasedMatches.list", + "path": "turnbasedmatches", + "httpMethod": "GET", + "description": "Returns turn-based matches the player is or was involved in.", + "parameters": { + "includeMatchData": { + "type": "boolean", + "description": "True if match data should be returned in the response. Note that not all data will necessarily be returned if include_match_data is true; the server may decide to only return data for some of the matches to limit download size for the client. The remainder of the data for these matches will be retrievable on request.", + "location": "query" + }, + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "maxCompletedMatches": { + "type": "integer", + "description": "The maximum number of completed or canceled matches to return in the response. If not set, all matches returned could be completed or canceled.", + "format": "int32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of matches to return in the response, used for paging. For any response, the actual number of matches to return may be less than the specified maxResults.", + "format": "int32", + "minimum": "1", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + } + }, + "response": { + "$ref": "TurnBasedMatchList" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "rematch": { + "id": "games.turnBasedMatches.rematch", + "path": "turnbasedmatches/{matchId}/rematch", + "httpMethod": "POST", + "description": "Create a rematch of a match that was previously completed, with the same participants. This can be called by only one player on a match still in their list; the player must have called Finish first. Returns the newly created match; it will be the caller's turn.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "matchId": { + "type": "string", + "description": "The ID of the match.", + "required": true, + "location": "path" + }, + "requestId": { + "type": "string", + "description": "A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "matchId" + ], + "response": { + "$ref": "TurnBasedMatchRematch" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "sync": { + "id": "games.turnBasedMatches.sync", + "path": "turnbasedmatches/sync", + "httpMethod": "GET", + "description": "Returns turn-based matches the player is or was involved in that changed since the last sync call, with the least recent changes coming first. Matches that should be removed from the local cache will have a status of MATCH_DELETED.", + "parameters": { + "includeMatchData": { + "type": "boolean", + "description": "True if match data should be returned in the response. Note that not all data will necessarily be returned if include_match_data is true; the server may decide to only return data for some of the matches to limit download size for the client. The remainder of the data for these matches will be retrievable on request.", + "location": "query" + }, + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "maxCompletedMatches": { + "type": "integer", + "description": "The maximum number of completed or canceled matches to return in the response. If not set, all matches returned could be completed or canceled.", + "format": "int32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of matches to return in the response, used for paging. For any response, the actual number of matches to return may be less than the specified maxResults.", + "format": "int32", + "minimum": "1", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + } + }, + "response": { + "$ref": "TurnBasedMatchSync" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "takeTurn": { + "id": "games.turnBasedMatches.takeTurn", + "path": "turnbasedmatches/{matchId}/turn", + "httpMethod": "PUT", + "description": "Commit the results of a player turn.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "matchId": { + "type": "string", + "description": "The ID of the match.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "matchId" + ], + "request": { + "$ref": "TurnBasedMatchTurn" + }, + "response": { + "$ref": "TurnBasedMatch" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/games/v1/games-gen.go b/third_party/src/code.google.com/p/google-api-go-client/games/v1/games-gen.go new file mode 100644 index 0000000000000..bcc80a0c42c8f --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/games/v1/games-gen.go @@ -0,0 +1,5694 @@ +// Package games provides access to the Google Play Game Services API. +// +// See https://developers.google.com/games/services/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/games/v1" +// ... +// gamesService, err := games.New(oauthHttpClient) +package games + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "games:v1" +const apiName = "games" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/games/v1/" + +// OAuth2 scopes used by this API. +const ( + // Share your Google+ profile information and view and manage your game + // activity + GamesScope = "https://www.googleapis.com/auth/games" + + // Know your basic profile info and list of people in your circles. + PlusLoginScope = "https://www.googleapis.com/auth/plus.login" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.AchievementDefinitions = NewAchievementDefinitionsService(s) + s.Achievements = NewAchievementsService(s) + s.Applications = NewApplicationsService(s) + s.Leaderboards = NewLeaderboardsService(s) + s.Players = NewPlayersService(s) + s.Pushtokens = NewPushtokensService(s) + s.Revisions = NewRevisionsService(s) + s.Rooms = NewRoomsService(s) + s.Scores = NewScoresService(s) + s.TurnBasedMatches = NewTurnBasedMatchesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + AchievementDefinitions *AchievementDefinitionsService + + Achievements *AchievementsService + + Applications *ApplicationsService + + Leaderboards *LeaderboardsService + + Players *PlayersService + + Pushtokens *PushtokensService + + Revisions *RevisionsService + + Rooms *RoomsService + + Scores *ScoresService + + TurnBasedMatches *TurnBasedMatchesService +} + +func NewAchievementDefinitionsService(s *Service) *AchievementDefinitionsService { + rs := &AchievementDefinitionsService{s: s} + return rs +} + +type AchievementDefinitionsService struct { + s *Service +} + +func NewAchievementsService(s *Service) *AchievementsService { + rs := &AchievementsService{s: s} + return rs +} + +type AchievementsService struct { + s *Service +} + +func NewApplicationsService(s *Service) *ApplicationsService { + rs := &ApplicationsService{s: s} + return rs +} + +type ApplicationsService struct { + s *Service +} + +func NewLeaderboardsService(s *Service) *LeaderboardsService { + rs := &LeaderboardsService{s: s} + return rs +} + +type LeaderboardsService struct { + s *Service +} + +func NewPlayersService(s *Service) *PlayersService { + rs := &PlayersService{s: s} + return rs +} + +type PlayersService struct { + s *Service +} + +func NewPushtokensService(s *Service) *PushtokensService { + rs := &PushtokensService{s: s} + return rs +} + +type PushtokensService struct { + s *Service +} + +func NewRevisionsService(s *Service) *RevisionsService { + rs := &RevisionsService{s: s} + return rs +} + +type RevisionsService struct { + s *Service +} + +func NewRoomsService(s *Service) *RoomsService { + rs := &RoomsService{s: s} + return rs +} + +type RoomsService struct { + s *Service +} + +func NewScoresService(s *Service) *ScoresService { + rs := &ScoresService{s: s} + return rs +} + +type ScoresService struct { + s *Service +} + +func NewTurnBasedMatchesService(s *Service) *TurnBasedMatchesService { + rs := &TurnBasedMatchesService{s: s} + return rs +} + +type TurnBasedMatchesService struct { + s *Service +} + +type AchievementDefinition struct { + // AchievementType: The type of the achievement. + // Possible values are: + // + // - "STANDARD" - Achievement is either locked or unlocked. + // - + // "INCREMENTAL" - Achievement is incremental. + AchievementType string `json:"achievementType,omitempty"` + + // Description: The description of the achievement. + Description string `json:"description,omitempty"` + + // FormattedTotalSteps: The total steps for an incremental achievement + // as a string. + FormattedTotalSteps string `json:"formattedTotalSteps,omitempty"` + + // Id: The ID of the achievement. + Id string `json:"id,omitempty"` + + // InitialState: The initial state of the achievement. + // Possible values + // are: + // - "HIDDEN" - Achievement is hidden. + // - "REVEALED" - + // Achievement is revealed. + // - "UNLOCKED" - Achievement is unlocked. + InitialState string `json:"initialState,omitempty"` + + // IsRevealedIconUrlDefault: Indicates whether the revealed icon image + // being returned is a default image, or is provided by the game. + IsRevealedIconUrlDefault bool `json:"isRevealedIconUrlDefault,omitempty"` + + // IsUnlockedIconUrlDefault: Indicates whether the unlocked icon image + // being returned is a default image, or is game-provided. + IsUnlockedIconUrlDefault bool `json:"isUnlockedIconUrlDefault,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#achievementDefinition. + Kind string `json:"kind,omitempty"` + + // Name: The name of the achievement. + Name string `json:"name,omitempty"` + + // RevealedIconUrl: The image URL for the revealed achievement icon. + RevealedIconUrl string `json:"revealedIconUrl,omitempty"` + + // TotalSteps: The total steps for an incremental achievement. + TotalSteps int64 `json:"totalSteps,omitempty"` + + // UnlockedIconUrl: The image URL for the unlocked achievement icon. + UnlockedIconUrl string `json:"unlockedIconUrl,omitempty"` +} + +type AchievementDefinitionsListResponse struct { + // Items: The achievement definitions. + Items []*AchievementDefinition `json:"items,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#achievementDefinitionsListResponse. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token corresponding to the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type AchievementIncrementResponse struct { + // CurrentSteps: The current steps recorded for this incremental + // achievement. + CurrentSteps int64 `json:"currentSteps,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#achievementIncrementResponse. + Kind string `json:"kind,omitempty"` + + // NewlyUnlocked: Whether the the current steps for the achievement has + // reached the number of steps required to unlock. + NewlyUnlocked bool `json:"newlyUnlocked,omitempty"` +} + +type AchievementRevealResponse struct { + // CurrentState: The current state of the achievement for which a reveal + // was attempted. This might be UNLOCKED if the achievement was already + // unlocked. + // Possible values are: + // - "REVEALED" - Achievement is + // revealed. + // - "UNLOCKED" - Achievement is unlocked. + CurrentState string `json:"currentState,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#achievementRevealResponse. + Kind string `json:"kind,omitempty"` +} + +type AchievementSetStepsAtLeastResponse struct { + // CurrentSteps: The current steps recorded for this incremental + // achievement. + CurrentSteps int64 `json:"currentSteps,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#achievementSetStepsAtLeastResponse. + Kind string `json:"kind,omitempty"` + + // NewlyUnlocked: Whether the the current steps for the achievement has + // reached the number of steps required to unlock. + NewlyUnlocked bool `json:"newlyUnlocked,omitempty"` +} + +type AchievementUnlockResponse struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#achievementUnlockResponse. + Kind string `json:"kind,omitempty"` + + // NewlyUnlocked: Whether this achievement was newly unlocked (that is, + // whether the unlock request for the achievement was the first for the + // player). + NewlyUnlocked bool `json:"newlyUnlocked,omitempty"` +} + +type AchievementUpdateMultipleRequest struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#achievementUpdateMultipleRequest. + Kind string `json:"kind,omitempty"` + + // Updates: The individual achievement update requests. + Updates []*AchievementUpdateRequest `json:"updates,omitempty"` +} + +type AchievementUpdateMultipleResponse struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#achievementUpdateListResponse. + Kind string `json:"kind,omitempty"` + + // UpdatedAchievements: The updated state of the achievements. + UpdatedAchievements []*AchievementUpdateResponse `json:"updatedAchievements,omitempty"` +} + +type AchievementUpdateRequest struct { + // AchievementId: The achievement this update is being applied to. + AchievementId string `json:"achievementId,omitempty"` + + // IncrementPayload: The payload if an update of type INCREMENT was + // requested for the achievement. + IncrementPayload *GamesAchievementIncrement `json:"incrementPayload,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#achievementUpdateRequest. + Kind string `json:"kind,omitempty"` + + // SetStepsAtLeastPayload: The payload if an update of type + // SET_STEPS_AT_LEAST was requested for the achievement. + SetStepsAtLeastPayload *GamesAchievementSetStepsAtLeast `json:"setStepsAtLeastPayload,omitempty"` + + // UpdateType: The type of update being applied. + // Possible values are: + // + // - "REVEAL" - Achievement is revealed. + // - "UNLOCK" - Achievement is + // unlocked. + // - "INCREMENT" - Achievement is incremented. + // - + // "SET_STEPS_AT_LEAST" - Achievement progress is set to at least the + // passed value. + UpdateType string `json:"updateType,omitempty"` +} + +type AchievementUpdateResponse struct { + // AchievementId: The achievement this update is was applied to. + AchievementId string `json:"achievementId,omitempty"` + + // CurrentState: The current state of the achievement. + // Possible values + // are: + // - "HIDDEN" - Achievement is hidden. + // - "REVEALED" - + // Achievement is revealed. + // - "UNLOCKED" - Achievement is unlocked. + CurrentState string `json:"currentState,omitempty"` + + // CurrentSteps: The current steps recorded for this achievement if it + // is incremental. + CurrentSteps int64 `json:"currentSteps,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#achievementUpdateResponse. + Kind string `json:"kind,omitempty"` + + // NewlyUnlocked: Whether this achievement was newly unlocked (that is, + // whether the unlock request for the achievement was the first for the + // player). + NewlyUnlocked bool `json:"newlyUnlocked,omitempty"` + + // UpdateOccurred: Whether the requested updates actually affected the + // achievement. + UpdateOccurred bool `json:"updateOccurred,omitempty"` +} + +type AggregateStats struct { + // Count: The number of messages sent between a pair of peers. + Count int64 `json:"count,omitempty,string"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#aggregateStats. + Kind string `json:"kind,omitempty"` + + // Max: The maximum amount. + Max int64 `json:"max,omitempty,string"` + + // Min: The minimum amount. + Min int64 `json:"min,omitempty,string"` + + // Sum: The total number of bytes sent for messages between a pair of + // peers. + Sum int64 `json:"sum,omitempty,string"` +} + +type AnonymousPlayer struct { + // AvatarImageUrl: The base URL for the image to display for the + // anonymous player. + AvatarImageUrl string `json:"avatarImageUrl,omitempty"` + + // DisplayName: The name to display for the anonymous player. + DisplayName string `json:"displayName,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#anonymousPlayer. + Kind string `json:"kind,omitempty"` +} + +type Application struct { + // Achievement_count: The number of achievements visible to the + // currently authenticated player. + Achievement_count int64 `json:"achievement_count,omitempty"` + + // Assets: The assets of the application. + Assets []*ImageAsset `json:"assets,omitempty"` + + // Author: The author of the application. + Author string `json:"author,omitempty"` + + // Category: The category of the application. + Category *ApplicationCategory `json:"category,omitempty"` + + // Description: The description of the application. + Description string `json:"description,omitempty"` + + // Id: The ID of the application. + Id string `json:"id,omitempty"` + + // Instances: The instances of the application. + Instances []*Instance `json:"instances,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#application. + Kind string `json:"kind,omitempty"` + + // LastUpdatedTimestamp: The last updated timestamp of the application. + LastUpdatedTimestamp int64 `json:"lastUpdatedTimestamp,omitempty,string"` + + // Leaderboard_count: The number of leaderboards visible to the + // currently authenticated player. + Leaderboard_count int64 `json:"leaderboard_count,omitempty"` + + // Name: The name of the application. + Name string `json:"name,omitempty"` +} + +type ApplicationCategory struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#applicationCategory. + Kind string `json:"kind,omitempty"` + + // Primary: The primary category. + Primary string `json:"primary,omitempty"` + + // Secondary: The secondary category. + Secondary string `json:"secondary,omitempty"` +} + +type GamesAchievementIncrement struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#GamesAchievementIncrement. + Kind string `json:"kind,omitempty"` + + // RequestId: The requestId associated with an increment to an + // achievement. + RequestId int64 `json:"requestId,omitempty,string"` + + // Steps: The number of steps to be incremented. + Steps int64 `json:"steps,omitempty"` +} + +type GamesAchievementSetStepsAtLeast struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#GamesAchievementSetStepsAtLeast. + Kind string `json:"kind,omitempty"` + + // Steps: The minimum number of steps for the achievement to be set to. + Steps int64 `json:"steps,omitempty"` +} + +type ImageAsset struct { + // Height: The height of the asset. + Height int64 `json:"height,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#imageAsset. + Kind string `json:"kind,omitempty"` + + // Name: The name of the asset. + Name string `json:"name,omitempty"` + + // Url: The URL of the asset. + Url string `json:"url,omitempty"` + + // Width: The width of the asset. + Width int64 `json:"width,omitempty"` +} + +type Instance struct { + // AcquisitionUri: URI which shows where a user can acquire this + // instance. + AcquisitionUri string `json:"acquisitionUri,omitempty"` + + // AndroidInstance: Platform dependent details for Android. + AndroidInstance *InstanceAndroidDetails `json:"androidInstance,omitempty"` + + // IosInstance: Platform dependent details for iOS. + IosInstance *InstanceIosDetails `json:"iosInstance,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#instance. + Kind string `json:"kind,omitempty"` + + // Name: Localized display name. + Name string `json:"name,omitempty"` + + // PlatformType: The platform type. + // Possible values are: + // - "ANDROID" - + // Instance is for Android. + // - "IOS" - Instance is for iOS + // - "WEB_APP" + // - Instance is for Web App. + PlatformType string `json:"platformType,omitempty"` + + // RealtimePlay: Flag to show if this game instance supports realtime + // play. + RealtimePlay bool `json:"realtimePlay,omitempty"` + + // TurnBasedPlay: Flag to show if this game instance supports turn based + // play. + TurnBasedPlay bool `json:"turnBasedPlay,omitempty"` + + // WebInstance: Platform dependent details for Web. + WebInstance *InstanceWebDetails `json:"webInstance,omitempty"` +} + +type InstanceAndroidDetails struct { + // EnablePiracyCheck: Flag indicating whether the anti-piracy check is + // enabled. + EnablePiracyCheck bool `json:"enablePiracyCheck,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#instanceAndroidDetails. + Kind string `json:"kind,omitempty"` + + // PackageName: Android package name which maps to Google Play URL. + PackageName string `json:"packageName,omitempty"` + + // Preferred: Indicates that this instance is the default for new + // installations. + Preferred bool `json:"preferred,omitempty"` +} + +type InstanceIosDetails struct { + // BundleIdentifier: Bundle identifier. + BundleIdentifier string `json:"bundleIdentifier,omitempty"` + + // ItunesAppId: iTunes App ID. + ItunesAppId string `json:"itunesAppId,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#instanceIosDetails. + Kind string `json:"kind,omitempty"` + + // PreferredForIpad: Indicates that this instance is the default for new + // installations on iPad devices. + PreferredForIpad bool `json:"preferredForIpad,omitempty"` + + // PreferredForIphone: Indicates that this instance is the default for + // new installations on iPhone devices. + PreferredForIphone bool `json:"preferredForIphone,omitempty"` + + // SupportIpad: Flag to indicate if this instance supports iPad. + SupportIpad bool `json:"supportIpad,omitempty"` + + // SupportIphone: Flag to indicate if this instance supports iPhone. + SupportIphone bool `json:"supportIphone,omitempty"` +} + +type InstanceWebDetails struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#instanceWebDetails. + Kind string `json:"kind,omitempty"` + + // LaunchUrl: Launch URL for the game. + LaunchUrl string `json:"launchUrl,omitempty"` + + // Preferred: Indicates that this instance is the default for new + // installations. + Preferred bool `json:"preferred,omitempty"` +} + +type Leaderboard struct { + // IconUrl: The icon for the leaderboard. + IconUrl string `json:"iconUrl,omitempty"` + + // Id: The leaderboard ID. + Id string `json:"id,omitempty"` + + // IsIconUrlDefault: Indicates whether the icon image being returned is + // a default image, or is game-provided. + IsIconUrlDefault bool `json:"isIconUrlDefault,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#leaderboard. + Kind string `json:"kind,omitempty"` + + // Name: The name of the leaderboard. + Name string `json:"name,omitempty"` + + // Order: How scores are ordered. + // Possible values are: + // - + // "LARGER_IS_BETTER" - Larger values are better; scores are sorted in + // descending order. + // - "SMALLER_IS_BETTER" - Smaller values are better; + // scores are sorted in ascending order. + Order string `json:"order,omitempty"` +} + +type LeaderboardEntry struct { + // FormattedScore: The localized string for the numerical value of this + // score. + FormattedScore string `json:"formattedScore,omitempty"` + + // FormattedScoreRank: The localized string for the rank of this score + // for this leaderboard. + FormattedScoreRank string `json:"formattedScoreRank,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#leaderboardEntry. + Kind string `json:"kind,omitempty"` + + // Player: The player who holds this score. + Player *Player `json:"player,omitempty"` + + // ScoreRank: The rank of this score for this leaderboard. + ScoreRank int64 `json:"scoreRank,omitempty,string"` + + // ScoreTag: Additional information about the score. Values must contain + // no more than 64 URI-safe characters as defined by section 2.3 of RFC + // 3986. + ScoreTag string `json:"scoreTag,omitempty"` + + // ScoreValue: The numerical value of this score. + ScoreValue int64 `json:"scoreValue,omitempty,string"` + + // TimeSpan: The time span of this high score. + // Possible values are: + // - + // "ALL_TIME" - The score is an all-time high score. + // - "WEEKLY" - The + // score is a weekly high score. + // - "DAILY" - The score is a daily high + // score. + TimeSpan string `json:"timeSpan,omitempty"` + + // WriteTimestampMillis: The timestamp at which this score was recorded, + // in milliseconds since the epoch in UTC. + WriteTimestampMillis int64 `json:"writeTimestampMillis,omitempty,string"` +} + +type LeaderboardListResponse struct { + // Items: The leaderboards. + Items []*Leaderboard `json:"items,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#leaderboardListResponse. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token corresponding to the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type LeaderboardScoreRank struct { + // FormattedNumScores: The number of scores in the leaderboard as a + // string. + FormattedNumScores string `json:"formattedNumScores,omitempty"` + + // FormattedRank: The rank in the leaderboard as a string. + FormattedRank string `json:"formattedRank,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#leaderboardScoreRank. + Kind string `json:"kind,omitempty"` + + // NumScores: The number of scores in the leaderboard. + NumScores int64 `json:"numScores,omitempty,string"` + + // Rank: The rank in the leaderboard. + Rank int64 `json:"rank,omitempty,string"` +} + +type LeaderboardScores struct { + // Items: The scores in the leaderboard. + Items []*LeaderboardEntry `json:"items,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#leaderboardScores. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The pagination token for the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // NumScores: The total number of scores in the leaderboard. + NumScores int64 `json:"numScores,omitempty,string"` + + // PlayerScore: The score of the requesting player on the leaderboard. + // The player's score may appear both here and in the list of scores + // above. If you are viewing a public leaderboard and the player is not + // sharing their gameplay information publicly, the scoreRank and + // formattedScoreRank values will not be present. + PlayerScore *LeaderboardEntry `json:"playerScore,omitempty"` + + // PrevPageToken: The pagination token for the previous page of results. + PrevPageToken string `json:"prevPageToken,omitempty"` +} + +type NetworkDiagnostics struct { + // AndroidNetworkSubtype: The Android network subtype. + AndroidNetworkSubtype int64 `json:"androidNetworkSubtype,omitempty"` + + // AndroidNetworkType: The Android network type. + AndroidNetworkType int64 `json:"androidNetworkType,omitempty"` + + // IosNetworkType: iOS network type as defined in Reachability.h. + IosNetworkType int64 `json:"iosNetworkType,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#networkDiagnostics. + Kind string `json:"kind,omitempty"` + + // RegistrationLatencyMillis: The amount of time in milliseconds it took + // for the client to establish a connection with the XMPP server. + RegistrationLatencyMillis int64 `json:"registrationLatencyMillis,omitempty"` +} + +type ParticipantResult struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#participantResult. + Kind string `json:"kind,omitempty"` + + // ParticipantId: The ID of the participant. + ParticipantId string `json:"participantId,omitempty"` + + // Placing: The placement or ranking of the participant in the match + // results; a number from one to the number of participants in the + // match. Multiple participants may have the same placing value in case + // of a type. + Placing int64 `json:"placing,omitempty"` + + // Result: The result of the participant for this match. + // Possible values + // are: + // - "MATCH_RESULT_WIN" - The participant won the match. + // - + // "MATCH_RESULT_LOSS" - The participant lost the match. + // - + // "MATCH_RESULT_TIE" - The participant tied the match. + // - + // "MATCH_RESULT_NONE" - There was no winner for the match (nobody wins + // or loses this kind of game.) + // - "MATCH_RESULT_DISCONNECT" - The + // participant disconnected / left during the match. + // - + // "MATCH_RESULT_DISAGREED" - Different clients reported different + // results for this participant. + Result string `json:"result,omitempty"` +} + +type PeerChannelDiagnostics struct { + // BytesReceived: Number of bytes received. + BytesReceived *AggregateStats `json:"bytesReceived,omitempty"` + + // BytesSent: Number of bytes sent. + BytesSent *AggregateStats `json:"bytesSent,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#peerChannelDiagnostics. + Kind string `json:"kind,omitempty"` + + // NumMessagesLost: Number of messages lost. + NumMessagesLost int64 `json:"numMessagesLost,omitempty"` + + // NumMessagesReceived: Number of messages received. + NumMessagesReceived int64 `json:"numMessagesReceived,omitempty"` + + // NumMessagesSent: Number of messages sent. + NumMessagesSent int64 `json:"numMessagesSent,omitempty"` + + // NumSendFailures: Number of send failures. + NumSendFailures int64 `json:"numSendFailures,omitempty"` + + // RoundtripLatencyMillis: Roundtrip latency stats in milliseconds. + RoundtripLatencyMillis *AggregateStats `json:"roundtripLatencyMillis,omitempty"` +} + +type PeerSessionDiagnostics struct { + // ConnectedTimestampMillis: Connected time in milliseconds. + ConnectedTimestampMillis int64 `json:"connectedTimestampMillis,omitempty,string"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#peerSessionDiagnostics. + Kind string `json:"kind,omitempty"` + + // ParticipantId: The participant ID of the peer. + ParticipantId string `json:"participantId,omitempty"` + + // ReliableChannel: Reliable channel diagnostics. + ReliableChannel *PeerChannelDiagnostics `json:"reliableChannel,omitempty"` + + // UnreliableChannel: Unreliable channel diagnostics. + UnreliableChannel *PeerChannelDiagnostics `json:"unreliableChannel,omitempty"` +} + +type Played struct { + // AutoMatched: True if the player was auto-matched with the currently + // authenticated user. + AutoMatched bool `json:"autoMatched,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#played. + Kind string `json:"kind,omitempty"` + + // TimeMillis: The last time the player played the game in milliseconds + // since the epoch in UTC. + TimeMillis int64 `json:"timeMillis,omitempty,string"` +} + +type Player struct { + // AvatarImageUrl: The base URL for the image that represents the + // player. + AvatarImageUrl string `json:"avatarImageUrl,omitempty"` + + // DisplayName: The name to display for the player. + DisplayName string `json:"displayName,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#player. + Kind string `json:"kind,omitempty"` + + // LastPlayedWith: Details about the last time this player played a + // multiplayer game with the currently authenticated player. Populated + // for PLAYED_WITH player collection members. + LastPlayedWith *Played `json:"lastPlayedWith,omitempty"` + + // Name: An object representation of the individual components of the + // player's name. + Name *PlayerName `json:"name,omitempty"` + + // PlayerId: The ID of the player. + PlayerId string `json:"playerId,omitempty"` +} + +type PlayerName struct { + // FamilyName: The family name (last name) of this player. + FamilyName string `json:"familyName,omitempty"` + + // GivenName: The given name (first name) of this player. + GivenName string `json:"givenName,omitempty"` +} + +type PlayerAchievement struct { + // AchievementState: The state of the achievement. + // Possible values are: + // + // - "HIDDEN" - Achievement is hidden. + // - "REVEALED" - Achievement is + // revealed. + // - "UNLOCKED" - Achievement is unlocked. + AchievementState string `json:"achievementState,omitempty"` + + // CurrentSteps: The current steps for an incremental achievement. + CurrentSteps int64 `json:"currentSteps,omitempty"` + + // FormattedCurrentStepsString: The current steps for an incremental + // achievement as a string. + FormattedCurrentStepsString string `json:"formattedCurrentStepsString,omitempty"` + + // Id: The ID of the achievement. + Id string `json:"id,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#playerAchievement. + Kind string `json:"kind,omitempty"` + + // LastUpdatedTimestamp: The timestamp of the last modification to this + // achievement's state. + LastUpdatedTimestamp int64 `json:"lastUpdatedTimestamp,omitempty,string"` +} + +type PlayerAchievementListResponse struct { + // Items: The achievements. + Items []*PlayerAchievement `json:"items,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#playerAchievementListResponse. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token corresponding to the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type PlayerLeaderboardScore struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#playerLeaderboardScore. + Kind string `json:"kind,omitempty"` + + // Leaderboard_id: The ID of the leaderboard this score is in. + Leaderboard_id string `json:"leaderboard_id,omitempty"` + + // PublicRank: The public rank of the score in this leaderboard. This + // object will not be present if the user is not sharing their scores + // publicly. + PublicRank *LeaderboardScoreRank `json:"publicRank,omitempty"` + + // ScoreString: The formatted value of this score. + ScoreString string `json:"scoreString,omitempty"` + + // ScoreTag: Additional information about the score. Values must contain + // no more than 64 URI-safe characters as defined by section 2.3 of RFC + // 3986. + ScoreTag string `json:"scoreTag,omitempty"` + + // ScoreValue: The numerical value of this score. + ScoreValue int64 `json:"scoreValue,omitempty,string"` + + // SocialRank: The social rank of the score in this leaderboard. + SocialRank *LeaderboardScoreRank `json:"socialRank,omitempty"` + + // TimeSpan: The time span of this score. + // Possible values are: + // - + // "ALL_TIME" - The score is an all-time score. + // - "WEEKLY" - The score + // is a weekly score. + // - "DAILY" - The score is a daily score. + TimeSpan string `json:"timeSpan,omitempty"` + + // WriteTimestamp: The timestamp at which this score was recorded, in + // milliseconds since the epoch in UTC. + WriteTimestamp int64 `json:"writeTimestamp,omitempty,string"` +} + +type PlayerLeaderboardScoreListResponse struct { + // Items: The leaderboard scores. + Items []*PlayerLeaderboardScore `json:"items,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#playerLeaderboardScoreListResponse. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The pagination token for the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Player: The Player resources for the owner of this score. + Player *Player `json:"player,omitempty"` +} + +type PlayerListResponse struct { + // Items: The players. + Items []*Player `json:"items,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#playerListResponse. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token corresponding to the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type PlayerScore struct { + // FormattedScore: The formatted score for this player score. + FormattedScore string `json:"formattedScore,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#playerScore. + Kind string `json:"kind,omitempty"` + + // Score: The numerical value for this player score. + Score int64 `json:"score,omitempty,string"` + + // ScoreTag: Additional information about this score. Values will + // contain no more than 64 URI-safe characters as defined by section 2.3 + // of RFC 3986. + ScoreTag string `json:"scoreTag,omitempty"` + + // TimeSpan: The time span for this player score. + // Possible values are: + // + // - "ALL_TIME" - The score is an all-time score. + // - "WEEKLY" - The + // score is a weekly score. + // - "DAILY" - The score is a daily score. + TimeSpan string `json:"timeSpan,omitempty"` +} + +type PlayerScoreListResponse struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#playerScoreListResponse. + Kind string `json:"kind,omitempty"` + + // SubmittedScores: The score submissions statuses. + SubmittedScores []*PlayerScoreResponse `json:"submittedScores,omitempty"` +} + +type PlayerScoreResponse struct { + // BeatenScoreTimeSpans: The time spans where the submitted score is + // better than the existing score for that time span. + // Possible values + // are: + // - "ALL_TIME" - The score is an all-time score. + // - "WEEKLY" - + // The score is a weekly score. + // - "DAILY" - The score is a daily score. + BeatenScoreTimeSpans []string `json:"beatenScoreTimeSpans,omitempty"` + + // FormattedScore: The formatted value of the submitted score. + FormattedScore string `json:"formattedScore,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#playerScoreResponse. + Kind string `json:"kind,omitempty"` + + // LeaderboardId: The leaderboard ID that this score was submitted to. + LeaderboardId string `json:"leaderboardId,omitempty"` + + // ScoreTag: Additional information about this score. Values will + // contain no more than 64 URI-safe characters as defined by section 2.3 + // of RFC 3986. + ScoreTag string `json:"scoreTag,omitempty"` + + // UnbeatenScores: The scores in time spans that have not been beaten. + // As an example, the submitted score may be better than the player's + // DAILY score, but not better than the player's scores for the WEEKLY + // or ALL_TIME time spans. + UnbeatenScores []*PlayerScore `json:"unbeatenScores,omitempty"` +} + +type PlayerScoreSubmissionList struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#playerScoreSubmissionList. + Kind string `json:"kind,omitempty"` + + // Scores: The score submissions. + Scores []*ScoreSubmission `json:"scores,omitempty"` +} + +type PushToken struct { + // ClientRevision: The revision of the client SDK used by your + // application, in the same format that's used by revisions.check. Used + // to send backward compatible messages. Format: + // [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE + // are: + // - IOS - Push token is for iOS + ClientRevision string `json:"clientRevision,omitempty"` + + // Id: Unique identifier for this push token. + Id *PushTokenId `json:"id,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#pushToken. + Kind string `json:"kind,omitempty"` + + // Language: The preferred language for notifications that are sent + // using this token. + Language string `json:"language,omitempty"` +} + +type PushTokenId struct { + // Ios: A push token ID for iOS devices. + Ios *PushTokenIdIos `json:"ios,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#pushTokenId. + Kind string `json:"kind,omitempty"` +} + +type PushTokenIdIos struct { + // Apns_device_token: Device token supplied by an iOS system call to + // register for remote notifications. Encode this field as web-safe + // base64. + Apns_device_token string `json:"apns_device_token,omitempty"` + + // Apns_environment: Use SANDBOX during development for the APNS test + // server at gateway.sandbox.push.apple.com or PRODUCTION for the + // production server at gateway.push.apple.com. + Apns_environment string `json:"apns_environment,omitempty"` +} + +type RevisionCheckResponse struct { + // ApiVersion: The version of the API this client revision should use + // when calling API methods. + ApiVersion string `json:"apiVersion,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#revisionCheckResponse. + Kind string `json:"kind,omitempty"` + + // RevisionStatus: The result of the revision check. + // Possible values + // are: + // - "OK" - The revision being used is current. + // - "DEPRECATED" - + // There is currently a newer version available, but the revision being + // used still works. + // - "INVALID" - The revision being used is not + // supported in any released version. + RevisionStatus string `json:"revisionStatus,omitempty"` +} + +type Room struct { + // ApplicationId: The ID of the application being played. + ApplicationId string `json:"applicationId,omitempty"` + + // AutoMatchingCriteria: Criteria for auto-matching players into this + // room. + AutoMatchingCriteria *RoomAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"` + + // AutoMatchingStatus: Auto-matching status for this room. Not set if + // the room is not currently in the auto-matching queue. + AutoMatchingStatus *RoomAutoMatchStatus `json:"autoMatchingStatus,omitempty"` + + // CreationDetails: Details about the room creation. + CreationDetails *RoomModification `json:"creationDetails,omitempty"` + + // Description: This short description is generated by our servers and + // worded relative to the player requesting the room. It is intended to + // be displayed when the room is shown in a list (that is, an invitation + // to a room.) + Description string `json:"description,omitempty"` + + // InviterId: The ID of the participant that invited the user to the + // room. Not set if the user was not invited to the room. + InviterId string `json:"inviterId,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#room. + Kind string `json:"kind,omitempty"` + + // LastUpdateDetails: Details about the last update to the room. + LastUpdateDetails *RoomModification `json:"lastUpdateDetails,omitempty"` + + // Participants: The participants involved in the room, along with their + // statuses. Includes participants who have left or declined + // invitations. + Participants []*RoomParticipant `json:"participants,omitempty"` + + // RoomId: Globally unique ID for a room. + RoomId string `json:"roomId,omitempty"` + + // RoomStatusVersion: The version of the room status: an increasing + // counter, used by the client to ignore out-of-order updates to room + // status. + RoomStatusVersion int64 `json:"roomStatusVersion,omitempty"` + + // Status: The status of the room. + // Possible values are: + // - + // "ROOM_INVITING" - One or more players have been invited and not + // responded. + // - "ROOM_AUTO_MATCHING" - One or more slots need to be + // filled by auto-matching. + // - "ROOM_CONNECTING" - Players have joined + // and are connecting to each other (either before or after + // auto-matching). + // - "ROOM_ACTIVE" - All players have joined and + // connected to each other. + // - "ROOM_DELETED" - The room should no + // longer be shown on the client. Returned in sync calls when a player + // joins a room (as a tombstone), or for rooms where all joined + // participants have left. + Status string `json:"status,omitempty"` + + // Variant: The variant / mode of the application being played; can be + // any integer value, or left blank. + Variant int64 `json:"variant,omitempty"` +} + +type RoomAutoMatchStatus struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#roomAutoMatchStatus. + Kind string `json:"kind,omitempty"` + + // WaitEstimateSeconds: An estimate for the amount of time (in seconds) + // that auto-matching is expected to take to complete. + WaitEstimateSeconds int64 `json:"waitEstimateSeconds,omitempty"` +} + +type RoomAutoMatchingCriteria struct { + // ExclusiveBitmask: A bitmask indicating when auto-matches are valid. + // When ANDed with other exclusive bitmasks, the result must be zero. + // Can be used to support exclusive roles within a game. + ExclusiveBitmask int64 `json:"exclusiveBitmask,omitempty,string"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#roomAutoMatchingCriteria. + Kind string `json:"kind,omitempty"` + + // MaxAutoMatchingPlayers: The maximum number of players that should be + // added to the room by auto-matching. + MaxAutoMatchingPlayers int64 `json:"maxAutoMatchingPlayers,omitempty"` + + // MinAutoMatchingPlayers: The minimum number of players that should be + // added to the room by auto-matching. + MinAutoMatchingPlayers int64 `json:"minAutoMatchingPlayers,omitempty"` +} + +type RoomClientAddress struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#roomClientAddress. + Kind string `json:"kind,omitempty"` + + // XmppAddress: The XMPP address of the client on the Google Games XMPP + // network. + XmppAddress string `json:"xmppAddress,omitempty"` +} + +type RoomCreateRequest struct { + // AutoMatchingCriteria: Criteria for auto-matching players into this + // room. + AutoMatchingCriteria *RoomAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"` + + // Capabilities: The capabilities that this client supports for realtime + // communication. + Capabilities []string `json:"capabilities,omitempty"` + + // ClientAddress: Client address for the player creating the room. + ClientAddress *RoomClientAddress `json:"clientAddress,omitempty"` + + // InvitedPlayerIds: The player IDs to invite to the room. + InvitedPlayerIds []string `json:"invitedPlayerIds,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#roomCreateRequest. + Kind string `json:"kind,omitempty"` + + // NetworkDiagnostics: Network diagnostics for the client creating the + // room. + NetworkDiagnostics *NetworkDiagnostics `json:"networkDiagnostics,omitempty"` + + // RequestId: A randomly generated numeric ID. This number is used at + // the server to ensure that the request is handled correctly across + // retries. + RequestId int64 `json:"requestId,omitempty,string"` + + // Variant: The variant / mode of the application to be played. This can + // be any integer value, or left blank. You should use a small number of + // variants to keep the auto-matching pool as large as possible. + Variant int64 `json:"variant,omitempty"` +} + +type RoomJoinRequest struct { + // Capabilities: The capabilities that this client supports for realtime + // communication. + Capabilities []string `json:"capabilities,omitempty"` + + // ClientAddress: Client address for the player joining the room. + ClientAddress *RoomClientAddress `json:"clientAddress,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#roomJoinRequest. + Kind string `json:"kind,omitempty"` + + // NetworkDiagnostics: Network diagnostics for the client joining the + // room. + NetworkDiagnostics *NetworkDiagnostics `json:"networkDiagnostics,omitempty"` +} + +type RoomLeaveDiagnostics struct { + // AndroidNetworkSubtype: Android network subtype. + // http://developer.android.com/reference/android/net/NetworkInfo.html#ge + // tSubtype() + AndroidNetworkSubtype int64 `json:"androidNetworkSubtype,omitempty"` + + // AndroidNetworkType: Android network type. + // http://developer.android.com/reference/android/net/NetworkInfo.html#ge + // tType() + AndroidNetworkType int64 `json:"androidNetworkType,omitempty"` + + // IosNetworkType: iOS network type as defined in Reachability.h. + IosNetworkType int64 `json:"iosNetworkType,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#roomLeaveDiagnostics. + Kind string `json:"kind,omitempty"` + + // PeerSession: Diagnostics about all peer sessions. + PeerSession []*PeerSessionDiagnostics `json:"peerSession,omitempty"` + + // SocketsUsed: Whether or not sockets were used. + SocketsUsed bool `json:"socketsUsed,omitempty"` +} + +type RoomLeaveRequest struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#roomLeaveRequest. + Kind string `json:"kind,omitempty"` + + // LeaveDiagnostics: Diagnostics for a player leaving the room. + LeaveDiagnostics *RoomLeaveDiagnostics `json:"leaveDiagnostics,omitempty"` + + // Reason: Reason for leaving the match. + // Possible values are: + // - + // "PLAYER_LEFT" - The player chose to leave the room.. + // - "GAME_LEFT" - + // The game chose to remove the player from the room. + // - + // "REALTIME_ABANDONED" - The player switched to another application and + // abandoned the room. + // - "REALTIME_PEER_CONNECTION_FAILURE" - The + // client was unable to establish a connection to other peer(s). + // - + // "REALTIME_SERVER_CONNECTION_FAILURE" - The client was unable to + // communicate with the server. + // - "REALTIME_SERVER_ERROR" - The client + // received an error response when it tried to communicate with the + // server. + // - "REALTIME_TIMEOUT" - The client timed out while waiting + // for a room. + Reason string `json:"reason,omitempty"` +} + +type RoomList struct { + // Items: The rooms. + Items []*Room `json:"items,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#roomList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The pagination token for the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type RoomModification struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#roomModification. + Kind string `json:"kind,omitempty"` + + // ModifiedTimestampMillis: The timestamp at which they modified the + // room, in milliseconds since the epoch in UTC. + ModifiedTimestampMillis int64 `json:"modifiedTimestampMillis,omitempty,string"` + + // ParticipantId: The ID of the participant that modified the room. + ParticipantId string `json:"participantId,omitempty"` +} + +type RoomP2PStatus struct { + // ConnectionSetupLatencyMillis: The amount of time in milliseconds it + // took to establish connections with this peer. + ConnectionSetupLatencyMillis int64 `json:"connectionSetupLatencyMillis,omitempty"` + + // Error: The error code in event of a failure. + // Possible values are: + // - + // "P2P_FAILED" - The client failed to establish a P2P connection with + // the peer. + // - "PRESENCE_FAILED" - The client failed to register to + // receive P2P connections. + // - "RELAY_SERVER_FAILED" - The client + // received an error when trying to use the relay server to establish a + // P2P connection with the peer. + Error string `json:"error,omitempty"` + + // Error_reason: More detailed diagnostic message returned in event of a + // failure. + Error_reason string `json:"error_reason,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#roomP2PStatus. + Kind string `json:"kind,omitempty"` + + // ParticipantId: The ID of the participant. + ParticipantId string `json:"participantId,omitempty"` + + // Status: The status of the peer in the room. + // Possible values are: + // - + // "CONNECTION_ESTABLISHED" - The client established a P2P connection + // with the peer. + // - "CONNECTION_FAILED" - The client failed to + // establish directed presence with the peer. + Status string `json:"status,omitempty"` + + // UnreliableRoundtripLatencyMillis: The amount of time in milliseconds + // it took to send packets back and forth on the unreliable channel with + // this peer. + UnreliableRoundtripLatencyMillis int64 `json:"unreliableRoundtripLatencyMillis,omitempty"` +} + +type RoomP2PStatuses struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#roomP2PStatuses. + Kind string `json:"kind,omitempty"` + + // Updates: The updates for the peers. + Updates []*RoomP2PStatus `json:"updates,omitempty"` +} + +type RoomParticipant struct { + // AutoMatched: True if this participant was auto-matched with the + // requesting player. + AutoMatched bool `json:"autoMatched,omitempty"` + + // AutoMatchedPlayer: Information about a player that has been + // anonymously auto-matched against the requesting player. (Either + // player or autoMatchedPlayer will be set.) + AutoMatchedPlayer *AnonymousPlayer `json:"autoMatchedPlayer,omitempty"` + + // Capabilities: The capabilities which can be used when communicating + // with this participant. + Capabilities []string `json:"capabilities,omitempty"` + + // ClientAddress: Client address for the participant. + ClientAddress *RoomClientAddress `json:"clientAddress,omitempty"` + + // Connected: True if this participant is in the fully connected set of + // peers in the room. + Connected bool `json:"connected,omitempty"` + + // Id: An identifier for the participant in the scope of the room. + // Cannot be used to identify a player across rooms or in other + // contexts. + Id string `json:"id,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#roomParticipant. + Kind string `json:"kind,omitempty"` + + // LeaveReason: The reason the participant left the room; populated if + // the participant status is PARTICIPANT_LEFT. + // Possible values are: + // - + // "PLAYER_LEFT" - The player explicitly chose to leave the room. + // - + // "GAME_LEFT" - The game chose to remove the player from the room. + // - + // "ABANDONED" - The player switched to another application and + // abandoned the room. + // - "PEER_CONNECTION_FAILURE" - The client was + // unable to establish or maintain a connection to other peer(s) in the + // room. + // - "SERVER_ERROR" - The client received an error response when + // it tried to communicate with the server. + // - "TIMEOUT" - The client + // timed out while waiting for players to join and connect. + // - + // "PRESENCE_FAILURE" - The client's XMPP connection ended abruptly. + LeaveReason string `json:"leaveReason,omitempty"` + + // Player: Information about the player. Not populated if this player + // was anonymously auto-matched against the requesting player. (Either + // player or autoMatchedPlayer will be set.) + Player *Player `json:"player,omitempty"` + + // Status: The status of the participant with respect to the + // room. + // Possible values are: + // - "PARTICIPANT_INVITED" - The + // participant has been invited to join the room, but has not yet + // responded. + // - "PARTICIPANT_JOINED" - The participant has joined the + // room (either after creating it or accepting an invitation.) + // - + // "PARTICIPANT_DECLINED" - The participant declined an invitation to + // join the room. + // - "PARTICIPANT_LEFT" - The participant joined the + // room and then left it. + Status string `json:"status,omitempty"` +} + +type RoomStatus struct { + // AutoMatchingStatus: Auto-matching status for this room. Not set if + // the room is not currently in the automatching queue. + AutoMatchingStatus *RoomAutoMatchStatus `json:"autoMatchingStatus,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#roomStatus. + Kind string `json:"kind,omitempty"` + + // Participants: The participants involved in the room, along with their + // statuses. Includes participants who have left or declined + // invitations. + Participants []*RoomParticipant `json:"participants,omitempty"` + + // RoomId: Globally unique ID for a room. + RoomId string `json:"roomId,omitempty"` + + // Status: The status of the room. + // Possible values are: + // - + // "ROOM_INVITING" - One or more players have been invited and not + // responded. + // - "ROOM_AUTO_MATCHING" - One or more slots need to be + // filled by auto-matching. + // - "ROOM_CONNECTING" - Players have joined + // are connecting to each other (either before or after auto-matching). + // + // - "ROOM_ACTIVE" - All players have joined and connected to each + // other. + // - "ROOM_DELETED" - All joined players have left. + Status string `json:"status,omitempty"` + + // StatusVersion: The version of the status for the room: an increasing + // counter, used by the client to ignore out-of-order updates to room + // status. + StatusVersion int64 `json:"statusVersion,omitempty"` +} + +type ScoreSubmission struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#scoreSubmission. + Kind string `json:"kind,omitempty"` + + // LeaderboardId: The leaderboard this score is being submitted to. + LeaderboardId string `json:"leaderboardId,omitempty"` + + // Score: The new score being submitted. + Score int64 `json:"score,omitempty,string"` + + // ScoreTag: Additional information about this score. Values will + // contain no more than 64 URI-safe characters as defined by section 2.3 + // of RFC 3986. + ScoreTag string `json:"scoreTag,omitempty"` +} + +type TurnBasedAutoMatchingCriteria struct { + // ExclusiveBitmask: A bitmask indicating when auto-matches are valid. + // When ANDed with other exclusive bitmasks, the result must be zero. + // Can be used to support exclusive roles within a game. + ExclusiveBitmask int64 `json:"exclusiveBitmask,omitempty,string"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#turnBasedAutoMatchingCriteria. + Kind string `json:"kind,omitempty"` + + // MaxAutoMatchingPlayers: The maximum number of players that should be + // added to the match by auto-matching. + MaxAutoMatchingPlayers int64 `json:"maxAutoMatchingPlayers,omitempty"` + + // MinAutoMatchingPlayers: The minimum number of players that should be + // added to the match by auto-matching. + MinAutoMatchingPlayers int64 `json:"minAutoMatchingPlayers,omitempty"` +} + +type TurnBasedMatch struct { + // ApplicationId: The ID of the application being played. + ApplicationId string `json:"applicationId,omitempty"` + + // AutoMatchingCriteria: Criteria for auto-matching players into this + // match. + AutoMatchingCriteria *TurnBasedAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"` + + // CreationDetails: Details about the match creation. + CreationDetails *TurnBasedMatchModification `json:"creationDetails,omitempty"` + + // Data: The data / game state for this match. + Data *TurnBasedMatchData `json:"data,omitempty"` + + // Description: This short description is generated by our servers based + // on turn state and is localized and worded relative to the player + // requesting the match. It is intended to be displayed when the match + // is shown in a list. + Description string `json:"description,omitempty"` + + // InviterId: The ID of the participant that invited the user to the + // match. Not set if the user was not invited to the match. + InviterId string `json:"inviterId,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#turnBasedMatch. + Kind string `json:"kind,omitempty"` + + // LastUpdateDetails: Details about the last update to the match. + LastUpdateDetails *TurnBasedMatchModification `json:"lastUpdateDetails,omitempty"` + + // MatchId: Globally unique ID for a turn-based match. + MatchId string `json:"matchId,omitempty"` + + // MatchNumber: The number of the match in a chain of rematches. Will be + // set to 1 for the first match and incremented by 1 for each rematch. + MatchNumber int64 `json:"matchNumber,omitempty"` + + // MatchVersion: The version of this match: an increasing counter, used + // to avoid out-of-date updates to the match. + MatchVersion int64 `json:"matchVersion,omitempty"` + + // Participants: The participants involved in the match, along with + // their statuses. Includes participants who have left or declined + // invitations. + Participants []*TurnBasedMatchParticipant `json:"participants,omitempty"` + + // PendingParticipantId: The ID of the participant that is taking a + // turn. + PendingParticipantId string `json:"pendingParticipantId,omitempty"` + + // PreviousMatchData: The data / game state for the previous match; set + // for the first turn of rematches only. + PreviousMatchData *TurnBasedMatchData `json:"previousMatchData,omitempty"` + + // RematchId: The ID of a rematch of this match. Only set for completed + // matches that have been rematched. + RematchId string `json:"rematchId,omitempty"` + + // Results: The results reported for this match. + Results []*ParticipantResult `json:"results,omitempty"` + + // Status: The status of the match. + // Possible values are: + // - + // "MATCH_AUTO_MATCHING" - One or more slots need to be filled by + // auto-matching; the match cannot be established until they are filled. + // + // - "MATCH_ACTIVE" - The match has started. + // - "MATCH_COMPLETE" - The + // match has finished. + // - "MATCH_CANCELED" - The match was canceled. + // - + // "MATCH_EXPIRED" - The match expired due to inactivity. + // - + // "MATCH_DELETED" - The match should no longer be shown on the client. + // Returned only for tombstones for matches when sync is called. + Status string `json:"status,omitempty"` + + // UserMatchStatus: The status of the current user in the match. Derived + // from the match type, match status, the user's participant status, and + // the pending participant for the match. + // Possible values are: + // - + // "USER_INVITED" - The user has been invited to join the match and has + // not responded yet. + // - "USER_AWAITING_TURN" - The user is waiting for + // their turn. + // - "USER_TURN" - The user has an action to take in the + // match. + // - "USER_MATCH_COMPLETED" - The match has ended (it is + // completed, canceled, or expired.) + UserMatchStatus string `json:"userMatchStatus,omitempty"` + + // Variant: The variant / mode of the application being played; can be + // any integer value, or left blank. + Variant int64 `json:"variant,omitempty"` + + // WithParticipantId: The ID of another participant in the match that + // can be used when describing the participants the user is playing + // with. + WithParticipantId string `json:"withParticipantId,omitempty"` +} + +type TurnBasedMatchCreateRequest struct { + // AutoMatchingCriteria: Criteria for auto-matching players into this + // match. + AutoMatchingCriteria *TurnBasedAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"` + + // InvitedPlayerIds: The player ids to invite to the match. + InvitedPlayerIds []string `json:"invitedPlayerIds,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#turnBasedMatchCreateRequest. + Kind string `json:"kind,omitempty"` + + // RequestId: A randomly generated numeric ID. This number is used at + // the server to ensure that the request is handled correctly across + // retries. + RequestId int64 `json:"requestId,omitempty,string"` + + // Variant: The variant / mode of the application to be played. This can + // be any integer value, or left blank. You should use a small number of + // variants to keep the auto-matching pool as large as possible. + Variant int64 `json:"variant,omitempty"` +} + +type TurnBasedMatchData struct { + // Data: The byte representation of the data (limited to 128 kB), as a + // Base64-encoded string with the URL_SAFE encoding option. + Data string `json:"data,omitempty"` + + // DataAvailable: True if this match has data available but it wasn't + // returned in a list response; fetching the match individually will + // retrieve this data. + DataAvailable bool `json:"dataAvailable,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#turnBasedMatchData. + Kind string `json:"kind,omitempty"` +} + +type TurnBasedMatchDataRequest struct { + // Data: The byte representation of the data (limited to 128 kB), as a + // Base64-encoded string with the URL_SAFE encoding option. + Data string `json:"data,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#turnBasedMatchDataRequest. + Kind string `json:"kind,omitempty"` +} + +type TurnBasedMatchList struct { + // Items: The matches. + Items []*TurnBasedMatch `json:"items,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#turnBasedMatchList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The pagination token for the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type TurnBasedMatchModification struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#turnBasedMatchModification. + Kind string `json:"kind,omitempty"` + + // ModifiedTimestampMillis: The timestamp at which they modified the + // match, in milliseconds since the epoch in UTC. + ModifiedTimestampMillis int64 `json:"modifiedTimestampMillis,omitempty,string"` + + // ParticipantId: The ID of the participant that modified the match. + ParticipantId string `json:"participantId,omitempty"` +} + +type TurnBasedMatchParticipant struct { + // AutoMatched: True if this participant was auto-matched with the + // requesting player. + AutoMatched bool `json:"autoMatched,omitempty"` + + // AutoMatchedPlayer: Information about a player that has been + // anonymously auto-matched against the requesting player. (Either + // player or autoMatchedPlayer will be set.) + AutoMatchedPlayer *AnonymousPlayer `json:"autoMatchedPlayer,omitempty"` + + // Id: An identifier for the participant in the scope of the match. + // Cannot be used to identify a player across matches or in other + // contexts. + Id string `json:"id,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#turnBasedMatchParticipant. + Kind string `json:"kind,omitempty"` + + // Player: Information about the player. Not populated if this player + // was anonymously auto-matched against the requesting player. (Either + // player or autoMatchedPlayer will be set.) + Player *Player `json:"player,omitempty"` + + // Status: The status of the participant with respect to the + // match. + // Possible values are: + // - "PARTICIPANT_NOT_INVITED_YET" - The + // participant is slated to be invited to the match, but the invitation + // has not been sent; the invite will be sent when it becomes their + // turn. + // - "PARTICIPANT_INVITED" - The participant has been invited to + // join the match, but has not yet responded. + // - "PARTICIPANT_JOINED" - + // The participant has joined the match (either after creating it or + // accepting an invitation.) + // - "PARTICIPANT_DECLINED" - The participant + // declined an invitation to join the match. + // - "PARTICIPANT_LEFT" - The + // participant joined the match and then left it. + // - + // "PARTICIPANT_FINISHED" - The participant finished playing in the + // match. + // - "PARTICIPANT_UNRESPONSIVE" - The participant did not take + // their turn in the allotted time. + Status string `json:"status,omitempty"` +} + +type TurnBasedMatchRematch struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#turnBasedMatchRematch. + Kind string `json:"kind,omitempty"` + + // PreviousMatch: The old match that the rematch was created from; will + // be updated such that the rematchId field will point at the new match. + PreviousMatch *TurnBasedMatch `json:"previousMatch,omitempty"` + + // Rematch: The newly created match; a rematch of the old match with the + // same participants. + Rematch *TurnBasedMatch `json:"rematch,omitempty"` +} + +type TurnBasedMatchResults struct { + // Data: The final match data. + Data *TurnBasedMatchDataRequest `json:"data,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#turnBasedMatchResults. + Kind string `json:"kind,omitempty"` + + // MatchVersion: The version of the match being updated. + MatchVersion int64 `json:"matchVersion,omitempty"` + + // Results: The match results for the participants in the match. + Results []*ParticipantResult `json:"results,omitempty"` +} + +type TurnBasedMatchSync struct { + // Items: The matches. + Items []*TurnBasedMatch `json:"items,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#turnBasedMatchSync. + Kind string `json:"kind,omitempty"` + + // MoreAvailable: True if there were more matches available to fetch at + // the time the response was generated (which were not returned due to + // page size limits.) + MoreAvailable bool `json:"moreAvailable,omitempty"` + + // NextPageToken: The pagination token for the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type TurnBasedMatchTurn struct { + // Data: The shared game state data after the turn is over. + Data *TurnBasedMatchDataRequest `json:"data,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#turnBasedMatchTurn. + Kind string `json:"kind,omitempty"` + + // MatchVersion: The version of this match: an increasing counter, used + // to avoid out-of-date updates to the match. + MatchVersion int64 `json:"matchVersion,omitempty"` + + // PendingParticipantId: The ID of the participant who should take their + // turn next. May be set to the current player's participant ID to + // update match state without changing the turn. If not set, the match + // will wait for other player(s) to join via automatching; this is only + // valid if automatch criteria is set on the match with remaining slots + // for automatched players. + PendingParticipantId string `json:"pendingParticipantId,omitempty"` + + // Results: The match results for the participants in the match. + Results []*ParticipantResult `json:"results,omitempty"` +} + +// method id "games.achievementDefinitions.list": + +type AchievementDefinitionsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Lists all the achievement definitions for your application. +func (r *AchievementDefinitionsService) List() *AchievementDefinitionsListCall { + c := &AchievementDefinitionsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *AchievementDefinitionsListCall) Language(language string) *AchievementDefinitionsListCall { + c.opt_["language"] = language + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of achievement resources to return in the response, used for +// paging. For any response, the actual number of achievement resources +// returned may be less than the specified maxResults. +func (c *AchievementDefinitionsListCall) MaxResults(maxResults int64) *AchievementDefinitionsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *AchievementDefinitionsListCall) PageToken(pageToken string) *AchievementDefinitionsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AchievementDefinitionsListCall) Do() (*AchievementDefinitionsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AchievementDefinitionsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all the achievement definitions for your application.", + // "httpMethod": "GET", + // "id": "games.achievementDefinitions.list", + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults.", + // "format": "int32", + // "location": "query", + // "maximum": "200", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "achievements", + // "response": { + // "$ref": "AchievementDefinitionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.achievements.increment": + +type AchievementsIncrementCall struct { + s *Service + achievementId string + stepsToIncrement int64 + opt_ map[string]interface{} +} + +// Increment: Increments the steps of the achievement with the given ID +// for the currently authenticated player. +func (r *AchievementsService) Increment(achievementId string, stepsToIncrement int64) *AchievementsIncrementCall { + c := &AchievementsIncrementCall{s: r.s, opt_: make(map[string]interface{})} + c.achievementId = achievementId + c.stepsToIncrement = stepsToIncrement + return c +} + +// RequestId sets the optional parameter "requestId": A randomly +// generated numeric ID for each request specified by the caller. This +// number is used at the server to ensure that the request is handled +// correctly across retries. +func (c *AchievementsIncrementCall) RequestId(requestId int64) *AchievementsIncrementCall { + c.opt_["requestId"] = requestId + return c +} + +func (c *AchievementsIncrementCall) Do() (*AchievementIncrementResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("stepsToIncrement", fmt.Sprintf("%v", c.stepsToIncrement)) + if v, ok := c.opt_["requestId"]; ok { + params.Set("requestId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/increment") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{achievementId}", url.QueryEscape(c.achievementId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AchievementIncrementResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Increments the steps of the achievement with the given ID for the currently authenticated player.", + // "httpMethod": "POST", + // "id": "games.achievements.increment", + // "parameterOrder": [ + // "achievementId", + // "stepsToIncrement" + // ], + // "parameters": { + // "achievementId": { + // "description": "The ID of the achievement used by this method.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "requestId": { + // "description": "A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "stepsToIncrement": { + // "description": "The number of steps to increment.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "achievements/{achievementId}/increment", + // "response": { + // "$ref": "AchievementIncrementResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.achievements.list": + +type AchievementsListCall struct { + s *Service + playerId string + opt_ map[string]interface{} +} + +// List: Lists the progress for all your application's achievements for +// the currently authenticated player. +func (r *AchievementsService) List(playerId string) *AchievementsListCall { + c := &AchievementsListCall{s: r.s, opt_: make(map[string]interface{})} + c.playerId = playerId + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *AchievementsListCall) Language(language string) *AchievementsListCall { + c.opt_["language"] = language + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of achievement resources to return in the response, used for +// paging. For any response, the actual number of achievement resources +// returned may be less than the specified maxResults. +func (c *AchievementsListCall) MaxResults(maxResults int64) *AchievementsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *AchievementsListCall) PageToken(pageToken string) *AchievementsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// State sets the optional parameter "state": Tells the server to return +// only achievements with the specified state. If this parameter isn't +// specified, all achievements are returned. +func (c *AchievementsListCall) State(state string) *AchievementsListCall { + c.opt_["state"] = state + return c +} + +func (c *AchievementsListCall) Do() (*PlayerAchievementListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["state"]; ok { + params.Set("state", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/achievements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{playerId}", url.QueryEscape(c.playerId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PlayerAchievementListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the progress for all your application's achievements for the currently authenticated player.", + // "httpMethod": "GET", + // "id": "games.achievements.list", + // "parameterOrder": [ + // "playerId" + // ], + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults.", + // "format": "int32", + // "location": "query", + // "maximum": "200", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // }, + // "playerId": { + // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "state": { + // "description": "Tells the server to return only achievements with the specified state. If this parameter isn't specified, all achievements are returned.", + // "enum": [ + // "ALL", + // "HIDDEN", + // "REVEALED", + // "UNLOCKED" + // ], + // "enumDescriptions": [ + // "List all achievements. This is the default.", + // "List only hidden achievements.", + // "List only revealed achievements.", + // "List only unlocked achievements." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "players/{playerId}/achievements", + // "response": { + // "$ref": "PlayerAchievementListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.achievements.reveal": + +type AchievementsRevealCall struct { + s *Service + achievementId string + opt_ map[string]interface{} +} + +// Reveal: Sets the state of the achievement with the given ID to +// REVEALED for the currently authenticated player. +func (r *AchievementsService) Reveal(achievementId string) *AchievementsRevealCall { + c := &AchievementsRevealCall{s: r.s, opt_: make(map[string]interface{})} + c.achievementId = achievementId + return c +} + +func (c *AchievementsRevealCall) Do() (*AchievementRevealResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/reveal") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{achievementId}", url.QueryEscape(c.achievementId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AchievementRevealResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the state of the achievement with the given ID to REVEALED for the currently authenticated player.", + // "httpMethod": "POST", + // "id": "games.achievements.reveal", + // "parameterOrder": [ + // "achievementId" + // ], + // "parameters": { + // "achievementId": { + // "description": "The ID of the achievement used by this method.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "achievements/{achievementId}/reveal", + // "response": { + // "$ref": "AchievementRevealResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.achievements.setStepsAtLeast": + +type AchievementsSetStepsAtLeastCall struct { + s *Service + achievementId string + steps int64 + opt_ map[string]interface{} +} + +// SetStepsAtLeast: Sets the steps for the currently authenticated +// player towards unlocking an achievement. If the steps parameter is +// less than the current number of steps that the player already gained +// for the achievement, the achievement is not modified. +func (r *AchievementsService) SetStepsAtLeast(achievementId string, steps int64) *AchievementsSetStepsAtLeastCall { + c := &AchievementsSetStepsAtLeastCall{s: r.s, opt_: make(map[string]interface{})} + c.achievementId = achievementId + c.steps = steps + return c +} + +func (c *AchievementsSetStepsAtLeastCall) Do() (*AchievementSetStepsAtLeastResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("steps", fmt.Sprintf("%v", c.steps)) + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/setStepsAtLeast") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{achievementId}", url.QueryEscape(c.achievementId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AchievementSetStepsAtLeastResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the steps for the currently authenticated player towards unlocking an achievement. If the steps parameter is less than the current number of steps that the player already gained for the achievement, the achievement is not modified.", + // "httpMethod": "POST", + // "id": "games.achievements.setStepsAtLeast", + // "parameterOrder": [ + // "achievementId", + // "steps" + // ], + // "parameters": { + // "achievementId": { + // "description": "The ID of the achievement used by this method.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "steps": { + // "description": "The minimum value to set the steps to.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "achievements/{achievementId}/setStepsAtLeast", + // "response": { + // "$ref": "AchievementSetStepsAtLeastResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.achievements.unlock": + +type AchievementsUnlockCall struct { + s *Service + achievementId string + opt_ map[string]interface{} +} + +// Unlock: Unlocks this achievement for the currently authenticated +// player. +func (r *AchievementsService) Unlock(achievementId string) *AchievementsUnlockCall { + c := &AchievementsUnlockCall{s: r.s, opt_: make(map[string]interface{})} + c.achievementId = achievementId + return c +} + +func (c *AchievementsUnlockCall) Do() (*AchievementUnlockResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/unlock") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{achievementId}", url.QueryEscape(c.achievementId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AchievementUnlockResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Unlocks this achievement for the currently authenticated player.", + // "httpMethod": "POST", + // "id": "games.achievements.unlock", + // "parameterOrder": [ + // "achievementId" + // ], + // "parameters": { + // "achievementId": { + // "description": "The ID of the achievement used by this method.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "achievements/{achievementId}/unlock", + // "response": { + // "$ref": "AchievementUnlockResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.achievements.updateMultiple": + +type AchievementsUpdateMultipleCall struct { + s *Service + achievementupdatemultiplerequest *AchievementUpdateMultipleRequest + opt_ map[string]interface{} +} + +// UpdateMultiple: Updates multiple achievements for the currently +// authenticated player. +func (r *AchievementsService) UpdateMultiple(achievementupdatemultiplerequest *AchievementUpdateMultipleRequest) *AchievementsUpdateMultipleCall { + c := &AchievementsUpdateMultipleCall{s: r.s, opt_: make(map[string]interface{})} + c.achievementupdatemultiplerequest = achievementupdatemultiplerequest + return c +} + +func (c *AchievementsUpdateMultipleCall) Do() (*AchievementUpdateMultipleResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementupdatemultiplerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/updateMultiple") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AchievementUpdateMultipleResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates multiple achievements for the currently authenticated player.", + // "httpMethod": "POST", + // "id": "games.achievements.updateMultiple", + // "path": "achievements/updateMultiple", + // "request": { + // "$ref": "AchievementUpdateMultipleRequest" + // }, + // "response": { + // "$ref": "AchievementUpdateMultipleResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.applications.get": + +type ApplicationsGetCall struct { + s *Service + applicationId string + opt_ map[string]interface{} +} + +// Get: Retrieves the metadata of the application with the given ID. If +// the requested application is not available for the specified +// platformType, the returned response will not include any instance +// data. +func (r *ApplicationsService) Get(applicationId string) *ApplicationsGetCall { + c := &ApplicationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.applicationId = applicationId + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *ApplicationsGetCall) Language(language string) *ApplicationsGetCall { + c.opt_["language"] = language + return c +} + +// PlatformType sets the optional parameter "platformType": Restrict +// application details returned to the specific platform. +func (c *ApplicationsGetCall) PlatformType(platformType string) *ApplicationsGetCall { + c.opt_["platformType"] = platformType + return c +} + +func (c *ApplicationsGetCall) Do() (*Application, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["platformType"]; ok { + params.Set("platformType", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{applicationId}", url.QueryEscape(c.applicationId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Application) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the metadata of the application with the given ID. If the requested application is not available for the specified platformType, the returned response will not include any instance data.", + // "httpMethod": "GET", + // "id": "games.applications.get", + // "parameterOrder": [ + // "applicationId" + // ], + // "parameters": { + // "applicationId": { + // "description": "The application being requested.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "platformType": { + // "description": "Restrict application details returned to the specific platform.", + // "enum": [ + // "ANDROID", + // "IOS", + // "WEB_APP" + // ], + // "enumDescriptions": [ + // "Retrieve applications that can be played on Android.", + // "Retrieve applications that can be played on iOS.", + // "Retrieve applications that can be played on desktop web." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "applications/{applicationId}", + // "response": { + // "$ref": "Application" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.applications.played": + +type ApplicationsPlayedCall struct { + s *Service + opt_ map[string]interface{} +} + +// Played: Indicate that the the currently authenticated user is playing +// your application. +func (r *ApplicationsService) Played() *ApplicationsPlayedCall { + c := &ApplicationsPlayedCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *ApplicationsPlayedCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "applications/played") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Indicate that the the currently authenticated user is playing your application.", + // "httpMethod": "POST", + // "id": "games.applications.played", + // "path": "applications/played", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.leaderboards.get": + +type LeaderboardsGetCall struct { + s *Service + leaderboardId string + opt_ map[string]interface{} +} + +// Get: Retrieves the metadata of the leaderboard with the given ID. +func (r *LeaderboardsService) Get(leaderboardId string) *LeaderboardsGetCall { + c := &LeaderboardsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.leaderboardId = leaderboardId + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *LeaderboardsGetCall) Language(language string) *LeaderboardsGetCall { + c.opt_["language"] = language + return c +} + +func (c *LeaderboardsGetCall) Do() (*Leaderboard, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{leaderboardId}", url.QueryEscape(c.leaderboardId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Leaderboard) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the metadata of the leaderboard with the given ID.", + // "httpMethod": "GET", + // "id": "games.leaderboards.get", + // "parameterOrder": [ + // "leaderboardId" + // ], + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "leaderboardId": { + // "description": "The ID of the leaderboard.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "leaderboards/{leaderboardId}", + // "response": { + // "$ref": "Leaderboard" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.leaderboards.list": + +type LeaderboardsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Lists all the leaderboard metadata for your application. +func (r *LeaderboardsService) List() *LeaderboardsListCall { + c := &LeaderboardsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *LeaderboardsListCall) Language(language string) *LeaderboardsListCall { + c.opt_["language"] = language + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of leaderboards to return in the response. For any response, +// the actual number of leaderboards returned may be less than the +// specified maxResults. +func (c *LeaderboardsListCall) MaxResults(maxResults int64) *LeaderboardsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *LeaderboardsListCall) PageToken(pageToken string) *LeaderboardsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *LeaderboardsListCall) Do() (*LeaderboardListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(LeaderboardListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all the leaderboard metadata for your application.", + // "httpMethod": "GET", + // "id": "games.leaderboards.list", + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of leaderboards to return in the response. For any response, the actual number of leaderboards returned may be less than the specified maxResults.", + // "format": "int32", + // "location": "query", + // "maximum": "200", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "leaderboards", + // "response": { + // "$ref": "LeaderboardListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.players.get": + +type PlayersGetCall struct { + s *Service + playerId string + opt_ map[string]interface{} +} + +// Get: Retrieves the Player resource with the given ID. To retrieve the +// player for the currently authenticated user, set playerId to me. +func (r *PlayersService) Get(playerId string) *PlayersGetCall { + c := &PlayersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.playerId = playerId + return c +} + +func (c *PlayersGetCall) Do() (*Player, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{playerId}", url.QueryEscape(c.playerId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Player) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the Player resource with the given ID. To retrieve the player for the currently authenticated user, set playerId to me.", + // "httpMethod": "GET", + // "id": "games.players.get", + // "parameterOrder": [ + // "playerId" + // ], + // "parameters": { + // "playerId": { + // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "players/{playerId}", + // "response": { + // "$ref": "Player" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.players.list": + +type PlayersListCall struct { + s *Service + collection string + opt_ map[string]interface{} +} + +// List: Get the collection of players for the currently authenticated +// user. +func (r *PlayersService) List(collection string) *PlayersListCall { + c := &PlayersListCall{s: r.s, opt_: make(map[string]interface{})} + c.collection = collection + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of player resources to return in the response, used for +// paging. For any response, the actual number of player resources +// returned may be less than the specified maxResults. +func (c *PlayersListCall) MaxResults(maxResults int64) *PlayersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *PlayersListCall) PageToken(pageToken string) *PlayersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *PlayersListCall) Do() (*PlayerListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "players/me/players/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{collection}", url.QueryEscape(c.collection), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PlayerListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the collection of players for the currently authenticated user.", + // "httpMethod": "GET", + // "id": "games.players.list", + // "parameterOrder": [ + // "collection" + // ], + // "parameters": { + // "collection": { + // "description": "Collection of players being retrieved", + // "enum": [ + // "playedWith" + // ], + // "enumDescriptions": [ + // "Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of player resources to return in the response, used for paging. For any response, the actual number of player resources returned may be less than the specified maxResults.", + // "format": "int32", + // "location": "query", + // "maximum": "15", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "players/me/players/{collection}", + // "response": { + // "$ref": "PlayerListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.pushtokens.remove": + +type PushtokensRemoveCall struct { + s *Service + pushtokenid *PushTokenId + opt_ map[string]interface{} +} + +// Remove: Removes a push token for the current user and application. +// Removing a non-existent push token will report success. +func (r *PushtokensService) Remove(pushtokenid *PushTokenId) *PushtokensRemoveCall { + c := &PushtokensRemoveCall{s: r.s, opt_: make(map[string]interface{})} + c.pushtokenid = pushtokenid + return c +} + +func (c *PushtokensRemoveCall) Do() error { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pushtokenid) + if err != nil { + return err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "pushtokens/remove") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Removes a push token for the current user and application. Removing a non-existent push token will report success.", + // "httpMethod": "POST", + // "id": "games.pushtokens.remove", + // "path": "pushtokens/remove", + // "request": { + // "$ref": "PushTokenId" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.pushtokens.update": + +type PushtokensUpdateCall struct { + s *Service + pushtoken *PushToken + opt_ map[string]interface{} +} + +// Update: Registers a push token for the current user and application. +func (r *PushtokensService) Update(pushtoken *PushToken) *PushtokensUpdateCall { + c := &PushtokensUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.pushtoken = pushtoken + return c +} + +func (c *PushtokensUpdateCall) Do() error { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pushtoken) + if err != nil { + return err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "pushtokens") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Registers a push token for the current user and application.", + // "httpMethod": "PUT", + // "id": "games.pushtokens.update", + // "path": "pushtokens", + // "request": { + // "$ref": "PushToken" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.revisions.check": + +type RevisionsCheckCall struct { + s *Service + clientRevision string + opt_ map[string]interface{} +} + +// Check: Checks whether the games client is out of date. +func (r *RevisionsService) Check(clientRevision string) *RevisionsCheckCall { + c := &RevisionsCheckCall{s: r.s, opt_: make(map[string]interface{})} + c.clientRevision = clientRevision + return c +} + +func (c *RevisionsCheckCall) Do() (*RevisionCheckResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("clientRevision", fmt.Sprintf("%v", c.clientRevision)) + urls := googleapi.ResolveRelative(c.s.BasePath, "revisions/check") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RevisionCheckResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Checks whether the games client is out of date.", + // "httpMethod": "GET", + // "id": "games.revisions.check", + // "parameterOrder": [ + // "clientRevision" + // ], + // "parameters": { + // "clientRevision": { + // "description": "The revision of the client SDK used by your application. Format:\n[PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE are:\n \n- \"ANDROID\" - Client is running the Android SDK. \n- \"IOS\" - Client is running the iOS SDK. \n- \"WEB_APP\" - Client is running as a Web App.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "revisions/check", + // "response": { + // "$ref": "RevisionCheckResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.rooms.create": + +type RoomsCreateCall struct { + s *Service + roomcreaterequest *RoomCreateRequest + opt_ map[string]interface{} +} + +// Create: Create a room. For internal use by the Games SDK only. +// Calling this method directly is unsupported. +func (r *RoomsService) Create(roomcreaterequest *RoomCreateRequest) *RoomsCreateCall { + c := &RoomsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.roomcreaterequest = roomcreaterequest + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *RoomsCreateCall) Language(language string) *RoomsCreateCall { + c.opt_["language"] = language + return c +} + +func (c *RoomsCreateCall) Do() (*Room, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomcreaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/create") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Room) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", + // "httpMethod": "POST", + // "id": "games.rooms.create", + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "rooms/create", + // "request": { + // "$ref": "RoomCreateRequest" + // }, + // "response": { + // "$ref": "Room" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.rooms.decline": + +type RoomsDeclineCall struct { + s *Service + roomId string + opt_ map[string]interface{} +} + +// Decline: Decline an invitation to join a room. For internal use by +// the Games SDK only. Calling this method directly is unsupported. +func (r *RoomsService) Decline(roomId string) *RoomsDeclineCall { + c := &RoomsDeclineCall{s: r.s, opt_: make(map[string]interface{})} + c.roomId = roomId + return c +} + +func (c *RoomsDeclineCall) Do() (*Room, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/decline") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{roomId}", url.QueryEscape(c.roomId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Room) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Decline an invitation to join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", + // "httpMethod": "POST", + // "id": "games.rooms.decline", + // "parameterOrder": [ + // "roomId" + // ], + // "parameters": { + // "roomId": { + // "description": "The ID of the room.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rooms/{roomId}/decline", + // "response": { + // "$ref": "Room" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.rooms.dismiss": + +type RoomsDismissCall struct { + s *Service + roomId string + opt_ map[string]interface{} +} + +// Dismiss: Dismiss an invitation to join a room. For internal use by +// the Games SDK only. Calling this method directly is unsupported. +func (r *RoomsService) Dismiss(roomId string) *RoomsDismissCall { + c := &RoomsDismissCall{s: r.s, opt_: make(map[string]interface{})} + c.roomId = roomId + return c +} + +func (c *RoomsDismissCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/dismiss") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{roomId}", url.QueryEscape(c.roomId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Dismiss an invitation to join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", + // "httpMethod": "POST", + // "id": "games.rooms.dismiss", + // "parameterOrder": [ + // "roomId" + // ], + // "parameters": { + // "roomId": { + // "description": "The ID of the room.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rooms/{roomId}/dismiss", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.rooms.get": + +type RoomsGetCall struct { + s *Service + roomId string + opt_ map[string]interface{} +} + +// Get: Get the data for a room. +func (r *RoomsService) Get(roomId string) *RoomsGetCall { + c := &RoomsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.roomId = roomId + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *RoomsGetCall) Language(language string) *RoomsGetCall { + c.opt_["language"] = language + return c +} + +func (c *RoomsGetCall) Do() (*Room, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{roomId}", url.QueryEscape(c.roomId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Room) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the data for a room.", + // "httpMethod": "GET", + // "id": "games.rooms.get", + // "parameterOrder": [ + // "roomId" + // ], + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "roomId": { + // "description": "The ID of the room.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rooms/{roomId}", + // "response": { + // "$ref": "Room" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.rooms.join": + +type RoomsJoinCall struct { + s *Service + roomId string + roomjoinrequest *RoomJoinRequest + opt_ map[string]interface{} +} + +// Join: Join a room. For internal use by the Games SDK only. Calling +// this method directly is unsupported. +func (r *RoomsService) Join(roomId string, roomjoinrequest *RoomJoinRequest) *RoomsJoinCall { + c := &RoomsJoinCall{s: r.s, opt_: make(map[string]interface{})} + c.roomId = roomId + c.roomjoinrequest = roomjoinrequest + return c +} + +func (c *RoomsJoinCall) Do() (*Room, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomjoinrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/join") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{roomId}", url.QueryEscape(c.roomId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Room) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", + // "httpMethod": "POST", + // "id": "games.rooms.join", + // "parameterOrder": [ + // "roomId" + // ], + // "parameters": { + // "roomId": { + // "description": "The ID of the room.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rooms/{roomId}/join", + // "request": { + // "$ref": "RoomJoinRequest" + // }, + // "response": { + // "$ref": "Room" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.rooms.leave": + +type RoomsLeaveCall struct { + s *Service + roomId string + roomleaverequest *RoomLeaveRequest + opt_ map[string]interface{} +} + +// Leave: Leave a room. For internal use by the Games SDK only. Calling +// this method directly is unsupported. +func (r *RoomsService) Leave(roomId string, roomleaverequest *RoomLeaveRequest) *RoomsLeaveCall { + c := &RoomsLeaveCall{s: r.s, opt_: make(map[string]interface{})} + c.roomId = roomId + c.roomleaverequest = roomleaverequest + return c +} + +func (c *RoomsLeaveCall) Do() (*Room, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomleaverequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/leave") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{roomId}", url.QueryEscape(c.roomId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Room) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Leave a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", + // "httpMethod": "POST", + // "id": "games.rooms.leave", + // "parameterOrder": [ + // "roomId" + // ], + // "parameters": { + // "roomId": { + // "description": "The ID of the room.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rooms/{roomId}/leave", + // "request": { + // "$ref": "RoomLeaveRequest" + // }, + // "response": { + // "$ref": "Room" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.rooms.list": + +type RoomsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Returns invitations to join rooms. +func (r *RoomsService) List() *RoomsListCall { + c := &RoomsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *RoomsListCall) Language(language string) *RoomsListCall { + c.opt_["language"] = language + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of rooms to return in the response, used for paging. For any +// response, the actual number of rooms to return may be less than the +// specified maxResults. +func (c *RoomsListCall) MaxResults(maxResults int64) *RoomsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *RoomsListCall) PageToken(pageToken string) *RoomsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *RoomsListCall) Do() (*RoomList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rooms") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RoomList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns invitations to join rooms.", + // "httpMethod": "GET", + // "id": "games.rooms.list", + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of rooms to return in the response, used for paging. For any response, the actual number of rooms to return may be less than the specified maxResults.", + // "format": "int32", + // "location": "query", + // "maximum": "500", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "rooms", + // "response": { + // "$ref": "RoomList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.rooms.reportStatus": + +type RoomsReportStatusCall struct { + s *Service + roomId string + roomp2pstatuses *RoomP2PStatuses + opt_ map[string]interface{} +} + +// ReportStatus: Updates sent by a client reporting the status of peers +// in a room. For internal use by the Games SDK only. Calling this +// method directly is unsupported. +func (r *RoomsService) ReportStatus(roomId string, roomp2pstatuses *RoomP2PStatuses) *RoomsReportStatusCall { + c := &RoomsReportStatusCall{s: r.s, opt_: make(map[string]interface{})} + c.roomId = roomId + c.roomp2pstatuses = roomp2pstatuses + return c +} + +func (c *RoomsReportStatusCall) Do() (*RoomStatus, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomp2pstatuses) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/reportstatus") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{roomId}", url.QueryEscape(c.roomId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RoomStatus) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates sent by a client reporting the status of peers in a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", + // "httpMethod": "POST", + // "id": "games.rooms.reportStatus", + // "parameterOrder": [ + // "roomId" + // ], + // "parameters": { + // "roomId": { + // "description": "The ID of the room.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rooms/{roomId}/reportstatus", + // "request": { + // "$ref": "RoomP2PStatuses" + // }, + // "response": { + // "$ref": "RoomStatus" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.scores.get": + +type ScoresGetCall struct { + s *Service + playerId string + leaderboardId string + timeSpan string + opt_ map[string]interface{} +} + +// Get: Get high scores, and optionally ranks, in leaderboards for the +// currently authenticated player. For a specific time span, +// leaderboardId can be set to ALL to retrieve data for all leaderboards +// in a given time span. +// NOTE: You cannot ask for 'ALL' leaderboards and +// 'ALL' timeSpans in the same request; only one parameter may be set to +// 'ALL'. +func (r *ScoresService) Get(playerId string, leaderboardId string, timeSpan string) *ScoresGetCall { + c := &ScoresGetCall{s: r.s, opt_: make(map[string]interface{})} + c.playerId = playerId + c.leaderboardId = leaderboardId + c.timeSpan = timeSpan + return c +} + +// IncludeRankType sets the optional parameter "includeRankType": The +// types of ranks to return. If the parameter is omitted, no ranks will +// be returned. +func (c *ScoresGetCall) IncludeRankType(includeRankType string) *ScoresGetCall { + c.opt_["includeRankType"] = includeRankType + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *ScoresGetCall) Language(language string) *ScoresGetCall { + c.opt_["language"] = language + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of leaderboard scores to return in the response. For any +// response, the actual number of leaderboard scores returned may be +// less than the specified maxResults. +func (c *ScoresGetCall) MaxResults(maxResults int64) *ScoresGetCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *ScoresGetCall) PageToken(pageToken string) *ScoresGetCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ScoresGetCall) Do() (*PlayerLeaderboardScoreListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeRankType"]; ok { + params.Set("includeRankType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{playerId}", url.QueryEscape(c.playerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{leaderboardId}", url.QueryEscape(c.leaderboardId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{timeSpan}", url.QueryEscape(c.timeSpan), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PlayerLeaderboardScoreListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get high scores, and optionally ranks, in leaderboards for the currently authenticated player. For a specific time span, leaderboardId can be set to ALL to retrieve data for all leaderboards in a given time span.\nNOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same request; only one parameter may be set to 'ALL'.", + // "httpMethod": "GET", + // "id": "games.scores.get", + // "parameterOrder": [ + // "playerId", + // "leaderboardId", + // "timeSpan" + // ], + // "parameters": { + // "includeRankType": { + // "description": "The types of ranks to return. If the parameter is omitted, no ranks will be returned.", + // "enum": [ + // "ALL", + // "PUBLIC", + // "SOCIAL" + // ], + // "enumDescriptions": [ + // "Retrieve public and social ranks.", + // "Retrieve public ranks, if the player is sharing their gameplay activity publicly.", + // "Retrieve the social rank." + // ], + // "location": "query", + // "type": "string" + // }, + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "leaderboardId": { + // "description": "The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all leaderboards for this application.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults.", + // "format": "int32", + // "location": "query", + // "maximum": "25", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // }, + // "playerId": { + // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "timeSpan": { + // "description": "The time span for the scores and ranks you're requesting.", + // "enum": [ + // "ALL", + // "ALL_TIME", + // "DAILY", + // "WEEKLY" + // ], + // "enumDescriptions": [ + // "Get the high scores for all time spans. If this is used, maxResults values will be ignored.", + // "Get the all time high score.", + // "List the top scores for the current day.", + // "List the top scores for the current week." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}", + // "response": { + // "$ref": "PlayerLeaderboardScoreListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.scores.list": + +type ScoresListCall struct { + s *Service + leaderboardId string + collection string + timeSpan string + opt_ map[string]interface{} +} + +// List: Lists the scores in a leaderboard, starting from the top. +func (r *ScoresService) List(leaderboardId string, collection string, timeSpan string) *ScoresListCall { + c := &ScoresListCall{s: r.s, opt_: make(map[string]interface{})} + c.leaderboardId = leaderboardId + c.collection = collection + c.timeSpan = timeSpan + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *ScoresListCall) Language(language string) *ScoresListCall { + c.opt_["language"] = language + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of leaderboard scores to return in the response. For any +// response, the actual number of leaderboard scores returned may be +// less than the specified maxResults. +func (c *ScoresListCall) MaxResults(maxResults int64) *ScoresListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *ScoresListCall) PageToken(pageToken string) *ScoresListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ScoresListCall) Do() (*LeaderboardScores, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("timeSpan", fmt.Sprintf("%v", c.timeSpan)) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/scores/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{leaderboardId}", url.QueryEscape(c.leaderboardId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{collection}", url.QueryEscape(c.collection), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(LeaderboardScores) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the scores in a leaderboard, starting from the top.", + // "httpMethod": "GET", + // "id": "games.scores.list", + // "parameterOrder": [ + // "leaderboardId", + // "collection", + // "timeSpan" + // ], + // "parameters": { + // "collection": { + // "description": "The collection of scores you're requesting.", + // "enum": [ + // "PUBLIC", + // "SOCIAL" + // ], + // "enumDescriptions": [ + // "List all scores in the public leaderboard.", + // "List only social scores." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "leaderboardId": { + // "description": "The ID of the leaderboard.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults.", + // "format": "int32", + // "location": "query", + // "maximum": "25", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // }, + // "timeSpan": { + // "description": "The time span for the scores and ranks you're requesting.", + // "enum": [ + // "ALL_TIME", + // "DAILY", + // "WEEKLY" + // ], + // "enumDescriptions": [ + // "List the all-time top scores.", + // "List the top scores for the current day.", + // "List the top scores for the current week." + // ], + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "leaderboards/{leaderboardId}/scores/{collection}", + // "response": { + // "$ref": "LeaderboardScores" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.scores.listWindow": + +type ScoresListWindowCall struct { + s *Service + leaderboardId string + collection string + timeSpan string + opt_ map[string]interface{} +} + +// ListWindow: Lists the scores in a leaderboard around (and including) +// a player's score. +func (r *ScoresService) ListWindow(leaderboardId string, collection string, timeSpan string) *ScoresListWindowCall { + c := &ScoresListWindowCall{s: r.s, opt_: make(map[string]interface{})} + c.leaderboardId = leaderboardId + c.collection = collection + c.timeSpan = timeSpan + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *ScoresListWindowCall) Language(language string) *ScoresListWindowCall { + c.opt_["language"] = language + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of leaderboard scores to return in the response. For any +// response, the actual number of leaderboard scores returned may be +// less than the specified maxResults. +func (c *ScoresListWindowCall) MaxResults(maxResults int64) *ScoresListWindowCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *ScoresListWindowCall) PageToken(pageToken string) *ScoresListWindowCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ResultsAbove sets the optional parameter "resultsAbove": The +// preferred number of scores to return above the player's score. More +// scores may be returned if the player is at the bottom of the +// leaderboard; fewer may be returned if the player is at the top. Must +// be less than or equal to maxResults. +func (c *ScoresListWindowCall) ResultsAbove(resultsAbove int64) *ScoresListWindowCall { + c.opt_["resultsAbove"] = resultsAbove + return c +} + +// ReturnTopIfAbsent sets the optional parameter "returnTopIfAbsent": +// True if the top scores should be returned when the player is not in +// the leaderboard. Defaults to true. +func (c *ScoresListWindowCall) ReturnTopIfAbsent(returnTopIfAbsent bool) *ScoresListWindowCall { + c.opt_["returnTopIfAbsent"] = returnTopIfAbsent + return c +} + +func (c *ScoresListWindowCall) Do() (*LeaderboardScores, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("timeSpan", fmt.Sprintf("%v", c.timeSpan)) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["resultsAbove"]; ok { + params.Set("resultsAbove", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["returnTopIfAbsent"]; ok { + params.Set("returnTopIfAbsent", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/window/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{leaderboardId}", url.QueryEscape(c.leaderboardId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{collection}", url.QueryEscape(c.collection), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(LeaderboardScores) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the scores in a leaderboard around (and including) a player's score.", + // "httpMethod": "GET", + // "id": "games.scores.listWindow", + // "parameterOrder": [ + // "leaderboardId", + // "collection", + // "timeSpan" + // ], + // "parameters": { + // "collection": { + // "description": "The collection of scores you're requesting.", + // "enum": [ + // "PUBLIC", + // "SOCIAL" + // ], + // "enumDescriptions": [ + // "List all scores in the public leaderboard.", + // "List only social scores." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "leaderboardId": { + // "description": "The ID of the leaderboard.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults.", + // "format": "int32", + // "location": "query", + // "maximum": "25", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // }, + // "resultsAbove": { + // "description": "The preferred number of scores to return above the player's score. More scores may be returned if the player is at the bottom of the leaderboard; fewer may be returned if the player is at the top. Must be less than or equal to maxResults.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "returnTopIfAbsent": { + // "description": "True if the top scores should be returned when the player is not in the leaderboard. Defaults to true.", + // "location": "query", + // "type": "boolean" + // }, + // "timeSpan": { + // "description": "The time span for the scores and ranks you're requesting.", + // "enum": [ + // "ALL_TIME", + // "DAILY", + // "WEEKLY" + // ], + // "enumDescriptions": [ + // "List the all-time top scores.", + // "List the top scores for the current day.", + // "List the top scores for the current week." + // ], + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "leaderboards/{leaderboardId}/window/{collection}", + // "response": { + // "$ref": "LeaderboardScores" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.scores.submit": + +type ScoresSubmitCall struct { + s *Service + leaderboardId string + score int64 + opt_ map[string]interface{} +} + +// Submit: Submits a score to the specified leaderboard. +func (r *ScoresService) Submit(leaderboardId string, score int64) *ScoresSubmitCall { + c := &ScoresSubmitCall{s: r.s, opt_: make(map[string]interface{})} + c.leaderboardId = leaderboardId + c.score = score + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *ScoresSubmitCall) Language(language string) *ScoresSubmitCall { + c.opt_["language"] = language + return c +} + +// ScoreTag sets the optional parameter "scoreTag": Additional +// information about the score you're submitting. Values must contain no +// more than 64 URI-safe characters as defined by section 2.3 of RFC +// 3986. +func (c *ScoresSubmitCall) ScoreTag(scoreTag string) *ScoresSubmitCall { + c.opt_["scoreTag"] = scoreTag + return c +} + +func (c *ScoresSubmitCall) Do() (*PlayerScoreResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("score", fmt.Sprintf("%v", c.score)) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["scoreTag"]; ok { + params.Set("scoreTag", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/scores") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{leaderboardId}", url.QueryEscape(c.leaderboardId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PlayerScoreResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Submits a score to the specified leaderboard.", + // "httpMethod": "POST", + // "id": "games.scores.submit", + // "parameterOrder": [ + // "leaderboardId", + // "score" + // ], + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "leaderboardId": { + // "description": "The ID of the leaderboard.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "score": { + // "description": "The score you're submitting. The submitted score is ignored if it is worse than a previously submitted score, where worse depends on the leaderboard sort order. The meaning of the score value depends on the leaderboard format type. For fixed-point, the score represents the raw value. For time, the score represents elapsed time in milliseconds. For currency, the score represents a value in micro units.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "scoreTag": { + // "description": "Additional information about the score you're submitting. Values must contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986.", + // "location": "query", + // "pattern": "[a-zA-Z0-9-._~]{0,64}", + // "type": "string" + // } + // }, + // "path": "leaderboards/{leaderboardId}/scores", + // "response": { + // "$ref": "PlayerScoreResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.scores.submitMultiple": + +type ScoresSubmitMultipleCall struct { + s *Service + playerscoresubmissionlist *PlayerScoreSubmissionList + opt_ map[string]interface{} +} + +// SubmitMultiple: Submits multiple scores to leaderboards. +func (r *ScoresService) SubmitMultiple(playerscoresubmissionlist *PlayerScoreSubmissionList) *ScoresSubmitMultipleCall { + c := &ScoresSubmitMultipleCall{s: r.s, opt_: make(map[string]interface{})} + c.playerscoresubmissionlist = playerscoresubmissionlist + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *ScoresSubmitMultipleCall) Language(language string) *ScoresSubmitMultipleCall { + c.opt_["language"] = language + return c +} + +func (c *ScoresSubmitMultipleCall) Do() (*PlayerScoreListResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.playerscoresubmissionlist) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/scores") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PlayerScoreListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Submits multiple scores to leaderboards.", + // "httpMethod": "POST", + // "id": "games.scores.submitMultiple", + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "leaderboards/scores", + // "request": { + // "$ref": "PlayerScoreSubmissionList" + // }, + // "response": { + // "$ref": "PlayerScoreListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.turnBasedMatches.cancel": + +type TurnBasedMatchesCancelCall struct { + s *Service + matchId string + opt_ map[string]interface{} +} + +// Cancel: Cancel a turn-based match. +func (r *TurnBasedMatchesService) Cancel(matchId string) *TurnBasedMatchesCancelCall { + c := &TurnBasedMatchesCancelCall{s: r.s, opt_: make(map[string]interface{})} + c.matchId = matchId + return c +} + +func (c *TurnBasedMatchesCancelCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/cancel") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{matchId}", url.QueryEscape(c.matchId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Cancel a turn-based match.", + // "httpMethod": "PUT", + // "id": "games.turnBasedMatches.cancel", + // "parameterOrder": [ + // "matchId" + // ], + // "parameters": { + // "matchId": { + // "description": "The ID of the match.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "turnbasedmatches/{matchId}/cancel", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.turnBasedMatches.create": + +type TurnBasedMatchesCreateCall struct { + s *Service + turnbasedmatchcreaterequest *TurnBasedMatchCreateRequest + opt_ map[string]interface{} +} + +// Create: Create a turn-based match. +func (r *TurnBasedMatchesService) Create(turnbasedmatchcreaterequest *TurnBasedMatchCreateRequest) *TurnBasedMatchesCreateCall { + c := &TurnBasedMatchesCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.turnbasedmatchcreaterequest = turnbasedmatchcreaterequest + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *TurnBasedMatchesCreateCall) Language(language string) *TurnBasedMatchesCreateCall { + c.opt_["language"] = language + return c +} + +func (c *TurnBasedMatchesCreateCall) Do() (*TurnBasedMatch, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.turnbasedmatchcreaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/create") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TurnBasedMatch) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a turn-based match.", + // "httpMethod": "POST", + // "id": "games.turnBasedMatches.create", + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "turnbasedmatches/create", + // "request": { + // "$ref": "TurnBasedMatchCreateRequest" + // }, + // "response": { + // "$ref": "TurnBasedMatch" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.turnBasedMatches.decline": + +type TurnBasedMatchesDeclineCall struct { + s *Service + matchId string + opt_ map[string]interface{} +} + +// Decline: Decline an invitation to play a turn-based match. +func (r *TurnBasedMatchesService) Decline(matchId string) *TurnBasedMatchesDeclineCall { + c := &TurnBasedMatchesDeclineCall{s: r.s, opt_: make(map[string]interface{})} + c.matchId = matchId + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *TurnBasedMatchesDeclineCall) Language(language string) *TurnBasedMatchesDeclineCall { + c.opt_["language"] = language + return c +} + +func (c *TurnBasedMatchesDeclineCall) Do() (*TurnBasedMatch, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/decline") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{matchId}", url.QueryEscape(c.matchId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TurnBasedMatch) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Decline an invitation to play a turn-based match.", + // "httpMethod": "PUT", + // "id": "games.turnBasedMatches.decline", + // "parameterOrder": [ + // "matchId" + // ], + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "matchId": { + // "description": "The ID of the match.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "turnbasedmatches/{matchId}/decline", + // "response": { + // "$ref": "TurnBasedMatch" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.turnBasedMatches.dismiss": + +type TurnBasedMatchesDismissCall struct { + s *Service + matchId string + opt_ map[string]interface{} +} + +// Dismiss: Dismiss a turn-based match from the match list. The match +// will no longer show up in the list and will not generate +// notifications. +func (r *TurnBasedMatchesService) Dismiss(matchId string) *TurnBasedMatchesDismissCall { + c := &TurnBasedMatchesDismissCall{s: r.s, opt_: make(map[string]interface{})} + c.matchId = matchId + return c +} + +func (c *TurnBasedMatchesDismissCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/dismiss") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{matchId}", url.QueryEscape(c.matchId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Dismiss a turn-based match from the match list. The match will no longer show up in the list and will not generate notifications.", + // "httpMethod": "PUT", + // "id": "games.turnBasedMatches.dismiss", + // "parameterOrder": [ + // "matchId" + // ], + // "parameters": { + // "matchId": { + // "description": "The ID of the match.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "turnbasedmatches/{matchId}/dismiss", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.turnBasedMatches.finish": + +type TurnBasedMatchesFinishCall struct { + s *Service + matchId string + turnbasedmatchresults *TurnBasedMatchResults + opt_ map[string]interface{} +} + +// Finish: Finish a turn-based match. Each player should make this call +// once, after all results are in. Only the player whose turn it is may +// make the first call to Finish, and can pass in the final match state. +func (r *TurnBasedMatchesService) Finish(matchId string, turnbasedmatchresults *TurnBasedMatchResults) *TurnBasedMatchesFinishCall { + c := &TurnBasedMatchesFinishCall{s: r.s, opt_: make(map[string]interface{})} + c.matchId = matchId + c.turnbasedmatchresults = turnbasedmatchresults + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *TurnBasedMatchesFinishCall) Language(language string) *TurnBasedMatchesFinishCall { + c.opt_["language"] = language + return c +} + +func (c *TurnBasedMatchesFinishCall) Do() (*TurnBasedMatch, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.turnbasedmatchresults) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/finish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{matchId}", url.QueryEscape(c.matchId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TurnBasedMatch) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Finish a turn-based match. Each player should make this call once, after all results are in. Only the player whose turn it is may make the first call to Finish, and can pass in the final match state.", + // "httpMethod": "PUT", + // "id": "games.turnBasedMatches.finish", + // "parameterOrder": [ + // "matchId" + // ], + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "matchId": { + // "description": "The ID of the match.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "turnbasedmatches/{matchId}/finish", + // "request": { + // "$ref": "TurnBasedMatchResults" + // }, + // "response": { + // "$ref": "TurnBasedMatch" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.turnBasedMatches.get": + +type TurnBasedMatchesGetCall struct { + s *Service + matchId string + opt_ map[string]interface{} +} + +// Get: Get the data for a turn-based match. +func (r *TurnBasedMatchesService) Get(matchId string) *TurnBasedMatchesGetCall { + c := &TurnBasedMatchesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.matchId = matchId + return c +} + +// IncludeMatchData sets the optional parameter "includeMatchData": Get +// match data along with metadata. +func (c *TurnBasedMatchesGetCall) IncludeMatchData(includeMatchData bool) *TurnBasedMatchesGetCall { + c.opt_["includeMatchData"] = includeMatchData + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *TurnBasedMatchesGetCall) Language(language string) *TurnBasedMatchesGetCall { + c.opt_["language"] = language + return c +} + +func (c *TurnBasedMatchesGetCall) Do() (*TurnBasedMatch, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeMatchData"]; ok { + params.Set("includeMatchData", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{matchId}", url.QueryEscape(c.matchId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TurnBasedMatch) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the data for a turn-based match.", + // "httpMethod": "GET", + // "id": "games.turnBasedMatches.get", + // "parameterOrder": [ + // "matchId" + // ], + // "parameters": { + // "includeMatchData": { + // "description": "Get match data along with metadata.", + // "location": "query", + // "type": "boolean" + // }, + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "matchId": { + // "description": "The ID of the match.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "turnbasedmatches/{matchId}", + // "response": { + // "$ref": "TurnBasedMatch" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.turnBasedMatches.join": + +type TurnBasedMatchesJoinCall struct { + s *Service + matchId string + opt_ map[string]interface{} +} + +// Join: Join a turn-based match. +func (r *TurnBasedMatchesService) Join(matchId string) *TurnBasedMatchesJoinCall { + c := &TurnBasedMatchesJoinCall{s: r.s, opt_: make(map[string]interface{})} + c.matchId = matchId + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *TurnBasedMatchesJoinCall) Language(language string) *TurnBasedMatchesJoinCall { + c.opt_["language"] = language + return c +} + +func (c *TurnBasedMatchesJoinCall) Do() (*TurnBasedMatch, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/join") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{matchId}", url.QueryEscape(c.matchId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TurnBasedMatch) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Join a turn-based match.", + // "httpMethod": "PUT", + // "id": "games.turnBasedMatches.join", + // "parameterOrder": [ + // "matchId" + // ], + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "matchId": { + // "description": "The ID of the match.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "turnbasedmatches/{matchId}/join", + // "response": { + // "$ref": "TurnBasedMatch" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.turnBasedMatches.leave": + +type TurnBasedMatchesLeaveCall struct { + s *Service + matchId string + opt_ map[string]interface{} +} + +// Leave: Leave a turn-based match when it is not the current player's +// turn, without canceling the match. +func (r *TurnBasedMatchesService) Leave(matchId string) *TurnBasedMatchesLeaveCall { + c := &TurnBasedMatchesLeaveCall{s: r.s, opt_: make(map[string]interface{})} + c.matchId = matchId + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *TurnBasedMatchesLeaveCall) Language(language string) *TurnBasedMatchesLeaveCall { + c.opt_["language"] = language + return c +} + +func (c *TurnBasedMatchesLeaveCall) Do() (*TurnBasedMatch, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/leave") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{matchId}", url.QueryEscape(c.matchId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TurnBasedMatch) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Leave a turn-based match when it is not the current player's turn, without canceling the match.", + // "httpMethod": "PUT", + // "id": "games.turnBasedMatches.leave", + // "parameterOrder": [ + // "matchId" + // ], + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "matchId": { + // "description": "The ID of the match.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "turnbasedmatches/{matchId}/leave", + // "response": { + // "$ref": "TurnBasedMatch" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.turnBasedMatches.leaveTurn": + +type TurnBasedMatchesLeaveTurnCall struct { + s *Service + matchId string + matchVersion int64 + opt_ map[string]interface{} +} + +// LeaveTurn: Leave a turn-based match during the current player's turn, +// without canceling the match. +func (r *TurnBasedMatchesService) LeaveTurn(matchId string, matchVersion int64) *TurnBasedMatchesLeaveTurnCall { + c := &TurnBasedMatchesLeaveTurnCall{s: r.s, opt_: make(map[string]interface{})} + c.matchId = matchId + c.matchVersion = matchVersion + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *TurnBasedMatchesLeaveTurnCall) Language(language string) *TurnBasedMatchesLeaveTurnCall { + c.opt_["language"] = language + return c +} + +// PendingParticipantId sets the optional parameter +// "pendingParticipantId": The ID of another participant who should take +// their turn next. If not set, the match will wait for other player(s) +// to join via automatching; this is only valid if automatch criteria is +// set on the match with remaining slots for automatched players. +func (c *TurnBasedMatchesLeaveTurnCall) PendingParticipantId(pendingParticipantId string) *TurnBasedMatchesLeaveTurnCall { + c.opt_["pendingParticipantId"] = pendingParticipantId + return c +} + +func (c *TurnBasedMatchesLeaveTurnCall) Do() (*TurnBasedMatch, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("matchVersion", fmt.Sprintf("%v", c.matchVersion)) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pendingParticipantId"]; ok { + params.Set("pendingParticipantId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/leaveTurn") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{matchId}", url.QueryEscape(c.matchId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TurnBasedMatch) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Leave a turn-based match during the current player's turn, without canceling the match.", + // "httpMethod": "PUT", + // "id": "games.turnBasedMatches.leaveTurn", + // "parameterOrder": [ + // "matchId", + // "matchVersion" + // ], + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "matchId": { + // "description": "The ID of the match.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "matchVersion": { + // "description": "The version of the match being updated.", + // "format": "int32", + // "location": "query", + // "required": true, + // "type": "integer" + // }, + // "pendingParticipantId": { + // "description": "The ID of another participant who should take their turn next. If not set, the match will wait for other player(s) to join via automatching; this is only valid if automatch criteria is set on the match with remaining slots for automatched players.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "turnbasedmatches/{matchId}/leaveTurn", + // "response": { + // "$ref": "TurnBasedMatch" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.turnBasedMatches.list": + +type TurnBasedMatchesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Returns turn-based matches the player is or was involved in. +func (r *TurnBasedMatchesService) List() *TurnBasedMatchesListCall { + c := &TurnBasedMatchesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// IncludeMatchData sets the optional parameter "includeMatchData": True +// if match data should be returned in the response. Note that not all +// data will necessarily be returned if include_match_data is true; the +// server may decide to only return data for some of the matches to +// limit download size for the client. The remainder of the data for +// these matches will be retrievable on request. +func (c *TurnBasedMatchesListCall) IncludeMatchData(includeMatchData bool) *TurnBasedMatchesListCall { + c.opt_["includeMatchData"] = includeMatchData + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *TurnBasedMatchesListCall) Language(language string) *TurnBasedMatchesListCall { + c.opt_["language"] = language + return c +} + +// MaxCompletedMatches sets the optional parameter +// "maxCompletedMatches": The maximum number of completed or canceled +// matches to return in the response. If not set, all matches returned +// could be completed or canceled. +func (c *TurnBasedMatchesListCall) MaxCompletedMatches(maxCompletedMatches int64) *TurnBasedMatchesListCall { + c.opt_["maxCompletedMatches"] = maxCompletedMatches + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of matches to return in the response, used for paging. For any +// response, the actual number of matches to return may be less than the +// specified maxResults. +func (c *TurnBasedMatchesListCall) MaxResults(maxResults int64) *TurnBasedMatchesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *TurnBasedMatchesListCall) PageToken(pageToken string) *TurnBasedMatchesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *TurnBasedMatchesListCall) Do() (*TurnBasedMatchList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeMatchData"]; ok { + params.Set("includeMatchData", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxCompletedMatches"]; ok { + params.Set("maxCompletedMatches", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TurnBasedMatchList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns turn-based matches the player is or was involved in.", + // "httpMethod": "GET", + // "id": "games.turnBasedMatches.list", + // "parameters": { + // "includeMatchData": { + // "description": "True if match data should be returned in the response. Note that not all data will necessarily be returned if include_match_data is true; the server may decide to only return data for some of the matches to limit download size for the client. The remainder of the data for these matches will be retrievable on request.", + // "location": "query", + // "type": "boolean" + // }, + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "maxCompletedMatches": { + // "description": "The maximum number of completed or canceled matches to return in the response. If not set, all matches returned could be completed or canceled.", + // "format": "int32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "maxResults": { + // "description": "The maximum number of matches to return in the response, used for paging. For any response, the actual number of matches to return may be less than the specified maxResults.", + // "format": "int32", + // "location": "query", + // "maximum": "500", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "turnbasedmatches", + // "response": { + // "$ref": "TurnBasedMatchList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.turnBasedMatches.rematch": + +type TurnBasedMatchesRematchCall struct { + s *Service + matchId string + opt_ map[string]interface{} +} + +// Rematch: Create a rematch of a match that was previously completed, +// with the same participants. This can be called by only one player on +// a match still in their list; the player must have called Finish +// first. Returns the newly created match; it will be the caller's turn. +func (r *TurnBasedMatchesService) Rematch(matchId string) *TurnBasedMatchesRematchCall { + c := &TurnBasedMatchesRematchCall{s: r.s, opt_: make(map[string]interface{})} + c.matchId = matchId + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *TurnBasedMatchesRematchCall) Language(language string) *TurnBasedMatchesRematchCall { + c.opt_["language"] = language + return c +} + +// RequestId sets the optional parameter "requestId": A randomly +// generated numeric ID for each request specified by the caller. This +// number is used at the server to ensure that the request is handled +// correctly across retries. +func (c *TurnBasedMatchesRematchCall) RequestId(requestId int64) *TurnBasedMatchesRematchCall { + c.opt_["requestId"] = requestId + return c +} + +func (c *TurnBasedMatchesRematchCall) Do() (*TurnBasedMatchRematch, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestId"]; ok { + params.Set("requestId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/rematch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{matchId}", url.QueryEscape(c.matchId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TurnBasedMatchRematch) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a rematch of a match that was previously completed, with the same participants. This can be called by only one player on a match still in their list; the player must have called Finish first. Returns the newly created match; it will be the caller's turn.", + // "httpMethod": "POST", + // "id": "games.turnBasedMatches.rematch", + // "parameterOrder": [ + // "matchId" + // ], + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "matchId": { + // "description": "The ID of the match.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "requestId": { + // "description": "A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "turnbasedmatches/{matchId}/rematch", + // "response": { + // "$ref": "TurnBasedMatchRematch" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.turnBasedMatches.sync": + +type TurnBasedMatchesSyncCall struct { + s *Service + opt_ map[string]interface{} +} + +// Sync: Returns turn-based matches the player is or was involved in +// that changed since the last sync call, with the least recent changes +// coming first. Matches that should be removed from the local cache +// will have a status of MATCH_DELETED. +func (r *TurnBasedMatchesService) Sync() *TurnBasedMatchesSyncCall { + c := &TurnBasedMatchesSyncCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// IncludeMatchData sets the optional parameter "includeMatchData": True +// if match data should be returned in the response. Note that not all +// data will necessarily be returned if include_match_data is true; the +// server may decide to only return data for some of the matches to +// limit download size for the client. The remainder of the data for +// these matches will be retrievable on request. +func (c *TurnBasedMatchesSyncCall) IncludeMatchData(includeMatchData bool) *TurnBasedMatchesSyncCall { + c.opt_["includeMatchData"] = includeMatchData + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *TurnBasedMatchesSyncCall) Language(language string) *TurnBasedMatchesSyncCall { + c.opt_["language"] = language + return c +} + +// MaxCompletedMatches sets the optional parameter +// "maxCompletedMatches": The maximum number of completed or canceled +// matches to return in the response. If not set, all matches returned +// could be completed or canceled. +func (c *TurnBasedMatchesSyncCall) MaxCompletedMatches(maxCompletedMatches int64) *TurnBasedMatchesSyncCall { + c.opt_["maxCompletedMatches"] = maxCompletedMatches + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of matches to return in the response, used for paging. For any +// response, the actual number of matches to return may be less than the +// specified maxResults. +func (c *TurnBasedMatchesSyncCall) MaxResults(maxResults int64) *TurnBasedMatchesSyncCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *TurnBasedMatchesSyncCall) PageToken(pageToken string) *TurnBasedMatchesSyncCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *TurnBasedMatchesSyncCall) Do() (*TurnBasedMatchSync, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeMatchData"]; ok { + params.Set("includeMatchData", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxCompletedMatches"]; ok { + params.Set("maxCompletedMatches", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/sync") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TurnBasedMatchSync) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns turn-based matches the player is or was involved in that changed since the last sync call, with the least recent changes coming first. Matches that should be removed from the local cache will have a status of MATCH_DELETED.", + // "httpMethod": "GET", + // "id": "games.turnBasedMatches.sync", + // "parameters": { + // "includeMatchData": { + // "description": "True if match data should be returned in the response. Note that not all data will necessarily be returned if include_match_data is true; the server may decide to only return data for some of the matches to limit download size for the client. The remainder of the data for these matches will be retrievable on request.", + // "location": "query", + // "type": "boolean" + // }, + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "maxCompletedMatches": { + // "description": "The maximum number of completed or canceled matches to return in the response. If not set, all matches returned could be completed or canceled.", + // "format": "int32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "maxResults": { + // "description": "The maximum number of matches to return in the response, used for paging. For any response, the actual number of matches to return may be less than the specified maxResults.", + // "format": "int32", + // "location": "query", + // "maximum": "500", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "turnbasedmatches/sync", + // "response": { + // "$ref": "TurnBasedMatchSync" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.turnBasedMatches.takeTurn": + +type TurnBasedMatchesTakeTurnCall struct { + s *Service + matchId string + turnbasedmatchturn *TurnBasedMatchTurn + opt_ map[string]interface{} +} + +// TakeTurn: Commit the results of a player turn. +func (r *TurnBasedMatchesService) TakeTurn(matchId string, turnbasedmatchturn *TurnBasedMatchTurn) *TurnBasedMatchesTakeTurnCall { + c := &TurnBasedMatchesTakeTurnCall{s: r.s, opt_: make(map[string]interface{})} + c.matchId = matchId + c.turnbasedmatchturn = turnbasedmatchturn + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *TurnBasedMatchesTakeTurnCall) Language(language string) *TurnBasedMatchesTakeTurnCall { + c.opt_["language"] = language + return c +} + +func (c *TurnBasedMatchesTakeTurnCall) Do() (*TurnBasedMatch, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.turnbasedmatchturn) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/turn") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{matchId}", url.QueryEscape(c.matchId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TurnBasedMatch) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Commit the results of a player turn.", + // "httpMethod": "PUT", + // "id": "games.turnBasedMatches.takeTurn", + // "parameterOrder": [ + // "matchId" + // ], + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "matchId": { + // "description": "The ID of the match.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "turnbasedmatches/{matchId}/turn", + // "request": { + // "$ref": "TurnBasedMatchTurn" + // }, + // "response": { + // "$ref": "TurnBasedMatch" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/gamesmanagement/v1management/gamesmanagement-api.json b/third_party/src/code.google.com/p/google-api-go-client/gamesmanagement/v1management/gamesmanagement-api.json new file mode 100644 index 0000000000000..fca78fbd16059 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/gamesmanagement/v1management/gamesmanagement-api.json @@ -0,0 +1,489 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/ezsqeTaysRk0TeNXoa9oSjBpsPM\"", + "discoveryVersion": "v1", + "id": "gamesManagement:v1management", + "name": "gamesManagement", + "canonicalName": "Games Management", + "version": "v1management", + "title": "Google Play Game Services Management API", + "description": "The Management API for Google Play Game Services.", + "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", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/games/v1management/", + "basePath": "/games/v1management/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "games/v1management/", + "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/games": { + "description": "Share your Google+ profile information and view and manage your game activity" + }, + "https://www.googleapis.com/auth/plus.login": { + "description": "Know your basic profile info and list of people in your circles." + } + } + } + }, + "schemas": { + "AchievementResetAllResponse": { + "id": "AchievementResetAllResponse", + "type": "object", + "description": "This is a JSON template for achievement reset all response.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string gamesManagement#achievementResetAllResponse.", + "default": "gamesManagement#achievementResetAllResponse" + }, + "results": { + "type": "array", + "description": "The achievement reset results.", + "items": { + "$ref": "AchievementResetResponse" + } + } + } + }, + "AchievementResetResponse": { + "id": "AchievementResetResponse", + "type": "object", + "description": "This is a JSON template for an achievement reset response.", + "properties": { + "currentState": { + "type": "string", + "description": "The current state of the achievement. This is the same as the initial state of the achievement.\nPossible values are: \n- \"HIDDEN\"- Achievement is hidden. \n- \"REVEALED\" - Achievement is revealed. \n- \"UNLOCKED\" - Achievement is unlocked." + }, + "definitionId": { + "type": "string", + "description": "The ID of an achievement for which player state has been updated." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string gamesManagement#achievementResetResponse.", + "default": "gamesManagement#achievementResetResponse" + }, + "updateOccurred": { + "type": "boolean", + "description": "Flag to indicate if the requested update actually occurred." + } + } + }, + "GamesPlayedResource": { + "id": "GamesPlayedResource", + "type": "object", + "description": "This is a JSON template for 3P metadata about a player playing a game.", + "properties": { + "autoMatched": { + "type": "boolean", + "description": "True if the player was auto-matched with the currently authenticated user." + }, + "timeMillis": { + "type": "string", + "description": "The last time the player played the game in milliseconds since the epoch in UTC.", + "format": "int64" + } + } + }, + "HiddenPlayer": { + "id": "HiddenPlayer", + "type": "object", + "description": "This is a JSON template for the HiddenPlayer resource.", + "properties": { + "hiddenTimeMillis": { + "type": "string", + "description": "The time this player was hidden.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string gamesManagement#hiddenPlayer.", + "default": "gamesManagement#hiddenPlayer" + }, + "player": { + "$ref": "Player", + "description": "The player information." + } + } + }, + "HiddenPlayerList": { + "id": "HiddenPlayerList", + "type": "object", + "description": "This is a JSON template for a list of hidden players.", + "properties": { + "items": { + "type": "array", + "description": "The players.", + "items": { + "$ref": "HiddenPlayer" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string gamesManagement#hiddenPlayerList.", + "default": "gamesManagement#hiddenPlayerList" + }, + "nextPageToken": { + "type": "string", + "description": "The pagination token for the next page of results." + } + } + }, + "Player": { + "id": "Player", + "type": "object", + "description": "This is a JSON template for a Player resource.", + "properties": { + "avatarImageUrl": { + "type": "string", + "description": "The base URL for the image that represents the player." + }, + "displayName": { + "type": "string", + "description": "The name to display for the player." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string gamesManagement#player.", + "default": "gamesManagement#player" + }, + "lastPlayedWith": { + "$ref": "GamesPlayedResource", + "description": "Details about the last time this player played a multiplayer game with the currently authenticated player. Populated for PLAYED_WITH player collection members." + }, + "name": { + "type": "object", + "description": "An object representation of the individual components of the player's name.", + "properties": { + "familyName": { + "type": "string", + "description": "The family name (last name) of this player." + }, + "givenName": { + "type": "string", + "description": "The given name (first name) of this player." + } + } + }, + "playerId": { + "type": "string", + "description": "The ID of the player." + } + } + }, + "PlayerScoreResetResponse": { + "id": "PlayerScoreResetResponse", + "type": "object", + "description": "This is a JSON template for a list of reset leaderboard entry resources.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string gamesManagement#playerScoreResetResponse.", + "default": "gamesManagement#playerScoreResetResponse" + }, + "resetScoreTimeSpans": { + "type": "array", + "description": "The time spans of the updated score.\nPossible values are: \n- \"ALL_TIME\" - The score is an all-time score. \n- \"WEEKLY\" - The score is a weekly score. \n- \"DAILY\" - The score is a daily score.", + "items": { + "type": "string" + } + } + } + } + }, + "resources": { + "achievements": { + "methods": { + "reset": { + "id": "gamesManagement.achievements.reset", + "path": "achievements/{achievementId}/reset", + "httpMethod": "POST", + "description": "Resets the achievement with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application.", + "parameters": { + "achievementId": { + "type": "string", + "description": "The ID of the achievement used by this method.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "achievementId" + ], + "response": { + "$ref": "AchievementResetResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "resetAll": { + "id": "gamesManagement.achievements.resetAll", + "path": "achievements/reset", + "httpMethod": "POST", + "description": "Resets all achievements for the currently authenticated player for your application. This method is only accessible to whitelisted tester accounts for your application.", + "response": { + "$ref": "AchievementResetAllResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "resetForAllPlayers": { + "id": "gamesManagement.achievements.resetForAllPlayers", + "path": "achievements/{achievementId}/resetForAllPlayers", + "httpMethod": "POST", + "description": "Resets the achievement with the given ID for the all players. This method is only available to user accounts for your developer console. Only draft achievements can be reset.", + "parameters": { + "achievementId": { + "type": "string", + "description": "The ID of the achievement used by this method.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "achievementId" + ], + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + }, + "applications": { + "methods": { + "listHidden": { + "id": "gamesManagement.applications.listHidden", + "path": "applications/{applicationId}/players/hidden", + "httpMethod": "GET", + "description": "Get the list of players hidden from the given application. This method is only available to user accounts for your developer console.", + "parameters": { + "applicationId": { + "type": "string", + "description": "The application being requested.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of player resources to return in the response, used for paging. For any response, the actual number of player resources returned may be less than the specified maxResults.", + "format": "int32", + "minimum": "1", + "maximum": "15", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + } + }, + "parameterOrder": [ + "applicationId" + ], + "response": { + "$ref": "HiddenPlayerList" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + }, + "players": { + "methods": { + "hide": { + "id": "gamesManagement.players.hide", + "path": "applications/{applicationId}/players/hidden/{playerId}", + "httpMethod": "POST", + "description": "Hide the given player's leaderboard scores from the given application. This method is only available to user accounts for your developer console.", + "parameters": { + "applicationId": { + "type": "string", + "description": "The application being requested.", + "required": true, + "location": "path" + }, + "playerId": { + "type": "string", + "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "applicationId", + "playerId" + ], + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "unhide": { + "id": "gamesManagement.players.unhide", + "path": "applications/{applicationId}/players/hidden/{playerId}", + "httpMethod": "DELETE", + "description": "Unhide the given player's leaderboard scores from the given application. This method is only available to user accounts for your developer console.", + "parameters": { + "applicationId": { + "type": "string", + "description": "The application being requested.", + "required": true, + "location": "path" + }, + "playerId": { + "type": "string", + "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "applicationId", + "playerId" + ], + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + }, + "rooms": { + "methods": { + "reset": { + "id": "gamesManagement.rooms.reset", + "path": "rooms/reset", + "httpMethod": "POST", + "description": "Reset all rooms for the currently authenticated player for your application. This method is only accessible to whitelisted tester accounts for your application.", + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + }, + "scores": { + "methods": { + "reset": { + "id": "gamesManagement.scores.reset", + "path": "leaderboards/{leaderboardId}/scores/reset", + "httpMethod": "POST", + "description": "Reset scores for the specified leaderboard for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application.", + "parameters": { + "leaderboardId": { + "type": "string", + "description": "The ID of the leaderboard.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "leaderboardId" + ], + "response": { + "$ref": "PlayerScoreResetResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "resetForAllPlayers": { + "id": "gamesManagement.scores.resetForAllPlayers", + "path": "leaderboards/{leaderboardId}/scores/resetForAllPlayers", + "httpMethod": "POST", + "description": "Reset scores for the specified leaderboard for all players. This method is only available to user accounts for your developer console. Only draft leaderboards can be reset.", + "parameters": { + "leaderboardId": { + "type": "string", + "description": "The ID of the leaderboard.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "leaderboardId" + ], + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + }, + "turnBasedMatches": { + "methods": { + "reset": { + "id": "gamesManagement.turnBasedMatches.reset", + "path": "turnbasedmatches/reset", + "httpMethod": "POST", + "description": "Reset all turn-based match data for a user. This method is only accessible to whitelisted tester accounts for your application.", + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/gamesmanagement/v1management/gamesmanagement-gen.go b/third_party/src/code.google.com/p/google-api-go-client/gamesmanagement/v1management/gamesmanagement-gen.go new file mode 100644 index 0000000000000..f92b86f5af6a5 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/gamesmanagement/v1management/gamesmanagement-gen.go @@ -0,0 +1,891 @@ +// Package gamesmanagement provides access to the Google Play Game Services Management API. +// +// See https://developers.google.com/games/services +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/gamesmanagement/v1management" +// ... +// gamesmanagementService, err := gamesmanagement.New(oauthHttpClient) +package gamesmanagement + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "gamesManagement:v1management" +const apiName = "gamesManagement" +const apiVersion = "v1management" +const basePath = "https://www.googleapis.com/games/v1management/" + +// OAuth2 scopes used by this API. +const ( + // Share your Google+ profile information and view and manage your game + // activity + GamesScope = "https://www.googleapis.com/auth/games" + + // Know your basic profile info and list of people in your circles. + PlusLoginScope = "https://www.googleapis.com/auth/plus.login" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Achievements = NewAchievementsService(s) + s.Applications = NewApplicationsService(s) + s.Players = NewPlayersService(s) + s.Rooms = NewRoomsService(s) + s.Scores = NewScoresService(s) + s.TurnBasedMatches = NewTurnBasedMatchesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Achievements *AchievementsService + + Applications *ApplicationsService + + Players *PlayersService + + Rooms *RoomsService + + Scores *ScoresService + + TurnBasedMatches *TurnBasedMatchesService +} + +func NewAchievementsService(s *Service) *AchievementsService { + rs := &AchievementsService{s: s} + return rs +} + +type AchievementsService struct { + s *Service +} + +func NewApplicationsService(s *Service) *ApplicationsService { + rs := &ApplicationsService{s: s} + return rs +} + +type ApplicationsService struct { + s *Service +} + +func NewPlayersService(s *Service) *PlayersService { + rs := &PlayersService{s: s} + return rs +} + +type PlayersService struct { + s *Service +} + +func NewRoomsService(s *Service) *RoomsService { + rs := &RoomsService{s: s} + return rs +} + +type RoomsService struct { + s *Service +} + +func NewScoresService(s *Service) *ScoresService { + rs := &ScoresService{s: s} + return rs +} + +type ScoresService struct { + s *Service +} + +func NewTurnBasedMatchesService(s *Service) *TurnBasedMatchesService { + rs := &TurnBasedMatchesService{s: s} + return rs +} + +type TurnBasedMatchesService struct { + s *Service +} + +type AchievementResetAllResponse struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string gamesManagement#achievementResetAllResponse. + Kind string `json:"kind,omitempty"` + + // Results: The achievement reset results. + Results []*AchievementResetResponse `json:"results,omitempty"` +} + +type AchievementResetResponse struct { + // CurrentState: The current state of the achievement. This is the same + // as the initial state of the achievement. + // Possible values are: + // - + // "HIDDEN"- Achievement is hidden. + // - "REVEALED" - Achievement is + // revealed. + // - "UNLOCKED" - Achievement is unlocked. + CurrentState string `json:"currentState,omitempty"` + + // DefinitionId: The ID of an achievement for which player state has + // been updated. + DefinitionId string `json:"definitionId,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string gamesManagement#achievementResetResponse. + Kind string `json:"kind,omitempty"` + + // UpdateOccurred: Flag to indicate if the requested update actually + // occurred. + UpdateOccurred bool `json:"updateOccurred,omitempty"` +} + +type GamesPlayedResource struct { + // AutoMatched: True if the player was auto-matched with the currently + // authenticated user. + AutoMatched bool `json:"autoMatched,omitempty"` + + // TimeMillis: The last time the player played the game in milliseconds + // since the epoch in UTC. + TimeMillis int64 `json:"timeMillis,omitempty,string"` +} + +type HiddenPlayer struct { + // HiddenTimeMillis: The time this player was hidden. + HiddenTimeMillis int64 `json:"hiddenTimeMillis,omitempty,string"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string gamesManagement#hiddenPlayer. + Kind string `json:"kind,omitempty"` + + // Player: The player information. + Player *Player `json:"player,omitempty"` +} + +type HiddenPlayerList struct { + // Items: The players. + Items []*HiddenPlayer `json:"items,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string gamesManagement#hiddenPlayerList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The pagination token for the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Player struct { + // AvatarImageUrl: The base URL for the image that represents the + // player. + AvatarImageUrl string `json:"avatarImageUrl,omitempty"` + + // DisplayName: The name to display for the player. + DisplayName string `json:"displayName,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string gamesManagement#player. + Kind string `json:"kind,omitempty"` + + // LastPlayedWith: Details about the last time this player played a + // multiplayer game with the currently authenticated player. Populated + // for PLAYED_WITH player collection members. + LastPlayedWith *GamesPlayedResource `json:"lastPlayedWith,omitempty"` + + // Name: An object representation of the individual components of the + // player's name. + Name *PlayerName `json:"name,omitempty"` + + // PlayerId: The ID of the player. + PlayerId string `json:"playerId,omitempty"` +} + +type PlayerName struct { + // FamilyName: The family name (last name) of this player. + FamilyName string `json:"familyName,omitempty"` + + // GivenName: The given name (first name) of this player. + GivenName string `json:"givenName,omitempty"` +} + +type PlayerScoreResetResponse struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string gamesManagement#playerScoreResetResponse. + Kind string `json:"kind,omitempty"` + + // ResetScoreTimeSpans: The time spans of the updated score. + // Possible + // values are: + // - "ALL_TIME" - The score is an all-time score. + // - + // "WEEKLY" - The score is a weekly score. + // - "DAILY" - The score is a + // daily score. + ResetScoreTimeSpans []string `json:"resetScoreTimeSpans,omitempty"` +} + +// method id "gamesManagement.achievements.reset": + +type AchievementsResetCall struct { + s *Service + achievementId string + opt_ map[string]interface{} +} + +// Reset: Resets the achievement with the given ID for the currently +// authenticated player. This method is only accessible to whitelisted +// tester accounts for your application. +func (r *AchievementsService) Reset(achievementId string) *AchievementsResetCall { + c := &AchievementsResetCall{s: r.s, opt_: make(map[string]interface{})} + c.achievementId = achievementId + return c +} + +func (c *AchievementsResetCall) Do() (*AchievementResetResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{achievementId}", url.QueryEscape(c.achievementId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AchievementResetResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Resets the achievement with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application.", + // "httpMethod": "POST", + // "id": "gamesManagement.achievements.reset", + // "parameterOrder": [ + // "achievementId" + // ], + // "parameters": { + // "achievementId": { + // "description": "The ID of the achievement used by this method.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "achievements/{achievementId}/reset", + // "response": { + // "$ref": "AchievementResetResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "gamesManagement.achievements.resetAll": + +type AchievementsResetAllCall struct { + s *Service + opt_ map[string]interface{} +} + +// ResetAll: Resets all achievements for the currently authenticated +// player for your application. This method is only accessible to +// whitelisted tester accounts for your application. +func (r *AchievementsService) ResetAll() *AchievementsResetAllCall { + c := &AchievementsResetAllCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *AchievementsResetAllCall) Do() (*AchievementResetAllResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AchievementResetAllResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Resets all achievements for the currently authenticated player for your application. This method is only accessible to whitelisted tester accounts for your application.", + // "httpMethod": "POST", + // "id": "gamesManagement.achievements.resetAll", + // "path": "achievements/reset", + // "response": { + // "$ref": "AchievementResetAllResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "gamesManagement.achievements.resetForAllPlayers": + +type AchievementsResetForAllPlayersCall struct { + s *Service + achievementId string + opt_ map[string]interface{} +} + +// ResetForAllPlayers: Resets the achievement with the given ID for the +// all players. This method is only available to user accounts for your +// developer console. Only draft achievements can be reset. +func (r *AchievementsService) ResetForAllPlayers(achievementId string) *AchievementsResetForAllPlayersCall { + c := &AchievementsResetForAllPlayersCall{s: r.s, opt_: make(map[string]interface{})} + c.achievementId = achievementId + return c +} + +func (c *AchievementsResetForAllPlayersCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/resetForAllPlayers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{achievementId}", url.QueryEscape(c.achievementId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Resets the achievement with the given ID for the all players. This method is only available to user accounts for your developer console. Only draft achievements can be reset.", + // "httpMethod": "POST", + // "id": "gamesManagement.achievements.resetForAllPlayers", + // "parameterOrder": [ + // "achievementId" + // ], + // "parameters": { + // "achievementId": { + // "description": "The ID of the achievement used by this method.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "achievements/{achievementId}/resetForAllPlayers", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "gamesManagement.applications.listHidden": + +type ApplicationsListHiddenCall struct { + s *Service + applicationId string + opt_ map[string]interface{} +} + +// ListHidden: Get the list of players hidden from the given +// application. This method is only available to user accounts for your +// developer console. +func (r *ApplicationsService) ListHidden(applicationId string) *ApplicationsListHiddenCall { + c := &ApplicationsListHiddenCall{s: r.s, opt_: make(map[string]interface{})} + c.applicationId = applicationId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of player resources to return in the response, used for +// paging. For any response, the actual number of player resources +// returned may be less than the specified maxResults. +func (c *ApplicationsListHiddenCall) MaxResults(maxResults int64) *ApplicationsListHiddenCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *ApplicationsListHiddenCall) PageToken(pageToken string) *ApplicationsListHiddenCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ApplicationsListHiddenCall) Do() (*HiddenPlayerList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/players/hidden") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{applicationId}", url.QueryEscape(c.applicationId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(HiddenPlayerList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the list of players hidden from the given application. This method is only available to user accounts for your developer console.", + // "httpMethod": "GET", + // "id": "gamesManagement.applications.listHidden", + // "parameterOrder": [ + // "applicationId" + // ], + // "parameters": { + // "applicationId": { + // "description": "The application being requested.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of player resources to return in the response, used for paging. For any response, the actual number of player resources returned may be less than the specified maxResults.", + // "format": "int32", + // "location": "query", + // "maximum": "15", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "applications/{applicationId}/players/hidden", + // "response": { + // "$ref": "HiddenPlayerList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "gamesManagement.players.hide": + +type PlayersHideCall struct { + s *Service + applicationId string + playerId string + opt_ map[string]interface{} +} + +// Hide: Hide the given player's leaderboard scores from the given +// application. This method is only available to user accounts for your +// developer console. +func (r *PlayersService) Hide(applicationId string, playerId string) *PlayersHideCall { + c := &PlayersHideCall{s: r.s, opt_: make(map[string]interface{})} + c.applicationId = applicationId + c.playerId = playerId + return c +} + +func (c *PlayersHideCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/players/hidden/{playerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{applicationId}", url.QueryEscape(c.applicationId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{playerId}", url.QueryEscape(c.playerId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Hide the given player's leaderboard scores from the given application. This method is only available to user accounts for your developer console.", + // "httpMethod": "POST", + // "id": "gamesManagement.players.hide", + // "parameterOrder": [ + // "applicationId", + // "playerId" + // ], + // "parameters": { + // "applicationId": { + // "description": "The application being requested.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "playerId": { + // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "applications/{applicationId}/players/hidden/{playerId}", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "gamesManagement.players.unhide": + +type PlayersUnhideCall struct { + s *Service + applicationId string + playerId string + opt_ map[string]interface{} +} + +// Unhide: Unhide the given player's leaderboard scores from the given +// application. This method is only available to user accounts for your +// developer console. +func (r *PlayersService) Unhide(applicationId string, playerId string) *PlayersUnhideCall { + c := &PlayersUnhideCall{s: r.s, opt_: make(map[string]interface{})} + c.applicationId = applicationId + c.playerId = playerId + return c +} + +func (c *PlayersUnhideCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/players/hidden/{playerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{applicationId}", url.QueryEscape(c.applicationId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{playerId}", url.QueryEscape(c.playerId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Unhide the given player's leaderboard scores from the given application. This method is only available to user accounts for your developer console.", + // "httpMethod": "DELETE", + // "id": "gamesManagement.players.unhide", + // "parameterOrder": [ + // "applicationId", + // "playerId" + // ], + // "parameters": { + // "applicationId": { + // "description": "The application being requested.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "playerId": { + // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "applications/{applicationId}/players/hidden/{playerId}", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "gamesManagement.rooms.reset": + +type RoomsResetCall struct { + s *Service + opt_ map[string]interface{} +} + +// Reset: Reset all rooms for the currently authenticated player for +// your application. This method is only accessible to whitelisted +// tester accounts for your application. +func (r *RoomsService) Reset() *RoomsResetCall { + c := &RoomsResetCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *RoomsResetCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Reset all rooms for the currently authenticated player for your application. This method is only accessible to whitelisted tester accounts for your application.", + // "httpMethod": "POST", + // "id": "gamesManagement.rooms.reset", + // "path": "rooms/reset", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "gamesManagement.scores.reset": + +type ScoresResetCall struct { + s *Service + leaderboardId string + opt_ map[string]interface{} +} + +// Reset: Reset scores for the specified leaderboard for the currently +// authenticated player. This method is only accessible to whitelisted +// tester accounts for your application. +func (r *ScoresService) Reset(leaderboardId string) *ScoresResetCall { + c := &ScoresResetCall{s: r.s, opt_: make(map[string]interface{})} + c.leaderboardId = leaderboardId + return c +} + +func (c *ScoresResetCall) Do() (*PlayerScoreResetResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/scores/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{leaderboardId}", url.QueryEscape(c.leaderboardId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PlayerScoreResetResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Reset scores for the specified leaderboard for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application.", + // "httpMethod": "POST", + // "id": "gamesManagement.scores.reset", + // "parameterOrder": [ + // "leaderboardId" + // ], + // "parameters": { + // "leaderboardId": { + // "description": "The ID of the leaderboard.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "leaderboards/{leaderboardId}/scores/reset", + // "response": { + // "$ref": "PlayerScoreResetResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "gamesManagement.scores.resetForAllPlayers": + +type ScoresResetForAllPlayersCall struct { + s *Service + leaderboardId string + opt_ map[string]interface{} +} + +// ResetForAllPlayers: Reset scores for the specified leaderboard for +// all players. This method is only available to user accounts for your +// developer console. Only draft leaderboards can be reset. +func (r *ScoresService) ResetForAllPlayers(leaderboardId string) *ScoresResetForAllPlayersCall { + c := &ScoresResetForAllPlayersCall{s: r.s, opt_: make(map[string]interface{})} + c.leaderboardId = leaderboardId + return c +} + +func (c *ScoresResetForAllPlayersCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/scores/resetForAllPlayers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{leaderboardId}", url.QueryEscape(c.leaderboardId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Reset scores for the specified leaderboard for all players. This method is only available to user accounts for your developer console. Only draft leaderboards can be reset.", + // "httpMethod": "POST", + // "id": "gamesManagement.scores.resetForAllPlayers", + // "parameterOrder": [ + // "leaderboardId" + // ], + // "parameters": { + // "leaderboardId": { + // "description": "The ID of the leaderboard.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "leaderboards/{leaderboardId}/scores/resetForAllPlayers", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "gamesManagement.turnBasedMatches.reset": + +type TurnBasedMatchesResetCall struct { + s *Service + opt_ map[string]interface{} +} + +// Reset: Reset all turn-based match data for a user. This method is +// only accessible to whitelisted tester accounts for your application. +func (r *TurnBasedMatchesService) Reset() *TurnBasedMatchesResetCall { + c := &TurnBasedMatchesResetCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *TurnBasedMatchesResetCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Reset all turn-based match data for a user. This method is only accessible to whitelisted tester accounts for your application.", + // "httpMethod": "POST", + // "id": "gamesManagement.turnBasedMatches.reset", + // "path": "turnbasedmatches/reset", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/gan/v1beta1/gan-api.json b/third_party/src/code.google.com/p/google-api-go-client/gan/v1beta1/gan-api.json new file mode 100644 index 0000000000000..2772e6a42d6f3 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/gan/v1beta1/gan-api.json @@ -0,0 +1,1859 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/0f7uRmJraUnv6U9LmngxWGiEMV0\"", + "discoveryVersion": "v1", + "id": "gan:v1beta1", + "name": "gan", + "version": "v1beta1", + "title": "Google Affiliate Network API", + "description": "Lets you have programmatic access to your Google Affiliate Network data.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/affiliatenetwork-16.png", + "x32": "http://www.google.com/images/icons/product/affiliatenetwork-32.png" + }, + "documentationLink": "https://developers.google.com/affiliate-network/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/gan/v1beta1/", + "basePath": "/gan/v1beta1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "gan/v1beta1/", + "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" + } + }, + "schemas": { + "Advertiser": { + "id": "Advertiser", + "type": "object", + "description": "An AdvertiserResource.", + "properties": { + "allowPublisherCreatedLinks": { + "type": "boolean", + "description": "True if the advertiser allows publisher created links, otherwise false." + }, + "category": { + "type": "string", + "description": "Category that this advertiser belongs to. A valid list of categories can be found here: http://www.google.com/support/affiliatenetwork/advertiser/bin/answer.py?hl=en&answer=107581" + }, + "commissionDuration": { + "type": "integer", + "description": "The longest possible length of a commission (how long the cookies on the customer's browser last before they expire).", + "format": "int32" + }, + "contactEmail": { + "type": "string", + "description": "Email that this advertiser would like publishers to contact them with." + }, + "contactPhone": { + "type": "string", + "description": "Phone that this advertiser would like publishers to contact them with." + }, + "defaultLinkId": { + "type": "string", + "description": "The default link id for this advertiser.", + "format": "int64" + }, + "description": { + "type": "string", + "description": "Description of the website the advertiser advertises from." + }, + "epcNinetyDayAverage": { + "$ref": "Money", + "description": "The sum of fees paid to publishers divided by the total number of clicks over the past three months. This value should be multiplied by 100 at the time of display." + }, + "epcSevenDayAverage": { + "$ref": "Money", + "description": "The sum of fees paid to publishers divided by the total number of clicks over the past seven days. This value should be multiplied by 100 at the time of display." + }, + "id": { + "type": "string", + "description": "The ID of this advertiser.", + "format": "int64" + }, + "item": { + "$ref": "Advertiser", + "description": "The requested advertiser." + }, + "joinDate": { + "type": "string", + "description": "Date that this advertiser was approved as a Google Affiliate Network advertiser.", + "format": "date-time" + }, + "kind": { + "type": "string", + "description": "The kind for an advertiser.", + "default": "gan#advertiser" + }, + "logoUrl": { + "type": "string", + "description": "URL to the logo this advertiser uses on the Google Affiliate Network." + }, + "merchantCenterIds": { + "type": "array", + "description": "List of merchant center ids for this advertiser", + "items": { + "type": "string", + "format": "int64" + } + }, + "name": { + "type": "string", + "description": "The name of this advertiser." + }, + "payoutRank": { + "type": "string", + "description": "A rank based on commissions paid to publishers over the past 90 days. A number between 1 and 4 where 4 means the top quartile (most money paid) and 1 means the bottom quartile (least money paid)." + }, + "productFeedsEnabled": { + "type": "boolean", + "description": "Allows advertisers to submit product listings to Google Product Search." + }, + "redirectDomains": { + "type": "array", + "description": "List of redirect URLs for this advertiser", + "items": { + "type": "string" + } + }, + "siteUrl": { + "type": "string", + "description": "URL of the website this advertiser advertises from." + }, + "status": { + "type": "string", + "description": "The status of the requesting publisher's relationship this advertiser." + } + } + }, + "Advertisers": { + "id": "Advertisers", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The advertiser list.", + "items": { + "$ref": "Advertiser" + } + }, + "kind": { + "type": "string", + "description": "The kind for a page of advertisers.", + "default": "gan#advertisers" + }, + "nextPageToken": { + "type": "string", + "description": "The 'pageToken' to pass to the next request to get the next page, if there are more to retrieve." + } + } + }, + "CcOffer": { + "id": "CcOffer", + "type": "object", + "description": "A credit card offer. There are many possible result fields. We provide two different views of the data, or \"projections.\" The \"full\" projection includes every result field. And the \"summary\" projection, which is the default, includes a smaller subset of the fields. The fields included in the summary projection are marked as such in their descriptions.", + "properties": { + "additionalCardBenefits": { + "type": "array", + "description": "More marketing copy about the card's benefits. A summary field.", + "items": { + "type": "string" + } + }, + "additionalCardHolderFee": { + "type": "string", + "description": "Any extra fees levied on card holders." + }, + "ageMinimum": { + "type": "number", + "description": "The youngest a recipient of this card may be.", + "format": "double" + }, + "ageMinimumDetails": { + "type": "string", + "description": "Text describing the details of the age minimum restriction." + }, + "annualFee": { + "type": "number", + "description": "The ongoing annual fee, in dollars.", + "format": "double" + }, + "annualFeeDisplay": { + "type": "string", + "description": "Text describing the annual fee, including any difference for the first year. A summary field." + }, + "annualRewardMaximum": { + "type": "number", + "description": "The largest number of units you may accumulate in a year.", + "format": "double" + }, + "approvedCategories": { + "type": "array", + "description": "Possible categories for this card, eg \"Low Interest\" or \"Good.\" A summary field.", + "items": { + "type": "string" + } + }, + "aprDisplay": { + "type": "string", + "description": "Text describing the purchase APR. A summary field." + }, + "balanceComputationMethod": { + "type": "string", + "description": "Text describing how the balance is computed. A summary field." + }, + "balanceTransferTerms": { + "type": "string", + "description": "Text describing the terms for balance transfers. A summary field." + }, + "bonusRewards": { + "type": "array", + "description": "For cards with rewards programs, extra circumstances whereby additional rewards may be granted.", + "items": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "description": "How many units of reward will be granted.", + "format": "double" + }, + "details": { + "type": "string", + "description": "The circumstances under which this rule applies, for example, booking a flight via Orbitz." + } + } + } + }, + "carRentalInsurance": { + "type": "string", + "description": "If you get coverage when you use the card for the given activity, this field describes it." + }, + "cardBenefits": { + "type": "array", + "description": "A list of what the issuer thinks are the most important benefits of the card. Usually summarizes the rewards program, if there is one. A summary field.", + "items": { + "type": "string" + } + }, + "cardName": { + "type": "string", + "description": "The issuer's name for the card, including any trademark or service mark designators. A summary field." + }, + "cardType": { + "type": "string", + "description": "What kind of credit card this is, for example secured or unsecured." + }, + "cashAdvanceTerms": { + "type": "string", + "description": "Text describing the terms for cash advances. A summary field." + }, + "creditLimitMax": { + "type": "number", + "description": "The high end for credit limits the issuer imposes on recipients of this card.", + "format": "double" + }, + "creditLimitMin": { + "type": "number", + "description": "The low end for credit limits the issuer imposes on recipients of this card.", + "format": "double" + }, + "creditRatingDisplay": { + "type": "string", + "description": "Text describing the credit ratings required for recipients of this card, for example \"Excellent/Good.\" A summary field." + }, + "defaultFees": { + "type": "array", + "description": "Fees for defaulting on your payments.", + "items": { + "type": "object", + "properties": { + "category": { + "type": "string", + "description": "The type of charge, for example Purchases." + }, + "maxRate": { + "type": "number", + "description": "The highest rate the issuer may charge for defaulting on debt in this category. Expressed as an absolute number, not as a percentage.", + "format": "double" + }, + "minRate": { + "type": "number", + "description": "The lowest rate the issuer may charge for defaulting on debt in this category. Expressed as an absolute number, not as a percentage.", + "format": "double" + }, + "rateType": { + "type": "string", + "description": "Fixed or variable." + } + } + } + }, + "disclaimer": { + "type": "string", + "description": "A notice that, if present, is referenced via an asterisk by many of the other summary fields. If this field is present, it will always start with an asterisk (\"*\"), and must be prominently displayed with the offer. A summary field." + }, + "emergencyInsurance": { + "type": "string", + "description": "If you get coverage when you use the card for the given activity, this field describes it." + }, + "existingCustomerOnly": { + "type": "boolean", + "description": "Whether this card is only available to existing customers of the issuer." + }, + "extendedWarranty": { + "type": "string", + "description": "If you get coverage when you use the card for the given activity, this field describes it." + }, + "firstYearAnnualFee": { + "type": "number", + "description": "The annual fee for the first year, if different from the ongoing fee. Optional.", + "format": "double" + }, + "flightAccidentInsurance": { + "type": "string", + "description": "If you get coverage when you use the card for the given activity, this field describes it." + }, + "foreignCurrencyTransactionFee": { + "type": "string", + "description": "Fee for each transaction involving a foreign currency." + }, + "fraudLiability": { + "type": "string", + "description": "If you get coverage when you use the card for the given activity, this field describes it." + }, + "gracePeriodDisplay": { + "type": "string", + "description": "Text describing the grace period before finance charges apply. A summary field." + }, + "imageUrl": { + "type": "string", + "description": "The link to the image of the card that is shown on Connect Commerce. A summary field." + }, + "initialSetupAndProcessingFee": { + "type": "string", + "description": "Fee for setting up the card." + }, + "introBalanceTransferTerms": { + "type": "string", + "description": "Text describing the terms for introductory period balance transfers. A summary field." + }, + "introCashAdvanceTerms": { + "type": "string", + "description": "Text describing the terms for introductory period cash advances. A summary field." + }, + "introPurchaseTerms": { + "type": "string", + "description": "Text describing the terms for introductory period purchases. A summary field." + }, + "issuer": { + "type": "string", + "description": "Name of card issuer. A summary field." + }, + "issuerId": { + "type": "string", + "description": "The Google Affiliate Network ID of the advertiser making this offer." + }, + "issuerWebsite": { + "type": "string", + "description": "The generic link to the issuer's site." + }, + "kind": { + "type": "string", + "description": "The kind for one credit card offer. A summary field.", + "default": "gan#ccOffer" + }, + "landingPageUrl": { + "type": "string", + "description": "The link to the issuer's page for this card. A summary field." + }, + "latePaymentFee": { + "type": "string", + "description": "Text describing how much a late payment will cost, eg \"up to $35.\" A summary field." + }, + "luggageInsurance": { + "type": "string", + "description": "If you get coverage when you use the card for the given activity, this field describes it." + }, + "maxPurchaseRate": { + "type": "number", + "description": "The highest interest rate the issuer charges on this card. Expressed as an absolute number, not as a percentage.", + "format": "double" + }, + "minPurchaseRate": { + "type": "number", + "description": "The lowest interest rate the issuer charges on this card. Expressed as an absolute number, not as a percentage.", + "format": "double" + }, + "minimumFinanceCharge": { + "type": "string", + "description": "Text describing how much missing the grace period will cost." + }, + "network": { + "type": "string", + "description": "Which network (eg Visa) the card belongs to. A summary field." + }, + "offerId": { + "type": "string", + "description": "This offer's ID. A summary field." + }, + "offersImmediateCashReward": { + "type": "boolean", + "description": "Whether a cash reward program lets you get cash back sooner than end of year or other longish period." + }, + "overLimitFee": { + "type": "string", + "description": "Fee for exceeding the card's charge limit." + }, + "prohibitedCategories": { + "type": "array", + "description": "Categories in which the issuer does not wish the card to be displayed. A summary field.", + "items": { + "type": "string" + } + }, + "purchaseRateAdditionalDetails": { + "type": "string", + "description": "Text describing any additional details for the purchase rate. A summary field." + }, + "purchaseRateType": { + "type": "string", + "description": "Fixed or variable." + }, + "returnedPaymentFee": { + "type": "string", + "description": "Text describing the fee for a payment that doesn't clear. A summary field." + }, + "rewardPartner": { + "type": "string", + "description": "The company that redeems the rewards, if different from the issuer." + }, + "rewardUnit": { + "type": "string", + "description": "For cards with rewards programs, the unit of reward. For example, miles, cash back, points." + }, + "rewards": { + "type": "array", + "description": "For cards with rewards programs, detailed rules about how the program works.", + "items": { + "type": "object", + "properties": { + "additionalDetails": { + "type": "string", + "description": "Other limits, for example, if this rule only applies during an introductory period." + }, + "amount": { + "type": "number", + "description": "The number of units rewarded per purchase dollar.", + "format": "double" + }, + "category": { + "type": "string", + "description": "The kind of purchases covered by this rule." + }, + "expirationMonths": { + "type": "number", + "description": "How long rewards granted by this rule last.", + "format": "double" + }, + "maxRewardTier": { + "type": "number", + "description": "The maximum purchase amount in the given category for this rule to apply.", + "format": "double" + }, + "minRewardTier": { + "type": "number", + "description": "The minimum purchase amount in the given category before this rule applies.", + "format": "double" + } + } + } + }, + "rewardsExpire": { + "type": "boolean", + "description": "Whether accumulated rewards ever expire." + }, + "rewardsHaveBlackoutDates": { + "type": "boolean", + "description": "For airline miles rewards, tells whether blackout dates apply to the miles." + }, + "statementCopyFee": { + "type": "string", + "description": "Fee for requesting a copy of your statement." + }, + "trackingUrl": { + "type": "string", + "description": "The link to ping to register a click on this offer. A summary field." + }, + "travelInsurance": { + "type": "string", + "description": "If you get coverage when you use the card for the given activity, this field describes it." + }, + "variableRatesLastUpdated": { + "type": "string", + "description": "When variable rates were last updated." + }, + "variableRatesUpdateFrequency": { + "type": "string", + "description": "How often variable rates are updated." + } + } + }, + "CcOffers": { + "id": "CcOffers", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The credit card offers.", + "items": { + "$ref": "CcOffer" + } + }, + "kind": { + "type": "string", + "description": "The kind for a page of credit card offers.", + "default": "gan#ccOffers" + } + } + }, + "Event": { + "id": "Event", + "type": "object", + "description": "An EventResource.", + "properties": { + "advertiserId": { + "type": "string", + "description": "The ID of advertiser for this event.", + "format": "int64" + }, + "advertiserName": { + "type": "string", + "description": "The name of the advertiser for this event." + }, + "chargeId": { + "type": "string", + "description": "The charge ID for this event. Only returned for charge events." + }, + "chargeType": { + "type": "string", + "description": "Charge type of the event (other|slotting_fee|monthly_minimum|tier_bonus|debit|credit). Only returned for charge events." + }, + "commissionableSales": { + "$ref": "Money", + "description": "Amount of money exchanged during the transaction. Only returned for charge and conversion events." + }, + "earnings": { + "$ref": "Money", + "description": "Earnings by the publisher." + }, + "eventDate": { + "type": "string", + "description": "The date-time this event was initiated as a RFC 3339 date-time value.", + "format": "date-time" + }, + "kind": { + "type": "string", + "description": "The kind for one event.", + "default": "gan#event" + }, + "memberId": { + "type": "string", + "description": "The ID of the member attached to this event. Only returned for conversion events." + }, + "modifyDate": { + "type": "string", + "description": "The date-time this event was last modified as a RFC 3339 date-time value.", + "format": "date-time" + }, + "networkFee": { + "$ref": "Money", + "description": "Fee that the advertiser paid to the Google Affiliate Network." + }, + "orderId": { + "type": "string", + "description": "The order ID for this event. Only returned for conversion events." + }, + "products": { + "type": "array", + "description": "Products associated with the event.", + "items": { + "type": "object", + "properties": { + "categoryId": { + "type": "string", + "description": "Id of the category this product belongs to." + }, + "categoryName": { + "type": "string", + "description": "Name of the category this product belongs to." + }, + "earnings": { + "$ref": "Money", + "description": "Amount earned by the publisher on this product." + }, + "networkFee": { + "$ref": "Money", + "description": "Fee that the advertiser paid to the Google Affiliate Network for this product." + }, + "publisherFee": { + "$ref": "Money", + "description": "Fee that the advertiser paid to the publisehr for this product." + }, + "quantity": { + "type": "string", + "description": "Quantity of this product bought/exchanged.", + "format": "int64" + }, + "sku": { + "type": "string", + "description": "Sku of this product." + }, + "skuName": { + "type": "string", + "description": "Sku name of this product." + }, + "unitPrice": { + "$ref": "Money", + "description": "Price per unit of this product." + } + } + } + }, + "publisherFee": { + "$ref": "Money", + "description": "Fee that the advertiser paid to the publisher." + }, + "publisherId": { + "type": "string", + "description": "The ID of the publisher for this event.", + "format": "int64" + }, + "publisherName": { + "type": "string", + "description": "The name of the publisher for this event." + }, + "status": { + "type": "string", + "description": "Status of the event (active|canceled). Only returned for charge and conversion events." + }, + "type": { + "type": "string", + "description": "Type of the event (action|transaction|charge)." + } + } + }, + "Events": { + "id": "Events", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The event list.", + "items": { + "$ref": "Event" + } + }, + "kind": { + "type": "string", + "description": "The kind for a page of events.", + "default": "gan#events" + }, + "nextPageToken": { + "type": "string", + "description": "The 'pageToken' to pass to the next request to get the next page, if there are more to retrieve." + } + } + }, + "Link": { + "id": "Link", + "type": "object", + "description": "A LinkResource.", + "properties": { + "advertiserId": { + "type": "string", + "description": "The advertiser id for the advertiser who owns this link.", + "format": "int64" + }, + "authorship": { + "type": "string", + "description": "Authorship" + }, + "availability": { + "type": "string", + "description": "Availability." + }, + "clickTrackingUrl": { + "type": "string", + "description": "Tracking url for clicks." + }, + "createDate": { + "type": "string", + "description": "Date that this link was created.", + "format": "date-time" + }, + "description": { + "type": "string", + "description": "Description." + }, + "destinationUrl": { + "type": "string", + "description": "The destination URL for the link." + }, + "duration": { + "type": "string", + "description": "Duration" + }, + "endDate": { + "type": "string", + "description": "Date that this link becomes inactive.", + "format": "date-time" + }, + "epcNinetyDayAverage": { + "$ref": "Money", + "description": "The sum of fees paid to publishers divided by the total number of clicks over the past three months on this link. This value should be multiplied by 100 at the time of display." + }, + "epcSevenDayAverage": { + "$ref": "Money", + "description": "The sum of fees paid to publishers divided by the total number of clicks over the past seven days on this link. This value should be multiplied by 100 at the time of display." + }, + "id": { + "type": "string", + "description": "The ID of this link.", + "format": "int64" + }, + "imageAltText": { + "type": "string", + "description": "image alt text." + }, + "impressionTrackingUrl": { + "type": "string", + "description": "Tracking url for impressions." + }, + "isActive": { + "type": "boolean", + "description": "Flag for if this link is active." + }, + "kind": { + "type": "string", + "description": "The kind for one entity.", + "default": "gan#link" + }, + "linkType": { + "type": "string", + "description": "The link type." + }, + "name": { + "type": "string", + "description": "The logical name for this link." + }, + "promotionType": { + "type": "string", + "description": "Promotion Type" + }, + "specialOffers": { + "type": "object", + "description": "Special offers on the link.", + "properties": { + "freeGift": { + "type": "boolean", + "description": "Whether there is a free gift" + }, + "freeShipping": { + "type": "boolean", + "description": "Whether there is free shipping" + }, + "freeShippingMin": { + "$ref": "Money", + "description": "Minimum purchase amount for free shipping promotion" + }, + "percentOff": { + "type": "number", + "description": "Percent off on the purchase", + "format": "double" + }, + "percentOffMin": { + "$ref": "Money", + "description": "Minimum purchase amount for percent off promotion" + }, + "priceCut": { + "$ref": "Money", + "description": "Price cut on the purchase" + }, + "priceCutMin": { + "$ref": "Money", + "description": "Minimum purchase amount for price cut promotion" + }, + "promotionCodes": { + "type": "array", + "description": "List of promotion code associated with the link", + "items": { + "type": "string" + } + } + } + }, + "startDate": { + "type": "string", + "description": "Date that this link becomes active.", + "format": "date-time" + } + } + }, + "Links": { + "id": "Links", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The links.", + "items": { + "$ref": "Link" + } + }, + "kind": { + "type": "string", + "description": "The kind for a page of links.", + "default": "gan#links" + }, + "nextPageToken": { + "type": "string", + "description": "The next page token." + } + } + }, + "Money": { + "id": "Money", + "type": "object", + "description": "An ApiMoneyProto.", + "properties": { + "amount": { + "type": "number", + "description": "The amount of money.", + "format": "double" + }, + "currencyCode": { + "type": "string", + "description": "The 3-letter code of the currency in question." + } + } + }, + "Publisher": { + "id": "Publisher", + "type": "object", + "description": "A PublisherResource.", + "properties": { + "classification": { + "type": "string", + "description": "Classification that this publisher belongs to. See this link for all publisher classifications: http://www.google.com/support/affiliatenetwork/advertiser/bin/answer.py?hl=en&answer=107625&ctx=cb&src=cb&cbid=-k5fihzthfaik&cbrank=4" + }, + "epcNinetyDayAverage": { + "$ref": "Money", + "description": "The sum of fees paid to this publisher divided by the total number of clicks over the past three months. Values are multiplied by 100 for display purposes." + }, + "epcSevenDayAverage": { + "$ref": "Money", + "description": "The sum of fees paid to this publisher divided by the total number of clicks over the past seven days. Values are multiplied by 100 for display purposes." + }, + "id": { + "type": "string", + "description": "The ID of this publisher.", + "format": "int64" + }, + "item": { + "$ref": "Publisher", + "description": "The requested publisher." + }, + "joinDate": { + "type": "string", + "description": "Date that this publisher was approved as a Google Affiliate Network publisher.", + "format": "date-time" + }, + "kind": { + "type": "string", + "description": "The kind for a publisher.", + "default": "gan#publisher" + }, + "name": { + "type": "string", + "description": "The name of this publisher." + }, + "payoutRank": { + "type": "string", + "description": "A rank based on commissions paid to this publisher over the past 90 days. A number between 1 and 4 where 4 means the top quartile (most money paid) and 1 means the bottom quartile (least money paid)." + }, + "sites": { + "type": "array", + "description": "Websites that this publisher uses to advertise.", + "items": { + "type": "string" + } + }, + "status": { + "type": "string", + "description": "The status of the requesting advertiser's relationship with this publisher." + } + } + }, + "Publishers": { + "id": "Publishers", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The entity list.", + "items": { + "$ref": "Publisher" + } + }, + "kind": { + "type": "string", + "description": "The kind for a page of entities.", + "default": "gan#publishers" + }, + "nextPageToken": { + "type": "string", + "description": "The 'pageToken' to pass to the next request to get the next page, if there are more to retrieve." + } + } + }, + "Report": { + "id": "Report", + "type": "object", + "description": "A ReportResource representing a report of a certain type either for an advertiser or publisher.", + "properties": { + "column_names": { + "type": "array", + "description": "The column names for the report", + "items": { + "type": "string" + } + }, + "end_date": { + "type": "string", + "description": "The end of the date range for this report, exclusive." + }, + "kind": { + "type": "string", + "description": "The kind for a report.", + "default": "gan#report" + }, + "matching_row_count": { + "type": "string", + "description": "The number of matching rows before paging is applied.", + "format": "int64" + }, + "rows": { + "type": "array", + "description": "The rows of data for the report", + "items": { + "type": "array", + "description": "Loop over each column in the row.", + "items": { + "type": "any" + } + } + }, + "start_date": { + "type": "string", + "description": "The start of the date range for this report, inclusive." + }, + "totals_rows": { + "type": "array", + "description": "The totals rows for the report", + "items": { + "type": "array", + "description": "Loop over each column in the row.", + "items": { + "type": "any" + } + } + }, + "type": { + "type": "string", + "description": "The report type." + } + } + } + }, + "resources": { + "advertisers": { + "methods": { + "get": { + "id": "gan.advertisers.get", + "path": "{role}/{roleId}/advertiser", + "httpMethod": "GET", + "description": "Retrieves data about a single advertiser if that the requesting advertiser/publisher has access to it. Only publishers can lookup advertisers. Advertisers can request information about themselves by omitting the advertiserId query parameter.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "The ID of the advertiser to look up. Optional.", + "location": "query" + }, + "role": { + "type": "string", + "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.", + "required": true, + "enum": [ + "advertisers", + "publishers" + ], + "enumDescriptions": [ + "The requester is requesting as an advertiser.", + "The requester is requesting as a publisher." + ], + "location": "path" + }, + "roleId": { + "type": "string", + "description": "The ID of the requesting advertiser or publisher.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "role", + "roleId" + ], + "response": { + "$ref": "Advertiser" + } + }, + "list": { + "id": "gan.advertisers.list", + "path": "{role}/{roleId}/advertisers", + "httpMethod": "GET", + "description": "Retrieves data about all advertisers that the requesting advertiser/publisher has access to.", + "parameters": { + "advertiserCategory": { + "type": "string", + "description": "Caret(^) delimted list of advertiser categories. Valid categories are defined here: http://www.google.com/support/affiliatenetwork/advertiser/bin/answer.py?hl=en&answer=107581. Filters out all advertisers not in one of the given advertiser categories. Optional.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Max number of items to return in this page. Optional. Defaults to 20.", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "minNinetyDayEpc": { + "type": "number", + "description": "Filters out all advertisers that have a ninety day EPC average lower than the given value (inclusive). Min value: 0.0. Optional.", + "format": "double", + "location": "query" + }, + "minPayoutRank": { + "type": "integer", + "description": "A value between 1 and 4, where 1 represents the quartile of advertisers with the lowest ranks and 4 represents the quartile of advertisers with the highest ranks. Filters out all advertisers with a lower rank than the given quartile. For example if a 2 was given only advertisers with a payout rank of 25 or higher would be included. Optional.", + "format": "int32", + "minimum": "1", + "maximum": "4", + "location": "query" + }, + "minSevenDayEpc": { + "type": "number", + "description": "Filters out all advertisers that have a seven day EPC average lower than the given value (inclusive). Min value: 0.0. Optional.", + "format": "double", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of 'nextPageToken' from the previous page. Optional.", + "location": "query" + }, + "relationshipStatus": { + "type": "string", + "description": "Filters out all advertisers for which do not have the given relationship status with the requesting publisher.", + "enum": [ + "approved", + "available", + "deactivated", + "declined", + "pending" + ], + "enumDescriptions": [ + "An advertiser that has approved your application.", + "An advertiser program that's accepting new publishers.", + "Deactivated means either the advertiser has removed you from their program, or it could also mean that you chose to remove yourself from the advertiser's program.", + "An advertiser that did not approve your application.", + "An advertiser program that you've already applied to, but they haven't yet decided to approve or decline your application." + ], + "location": "query" + }, + "role": { + "type": "string", + "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.", + "required": true, + "enum": [ + "advertisers", + "publishers" + ], + "enumDescriptions": [ + "The requester is requesting as an advertiser.", + "The requester is requesting as a publisher." + ], + "location": "path" + }, + "roleId": { + "type": "string", + "description": "The ID of the requesting advertiser or publisher.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "role", + "roleId" + ], + "response": { + "$ref": "Advertisers" + } + } + } + }, + "ccOffers": { + "methods": { + "list": { + "id": "gan.ccOffers.list", + "path": "publishers/{publisher}/ccOffers", + "httpMethod": "GET", + "description": "Retrieves credit card offers for the given publisher.", + "parameters": { + "advertiser": { + "type": "string", + "description": "The advertiser ID of a card issuer whose offers to include. Optional, may be repeated.", + "repeated": true, + "location": "query" + }, + "projection": { + "type": "string", + "description": "The set of fields to return.", + "enum": [ + "full", + "summary" + ], + "enumDescriptions": [ + "Include all offer fields. This is the default.", + "Include only the basic fields needed to display an offer." + ], + "location": "query" + }, + "publisher": { + "type": "string", + "description": "The ID of the publisher in question.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "publisher" + ], + "response": { + "$ref": "CcOffers" + } + } + } + }, + "events": { + "methods": { + "list": { + "id": "gan.events.list", + "path": "{role}/{roleId}/events", + "httpMethod": "GET", + "description": "Retrieves event data for a given advertiser/publisher.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "Caret(^) delimited list of advertiser IDs. Filters out all events that do not reference one of the given advertiser IDs. Only used when under publishers role. Optional.", + "location": "query" + }, + "chargeType": { + "type": "string", + "description": "Filters out all charge events that are not of the given charge type. Valid values: 'other', 'slotting_fee', 'monthly_minimum', 'tier_bonus', 'credit', 'debit'. Optional.", + "enum": [ + "credit", + "debit", + "monthly_minimum", + "other", + "slotting_fee", + "tier_bonus" + ], + "enumDescriptions": [ + "A credit increases the publisher's payout amount and decreases the advertiser's invoice amount.", + "A debit reduces the publisher's payout and increases the advertiser's invoice amount.", + "A payment made to Google by an advertiser as a minimum monthly network fee.", + "Catch all. Default if unset", + "A one time payment made from an advertiser to a publisher.", + "A payment from an advertiser to a publisher for the publisher maintaining a high tier level" + ], + "location": "query" + }, + "eventDateMax": { + "type": "string", + "description": "Filters out all events later than given date. Optional. Defaults to 24 hours after eventMin.", + "location": "query" + }, + "eventDateMin": { + "type": "string", + "description": "Filters out all events earlier than given date. Optional. Defaults to 24 hours from current date/time.", + "location": "query" + }, + "linkId": { + "type": "string", + "description": "Caret(^) delimited list of link IDs. Filters out all events that do not reference one of the given link IDs. Optional.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Max number of offers to return in this page. Optional. Defaults to 20.", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "memberId": { + "type": "string", + "description": "Caret(^) delimited list of member IDs. Filters out all events that do not reference one of the given member IDs. Optional.", + "location": "query" + }, + "modifyDateMax": { + "type": "string", + "description": "Filters out all events modified later than given date. Optional. Defaults to 24 hours after modifyDateMin, if modifyDateMin is explicitly set.", + "location": "query" + }, + "modifyDateMin": { + "type": "string", + "description": "Filters out all events modified earlier than given date. Optional. Defaults to 24 hours before the current modifyDateMax, if modifyDateMax is explicitly set.", + "location": "query" + }, + "orderId": { + "type": "string", + "description": "Caret(^) delimited list of order IDs. Filters out all events that do not reference one of the given order IDs. Optional.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of 'nextPageToken' from the previous page. Optional.", + "location": "query" + }, + "productCategory": { + "type": "string", + "description": "Caret(^) delimited list of product categories. Filters out all events that do not reference a product in one of the given product categories. Optional.", + "location": "query" + }, + "publisherId": { + "type": "string", + "description": "Caret(^) delimited list of publisher IDs. Filters out all events that do not reference one of the given publishers IDs. Only used when under advertiser role. Optional.", + "location": "query" + }, + "role": { + "type": "string", + "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.", + "required": true, + "enum": [ + "advertisers", + "publishers" + ], + "enumDescriptions": [ + "The requester is requesting as an advertiser.", + "The requester is requesting as a publisher." + ], + "location": "path" + }, + "roleId": { + "type": "string", + "description": "The ID of the requesting advertiser or publisher.", + "required": true, + "location": "path" + }, + "sku": { + "type": "string", + "description": "Caret(^) delimited list of SKUs. Filters out all events that do not reference one of the given SKU. Optional.", + "location": "query" + }, + "status": { + "type": "string", + "description": "Filters out all events that do not have the given status. Valid values: 'active', 'canceled'. Optional.", + "enum": [ + "active", + "canceled" + ], + "enumDescriptions": [ + "Event is currently active.", + "Event is currently canceled." + ], + "location": "query" + }, + "type": { + "type": "string", + "description": "Filters out all events that are not of the given type. Valid values: 'action', 'transaction', 'charge'. Optional.", + "enum": [ + "action", + "charge", + "transaction" + ], + "enumDescriptions": [ + "The completion of an application, sign-up, or other process. For example, an action occurs if a user clicks an ad for a credit card and completes an application for that card.", + "A charge event is typically a payment between an advertiser, publisher or Google.", + "A conversion event, typically an e-commerce transaction. Some advertisers use a transaction to record other types of events, such as magazine subscriptions." + ], + "location": "query" + } + }, + "parameterOrder": [ + "role", + "roleId" + ], + "response": { + "$ref": "Events" + } + } + } + }, + "links": { + "methods": { + "get": { + "id": "gan.links.get", + "path": "{role}/{roleId}/link/{linkId}", + "httpMethod": "GET", + "description": "Retrieves data about a single link if the requesting advertiser/publisher has access to it. Advertisers can look up their own links. Publishers can look up visible links or links belonging to advertisers they are in a relationship with.", + "parameters": { + "linkId": { + "type": "string", + "description": "The ID of the link to look up.", + "required": true, + "format": "int64", + "location": "path" + }, + "role": { + "type": "string", + "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.", + "required": true, + "enum": [ + "advertisers", + "publishers" + ], + "enumDescriptions": [ + "The requester is requesting as an advertiser.", + "The requester is requesting as a publisher." + ], + "location": "path" + }, + "roleId": { + "type": "string", + "description": "The ID of the requesting advertiser or publisher.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "role", + "roleId", + "linkId" + ], + "response": { + "$ref": "Link" + } + }, + "insert": { + "id": "gan.links.insert", + "path": "{role}/{roleId}/link", + "httpMethod": "POST", + "description": "Inserts a new link.", + "parameters": { + "role": { + "type": "string", + "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.", + "required": true, + "enum": [ + "advertisers", + "publishers" + ], + "enumDescriptions": [ + "The requester is requesting as an advertiser.", + "The requester is requesting as a publisher." + ], + "location": "path" + }, + "roleId": { + "type": "string", + "description": "The ID of the requesting advertiser or publisher.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "role", + "roleId" + ], + "request": { + "$ref": "Link" + }, + "response": { + "$ref": "Link" + } + }, + "list": { + "id": "gan.links.list", + "path": "{role}/{roleId}/links", + "httpMethod": "GET", + "description": "Retrieves all links that match the query parameters.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "Limits the resulting links to the ones belonging to the listed advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "assetSize": { + "type": "string", + "description": "The size of the given asset.", + "repeated": true, + "location": "query" + }, + "authorship": { + "type": "string", + "description": "The role of the author of the link.", + "enum": [ + "advertiser", + "publisher" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "createDateMax": { + "type": "string", + "description": "The end of the create date range.", + "location": "query" + }, + "createDateMin": { + "type": "string", + "description": "The beginning of the create date range.", + "location": "query" + }, + "linkType": { + "type": "string", + "description": "The type of the link.", + "enum": [ + "banner", + "text" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Max number of items to return in this page. Optional. Defaults to 20.", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of 'nextPageToken' from the previous page. Optional.", + "location": "query" + }, + "promotionType": { + "type": "string", + "description": "The promotion type.", + "enum": [ + "coupon", + "free_gift", + "free_shipping", + "percent_off", + "price_cut" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "relationshipStatus": { + "type": "string", + "description": "The status of the relationship.", + "enum": [ + "approved", + "available" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "role": { + "type": "string", + "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.", + "required": true, + "enum": [ + "advertisers", + "publishers" + ], + "enumDescriptions": [ + "The requester is requesting as an advertiser.", + "The requester is requesting as a publisher." + ], + "location": "path" + }, + "roleId": { + "type": "string", + "description": "The ID of the requesting advertiser or publisher.", + "required": true, + "location": "path" + }, + "searchText": { + "type": "string", + "description": "Field for full text search across title and merchandising text, supports link id search.", + "location": "query" + }, + "startDateMax": { + "type": "string", + "description": "The end of the start date range.", + "location": "query" + }, + "startDateMin": { + "type": "string", + "description": "The beginning of the start date range.", + "location": "query" + } + }, + "parameterOrder": [ + "role", + "roleId" + ], + "response": { + "$ref": "Links" + } + } + } + }, + "publishers": { + "methods": { + "get": { + "id": "gan.publishers.get", + "path": "{role}/{roleId}/publisher", + "httpMethod": "GET", + "description": "Retrieves data about a single advertiser if that the requesting advertiser/publisher has access to it. Only advertisers can look up publishers. Publishers can request information about themselves by omitting the publisherId query parameter.", + "parameters": { + "publisherId": { + "type": "string", + "description": "The ID of the publisher to look up. Optional.", + "location": "query" + }, + "role": { + "type": "string", + "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.", + "required": true, + "enum": [ + "advertisers", + "publishers" + ], + "enumDescriptions": [ + "The requester is requesting as an advertiser.", + "The requester is requesting as a publisher." + ], + "location": "path" + }, + "roleId": { + "type": "string", + "description": "The ID of the requesting advertiser or publisher.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "role", + "roleId" + ], + "response": { + "$ref": "Publisher" + } + }, + "list": { + "id": "gan.publishers.list", + "path": "{role}/{roleId}/publishers", + "httpMethod": "GET", + "description": "Retrieves data about all publishers that the requesting advertiser/publisher has access to.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Max number of items to return in this page. Optional. Defaults to 20.", + "format": "uint32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "minNinetyDayEpc": { + "type": "number", + "description": "Filters out all publishers that have a ninety day EPC average lower than the given value (inclusive). Min value: 0.0. Optional.", + "format": "double", + "location": "query" + }, + "minPayoutRank": { + "type": "integer", + "description": "A value between 1 and 4, where 1 represents the quartile of publishers with the lowest ranks and 4 represents the quartile of publishers with the highest ranks. Filters out all publishers with a lower rank than the given quartile. For example if a 2 was given only publishers with a payout rank of 25 or higher would be included. Optional.", + "format": "int32", + "minimum": "1", + "maximum": "4", + "location": "query" + }, + "minSevenDayEpc": { + "type": "number", + "description": "Filters out all publishers that have a seven day EPC average lower than the given value (inclusive). Min value 0.0. Optional.", + "format": "double", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of 'nextPageToken' from the previous page. Optional.", + "location": "query" + }, + "publisherCategory": { + "type": "string", + "description": "Caret(^) delimted list of publisher categories. Valid categories: (unclassified|community_and_content|shopping_and_promotion|loyalty_and_rewards|network|search_specialist|comparison_shopping|email). Filters out all publishers not in one of the given advertiser categories. Optional.", + "location": "query" + }, + "relationshipStatus": { + "type": "string", + "description": "Filters out all publishers for which do not have the given relationship status with the requesting publisher.", + "enum": [ + "approved", + "available", + "deactivated", + "declined", + "pending" + ], + "enumDescriptions": [ + "Publishers you've approved to your program.", + "Publishers available for you to recruit.", + "A publisher that you terminated from your program. Publishers also have the ability to remove themselves from your program.", + "A publisher that you did not approve to your program.", + "Publishers that have applied to your program. We recommend reviewing and deciding on pending publishers on a weekly basis." + ], + "location": "query" + }, + "role": { + "type": "string", + "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.", + "required": true, + "enum": [ + "advertisers", + "publishers" + ], + "enumDescriptions": [ + "The requester is requesting as an advertiser.", + "The requester is requesting as a publisher." + ], + "location": "path" + }, + "roleId": { + "type": "string", + "description": "The ID of the requesting advertiser or publisher.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "role", + "roleId" + ], + "response": { + "$ref": "Publishers" + } + } + } + }, + "reports": { + "methods": { + "get": { + "id": "gan.reports.get", + "path": "{role}/{roleId}/report/{reportType}", + "httpMethod": "GET", + "description": "Retrieves a report of the specified type.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "The IDs of the advertisers to look up, if applicable.", + "repeated": true, + "location": "query" + }, + "calculateTotals": { + "type": "boolean", + "description": "Whether or not to calculate totals rows. Optional.", + "location": "query" + }, + "endDate": { + "type": "string", + "description": "The end date (exclusive), in RFC 3339 format, for the report data to be returned. Defaults to one day after startDate, if that is given, or today. Optional.", + "location": "query" + }, + "eventType": { + "type": "string", + "description": "Filters out all events that are not of the given type. Valid values: 'action', 'transaction', or 'charge'. Optional.", + "enum": [ + "action", + "charge", + "transaction" + ], + "enumDescriptions": [ + "Event type is action.", + "Event type is charge.", + "Event type is transaction." + ], + "location": "query" + }, + "linkId": { + "type": "string", + "description": "Filters to capture one of given link IDs. Optional.", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Max number of items to return in this page. Optional. Defaults to return all results.", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderId": { + "type": "string", + "description": "Filters to capture one of the given order IDs. Optional.", + "repeated": true, + "location": "query" + }, + "publisherId": { + "type": "string", + "description": "The IDs of the publishers to look up, if applicable.", + "repeated": true, + "location": "query" + }, + "reportType": { + "type": "string", + "description": "The type of report being requested. Valid values: 'order_delta'. Required.", + "required": true, + "enum": [ + "order_delta" + ], + "enumDescriptions": [ + "The order delta report type." + ], + "location": "path" + }, + "role": { + "type": "string", + "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.", + "required": true, + "enum": [ + "advertisers", + "publishers" + ], + "enumDescriptions": [ + "The requester is requesting as an advertiser.", + "The requester is requesting as a publisher." + ], + "location": "path" + }, + "roleId": { + "type": "string", + "description": "The ID of the requesting advertiser or publisher.", + "required": true, + "location": "path" + }, + "startDate": { + "type": "string", + "description": "The start date (inclusive), in RFC 3339 format, for the report data to be returned. Defaults to one day before endDate, if that is given, or yesterday. Optional.", + "location": "query" + }, + "startIndex": { + "type": "integer", + "description": "Offset on which to return results when paging. Optional.", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "status": { + "type": "string", + "description": "Filters out all events that do not have the given status. Valid values: 'active', 'canceled', or 'invalid'. Optional.", + "enum": [ + "active", + "canceled", + "invalid" + ], + "enumDescriptions": [ + "Event is currently active.", + "Event is currently canceled.", + "Event is currently invalid." + ], + "location": "query" + } + }, + "parameterOrder": [ + "role", + "roleId", + "reportType" + ], + "response": { + "$ref": "Report" + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/gan/v1beta1/gan-gen.go b/third_party/src/code.google.com/p/google-api-go-client/gan/v1beta1/gan-gen.go new file mode 100644 index 0000000000000..00d0a911846b4 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/gan/v1beta1/gan-gen.go @@ -0,0 +1,2731 @@ +// Package gan provides access to the Google Affiliate Network API. +// +// See https://developers.google.com/affiliate-network/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/gan/v1beta1" +// ... +// ganService, err := gan.New(oauthHttpClient) +package gan + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "gan:v1beta1" +const apiName = "gan" +const apiVersion = "v1beta1" +const basePath = "https://www.googleapis.com/gan/v1beta1/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Advertisers = NewAdvertisersService(s) + s.CcOffers = NewCcOffersService(s) + s.Events = NewEventsService(s) + s.Links = NewLinksService(s) + s.Publishers = NewPublishersService(s) + s.Reports = NewReportsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Advertisers *AdvertisersService + + CcOffers *CcOffersService + + Events *EventsService + + Links *LinksService + + Publishers *PublishersService + + Reports *ReportsService +} + +func NewAdvertisersService(s *Service) *AdvertisersService { + rs := &AdvertisersService{s: s} + return rs +} + +type AdvertisersService struct { + s *Service +} + +func NewCcOffersService(s *Service) *CcOffersService { + rs := &CcOffersService{s: s} + return rs +} + +type CcOffersService struct { + s *Service +} + +func NewEventsService(s *Service) *EventsService { + rs := &EventsService{s: s} + return rs +} + +type EventsService struct { + s *Service +} + +func NewLinksService(s *Service) *LinksService { + rs := &LinksService{s: s} + return rs +} + +type LinksService struct { + s *Service +} + +func NewPublishersService(s *Service) *PublishersService { + rs := &PublishersService{s: s} + return rs +} + +type PublishersService struct { + s *Service +} + +func NewReportsService(s *Service) *ReportsService { + rs := &ReportsService{s: s} + return rs +} + +type ReportsService struct { + s *Service +} + +type Advertiser struct { + // AllowPublisherCreatedLinks: True if the advertiser allows publisher + // created links, otherwise false. + AllowPublisherCreatedLinks bool `json:"allowPublisherCreatedLinks,omitempty"` + + // Category: Category that this advertiser belongs to. A valid list of + // categories can be found here: + // http://www.google.com/support/affiliatenetwork/advertiser/bin/answer.p + // y?hl=en&answer=107581 + Category string `json:"category,omitempty"` + + // CommissionDuration: The longest possible length of a commission (how + // long the cookies on the customer's browser last before they expire). + CommissionDuration int64 `json:"commissionDuration,omitempty"` + + // ContactEmail: Email that this advertiser would like publishers to + // contact them with. + ContactEmail string `json:"contactEmail,omitempty"` + + // ContactPhone: Phone that this advertiser would like publishers to + // contact them with. + ContactPhone string `json:"contactPhone,omitempty"` + + // DefaultLinkId: The default link id for this advertiser. + DefaultLinkId int64 `json:"defaultLinkId,omitempty,string"` + + // Description: Description of the website the advertiser advertises + // from. + Description string `json:"description,omitempty"` + + // EpcNinetyDayAverage: The sum of fees paid to publishers divided by + // the total number of clicks over the past three months. This value + // should be multiplied by 100 at the time of display. + EpcNinetyDayAverage *Money `json:"epcNinetyDayAverage,omitempty"` + + // EpcSevenDayAverage: The sum of fees paid to publishers divided by the + // total number of clicks over the past seven days. This value should be + // multiplied by 100 at the time of display. + EpcSevenDayAverage *Money `json:"epcSevenDayAverage,omitempty"` + + // Id: The ID of this advertiser. + Id int64 `json:"id,omitempty,string"` + + // Item: The requested advertiser. + Item *Advertiser `json:"item,omitempty"` + + // JoinDate: Date that this advertiser was approved as a Google + // Affiliate Network advertiser. + JoinDate string `json:"joinDate,omitempty"` + + // Kind: The kind for an advertiser. + Kind string `json:"kind,omitempty"` + + // LogoUrl: URL to the logo this advertiser uses on the Google Affiliate + // Network. + LogoUrl string `json:"logoUrl,omitempty"` + + // MerchantCenterIds: List of merchant center ids for this advertiser + MerchantCenterIds googleapi.Int64s `json:"merchantCenterIds,omitempty"` + + // Name: The name of this advertiser. + Name string `json:"name,omitempty"` + + // PayoutRank: A rank based on commissions paid to publishers over the + // past 90 days. A number between 1 and 4 where 4 means the top quartile + // (most money paid) and 1 means the bottom quartile (least money paid). + PayoutRank string `json:"payoutRank,omitempty"` + + // ProductFeedsEnabled: Allows advertisers to submit product listings to + // Google Product Search. + ProductFeedsEnabled bool `json:"productFeedsEnabled,omitempty"` + + // RedirectDomains: List of redirect URLs for this advertiser + RedirectDomains []string `json:"redirectDomains,omitempty"` + + // SiteUrl: URL of the website this advertiser advertises from. + SiteUrl string `json:"siteUrl,omitempty"` + + // Status: The status of the requesting publisher's relationship this + // advertiser. + Status string `json:"status,omitempty"` +} + +type Advertisers struct { + // Items: The advertiser list. + Items []*Advertiser `json:"items,omitempty"` + + // Kind: The kind for a page of advertisers. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The 'pageToken' to pass to the next request to get the + // next page, if there are more to retrieve. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type CcOffer struct { + // AdditionalCardBenefits: More marketing copy about the card's + // benefits. A summary field. + AdditionalCardBenefits []string `json:"additionalCardBenefits,omitempty"` + + // AdditionalCardHolderFee: Any extra fees levied on card holders. + AdditionalCardHolderFee string `json:"additionalCardHolderFee,omitempty"` + + // AgeMinimum: The youngest a recipient of this card may be. + AgeMinimum float64 `json:"ageMinimum,omitempty"` + + // AgeMinimumDetails: Text describing the details of the age minimum + // restriction. + AgeMinimumDetails string `json:"ageMinimumDetails,omitempty"` + + // AnnualFee: The ongoing annual fee, in dollars. + AnnualFee float64 `json:"annualFee,omitempty"` + + // AnnualFeeDisplay: Text describing the annual fee, including any + // difference for the first year. A summary field. + AnnualFeeDisplay string `json:"annualFeeDisplay,omitempty"` + + // AnnualRewardMaximum: The largest number of units you may accumulate + // in a year. + AnnualRewardMaximum float64 `json:"annualRewardMaximum,omitempty"` + + // ApprovedCategories: Possible categories for this card, eg "Low + // Interest" or "Good." A summary field. + ApprovedCategories []string `json:"approvedCategories,omitempty"` + + // AprDisplay: Text describing the purchase APR. A summary field. + AprDisplay string `json:"aprDisplay,omitempty"` + + // BalanceComputationMethod: Text describing how the balance is + // computed. A summary field. + BalanceComputationMethod string `json:"balanceComputationMethod,omitempty"` + + // BalanceTransferTerms: Text describing the terms for balance + // transfers. A summary field. + BalanceTransferTerms string `json:"balanceTransferTerms,omitempty"` + + // BonusRewards: For cards with rewards programs, extra circumstances + // whereby additional rewards may be granted. + BonusRewards []*CcOfferBonusRewards `json:"bonusRewards,omitempty"` + + // CarRentalInsurance: If you get coverage when you use the card for the + // given activity, this field describes it. + CarRentalInsurance string `json:"carRentalInsurance,omitempty"` + + // CardBenefits: A list of what the issuer thinks are the most important + // benefits of the card. Usually summarizes the rewards program, if + // there is one. A summary field. + CardBenefits []string `json:"cardBenefits,omitempty"` + + // CardName: The issuer's name for the card, including any trademark or + // service mark designators. A summary field. + CardName string `json:"cardName,omitempty"` + + // CardType: What kind of credit card this is, for example secured or + // unsecured. + CardType string `json:"cardType,omitempty"` + + // CashAdvanceTerms: Text describing the terms for cash advances. A + // summary field. + CashAdvanceTerms string `json:"cashAdvanceTerms,omitempty"` + + // CreditLimitMax: The high end for credit limits the issuer imposes on + // recipients of this card. + CreditLimitMax float64 `json:"creditLimitMax,omitempty"` + + // CreditLimitMin: The low end for credit limits the issuer imposes on + // recipients of this card. + CreditLimitMin float64 `json:"creditLimitMin,omitempty"` + + // CreditRatingDisplay: Text describing the credit ratings required for + // recipients of this card, for example "Excellent/Good." A summary + // field. + CreditRatingDisplay string `json:"creditRatingDisplay,omitempty"` + + // DefaultFees: Fees for defaulting on your payments. + DefaultFees []*CcOfferDefaultFees `json:"defaultFees,omitempty"` + + // Disclaimer: A notice that, if present, is referenced via an asterisk + // by many of the other summary fields. If this field is present, it + // will always start with an asterisk ("*"), and must be prominently + // displayed with the offer. A summary field. + Disclaimer string `json:"disclaimer,omitempty"` + + // EmergencyInsurance: If you get coverage when you use the card for the + // given activity, this field describes it. + EmergencyInsurance string `json:"emergencyInsurance,omitempty"` + + // ExistingCustomerOnly: Whether this card is only available to existing + // customers of the issuer. + ExistingCustomerOnly bool `json:"existingCustomerOnly,omitempty"` + + // ExtendedWarranty: If you get coverage when you use the card for the + // given activity, this field describes it. + ExtendedWarranty string `json:"extendedWarranty,omitempty"` + + // FirstYearAnnualFee: The annual fee for the first year, if different + // from the ongoing fee. Optional. + FirstYearAnnualFee float64 `json:"firstYearAnnualFee,omitempty"` + + // FlightAccidentInsurance: If you get coverage when you use the card + // for the given activity, this field describes it. + FlightAccidentInsurance string `json:"flightAccidentInsurance,omitempty"` + + // ForeignCurrencyTransactionFee: Fee for each transaction involving a + // foreign currency. + ForeignCurrencyTransactionFee string `json:"foreignCurrencyTransactionFee,omitempty"` + + // FraudLiability: If you get coverage when you use the card for the + // given activity, this field describes it. + FraudLiability string `json:"fraudLiability,omitempty"` + + // GracePeriodDisplay: Text describing the grace period before finance + // charges apply. A summary field. + GracePeriodDisplay string `json:"gracePeriodDisplay,omitempty"` + + // ImageUrl: The link to the image of the card that is shown on Connect + // Commerce. A summary field. + ImageUrl string `json:"imageUrl,omitempty"` + + // InitialSetupAndProcessingFee: Fee for setting up the card. + InitialSetupAndProcessingFee string `json:"initialSetupAndProcessingFee,omitempty"` + + // IntroBalanceTransferTerms: Text describing the terms for introductory + // period balance transfers. A summary field. + IntroBalanceTransferTerms string `json:"introBalanceTransferTerms,omitempty"` + + // IntroCashAdvanceTerms: Text describing the terms for introductory + // period cash advances. A summary field. + IntroCashAdvanceTerms string `json:"introCashAdvanceTerms,omitempty"` + + // IntroPurchaseTerms: Text describing the terms for introductory period + // purchases. A summary field. + IntroPurchaseTerms string `json:"introPurchaseTerms,omitempty"` + + // Issuer: Name of card issuer. A summary field. + Issuer string `json:"issuer,omitempty"` + + // IssuerId: The Google Affiliate Network ID of the advertiser making + // this offer. + IssuerId string `json:"issuerId,omitempty"` + + // IssuerWebsite: The generic link to the issuer's site. + IssuerWebsite string `json:"issuerWebsite,omitempty"` + + // Kind: The kind for one credit card offer. A summary field. + Kind string `json:"kind,omitempty"` + + // LandingPageUrl: The link to the issuer's page for this card. A + // summary field. + LandingPageUrl string `json:"landingPageUrl,omitempty"` + + // LatePaymentFee: Text describing how much a late payment will cost, eg + // "up to $35." A summary field. + LatePaymentFee string `json:"latePaymentFee,omitempty"` + + // LuggageInsurance: If you get coverage when you use the card for the + // given activity, this field describes it. + LuggageInsurance string `json:"luggageInsurance,omitempty"` + + // MaxPurchaseRate: The highest interest rate the issuer charges on this + // card. Expressed as an absolute number, not as a percentage. + MaxPurchaseRate float64 `json:"maxPurchaseRate,omitempty"` + + // MinPurchaseRate: The lowest interest rate the issuer charges on this + // card. Expressed as an absolute number, not as a percentage. + MinPurchaseRate float64 `json:"minPurchaseRate,omitempty"` + + // MinimumFinanceCharge: Text describing how much missing the grace + // period will cost. + MinimumFinanceCharge string `json:"minimumFinanceCharge,omitempty"` + + // Network: Which network (eg Visa) the card belongs to. A summary + // field. + Network string `json:"network,omitempty"` + + // OfferId: This offer's ID. A summary field. + OfferId string `json:"offerId,omitempty"` + + // OffersImmediateCashReward: Whether a cash reward program lets you get + // cash back sooner than end of year or other longish period. + OffersImmediateCashReward bool `json:"offersImmediateCashReward,omitempty"` + + // OverLimitFee: Fee for exceeding the card's charge limit. + OverLimitFee string `json:"overLimitFee,omitempty"` + + // ProhibitedCategories: Categories in which the issuer does not wish + // the card to be displayed. A summary field. + ProhibitedCategories []string `json:"prohibitedCategories,omitempty"` + + // PurchaseRateAdditionalDetails: Text describing any additional details + // for the purchase rate. A summary field. + PurchaseRateAdditionalDetails string `json:"purchaseRateAdditionalDetails,omitempty"` + + // PurchaseRateType: Fixed or variable. + PurchaseRateType string `json:"purchaseRateType,omitempty"` + + // ReturnedPaymentFee: Text describing the fee for a payment that + // doesn't clear. A summary field. + ReturnedPaymentFee string `json:"returnedPaymentFee,omitempty"` + + // RewardPartner: The company that redeems the rewards, if different + // from the issuer. + RewardPartner string `json:"rewardPartner,omitempty"` + + // RewardUnit: For cards with rewards programs, the unit of reward. For + // example, miles, cash back, points. + RewardUnit string `json:"rewardUnit,omitempty"` + + // Rewards: For cards with rewards programs, detailed rules about how + // the program works. + Rewards []*CcOfferRewards `json:"rewards,omitempty"` + + // RewardsExpire: Whether accumulated rewards ever expire. + RewardsExpire bool `json:"rewardsExpire,omitempty"` + + // RewardsHaveBlackoutDates: For airline miles rewards, tells whether + // blackout dates apply to the miles. + RewardsHaveBlackoutDates bool `json:"rewardsHaveBlackoutDates,omitempty"` + + // StatementCopyFee: Fee for requesting a copy of your statement. + StatementCopyFee string `json:"statementCopyFee,omitempty"` + + // TrackingUrl: The link to ping to register a click on this offer. A + // summary field. + TrackingUrl string `json:"trackingUrl,omitempty"` + + // TravelInsurance: If you get coverage when you use the card for the + // given activity, this field describes it. + TravelInsurance string `json:"travelInsurance,omitempty"` + + // VariableRatesLastUpdated: When variable rates were last updated. + VariableRatesLastUpdated string `json:"variableRatesLastUpdated,omitempty"` + + // VariableRatesUpdateFrequency: How often variable rates are updated. + VariableRatesUpdateFrequency string `json:"variableRatesUpdateFrequency,omitempty"` +} + +type CcOfferBonusRewards struct { + // Amount: How many units of reward will be granted. + Amount float64 `json:"amount,omitempty"` + + // Details: The circumstances under which this rule applies, for + // example, booking a flight via Orbitz. + Details string `json:"details,omitempty"` +} + +type CcOfferDefaultFees struct { + // Category: The type of charge, for example Purchases. + Category string `json:"category,omitempty"` + + // MaxRate: The highest rate the issuer may charge for defaulting on + // debt in this category. Expressed as an absolute number, not as a + // percentage. + MaxRate float64 `json:"maxRate,omitempty"` + + // MinRate: The lowest rate the issuer may charge for defaulting on debt + // in this category. Expressed as an absolute number, not as a + // percentage. + MinRate float64 `json:"minRate,omitempty"` + + // RateType: Fixed or variable. + RateType string `json:"rateType,omitempty"` +} + +type CcOfferRewards struct { + // AdditionalDetails: Other limits, for example, if this rule only + // applies during an introductory period. + AdditionalDetails string `json:"additionalDetails,omitempty"` + + // Amount: The number of units rewarded per purchase dollar. + Amount float64 `json:"amount,omitempty"` + + // Category: The kind of purchases covered by this rule. + Category string `json:"category,omitempty"` + + // ExpirationMonths: How long rewards granted by this rule last. + ExpirationMonths float64 `json:"expirationMonths,omitempty"` + + // MaxRewardTier: The maximum purchase amount in the given category for + // this rule to apply. + MaxRewardTier float64 `json:"maxRewardTier,omitempty"` + + // MinRewardTier: The minimum purchase amount in the given category + // before this rule applies. + MinRewardTier float64 `json:"minRewardTier,omitempty"` +} + +type CcOffers struct { + // Items: The credit card offers. + Items []*CcOffer `json:"items,omitempty"` + + // Kind: The kind for a page of credit card offers. + Kind string `json:"kind,omitempty"` +} + +type Event struct { + // AdvertiserId: The ID of advertiser for this event. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserName: The name of the advertiser for this event. + AdvertiserName string `json:"advertiserName,omitempty"` + + // ChargeId: The charge ID for this event. Only returned for charge + // events. + ChargeId string `json:"chargeId,omitempty"` + + // ChargeType: Charge type of the event + // (other|slotting_fee|monthly_minimum|tier_bonus|debit|credit). Only + // returned for charge events. + ChargeType string `json:"chargeType,omitempty"` + + // CommissionableSales: Amount of money exchanged during the + // transaction. Only returned for charge and conversion events. + CommissionableSales *Money `json:"commissionableSales,omitempty"` + + // Earnings: Earnings by the publisher. + Earnings *Money `json:"earnings,omitempty"` + + // EventDate: The date-time this event was initiated as a RFC 3339 + // date-time value. + EventDate string `json:"eventDate,omitempty"` + + // Kind: The kind for one event. + Kind string `json:"kind,omitempty"` + + // MemberId: The ID of the member attached to this event. Only returned + // for conversion events. + MemberId string `json:"memberId,omitempty"` + + // ModifyDate: The date-time this event was last modified as a RFC 3339 + // date-time value. + ModifyDate string `json:"modifyDate,omitempty"` + + // NetworkFee: Fee that the advertiser paid to the Google Affiliate + // Network. + NetworkFee *Money `json:"networkFee,omitempty"` + + // OrderId: The order ID for this event. Only returned for conversion + // events. + OrderId string `json:"orderId,omitempty"` + + // Products: Products associated with the event. + Products []*EventProducts `json:"products,omitempty"` + + // PublisherFee: Fee that the advertiser paid to the publisher. + PublisherFee *Money `json:"publisherFee,omitempty"` + + // PublisherId: The ID of the publisher for this event. + PublisherId int64 `json:"publisherId,omitempty,string"` + + // PublisherName: The name of the publisher for this event. + PublisherName string `json:"publisherName,omitempty"` + + // Status: Status of the event (active|canceled). Only returned for + // charge and conversion events. + Status string `json:"status,omitempty"` + + // Type: Type of the event (action|transaction|charge). + Type string `json:"type,omitempty"` +} + +type EventProducts struct { + // CategoryId: Id of the category this product belongs to. + CategoryId string `json:"categoryId,omitempty"` + + // CategoryName: Name of the category this product belongs to. + CategoryName string `json:"categoryName,omitempty"` + + // Earnings: Amount earned by the publisher on this product. + Earnings *Money `json:"earnings,omitempty"` + + // NetworkFee: Fee that the advertiser paid to the Google Affiliate + // Network for this product. + NetworkFee *Money `json:"networkFee,omitempty"` + + // PublisherFee: Fee that the advertiser paid to the publisehr for this + // product. + PublisherFee *Money `json:"publisherFee,omitempty"` + + // Quantity: Quantity of this product bought/exchanged. + Quantity int64 `json:"quantity,omitempty,string"` + + // Sku: Sku of this product. + Sku string `json:"sku,omitempty"` + + // SkuName: Sku name of this product. + SkuName string `json:"skuName,omitempty"` + + // UnitPrice: Price per unit of this product. + UnitPrice *Money `json:"unitPrice,omitempty"` +} + +type Events struct { + // Items: The event list. + Items []*Event `json:"items,omitempty"` + + // Kind: The kind for a page of events. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The 'pageToken' to pass to the next request to get the + // next page, if there are more to retrieve. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Link struct { + // AdvertiserId: The advertiser id for the advertiser who owns this + // link. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // Authorship: Authorship + Authorship string `json:"authorship,omitempty"` + + // Availability: Availability. + Availability string `json:"availability,omitempty"` + + // ClickTrackingUrl: Tracking url for clicks. + ClickTrackingUrl string `json:"clickTrackingUrl,omitempty"` + + // CreateDate: Date that this link was created. + CreateDate string `json:"createDate,omitempty"` + + // Description: Description. + Description string `json:"description,omitempty"` + + // DestinationUrl: The destination URL for the link. + DestinationUrl string `json:"destinationUrl,omitempty"` + + // Duration: Duration + Duration string `json:"duration,omitempty"` + + // EndDate: Date that this link becomes inactive. + EndDate string `json:"endDate,omitempty"` + + // EpcNinetyDayAverage: The sum of fees paid to publishers divided by + // the total number of clicks over the past three months on this link. + // This value should be multiplied by 100 at the time of display. + EpcNinetyDayAverage *Money `json:"epcNinetyDayAverage,omitempty"` + + // EpcSevenDayAverage: The sum of fees paid to publishers divided by the + // total number of clicks over the past seven days on this link. This + // value should be multiplied by 100 at the time of display. + EpcSevenDayAverage *Money `json:"epcSevenDayAverage,omitempty"` + + // Id: The ID of this link. + Id int64 `json:"id,omitempty,string"` + + // ImageAltText: image alt text. + ImageAltText string `json:"imageAltText,omitempty"` + + // ImpressionTrackingUrl: Tracking url for impressions. + ImpressionTrackingUrl string `json:"impressionTrackingUrl,omitempty"` + + // IsActive: Flag for if this link is active. + IsActive bool `json:"isActive,omitempty"` + + // Kind: The kind for one entity. + Kind string `json:"kind,omitempty"` + + // LinkType: The link type. + LinkType string `json:"linkType,omitempty"` + + // Name: The logical name for this link. + Name string `json:"name,omitempty"` + + // PromotionType: Promotion Type + PromotionType string `json:"promotionType,omitempty"` + + // SpecialOffers: Special offers on the link. + SpecialOffers *LinkSpecialOffers `json:"specialOffers,omitempty"` + + // StartDate: Date that this link becomes active. + StartDate string `json:"startDate,omitempty"` +} + +type LinkSpecialOffers struct { + // FreeGift: Whether there is a free gift + FreeGift bool `json:"freeGift,omitempty"` + + // FreeShipping: Whether there is free shipping + FreeShipping bool `json:"freeShipping,omitempty"` + + // FreeShippingMin: Minimum purchase amount for free shipping promotion + FreeShippingMin *Money `json:"freeShippingMin,omitempty"` + + // PercentOff: Percent off on the purchase + PercentOff float64 `json:"percentOff,omitempty"` + + // PercentOffMin: Minimum purchase amount for percent off promotion + PercentOffMin *Money `json:"percentOffMin,omitempty"` + + // PriceCut: Price cut on the purchase + PriceCut *Money `json:"priceCut,omitempty"` + + // PriceCutMin: Minimum purchase amount for price cut promotion + PriceCutMin *Money `json:"priceCutMin,omitempty"` + + // PromotionCodes: List of promotion code associated with the link + PromotionCodes []string `json:"promotionCodes,omitempty"` +} + +type Links struct { + // Items: The links. + Items []*Link `json:"items,omitempty"` + + // Kind: The kind for a page of links. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The next page token. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Money struct { + // Amount: The amount of money. + Amount float64 `json:"amount,omitempty"` + + // CurrencyCode: The 3-letter code of the currency in question. + CurrencyCode string `json:"currencyCode,omitempty"` +} + +type Publisher struct { + // Classification: Classification that this publisher belongs to. See + // this link for all publisher classifications: + // http://www.google.com/support/affiliatenetwork/advertiser/bin/answer.p + // y?hl=en&answer=107625&ctx=cb&src=cb&cbid=-k5fihzthfaik&cbrank=4 + Classification string `json:"classification,omitempty"` + + // EpcNinetyDayAverage: The sum of fees paid to this publisher divided + // by the total number of clicks over the past three months. Values are + // multiplied by 100 for display purposes. + EpcNinetyDayAverage *Money `json:"epcNinetyDayAverage,omitempty"` + + // EpcSevenDayAverage: The sum of fees paid to this publisher divided by + // the total number of clicks over the past seven days. Values are + // multiplied by 100 for display purposes. + EpcSevenDayAverage *Money `json:"epcSevenDayAverage,omitempty"` + + // Id: The ID of this publisher. + Id int64 `json:"id,omitempty,string"` + + // Item: The requested publisher. + Item *Publisher `json:"item,omitempty"` + + // JoinDate: Date that this publisher was approved as a Google Affiliate + // Network publisher. + JoinDate string `json:"joinDate,omitempty"` + + // Kind: The kind for a publisher. + Kind string `json:"kind,omitempty"` + + // Name: The name of this publisher. + Name string `json:"name,omitempty"` + + // PayoutRank: A rank based on commissions paid to this publisher over + // the past 90 days. A number between 1 and 4 where 4 means the top + // quartile (most money paid) and 1 means the bottom quartile (least + // money paid). + PayoutRank string `json:"payoutRank,omitempty"` + + // Sites: Websites that this publisher uses to advertise. + Sites []string `json:"sites,omitempty"` + + // Status: The status of the requesting advertiser's relationship with + // this publisher. + Status string `json:"status,omitempty"` +} + +type Publishers struct { + // Items: The entity list. + Items []*Publisher `json:"items,omitempty"` + + // Kind: The kind for a page of entities. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The 'pageToken' to pass to the next request to get the + // next page, if there are more to retrieve. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Report struct { + // Column_names: The column names for the report + Column_names []string `json:"column_names,omitempty"` + + // End_date: The end of the date range for this report, exclusive. + End_date string `json:"end_date,omitempty"` + + // Kind: The kind for a report. + Kind string `json:"kind,omitempty"` + + // Matching_row_count: The number of matching rows before paging is + // applied. + Matching_row_count int64 `json:"matching_row_count,omitempty,string"` + + // Rows: The rows of data for the report + Rows [][]interface{} `json:"rows,omitempty"` + + // Start_date: The start of the date range for this report, inclusive. + Start_date string `json:"start_date,omitempty"` + + // Totals_rows: The totals rows for the report + Totals_rows [][]interface{} `json:"totals_rows,omitempty"` + + // Type: The report type. + Type string `json:"type,omitempty"` +} + +// method id "gan.advertisers.get": + +type AdvertisersGetCall struct { + s *Service + role string + roleId string + opt_ map[string]interface{} +} + +// Get: Retrieves data about a single advertiser if that the requesting +// advertiser/publisher has access to it. Only publishers can lookup +// advertisers. Advertisers can request information about themselves by +// omitting the advertiserId query parameter. +func (r *AdvertisersService) Get(role string, roleId string) *AdvertisersGetCall { + c := &AdvertisersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.role = role + c.roleId = roleId + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": The ID of +// the advertiser to look up. +func (c *AdvertisersGetCall) AdvertiserId(advertiserId string) *AdvertisersGetCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +func (c *AdvertisersGetCall) Do() (*Advertiser, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/advertiser") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{role}", url.QueryEscape(c.role), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{roleId}", url.QueryEscape(c.roleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Advertiser) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves data about a single advertiser if that the requesting advertiser/publisher has access to it. Only publishers can lookup advertisers. Advertisers can request information about themselves by omitting the advertiserId query parameter.", + // "httpMethod": "GET", + // "id": "gan.advertisers.get", + // "parameterOrder": [ + // "role", + // "roleId" + // ], + // "parameters": { + // "advertiserId": { + // "description": "The ID of the advertiser to look up. Optional.", + // "location": "query", + // "type": "string" + // }, + // "role": { + // "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.", + // "enum": [ + // "advertisers", + // "publishers" + // ], + // "enumDescriptions": [ + // "The requester is requesting as an advertiser.", + // "The requester is requesting as a publisher." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "roleId": { + // "description": "The ID of the requesting advertiser or publisher.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{role}/{roleId}/advertiser", + // "response": { + // "$ref": "Advertiser" + // } + // } + +} + +// method id "gan.advertisers.list": + +type AdvertisersListCall struct { + s *Service + role string + roleId string + opt_ map[string]interface{} +} + +// List: Retrieves data about all advertisers that the requesting +// advertiser/publisher has access to. +func (r *AdvertisersService) List(role string, roleId string) *AdvertisersListCall { + c := &AdvertisersListCall{s: r.s, opt_: make(map[string]interface{})} + c.role = role + c.roleId = roleId + return c +} + +// AdvertiserCategory sets the optional parameter "advertiserCategory": +// Caret(^) delimted list of advertiser categories. Valid categories are +// defined here: +// http://www.google.com/support/affiliatenetwork/advertiser/bin/answer.p +// y?hl=en&answer=107581. Filters out all advertisers not in one of the +// given advertiser categories. +func (c *AdvertisersListCall) AdvertiserCategory(advertiserCategory string) *AdvertisersListCall { + c.opt_["advertiserCategory"] = advertiserCategory + return c +} + +// MaxResults sets the optional parameter "maxResults": Max number of +// items to return in this page. Defaults to 20. +func (c *AdvertisersListCall) MaxResults(maxResults int64) *AdvertisersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// MinNinetyDayEpc sets the optional parameter "minNinetyDayEpc": +// Filters out all advertisers that have a ninety day EPC average lower +// than the given value (inclusive). Min value: 0.0. +func (c *AdvertisersListCall) MinNinetyDayEpc(minNinetyDayEpc float64) *AdvertisersListCall { + c.opt_["minNinetyDayEpc"] = minNinetyDayEpc + return c +} + +// MinPayoutRank sets the optional parameter "minPayoutRank": A value +// between 1 and 4, where 1 represents the quartile of advertisers with +// the lowest ranks and 4 represents the quartile of advertisers with +// the highest ranks. Filters out all advertisers with a lower rank than +// the given quartile. For example if a 2 was given only advertisers +// with a payout rank of 25 or higher would be included. +func (c *AdvertisersListCall) MinPayoutRank(minPayoutRank int64) *AdvertisersListCall { + c.opt_["minPayoutRank"] = minPayoutRank + return c +} + +// MinSevenDayEpc sets the optional parameter "minSevenDayEpc": Filters +// out all advertisers that have a seven day EPC average lower than the +// given value (inclusive). Min value: 0.0. +func (c *AdvertisersListCall) MinSevenDayEpc(minSevenDayEpc float64) *AdvertisersListCall { + c.opt_["minSevenDayEpc"] = minSevenDayEpc + return c +} + +// PageToken sets the optional parameter "pageToken": The value of +// 'nextPageToken' from the previous page. +func (c *AdvertisersListCall) PageToken(pageToken string) *AdvertisersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// RelationshipStatus sets the optional parameter "relationshipStatus": +// Filters out all advertisers for which do not have the given +// relationship status with the requesting publisher. +func (c *AdvertisersListCall) RelationshipStatus(relationshipStatus string) *AdvertisersListCall { + c.opt_["relationshipStatus"] = relationshipStatus + return c +} + +func (c *AdvertisersListCall) Do() (*Advertisers, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["advertiserCategory"]; ok { + params.Set("advertiserCategory", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minNinetyDayEpc"]; ok { + params.Set("minNinetyDayEpc", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minPayoutRank"]; ok { + params.Set("minPayoutRank", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minSevenDayEpc"]; ok { + params.Set("minSevenDayEpc", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["relationshipStatus"]; ok { + params.Set("relationshipStatus", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/advertisers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{role}", url.QueryEscape(c.role), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{roleId}", url.QueryEscape(c.roleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Advertisers) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves data about all advertisers that the requesting advertiser/publisher has access to.", + // "httpMethod": "GET", + // "id": "gan.advertisers.list", + // "parameterOrder": [ + // "role", + // "roleId" + // ], + // "parameters": { + // "advertiserCategory": { + // "description": "Caret(^) delimted list of advertiser categories. Valid categories are defined here: http://www.google.com/support/affiliatenetwork/advertiser/bin/answer.py?hl=en\u0026answer=107581. Filters out all advertisers not in one of the given advertiser categories. Optional.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Max number of items to return in this page. Optional. Defaults to 20.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "minNinetyDayEpc": { + // "description": "Filters out all advertisers that have a ninety day EPC average lower than the given value (inclusive). Min value: 0.0. Optional.", + // "format": "double", + // "location": "query", + // "type": "number" + // }, + // "minPayoutRank": { + // "description": "A value between 1 and 4, where 1 represents the quartile of advertisers with the lowest ranks and 4 represents the quartile of advertisers with the highest ranks. Filters out all advertisers with a lower rank than the given quartile. For example if a 2 was given only advertisers with a payout rank of 25 or higher would be included. Optional.", + // "format": "int32", + // "location": "query", + // "maximum": "4", + // "minimum": "1", + // "type": "integer" + // }, + // "minSevenDayEpc": { + // "description": "Filters out all advertisers that have a seven day EPC average lower than the given value (inclusive). Min value: 0.0. Optional.", + // "format": "double", + // "location": "query", + // "type": "number" + // }, + // "pageToken": { + // "description": "The value of 'nextPageToken' from the previous page. Optional.", + // "location": "query", + // "type": "string" + // }, + // "relationshipStatus": { + // "description": "Filters out all advertisers for which do not have the given relationship status with the requesting publisher.", + // "enum": [ + // "approved", + // "available", + // "deactivated", + // "declined", + // "pending" + // ], + // "enumDescriptions": [ + // "An advertiser that has approved your application.", + // "An advertiser program that's accepting new publishers.", + // "Deactivated means either the advertiser has removed you from their program, or it could also mean that you chose to remove yourself from the advertiser's program.", + // "An advertiser that did not approve your application.", + // "An advertiser program that you've already applied to, but they haven't yet decided to approve or decline your application." + // ], + // "location": "query", + // "type": "string" + // }, + // "role": { + // "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.", + // "enum": [ + // "advertisers", + // "publishers" + // ], + // "enumDescriptions": [ + // "The requester is requesting as an advertiser.", + // "The requester is requesting as a publisher." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "roleId": { + // "description": "The ID of the requesting advertiser or publisher.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{role}/{roleId}/advertisers", + // "response": { + // "$ref": "Advertisers" + // } + // } + +} + +// method id "gan.ccOffers.list": + +type CcOffersListCall struct { + s *Service + publisher string + opt_ map[string]interface{} +} + +// List: Retrieves credit card offers for the given publisher. +func (r *CcOffersService) List(publisher string) *CcOffersListCall { + c := &CcOffersListCall{s: r.s, opt_: make(map[string]interface{})} + c.publisher = publisher + return c +} + +// Advertiser sets the optional parameter "advertiser": The advertiser +// ID of a card issuer whose offers to include. Optional, may be +// repeated. +func (c *CcOffersListCall) Advertiser(advertiser string) *CcOffersListCall { + c.opt_["advertiser"] = advertiser + return c +} + +// Projection sets the optional parameter "projection": The set of +// fields to return. +func (c *CcOffersListCall) Projection(projection string) *CcOffersListCall { + c.opt_["projection"] = projection + return c +} + +func (c *CcOffersListCall) Do() (*CcOffers, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["advertiser"]; ok { + params.Set("advertiser", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "publishers/{publisher}/ccOffers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{publisher}", url.QueryEscape(c.publisher), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CcOffers) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves credit card offers for the given publisher.", + // "httpMethod": "GET", + // "id": "gan.ccOffers.list", + // "parameterOrder": [ + // "publisher" + // ], + // "parameters": { + // "advertiser": { + // "description": "The advertiser ID of a card issuer whose offers to include. Optional, may be repeated.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "projection": { + // "description": "The set of fields to return.", + // "enum": [ + // "full", + // "summary" + // ], + // "enumDescriptions": [ + // "Include all offer fields. This is the default.", + // "Include only the basic fields needed to display an offer." + // ], + // "location": "query", + // "type": "string" + // }, + // "publisher": { + // "description": "The ID of the publisher in question.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "publishers/{publisher}/ccOffers", + // "response": { + // "$ref": "CcOffers" + // } + // } + +} + +// method id "gan.events.list": + +type EventsListCall struct { + s *Service + role string + roleId string + opt_ map[string]interface{} +} + +// List: Retrieves event data for a given advertiser/publisher. +func (r *EventsService) List(role string, roleId string) *EventsListCall { + c := &EventsListCall{s: r.s, opt_: make(map[string]interface{})} + c.role = role + c.roleId = roleId + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": Caret(^) +// delimited list of advertiser IDs. Filters out all events that do not +// reference one of the given advertiser IDs. Only used when under +// publishers role. +func (c *EventsListCall) AdvertiserId(advertiserId string) *EventsListCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +// ChargeType sets the optional parameter "chargeType": Filters out all +// charge events that are not of the given charge type. Valid values: +// 'other', 'slotting_fee', 'monthly_minimum', 'tier_bonus', 'credit', +// 'debit'. +func (c *EventsListCall) ChargeType(chargeType string) *EventsListCall { + c.opt_["chargeType"] = chargeType + return c +} + +// EventDateMax sets the optional parameter "eventDateMax": Filters out +// all events later than given date. Defaults to 24 hours after +// eventMin. +func (c *EventsListCall) EventDateMax(eventDateMax string) *EventsListCall { + c.opt_["eventDateMax"] = eventDateMax + return c +} + +// EventDateMin sets the optional parameter "eventDateMin": Filters out +// all events earlier than given date. Defaults to 24 hours from +// current date/time. +func (c *EventsListCall) EventDateMin(eventDateMin string) *EventsListCall { + c.opt_["eventDateMin"] = eventDateMin + return c +} + +// LinkId sets the optional parameter "linkId": Caret(^) delimited list +// of link IDs. Filters out all events that do not reference one of the +// given link IDs. +func (c *EventsListCall) LinkId(linkId string) *EventsListCall { + c.opt_["linkId"] = linkId + return c +} + +// MaxResults sets the optional parameter "maxResults": Max number of +// offers to return in this page. Defaults to 20. +func (c *EventsListCall) MaxResults(maxResults int64) *EventsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// MemberId sets the optional parameter "memberId": Caret(^) delimited +// list of member IDs. Filters out all events that do not reference one +// of the given member IDs. +func (c *EventsListCall) MemberId(memberId string) *EventsListCall { + c.opt_["memberId"] = memberId + return c +} + +// ModifyDateMax sets the optional parameter "modifyDateMax": Filters +// out all events modified later than given date. Defaults to 24 hours +// after modifyDateMin, if modifyDateMin is explicitly set. +func (c *EventsListCall) ModifyDateMax(modifyDateMax string) *EventsListCall { + c.opt_["modifyDateMax"] = modifyDateMax + return c +} + +// ModifyDateMin sets the optional parameter "modifyDateMin": Filters +// out all events modified earlier than given date. Defaults to 24 +// hours before the current modifyDateMax, if modifyDateMax is +// explicitly set. +func (c *EventsListCall) ModifyDateMin(modifyDateMin string) *EventsListCall { + c.opt_["modifyDateMin"] = modifyDateMin + return c +} + +// OrderId sets the optional parameter "orderId": Caret(^) delimited +// list of order IDs. Filters out all events that do not reference one +// of the given order IDs. +func (c *EventsListCall) OrderId(orderId string) *EventsListCall { + c.opt_["orderId"] = orderId + return c +} + +// PageToken sets the optional parameter "pageToken": The value of +// 'nextPageToken' from the previous page. +func (c *EventsListCall) PageToken(pageToken string) *EventsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ProductCategory sets the optional parameter "productCategory": +// Caret(^) delimited list of product categories. Filters out all events +// that do not reference a product in one of the given product +// categories. +func (c *EventsListCall) ProductCategory(productCategory string) *EventsListCall { + c.opt_["productCategory"] = productCategory + return c +} + +// PublisherId sets the optional parameter "publisherId": Caret(^) +// delimited list of publisher IDs. Filters out all events that do not +// reference one of the given publishers IDs. Only used when under +// advertiser role. +func (c *EventsListCall) PublisherId(publisherId string) *EventsListCall { + c.opt_["publisherId"] = publisherId + return c +} + +// Sku sets the optional parameter "sku": Caret(^) delimited list of +// SKUs. Filters out all events that do not reference one of the given +// SKU. +func (c *EventsListCall) Sku(sku string) *EventsListCall { + c.opt_["sku"] = sku + return c +} + +// Status sets the optional parameter "status": Filters out all events +// that do not have the given status. Valid values: 'active', +// 'canceled'. +func (c *EventsListCall) Status(status string) *EventsListCall { + c.opt_["status"] = status + return c +} + +// Type sets the optional parameter "type": Filters out all events that +// are not of the given type. Valid values: 'action', 'transaction', +// 'charge'. +func (c *EventsListCall) Type(type_ string) *EventsListCall { + c.opt_["type"] = type_ + return c +} + +func (c *EventsListCall) Do() (*Events, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["chargeType"]; ok { + params.Set("chargeType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["eventDateMax"]; ok { + params.Set("eventDateMax", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["eventDateMin"]; ok { + params.Set("eventDateMin", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["linkId"]; ok { + params.Set("linkId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["memberId"]; ok { + params.Set("memberId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["modifyDateMax"]; ok { + params.Set("modifyDateMax", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["modifyDateMin"]; ok { + params.Set("modifyDateMin", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderId"]; ok { + params.Set("orderId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["productCategory"]; ok { + params.Set("productCategory", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["publisherId"]; ok { + params.Set("publisherId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sku"]; ok { + params.Set("sku", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["status"]; ok { + params.Set("status", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["type"]; ok { + params.Set("type", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/events") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{role}", url.QueryEscape(c.role), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{roleId}", url.QueryEscape(c.roleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Events) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves event data for a given advertiser/publisher.", + // "httpMethod": "GET", + // "id": "gan.events.list", + // "parameterOrder": [ + // "role", + // "roleId" + // ], + // "parameters": { + // "advertiserId": { + // "description": "Caret(^) delimited list of advertiser IDs. Filters out all events that do not reference one of the given advertiser IDs. Only used when under publishers role. Optional.", + // "location": "query", + // "type": "string" + // }, + // "chargeType": { + // "description": "Filters out all charge events that are not of the given charge type. Valid values: 'other', 'slotting_fee', 'monthly_minimum', 'tier_bonus', 'credit', 'debit'. Optional.", + // "enum": [ + // "credit", + // "debit", + // "monthly_minimum", + // "other", + // "slotting_fee", + // "tier_bonus" + // ], + // "enumDescriptions": [ + // "A credit increases the publisher's payout amount and decreases the advertiser's invoice amount.", + // "A debit reduces the publisher's payout and increases the advertiser's invoice amount.", + // "A payment made to Google by an advertiser as a minimum monthly network fee.", + // "Catch all. Default if unset", + // "A one time payment made from an advertiser to a publisher.", + // "A payment from an advertiser to a publisher for the publisher maintaining a high tier level" + // ], + // "location": "query", + // "type": "string" + // }, + // "eventDateMax": { + // "description": "Filters out all events later than given date. Optional. Defaults to 24 hours after eventMin.", + // "location": "query", + // "type": "string" + // }, + // "eventDateMin": { + // "description": "Filters out all events earlier than given date. Optional. Defaults to 24 hours from current date/time.", + // "location": "query", + // "type": "string" + // }, + // "linkId": { + // "description": "Caret(^) delimited list of link IDs. Filters out all events that do not reference one of the given link IDs. Optional.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Max number of offers to return in this page. Optional. Defaults to 20.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "memberId": { + // "description": "Caret(^) delimited list of member IDs. Filters out all events that do not reference one of the given member IDs. Optional.", + // "location": "query", + // "type": "string" + // }, + // "modifyDateMax": { + // "description": "Filters out all events modified later than given date. Optional. Defaults to 24 hours after modifyDateMin, if modifyDateMin is explicitly set.", + // "location": "query", + // "type": "string" + // }, + // "modifyDateMin": { + // "description": "Filters out all events modified earlier than given date. Optional. Defaults to 24 hours before the current modifyDateMax, if modifyDateMax is explicitly set.", + // "location": "query", + // "type": "string" + // }, + // "orderId": { + // "description": "Caret(^) delimited list of order IDs. Filters out all events that do not reference one of the given order IDs. Optional.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "The value of 'nextPageToken' from the previous page. Optional.", + // "location": "query", + // "type": "string" + // }, + // "productCategory": { + // "description": "Caret(^) delimited list of product categories. Filters out all events that do not reference a product in one of the given product categories. Optional.", + // "location": "query", + // "type": "string" + // }, + // "publisherId": { + // "description": "Caret(^) delimited list of publisher IDs. Filters out all events that do not reference one of the given publishers IDs. Only used when under advertiser role. Optional.", + // "location": "query", + // "type": "string" + // }, + // "role": { + // "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.", + // "enum": [ + // "advertisers", + // "publishers" + // ], + // "enumDescriptions": [ + // "The requester is requesting as an advertiser.", + // "The requester is requesting as a publisher." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "roleId": { + // "description": "The ID of the requesting advertiser or publisher.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sku": { + // "description": "Caret(^) delimited list of SKUs. Filters out all events that do not reference one of the given SKU. Optional.", + // "location": "query", + // "type": "string" + // }, + // "status": { + // "description": "Filters out all events that do not have the given status. Valid values: 'active', 'canceled'. Optional.", + // "enum": [ + // "active", + // "canceled" + // ], + // "enumDescriptions": [ + // "Event is currently active.", + // "Event is currently canceled." + // ], + // "location": "query", + // "type": "string" + // }, + // "type": { + // "description": "Filters out all events that are not of the given type. Valid values: 'action', 'transaction', 'charge'. Optional.", + // "enum": [ + // "action", + // "charge", + // "transaction" + // ], + // "enumDescriptions": [ + // "The completion of an application, sign-up, or other process. For example, an action occurs if a user clicks an ad for a credit card and completes an application for that card.", + // "A charge event is typically a payment between an advertiser, publisher or Google.", + // "A conversion event, typically an e-commerce transaction. Some advertisers use a transaction to record other types of events, such as magazine subscriptions." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{role}/{roleId}/events", + // "response": { + // "$ref": "Events" + // } + // } + +} + +// method id "gan.links.get": + +type LinksGetCall struct { + s *Service + role string + roleId string + linkId int64 + opt_ map[string]interface{} +} + +// Get: Retrieves data about a single link if the requesting +// advertiser/publisher has access to it. Advertisers can look up their +// own links. Publishers can look up visible links or links belonging to +// advertisers they are in a relationship with. +func (r *LinksService) Get(role string, roleId string, linkId int64) *LinksGetCall { + c := &LinksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.role = role + c.roleId = roleId + c.linkId = linkId + return c +} + +func (c *LinksGetCall) Do() (*Link, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/link/{linkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{role}", url.QueryEscape(c.role), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{roleId}", url.QueryEscape(c.roleId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{linkId}", strconv.FormatInt(c.linkId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Link) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves data about a single link if the requesting advertiser/publisher has access to it. Advertisers can look up their own links. Publishers can look up visible links or links belonging to advertisers they are in a relationship with.", + // "httpMethod": "GET", + // "id": "gan.links.get", + // "parameterOrder": [ + // "role", + // "roleId", + // "linkId" + // ], + // "parameters": { + // "linkId": { + // "description": "The ID of the link to look up.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "role": { + // "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.", + // "enum": [ + // "advertisers", + // "publishers" + // ], + // "enumDescriptions": [ + // "The requester is requesting as an advertiser.", + // "The requester is requesting as a publisher." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "roleId": { + // "description": "The ID of the requesting advertiser or publisher.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{role}/{roleId}/link/{linkId}", + // "response": { + // "$ref": "Link" + // } + // } + +} + +// method id "gan.links.insert": + +type LinksInsertCall struct { + s *Service + role string + roleId string + link *Link + opt_ map[string]interface{} +} + +// Insert: Inserts a new link. +func (r *LinksService) Insert(role string, roleId string, link *Link) *LinksInsertCall { + c := &LinksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.role = role + c.roleId = roleId + c.link = link + return c +} + +func (c *LinksInsertCall) Do() (*Link, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/link") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{role}", url.QueryEscape(c.role), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{roleId}", url.QueryEscape(c.roleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Link) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new link.", + // "httpMethod": "POST", + // "id": "gan.links.insert", + // "parameterOrder": [ + // "role", + // "roleId" + // ], + // "parameters": { + // "role": { + // "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.", + // "enum": [ + // "advertisers", + // "publishers" + // ], + // "enumDescriptions": [ + // "The requester is requesting as an advertiser.", + // "The requester is requesting as a publisher." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "roleId": { + // "description": "The ID of the requesting advertiser or publisher.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{role}/{roleId}/link", + // "request": { + // "$ref": "Link" + // }, + // "response": { + // "$ref": "Link" + // } + // } + +} + +// method id "gan.links.list": + +type LinksListCall struct { + s *Service + role string + roleId string + opt_ map[string]interface{} +} + +// List: Retrieves all links that match the query parameters. +func (r *LinksService) List(role string, roleId string) *LinksListCall { + c := &LinksListCall{s: r.s, opt_: make(map[string]interface{})} + c.role = role + c.roleId = roleId + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": Limits the +// resulting links to the ones belonging to the listed advertisers. +func (c *LinksListCall) AdvertiserId(advertiserId int64) *LinksListCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +// AssetSize sets the optional parameter "assetSize": The size of the +// given asset. +func (c *LinksListCall) AssetSize(assetSize string) *LinksListCall { + c.opt_["assetSize"] = assetSize + return c +} + +// Authorship sets the optional parameter "authorship": The role of the +// author of the link. +func (c *LinksListCall) Authorship(authorship string) *LinksListCall { + c.opt_["authorship"] = authorship + return c +} + +// CreateDateMax sets the optional parameter "createDateMax": The end of +// the create date range. +func (c *LinksListCall) CreateDateMax(createDateMax string) *LinksListCall { + c.opt_["createDateMax"] = createDateMax + return c +} + +// CreateDateMin sets the optional parameter "createDateMin": The +// beginning of the create date range. +func (c *LinksListCall) CreateDateMin(createDateMin string) *LinksListCall { + c.opt_["createDateMin"] = createDateMin + return c +} + +// LinkType sets the optional parameter "linkType": The type of the +// link. +func (c *LinksListCall) LinkType(linkType string) *LinksListCall { + c.opt_["linkType"] = linkType + return c +} + +// MaxResults sets the optional parameter "maxResults": Max number of +// items to return in this page. Defaults to 20. +func (c *LinksListCall) MaxResults(maxResults int64) *LinksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value of +// 'nextPageToken' from the previous page. +func (c *LinksListCall) PageToken(pageToken string) *LinksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PromotionType sets the optional parameter "promotionType": The +// promotion type. +func (c *LinksListCall) PromotionType(promotionType string) *LinksListCall { + c.opt_["promotionType"] = promotionType + return c +} + +// RelationshipStatus sets the optional parameter "relationshipStatus": +// The status of the relationship. +func (c *LinksListCall) RelationshipStatus(relationshipStatus string) *LinksListCall { + c.opt_["relationshipStatus"] = relationshipStatus + return c +} + +// SearchText sets the optional parameter "searchText": Field for full +// text search across title and merchandising text, supports link id +// search. +func (c *LinksListCall) SearchText(searchText string) *LinksListCall { + c.opt_["searchText"] = searchText + return c +} + +// StartDateMax sets the optional parameter "startDateMax": The end of +// the start date range. +func (c *LinksListCall) StartDateMax(startDateMax string) *LinksListCall { + c.opt_["startDateMax"] = startDateMax + return c +} + +// StartDateMin sets the optional parameter "startDateMin": The +// beginning of the start date range. +func (c *LinksListCall) StartDateMin(startDateMin string) *LinksListCall { + c.opt_["startDateMin"] = startDateMin + return c +} + +func (c *LinksListCall) Do() (*Links, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["assetSize"]; ok { + params.Set("assetSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["authorship"]; ok { + params.Set("authorship", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["createDateMax"]; ok { + params.Set("createDateMax", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["createDateMin"]; ok { + params.Set("createDateMin", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["linkType"]; ok { + params.Set("linkType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["promotionType"]; ok { + params.Set("promotionType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["relationshipStatus"]; ok { + params.Set("relationshipStatus", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchText"]; ok { + params.Set("searchText", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startDateMax"]; ok { + params.Set("startDateMax", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startDateMin"]; ok { + params.Set("startDateMin", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/links") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{role}", url.QueryEscape(c.role), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{roleId}", url.QueryEscape(c.roleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Links) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves all links that match the query parameters.", + // "httpMethod": "GET", + // "id": "gan.links.list", + // "parameterOrder": [ + // "role", + // "roleId" + // ], + // "parameters": { + // "advertiserId": { + // "description": "Limits the resulting links to the ones belonging to the listed advertisers.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "assetSize": { + // "description": "The size of the given asset.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "authorship": { + // "description": "The role of the author of the link.", + // "enum": [ + // "advertiser", + // "publisher" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "createDateMax": { + // "description": "The end of the create date range.", + // "location": "query", + // "type": "string" + // }, + // "createDateMin": { + // "description": "The beginning of the create date range.", + // "location": "query", + // "type": "string" + // }, + // "linkType": { + // "description": "The type of the link.", + // "enum": [ + // "banner", + // "text" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Max number of items to return in this page. Optional. Defaults to 20.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of 'nextPageToken' from the previous page. Optional.", + // "location": "query", + // "type": "string" + // }, + // "promotionType": { + // "description": "The promotion type.", + // "enum": [ + // "coupon", + // "free_gift", + // "free_shipping", + // "percent_off", + // "price_cut" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "relationshipStatus": { + // "description": "The status of the relationship.", + // "enum": [ + // "approved", + // "available" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "role": { + // "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.", + // "enum": [ + // "advertisers", + // "publishers" + // ], + // "enumDescriptions": [ + // "The requester is requesting as an advertiser.", + // "The requester is requesting as a publisher." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "roleId": { + // "description": "The ID of the requesting advertiser or publisher.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchText": { + // "description": "Field for full text search across title and merchandising text, supports link id search.", + // "location": "query", + // "type": "string" + // }, + // "startDateMax": { + // "description": "The end of the start date range.", + // "location": "query", + // "type": "string" + // }, + // "startDateMin": { + // "description": "The beginning of the start date range.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{role}/{roleId}/links", + // "response": { + // "$ref": "Links" + // } + // } + +} + +// method id "gan.publishers.get": + +type PublishersGetCall struct { + s *Service + role string + roleId string + opt_ map[string]interface{} +} + +// Get: Retrieves data about a single advertiser if that the requesting +// advertiser/publisher has access to it. Only advertisers can look up +// publishers. Publishers can request information about themselves by +// omitting the publisherId query parameter. +func (r *PublishersService) Get(role string, roleId string) *PublishersGetCall { + c := &PublishersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.role = role + c.roleId = roleId + return c +} + +// PublisherId sets the optional parameter "publisherId": The ID of the +// publisher to look up. +func (c *PublishersGetCall) PublisherId(publisherId string) *PublishersGetCall { + c.opt_["publisherId"] = publisherId + return c +} + +func (c *PublishersGetCall) Do() (*Publisher, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["publisherId"]; ok { + params.Set("publisherId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/publisher") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{role}", url.QueryEscape(c.role), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{roleId}", url.QueryEscape(c.roleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Publisher) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves data about a single advertiser if that the requesting advertiser/publisher has access to it. Only advertisers can look up publishers. Publishers can request information about themselves by omitting the publisherId query parameter.", + // "httpMethod": "GET", + // "id": "gan.publishers.get", + // "parameterOrder": [ + // "role", + // "roleId" + // ], + // "parameters": { + // "publisherId": { + // "description": "The ID of the publisher to look up. Optional.", + // "location": "query", + // "type": "string" + // }, + // "role": { + // "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.", + // "enum": [ + // "advertisers", + // "publishers" + // ], + // "enumDescriptions": [ + // "The requester is requesting as an advertiser.", + // "The requester is requesting as a publisher." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "roleId": { + // "description": "The ID of the requesting advertiser or publisher.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{role}/{roleId}/publisher", + // "response": { + // "$ref": "Publisher" + // } + // } + +} + +// method id "gan.publishers.list": + +type PublishersListCall struct { + s *Service + role string + roleId string + opt_ map[string]interface{} +} + +// List: Retrieves data about all publishers that the requesting +// advertiser/publisher has access to. +func (r *PublishersService) List(role string, roleId string) *PublishersListCall { + c := &PublishersListCall{s: r.s, opt_: make(map[string]interface{})} + c.role = role + c.roleId = roleId + return c +} + +// MaxResults sets the optional parameter "maxResults": Max number of +// items to return in this page. Defaults to 20. +func (c *PublishersListCall) MaxResults(maxResults int64) *PublishersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// MinNinetyDayEpc sets the optional parameter "minNinetyDayEpc": +// Filters out all publishers that have a ninety day EPC average lower +// than the given value (inclusive). Min value: 0.0. +func (c *PublishersListCall) MinNinetyDayEpc(minNinetyDayEpc float64) *PublishersListCall { + c.opt_["minNinetyDayEpc"] = minNinetyDayEpc + return c +} + +// MinPayoutRank sets the optional parameter "minPayoutRank": A value +// between 1 and 4, where 1 represents the quartile of publishers with +// the lowest ranks and 4 represents the quartile of publishers with the +// highest ranks. Filters out all publishers with a lower rank than the +// given quartile. For example if a 2 was given only publishers with a +// payout rank of 25 or higher would be included. +func (c *PublishersListCall) MinPayoutRank(minPayoutRank int64) *PublishersListCall { + c.opt_["minPayoutRank"] = minPayoutRank + return c +} + +// MinSevenDayEpc sets the optional parameter "minSevenDayEpc": Filters +// out all publishers that have a seven day EPC average lower than the +// given value (inclusive). Min value 0.0. +func (c *PublishersListCall) MinSevenDayEpc(minSevenDayEpc float64) *PublishersListCall { + c.opt_["minSevenDayEpc"] = minSevenDayEpc + return c +} + +// PageToken sets the optional parameter "pageToken": The value of +// 'nextPageToken' from the previous page. +func (c *PublishersListCall) PageToken(pageToken string) *PublishersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PublisherCategory sets the optional parameter "publisherCategory": +// Caret(^) delimted list of publisher categories. Valid categories: +// (unclassified|community_and_content|shopping_and_promotion|loyalty_and +// _rewards|network|search_specialist|comparison_shopping|email). +// Filters out all publishers not in one of the given advertiser +// categories. +func (c *PublishersListCall) PublisherCategory(publisherCategory string) *PublishersListCall { + c.opt_["publisherCategory"] = publisherCategory + return c +} + +// RelationshipStatus sets the optional parameter "relationshipStatus": +// Filters out all publishers for which do not have the given +// relationship status with the requesting publisher. +func (c *PublishersListCall) RelationshipStatus(relationshipStatus string) *PublishersListCall { + c.opt_["relationshipStatus"] = relationshipStatus + return c +} + +func (c *PublishersListCall) Do() (*Publishers, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minNinetyDayEpc"]; ok { + params.Set("minNinetyDayEpc", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minPayoutRank"]; ok { + params.Set("minPayoutRank", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minSevenDayEpc"]; ok { + params.Set("minSevenDayEpc", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["publisherCategory"]; ok { + params.Set("publisherCategory", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["relationshipStatus"]; ok { + params.Set("relationshipStatus", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/publishers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{role}", url.QueryEscape(c.role), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{roleId}", url.QueryEscape(c.roleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Publishers) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves data about all publishers that the requesting advertiser/publisher has access to.", + // "httpMethod": "GET", + // "id": "gan.publishers.list", + // "parameterOrder": [ + // "role", + // "roleId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Max number of items to return in this page. Optional. Defaults to 20.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "minNinetyDayEpc": { + // "description": "Filters out all publishers that have a ninety day EPC average lower than the given value (inclusive). Min value: 0.0. Optional.", + // "format": "double", + // "location": "query", + // "type": "number" + // }, + // "minPayoutRank": { + // "description": "A value between 1 and 4, where 1 represents the quartile of publishers with the lowest ranks and 4 represents the quartile of publishers with the highest ranks. Filters out all publishers with a lower rank than the given quartile. For example if a 2 was given only publishers with a payout rank of 25 or higher would be included. Optional.", + // "format": "int32", + // "location": "query", + // "maximum": "4", + // "minimum": "1", + // "type": "integer" + // }, + // "minSevenDayEpc": { + // "description": "Filters out all publishers that have a seven day EPC average lower than the given value (inclusive). Min value 0.0. Optional.", + // "format": "double", + // "location": "query", + // "type": "number" + // }, + // "pageToken": { + // "description": "The value of 'nextPageToken' from the previous page. Optional.", + // "location": "query", + // "type": "string" + // }, + // "publisherCategory": { + // "description": "Caret(^) delimted list of publisher categories. Valid categories: (unclassified|community_and_content|shopping_and_promotion|loyalty_and_rewards|network|search_specialist|comparison_shopping|email). Filters out all publishers not in one of the given advertiser categories. Optional.", + // "location": "query", + // "type": "string" + // }, + // "relationshipStatus": { + // "description": "Filters out all publishers for which do not have the given relationship status with the requesting publisher.", + // "enum": [ + // "approved", + // "available", + // "deactivated", + // "declined", + // "pending" + // ], + // "enumDescriptions": [ + // "Publishers you've approved to your program.", + // "Publishers available for you to recruit.", + // "A publisher that you terminated from your program. Publishers also have the ability to remove themselves from your program.", + // "A publisher that you did not approve to your program.", + // "Publishers that have applied to your program. We recommend reviewing and deciding on pending publishers on a weekly basis." + // ], + // "location": "query", + // "type": "string" + // }, + // "role": { + // "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.", + // "enum": [ + // "advertisers", + // "publishers" + // ], + // "enumDescriptions": [ + // "The requester is requesting as an advertiser.", + // "The requester is requesting as a publisher." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "roleId": { + // "description": "The ID of the requesting advertiser or publisher.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{role}/{roleId}/publishers", + // "response": { + // "$ref": "Publishers" + // } + // } + +} + +// method id "gan.reports.get": + +type ReportsGetCall struct { + s *Service + role string + roleId string + reportType string + opt_ map[string]interface{} +} + +// Get: Retrieves a report of the specified type. +func (r *ReportsService) Get(role string, roleId string, reportType string) *ReportsGetCall { + c := &ReportsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.role = role + c.roleId = roleId + c.reportType = reportType + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": The IDs of +// the advertisers to look up, if applicable. +func (c *ReportsGetCall) AdvertiserId(advertiserId string) *ReportsGetCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +// CalculateTotals sets the optional parameter "calculateTotals": +// Whether or not to calculate totals rows. +func (c *ReportsGetCall) CalculateTotals(calculateTotals bool) *ReportsGetCall { + c.opt_["calculateTotals"] = calculateTotals + return c +} + +// EndDate sets the optional parameter "endDate": The end date +// (exclusive), in RFC 3339 format, for the report data to be returned. +// Defaults to one day after startDate, if that is given, or today. +func (c *ReportsGetCall) EndDate(endDate string) *ReportsGetCall { + c.opt_["endDate"] = endDate + return c +} + +// EventType sets the optional parameter "eventType": Filters out all +// events that are not of the given type. Valid values: 'action', +// 'transaction', or 'charge'. +func (c *ReportsGetCall) EventType(eventType string) *ReportsGetCall { + c.opt_["eventType"] = eventType + return c +} + +// LinkId sets the optional parameter "linkId": Filters to capture one +// of given link IDs. +func (c *ReportsGetCall) LinkId(linkId string) *ReportsGetCall { + c.opt_["linkId"] = linkId + return c +} + +// MaxResults sets the optional parameter "maxResults": Max number of +// items to return in this page. Defaults to return all results. +func (c *ReportsGetCall) MaxResults(maxResults int64) *ReportsGetCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderId sets the optional parameter "orderId": Filters to capture one +// of the given order IDs. +func (c *ReportsGetCall) OrderId(orderId string) *ReportsGetCall { + c.opt_["orderId"] = orderId + return c +} + +// PublisherId sets the optional parameter "publisherId": The IDs of the +// publishers to look up, if applicable. +func (c *ReportsGetCall) PublisherId(publisherId string) *ReportsGetCall { + c.opt_["publisherId"] = publisherId + return c +} + +// StartDate sets the optional parameter "startDate": The start date +// (inclusive), in RFC 3339 format, for the report data to be returned. +// Defaults to one day before endDate, if that is given, or yesterday. +func (c *ReportsGetCall) StartDate(startDate string) *ReportsGetCall { + c.opt_["startDate"] = startDate + return c +} + +// StartIndex sets the optional parameter "startIndex": Offset on which +// to return results when paging. +func (c *ReportsGetCall) StartIndex(startIndex int64) *ReportsGetCall { + c.opt_["startIndex"] = startIndex + return c +} + +// Status sets the optional parameter "status": Filters out all events +// that do not have the given status. Valid values: 'active', +// 'canceled', or 'invalid'. +func (c *ReportsGetCall) Status(status string) *ReportsGetCall { + c.opt_["status"] = status + return c +} + +func (c *ReportsGetCall) Do() (*Report, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["calculateTotals"]; ok { + params.Set("calculateTotals", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["endDate"]; ok { + params.Set("endDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["eventType"]; ok { + params.Set("eventType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["linkId"]; ok { + params.Set("linkId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderId"]; ok { + params.Set("orderId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["publisherId"]; ok { + params.Set("publisherId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startDate"]; ok { + params.Set("startDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["status"]; ok { + params.Set("status", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/report/{reportType}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{role}", url.QueryEscape(c.role), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{roleId}", url.QueryEscape(c.roleId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{reportType}", url.QueryEscape(c.reportType), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Report) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a report of the specified type.", + // "httpMethod": "GET", + // "id": "gan.reports.get", + // "parameterOrder": [ + // "role", + // "roleId", + // "reportType" + // ], + // "parameters": { + // "advertiserId": { + // "description": "The IDs of the advertisers to look up, if applicable.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "calculateTotals": { + // "description": "Whether or not to calculate totals rows. Optional.", + // "location": "query", + // "type": "boolean" + // }, + // "endDate": { + // "description": "The end date (exclusive), in RFC 3339 format, for the report data to be returned. Defaults to one day after startDate, if that is given, or today. Optional.", + // "location": "query", + // "type": "string" + // }, + // "eventType": { + // "description": "Filters out all events that are not of the given type. Valid values: 'action', 'transaction', or 'charge'. Optional.", + // "enum": [ + // "action", + // "charge", + // "transaction" + // ], + // "enumDescriptions": [ + // "Event type is action.", + // "Event type is charge.", + // "Event type is transaction." + // ], + // "location": "query", + // "type": "string" + // }, + // "linkId": { + // "description": "Filters to capture one of given link IDs. Optional.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Max number of items to return in this page. Optional. Defaults to return all results.", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "orderId": { + // "description": "Filters to capture one of the given order IDs. Optional.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "publisherId": { + // "description": "The IDs of the publishers to look up, if applicable.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "reportType": { + // "description": "The type of report being requested. Valid values: 'order_delta'. Required.", + // "enum": [ + // "order_delta" + // ], + // "enumDescriptions": [ + // "The order delta report type." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "role": { + // "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.", + // "enum": [ + // "advertisers", + // "publishers" + // ], + // "enumDescriptions": [ + // "The requester is requesting as an advertiser.", + // "The requester is requesting as a publisher." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "roleId": { + // "description": "The ID of the requesting advertiser or publisher.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startDate": { + // "description": "The start date (inclusive), in RFC 3339 format, for the report data to be returned. Defaults to one day before endDate, if that is given, or yesterday. Optional.", + // "location": "query", + // "type": "string" + // }, + // "startIndex": { + // "description": "Offset on which to return results when paging. Optional.", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "status": { + // "description": "Filters out all events that do not have the given status. Valid values: 'active', 'canceled', or 'invalid'. Optional.", + // "enum": [ + // "active", + // "canceled", + // "invalid" + // ], + // "enumDescriptions": [ + // "Event is currently active.", + // "Event is currently canceled.", + // "Event is currently invalid." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{role}/{roleId}/report/{reportType}", + // "response": { + // "$ref": "Report" + // } + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/gen.go b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/gen.go new file mode 100644 index 0000000000000..576d7959424c5 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/gen.go @@ -0,0 +1,1588 @@ +// Copyright 2011 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "encoding/json" + "errors" + "flag" + "fmt" + "go/format" + "io/ioutil" + "log" + "net/http" + "net/url" + "os" + "os/exec" + "path/filepath" + "sort" + "strings" + "unicode" +) + +// goGenVersion is the version of the Go code generator +const goGenVersion = "0.5" + +var ( + apiToGenerate = flag.String("api", "*", "The API ID to generate, like 'tasks:v1'. A value of '*' means all.") + useCache = flag.Bool("cache", true, "Use cache of discovered Google API discovery documents.") + genDir = flag.String("gendir", "", "Directory to use to write out generated Go files") + build = flag.Bool("build", false, "Compile generated packages.") + install = flag.Bool("install", false, "Install generated packages.") + apisURL = flag.String("discoveryurl", "https://www.googleapis.com/discovery/v1/apis", "URL to root discovery document") + + publicOnly = flag.Bool("publiconly", true, "Only build public, released APIs. Only applicable for Google employees.") + + jsonFile = flag.String("api_json_file", "", "If non-empty, the path to a local file on disk containing the API to generate. Exclusive with setting --api.") + output = flag.String("output", "", "(optional) Path to source output file. If not specified, the API name and version are used to construct an output path (e.g. tasks/v1).") + googleAPIPkg = flag.String("googleapi_pkg", "code.google.com/p/google-api-go-client/googleapi", "Go package path of the 'googleapi' support package.") +) + +// API represents an API to generate, as well as its state while it's +// generating. +type API struct { + ID string `json:"id"` + Name string `json:"name"` + Version string `json:"version"` + Title string `json:"title"` + DiscoveryLink string `json:"discoveryLink"` // relative + RootURL string `json:"rootUrl"` + ServicePath string `json:"servicePath"` + Preferred bool `json:"preferred"` + + m map[string]interface{} + + forceJSON []byte // if non-nil, the JSON schema file. else fetched. + usedNames namePool + schemas map[string]*Schema // apiName -> schema + + p func(format string, args ...interface{}) // print raw + pn func(format string, args ...interface{}) // print with indent and newline +} + +func (a *API) sortedSchemaNames() (names []string) { + for name := range a.schemas { + names = append(names, name) + } + sort.Strings(names) + return +} + +type AllAPIs struct { + Items []*API `json:"items"` +} + +type generateError struct { + api *API + error error +} + +func (e *generateError) Error() string { + return fmt.Sprintf("API %s failed to generate code: %v", e.api.ID, e.error) +} + +type compileError struct { + api *API + output string +} + +func (e *compileError) Error() string { + return fmt.Sprintf("API %s failed to compile:\n%v", e.api.ID, e.output) +} + +func main() { + flag.Parse() + + if *install { + *build = true + } + + var ( + apiIds = []string{} + matches = []*API{} + errors = []error{} + ) + for _, api := range getAPIs() { + apiIds = append(apiIds, api.ID) + if !api.want() { + continue + } + matches = append(matches, api) + log.Printf("Generating API %s", api.ID) + err := api.WriteGeneratedCode() + if err != nil { + errors = append(errors, &generateError{api, err}) + continue + } + if *build { + var args []string + if *install { + args = append(args, "install") + } else { + args = append(args, "build") + } + args = append(args, api.Target()) + out, err := exec.Command("go", args...).CombinedOutput() + if err != nil { + errors = append(errors, &compileError{api, string(out)}) + } + } + } + + if len(matches) == 0 { + log.Fatalf("No APIs matched %q; options are %v", *apiToGenerate, apiIds) + } + + if len(errors) > 0 { + log.Printf("%d API(s) failed to generate or compile:", len(errors)) + for _, ce := range errors { + log.Printf(ce.Error()) + } + os.Exit(1) + } +} + +func (a *API) want() bool { + if strings.Contains(a.ID, "buzz") { + // R.I.P. + return false + } + if strings.Contains(a.ID, "fusiontables") { + // TODO(bradfitz): broken codegen. + return false + } + return *apiToGenerate == "*" || *apiToGenerate == a.ID +} + +func getAPIs() []*API { + if *jsonFile != "" { + return getAPIsFromFile() + } + var all AllAPIs + disco := slurpURL(*apisURL) + if err := json.Unmarshal(disco, &all); err != nil { + log.Fatalf("error decoding JSON in %s: %v", apisURL, err) + } + if !*publicOnly && *apiToGenerate != "*" { + parts := strings.SplitN(*apiToGenerate, ":", 2) + apiName := parts[0] + apiVersion := parts[1] + all.Items = append(all.Items, &API{ + ID: *apiToGenerate, + Name: apiName, + Version: apiVersion, + DiscoveryLink: fmt.Sprintf("./apis/%s/%s/rest", apiName, apiVersion), + }) + } + return all.Items +} + +// getAPIsFromFile handles the case of generating exactly one API +// from the flag given in --api_json_file +func getAPIsFromFile() []*API { + if *apiToGenerate != "*" { + log.Fatalf("Can't set --api with --api_json_file.") + } + if !*publicOnly { + log.Fatalf("Can't set --publiconly with --api_json_file.") + } + a, err := apiFromFile(*jsonFile) + if err != nil { + log.Fatal(err) + } + return []*API{a} +} + +func apiFromFile(file string) (*API, error) { + jsonBytes, err := ioutil.ReadFile(file) + if err != nil { + return nil, fmt.Errorf("Error reading %s: %v", file, err) + } + a := &API{ + forceJSON: jsonBytes, + } + if err := json.Unmarshal(jsonBytes, a); err != nil { + return nil, fmt.Errorf("Decoding JSON in %s: %v", file, err) + } + return a, nil +} + +func writeFile(file string, contents []byte) error { + // Don't write it if the contents are identical. + existing, err := ioutil.ReadFile(file) + if err == nil && bytes.Equal(existing, contents) { + return nil + } + return ioutil.WriteFile(file, contents, 0644) +} + +func slurpURL(urlStr string) []byte { + diskFile := filepath.Join(os.TempDir(), "google-api-cache-"+url.QueryEscape(urlStr)) + if *useCache { + bs, err := ioutil.ReadFile(diskFile) + if err == nil && len(bs) > 0 { + return bs + } + } + + req, err := http.NewRequest("GET", urlStr, nil) + if err != nil { + log.Fatal(err) + } + if *publicOnly { + req.Header.Add("X-User-IP", "0.0.0.0") // hack + } + res, err := http.DefaultClient.Do(req) + if err != nil { + log.Fatalf("Error fetching URL %s: %v", urlStr, err) + } + bs, err := ioutil.ReadAll(res.Body) + if err != nil { + log.Fatalf("Error reading body of URL %s: %v", urlStr, err) + } + if *useCache { + if err := ioutil.WriteFile(diskFile, bs, 0666); err != nil { + log.Printf("Warning: failed to write JSON of %s to disk file %s: %v", urlStr, diskFile, err) + } + } + return bs +} + +func panicf(format string, args ...interface{}) { + panic(fmt.Sprintf(format, args...)) +} + +// namePool keeps track of used names and assigns free ones based on a +// preferred name +type namePool struct { + m map[string]bool // lazily initialized +} + +func (p *namePool) Get(preferred string) string { + if p.m == nil { + p.m = make(map[string]bool) + } + name := preferred + tries := 0 + for p.m[name] { + tries++ + name = fmt.Sprintf("%s%d", preferred, tries) + } + p.m[name] = true + return name +} + +func (a *API) SourceDir() string { + if *genDir == "" { + paths := filepath.SplitList(os.Getenv("GOPATH")) + if len(paths) > 0 && paths[0] != "" { + *genDir = filepath.Join(paths[0], "src", "code.google.com", "p", "google-api-go-client") + } + } + return filepath.Join(*genDir, a.Package(), a.Version) +} + +func (a *API) DiscoveryURL() string { + if a.DiscoveryLink == "" { + log.Fatalf("API %s has no DiscoveryLink", a.ID) + } + base, _ := url.Parse(*apisURL) + u, err := base.Parse(a.DiscoveryLink) + if err != nil { + log.Fatalf("API %s has bogus DiscoveryLink %s: %v", a.ID, a.DiscoveryLink, err) + } + return u.String() +} + +func (a *API) Package() string { + return strings.ToLower(a.Name) +} + +func (a *API) Target() string { + return fmt.Sprintf("code.google.com/p/google-api-go-client/%s/%s", a.Package(), a.Version) +} + +// GetName returns a free top-level function/type identifier in the package. +// It tries to return your preferred match if it's free. +func (a *API) GetName(preferred string) string { + return a.usedNames.Get(preferred) +} + +func (a *API) apiBaseURL() string { + if a.RootURL != "" { + return a.RootURL + a.ServicePath + } + return resolveRelative(*apisURL, jstr(a.m, "basePath")) +} + +func (a *API) needsDataWrapper() bool { + for _, feature := range jstrlist(a.m, "features") { + if feature == "dataWrapper" { + return true + } + } + return false +} + +func (a *API) jsonBytes() []byte { + if v := a.forceJSON; v != nil { + return v + } + return slurpURL(a.DiscoveryURL()) +} + +func (a *API) WriteGeneratedCode() error { + outdir := a.SourceDir() + err := os.MkdirAll(outdir, 0755) + if err != nil { + return fmt.Errorf("failed to Mkdir %s: %v", outdir, err) + } + + pkg := a.Package() + writeFile(filepath.Join(outdir, a.Package()+"-api.json"), a.jsonBytes()) + + genfilename := *output + if genfilename == "" { + genfilename = filepath.Join(outdir, pkg+"-gen.go") + } + + code, err := a.GenerateCode() + errw := writeFile(genfilename, code) + if err == nil { + err = errw + } + return err +} + +func (a *API) GenerateCode() ([]byte, error) { + pkg := a.Package() + + a.m = make(map[string]interface{}) + m := a.m + jsonBytes := a.jsonBytes() + err := json.Unmarshal(jsonBytes, &a.m) + if err != nil { + return nil, err + } + + // Buffer the output in memory, for gofmt'ing later in the defer. + var buf bytes.Buffer + a.p = func(format string, args ...interface{}) { + _, err := fmt.Fprintf(&buf, format, args...) + if err != nil { + panic(err) + } + } + a.pn = func(format string, args ...interface{}) { + a.p(format+"\n", args...) + } + + p, pn := a.p, a.pn + reslist := a.Resources(a.m, "") + + p("// Package %s provides access to the %s.\n", pkg, jstr(m, "title")) + if docs := jstr(m, "documentationLink"); docs != "" { + p("//\n") + p("// See %s\n", docs) + } + p("//\n// Usage example:\n") + p("//\n") + p("// import %q\n", a.Target()) + p("// ...\n") + p("// %sService, err := %s.New(oauthHttpClient)\n", pkg, pkg) + + p("package %s\n", pkg) + p("\n") + p("import (\n") + for _, pkg := range []string{ + "bytes", + *googleAPIPkg, + "encoding/json", + "errors", + "fmt", + "io", + "net/http", + "net/url", + "strconv", + "strings", + } { + p("\t%q\n", pkg) + } + p(")\n\n") + pn("// Always reference these packages, just in case the auto-generated code") + pn("// below doesn't.") + pn("var _ = bytes.NewBuffer") + pn("var _ = strconv.Itoa") + pn("var _ = fmt.Sprintf") + pn("var _ = json.NewDecoder") + pn("var _ = io.Copy") + pn("var _ = url.Parse") + pn("var _ = googleapi.Version") + pn("var _ = errors.New") + pn("var _ = strings.Replace") + pn("") + pn("const apiId = %q", jstr(m, "id")) + pn("const apiName = %q", jstr(m, "name")) + pn("const apiVersion = %q", jstr(m, "version")) + p("const basePath = %q\n", a.apiBaseURL()) + p("\n") + + a.generateScopeConstants() + + a.GetName("New") // ignore return value; we're the first caller + pn("func New(client *http.Client) (*Service, error) {") + pn("if client == nil { return nil, errors.New(\"client is nil\") }") + pn("s := &Service{client: client, BasePath: basePath}") + for _, res := range reslist { // add top level resources. + pn("s.%s = New%s(s)", res.GoField(), res.GoType()) + } + pn("return s, nil") + pn("}") + + a.GetName("Service") // ignore return value; no user-defined names yet + p("\ntype Service struct {\n") + p("\tclient *http.Client\n") + p("\tBasePath string // API endpoint base URL\n") + + for _, res := range reslist { + p("\n\t%s\t*%s\n", res.GoField(), res.GoType()) + } + p("}\n") + + for _, res := range reslist { + res.generateType() + } + + a.PopulateSchemas() + + for _, name := range a.sortedSchemaNames() { + a.schemas[name].writeSchemaCode() + } + + for _, meth := range a.APIMethods() { + meth.generateCode() + } + + for _, res := range reslist { + res.generateMethods() + } + + clean, err := format.Source(buf.Bytes()) + if err != nil { + return buf.Bytes(), err + } + return clean, nil +} + +func (a *API) generateScopeConstants() { + auth := jobj(a.m, "auth") + if auth == nil { + return + } + oauth2 := jobj(auth, "oauth2") + if oauth2 == nil { + return + } + scopes := jobj(oauth2, "scopes") + if scopes == nil || len(scopes) == 0 { + return + } + + a.p("// OAuth2 scopes used by this API.\n") + a.p("const (\n") + n := 0 + for _, scopeName := range sortedKeys(scopes) { + mi := scopes[scopeName] + if n > 0 { + a.p("\n") + } + n++ + ident := scopeIdentifierFromURL(scopeName) + if des := jstr(mi.(map[string]interface{}), "description"); des != "" { + a.p("%s", asComment("\t", des)) + } + a.p("\t%s = %q\n", ident, scopeName) + } + a.p(")\n\n") +} + +func scopeIdentifierFromURL(urlStr string) string { + const prefix = "https://www.googleapis.com/auth/" + if !strings.HasPrefix(urlStr, prefix) { + log.Fatalf("Unexpected oauth2 scope %q doesn't start with %q", urlStr, prefix) + } + ident := validGoIdentifer(initialCap(urlStr[len(prefix):])) + "Scope" + return ident +} + +type Schema struct { + api *API + m map[string]interface{} // original JSON map + + typ *Type // lazily populated by Type + + apiName string // the native API-defined name of this type + goName string // lazily populated by GoName +} + +type Property struct { + s *Schema // property of which schema + apiName string // the native API-defined name of this property + m map[string]interface{} // original JSON map + + typ *Type // lazily populated by Type +} + +func (p *Property) Type() *Type { + if p.typ == nil { + p.typ = &Type{api: p.s.api, m: p.m} + } + return p.typ +} + +func (p *Property) GoName() string { + return initialCap(p.apiName) +} + +func (p *Property) APIName() string { + return p.apiName +} + +func (p *Property) Description() string { + return jstr(p.m, "description") +} + +type Type struct { + m map[string]interface{} // JSON map containing key "type" and maybe "items", "properties" + api *API +} + +func (t *Type) apiType() string { + // Note: returns "" on reference types + if t, ok := t.m["type"].(string); ok { + return t + } + return "" +} + +func (t *Type) apiTypeFormat() string { + if f, ok := t.m["format"].(string); ok { + return f + } + return "" +} + +func (t *Type) isIntAsString() bool { + return t.apiType() == "string" && strings.Contains(t.apiTypeFormat(), "int") +} + +func (t *Type) asSimpleGoType() (goType string, ok bool) { + return simpleTypeConvert(t.apiType(), t.apiTypeFormat()) +} + +func (t *Type) String() string { + return fmt.Sprintf("[type=%q, map=%s]", t.apiType(), prettyJSON(t.m)) +} + +func (t *Type) AsGo() string { + if t, ok := t.asSimpleGoType(); ok { + return t + } + if at, ok := t.ArrayType(); ok { + if at.apiType() == "string" { + switch at.apiTypeFormat() { + case "int64": + return "googleapi.Int64s" + case "uint64": + return "googleapi.Uint64s" + case "int32": + return "googleapi.Int32s" + case "uint32": + return "googleapi.Uint32s" + case "float64": + return "googleapi.Float64s" + default: + return "[]" + at.AsGo() + } + } + return "[]" + at.AsGo() + } + if ref, ok := t.Reference(); ok { + s := t.api.schemas[ref] + if s == nil { + panic(fmt.Sprintf("in Type.AsGo(), failed to find referenced type %q for %s", + ref, prettyJSON(t.m))) + } + return s.Type().AsGo() + } + if t.IsMap() { + // TODO(gmlewis): support maps to any type. + return fmt.Sprintf("map[string]string") + } + if t.IsStruct() { + if apiName, ok := t.m["_apiName"].(string); ok { + s := t.api.schemas[apiName] + if s == nil { + panic(fmt.Sprintf("in Type.AsGo, _apiName of %q didn't point to a valid schema; json: %s", + apiName, prettyJSON(t.m))) + } + return "*" + s.GoName() + } + panic("in Type.AsGo, no _apiName found for struct type " + prettyJSON(t.m)) + } + panic("unhandled Type.AsGo for " + prettyJSON(t.m)) +} + +func (t *Type) IsSimple() bool { + _, ok := simpleTypeConvert(t.apiType(), t.apiTypeFormat()) + return ok +} + +func (t *Type) IsStruct() bool { + return t.apiType() == "object" +} + +func (t *Type) Reference() (apiName string, ok bool) { + apiName = jstr(t.m, "$ref") + ok = apiName != "" + return +} + +func (t *Type) IsMap() bool { + props := jobj(t.m, "additionalProperties") + if props == nil { + return false + } + s := jstr(props, "type") + b := s == "string" + if !b { + log.Printf("Warning: found map to type %q which is not implemented yet.", s) + } + return b +} + +func (t *Type) IsReference() bool { + return jstr(t.m, "$ref") != "" +} + +func (t *Type) ReferenceSchema() (s *Schema, ok bool) { + apiName, ok := t.Reference() + if !ok { + return + } + + s = t.api.schemas[apiName] + if s == nil { + panicf("failed to find t.api.schemas[%q] while resolving reference", + apiName) + } + return s, true +} + +func (t *Type) ArrayType() (elementType *Type, ok bool) { + if t.apiType() != "array" { + return + } + items := jobj(t.m, "items") + if items == nil { + panicf("can't handle array type missing its 'items' key. map is %#v", t.m) + } + return &Type{api: t.api, m: items}, true +} + +func (s *Schema) Type() *Type { + if s.typ == nil { + s.typ = &Type{api: s.api, m: s.m} + } + return s.typ +} + +func (s *Schema) properties() []*Property { + if !s.Type().IsStruct() { + panic("called properties on non-object schema") + } + pl := []*Property{} + propMap := jobj(s.m, "properties") + for _, name := range sortedKeys(propMap) { + m := propMap[name].(map[string]interface{}) + pl = append(pl, &Property{ + s: s, + m: m, + apiName: name, + }) + } + return pl +} + +func (s *Schema) populateSubSchemas() (outerr error) { + defer func() { + r := recover() + if r == nil { + return + } + outerr = fmt.Errorf("%v", r) + }() + + addSubStruct := func(subApiName string, t *Type) { + if s.api.schemas[subApiName] != nil { + panic("dup schema apiName: " + subApiName) + } + subm := t.m + subm["_apiName"] = subApiName + subs := &Schema{ + api: s.api, + m: subm, + typ: t, + apiName: subApiName, + } + s.api.schemas[subApiName] = subs + err := subs.populateSubSchemas() + if err != nil { + panicf("in sub-struct %q: %v", subApiName, err) + } + } + + if s.Type().IsStruct() { + for _, p := range s.properties() { + if p.Type().IsSimple() || p.Type().IsMap() { + continue + } + if at, ok := p.Type().ArrayType(); ok { + if at.IsSimple() || at.IsReference() { + continue + } + subApiName := fmt.Sprintf("%s.%s", s.apiName, p.apiName) + if at.IsStruct() { + addSubStruct(subApiName, at) // was p.Type()? + continue + } + if _, ok := at.ArrayType(); ok { + addSubStruct(subApiName, at) + continue + } + panicf("Unknown property array type for %q: %s", subApiName, at) + continue + } + subApiName := fmt.Sprintf("%s.%s", s.apiName, p.apiName) + if p.Type().IsStruct() { + addSubStruct(subApiName, p.Type()) + continue + } + if p.Type().IsReference() { + continue + } + panicf("Unknown type for %q: %s", subApiName, p.Type()) + } + return + } + + if at, ok := s.Type().ArrayType(); ok { + if at.IsSimple() || at.IsReference() { + return + } + subApiName := fmt.Sprintf("%s.Item", s.apiName) + + if at.IsStruct() { + addSubStruct(subApiName, at) + return + } + if at, ok := at.ArrayType(); ok { + if at.IsSimple() || at.IsReference() { + return + } + addSubStruct(subApiName, at) + return + } + panicf("Unknown array type for %q: %s", subApiName, at) + return + } + + if s.Type().IsSimple() || s.Type().IsReference() { + return + } + + fmt.Fprintf(os.Stderr, "in populateSubSchemas, schema is: %s", prettyJSON(s.m)) + panicf("populateSubSchemas: unsupported type for schema %q", s.apiName) + panic("unreachable") +} + +// GoName returns (or creates and returns) the bare Go name +// of the apiName, making sure that it's a proper Go identifier +// and doesn't conflict with an existing name. +func (s *Schema) GoName() string { + if s.goName == "" { + s.goName = s.api.GetName(initialCap(s.apiName)) + } + return s.goName +} + +func (s *Schema) writeSchemaCode() { + if s.Type().IsStruct() && !s.Type().IsMap() { + s.writeSchemaStruct() + return + } + + if _, ok := s.Type().ArrayType(); ok { + log.Printf("TODO writeSchemaCode for arrays for %s", s.GoName()) + return + } + + if destSchema, ok := s.Type().ReferenceSchema(); ok { + // Convert it to a struct using embedding. + s.api.p("\ntype %s struct {\n", s.GoName()) + s.api.p("\t%s\n", destSchema.GoName()) + s.api.p("}\n") + return + } + + if s.Type().IsSimple() || s.Type().IsMap() { + return + } + + fmt.Fprintf(os.Stderr, "in writeSchemaCode, schema is: %s", prettyJSON(s.m)) + panicf("writeSchemaCode: unsupported type for schema %q", s.apiName) +} + +func (s *Schema) writeSchemaStruct() { + // TODO: description + s.api.p("\ntype %s struct {\n", s.GoName()) + for i, p := range s.properties() { + if i > 0 { + s.api.p("\n") + } + pname := p.GoName() + if des := p.Description(); des != "" { + s.api.p("%s", asComment("\t", fmt.Sprintf("%s: %s", pname, des))) + } + var extraOpt string + if p.Type().isIntAsString() { + extraOpt += ",string" + } + s.api.p("\t%s %s `json:\"%s,omitempty%s\"`\n", pname, p.Type().AsGo(), p.APIName(), extraOpt) + } + s.api.p("}\n") +} + +// PopulateSchemas reads all the API types ("schemas") from the JSON file +// and converts them to *Schema instances, returning an identically +// keyed map, additionally containing subresources. For instance, +// +// A resource "Foo" of type "object" with a property "bar", also of type +// "object" (an anonymous sub-resource), will get a synthetic API name +// of "Foo.bar". +// +// A resource "Foo" of type "array" with an "items" of type "object" +// will get a synthetic API name of "Foo.Item". +func (a *API) PopulateSchemas() { + m := jobj(a.m, "schemas") + if a.schemas != nil { + panic("") + } + a.schemas = make(map[string]*Schema) + for name, mi := range m { + s := &Schema{ + api: a, + apiName: name, + m: mi.(map[string]interface{}), + } + + // And a little gross hack, so a map alone is good + // enough to get its apiName: + s.m["_apiName"] = name + + a.schemas[name] = s + err := s.populateSubSchemas() + if err != nil { + panicf("Error populating schema with API name %q: %v", name, err) + } + } +} + +type Resource struct { + api *API + name string + parent string + m map[string]interface{} + resources []*Resource +} + +func (r *Resource) generateType() { + p, pn := r.api.p, r.api.pn + t := r.GoType() + pn(fmt.Sprintf("func New%s(s *Service) *%s {", t, t)) + pn("rs := &%s{s : s}", t) + for _, res := range r.resources { + pn("rs.%s = New%s(s)", res.GoField(), res.GoType()) + } + pn("return rs") + pn("}") + + p("\ntype %s struct {\n", t) + p("\ts *Service\n") + for _, res := range r.resources { + p("\n\t%s\t*%s\n", res.GoField(), res.GoType()) + } + p("}\n") + + for _, res := range r.resources { + res.generateType() + } +} + +func (r *Resource) generateMethods() { + for _, meth := range r.Methods() { + meth.generateCode() + } + for _, res := range r.resources { + res.generateMethods() + } +} + +func (r *Resource) GoField() string { + return initialCap(r.name) +} + +func (r *Resource) GoType() string { + return initialCap(fmt.Sprintf("%s.%s", r.parent, r.name)) + "Service" +} + +func (r *Resource) Methods() []*Method { + ms := []*Method{} + + methMap := jobj(r.m, "methods") + for _, mname := range sortedKeys(methMap) { + mi := methMap[mname] + ms = append(ms, &Method{ + api: r.api, + r: r, + name: mname, + m: mi.(map[string]interface{}), + }) + } + return ms +} + +type Method struct { + api *API + r *Resource // or nil if a API-level (top-level) method + name string + m map[string]interface{} // original JSON + + params []*Param // all Params, of each type, lazily set by first access to Parameters +} + +func (m *Method) Id() string { + return jstr(m.m, "id") +} + +func (m *Method) supportsMedia() bool { + return jobj(m.m, "mediaUpload") != nil +} + +func (m *Method) mediaPath() string { + return jstr(jobj(jobj(jobj(m.m, "mediaUpload"), "protocols"), "simple"), "path") +} + +func (m *Method) Params() []*Param { + if m.params == nil { + paramMap := jobj(m.m, "parameters") + for _, name := range sortedKeys(paramMap) { + mi := paramMap[name] + pm := mi.(map[string]interface{}) + m.params = append(m.params, &Param{ + name: name, + m: pm, + method: m, + }) + } + } + return m.params +} + +func (m *Method) grepParams(f func(*Param) bool) []*Param { + matches := make([]*Param, 0) + for _, param := range m.Params() { + if f(param) { + matches = append(matches, param) + } + } + return matches +} + +func (m *Method) NamedParam(name string) *Param { + matches := m.grepParams(func(p *Param) bool { + return p.name == name + }) + if len(matches) < 1 { + log.Panicf("failed to find named parameter %q", name) + } + if len(matches) > 1 { + log.Panicf("found multiple parameters for parameter name %q", name) + } + return matches[0] +} + +func (m *Method) OptParams() []*Param { + return m.grepParams(func(p *Param) bool { + return !p.IsRequired() + }) +} + +func (m *Method) RequiredRepeatedQueryParams() []*Param { + return m.grepParams(func(p *Param) bool { + return p.IsRequired() && p.IsRepeated() && p.Location() == "query" + }) +} + +func (m *Method) RequiredQueryParams() []*Param { + return m.grepParams(func(p *Param) bool { + return p.IsRequired() && !p.IsRepeated() && p.Location() == "query" + }) +} + +func (meth *Method) generateCode() { + res := meth.r // may be nil if a top-level method + a := meth.api + p, pn := a.p, a.pn + + pn("\n// method id %q:", meth.Id()) + + retTypeComma := responseType(a, meth.m) + if retTypeComma != "" { + retTypeComma += ", " + } + + args := meth.NewArguments() + methodName := initialCap(meth.name) + + prefix := "" + if res != nil { + prefix = initialCap(fmt.Sprintf("%s.%s", res.parent, res.name)) + } + callName := a.GetName(prefix + methodName + "Call") + + p("\ntype %s struct {\n", callName) + p("\ts *Service\n") + for _, arg := range args.l { + p("\t%s %s\n", arg.goname, arg.gotype) + } + p("\topt_ map[string]interface{}\n") + if meth.supportsMedia() { + p("\tmedia_ io.Reader\n") + } + p("}\n") + + p("\n%s", asComment("", methodName+": "+jstr(meth.m, "description"))) + + var servicePtr string + if res == nil { + p("func (s *Service) %s(%s) *%s {\n", methodName, args, callName) + servicePtr = "s" + } else { + p("func (r *%s) %s(%s) *%s {\n", res.GoType(), methodName, args, callName) + servicePtr = "r.s" + } + + p("\tc := &%s{s: %s, opt_: make(map[string]interface{})}\n", callName, servicePtr) + for _, arg := range args.l { + p("\tc.%s = %s\n", arg.goname, arg.goname) + } + p("\treturn c\n") + p("}\n") + + for _, opt := range meth.OptParams() { + setter := initialCap(opt.name) + des := jstr(opt.m, "description") + des = strings.Replace(des, "Optional.", "", 1) + des = strings.TrimSpace(des) + p("\n%s", asComment("", fmt.Sprintf("%s sets the optional parameter %q: %s", setter, opt.name, des))) + np := new(namePool) + np.Get("c") // take the receiver's name + paramName := np.Get(validGoIdentifer(opt.name)) + p("func (c *%s) %s(%s %s) *%s {\n", callName, setter, paramName, opt.GoType(), callName) + p("c.opt_[%q] = %s\n", opt.name, paramName) + p("return c\n") + p("}\n") + } + + if meth.supportsMedia() { + p("func (c *%s) Media(r io.Reader) *%s {\n", callName, callName) + p("c.media_ = r\n") + p("return c\n") + p("}\n") + } + + pn("\nfunc (c *%s) Do() (%serror) {", callName, retTypeComma) + + nilRet := "" + if retTypeComma != "" { + nilRet = "nil, " + } + pn("var body io.Reader = nil") + hasContentType := false + httpMethod := jstr(meth.m, "httpMethod") + if ba := args.bodyArg(); ba != nil && httpMethod != "GET" { + style := "WithoutDataWrapper" + if a.needsDataWrapper() { + style = "WithDataWrapper" + } + pn("body, err := googleapi.%s.JSONReader(c.%s)", style, ba.goname) + pn("if err != nil { return %serr }", nilRet) + pn(`ctype := "application/json"`) + hasContentType = true + } + pn("params := make(url.Values)") + // Set this first. if they override it, though, might be gross. We don't expect + // XML replies elsewhere. TODO(bradfitz): hide this option in the generated code? + pn(`params.Set("alt", "json")`) + for _, p := range meth.RequiredQueryParams() { + pn("params.Set(%q, fmt.Sprintf(\"%%v\", c.%s))", p.name, p.goCallFieldName()) + } + for _, p := range meth.RequiredRepeatedQueryParams() { + pn("for _, v := range c.%s { params.Add(%q, fmt.Sprintf(\"%%v\", v)) }", + p.name, p.name) + } + for _, p := range meth.OptParams() { + pn("if v, ok := c.opt_[%q]; ok { params.Set(%q, fmt.Sprintf(\"%%v\", v)) }", + p.name, p.name) + } + + p("urls := googleapi.ResolveRelative(c.s.BasePath, %q)\n", jstr(meth.m, "path")) + if meth.supportsMedia() { + pn("if c.media_ != nil {") + // Hack guess, since we get a 404 otherwise: + //pn("urls = googleapi.ResolveRelative(%q, %q)", a.apiBaseURL(), meth.mediaPath()) + // Further hack. Discovery doc is wrong? + pn("urls = strings.Replace(urls, %q, %q, 1)", "https://www.googleapis.com/", "https://www.googleapis.com/upload/") + pn(`params.Set("uploadType", "multipart")`) + pn("}") + } + pn("urls += \"?\" + params.Encode()") + if meth.supportsMedia() && httpMethod != "GET" { + if !hasContentType { // Support mediaUpload but no ctype set. + pn("body = new(bytes.Buffer)") + pn(`ctype := "application/json"`) + hasContentType = true + } + pn("contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype)") + } + pn("req, _ := http.NewRequest(%q, urls, body)", httpMethod) + // Replace param values after NewRequest to avoid reencoding them. + // E.g. Cloud Storage API requires '%2F' in entity param to be kept, but url.Parse replaces it with '/'. + for _, arg := range args.forLocation("path") { + pn(`req.URL.Path = strings.Replace(req.URL.Path, "{%s}", %s, 1)`, arg.apiname, arg.cleanExpr("c.")) + } + // Set opaque to avoid encoding of the parameters in the URL path. + pn("googleapi.SetOpaque(req.URL)") + + if meth.supportsMedia() { + pn("if hasMedia_ { req.ContentLength = contentLength_ }") + } + if hasContentType { + pn(`req.Header.Set("Content-Type", ctype)`) + } + pn(`req.Header.Set("User-Agent", "google-api-go-client/` + goGenVersion + `")`) + pn("res, err := c.s.client.Do(req);") + pn("if err != nil { return %serr }", nilRet) + pn("defer googleapi.CloseBody(res)") + pn("if err := googleapi.CheckResponse(res); err != nil { return %serr }", nilRet) + if retTypeComma == "" { + pn("return nil") + } else { + pn("ret := new(%s)", responseType(a, meth.m)[1:]) + pn("if err := json.NewDecoder(res.Body).Decode(ret); err != nil { return nil, err }") + pn("return ret, nil") + } + + bs, _ := json.MarshalIndent(meth.m, "\t// ", " ") + pn("// %s\n", string(bs)) + pn("}") +} + +type Param struct { + method *Method + name string + m map[string]interface{} + callFieldName string // empty means to use the default +} + +func (p *Param) IsRequired() bool { + v, _ := p.m["required"].(bool) + return v +} + +func (p *Param) IsRepeated() bool { + v, _ := p.m["repeated"].(bool) + return v +} + +func (p *Param) Location() string { + return p.m["location"].(string) +} + +func (p *Param) GoType() string { + typ, format := jstr(p.m, "type"), jstr(p.m, "format") + if typ == "string" && strings.Contains(format, "int") && p.Location() != "query" { + panic("unexpected int parameter encoded as string, not in query: " + p.name) + } + t, ok := simpleTypeConvert(typ, format) + if !ok { + panic("failed to convert parameter type " + fmt.Sprintf("type=%q, format=%q", typ, format)) + } + return t +} + +// goCallFieldName returns the name of this parameter's field in a +// method's "Call" struct. +func (p *Param) goCallFieldName() string { + if p.callFieldName != "" { + return p.callFieldName + } + return validGoIdentifer(p.name) +} + +// APIMethods returns top-level ("API-level") methods. They don't have an associated resource. +func (a *API) APIMethods() []*Method { + meths := []*Method{} + methMap := jobj(a.m, "methods") + for _, name := range sortedKeys(methMap) { + mi := methMap[name] + meths = append(meths, &Method{ + api: a, + r: nil, // to be explicit + name: name, + m: mi.(map[string]interface{}), + }) + } + return meths +} + +func (a *API) Resources(m map[string]interface{}, p string) []*Resource { + res := []*Resource{} + resMap := jobj(m, "resources") + for _, rname := range sortedKeys(resMap) { + rmi := resMap[rname] + rm := rmi.(map[string]interface{}) + res = append(res, &Resource{a, rname, p, rm, a.Resources(rm, fmt.Sprintf("%s.%s", p, rname))}) + } + return res +} + +func resolveRelative(basestr, relstr string) string { + u, err := url.Parse(basestr) + if err != nil { + panicf("Error parsing base URL %q: %v", basestr, err) + } + rel, err := url.Parse(relstr) + if err != nil { + panicf("Error parsing relative URL %q: %v", relstr, err) + } + u = u.ResolveReference(rel) + return u.String() +} + +func (meth *Method) NewArguments() (args *arguments) { + args = &arguments{ + method: meth, + m: make(map[string]*argument), + } + po, ok := meth.m["parameterOrder"].([]interface{}) + if ok { + for _, poi := range po { + pname := poi.(string) + arg := meth.NewArg(pname, meth.NamedParam(pname)) + args.AddArg(arg) + } + } + if ro := jobj(meth.m, "request"); ro != nil { + args.AddArg(meth.NewBodyArg(ro)) + } + return +} + +func (meth *Method) NewBodyArg(m map[string]interface{}) *argument { + reftype := jstr(m, "$ref") + return &argument{ + goname: validGoIdentifer(strings.ToLower(reftype)), + apiname: "REQUEST", + gotype: "*" + reftype, + apitype: reftype, + location: "body", + } +} + +func (meth *Method) NewArg(apiname string, p *Param) *argument { + m := p.m + apitype := jstr(m, "type") + des := jstr(m, "description") + goname := validGoIdentifer(apiname) // but might be changed later, if conflicts + if strings.Contains(des, "identifier") && !strings.HasSuffix(strings.ToLower(goname), "id") { + goname += "id" // yay + p.callFieldName = goname + } + gotype := mustSimpleTypeConvert(apitype, jstr(m, "format")) + if p.IsRepeated() { + gotype = "[]" + gotype + } + return &argument{ + apiname: apiname, + apitype: apitype, + goname: goname, + gotype: gotype, + location: jstr(m, "location"), + } +} + +type argument struct { + method *Method + apiname, apitype string + goname, gotype string + location string // "path", "query", "body" +} + +func (a *argument) String() string { + return a.goname + " " + a.gotype +} + +func (a *argument) cleanExpr(prefix string) string { + switch a.gotype { + case "[]string": + log.Printf("TODO(bradfitz): only including the first parameter in path query.") + return "url.QueryEscape(" + prefix + a.goname + "[0])" + case "string": + return "url.QueryEscape(" + prefix + a.goname + ")" + case "integer", "int64": + return "strconv.FormatInt(" + prefix + a.goname + ", 10)" + case "uint64": + return "strconv.FormatUint(" + prefix + a.goname + ", 10)" + } + log.Panicf("unknown type: apitype=%q, gotype=%q", a.apitype, a.gotype) + return "" +} + +// arguments are the arguments that a method takes +type arguments struct { + l []*argument + m map[string]*argument + method *Method +} + +func (args *arguments) forLocation(loc string) []*argument { + matches := make([]*argument, 0) + for _, arg := range args.l { + if arg.location == loc { + matches = append(matches, arg) + } + } + return matches +} + +func (args *arguments) bodyArg() *argument { + for _, arg := range args.l { + if arg.location == "body" { + return arg + } + } + return nil +} + +func (args *arguments) AddArg(arg *argument) { + n := 1 + oname := arg.goname + for { + _, present := args.m[arg.goname] + if !present { + args.m[arg.goname] = arg + args.l = append(args.l, arg) + return + } + n++ + arg.goname = fmt.Sprintf("%s%d", oname, n) + } +} + +func (a *arguments) String() string { + var buf bytes.Buffer + for i, arg := range a.l { + if i != 0 { + buf.Write([]byte(", ")) + } + buf.Write([]byte(arg.String())) + } + return buf.String() +} + +func asComment(pfx, c string) string { + var buf bytes.Buffer + const maxLen = 70 + removeNewlines := func(s string) string { + return strings.Replace(s, "\n", "\n"+pfx+"// ", -1) + } + for len(c) > 0 { + line := c + if len(line) < maxLen { + fmt.Fprintf(&buf, "%s// %s\n", pfx, removeNewlines(line)) + break + } + line = line[:maxLen] + si := strings.LastIndex(line, " ") + if si != -1 { + line = line[:si] + } + fmt.Fprintf(&buf, "%s// %s\n", pfx, removeNewlines(line)) + c = c[len(line):] + if si != -1 { + c = c[1:] + } + } + return buf.String() +} + +func simpleTypeConvert(apiType, format string) (gotype string, ok bool) { + // From http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1 + switch apiType { + case "boolean": + gotype = "bool" + case "string": + gotype = "string" + switch format { + case "int64", "uint64", "int32", "uint32": + gotype = format + } + case "number": + gotype = "float64" + case "integer": + gotype = "int64" + case "any": + gotype = "interface{}" + } + return gotype, gotype != "" +} + +func mustSimpleTypeConvert(apiType, format string) string { + if gotype, ok := simpleTypeConvert(apiType, format); ok { + return gotype + } + panic(fmt.Sprintf("failed to simpleTypeConvert(%q, %q)", apiType, format)) +} + +func (a *API) goTypeOfJsonObject(outerName, memberName string, m map[string]interface{}) (string, error) { + apitype := jstr(m, "type") + switch apitype { + case "array": + items := jobj(m, "items") + if items == nil { + return "", errors.New("no items but type was array") + } + if ref := jstr(items, "$ref"); ref != "" { + return "[]*" + ref, nil // TODO: wrong; delete this whole function + } + if atype := jstr(items, "type"); atype != "" { + return "[]" + mustSimpleTypeConvert(atype, jstr(items, "format")), nil + } + return "", errors.New("unsupported 'array' type") + case "object": + return "*" + outerName + "_" + memberName, nil + //return "", os.NewError("unsupported 'object' type") + } + return mustSimpleTypeConvert(apitype, jstr(m, "format")), nil +} + +func responseType(api *API, m map[string]interface{}) string { + ro := jobj(m, "response") + if ro != nil { + if ref := jstr(ro, "$ref"); ref != "" { + if s := api.schemas[ref]; s != nil { + return "*" + s.GoName() + } + return "*" + ref + } + } + return "" +} + +// initialCap returns the identifier with a leading capital letter. +// it also maps "foo-bar" to "FooBar". +func initialCap(ident string) string { + if ident == "" { + panic("blank identifier") + } + return depunct(ident, true) +} + +func validGoIdentifer(ident string) string { + id := depunct(ident, false) + switch id { + case "break", "default", "func", "interface", "select", + "case", "defer", "go", "map", "struct", + "chan", "else", "goto", "package", "switch", + "const", "fallthrough", "if", "range", "type", + "continue", "for", "import", "return", "var": + return id + "_" + } + return id +} + +// depunct removes '-', '.', '$', '/' from identifers, making the +// following character uppercase +func depunct(ident string, needCap bool) string { + var buf bytes.Buffer + for _, c := range ident { + if c == '-' || c == '.' || c == '$' || c == '/' { + needCap = true + continue + } + if needCap { + c = unicode.ToUpper(c) + needCap = false + } + buf.WriteByte(byte(c)) + } + return buf.String() + +} + +func prettyJSON(m map[string]interface{}) string { + bs, err := json.MarshalIndent(m, "", " ") + if err != nil { + return fmt.Sprintf("[JSON error %v on %#v]", err, m) + } + return string(bs) +} + +func jstr(m map[string]interface{}, key string) string { + if s, ok := m[key].(string); ok { + return s + } + return "" +} + +func sortedKeys(m map[string]interface{}) (keys []string) { + for key := range m { + keys = append(keys, key) + } + sort.Strings(keys) + return +} + +func jobj(m map[string]interface{}, key string) map[string]interface{} { + if m, ok := m[key].(map[string]interface{}); ok { + return m + } + return nil +} + +func jstrlist(m map[string]interface{}, key string) []string { + si, ok := m[key].([]interface{}) + if !ok { + return nil + } + sl := make([]string, 0) + for _, si := range si { + sl = append(sl, si.(string)) + } + return sl +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/gen_test.go b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/gen_test.go new file mode 100644 index 0000000000000..fee0ead9a2c4d --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/gen_test.go @@ -0,0 +1,52 @@ +package main + +import ( + "bytes" + "flag" + "io/ioutil" + "path/filepath" + "testing" +) + +var updateGolden = flag.Bool("update_golden", false, "If true, causes TestAPIs to update golden files") + +func TestAPIs(t *testing.T) { + names := []string{ + "arrayofarray-1", + "arrayofmapofstrings", + "blogger-3", + "getwithoutbody", + "mapofstrings-1", + "quotednum", + "resource-named-service", // blogger/v3/blogger-api.json + s/BlogUserInfo/Service/ + } + for _, name := range names { + api, err := apiFromFile(filepath.Join("testdata", name+".json")) + if err != nil { + t.Errorf("Error loading API testdata/%s.json: %v", name, err) + continue + } + clean, err := api.GenerateCode() + if err != nil { + t.Errorf("Error generating code for %s: %v", name, err) + continue + } + goldenFile := filepath.Join("testdata", name+".want") + if *updateGolden { + if err := ioutil.WriteFile(goldenFile, clean, 0644); err != nil { + t.Fatal(err) + } + } + want, err := ioutil.ReadFile(goldenFile) + if err != nil { + t.Error(err) + continue + } + if !bytes.Equal(want, clean) { + tf, _ := ioutil.TempFile("", "api-"+name+"-got-json.") + tf.Write(clean) + tf.Close() + t.Errorf("Output for API %s differs: diff -u %s %s", name, goldenFile, tf.Name()) + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/arrayofarray-1.json b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/arrayofarray-1.json new file mode 100644 index 0000000000000..81cefae3efe5d --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/arrayofarray-1.json @@ -0,0 +1,49 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"", + "discoveryVersion": "v1", + "id": "arrayofarray:v1", + "name": "arrayofarray", + "version": "v1", + "title": "Example API", + "description": "The Example API demonstrates an array of arrays.", + "ownerDomain": "google.com", + "ownerName": "Google", + "protocol": "rest", + "schemas": { + "GeoJsonMultiPolygon": { + "id": "GeoJsonMultiPolygon", + "type": "object", + "description": "Multi Polygon", + "properties": { + "coordinates": { + "type": "array", + "description": "Coordinate arrays.", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + } + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a multi-polygon.", + "enum": [ + "MultiPolygon" + ], + "enumDescriptions": [ + "" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/arrayofarray-1.want b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/arrayofarray-1.want new file mode 100644 index 0000000000000..cbe75a22df700 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/arrayofarray-1.want @@ -0,0 +1,59 @@ +// Package arrayofarray provides access to the Example API. +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/arrayofarray/v1" +// ... +// arrayofarrayService, err := arrayofarray.New(oauthHttpClient) +package arrayofarray + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "arrayofarray:v1" +const apiName = "arrayofarray" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/discovery/v1/apis" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL +} + +type GeoJsonMultiPolygon struct { + // Coordinates: Coordinate arrays. + Coordinates [][][][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a multi-polygon. + Type string `json:"type,omitempty"` +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/arrayofmapofstrings.json b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/arrayofmapofstrings.json new file mode 100644 index 0000000000000..65b338b11f3bc --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/arrayofmapofstrings.json @@ -0,0 +1,32 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"", + "discoveryVersion": "v1", + "id": "arrayofmapofstrings:v1", + "name": "arrayofmapofstrings", + "version": "v1", + "title": "Example API", + "description": "The Example API demonstrates an array of arrays.", + "ownerDomain": "google.com", + "ownerName": "Google", + "protocol": "rest", + "schemas": { + "Analyze": { + "id": "Analyze", + "type": "object", + "properties": { + "errors": { + "type": "array", + "description": "List of errors with the data.", + "items": { + "type": "object", + "additionalProperties": { + "type": "string", + "description": "Error level followed by a detailed error message." + } + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/arrayofmapofstrings.want b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/arrayofmapofstrings.want new file mode 100644 index 0000000000000..762e171e4e1cc --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/arrayofmapofstrings.want @@ -0,0 +1,56 @@ +// Package arrayofmapofstrings provides access to the Example API. +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/arrayofmapofstrings/v1" +// ... +// arrayofmapofstringsService, err := arrayofmapofstrings.New(oauthHttpClient) +package arrayofmapofstrings + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "arrayofmapofstrings:v1" +const apiName = "arrayofmapofstrings" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/discovery/v1/apis" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL +} + +type Analyze struct { + // Errors: List of errors with the data. + Errors []map[string]string `json:"errors,omitempty"` +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/blogger-3.json b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/blogger-3.json new file mode 100644 index 0000000000000..53caa836470f5 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/blogger-3.json @@ -0,0 +1,2199 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"DGgqtFnjgu83tuwvvVNNUhOiHWk/HqXrvEeuZV7fVbX7lTgVYLdSy_g\"", + "discoveryVersion": "v1", + "id": "blogger:v3", + "name": "blogger", + "version": "v3", + "title": "Blogger API", + "description": "API for access to the data within Blogger.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/blogger-16.png", + "x32": "http://www.google.com/images/icons/product/blogger-32.png" + }, + "documentationLink": "https://developers.google.com/blogger/docs/3.0/getting_started", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/blogger/v3/", + "basePath": "/blogger/v3/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "blogger/v3/", + "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" + }, + "https://www.googleapis.com/auth/blogger.readonly": { + "description": "View your Blogger account" + } + } + } + }, + "schemas": { + "Blog": { + "id": "Blog", + "type": "object", + "properties": { + "customMetaData": { + "type": "string", + "description": "The JSON custom meta-data for the Blog" + }, + "description": { + "type": "string", + "description": "The description of this blog. This is displayed underneath the title." + }, + "id": { + "type": "string", + "description": "The identifier for this resource." + }, + "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": { + "items": { + "type": "array", + "description": "The List of Posts for this Blog.", + "items": { + "$ref": "Post" + } + }, + "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": { + "blogUserInfos": { + "type": "array", + "description": "Admin level list of blog per-user information", + "items": { + "$ref": "BlogUserInfo" + } + }, + "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" + } + } + }, + "BlogPerUserInfo": { + "id": "BlogPerUserInfo", + "type": "object", + "properties": { + "blogId": { + "type": "string", + "description": "ID of the Blog resource" + }, + "hasAdminAccess": { + "type": "boolean", + "description": "True if the user has Admin level access to the blog." + }, + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#blogPerUserInfo", + "default": "blogger#blogPerUserInfo" + }, + "photosAlbumKey": { + "type": "string", + "description": "The Photo Album Key for the user when adding photos to the blog" + }, + "userId": { + "type": "string", + "description": "ID of the User" + } + } + }, + "BlogUserInfo": { + "id": "BlogUserInfo", + "type": "object", + "properties": { + "blog": { + "$ref": "Blog", + "description": "The Blog resource." + }, + "blog_user_info": { + "$ref": "BlogPerUserInfo", + "description": "Information about a User for the Blog." + }, + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#blogUserInfo", + "default": "blogger#blogUserInfo" + } + } + }, + "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." + } + } + }, + "content": { + "type": "string", + "description": "The actual content of the comment. May include HTML markup." + }, + "id": { + "type": "string", + "description": "The identifier for this resource." + }, + "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." + } + } + }, + "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." + } + } + }, + "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." + }, + "status": { + "type": "string", + "description": "The status of the comment (only populated for admin users)" + }, + "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." + } + } + }, + "content": { + "type": "string", + "description": "The body content of this Page, in HTML." + }, + "id": { + "type": "string", + "description": "The identifier for this resource." + }, + "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." + }, + "status": { + "type": "string", + "description": "The status of the page for admin resources (either LIVE or DRAFT)." + }, + "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" + } + } + }, + "Pageviews": { + "id": "Pageviews", + "type": "object", + "properties": { + "blogId": { + "type": "string", + "description": "Blog Id", + "format": "int64" + }, + "counts": { + "type": "array", + "description": "The container of posts in this blog.", + "items": { + "type": "object", + "properties": { + "count": { + "type": "string", + "description": "Count of page views for the given time range", + "format": "int64" + }, + "timeRange": { + "type": "string", + "description": "Time range the given count applies to" + } + } + } + }, + "kind": { + "type": "string", + "description": "The kind of this entry. Always blogger#page_views", + "default": "blogger#page_views" + } + } + }, + "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." + } + } + }, + "content": { + "type": "string", + "description": "The content of the Post. May contain HTML markup." + }, + "customMetaData": { + "type": "string", + "description": "The JSON meta-data for the Post." + }, + "id": { + "type": "string", + "description": "The identifier of this Post." + }, + "images": { + "type": "array", + "description": "Display image for the Post.", + "items": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + } + } + }, + "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" + } + }, + "location": { + "type": "object", + "description": "The location for geotagged posts.", + "properties": { + "lat": { + "type": "number", + "description": "Location's latitude.", + "format": "double" + }, + "lng": { + "type": "number", + "description": "Location's longitude.", + "format": "double" + }, + "name": { + "type": "string", + "description": "Location name." + }, + "span": { + "type": "string", + "description": "Location's viewport span. Can be used when rendering a map preview." + } + } + }, + "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": { + "items": { + "type": "array", + "description": "The List of Comments for this Post.", + "items": { + "$ref": "Comment" + } + }, + "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." + }, + "status": { + "type": "string", + "description": "Status of the post. Only set for admin-level requests" + }, + "title": { + "type": "string", + "description": "The title of the Post." + }, + "titleLink": { + "type": "string", + "description": "The title link URL, similar to atom's related link." + }, + "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." + } + } + }, + "PostPerUserInfo": { + "id": "PostPerUserInfo", + "type": "object", + "properties": { + "blogId": { + "type": "string", + "description": "ID of the Blog that the post resource belongs to." + }, + "hasEditAccess": { + "type": "boolean", + "description": "True if the user has Author level access to the post." + }, + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#postPerUserInfo", + "default": "blogger#postPerUserInfo" + }, + "postId": { + "type": "string", + "description": "ID of the Post resource." + }, + "userId": { + "type": "string", + "description": "ID of the User." + } + } + }, + "PostUserInfo": { + "id": "PostUserInfo", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#postUserInfo", + "default": "blogger#postUserInfo" + }, + "post": { + "$ref": "Post", + "description": "The Post resource." + }, + "post_user_info": { + "$ref": "PostPerUserInfo", + "description": "Information about a User for the Post." + } + } + }, + "PostUserInfosList": { + "id": "PostUserInfosList", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The list of Posts with User information for the post, for this Blog.", + "items": { + "$ref": "PostUserInfo" + } + }, + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#postList", + "default": "blogger#postUserInfosList" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to fetch the next 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": { + "blogUserInfos": { + "methods": { + "get": { + "id": "blogger.blogUserInfos.get", + "path": "users/{userId}/blogs/{blogId}", + "httpMethod": "GET", + "description": "Gets one blog and user info pair by blogId and userId.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the blog to get.", + "required": true, + "location": "path" + }, + "maxPosts": { + "type": "integer", + "description": "Maximum number of posts to pull back with the blog.", + "format": "uint32", + "location": "query" + }, + "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", + "blogId" + ], + "response": { + "$ref": "BlogUserInfo" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + } + } + }, + "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" + }, + "maxPosts": { + "type": "integer", + "description": "Maximum number of posts to pull back with the blog.", + "format": "uint32", + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "response": { + "$ref": "Blog" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "getByUrl": { + "id": "blogger.blogs.getByUrl", + "path": "blogs/byurl", + "httpMethod": "GET", + "description": "Retrieve a Blog by URL.", + "parameters": { + "url": { + "type": "string", + "description": "The URL of the blog to retrieve.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "url" + ], + "response": { + "$ref": "Blog" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "listByUser": { + "id": "blogger.blogs.listByUser", + "path": "users/{userId}/blogs", + "httpMethod": "GET", + "description": "Retrieves a list of blogs, possibly filtered.", + "parameters": { + "fetchUserInfo": { + "type": "boolean", + "description": "Whether the response is a list of blogs with per-user information instead of just blogs.", + "location": "query" + }, + "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" + }, + "view": { + "type": "string", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Admin level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "BlogList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + } + } + }, + "comments": { + "methods": { + "approve": { + "id": "blogger.comments.approve", + "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve", + "httpMethod": "POST", + "description": "Marks a comment as not spam.", + "parameters": { + "blogId": { + "type": "string", + "description": "The Id of the Blog.", + "required": true, + "location": "path" + }, + "commentId": { + "type": "string", + "description": "The ID of the comment to mark as not spam.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId", + "commentId" + ], + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "delete": { + "id": "blogger.comments.delete", + "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}", + "httpMethod": "DELETE", + "description": "Delete a comment by id.", + "parameters": { + "blogId": { + "type": "string", + "description": "The Id of the Blog.", + "required": true, + "location": "path" + }, + "commentId": { + "type": "string", + "description": "The ID of the comment to delete.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId", + "commentId" + ], + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "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", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "list": { + "id": "blogger.comments.list", + "path": "blogs/{blogId}/posts/{postId}/comments", + "httpMethod": "GET", + "description": "Retrieves the comments for a post, possibly filtered.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch comments from.", + "required": true, + "location": "path" + }, + "endDate": { + "type": "string", + "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.", + "format": "date-time", + "location": "query" + }, + "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" + }, + "statuses": { + "type": "string", + "enum": [ + "emptied", + "live", + "pending", + "spam" + ], + "enumDescriptions": [ + "Comments that have had their content removed", + "Comments that are publicly visible", + "Comments that are awaiting administrator approval", + "Comments marked as spam by the administrator" + ], + "repeated": true, + "location": "query" + }, + "view": { + "type": "string", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Admin level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "response": { + "$ref": "CommentList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "listByBlog": { + "id": "blogger.comments.listByBlog", + "path": "blogs/{blogId}/comments", + "httpMethod": "GET", + "description": "Retrieves the comments for a blog, across all posts, possibly filtered.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch comments from.", + "required": true, + "location": "path" + }, + "endDate": { + "type": "string", + "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.", + "format": "date-time", + "location": "query" + }, + "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" + }, + "startDate": { + "type": "string", + "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.", + "format": "date-time", + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "response": { + "$ref": "CommentList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "markAsSpam": { + "id": "blogger.comments.markAsSpam", + "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam", + "httpMethod": "POST", + "description": "Marks a comment as spam.", + "parameters": { + "blogId": { + "type": "string", + "description": "The Id of the Blog.", + "required": true, + "location": "path" + }, + "commentId": { + "type": "string", + "description": "The ID of the comment to mark as spam.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId", + "commentId" + ], + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "removeContent": { + "id": "blogger.comments.removeContent", + "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent", + "httpMethod": "POST", + "description": "Removes the content of a comment.", + "parameters": { + "blogId": { + "type": "string", + "description": "The Id of the Blog.", + "required": true, + "location": "path" + }, + "commentId": { + "type": "string", + "description": "The ID of the comment to delete content from.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId", + "commentId" + ], + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + } + } + }, + "pageViews": { + "methods": { + "get": { + "id": "blogger.pageViews.get", + "path": "blogs/{blogId}/pageviews", + "httpMethod": "GET", + "description": "Retrieve pageview stats for a Blog.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the blog to get.", + "required": true, + "location": "path" + }, + "range": { + "type": "string", + "enum": [ + "30DAYS", + "7DAYS", + "all" + ], + "enumDescriptions": [ + "Page view counts from the last thirty days.", + "Page view counts from the last seven days.", + "Total page view counts from all time." + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "response": { + "$ref": "Pageviews" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + } + } + }, + "pages": { + "methods": { + "delete": { + "id": "blogger.pages.delete", + "path": "blogs/{blogId}/pages/{pageId}", + "httpMethod": "DELETE", + "description": "Delete a page by id.", + "parameters": { + "blogId": { + "type": "string", + "description": "The Id of the Blog.", + "required": true, + "location": "path" + }, + "pageId": { + "type": "string", + "description": "The ID of the Page.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "pageId" + ], + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "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" + }, + "view": { + "type": "string", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Admin level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "pageId" + ], + "response": { + "$ref": "Page" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "insert": { + "id": "blogger.pages.insert", + "path": "blogs/{blogId}/pages", + "httpMethod": "POST", + "description": "Add a page.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to add the page to.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId" + ], + "request": { + "$ref": "Page" + }, + "response": { + "$ref": "Page" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "list": { + "id": "blogger.pages.list", + "path": "blogs/{blogId}/pages", + "httpMethod": "GET", + "description": "Retrieves the pages for a blog, optionally including non-LIVE statuses.", + "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" + }, + "statuses": { + "type": "string", + "enum": [ + "draft", + "imported", + "live" + ], + "enumDescriptions": [ + "Draft (unpublished) Pages", + "Pages that have had their content removed", + "Pages that are publicly visible" + ], + "repeated": true, + "location": "query" + }, + "view": { + "type": "string", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Admin level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "response": { + "$ref": "PageList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "patch": { + "id": "blogger.pages.patch", + "path": "blogs/{blogId}/pages/{pageId}", + "httpMethod": "PATCH", + "description": "Update a page. This method supports patch semantics.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the Blog.", + "required": true, + "location": "path" + }, + "pageId": { + "type": "string", + "description": "The ID of the Page.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "pageId" + ], + "request": { + "$ref": "Page" + }, + "response": { + "$ref": "Page" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "update": { + "id": "blogger.pages.update", + "path": "blogs/{blogId}/pages/{pageId}", + "httpMethod": "PUT", + "description": "Update a page.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the Blog.", + "required": true, + "location": "path" + }, + "pageId": { + "type": "string", + "description": "The ID of the Page.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "pageId" + ], + "request": { + "$ref": "Page" + }, + "response": { + "$ref": "Page" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + } + } + }, + "postUserInfos": { + "methods": { + "get": { + "id": "blogger.postUserInfos.get", + "path": "users/{userId}/blogs/{blogId}/posts/{postId}", + "httpMethod": "GET", + "description": "Gets one post and user info pair by postId and userId.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the blog.", + "required": true, + "location": "path" + }, + "maxComments": { + "type": "integer", + "description": "Maximum number of comments to pull back on a post.", + "format": "uint32", + "location": "query" + }, + "postId": { + "type": "string", + "description": "The ID of the post to get.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "blogId", + "postId" + ], + "response": { + "$ref": "PostUserInfo" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "list": { + "id": "blogger.postUserInfos.list", + "path": "users/{userId}/blogs/{blogId}/posts", + "httpMethod": "GET", + "description": "Retrieves a list of post and user info pairs, possibly filtered.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch posts from.", + "required": true, + "location": "path" + }, + "endDate": { + "type": "string", + "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.", + "format": "date-time", + "location": "query" + }, + "fetchBodies": { + "type": "boolean", + "description": "Whether the body content of posts is included.", + "location": "query" + }, + "labels": { + "type": "string", + "description": "Comma-separated list of labels to search for.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of posts to fetch.", + "format": "uint32", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sort search results", + "default": "PUBLISHED", + "enum": [ + "published", + "updated" + ], + "enumDescriptions": [ + "Order by the date the post was published", + "Order by the date the post was last updated" + ], + "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" + }, + "statuses": { + "type": "string", + "enum": [ + "draft", + "live", + "scheduled" + ], + "enumDescriptions": [ + "Draft posts", + "Published posts", + "Posts that are scheduled to publish in future." + ], + "repeated": true, + "location": "query" + }, + "userId": { + "type": "string", + "description": "ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + "required": true, + "location": "path" + }, + "view": { + "type": "string", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Reader level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "userId", + "blogId" + ], + "response": { + "$ref": "PostUserInfosList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + } + } + }, + "posts": { + "methods": { + "delete": { + "id": "blogger.posts.delete", + "path": "blogs/{blogId}/posts/{postId}", + "httpMethod": "DELETE", + "description": "Delete a post by id.", + "parameters": { + "blogId": { + "type": "string", + "description": "The Id of the Blog.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "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" + }, + "maxComments": { + "type": "integer", + "description": "Maximum number of comments to pull back on a post.", + "format": "uint32", + "location": "query" + }, + "postId": { + "type": "string", + "description": "The ID of the post", + "required": true, + "location": "path" + }, + "view": { + "type": "string", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Admin level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "response": { + "$ref": "Post" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "getByPath": { + "id": "blogger.posts.getByPath", + "path": "blogs/{blogId}/posts/bypath", + "httpMethod": "GET", + "description": "Retrieve a Post by Path.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch the post from.", + "required": true, + "location": "path" + }, + "maxComments": { + "type": "integer", + "description": "Maximum number of comments to pull back on a post.", + "format": "uint32", + "location": "query" + }, + "path": { + "type": "string", + "description": "Path of the Post to retrieve.", + "required": true, + "location": "query" + }, + "view": { + "type": "string", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Admin level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "path" + ], + "response": { + "$ref": "Post" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "insert": { + "id": "blogger.posts.insert", + "path": "blogs/{blogId}/posts", + "httpMethod": "POST", + "description": "Add a post.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to add the post to.", + "required": true, + "location": "path" + }, + "isDraft": { + "type": "boolean", + "description": "Whether to create the post as a draft", + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "request": { + "$ref": "Post" + }, + "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" + }, + "endDate": { + "type": "string", + "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.", + "format": "date-time", + "location": "query" + }, + "fetchBodies": { + "type": "boolean", + "description": "Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.", + "default": "true", + "location": "query" + }, + "fetchImages": { + "type": "boolean", + "description": "Whether image URL metadata for each post is included.", + "location": "query" + }, + "labels": { + "type": "string", + "description": "Comma-separated list of labels to search for.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of posts to fetch.", + "format": "uint32", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sort search results", + "default": "PUBLISHED", + "enum": [ + "published", + "updated" + ], + "enumDescriptions": [ + "Order by the date the post was published", + "Order by the date the post was last updated" + ], + "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" + }, + "statuses": { + "type": "string", + "enum": [ + "draft", + "live", + "scheduled" + ], + "enumDescriptions": [ + "Draft posts", + "Published posts", + "Posts that are scheduled to publish in future." + ], + "repeated": true, + "location": "query" + }, + "view": { + "type": "string", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Reader level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "response": { + "$ref": "PostList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "patch": { + "id": "blogger.posts.patch", + "path": "blogs/{blogId}/posts/{postId}", + "httpMethod": "PATCH", + "description": "Update a post. This method supports patch semantics.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the Blog.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "request": { + "$ref": "Post" + }, + "response": { + "$ref": "Post" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "publish": { + "id": "blogger.posts.publish", + "path": "blogs/{blogId}/posts/{postId}/publish", + "httpMethod": "POST", + "description": "Publish a draft post.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the Blog.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + }, + "publishDate": { + "type": "string", + "description": "The date and time to schedule the publishing of the Blog.", + "format": "date-time", + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "response": { + "$ref": "Post" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "revert": { + "id": "blogger.posts.revert", + "path": "blogs/{blogId}/posts/{postId}/revert", + "httpMethod": "POST", + "description": "Revert a published or scheduled post to draft state.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the Blog.", + "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" + ] + }, + "search": { + "id": "blogger.posts.search", + "path": "blogs/{blogId}/posts/search", + "httpMethod": "GET", + "description": "Search for a post.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch the post from.", + "required": true, + "location": "path" + }, + "fetchBodies": { + "type": "boolean", + "description": "Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.", + "default": "true", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sort search results", + "default": "PUBLISHED", + "enum": [ + "published", + "updated" + ], + "enumDescriptions": [ + "Order by the date the post was published", + "Order by the date the post was last updated" + ], + "location": "query" + }, + "q": { + "type": "string", + "description": "Query terms to search this blog for matching posts.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "q" + ], + "response": { + "$ref": "PostList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "update": { + "id": "blogger.posts.update", + "path": "blogs/{blogId}/posts/{postId}", + "httpMethod": "PUT", + "description": "Update a post.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the Blog.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "request": { + "$ref": "Post" + }, + "response": { + "$ref": "Post" + }, + "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", + "https://www.googleapis.com/auth/blogger.readonly" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/blogger-3.want b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/blogger-3.want new file mode 100644 index 0000000000000..5936bf97dc4bc --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/blogger-3.want @@ -0,0 +1,3860 @@ +// Package blogger provides access to the Blogger API. +// +// See https://developers.google.com/blogger/docs/3.0/getting_started +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/blogger/v3" +// ... +// bloggerService, err := blogger.New(oauthHttpClient) +package blogger + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "blogger:v3" +const apiName = "blogger" +const apiVersion = "v3" +const basePath = "https://www.googleapis.com/blogger/v3/" + +// OAuth2 scopes used by this API. +const ( + // Manage your Blogger account + BloggerScope = "https://www.googleapis.com/auth/blogger" + + // View your Blogger account + BloggerReadonlyScope = "https://www.googleapis.com/auth/blogger.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.BlogUserInfos = NewBlogUserInfosService(s) + s.Blogs = NewBlogsService(s) + s.Comments = NewCommentsService(s) + s.PageViews = NewPageViewsService(s) + s.Pages = NewPagesService(s) + s.PostUserInfos = NewPostUserInfosService(s) + s.Posts = NewPostsService(s) + s.Users = NewUsersService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + BlogUserInfos *BlogUserInfosService + + Blogs *BlogsService + + Comments *CommentsService + + PageViews *PageViewsService + + Pages *PagesService + + PostUserInfos *PostUserInfosService + + Posts *PostsService + + Users *UsersService +} + +func NewBlogUserInfosService(s *Service) *BlogUserInfosService { + rs := &BlogUserInfosService{s: s} + return rs +} + +type BlogUserInfosService struct { + s *Service +} + +func NewBlogsService(s *Service) *BlogsService { + rs := &BlogsService{s: s} + return rs +} + +type BlogsService struct { + s *Service +} + +func NewCommentsService(s *Service) *CommentsService { + rs := &CommentsService{s: s} + return rs +} + +type CommentsService struct { + s *Service +} + +func NewPageViewsService(s *Service) *PageViewsService { + rs := &PageViewsService{s: s} + return rs +} + +type PageViewsService struct { + s *Service +} + +func NewPagesService(s *Service) *PagesService { + rs := &PagesService{s: s} + return rs +} + +type PagesService struct { + s *Service +} + +func NewPostUserInfosService(s *Service) *PostUserInfosService { + rs := &PostUserInfosService{s: s} + return rs +} + +type PostUserInfosService struct { + s *Service +} + +func NewPostsService(s *Service) *PostsService { + rs := &PostsService{s: s} + return rs +} + +type PostsService struct { + s *Service +} + +func NewUsersService(s *Service) *UsersService { + rs := &UsersService{s: s} + return rs +} + +type UsersService struct { + s *Service +} + +type Blog struct { + // CustomMetaData: The JSON custom meta-data for the Blog + CustomMetaData string `json:"customMetaData,omitempty"` + + // Description: The description of this blog. This is displayed + // underneath the title. + Description string `json:"description,omitempty"` + + // Id: The identifier for this resource. + Id string `json:"id,omitempty"` + + // Kind: The kind of this entry. Always blogger#blog + Kind string `json:"kind,omitempty"` + + // Locale: The locale this Blog is set to. + Locale *BlogLocale `json:"locale,omitempty"` + + // Name: The name of this blog. This is displayed as the title. + Name string `json:"name,omitempty"` + + // Pages: The container of pages in this blog. + Pages *BlogPages `json:"pages,omitempty"` + + // Posts: The container of posts in this blog. + Posts *BlogPosts `json:"posts,omitempty"` + + // Published: RFC 3339 date-time when this blog was published. + Published string `json:"published,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Updated: RFC 3339 date-time when this blog was last updated. + Updated string `json:"updated,omitempty"` + + // Url: The URL where this blog is published. + Url string `json:"url,omitempty"` +} + +type BlogLocale struct { + // Country: The country this blog's locale is set to. + Country string `json:"country,omitempty"` + + // Language: The language this blog is authored in. + Language string `json:"language,omitempty"` + + // Variant: The language variant this blog is authored in. + Variant string `json:"variant,omitempty"` +} + +type BlogPages struct { + // SelfLink: The URL of the container for pages in this blog. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: The count of pages in this blog. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type BlogPosts struct { + // Items: The List of Posts for this Blog. + Items []*Post `json:"items,omitempty"` + + // SelfLink: The URL of the container for posts in this blog. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: The count of posts in this blog. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type BlogList struct { + // BlogUserInfos: Admin level list of blog per-user information + BlogUserInfos []*BlogUserInfo `json:"blogUserInfos,omitempty"` + + // Items: The list of Blogs this user has Authorship or Admin rights + // over. + Items []*Blog `json:"items,omitempty"` + + // Kind: The kind of this entity. Always blogger#blogList + Kind string `json:"kind,omitempty"` +} + +type BlogPerUserInfo struct { + // BlogId: ID of the Blog resource + BlogId string `json:"blogId,omitempty"` + + // HasAdminAccess: True if the user has Admin level access to the blog. + HasAdminAccess bool `json:"hasAdminAccess,omitempty"` + + // Kind: The kind of this entity. Always blogger#blogPerUserInfo + Kind string `json:"kind,omitempty"` + + // PhotosAlbumKey: The Photo Album Key for the user when adding photos + // to the blog + PhotosAlbumKey string `json:"photosAlbumKey,omitempty"` + + // UserId: ID of the User + UserId string `json:"userId,omitempty"` +} + +type BlogUserInfo struct { + // Blog: The Blog resource. + Blog *Blog `json:"blog,omitempty"` + + // Blog_user_info: Information about a User for the Blog. + Blog_user_info *BlogPerUserInfo `json:"blog_user_info,omitempty"` + + // Kind: The kind of this entity. Always blogger#blogUserInfo + Kind string `json:"kind,omitempty"` +} + +type Comment struct { + // Author: The author of this Comment. + Author *CommentAuthor `json:"author,omitempty"` + + // Blog: Data about the blog containing this comment. + Blog *CommentBlog `json:"blog,omitempty"` + + // Content: The actual content of the comment. May include HTML markup. + Content string `json:"content,omitempty"` + + // Id: The identifier for this resource. + Id string `json:"id,omitempty"` + + // InReplyTo: Data about the comment this is in reply to. + InReplyTo *CommentInReplyTo `json:"inReplyTo,omitempty"` + + // Kind: The kind of this entry. Always blogger#comment + Kind string `json:"kind,omitempty"` + + // Post: Data about the post containing this comment. + Post *CommentPost `json:"post,omitempty"` + + // Published: RFC 3339 date-time when this comment was published. + Published string `json:"published,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Status: The status of the comment (only populated for admin users) + Status string `json:"status,omitempty"` + + // Updated: RFC 3339 date-time when this comment was last updated. + Updated string `json:"updated,omitempty"` +} + +type CommentAuthor struct { + // DisplayName: The display name. + DisplayName string `json:"displayName,omitempty"` + + // Id: The identifier of the Comment creator. + Id string `json:"id,omitempty"` + + // Image: The comment creator's avatar. + Image *CommentAuthorImage `json:"image,omitempty"` + + // Url: The URL of the Comment creator's Profile page. + Url string `json:"url,omitempty"` +} + +type CommentAuthorImage struct { + // Url: The comment creator's avatar URL. + Url string `json:"url,omitempty"` +} + +type CommentBlog struct { + // Id: The identifier of the blog containing this comment. + Id string `json:"id,omitempty"` +} + +type CommentInReplyTo struct { + // Id: The identified of the parent of this comment. + Id string `json:"id,omitempty"` +} + +type CommentPost struct { + // Id: The identifier of the post containing this comment. + Id string `json:"id,omitempty"` +} + +type CommentList struct { + // Items: The List of Comments for a Post. + Items []*Comment `json:"items,omitempty"` + + // Kind: The kind of this entry. Always blogger#commentList + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to fetch the next page, if one + // exists. + NextPageToken string `json:"nextPageToken,omitempty"` + + // PrevPageToken: Pagination token to fetch the previous page, if one + // exists. + PrevPageToken string `json:"prevPageToken,omitempty"` +} + +type Page struct { + // Author: The author of this Page. + Author *PageAuthor `json:"author,omitempty"` + + // Blog: Data about the blog containing this Page. + Blog *PageBlog `json:"blog,omitempty"` + + // Content: The body content of this Page, in HTML. + Content string `json:"content,omitempty"` + + // Id: The identifier for this resource. + Id string `json:"id,omitempty"` + + // Kind: The kind of this entity. Always blogger#page + Kind string `json:"kind,omitempty"` + + // Published: RFC 3339 date-time when this Page was published. + Published string `json:"published,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Status: The status of the page for admin resources (either LIVE or + // DRAFT). + Status string `json:"status,omitempty"` + + // Title: The title of this entity. This is the name displayed in the + // Admin user interface. + Title string `json:"title,omitempty"` + + // Updated: RFC 3339 date-time when this Page was last updated. + Updated string `json:"updated,omitempty"` + + // Url: The URL that this Page is displayed at. + Url string `json:"url,omitempty"` +} + +type PageAuthor struct { + // DisplayName: The display name. + DisplayName string `json:"displayName,omitempty"` + + // Id: The identifier of the Page creator. + Id string `json:"id,omitempty"` + + // Image: The page author's avatar. + Image *PageAuthorImage `json:"image,omitempty"` + + // Url: The URL of the Page creator's Profile page. + Url string `json:"url,omitempty"` +} + +type PageAuthorImage struct { + // Url: The page author's avatar URL. + Url string `json:"url,omitempty"` +} + +type PageBlog struct { + // Id: The identifier of the blog containing this page. + Id string `json:"id,omitempty"` +} + +type PageList struct { + // Items: The list of Pages for a Blog. + Items []*Page `json:"items,omitempty"` + + // Kind: The kind of this entity. Always blogger#pageList + Kind string `json:"kind,omitempty"` +} + +type Pageviews struct { + // BlogId: Blog Id + BlogId int64 `json:"blogId,omitempty,string"` + + // Counts: The container of posts in this blog. + Counts []*PageviewsCounts `json:"counts,omitempty"` + + // Kind: The kind of this entry. Always blogger#page_views + Kind string `json:"kind,omitempty"` +} + +type PageviewsCounts struct { + // Count: Count of page views for the given time range + Count int64 `json:"count,omitempty,string"` + + // TimeRange: Time range the given count applies to + TimeRange string `json:"timeRange,omitempty"` +} + +type Post struct { + // Author: The author of this Post. + Author *PostAuthor `json:"author,omitempty"` + + // Blog: Data about the blog containing this Post. + Blog *PostBlog `json:"blog,omitempty"` + + // Content: The content of the Post. May contain HTML markup. + Content string `json:"content,omitempty"` + + // CustomMetaData: The JSON meta-data for the Post. + CustomMetaData string `json:"customMetaData,omitempty"` + + // Id: The identifier of this Post. + Id string `json:"id,omitempty"` + + // Images: Display image for the Post. + Images []*PostImages `json:"images,omitempty"` + + // Kind: The kind of this entity. Always blogger#post + Kind string `json:"kind,omitempty"` + + // Labels: The list of labels this Post was tagged with. + Labels []string `json:"labels,omitempty"` + + // Location: The location for geotagged posts. + Location *PostLocation `json:"location,omitempty"` + + // Published: RFC 3339 date-time when this Post was published. + Published string `json:"published,omitempty"` + + // Replies: The container of comments on this Post. + Replies *PostReplies `json:"replies,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Status: Status of the post. Only set for admin-level requests + Status string `json:"status,omitempty"` + + // Title: The title of the Post. + Title string `json:"title,omitempty"` + + // TitleLink: The title link URL, similar to atom's related link. + TitleLink string `json:"titleLink,omitempty"` + + // Updated: RFC 3339 date-time when this Post was last updated. + Updated string `json:"updated,omitempty"` + + // Url: The URL where this Post is displayed. + Url string `json:"url,omitempty"` +} + +type PostAuthor struct { + // DisplayName: The display name. + DisplayName string `json:"displayName,omitempty"` + + // Id: The identifier of the Post creator. + Id string `json:"id,omitempty"` + + // Image: The Post author's avatar. + Image *PostAuthorImage `json:"image,omitempty"` + + // Url: The URL of the Post creator's Profile page. + Url string `json:"url,omitempty"` +} + +type PostAuthorImage struct { + // Url: The Post author's avatar URL. + Url string `json:"url,omitempty"` +} + +type PostBlog struct { + // Id: The identifier of the Blog that contains this Post. + Id string `json:"id,omitempty"` +} + +type PostImages struct { + Url string `json:"url,omitempty"` +} + +type PostLocation struct { + // Lat: Location's latitude. + Lat float64 `json:"lat,omitempty"` + + // Lng: Location's longitude. + Lng float64 `json:"lng,omitempty"` + + // Name: Location name. + Name string `json:"name,omitempty"` + + // Span: Location's viewport span. Can be used when rendering a map + // preview. + Span string `json:"span,omitempty"` +} + +type PostReplies struct { + // Items: The List of Comments for this Post. + Items []*Comment `json:"items,omitempty"` + + // SelfLink: The URL of the comments on this post. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: The count of comments on this post. + TotalItems int64 `json:"totalItems,omitempty,string"` +} + +type PostList struct { + // Items: The list of Posts for this Blog. + Items []*Post `json:"items,omitempty"` + + // Kind: The kind of this entity. Always blogger#postList + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to fetch the next page, if one + // exists. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type PostPerUserInfo struct { + // BlogId: ID of the Blog that the post resource belongs to. + BlogId string `json:"blogId,omitempty"` + + // HasEditAccess: True if the user has Author level access to the post. + HasEditAccess bool `json:"hasEditAccess,omitempty"` + + // Kind: The kind of this entity. Always blogger#postPerUserInfo + Kind string `json:"kind,omitempty"` + + // PostId: ID of the Post resource. + PostId string `json:"postId,omitempty"` + + // UserId: ID of the User. + UserId string `json:"userId,omitempty"` +} + +type PostUserInfo struct { + // Kind: The kind of this entity. Always blogger#postUserInfo + Kind string `json:"kind,omitempty"` + + // Post: The Post resource. + Post *Post `json:"post,omitempty"` + + // Post_user_info: Information about a User for the Post. + Post_user_info *PostPerUserInfo `json:"post_user_info,omitempty"` +} + +type PostUserInfosList struct { + // Items: The list of Posts with User information for the post, for this + // Blog. + Items []*PostUserInfo `json:"items,omitempty"` + + // Kind: The kind of this entity. Always blogger#postList + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to fetch the next page, if one + // exists. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type User struct { + // About: Profile summary information. + About string `json:"about,omitempty"` + + // Blogs: The container of blogs for this user. + Blogs *UserBlogs `json:"blogs,omitempty"` + + // Created: The timestamp of when this profile was created, in seconds + // since epoch. + Created string `json:"created,omitempty"` + + // DisplayName: The display name. + DisplayName string `json:"displayName,omitempty"` + + // Id: The identifier for this User. + Id string `json:"id,omitempty"` + + // Kind: The kind of this entity. Always blogger#user + Kind string `json:"kind,omitempty"` + + // Locale: This user's locale + Locale *UserLocale `json:"locale,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Url: The user's profile page. + Url string `json:"url,omitempty"` +} + +type UserBlogs struct { + // SelfLink: The URL of the Blogs for this user. + SelfLink string `json:"selfLink,omitempty"` +} + +type UserLocale struct { + // Country: The user's country setting. + Country string `json:"country,omitempty"` + + // Language: The user's language setting. + Language string `json:"language,omitempty"` + + // Variant: The user's language variant setting. + Variant string `json:"variant,omitempty"` +} + +// method id "blogger.blogUserInfos.get": + +type BlogUserInfosGetCall struct { + s *Service + userId string + blogId string + opt_ map[string]interface{} +} + +// Get: Gets one blog and user info pair by blogId and userId. +func (r *BlogUserInfosService) Get(userId string, blogId string) *BlogUserInfosGetCall { + c := &BlogUserInfosGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.blogId = blogId + return c +} + +// MaxPosts sets the optional parameter "maxPosts": Maximum number of +// posts to pull back with the blog. +func (c *BlogUserInfosGetCall) MaxPosts(maxPosts int64) *BlogUserInfosGetCall { + c.opt_["maxPosts"] = maxPosts + return c +} + +func (c *BlogUserInfosGetCall) Do() (*BlogUserInfo, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxPosts"]; ok { + params.Set("maxPosts", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BlogUserInfo) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one blog and user info pair by blogId and userId.", + // "httpMethod": "GET", + // "id": "blogger.blogUserInfos.get", + // "parameterOrder": [ + // "userId", + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the blog to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxPosts": { + // "description": "Maximum number of posts to pull back with the blog.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "userId": { + // "description": "ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userId}/blogs/{blogId}", + // "response": { + // "$ref": "BlogUserInfo" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.blogs.get": + +type BlogsGetCall struct { + s *Service + blogId string + opt_ map[string]interface{} +} + +// Get: Gets one blog by id. +func (r *BlogsService) Get(blogId string) *BlogsGetCall { + c := &BlogsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + return c +} + +// MaxPosts sets the optional parameter "maxPosts": Maximum number of +// posts to pull back with the blog. +func (c *BlogsGetCall) MaxPosts(maxPosts int64) *BlogsGetCall { + c.opt_["maxPosts"] = maxPosts + return c +} + +func (c *BlogsGetCall) Do() (*Blog, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxPosts"]; ok { + params.Set("maxPosts", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Blog) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one blog by id.", + // "httpMethod": "GET", + // "id": "blogger.blogs.get", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the blog to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxPosts": { + // "description": "Maximum number of posts to pull back with the blog.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // } + // }, + // "path": "blogs/{blogId}", + // "response": { + // "$ref": "Blog" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.blogs.getByUrl": + +type BlogsGetByUrlCall struct { + s *Service + url string + opt_ map[string]interface{} +} + +// GetByUrl: Retrieve a Blog by URL. +func (r *BlogsService) GetByUrl(url string) *BlogsGetByUrlCall { + c := &BlogsGetByUrlCall{s: r.s, opt_: make(map[string]interface{})} + c.url = url + return c +} + +func (c *BlogsGetByUrlCall) Do() (*Blog, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("url", fmt.Sprintf("%v", c.url)) + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/byurl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Blog) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve a Blog by URL.", + // "httpMethod": "GET", + // "id": "blogger.blogs.getByUrl", + // "parameterOrder": [ + // "url" + // ], + // "parameters": { + // "url": { + // "description": "The URL of the blog to retrieve.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/byurl", + // "response": { + // "$ref": "Blog" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.blogs.listByUser": + +type BlogsListByUserCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// ListByUser: Retrieves a list of blogs, possibly filtered. +func (r *BlogsService) ListByUser(userId string) *BlogsListByUserCall { + c := &BlogsListByUserCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// FetchUserInfo sets the optional parameter "fetchUserInfo": Whether +// the response is a list of blogs with per-user information instead of +// just blogs. +func (c *BlogsListByUserCall) FetchUserInfo(fetchUserInfo bool) *BlogsListByUserCall { + c.opt_["fetchUserInfo"] = fetchUserInfo + return c +} + +// View sets the optional parameter "view": +func (c *BlogsListByUserCall) View(view string) *BlogsListByUserCall { + c.opt_["view"] = view + return c +} + +func (c *BlogsListByUserCall) Do() (*BlogList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["fetchUserInfo"]; ok { + params.Set("fetchUserInfo", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BlogList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of blogs, possibly filtered.", + // "httpMethod": "GET", + // "id": "blogger.blogs.listByUser", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "fetchUserInfo": { + // "description": "Whether the response is a list of blogs with per-user information instead of just blogs.", + // "location": "query", + // "type": "boolean" + // }, + // "userId": { + // "description": "ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "view": { + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Admin level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "users/{userId}/blogs", + // "response": { + // "$ref": "BlogList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.comments.approve": + +type CommentsApproveCall struct { + s *Service + blogId string + postId string + commentId string + opt_ map[string]interface{} +} + +// Approve: Marks a comment as not spam. +func (r *CommentsService) Approve(blogId string, postId string, commentId string) *CommentsApproveCall { + c := &CommentsApproveCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.commentId = commentId + return c +} + +func (c *CommentsApproveCall) Do() (*Comment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Marks a comment as not spam.", + // "httpMethod": "POST", + // "id": "blogger.comments.approve", + // "parameterOrder": [ + // "blogId", + // "postId", + // "commentId" + // ], + // "parameters": { + // "blogId": { + // "description": "The Id of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "commentId": { + // "description": "The ID of the comment to mark as not spam.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve", + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.comments.delete": + +type CommentsDeleteCall struct { + s *Service + blogId string + postId string + commentId string + opt_ map[string]interface{} +} + +// Delete: Delete a comment by id. +func (r *CommentsService) Delete(blogId string, postId string, commentId string) *CommentsDeleteCall { + c := &CommentsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.commentId = commentId + return c +} + +func (c *CommentsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a comment by id.", + // "httpMethod": "DELETE", + // "id": "blogger.comments.delete", + // "parameterOrder": [ + // "blogId", + // "postId", + // "commentId" + // ], + // "parameters": { + // "blogId": { + // "description": "The Id of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "commentId": { + // "description": "The ID of the comment to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}", + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.comments.get": + +type CommentsGetCall struct { + s *Service + blogId string + postId string + commentId string + opt_ map[string]interface{} +} + +// Get: Gets one comment by id. +func (r *CommentsService) Get(blogId string, postId string, commentId string) *CommentsGetCall { + c := &CommentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.commentId = commentId + return c +} + +func (c *CommentsGetCall) Do() (*Comment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one comment by id.", + // "httpMethod": "GET", + // "id": "blogger.comments.get", + // "parameterOrder": [ + // "blogId", + // "postId", + // "commentId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to containing the comment.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "commentId": { + // "description": "The ID of the comment to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "ID of the post to fetch posts from.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}", + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.comments.list": + +type CommentsListCall struct { + s *Service + blogId string + postId string + opt_ map[string]interface{} +} + +// List: Retrieves the comments for a post, possibly filtered. +func (r *CommentsService) List(blogId string, postId string) *CommentsListCall { + c := &CommentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + return c +} + +// EndDate sets the optional parameter "endDate": Latest date of comment +// to fetch, a date-time with RFC 3339 formatting. +func (c *CommentsListCall) EndDate(endDate string) *CommentsListCall { + c.opt_["endDate"] = endDate + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether the +// body content of the comments is included. +func (c *CommentsListCall) FetchBodies(fetchBodies bool) *CommentsListCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of comments to include in the result. +func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// if request is paged. +func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartDate sets the optional parameter "startDate": Earliest date of +// comment to fetch, a date-time with RFC 3339 formatting. +func (c *CommentsListCall) StartDate(startDate string) *CommentsListCall { + c.opt_["startDate"] = startDate + return c +} + +// Statuses sets the optional parameter "statuses": +func (c *CommentsListCall) Statuses(statuses string) *CommentsListCall { + c.opt_["statuses"] = statuses + return c +} + +// View sets the optional parameter "view": +func (c *CommentsListCall) View(view string) *CommentsListCall { + c.opt_["view"] = view + return c +} + +func (c *CommentsListCall) Do() (*CommentList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["endDate"]; ok { + params.Set("endDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startDate"]; ok { + params.Set("startDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["statuses"]; ok { + params.Set("statuses", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommentList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the comments for a post, possibly filtered.", + // "httpMethod": "GET", + // "id": "blogger.comments.list", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch comments from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "endDate": { + // "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "fetchBodies": { + // "description": "Whether the body content of the comments is included.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "Maximum number of comments to include in the result.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token if request is paged.", + // "location": "query", + // "type": "string" + // }, + // "postId": { + // "description": "ID of the post to fetch posts from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startDate": { + // "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "statuses": { + // "enum": [ + // "emptied", + // "live", + // "pending", + // "spam" + // ], + // "enumDescriptions": [ + // "Comments that have had their content removed", + // "Comments that are publicly visible", + // "Comments that are awaiting administrator approval", + // "Comments marked as spam by the administrator" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "view": { + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Admin level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments", + // "response": { + // "$ref": "CommentList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.comments.listByBlog": + +type CommentsListByBlogCall struct { + s *Service + blogId string + opt_ map[string]interface{} +} + +// ListByBlog: Retrieves the comments for a blog, across all posts, +// possibly filtered. +func (r *CommentsService) ListByBlog(blogId string) *CommentsListByBlogCall { + c := &CommentsListByBlogCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + return c +} + +// EndDate sets the optional parameter "endDate": Latest date of comment +// to fetch, a date-time with RFC 3339 formatting. +func (c *CommentsListByBlogCall) EndDate(endDate string) *CommentsListByBlogCall { + c.opt_["endDate"] = endDate + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether the +// body content of the comments is included. +func (c *CommentsListByBlogCall) FetchBodies(fetchBodies bool) *CommentsListByBlogCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of comments to include in the result. +func (c *CommentsListByBlogCall) MaxResults(maxResults int64) *CommentsListByBlogCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// if request is paged. +func (c *CommentsListByBlogCall) PageToken(pageToken string) *CommentsListByBlogCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartDate sets the optional parameter "startDate": Earliest date of +// comment to fetch, a date-time with RFC 3339 formatting. +func (c *CommentsListByBlogCall) StartDate(startDate string) *CommentsListByBlogCall { + c.opt_["startDate"] = startDate + return c +} + +func (c *CommentsListByBlogCall) Do() (*CommentList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["endDate"]; ok { + params.Set("endDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startDate"]; ok { + params.Set("startDate", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommentList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the comments for a blog, across all posts, possibly filtered.", + // "httpMethod": "GET", + // "id": "blogger.comments.listByBlog", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch comments from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "endDate": { + // "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "fetchBodies": { + // "description": "Whether the body content of the comments is included.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "Maximum number of comments to include in the result.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token if request is paged.", + // "location": "query", + // "type": "string" + // }, + // "startDate": { + // "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/comments", + // "response": { + // "$ref": "CommentList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.comments.markAsSpam": + +type CommentsMarkAsSpamCall struct { + s *Service + blogId string + postId string + commentId string + opt_ map[string]interface{} +} + +// MarkAsSpam: Marks a comment as spam. +func (r *CommentsService) MarkAsSpam(blogId string, postId string, commentId string) *CommentsMarkAsSpamCall { + c := &CommentsMarkAsSpamCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.commentId = commentId + return c +} + +func (c *CommentsMarkAsSpamCall) Do() (*Comment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Marks a comment as spam.", + // "httpMethod": "POST", + // "id": "blogger.comments.markAsSpam", + // "parameterOrder": [ + // "blogId", + // "postId", + // "commentId" + // ], + // "parameters": { + // "blogId": { + // "description": "The Id of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "commentId": { + // "description": "The ID of the comment to mark as spam.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam", + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.comments.removeContent": + +type CommentsRemoveContentCall struct { + s *Service + blogId string + postId string + commentId string + opt_ map[string]interface{} +} + +// RemoveContent: Removes the content of a comment. +func (r *CommentsService) RemoveContent(blogId string, postId string, commentId string) *CommentsRemoveContentCall { + c := &CommentsRemoveContentCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.commentId = commentId + return c +} + +func (c *CommentsRemoveContentCall) Do() (*Comment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes the content of a comment.", + // "httpMethod": "POST", + // "id": "blogger.comments.removeContent", + // "parameterOrder": [ + // "blogId", + // "postId", + // "commentId" + // ], + // "parameters": { + // "blogId": { + // "description": "The Id of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "commentId": { + // "description": "The ID of the comment to delete content from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent", + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pageViews.get": + +type PageViewsGetCall struct { + s *Service + blogId string + opt_ map[string]interface{} +} + +// Get: Retrieve pageview stats for a Blog. +func (r *PageViewsService) Get(blogId string) *PageViewsGetCall { + c := &PageViewsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + return c +} + +// Range sets the optional parameter "range": +func (c *PageViewsGetCall) Range(range_ string) *PageViewsGetCall { + c.opt_["range"] = range_ + return c +} + +func (c *PageViewsGetCall) Do() (*Pageviews, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["range"]; ok { + params.Set("range", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pageviews") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Pageviews) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve pageview stats for a Blog.", + // "httpMethod": "GET", + // "id": "blogger.pageViews.get", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the blog to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "range": { + // "enum": [ + // "30DAYS", + // "7DAYS", + // "all" + // ], + // "enumDescriptions": [ + // "Page view counts from the last thirty days.", + // "Page view counts from the last seven days.", + // "Total page view counts from all time." + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pageviews", + // "response": { + // "$ref": "Pageviews" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pages.delete": + +type PagesDeleteCall struct { + s *Service + blogId string + pageId string + opt_ map[string]interface{} +} + +// Delete: Delete a page by id. +func (r *PagesService) Delete(blogId string, pageId string) *PagesDeleteCall { + c := &PagesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.pageId = pageId + return c +} + +func (c *PagesDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{pageId}", url.QueryEscape(c.pageId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a page by id.", + // "httpMethod": "DELETE", + // "id": "blogger.pages.delete", + // "parameterOrder": [ + // "blogId", + // "pageId" + // ], + // "parameters": { + // "blogId": { + // "description": "The Id of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageId": { + // "description": "The ID of the Page.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages/{pageId}", + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pages.get": + +type PagesGetCall struct { + s *Service + blogId string + pageId string + opt_ map[string]interface{} +} + +// Get: Gets one blog page by id. +func (r *PagesService) Get(blogId string, pageId string) *PagesGetCall { + c := &PagesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.pageId = pageId + return c +} + +// View sets the optional parameter "view": +func (c *PagesGetCall) View(view string) *PagesGetCall { + c.opt_["view"] = view + return c +} + +func (c *PagesGetCall) Do() (*Page, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{pageId}", url.QueryEscape(c.pageId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Page) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one blog page by id.", + // "httpMethod": "GET", + // "id": "blogger.pages.get", + // "parameterOrder": [ + // "blogId", + // "pageId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog containing the page.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageId": { + // "description": "The ID of the page to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "view": { + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Admin level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages/{pageId}", + // "response": { + // "$ref": "Page" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.pages.insert": + +type PagesInsertCall struct { + s *Service + blogId string + page *Page + opt_ map[string]interface{} +} + +// Insert: Add a page. +func (r *PagesService) Insert(blogId string, page *Page) *PagesInsertCall { + c := &PagesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.page = page + return c +} + +func (c *PagesInsertCall) Do() (*Page, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Page) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add a page.", + // "httpMethod": "POST", + // "id": "blogger.pages.insert", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to add the page to.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages", + // "request": { + // "$ref": "Page" + // }, + // "response": { + // "$ref": "Page" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pages.list": + +type PagesListCall struct { + s *Service + blogId string + opt_ map[string]interface{} +} + +// List: Retrieves the pages for a blog, optionally including non-LIVE +// statuses. +func (r *PagesService) List(blogId string) *PagesListCall { + c := &PagesListCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether to +// retrieve the Page bodies. +func (c *PagesListCall) FetchBodies(fetchBodies bool) *PagesListCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// Statuses sets the optional parameter "statuses": +func (c *PagesListCall) Statuses(statuses string) *PagesListCall { + c.opt_["statuses"] = statuses + return c +} + +// View sets the optional parameter "view": +func (c *PagesListCall) View(view string) *PagesListCall { + c.opt_["view"] = view + return c +} + +func (c *PagesListCall) Do() (*PageList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["statuses"]; ok { + params.Set("statuses", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PageList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the pages for a blog, optionally including non-LIVE statuses.", + // "httpMethod": "GET", + // "id": "blogger.pages.list", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch pages from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fetchBodies": { + // "description": "Whether to retrieve the Page bodies.", + // "location": "query", + // "type": "boolean" + // }, + // "statuses": { + // "enum": [ + // "draft", + // "imported", + // "live" + // ], + // "enumDescriptions": [ + // "Draft (unpublished) Pages", + // "Pages that have had their content removed", + // "Pages that are publicly visible" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "view": { + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Admin level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages", + // "response": { + // "$ref": "PageList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.pages.patch": + +type PagesPatchCall struct { + s *Service + blogId string + pageId string + page *Page + opt_ map[string]interface{} +} + +// Patch: Update a page. This method supports patch semantics. +func (r *PagesService) Patch(blogId string, pageId string, page *Page) *PagesPatchCall { + c := &PagesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.pageId = pageId + c.page = page + return c +} + +func (c *PagesPatchCall) Do() (*Page, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{pageId}", url.QueryEscape(c.pageId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Page) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a page. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "blogger.pages.patch", + // "parameterOrder": [ + // "blogId", + // "pageId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageId": { + // "description": "The ID of the Page.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages/{pageId}", + // "request": { + // "$ref": "Page" + // }, + // "response": { + // "$ref": "Page" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pages.update": + +type PagesUpdateCall struct { + s *Service + blogId string + pageId string + page *Page + opt_ map[string]interface{} +} + +// Update: Update a page. +func (r *PagesService) Update(blogId string, pageId string, page *Page) *PagesUpdateCall { + c := &PagesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.pageId = pageId + c.page = page + return c +} + +func (c *PagesUpdateCall) Do() (*Page, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{pageId}", url.QueryEscape(c.pageId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Page) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a page.", + // "httpMethod": "PUT", + // "id": "blogger.pages.update", + // "parameterOrder": [ + // "blogId", + // "pageId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageId": { + // "description": "The ID of the Page.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages/{pageId}", + // "request": { + // "$ref": "Page" + // }, + // "response": { + // "$ref": "Page" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.postUserInfos.get": + +type PostUserInfosGetCall struct { + s *Service + userId string + blogId string + postId string + opt_ map[string]interface{} +} + +// Get: Gets one post and user info pair by postId and userId. +func (r *PostUserInfosService) Get(userId string, blogId string, postId string) *PostUserInfosGetCall { + c := &PostUserInfosGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.blogId = blogId + c.postId = postId + return c +} + +// MaxComments sets the optional parameter "maxComments": Maximum number +// of comments to pull back on a post. +func (c *PostUserInfosGetCall) MaxComments(maxComments int64) *PostUserInfosGetCall { + c.opt_["maxComments"] = maxComments + return c +} + +func (c *PostUserInfosGetCall) Do() (*PostUserInfo, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxComments"]; ok { + params.Set("maxComments", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PostUserInfo) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one post and user info pair by postId and userId.", + // "httpMethod": "GET", + // "id": "blogger.postUserInfos.get", + // "parameterOrder": [ + // "userId", + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxComments": { + // "description": "Maximum number of comments to pull back on a post.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "postId": { + // "description": "The ID of the post to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userId}/blogs/{blogId}/posts/{postId}", + // "response": { + // "$ref": "PostUserInfo" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.postUserInfos.list": + +type PostUserInfosListCall struct { + s *Service + userId string + blogId string + opt_ map[string]interface{} +} + +// List: Retrieves a list of post and user info pairs, possibly +// filtered. +func (r *PostUserInfosService) List(userId string, blogId string) *PostUserInfosListCall { + c := &PostUserInfosListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.blogId = blogId + return c +} + +// EndDate sets the optional parameter "endDate": Latest post date to +// fetch, a date-time with RFC 3339 formatting. +func (c *PostUserInfosListCall) EndDate(endDate string) *PostUserInfosListCall { + c.opt_["endDate"] = endDate + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether the +// body content of posts is included. +func (c *PostUserInfosListCall) FetchBodies(fetchBodies bool) *PostUserInfosListCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// Labels sets the optional parameter "labels": Comma-separated list of +// labels to search for. +func (c *PostUserInfosListCall) Labels(labels string) *PostUserInfosListCall { + c.opt_["labels"] = labels + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of posts to fetch. +func (c *PostUserInfosListCall) MaxResults(maxResults int64) *PostUserInfosListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sort search results +func (c *PostUserInfosListCall) OrderBy(orderBy string) *PostUserInfosListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// if the request is paged. +func (c *PostUserInfosListCall) PageToken(pageToken string) *PostUserInfosListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartDate sets the optional parameter "startDate": Earliest post date +// to fetch, a date-time with RFC 3339 formatting. +func (c *PostUserInfosListCall) StartDate(startDate string) *PostUserInfosListCall { + c.opt_["startDate"] = startDate + return c +} + +// Statuses sets the optional parameter "statuses": +func (c *PostUserInfosListCall) Statuses(statuses string) *PostUserInfosListCall { + c.opt_["statuses"] = statuses + return c +} + +// View sets the optional parameter "view": +func (c *PostUserInfosListCall) View(view string) *PostUserInfosListCall { + c.opt_["view"] = view + return c +} + +func (c *PostUserInfosListCall) Do() (*PostUserInfosList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["endDate"]; ok { + params.Set("endDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["labels"]; ok { + params.Set("labels", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startDate"]; ok { + params.Set("startDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["statuses"]; ok { + params.Set("statuses", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PostUserInfosList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of post and user info pairs, possibly filtered.", + // "httpMethod": "GET", + // "id": "blogger.postUserInfos.list", + // "parameterOrder": [ + // "userId", + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch posts from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "endDate": { + // "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "fetchBodies": { + // "description": "Whether the body content of posts is included.", + // "location": "query", + // "type": "boolean" + // }, + // "labels": { + // "description": "Comma-separated list of labels to search for.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of posts to fetch.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "orderBy": { + // "default": "PUBLISHED", + // "description": "Sort search results", + // "enum": [ + // "published", + // "updated" + // ], + // "enumDescriptions": [ + // "Order by the date the post was published", + // "Order by the date the post was last updated" + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Continuation token if the request is paged.", + // "location": "query", + // "type": "string" + // }, + // "startDate": { + // "description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "statuses": { + // "enum": [ + // "draft", + // "live", + // "scheduled" + // ], + // "enumDescriptions": [ + // "Draft posts", + // "Published posts", + // "Posts that are scheduled to publish in future." + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "userId": { + // "description": "ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "view": { + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Reader level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "users/{userId}/blogs/{blogId}/posts", + // "response": { + // "$ref": "PostUserInfosList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.posts.delete": + +type PostsDeleteCall struct { + s *Service + blogId string + postId string + opt_ map[string]interface{} +} + +// Delete: Delete a post by id. +func (r *PostsService) Delete(blogId string, postId string) *PostsDeleteCall { + c := &PostsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + return c +} + +func (c *PostsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a post by id.", + // "httpMethod": "DELETE", + // "id": "blogger.posts.delete", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "The Id of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}", + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.posts.get": + +type PostsGetCall struct { + s *Service + blogId string + postId string + opt_ map[string]interface{} +} + +// Get: Get a post by id. +func (r *PostsService) Get(blogId string, postId string) *PostsGetCall { + c := &PostsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + return c +} + +// MaxComments sets the optional parameter "maxComments": Maximum number +// of comments to pull back on a post. +func (c *PostsGetCall) MaxComments(maxComments int64) *PostsGetCall { + c.opt_["maxComments"] = maxComments + return c +} + +// View sets the optional parameter "view": +func (c *PostsGetCall) View(view string) *PostsGetCall { + c.opt_["view"] = view + return c +} + +func (c *PostsGetCall) Do() (*Post, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxComments"]; ok { + params.Set("maxComments", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a post by id.", + // "httpMethod": "GET", + // "id": "blogger.posts.get", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch the post from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxComments": { + // "description": "Maximum number of comments to pull back on a post.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "postId": { + // "description": "The ID of the post", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "view": { + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Admin level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}", + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.posts.getByPath": + +type PostsGetByPathCall struct { + s *Service + blogId string + path string + opt_ map[string]interface{} +} + +// GetByPath: Retrieve a Post by Path. +func (r *PostsService) GetByPath(blogId string, path string) *PostsGetByPathCall { + c := &PostsGetByPathCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.path = path + return c +} + +// MaxComments sets the optional parameter "maxComments": Maximum number +// of comments to pull back on a post. +func (c *PostsGetByPathCall) MaxComments(maxComments int64) *PostsGetByPathCall { + c.opt_["maxComments"] = maxComments + return c +} + +// View sets the optional parameter "view": +func (c *PostsGetByPathCall) View(view string) *PostsGetByPathCall { + c.opt_["view"] = view + return c +} + +func (c *PostsGetByPathCall) Do() (*Post, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("path", fmt.Sprintf("%v", c.path)) + if v, ok := c.opt_["maxComments"]; ok { + params.Set("maxComments", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/bypath") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve a Post by Path.", + // "httpMethod": "GET", + // "id": "blogger.posts.getByPath", + // "parameterOrder": [ + // "blogId", + // "path" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch the post from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxComments": { + // "description": "Maximum number of comments to pull back on a post.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "path": { + // "description": "Path of the Post to retrieve.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "view": { + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Admin level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/bypath", + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.posts.insert": + +type PostsInsertCall struct { + s *Service + blogId string + post *Post + opt_ map[string]interface{} +} + +// Insert: Add a post. +func (r *PostsService) Insert(blogId string, post *Post) *PostsInsertCall { + c := &PostsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.post = post + return c +} + +// IsDraft sets the optional parameter "isDraft": Whether to create the +// post as a draft +func (c *PostsInsertCall) IsDraft(isDraft bool) *PostsInsertCall { + c.opt_["isDraft"] = isDraft + return c +} + +func (c *PostsInsertCall) Do() (*Post, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["isDraft"]; ok { + params.Set("isDraft", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add a post.", + // "httpMethod": "POST", + // "id": "blogger.posts.insert", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to add the post to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "isDraft": { + // "description": "Whether to create the post as a draft", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "blogs/{blogId}/posts", + // "request": { + // "$ref": "Post" + // }, + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.posts.list": + +type PostsListCall struct { + s *Service + blogId string + opt_ map[string]interface{} +} + +// List: Retrieves a list of posts, possibly filtered. +func (r *PostsService) List(blogId string) *PostsListCall { + c := &PostsListCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + return c +} + +// EndDate sets the optional parameter "endDate": Latest post date to +// fetch, a date-time with RFC 3339 formatting. +func (c *PostsListCall) EndDate(endDate string) *PostsListCall { + c.opt_["endDate"] = endDate + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether the +// body content of posts is included (default: true). This should be set +// to false when the post bodies are not required, to help minimize +// traffic. +func (c *PostsListCall) FetchBodies(fetchBodies bool) *PostsListCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// FetchImages sets the optional parameter "fetchImages": Whether image +// URL metadata for each post is included. +func (c *PostsListCall) FetchImages(fetchImages bool) *PostsListCall { + c.opt_["fetchImages"] = fetchImages + return c +} + +// Labels sets the optional parameter "labels": Comma-separated list of +// labels to search for. +func (c *PostsListCall) Labels(labels string) *PostsListCall { + c.opt_["labels"] = labels + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of posts to fetch. +func (c *PostsListCall) MaxResults(maxResults int64) *PostsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sort search results +func (c *PostsListCall) OrderBy(orderBy string) *PostsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// if the request is paged. +func (c *PostsListCall) PageToken(pageToken string) *PostsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartDate sets the optional parameter "startDate": Earliest post date +// to fetch, a date-time with RFC 3339 formatting. +func (c *PostsListCall) StartDate(startDate string) *PostsListCall { + c.opt_["startDate"] = startDate + return c +} + +// Statuses sets the optional parameter "statuses": +func (c *PostsListCall) Statuses(statuses string) *PostsListCall { + c.opt_["statuses"] = statuses + return c +} + +// View sets the optional parameter "view": +func (c *PostsListCall) View(view string) *PostsListCall { + c.opt_["view"] = view + return c +} + +func (c *PostsListCall) Do() (*PostList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["endDate"]; ok { + params.Set("endDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchImages"]; ok { + params.Set("fetchImages", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["labels"]; ok { + params.Set("labels", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startDate"]; ok { + params.Set("startDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["statuses"]; ok { + params.Set("statuses", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PostList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of posts, possibly filtered.", + // "httpMethod": "GET", + // "id": "blogger.posts.list", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch posts from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "endDate": { + // "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "fetchBodies": { + // "default": "true", + // "description": "Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.", + // "location": "query", + // "type": "boolean" + // }, + // "fetchImages": { + // "description": "Whether image URL metadata for each post is included.", + // "location": "query", + // "type": "boolean" + // }, + // "labels": { + // "description": "Comma-separated list of labels to search for.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of posts to fetch.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "orderBy": { + // "default": "PUBLISHED", + // "description": "Sort search results", + // "enum": [ + // "published", + // "updated" + // ], + // "enumDescriptions": [ + // "Order by the date the post was published", + // "Order by the date the post was last updated" + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Continuation token if the request is paged.", + // "location": "query", + // "type": "string" + // }, + // "startDate": { + // "description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "statuses": { + // "enum": [ + // "draft", + // "live", + // "scheduled" + // ], + // "enumDescriptions": [ + // "Draft posts", + // "Published posts", + // "Posts that are scheduled to publish in future." + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "view": { + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Reader level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts", + // "response": { + // "$ref": "PostList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.posts.patch": + +type PostsPatchCall struct { + s *Service + blogId string + postId string + post *Post + opt_ map[string]interface{} +} + +// Patch: Update a post. This method supports patch semantics. +func (r *PostsService) Patch(blogId string, postId string, post *Post) *PostsPatchCall { + c := &PostsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.post = post + return c +} + +func (c *PostsPatchCall) Do() (*Post, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a post. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "blogger.posts.patch", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}", + // "request": { + // "$ref": "Post" + // }, + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.posts.publish": + +type PostsPublishCall struct { + s *Service + blogId string + postId string + opt_ map[string]interface{} +} + +// Publish: Publish a draft post. +func (r *PostsService) Publish(blogId string, postId string) *PostsPublishCall { + c := &PostsPublishCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + return c +} + +// PublishDate sets the optional parameter "publishDate": The date and +// time to schedule the publishing of the Blog. +func (c *PostsPublishCall) PublishDate(publishDate string) *PostsPublishCall { + c.opt_["publishDate"] = publishDate + return c +} + +func (c *PostsPublishCall) Do() (*Post, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["publishDate"]; ok { + params.Set("publishDate", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/publish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Publish a draft post.", + // "httpMethod": "POST", + // "id": "blogger.posts.publish", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "publishDate": { + // "description": "The date and time to schedule the publishing of the Blog.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/publish", + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.posts.revert": + +type PostsRevertCall struct { + s *Service + blogId string + postId string + opt_ map[string]interface{} +} + +// Revert: Revert a published or scheduled post to draft state. +func (r *PostsService) Revert(blogId string, postId string) *PostsRevertCall { + c := &PostsRevertCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + return c +} + +func (c *PostsRevertCall) Do() (*Post, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/revert") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Revert a published or scheduled post to draft state.", + // "httpMethod": "POST", + // "id": "blogger.posts.revert", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/revert", + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.posts.search": + +type PostsSearchCall struct { + s *Service + blogId string + q string + opt_ map[string]interface{} +} + +// Search: Search for a post. +func (r *PostsService) Search(blogId string, q string) *PostsSearchCall { + c := &PostsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.q = q + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether the +// body content of posts is included (default: true). This should be set +// to false when the post bodies are not required, to help minimize +// traffic. +func (c *PostsSearchCall) FetchBodies(fetchBodies bool) *PostsSearchCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// OrderBy sets the optional parameter "orderBy": Sort search results +func (c *PostsSearchCall) OrderBy(orderBy string) *PostsSearchCall { + c.opt_["orderBy"] = orderBy + return c +} + +func (c *PostsSearchCall) Do() (*PostList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("q", fmt.Sprintf("%v", c.q)) + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/search") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PostList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Search for a post.", + // "httpMethod": "GET", + // "id": "blogger.posts.search", + // "parameterOrder": [ + // "blogId", + // "q" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch the post from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fetchBodies": { + // "default": "true", + // "description": "Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.", + // "location": "query", + // "type": "boolean" + // }, + // "orderBy": { + // "default": "PUBLISHED", + // "description": "Sort search results", + // "enum": [ + // "published", + // "updated" + // ], + // "enumDescriptions": [ + // "Order by the date the post was published", + // "Order by the date the post was last updated" + // ], + // "location": "query", + // "type": "string" + // }, + // "q": { + // "description": "Query terms to search this blog for matching posts.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/search", + // "response": { + // "$ref": "PostList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.posts.update": + +type PostsUpdateCall struct { + s *Service + blogId string + postId string + post *Post + opt_ map[string]interface{} +} + +// Update: Update a post. +func (r *PostsService) Update(blogId string, postId string, post *Post) *PostsUpdateCall { + c := &PostsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.post = post + return c +} + +func (c *PostsUpdateCall) Do() (*Post, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a post.", + // "httpMethod": "PUT", + // "id": "blogger.posts.update", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}", + // "request": { + // "$ref": "Post" + // }, + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.users.get": + +type UsersGetCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// Get: Gets one user by id. +func (r *UsersService) Get(userId string) *UsersGetCall { + c := &UsersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +func (c *UsersGetCall) Do() (*User, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(User) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one user by id.", + // "httpMethod": "GET", + // "id": "blogger.users.get", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "description": "The ID of the user to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userId}", + // "response": { + // "$ref": "User" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/getwithoutbody.json b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/getwithoutbody.json new file mode 100644 index 0000000000000..b23b25741dbc3 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/getwithoutbody.json @@ -0,0 +1,89 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"", + "discoveryVersion": "v1", + "id": "getwithoutbody:v1", + "name": "getwithoutbody", + "version": "v1", + "title": "Example API", + "description": "The Example API demonstrates a GET with a request.", + "ownerDomain": "google.com", + "ownerName": "Google", + "protocol": "rest", + "schemas": { + "ListMetricRequest": { + "id": "ListMetricRequest", + "type": "object", + "description": "The request of getwithoutbody.metricDescriptors.list.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"getwithoutbody#listMetricRequest\".", + "default": "getwithoutbody#listMetricRequest" + } + } + }, + "ListMetricResponse": { + "id": "ListMetricResponse", + "type": "object", + "description": "The response of getwithoutbody.metricDescriptors.list.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"getwithoutbody#listMetricResponse\".", + "default": "getwithoutbody#listMetricResponse" + }, + "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." + } + } + } + }, + "resources": { + "metricDescriptors": { + "methods": { + "list": { + "id": "getwithoutbody.metricDescriptors.list", + "path": "{project}/metricDescriptors", + "httpMethod": "GET", + "description": "List all of the available metric descriptors. Large number of metric descriptors 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" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "ListMetricRequest" + }, + "response": { + "$ref": "ListMetricResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/getwithoutbody.readonly" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/getwithoutbody.want b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/getwithoutbody.want new file mode 100644 index 0000000000000..423aae8267953 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/getwithoutbody.want @@ -0,0 +1,190 @@ +// Package getwithoutbody provides access to the Example API. +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/getwithoutbody/v1" +// ... +// getwithoutbodyService, err := getwithoutbody.New(oauthHttpClient) +package getwithoutbody + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "getwithoutbody:v1" +const apiName = "getwithoutbody" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/discovery/v1/apis" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.MetricDescriptors = NewMetricDescriptorsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + MetricDescriptors *MetricDescriptorsService +} + +func NewMetricDescriptorsService(s *Service) *MetricDescriptorsService { + rs := &MetricDescriptorsService{s: s} + return rs +} + +type MetricDescriptorsService struct { + s *Service +} + +type ListMetricRequest struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "getwithoutbody#listMetricRequest". + Kind string `json:"kind,omitempty"` +} + +type ListMetricResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "getwithoutbody#listMetricResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: 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. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +// method id "getwithoutbody.metricDescriptors.list": + +type MetricDescriptorsListCall struct { + s *Service + project string + listmetricrequest *ListMetricRequest + opt_ map[string]interface{} +} + +// List: List all of the available metric descriptors. Large number of +// metric descriptors 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. +func (r *MetricDescriptorsService) List(project string, listmetricrequest *ListMetricRequest) *MetricDescriptorsListCall { + c := &MetricDescriptorsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.listmetricrequest = listmetricrequest + return c +} + +// Count sets the optional parameter "count": Maximum number of metric +// descriptors per page. Used for pagination. If not specified, count = +// 100. +func (c *MetricDescriptorsListCall) Count(count int64) *MetricDescriptorsListCall { + c.opt_["count"] = count + return c +} + +// PageToken sets the optional parameter "pageToken": 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. +func (c *MetricDescriptorsListCall) PageToken(pageToken string) *MetricDescriptorsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *MetricDescriptorsListCall) Do() (*ListMetricResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["count"]; ok { + params.Set("count", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/metricDescriptors") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ListMetricResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the available metric descriptors. Large number of metric descriptors 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.", + // "httpMethod": "GET", + // "id": "getwithoutbody.metricDescriptors.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "count": { + // "default": "100", + // "description": "Maximum number of metric descriptors per page. Used for pagination. If not specified, count = 100.", + // "format": "int32", + // "location": "query", + // "maximum": "1000", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "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", + // "type": "string" + // }, + // "project": { + // "description": "The project id. The value can be the numeric project ID or string-based project name.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/metricDescriptors", + // "request": { + // "$ref": "ListMetricRequest" + // }, + // "response": { + // "$ref": "ListMetricResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/getwithoutbody.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/mapofstrings-1.json b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/mapofstrings-1.json new file mode 100644 index 0000000000000..435aa857aaaaf --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/mapofstrings-1.json @@ -0,0 +1,38 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"", + "discoveryVersion": "v1", + "id": "additionalprops:v1", + "name": "additionalprops", + "version": "v1", + "title": "Example API", + "description": "The Example API demonstrates an associative array.", + "ownerDomain": "google.com", + "ownerName": "Google", + "protocol": "rest", + "schemas": { + "TimeseriesDescriptor": { + "id": "TimeseriesDescriptor", + "type": "object", + "description": "The descriptions of a time series.", + "properties": { + "labels": { + "type": "object", + "description": "The set of key-value pairs that describe this time series, including target-specific labels and metric-specific labels.", + "additionalProperties": { + "type": "string", + "description": "The label's name." + } + }, + "metric": { + "type": "string", + "description": "The name of the metric." + }, + "project": { + "type": "string", + "description": "The project ID to which this time series belongs." + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/mapofstrings-1.want b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/mapofstrings-1.want new file mode 100644 index 0000000000000..107be8c14c894 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/mapofstrings-1.want @@ -0,0 +1,63 @@ +// Package additionalprops provides access to the Example API. +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/additionalprops/v1" +// ... +// additionalpropsService, err := additionalprops.New(oauthHttpClient) +package additionalprops + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "additionalprops:v1" +const apiName = "additionalprops" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/discovery/v1/apis" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL +} + +type TimeseriesDescriptor struct { + // Labels: The set of key-value pairs that describe this time series, + // including target-specific labels and metric-specific labels. + Labels map[string]string `json:"labels,omitempty"` + + // Metric: The name of the metric. + Metric string `json:"metric,omitempty"` + + // Project: The project ID to which this time series belongs. + Project string `json:"project,omitempty"` +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/quotednum.json b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/quotednum.json new file mode 100644 index 0000000000000..738555e65ffb4 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/quotednum.json @@ -0,0 +1,94 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"DGgqtFnjgu83tuwvvVNNUhOiHWk/1UCG4CqfTBrxPN0MRjUm7GaLJ7Y\"", + "discoveryVersion": "v1", + "id": "adexchangebuyer:v1.1", + "name": "adexchangebuyer", + "version": "v1.1", + "title": "Ad Exchange Buyer API", + "description": "Lets you manage your Ad Exchange Buyer account.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "http://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.1/", + "basePath": "/adexchangebuyer/v1.1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "adexchangebuyer/v1.1/", + "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": { + "Creative": { + "id": "Creative", + "type": "object", + "description": "A creative and its classification data.", + "properties": { + "advertiserId": { + "type": "array", + "description": "Detected advertiser id, if any. Read-only. This field should not be set in requests.", + "items": { + "type": "string", + "format": "int64" + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/quotednum.want b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/quotednum.want new file mode 100644 index 0000000000000..16f7c130a9ee7 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/quotednum.want @@ -0,0 +1,65 @@ +// Package adexchangebuyer provides access to the Ad Exchange Buyer API. +// +// See https://developers.google.com/ad-exchange/buyer-rest +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/adexchangebuyer/v1.1" +// ... +// adexchangebuyerService, err := adexchangebuyer.New(oauthHttpClient) +package adexchangebuyer + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "adexchangebuyer:v1.1" +const apiName = "adexchangebuyer" +const apiVersion = "v1.1" +const basePath = "https://www.googleapis.com/adexchangebuyer/v1.1/" + +// OAuth2 scopes used by this API. +const ( + // Manage your Ad Exchange buyer account configuration + AdexchangeBuyerScope = "https://www.googleapis.com/auth/adexchange.buyer" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL +} + +type Creative struct { + // AdvertiserId: Detected advertiser id, if any. Read-only. This field + // should not be set in requests. + AdvertiserId googleapi.Int64s `json:"advertiserId,omitempty"` +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/resource-named-service.json b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/resource-named-service.json new file mode 100644 index 0000000000000..53b7b164838af --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/resource-named-service.json @@ -0,0 +1,2199 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"DGgqtFnjgu83tuwvvVNNUhOiHWk/HqXrvEeuZV7fVbX7lTgVYLdSy_g\"", + "discoveryVersion": "v1", + "id": "blogger:v3", + "name": "blogger", + "version": "v3", + "title": "Blogger API", + "description": "API for access to the data within Blogger.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/blogger-16.png", + "x32": "http://www.google.com/images/icons/product/blogger-32.png" + }, + "documentationLink": "https://developers.google.com/blogger/docs/3.0/getting_started", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/blogger/v3/", + "basePath": "/blogger/v3/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "blogger/v3/", + "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" + }, + "https://www.googleapis.com/auth/blogger.readonly": { + "description": "View your Blogger account" + } + } + } + }, + "schemas": { + "Blog": { + "id": "Blog", + "type": "object", + "properties": { + "customMetaData": { + "type": "string", + "description": "The JSON custom meta-data for the Blog" + }, + "description": { + "type": "string", + "description": "The description of this blog. This is displayed underneath the title." + }, + "id": { + "type": "string", + "description": "The identifier for this resource." + }, + "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": { + "items": { + "type": "array", + "description": "The List of Posts for this Blog.", + "items": { + "$ref": "Post" + } + }, + "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": { + "blogUserInfos": { + "type": "array", + "description": "Admin level list of blog per-user information", + "items": { + "$ref": "Service" + } + }, + "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" + } + } + }, + "BlogPerUserInfo": { + "id": "BlogPerUserInfo", + "type": "object", + "properties": { + "blogId": { + "type": "string", + "description": "ID of the Blog resource" + }, + "hasAdminAccess": { + "type": "boolean", + "description": "True if the user has Admin level access to the blog." + }, + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#blogPerUserInfo", + "default": "blogger#blogPerUserInfo" + }, + "photosAlbumKey": { + "type": "string", + "description": "The Photo Album Key for the user when adding photos to the blog" + }, + "userId": { + "type": "string", + "description": "ID of the User" + } + } + }, + "Service": { + "id": "Service", + "type": "object", + "properties": { + "blog": { + "$ref": "Blog", + "description": "The Blog resource." + }, + "blog_user_info": { + "$ref": "BlogPerUserInfo", + "description": "Information about a User for the Blog." + }, + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#blogUserInfo", + "default": "blogger#blogUserInfo" + } + } + }, + "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." + } + } + }, + "content": { + "type": "string", + "description": "The actual content of the comment. May include HTML markup." + }, + "id": { + "type": "string", + "description": "The identifier for this resource." + }, + "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." + } + } + }, + "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." + } + } + }, + "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." + }, + "status": { + "type": "string", + "description": "The status of the comment (only populated for admin users)" + }, + "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." + } + } + }, + "content": { + "type": "string", + "description": "The body content of this Page, in HTML." + }, + "id": { + "type": "string", + "description": "The identifier for this resource." + }, + "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." + }, + "status": { + "type": "string", + "description": "The status of the page for admin resources (either LIVE or DRAFT)." + }, + "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" + } + } + }, + "Pageviews": { + "id": "Pageviews", + "type": "object", + "properties": { + "blogId": { + "type": "string", + "description": "Blog Id", + "format": "int64" + }, + "counts": { + "type": "array", + "description": "The container of posts in this blog.", + "items": { + "type": "object", + "properties": { + "count": { + "type": "string", + "description": "Count of page views for the given time range", + "format": "int64" + }, + "timeRange": { + "type": "string", + "description": "Time range the given count applies to" + } + } + } + }, + "kind": { + "type": "string", + "description": "The kind of this entry. Always blogger#page_views", + "default": "blogger#page_views" + } + } + }, + "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." + } + } + }, + "content": { + "type": "string", + "description": "The content of the Post. May contain HTML markup." + }, + "customMetaData": { + "type": "string", + "description": "The JSON meta-data for the Post." + }, + "id": { + "type": "string", + "description": "The identifier of this Post." + }, + "images": { + "type": "array", + "description": "Display image for the Post.", + "items": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + } + } + }, + "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" + } + }, + "location": { + "type": "object", + "description": "The location for geotagged posts.", + "properties": { + "lat": { + "type": "number", + "description": "Location's latitude.", + "format": "double" + }, + "lng": { + "type": "number", + "description": "Location's longitude.", + "format": "double" + }, + "name": { + "type": "string", + "description": "Location name." + }, + "span": { + "type": "string", + "description": "Location's viewport span. Can be used when rendering a map preview." + } + } + }, + "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": { + "items": { + "type": "array", + "description": "The List of Comments for this Post.", + "items": { + "$ref": "Comment" + } + }, + "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." + }, + "status": { + "type": "string", + "description": "Status of the post. Only set for admin-level requests" + }, + "title": { + "type": "string", + "description": "The title of the Post." + }, + "titleLink": { + "type": "string", + "description": "The title link URL, similar to atom's related link." + }, + "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." + } + } + }, + "PostPerUserInfo": { + "id": "PostPerUserInfo", + "type": "object", + "properties": { + "blogId": { + "type": "string", + "description": "ID of the Blog that the post resource belongs to." + }, + "hasEditAccess": { + "type": "boolean", + "description": "True if the user has Author level access to the post." + }, + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#postPerUserInfo", + "default": "blogger#postPerUserInfo" + }, + "postId": { + "type": "string", + "description": "ID of the Post resource." + }, + "userId": { + "type": "string", + "description": "ID of the User." + } + } + }, + "PostUserInfo": { + "id": "PostUserInfo", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#postUserInfo", + "default": "blogger#postUserInfo" + }, + "post": { + "$ref": "Post", + "description": "The Post resource." + }, + "post_user_info": { + "$ref": "PostPerUserInfo", + "description": "Information about a User for the Post." + } + } + }, + "PostUserInfosList": { + "id": "PostUserInfosList", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The list of Posts with User information for the post, for this Blog.", + "items": { + "$ref": "PostUserInfo" + } + }, + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#postList", + "default": "blogger#postUserInfosList" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to fetch the next 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": { + "blogUserInfos": { + "methods": { + "get": { + "id": "blogger.blogUserInfos.get", + "path": "users/{userId}/blogs/{blogId}", + "httpMethod": "GET", + "description": "Gets one blog and user info pair by blogId and userId.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the blog to get.", + "required": true, + "location": "path" + }, + "maxPosts": { + "type": "integer", + "description": "Maximum number of posts to pull back with the blog.", + "format": "uint32", + "location": "query" + }, + "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", + "blogId" + ], + "response": { + "$ref": "Service" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + } + } + }, + "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" + }, + "maxPosts": { + "type": "integer", + "description": "Maximum number of posts to pull back with the blog.", + "format": "uint32", + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "response": { + "$ref": "Blog" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "getByUrl": { + "id": "blogger.blogs.getByUrl", + "path": "blogs/byurl", + "httpMethod": "GET", + "description": "Retrieve a Blog by URL.", + "parameters": { + "url": { + "type": "string", + "description": "The URL of the blog to retrieve.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "url" + ], + "response": { + "$ref": "Blog" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "listByUser": { + "id": "blogger.blogs.listByUser", + "path": "users/{userId}/blogs", + "httpMethod": "GET", + "description": "Retrieves a list of blogs, possibly filtered.", + "parameters": { + "fetchUserInfo": { + "type": "boolean", + "description": "Whether the response is a list of blogs with per-user information instead of just blogs.", + "location": "query" + }, + "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" + }, + "view": { + "type": "string", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Admin level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "BlogList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + } + } + }, + "comments": { + "methods": { + "approve": { + "id": "blogger.comments.approve", + "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve", + "httpMethod": "POST", + "description": "Marks a comment as not spam.", + "parameters": { + "blogId": { + "type": "string", + "description": "The Id of the Blog.", + "required": true, + "location": "path" + }, + "commentId": { + "type": "string", + "description": "The ID of the comment to mark as not spam.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId", + "commentId" + ], + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "delete": { + "id": "blogger.comments.delete", + "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}", + "httpMethod": "DELETE", + "description": "Delete a comment by id.", + "parameters": { + "blogId": { + "type": "string", + "description": "The Id of the Blog.", + "required": true, + "location": "path" + }, + "commentId": { + "type": "string", + "description": "The ID of the comment to delete.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId", + "commentId" + ], + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "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", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "list": { + "id": "blogger.comments.list", + "path": "blogs/{blogId}/posts/{postId}/comments", + "httpMethod": "GET", + "description": "Retrieves the comments for a post, possibly filtered.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch comments from.", + "required": true, + "location": "path" + }, + "endDate": { + "type": "string", + "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.", + "format": "date-time", + "location": "query" + }, + "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" + }, + "statuses": { + "type": "string", + "enum": [ + "emptied", + "live", + "pending", + "spam" + ], + "enumDescriptions": [ + "Comments that have had their content removed", + "Comments that are publicly visible", + "Comments that are awaiting administrator approval", + "Comments marked as spam by the administrator" + ], + "repeated": true, + "location": "query" + }, + "view": { + "type": "string", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Admin level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "response": { + "$ref": "CommentList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "listByBlog": { + "id": "blogger.comments.listByBlog", + "path": "blogs/{blogId}/comments", + "httpMethod": "GET", + "description": "Retrieves the comments for a blog, across all posts, possibly filtered.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch comments from.", + "required": true, + "location": "path" + }, + "endDate": { + "type": "string", + "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.", + "format": "date-time", + "location": "query" + }, + "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" + }, + "startDate": { + "type": "string", + "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.", + "format": "date-time", + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "response": { + "$ref": "CommentList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "markAsSpam": { + "id": "blogger.comments.markAsSpam", + "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam", + "httpMethod": "POST", + "description": "Marks a comment as spam.", + "parameters": { + "blogId": { + "type": "string", + "description": "The Id of the Blog.", + "required": true, + "location": "path" + }, + "commentId": { + "type": "string", + "description": "The ID of the comment to mark as spam.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId", + "commentId" + ], + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "removeContent": { + "id": "blogger.comments.removeContent", + "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent", + "httpMethod": "POST", + "description": "Removes the content of a comment.", + "parameters": { + "blogId": { + "type": "string", + "description": "The Id of the Blog.", + "required": true, + "location": "path" + }, + "commentId": { + "type": "string", + "description": "The ID of the comment to delete content from.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId", + "commentId" + ], + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + } + } + }, + "pageViews": { + "methods": { + "get": { + "id": "blogger.pageViews.get", + "path": "blogs/{blogId}/pageviews", + "httpMethod": "GET", + "description": "Retrieve pageview stats for a Blog.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the blog to get.", + "required": true, + "location": "path" + }, + "range": { + "type": "string", + "enum": [ + "30DAYS", + "7DAYS", + "all" + ], + "enumDescriptions": [ + "Page view counts from the last thirty days.", + "Page view counts from the last seven days.", + "Total page view counts from all time." + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "response": { + "$ref": "Pageviews" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + } + } + }, + "pages": { + "methods": { + "delete": { + "id": "blogger.pages.delete", + "path": "blogs/{blogId}/pages/{pageId}", + "httpMethod": "DELETE", + "description": "Delete a page by id.", + "parameters": { + "blogId": { + "type": "string", + "description": "The Id of the Blog.", + "required": true, + "location": "path" + }, + "pageId": { + "type": "string", + "description": "The ID of the Page.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "pageId" + ], + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "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" + }, + "view": { + "type": "string", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Admin level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "pageId" + ], + "response": { + "$ref": "Page" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "insert": { + "id": "blogger.pages.insert", + "path": "blogs/{blogId}/pages", + "httpMethod": "POST", + "description": "Add a page.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to add the page to.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId" + ], + "request": { + "$ref": "Page" + }, + "response": { + "$ref": "Page" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "list": { + "id": "blogger.pages.list", + "path": "blogs/{blogId}/pages", + "httpMethod": "GET", + "description": "Retrieves the pages for a blog, optionally including non-LIVE statuses.", + "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" + }, + "statuses": { + "type": "string", + "enum": [ + "draft", + "imported", + "live" + ], + "enumDescriptions": [ + "Draft (unpublished) Pages", + "Pages that have had their content removed", + "Pages that are publicly visible" + ], + "repeated": true, + "location": "query" + }, + "view": { + "type": "string", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Admin level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "response": { + "$ref": "PageList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "patch": { + "id": "blogger.pages.patch", + "path": "blogs/{blogId}/pages/{pageId}", + "httpMethod": "PATCH", + "description": "Update a page. This method supports patch semantics.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the Blog.", + "required": true, + "location": "path" + }, + "pageId": { + "type": "string", + "description": "The ID of the Page.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "pageId" + ], + "request": { + "$ref": "Page" + }, + "response": { + "$ref": "Page" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "update": { + "id": "blogger.pages.update", + "path": "blogs/{blogId}/pages/{pageId}", + "httpMethod": "PUT", + "description": "Update a page.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the Blog.", + "required": true, + "location": "path" + }, + "pageId": { + "type": "string", + "description": "The ID of the Page.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "pageId" + ], + "request": { + "$ref": "Page" + }, + "response": { + "$ref": "Page" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + } + } + }, + "postUserInfos": { + "methods": { + "get": { + "id": "blogger.postUserInfos.get", + "path": "users/{userId}/blogs/{blogId}/posts/{postId}", + "httpMethod": "GET", + "description": "Gets one post and user info pair by postId and userId.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the blog.", + "required": true, + "location": "path" + }, + "maxComments": { + "type": "integer", + "description": "Maximum number of comments to pull back on a post.", + "format": "uint32", + "location": "query" + }, + "postId": { + "type": "string", + "description": "The ID of the post to get.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "blogId", + "postId" + ], + "response": { + "$ref": "PostUserInfo" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "list": { + "id": "blogger.postUserInfos.list", + "path": "users/{userId}/blogs/{blogId}/posts", + "httpMethod": "GET", + "description": "Retrieves a list of post and user info pairs, possibly filtered.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch posts from.", + "required": true, + "location": "path" + }, + "endDate": { + "type": "string", + "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.", + "format": "date-time", + "location": "query" + }, + "fetchBodies": { + "type": "boolean", + "description": "Whether the body content of posts is included.", + "location": "query" + }, + "labels": { + "type": "string", + "description": "Comma-separated list of labels to search for.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of posts to fetch.", + "format": "uint32", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sort search results", + "default": "PUBLISHED", + "enum": [ + "published", + "updated" + ], + "enumDescriptions": [ + "Order by the date the post was published", + "Order by the date the post was last updated" + ], + "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" + }, + "statuses": { + "type": "string", + "enum": [ + "draft", + "live", + "scheduled" + ], + "enumDescriptions": [ + "Draft posts", + "Published posts", + "Posts that are scheduled to publish in future." + ], + "repeated": true, + "location": "query" + }, + "userId": { + "type": "string", + "description": "ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + "required": true, + "location": "path" + }, + "view": { + "type": "string", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Reader level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "userId", + "blogId" + ], + "response": { + "$ref": "PostUserInfosList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + } + } + }, + "posts": { + "methods": { + "delete": { + "id": "blogger.posts.delete", + "path": "blogs/{blogId}/posts/{postId}", + "httpMethod": "DELETE", + "description": "Delete a post by id.", + "parameters": { + "blogId": { + "type": "string", + "description": "The Id of the Blog.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "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" + }, + "maxComments": { + "type": "integer", + "description": "Maximum number of comments to pull back on a post.", + "format": "uint32", + "location": "query" + }, + "postId": { + "type": "string", + "description": "The ID of the post", + "required": true, + "location": "path" + }, + "view": { + "type": "string", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Admin level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "response": { + "$ref": "Post" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "getByPath": { + "id": "blogger.posts.getByPath", + "path": "blogs/{blogId}/posts/bypath", + "httpMethod": "GET", + "description": "Retrieve a Post by Path.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch the post from.", + "required": true, + "location": "path" + }, + "maxComments": { + "type": "integer", + "description": "Maximum number of comments to pull back on a post.", + "format": "uint32", + "location": "query" + }, + "path": { + "type": "string", + "description": "Path of the Post to retrieve.", + "required": true, + "location": "query" + }, + "view": { + "type": "string", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Admin level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "path" + ], + "response": { + "$ref": "Post" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "insert": { + "id": "blogger.posts.insert", + "path": "blogs/{blogId}/posts", + "httpMethod": "POST", + "description": "Add a post.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to add the post to.", + "required": true, + "location": "path" + }, + "isDraft": { + "type": "boolean", + "description": "Whether to create the post as a draft", + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "request": { + "$ref": "Post" + }, + "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" + }, + "endDate": { + "type": "string", + "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.", + "format": "date-time", + "location": "query" + }, + "fetchBodies": { + "type": "boolean", + "description": "Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.", + "default": "true", + "location": "query" + }, + "fetchImages": { + "type": "boolean", + "description": "Whether image URL metadata for each post is included.", + "location": "query" + }, + "labels": { + "type": "string", + "description": "Comma-separated list of labels to search for.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of posts to fetch.", + "format": "uint32", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sort search results", + "default": "PUBLISHED", + "enum": [ + "published", + "updated" + ], + "enumDescriptions": [ + "Order by the date the post was published", + "Order by the date the post was last updated" + ], + "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" + }, + "statuses": { + "type": "string", + "enum": [ + "draft", + "live", + "scheduled" + ], + "enumDescriptions": [ + "Draft posts", + "Published posts", + "Posts that are scheduled to publish in future." + ], + "repeated": true, + "location": "query" + }, + "view": { + "type": "string", + "enum": [ + "ADMIN", + "AUTHOR", + "READER" + ], + "enumDescriptions": [ + "Admin level detail", + "Author level detail", + "Reader level detail" + ], + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "response": { + "$ref": "PostList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "patch": { + "id": "blogger.posts.patch", + "path": "blogs/{blogId}/posts/{postId}", + "httpMethod": "PATCH", + "description": "Update a post. This method supports patch semantics.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the Blog.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "request": { + "$ref": "Post" + }, + "response": { + "$ref": "Post" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "publish": { + "id": "blogger.posts.publish", + "path": "blogs/{blogId}/posts/{postId}/publish", + "httpMethod": "POST", + "description": "Publish a draft post.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the Blog.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + }, + "publishDate": { + "type": "string", + "description": "The date and time to schedule the publishing of the Blog.", + "format": "date-time", + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "response": { + "$ref": "Post" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "revert": { + "id": "blogger.posts.revert", + "path": "blogs/{blogId}/posts/{postId}/revert", + "httpMethod": "POST", + "description": "Revert a published or scheduled post to draft state.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the Blog.", + "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" + ] + }, + "search": { + "id": "blogger.posts.search", + "path": "blogs/{blogId}/posts/search", + "httpMethod": "GET", + "description": "Search for a post.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch the post from.", + "required": true, + "location": "path" + }, + "fetchBodies": { + "type": "boolean", + "description": "Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.", + "default": "true", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sort search results", + "default": "PUBLISHED", + "enum": [ + "published", + "updated" + ], + "enumDescriptions": [ + "Order by the date the post was published", + "Order by the date the post was last updated" + ], + "location": "query" + }, + "q": { + "type": "string", + "description": "Query terms to search this blog for matching posts.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "q" + ], + "response": { + "$ref": "PostList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger", + "https://www.googleapis.com/auth/blogger.readonly" + ] + }, + "update": { + "id": "blogger.posts.update", + "path": "blogs/{blogId}/posts/{postId}", + "httpMethod": "PUT", + "description": "Update a post.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the Blog.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the Post.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "request": { + "$ref": "Post" + }, + "response": { + "$ref": "Post" + }, + "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", + "https://www.googleapis.com/auth/blogger.readonly" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/resource-named-service.want b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/resource-named-service.want new file mode 100644 index 0000000000000..ec32d8efb3d6a --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/google-api-go-generator/testdata/resource-named-service.want @@ -0,0 +1,3860 @@ +// Package blogger provides access to the Blogger API. +// +// See https://developers.google.com/blogger/docs/3.0/getting_started +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/blogger/v3" +// ... +// bloggerService, err := blogger.New(oauthHttpClient) +package blogger + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "blogger:v3" +const apiName = "blogger" +const apiVersion = "v3" +const basePath = "https://www.googleapis.com/blogger/v3/" + +// OAuth2 scopes used by this API. +const ( + // Manage your Blogger account + BloggerScope = "https://www.googleapis.com/auth/blogger" + + // View your Blogger account + BloggerReadonlyScope = "https://www.googleapis.com/auth/blogger.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.BlogUserInfos = NewBlogUserInfosService(s) + s.Blogs = NewBlogsService(s) + s.Comments = NewCommentsService(s) + s.PageViews = NewPageViewsService(s) + s.Pages = NewPagesService(s) + s.PostUserInfos = NewPostUserInfosService(s) + s.Posts = NewPostsService(s) + s.Users = NewUsersService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + BlogUserInfos *BlogUserInfosService + + Blogs *BlogsService + + Comments *CommentsService + + PageViews *PageViewsService + + Pages *PagesService + + PostUserInfos *PostUserInfosService + + Posts *PostsService + + Users *UsersService +} + +func NewBlogUserInfosService(s *Service) *BlogUserInfosService { + rs := &BlogUserInfosService{s: s} + return rs +} + +type BlogUserInfosService struct { + s *Service +} + +func NewBlogsService(s *Service) *BlogsService { + rs := &BlogsService{s: s} + return rs +} + +type BlogsService struct { + s *Service +} + +func NewCommentsService(s *Service) *CommentsService { + rs := &CommentsService{s: s} + return rs +} + +type CommentsService struct { + s *Service +} + +func NewPageViewsService(s *Service) *PageViewsService { + rs := &PageViewsService{s: s} + return rs +} + +type PageViewsService struct { + s *Service +} + +func NewPagesService(s *Service) *PagesService { + rs := &PagesService{s: s} + return rs +} + +type PagesService struct { + s *Service +} + +func NewPostUserInfosService(s *Service) *PostUserInfosService { + rs := &PostUserInfosService{s: s} + return rs +} + +type PostUserInfosService struct { + s *Service +} + +func NewPostsService(s *Service) *PostsService { + rs := &PostsService{s: s} + return rs +} + +type PostsService struct { + s *Service +} + +func NewUsersService(s *Service) *UsersService { + rs := &UsersService{s: s} + return rs +} + +type UsersService struct { + s *Service +} + +type Blog struct { + // CustomMetaData: The JSON custom meta-data for the Blog + CustomMetaData string `json:"customMetaData,omitempty"` + + // Description: The description of this blog. This is displayed + // underneath the title. + Description string `json:"description,omitempty"` + + // Id: The identifier for this resource. + Id string `json:"id,omitempty"` + + // Kind: The kind of this entry. Always blogger#blog + Kind string `json:"kind,omitempty"` + + // Locale: The locale this Blog is set to. + Locale *BlogLocale `json:"locale,omitempty"` + + // Name: The name of this blog. This is displayed as the title. + Name string `json:"name,omitempty"` + + // Pages: The container of pages in this blog. + Pages *BlogPages `json:"pages,omitempty"` + + // Posts: The container of posts in this blog. + Posts *BlogPosts `json:"posts,omitempty"` + + // Published: RFC 3339 date-time when this blog was published. + Published string `json:"published,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Updated: RFC 3339 date-time when this blog was last updated. + Updated string `json:"updated,omitempty"` + + // Url: The URL where this blog is published. + Url string `json:"url,omitempty"` +} + +type BlogLocale struct { + // Country: The country this blog's locale is set to. + Country string `json:"country,omitempty"` + + // Language: The language this blog is authored in. + Language string `json:"language,omitempty"` + + // Variant: The language variant this blog is authored in. + Variant string `json:"variant,omitempty"` +} + +type BlogPages struct { + // SelfLink: The URL of the container for pages in this blog. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: The count of pages in this blog. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type BlogPosts struct { + // Items: The List of Posts for this Blog. + Items []*Post `json:"items,omitempty"` + + // SelfLink: The URL of the container for posts in this blog. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: The count of posts in this blog. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type BlogList struct { + // BlogUserInfos: Admin level list of blog per-user information + BlogUserInfos []*Service1 `json:"blogUserInfos,omitempty"` + + // Items: The list of Blogs this user has Authorship or Admin rights + // over. + Items []*Blog `json:"items,omitempty"` + + // Kind: The kind of this entity. Always blogger#blogList + Kind string `json:"kind,omitempty"` +} + +type BlogPerUserInfo struct { + // BlogId: ID of the Blog resource + BlogId string `json:"blogId,omitempty"` + + // HasAdminAccess: True if the user has Admin level access to the blog. + HasAdminAccess bool `json:"hasAdminAccess,omitempty"` + + // Kind: The kind of this entity. Always blogger#blogPerUserInfo + Kind string `json:"kind,omitempty"` + + // PhotosAlbumKey: The Photo Album Key for the user when adding photos + // to the blog + PhotosAlbumKey string `json:"photosAlbumKey,omitempty"` + + // UserId: ID of the User + UserId string `json:"userId,omitempty"` +} + +type Comment struct { + // Author: The author of this Comment. + Author *CommentAuthor `json:"author,omitempty"` + + // Blog: Data about the blog containing this comment. + Blog *CommentBlog `json:"blog,omitempty"` + + // Content: The actual content of the comment. May include HTML markup. + Content string `json:"content,omitempty"` + + // Id: The identifier for this resource. + Id string `json:"id,omitempty"` + + // InReplyTo: Data about the comment this is in reply to. + InReplyTo *CommentInReplyTo `json:"inReplyTo,omitempty"` + + // Kind: The kind of this entry. Always blogger#comment + Kind string `json:"kind,omitempty"` + + // Post: Data about the post containing this comment. + Post *CommentPost `json:"post,omitempty"` + + // Published: RFC 3339 date-time when this comment was published. + Published string `json:"published,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Status: The status of the comment (only populated for admin users) + Status string `json:"status,omitempty"` + + // Updated: RFC 3339 date-time when this comment was last updated. + Updated string `json:"updated,omitempty"` +} + +type CommentAuthor struct { + // DisplayName: The display name. + DisplayName string `json:"displayName,omitempty"` + + // Id: The identifier of the Comment creator. + Id string `json:"id,omitempty"` + + // Image: The comment creator's avatar. + Image *CommentAuthorImage `json:"image,omitempty"` + + // Url: The URL of the Comment creator's Profile page. + Url string `json:"url,omitempty"` +} + +type CommentAuthorImage struct { + // Url: The comment creator's avatar URL. + Url string `json:"url,omitempty"` +} + +type CommentBlog struct { + // Id: The identifier of the blog containing this comment. + Id string `json:"id,omitempty"` +} + +type CommentInReplyTo struct { + // Id: The identified of the parent of this comment. + Id string `json:"id,omitempty"` +} + +type CommentPost struct { + // Id: The identifier of the post containing this comment. + Id string `json:"id,omitempty"` +} + +type CommentList struct { + // Items: The List of Comments for a Post. + Items []*Comment `json:"items,omitempty"` + + // Kind: The kind of this entry. Always blogger#commentList + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to fetch the next page, if one + // exists. + NextPageToken string `json:"nextPageToken,omitempty"` + + // PrevPageToken: Pagination token to fetch the previous page, if one + // exists. + PrevPageToken string `json:"prevPageToken,omitempty"` +} + +type Page struct { + // Author: The author of this Page. + Author *PageAuthor `json:"author,omitempty"` + + // Blog: Data about the blog containing this Page. + Blog *PageBlog `json:"blog,omitempty"` + + // Content: The body content of this Page, in HTML. + Content string `json:"content,omitempty"` + + // Id: The identifier for this resource. + Id string `json:"id,omitempty"` + + // Kind: The kind of this entity. Always blogger#page + Kind string `json:"kind,omitempty"` + + // Published: RFC 3339 date-time when this Page was published. + Published string `json:"published,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Status: The status of the page for admin resources (either LIVE or + // DRAFT). + Status string `json:"status,omitempty"` + + // Title: The title of this entity. This is the name displayed in the + // Admin user interface. + Title string `json:"title,omitempty"` + + // Updated: RFC 3339 date-time when this Page was last updated. + Updated string `json:"updated,omitempty"` + + // Url: The URL that this Page is displayed at. + Url string `json:"url,omitempty"` +} + +type PageAuthor struct { + // DisplayName: The display name. + DisplayName string `json:"displayName,omitempty"` + + // Id: The identifier of the Page creator. + Id string `json:"id,omitempty"` + + // Image: The page author's avatar. + Image *PageAuthorImage `json:"image,omitempty"` + + // Url: The URL of the Page creator's Profile page. + Url string `json:"url,omitempty"` +} + +type PageAuthorImage struct { + // Url: The page author's avatar URL. + Url string `json:"url,omitempty"` +} + +type PageBlog struct { + // Id: The identifier of the blog containing this page. + Id string `json:"id,omitempty"` +} + +type PageList struct { + // Items: The list of Pages for a Blog. + Items []*Page `json:"items,omitempty"` + + // Kind: The kind of this entity. Always blogger#pageList + Kind string `json:"kind,omitempty"` +} + +type Pageviews struct { + // BlogId: Blog Id + BlogId int64 `json:"blogId,omitempty,string"` + + // Counts: The container of posts in this blog. + Counts []*PageviewsCounts `json:"counts,omitempty"` + + // Kind: The kind of this entry. Always blogger#page_views + Kind string `json:"kind,omitempty"` +} + +type PageviewsCounts struct { + // Count: Count of page views for the given time range + Count int64 `json:"count,omitempty,string"` + + // TimeRange: Time range the given count applies to + TimeRange string `json:"timeRange,omitempty"` +} + +type Post struct { + // Author: The author of this Post. + Author *PostAuthor `json:"author,omitempty"` + + // Blog: Data about the blog containing this Post. + Blog *PostBlog `json:"blog,omitempty"` + + // Content: The content of the Post. May contain HTML markup. + Content string `json:"content,omitempty"` + + // CustomMetaData: The JSON meta-data for the Post. + CustomMetaData string `json:"customMetaData,omitempty"` + + // Id: The identifier of this Post. + Id string `json:"id,omitempty"` + + // Images: Display image for the Post. + Images []*PostImages `json:"images,omitempty"` + + // Kind: The kind of this entity. Always blogger#post + Kind string `json:"kind,omitempty"` + + // Labels: The list of labels this Post was tagged with. + Labels []string `json:"labels,omitempty"` + + // Location: The location for geotagged posts. + Location *PostLocation `json:"location,omitempty"` + + // Published: RFC 3339 date-time when this Post was published. + Published string `json:"published,omitempty"` + + // Replies: The container of comments on this Post. + Replies *PostReplies `json:"replies,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Status: Status of the post. Only set for admin-level requests + Status string `json:"status,omitempty"` + + // Title: The title of the Post. + Title string `json:"title,omitempty"` + + // TitleLink: The title link URL, similar to atom's related link. + TitleLink string `json:"titleLink,omitempty"` + + // Updated: RFC 3339 date-time when this Post was last updated. + Updated string `json:"updated,omitempty"` + + // Url: The URL where this Post is displayed. + Url string `json:"url,omitempty"` +} + +type PostAuthor struct { + // DisplayName: The display name. + DisplayName string `json:"displayName,omitempty"` + + // Id: The identifier of the Post creator. + Id string `json:"id,omitempty"` + + // Image: The Post author's avatar. + Image *PostAuthorImage `json:"image,omitempty"` + + // Url: The URL of the Post creator's Profile page. + Url string `json:"url,omitempty"` +} + +type PostAuthorImage struct { + // Url: The Post author's avatar URL. + Url string `json:"url,omitempty"` +} + +type PostBlog struct { + // Id: The identifier of the Blog that contains this Post. + Id string `json:"id,omitempty"` +} + +type PostImages struct { + Url string `json:"url,omitempty"` +} + +type PostLocation struct { + // Lat: Location's latitude. + Lat float64 `json:"lat,omitempty"` + + // Lng: Location's longitude. + Lng float64 `json:"lng,omitempty"` + + // Name: Location name. + Name string `json:"name,omitempty"` + + // Span: Location's viewport span. Can be used when rendering a map + // preview. + Span string `json:"span,omitempty"` +} + +type PostReplies struct { + // Items: The List of Comments for this Post. + Items []*Comment `json:"items,omitempty"` + + // SelfLink: The URL of the comments on this post. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: The count of comments on this post. + TotalItems int64 `json:"totalItems,omitempty,string"` +} + +type PostList struct { + // Items: The list of Posts for this Blog. + Items []*Post `json:"items,omitempty"` + + // Kind: The kind of this entity. Always blogger#postList + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to fetch the next page, if one + // exists. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type PostPerUserInfo struct { + // BlogId: ID of the Blog that the post resource belongs to. + BlogId string `json:"blogId,omitempty"` + + // HasEditAccess: True if the user has Author level access to the post. + HasEditAccess bool `json:"hasEditAccess,omitempty"` + + // Kind: The kind of this entity. Always blogger#postPerUserInfo + Kind string `json:"kind,omitempty"` + + // PostId: ID of the Post resource. + PostId string `json:"postId,omitempty"` + + // UserId: ID of the User. + UserId string `json:"userId,omitempty"` +} + +type PostUserInfo struct { + // Kind: The kind of this entity. Always blogger#postUserInfo + Kind string `json:"kind,omitempty"` + + // Post: The Post resource. + Post *Post `json:"post,omitempty"` + + // Post_user_info: Information about a User for the Post. + Post_user_info *PostPerUserInfo `json:"post_user_info,omitempty"` +} + +type PostUserInfosList struct { + // Items: The list of Posts with User information for the post, for this + // Blog. + Items []*PostUserInfo `json:"items,omitempty"` + + // Kind: The kind of this entity. Always blogger#postList + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to fetch the next page, if one + // exists. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Service1 struct { + // Blog: The Blog resource. + Blog *Blog `json:"blog,omitempty"` + + // Blog_user_info: Information about a User for the Blog. + Blog_user_info *BlogPerUserInfo `json:"blog_user_info,omitempty"` + + // Kind: The kind of this entity. Always blogger#blogUserInfo + Kind string `json:"kind,omitempty"` +} + +type User struct { + // About: Profile summary information. + About string `json:"about,omitempty"` + + // Blogs: The container of blogs for this user. + Blogs *UserBlogs `json:"blogs,omitempty"` + + // Created: The timestamp of when this profile was created, in seconds + // since epoch. + Created string `json:"created,omitempty"` + + // DisplayName: The display name. + DisplayName string `json:"displayName,omitempty"` + + // Id: The identifier for this User. + Id string `json:"id,omitempty"` + + // Kind: The kind of this entity. Always blogger#user + Kind string `json:"kind,omitempty"` + + // Locale: This user's locale + Locale *UserLocale `json:"locale,omitempty"` + + // SelfLink: The API REST URL to fetch this resource from. + SelfLink string `json:"selfLink,omitempty"` + + // Url: The user's profile page. + Url string `json:"url,omitempty"` +} + +type UserBlogs struct { + // SelfLink: The URL of the Blogs for this user. + SelfLink string `json:"selfLink,omitempty"` +} + +type UserLocale struct { + // Country: The user's country setting. + Country string `json:"country,omitempty"` + + // Language: The user's language setting. + Language string `json:"language,omitempty"` + + // Variant: The user's language variant setting. + Variant string `json:"variant,omitempty"` +} + +// method id "blogger.blogUserInfos.get": + +type BlogUserInfosGetCall struct { + s *Service + userId string + blogId string + opt_ map[string]interface{} +} + +// Get: Gets one blog and user info pair by blogId and userId. +func (r *BlogUserInfosService) Get(userId string, blogId string) *BlogUserInfosGetCall { + c := &BlogUserInfosGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.blogId = blogId + return c +} + +// MaxPosts sets the optional parameter "maxPosts": Maximum number of +// posts to pull back with the blog. +func (c *BlogUserInfosGetCall) MaxPosts(maxPosts int64) *BlogUserInfosGetCall { + c.opt_["maxPosts"] = maxPosts + return c +} + +func (c *BlogUserInfosGetCall) Do() (*Service1, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxPosts"]; ok { + params.Set("maxPosts", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Service1) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one blog and user info pair by blogId and userId.", + // "httpMethod": "GET", + // "id": "blogger.blogUserInfos.get", + // "parameterOrder": [ + // "userId", + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the blog to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxPosts": { + // "description": "Maximum number of posts to pull back with the blog.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "userId": { + // "description": "ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userId}/blogs/{blogId}", + // "response": { + // "$ref": "Service" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.blogs.get": + +type BlogsGetCall struct { + s *Service + blogId string + opt_ map[string]interface{} +} + +// Get: Gets one blog by id. +func (r *BlogsService) Get(blogId string) *BlogsGetCall { + c := &BlogsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + return c +} + +// MaxPosts sets the optional parameter "maxPosts": Maximum number of +// posts to pull back with the blog. +func (c *BlogsGetCall) MaxPosts(maxPosts int64) *BlogsGetCall { + c.opt_["maxPosts"] = maxPosts + return c +} + +func (c *BlogsGetCall) Do() (*Blog, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxPosts"]; ok { + params.Set("maxPosts", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Blog) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one blog by id.", + // "httpMethod": "GET", + // "id": "blogger.blogs.get", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the blog to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxPosts": { + // "description": "Maximum number of posts to pull back with the blog.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // } + // }, + // "path": "blogs/{blogId}", + // "response": { + // "$ref": "Blog" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.blogs.getByUrl": + +type BlogsGetByUrlCall struct { + s *Service + url string + opt_ map[string]interface{} +} + +// GetByUrl: Retrieve a Blog by URL. +func (r *BlogsService) GetByUrl(url string) *BlogsGetByUrlCall { + c := &BlogsGetByUrlCall{s: r.s, opt_: make(map[string]interface{})} + c.url = url + return c +} + +func (c *BlogsGetByUrlCall) Do() (*Blog, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("url", fmt.Sprintf("%v", c.url)) + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/byurl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Blog) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve a Blog by URL.", + // "httpMethod": "GET", + // "id": "blogger.blogs.getByUrl", + // "parameterOrder": [ + // "url" + // ], + // "parameters": { + // "url": { + // "description": "The URL of the blog to retrieve.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/byurl", + // "response": { + // "$ref": "Blog" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.blogs.listByUser": + +type BlogsListByUserCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// ListByUser: Retrieves a list of blogs, possibly filtered. +func (r *BlogsService) ListByUser(userId string) *BlogsListByUserCall { + c := &BlogsListByUserCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// FetchUserInfo sets the optional parameter "fetchUserInfo": Whether +// the response is a list of blogs with per-user information instead of +// just blogs. +func (c *BlogsListByUserCall) FetchUserInfo(fetchUserInfo bool) *BlogsListByUserCall { + c.opt_["fetchUserInfo"] = fetchUserInfo + return c +} + +// View sets the optional parameter "view": +func (c *BlogsListByUserCall) View(view string) *BlogsListByUserCall { + c.opt_["view"] = view + return c +} + +func (c *BlogsListByUserCall) Do() (*BlogList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["fetchUserInfo"]; ok { + params.Set("fetchUserInfo", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BlogList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of blogs, possibly filtered.", + // "httpMethod": "GET", + // "id": "blogger.blogs.listByUser", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "fetchUserInfo": { + // "description": "Whether the response is a list of blogs with per-user information instead of just blogs.", + // "location": "query", + // "type": "boolean" + // }, + // "userId": { + // "description": "ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "view": { + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Admin level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "users/{userId}/blogs", + // "response": { + // "$ref": "BlogList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.comments.approve": + +type CommentsApproveCall struct { + s *Service + blogId string + postId string + commentId string + opt_ map[string]interface{} +} + +// Approve: Marks a comment as not spam. +func (r *CommentsService) Approve(blogId string, postId string, commentId string) *CommentsApproveCall { + c := &CommentsApproveCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.commentId = commentId + return c +} + +func (c *CommentsApproveCall) Do() (*Comment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Marks a comment as not spam.", + // "httpMethod": "POST", + // "id": "blogger.comments.approve", + // "parameterOrder": [ + // "blogId", + // "postId", + // "commentId" + // ], + // "parameters": { + // "blogId": { + // "description": "The Id of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "commentId": { + // "description": "The ID of the comment to mark as not spam.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve", + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.comments.delete": + +type CommentsDeleteCall struct { + s *Service + blogId string + postId string + commentId string + opt_ map[string]interface{} +} + +// Delete: Delete a comment by id. +func (r *CommentsService) Delete(blogId string, postId string, commentId string) *CommentsDeleteCall { + c := &CommentsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.commentId = commentId + return c +} + +func (c *CommentsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a comment by id.", + // "httpMethod": "DELETE", + // "id": "blogger.comments.delete", + // "parameterOrder": [ + // "blogId", + // "postId", + // "commentId" + // ], + // "parameters": { + // "blogId": { + // "description": "The Id of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "commentId": { + // "description": "The ID of the comment to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}", + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.comments.get": + +type CommentsGetCall struct { + s *Service + blogId string + postId string + commentId string + opt_ map[string]interface{} +} + +// Get: Gets one comment by id. +func (r *CommentsService) Get(blogId string, postId string, commentId string) *CommentsGetCall { + c := &CommentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.commentId = commentId + return c +} + +func (c *CommentsGetCall) Do() (*Comment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one comment by id.", + // "httpMethod": "GET", + // "id": "blogger.comments.get", + // "parameterOrder": [ + // "blogId", + // "postId", + // "commentId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to containing the comment.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "commentId": { + // "description": "The ID of the comment to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "ID of the post to fetch posts from.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}", + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.comments.list": + +type CommentsListCall struct { + s *Service + blogId string + postId string + opt_ map[string]interface{} +} + +// List: Retrieves the comments for a post, possibly filtered. +func (r *CommentsService) List(blogId string, postId string) *CommentsListCall { + c := &CommentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + return c +} + +// EndDate sets the optional parameter "endDate": Latest date of comment +// to fetch, a date-time with RFC 3339 formatting. +func (c *CommentsListCall) EndDate(endDate string) *CommentsListCall { + c.opt_["endDate"] = endDate + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether the +// body content of the comments is included. +func (c *CommentsListCall) FetchBodies(fetchBodies bool) *CommentsListCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of comments to include in the result. +func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// if request is paged. +func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartDate sets the optional parameter "startDate": Earliest date of +// comment to fetch, a date-time with RFC 3339 formatting. +func (c *CommentsListCall) StartDate(startDate string) *CommentsListCall { + c.opt_["startDate"] = startDate + return c +} + +// Statuses sets the optional parameter "statuses": +func (c *CommentsListCall) Statuses(statuses string) *CommentsListCall { + c.opt_["statuses"] = statuses + return c +} + +// View sets the optional parameter "view": +func (c *CommentsListCall) View(view string) *CommentsListCall { + c.opt_["view"] = view + return c +} + +func (c *CommentsListCall) Do() (*CommentList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["endDate"]; ok { + params.Set("endDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startDate"]; ok { + params.Set("startDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["statuses"]; ok { + params.Set("statuses", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommentList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the comments for a post, possibly filtered.", + // "httpMethod": "GET", + // "id": "blogger.comments.list", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch comments from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "endDate": { + // "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "fetchBodies": { + // "description": "Whether the body content of the comments is included.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "Maximum number of comments to include in the result.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token if request is paged.", + // "location": "query", + // "type": "string" + // }, + // "postId": { + // "description": "ID of the post to fetch posts from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startDate": { + // "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "statuses": { + // "enum": [ + // "emptied", + // "live", + // "pending", + // "spam" + // ], + // "enumDescriptions": [ + // "Comments that have had their content removed", + // "Comments that are publicly visible", + // "Comments that are awaiting administrator approval", + // "Comments marked as spam by the administrator" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "view": { + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Admin level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments", + // "response": { + // "$ref": "CommentList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.comments.listByBlog": + +type CommentsListByBlogCall struct { + s *Service + blogId string + opt_ map[string]interface{} +} + +// ListByBlog: Retrieves the comments for a blog, across all posts, +// possibly filtered. +func (r *CommentsService) ListByBlog(blogId string) *CommentsListByBlogCall { + c := &CommentsListByBlogCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + return c +} + +// EndDate sets the optional parameter "endDate": Latest date of comment +// to fetch, a date-time with RFC 3339 formatting. +func (c *CommentsListByBlogCall) EndDate(endDate string) *CommentsListByBlogCall { + c.opt_["endDate"] = endDate + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether the +// body content of the comments is included. +func (c *CommentsListByBlogCall) FetchBodies(fetchBodies bool) *CommentsListByBlogCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of comments to include in the result. +func (c *CommentsListByBlogCall) MaxResults(maxResults int64) *CommentsListByBlogCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// if request is paged. +func (c *CommentsListByBlogCall) PageToken(pageToken string) *CommentsListByBlogCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartDate sets the optional parameter "startDate": Earliest date of +// comment to fetch, a date-time with RFC 3339 formatting. +func (c *CommentsListByBlogCall) StartDate(startDate string) *CommentsListByBlogCall { + c.opt_["startDate"] = startDate + return c +} + +func (c *CommentsListByBlogCall) Do() (*CommentList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["endDate"]; ok { + params.Set("endDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startDate"]; ok { + params.Set("startDate", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommentList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the comments for a blog, across all posts, possibly filtered.", + // "httpMethod": "GET", + // "id": "blogger.comments.listByBlog", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch comments from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "endDate": { + // "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "fetchBodies": { + // "description": "Whether the body content of the comments is included.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "Maximum number of comments to include in the result.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token if request is paged.", + // "location": "query", + // "type": "string" + // }, + // "startDate": { + // "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/comments", + // "response": { + // "$ref": "CommentList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.comments.markAsSpam": + +type CommentsMarkAsSpamCall struct { + s *Service + blogId string + postId string + commentId string + opt_ map[string]interface{} +} + +// MarkAsSpam: Marks a comment as spam. +func (r *CommentsService) MarkAsSpam(blogId string, postId string, commentId string) *CommentsMarkAsSpamCall { + c := &CommentsMarkAsSpamCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.commentId = commentId + return c +} + +func (c *CommentsMarkAsSpamCall) Do() (*Comment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Marks a comment as spam.", + // "httpMethod": "POST", + // "id": "blogger.comments.markAsSpam", + // "parameterOrder": [ + // "blogId", + // "postId", + // "commentId" + // ], + // "parameters": { + // "blogId": { + // "description": "The Id of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "commentId": { + // "description": "The ID of the comment to mark as spam.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam", + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.comments.removeContent": + +type CommentsRemoveContentCall struct { + s *Service + blogId string + postId string + commentId string + opt_ map[string]interface{} +} + +// RemoveContent: Removes the content of a comment. +func (r *CommentsService) RemoveContent(blogId string, postId string, commentId string) *CommentsRemoveContentCall { + c := &CommentsRemoveContentCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.commentId = commentId + return c +} + +func (c *CommentsRemoveContentCall) Do() (*Comment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes the content of a comment.", + // "httpMethod": "POST", + // "id": "blogger.comments.removeContent", + // "parameterOrder": [ + // "blogId", + // "postId", + // "commentId" + // ], + // "parameters": { + // "blogId": { + // "description": "The Id of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "commentId": { + // "description": "The ID of the comment to delete content from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent", + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pageViews.get": + +type PageViewsGetCall struct { + s *Service + blogId string + opt_ map[string]interface{} +} + +// Get: Retrieve pageview stats for a Blog. +func (r *PageViewsService) Get(blogId string) *PageViewsGetCall { + c := &PageViewsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + return c +} + +// Range sets the optional parameter "range": +func (c *PageViewsGetCall) Range(range_ string) *PageViewsGetCall { + c.opt_["range"] = range_ + return c +} + +func (c *PageViewsGetCall) Do() (*Pageviews, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["range"]; ok { + params.Set("range", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pageviews") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Pageviews) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve pageview stats for a Blog.", + // "httpMethod": "GET", + // "id": "blogger.pageViews.get", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the blog to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "range": { + // "enum": [ + // "30DAYS", + // "7DAYS", + // "all" + // ], + // "enumDescriptions": [ + // "Page view counts from the last thirty days.", + // "Page view counts from the last seven days.", + // "Total page view counts from all time." + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pageviews", + // "response": { + // "$ref": "Pageviews" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pages.delete": + +type PagesDeleteCall struct { + s *Service + blogId string + pageId string + opt_ map[string]interface{} +} + +// Delete: Delete a page by id. +func (r *PagesService) Delete(blogId string, pageId string) *PagesDeleteCall { + c := &PagesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.pageId = pageId + return c +} + +func (c *PagesDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{pageId}", url.QueryEscape(c.pageId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a page by id.", + // "httpMethod": "DELETE", + // "id": "blogger.pages.delete", + // "parameterOrder": [ + // "blogId", + // "pageId" + // ], + // "parameters": { + // "blogId": { + // "description": "The Id of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageId": { + // "description": "The ID of the Page.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages/{pageId}", + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pages.get": + +type PagesGetCall struct { + s *Service + blogId string + pageId string + opt_ map[string]interface{} +} + +// Get: Gets one blog page by id. +func (r *PagesService) Get(blogId string, pageId string) *PagesGetCall { + c := &PagesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.pageId = pageId + return c +} + +// View sets the optional parameter "view": +func (c *PagesGetCall) View(view string) *PagesGetCall { + c.opt_["view"] = view + return c +} + +func (c *PagesGetCall) Do() (*Page, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{pageId}", url.QueryEscape(c.pageId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Page) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one blog page by id.", + // "httpMethod": "GET", + // "id": "blogger.pages.get", + // "parameterOrder": [ + // "blogId", + // "pageId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog containing the page.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageId": { + // "description": "The ID of the page to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "view": { + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Admin level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages/{pageId}", + // "response": { + // "$ref": "Page" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.pages.insert": + +type PagesInsertCall struct { + s *Service + blogId string + page *Page + opt_ map[string]interface{} +} + +// Insert: Add a page. +func (r *PagesService) Insert(blogId string, page *Page) *PagesInsertCall { + c := &PagesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.page = page + return c +} + +func (c *PagesInsertCall) Do() (*Page, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Page) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add a page.", + // "httpMethod": "POST", + // "id": "blogger.pages.insert", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to add the page to.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages", + // "request": { + // "$ref": "Page" + // }, + // "response": { + // "$ref": "Page" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pages.list": + +type PagesListCall struct { + s *Service + blogId string + opt_ map[string]interface{} +} + +// List: Retrieves the pages for a blog, optionally including non-LIVE +// statuses. +func (r *PagesService) List(blogId string) *PagesListCall { + c := &PagesListCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether to +// retrieve the Page bodies. +func (c *PagesListCall) FetchBodies(fetchBodies bool) *PagesListCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// Statuses sets the optional parameter "statuses": +func (c *PagesListCall) Statuses(statuses string) *PagesListCall { + c.opt_["statuses"] = statuses + return c +} + +// View sets the optional parameter "view": +func (c *PagesListCall) View(view string) *PagesListCall { + c.opt_["view"] = view + return c +} + +func (c *PagesListCall) Do() (*PageList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["statuses"]; ok { + params.Set("statuses", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PageList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the pages for a blog, optionally including non-LIVE statuses.", + // "httpMethod": "GET", + // "id": "blogger.pages.list", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch pages from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fetchBodies": { + // "description": "Whether to retrieve the Page bodies.", + // "location": "query", + // "type": "boolean" + // }, + // "statuses": { + // "enum": [ + // "draft", + // "imported", + // "live" + // ], + // "enumDescriptions": [ + // "Draft (unpublished) Pages", + // "Pages that have had their content removed", + // "Pages that are publicly visible" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "view": { + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Admin level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages", + // "response": { + // "$ref": "PageList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.pages.patch": + +type PagesPatchCall struct { + s *Service + blogId string + pageId string + page *Page + opt_ map[string]interface{} +} + +// Patch: Update a page. This method supports patch semantics. +func (r *PagesService) Patch(blogId string, pageId string, page *Page) *PagesPatchCall { + c := &PagesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.pageId = pageId + c.page = page + return c +} + +func (c *PagesPatchCall) Do() (*Page, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{pageId}", url.QueryEscape(c.pageId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Page) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a page. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "blogger.pages.patch", + // "parameterOrder": [ + // "blogId", + // "pageId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageId": { + // "description": "The ID of the Page.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages/{pageId}", + // "request": { + // "$ref": "Page" + // }, + // "response": { + // "$ref": "Page" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pages.update": + +type PagesUpdateCall struct { + s *Service + blogId string + pageId string + page *Page + opt_ map[string]interface{} +} + +// Update: Update a page. +func (r *PagesService) Update(blogId string, pageId string, page *Page) *PagesUpdateCall { + c := &PagesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.pageId = pageId + c.page = page + return c +} + +func (c *PagesUpdateCall) Do() (*Page, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{pageId}", url.QueryEscape(c.pageId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Page) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a page.", + // "httpMethod": "PUT", + // "id": "blogger.pages.update", + // "parameterOrder": [ + // "blogId", + // "pageId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageId": { + // "description": "The ID of the Page.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/pages/{pageId}", + // "request": { + // "$ref": "Page" + // }, + // "response": { + // "$ref": "Page" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.postUserInfos.get": + +type PostUserInfosGetCall struct { + s *Service + userId string + blogId string + postId string + opt_ map[string]interface{} +} + +// Get: Gets one post and user info pair by postId and userId. +func (r *PostUserInfosService) Get(userId string, blogId string, postId string) *PostUserInfosGetCall { + c := &PostUserInfosGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.blogId = blogId + c.postId = postId + return c +} + +// MaxComments sets the optional parameter "maxComments": Maximum number +// of comments to pull back on a post. +func (c *PostUserInfosGetCall) MaxComments(maxComments int64) *PostUserInfosGetCall { + c.opt_["maxComments"] = maxComments + return c +} + +func (c *PostUserInfosGetCall) Do() (*PostUserInfo, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxComments"]; ok { + params.Set("maxComments", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PostUserInfo) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one post and user info pair by postId and userId.", + // "httpMethod": "GET", + // "id": "blogger.postUserInfos.get", + // "parameterOrder": [ + // "userId", + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxComments": { + // "description": "Maximum number of comments to pull back on a post.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "postId": { + // "description": "The ID of the post to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userId}/blogs/{blogId}/posts/{postId}", + // "response": { + // "$ref": "PostUserInfo" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.postUserInfos.list": + +type PostUserInfosListCall struct { + s *Service + userId string + blogId string + opt_ map[string]interface{} +} + +// List: Retrieves a list of post and user info pairs, possibly +// filtered. +func (r *PostUserInfosService) List(userId string, blogId string) *PostUserInfosListCall { + c := &PostUserInfosListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.blogId = blogId + return c +} + +// EndDate sets the optional parameter "endDate": Latest post date to +// fetch, a date-time with RFC 3339 formatting. +func (c *PostUserInfosListCall) EndDate(endDate string) *PostUserInfosListCall { + c.opt_["endDate"] = endDate + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether the +// body content of posts is included. +func (c *PostUserInfosListCall) FetchBodies(fetchBodies bool) *PostUserInfosListCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// Labels sets the optional parameter "labels": Comma-separated list of +// labels to search for. +func (c *PostUserInfosListCall) Labels(labels string) *PostUserInfosListCall { + c.opt_["labels"] = labels + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of posts to fetch. +func (c *PostUserInfosListCall) MaxResults(maxResults int64) *PostUserInfosListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sort search results +func (c *PostUserInfosListCall) OrderBy(orderBy string) *PostUserInfosListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// if the request is paged. +func (c *PostUserInfosListCall) PageToken(pageToken string) *PostUserInfosListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartDate sets the optional parameter "startDate": Earliest post date +// to fetch, a date-time with RFC 3339 formatting. +func (c *PostUserInfosListCall) StartDate(startDate string) *PostUserInfosListCall { + c.opt_["startDate"] = startDate + return c +} + +// Statuses sets the optional parameter "statuses": +func (c *PostUserInfosListCall) Statuses(statuses string) *PostUserInfosListCall { + c.opt_["statuses"] = statuses + return c +} + +// View sets the optional parameter "view": +func (c *PostUserInfosListCall) View(view string) *PostUserInfosListCall { + c.opt_["view"] = view + return c +} + +func (c *PostUserInfosListCall) Do() (*PostUserInfosList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["endDate"]; ok { + params.Set("endDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["labels"]; ok { + params.Set("labels", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startDate"]; ok { + params.Set("startDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["statuses"]; ok { + params.Set("statuses", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PostUserInfosList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of post and user info pairs, possibly filtered.", + // "httpMethod": "GET", + // "id": "blogger.postUserInfos.list", + // "parameterOrder": [ + // "userId", + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch posts from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "endDate": { + // "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "fetchBodies": { + // "description": "Whether the body content of posts is included.", + // "location": "query", + // "type": "boolean" + // }, + // "labels": { + // "description": "Comma-separated list of labels to search for.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of posts to fetch.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "orderBy": { + // "default": "PUBLISHED", + // "description": "Sort search results", + // "enum": [ + // "published", + // "updated" + // ], + // "enumDescriptions": [ + // "Order by the date the post was published", + // "Order by the date the post was last updated" + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Continuation token if the request is paged.", + // "location": "query", + // "type": "string" + // }, + // "startDate": { + // "description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "statuses": { + // "enum": [ + // "draft", + // "live", + // "scheduled" + // ], + // "enumDescriptions": [ + // "Draft posts", + // "Published posts", + // "Posts that are scheduled to publish in future." + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "userId": { + // "description": "ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "view": { + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Reader level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "users/{userId}/blogs/{blogId}/posts", + // "response": { + // "$ref": "PostUserInfosList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.posts.delete": + +type PostsDeleteCall struct { + s *Service + blogId string + postId string + opt_ map[string]interface{} +} + +// Delete: Delete a post by id. +func (r *PostsService) Delete(blogId string, postId string) *PostsDeleteCall { + c := &PostsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + return c +} + +func (c *PostsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a post by id.", + // "httpMethod": "DELETE", + // "id": "blogger.posts.delete", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "The Id of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}", + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.posts.get": + +type PostsGetCall struct { + s *Service + blogId string + postId string + opt_ map[string]interface{} +} + +// Get: Get a post by id. +func (r *PostsService) Get(blogId string, postId string) *PostsGetCall { + c := &PostsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + return c +} + +// MaxComments sets the optional parameter "maxComments": Maximum number +// of comments to pull back on a post. +func (c *PostsGetCall) MaxComments(maxComments int64) *PostsGetCall { + c.opt_["maxComments"] = maxComments + return c +} + +// View sets the optional parameter "view": +func (c *PostsGetCall) View(view string) *PostsGetCall { + c.opt_["view"] = view + return c +} + +func (c *PostsGetCall) Do() (*Post, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxComments"]; ok { + params.Set("maxComments", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a post by id.", + // "httpMethod": "GET", + // "id": "blogger.posts.get", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch the post from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxComments": { + // "description": "Maximum number of comments to pull back on a post.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "postId": { + // "description": "The ID of the post", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "view": { + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Admin level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}", + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.posts.getByPath": + +type PostsGetByPathCall struct { + s *Service + blogId string + path string + opt_ map[string]interface{} +} + +// GetByPath: Retrieve a Post by Path. +func (r *PostsService) GetByPath(blogId string, path string) *PostsGetByPathCall { + c := &PostsGetByPathCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.path = path + return c +} + +// MaxComments sets the optional parameter "maxComments": Maximum number +// of comments to pull back on a post. +func (c *PostsGetByPathCall) MaxComments(maxComments int64) *PostsGetByPathCall { + c.opt_["maxComments"] = maxComments + return c +} + +// View sets the optional parameter "view": +func (c *PostsGetByPathCall) View(view string) *PostsGetByPathCall { + c.opt_["view"] = view + return c +} + +func (c *PostsGetByPathCall) Do() (*Post, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("path", fmt.Sprintf("%v", c.path)) + if v, ok := c.opt_["maxComments"]; ok { + params.Set("maxComments", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/bypath") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve a Post by Path.", + // "httpMethod": "GET", + // "id": "blogger.posts.getByPath", + // "parameterOrder": [ + // "blogId", + // "path" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch the post from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxComments": { + // "description": "Maximum number of comments to pull back on a post.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "path": { + // "description": "Path of the Post to retrieve.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "view": { + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Admin level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/bypath", + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.posts.insert": + +type PostsInsertCall struct { + s *Service + blogId string + post *Post + opt_ map[string]interface{} +} + +// Insert: Add a post. +func (r *PostsService) Insert(blogId string, post *Post) *PostsInsertCall { + c := &PostsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.post = post + return c +} + +// IsDraft sets the optional parameter "isDraft": Whether to create the +// post as a draft +func (c *PostsInsertCall) IsDraft(isDraft bool) *PostsInsertCall { + c.opt_["isDraft"] = isDraft + return c +} + +func (c *PostsInsertCall) Do() (*Post, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["isDraft"]; ok { + params.Set("isDraft", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add a post.", + // "httpMethod": "POST", + // "id": "blogger.posts.insert", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to add the post to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "isDraft": { + // "description": "Whether to create the post as a draft", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "blogs/{blogId}/posts", + // "request": { + // "$ref": "Post" + // }, + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.posts.list": + +type PostsListCall struct { + s *Service + blogId string + opt_ map[string]interface{} +} + +// List: Retrieves a list of posts, possibly filtered. +func (r *PostsService) List(blogId string) *PostsListCall { + c := &PostsListCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + return c +} + +// EndDate sets the optional parameter "endDate": Latest post date to +// fetch, a date-time with RFC 3339 formatting. +func (c *PostsListCall) EndDate(endDate string) *PostsListCall { + c.opt_["endDate"] = endDate + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether the +// body content of posts is included (default: true). This should be set +// to false when the post bodies are not required, to help minimize +// traffic. +func (c *PostsListCall) FetchBodies(fetchBodies bool) *PostsListCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// FetchImages sets the optional parameter "fetchImages": Whether image +// URL metadata for each post is included. +func (c *PostsListCall) FetchImages(fetchImages bool) *PostsListCall { + c.opt_["fetchImages"] = fetchImages + return c +} + +// Labels sets the optional parameter "labels": Comma-separated list of +// labels to search for. +func (c *PostsListCall) Labels(labels string) *PostsListCall { + c.opt_["labels"] = labels + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of posts to fetch. +func (c *PostsListCall) MaxResults(maxResults int64) *PostsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sort search results +func (c *PostsListCall) OrderBy(orderBy string) *PostsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// if the request is paged. +func (c *PostsListCall) PageToken(pageToken string) *PostsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartDate sets the optional parameter "startDate": Earliest post date +// to fetch, a date-time with RFC 3339 formatting. +func (c *PostsListCall) StartDate(startDate string) *PostsListCall { + c.opt_["startDate"] = startDate + return c +} + +// Statuses sets the optional parameter "statuses": +func (c *PostsListCall) Statuses(statuses string) *PostsListCall { + c.opt_["statuses"] = statuses + return c +} + +// View sets the optional parameter "view": +func (c *PostsListCall) View(view string) *PostsListCall { + c.opt_["view"] = view + return c +} + +func (c *PostsListCall) Do() (*PostList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["endDate"]; ok { + params.Set("endDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fetchImages"]; ok { + params.Set("fetchImages", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["labels"]; ok { + params.Set("labels", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startDate"]; ok { + params.Set("startDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["statuses"]; ok { + params.Set("statuses", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PostList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of posts, possibly filtered.", + // "httpMethod": "GET", + // "id": "blogger.posts.list", + // "parameterOrder": [ + // "blogId" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch posts from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "endDate": { + // "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "fetchBodies": { + // "default": "true", + // "description": "Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.", + // "location": "query", + // "type": "boolean" + // }, + // "fetchImages": { + // "description": "Whether image URL metadata for each post is included.", + // "location": "query", + // "type": "boolean" + // }, + // "labels": { + // "description": "Comma-separated list of labels to search for.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of posts to fetch.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "orderBy": { + // "default": "PUBLISHED", + // "description": "Sort search results", + // "enum": [ + // "published", + // "updated" + // ], + // "enumDescriptions": [ + // "Order by the date the post was published", + // "Order by the date the post was last updated" + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Continuation token if the request is paged.", + // "location": "query", + // "type": "string" + // }, + // "startDate": { + // "description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "statuses": { + // "enum": [ + // "draft", + // "live", + // "scheduled" + // ], + // "enumDescriptions": [ + // "Draft posts", + // "Published posts", + // "Posts that are scheduled to publish in future." + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "view": { + // "enum": [ + // "ADMIN", + // "AUTHOR", + // "READER" + // ], + // "enumDescriptions": [ + // "Admin level detail", + // "Author level detail", + // "Reader level detail" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts", + // "response": { + // "$ref": "PostList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.posts.patch": + +type PostsPatchCall struct { + s *Service + blogId string + postId string + post *Post + opt_ map[string]interface{} +} + +// Patch: Update a post. This method supports patch semantics. +func (r *PostsService) Patch(blogId string, postId string, post *Post) *PostsPatchCall { + c := &PostsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.post = post + return c +} + +func (c *PostsPatchCall) Do() (*Post, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a post. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "blogger.posts.patch", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}", + // "request": { + // "$ref": "Post" + // }, + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.posts.publish": + +type PostsPublishCall struct { + s *Service + blogId string + postId string + opt_ map[string]interface{} +} + +// Publish: Publish a draft post. +func (r *PostsService) Publish(blogId string, postId string) *PostsPublishCall { + c := &PostsPublishCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + return c +} + +// PublishDate sets the optional parameter "publishDate": The date and +// time to schedule the publishing of the Blog. +func (c *PostsPublishCall) PublishDate(publishDate string) *PostsPublishCall { + c.opt_["publishDate"] = publishDate + return c +} + +func (c *PostsPublishCall) Do() (*Post, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["publishDate"]; ok { + params.Set("publishDate", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/publish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Publish a draft post.", + // "httpMethod": "POST", + // "id": "blogger.posts.publish", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "publishDate": { + // "description": "The date and time to schedule the publishing of the Blog.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/publish", + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.posts.revert": + +type PostsRevertCall struct { + s *Service + blogId string + postId string + opt_ map[string]interface{} +} + +// Revert: Revert a published or scheduled post to draft state. +func (r *PostsService) Revert(blogId string, postId string) *PostsRevertCall { + c := &PostsRevertCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + return c +} + +func (c *PostsRevertCall) Do() (*Post, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/revert") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Revert a published or scheduled post to draft state.", + // "httpMethod": "POST", + // "id": "blogger.posts.revert", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}/revert", + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.posts.search": + +type PostsSearchCall struct { + s *Service + blogId string + q string + opt_ map[string]interface{} +} + +// Search: Search for a post. +func (r *PostsService) Search(blogId string, q string) *PostsSearchCall { + c := &PostsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.q = q + return c +} + +// FetchBodies sets the optional parameter "fetchBodies": Whether the +// body content of posts is included (default: true). This should be set +// to false when the post bodies are not required, to help minimize +// traffic. +func (c *PostsSearchCall) FetchBodies(fetchBodies bool) *PostsSearchCall { + c.opt_["fetchBodies"] = fetchBodies + return c +} + +// OrderBy sets the optional parameter "orderBy": Sort search results +func (c *PostsSearchCall) OrderBy(orderBy string) *PostsSearchCall { + c.opt_["orderBy"] = orderBy + return c +} + +func (c *PostsSearchCall) Do() (*PostList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("q", fmt.Sprintf("%v", c.q)) + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/search") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PostList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Search for a post.", + // "httpMethod": "GET", + // "id": "blogger.posts.search", + // "parameterOrder": [ + // "blogId", + // "q" + // ], + // "parameters": { + // "blogId": { + // "description": "ID of the blog to fetch the post from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fetchBodies": { + // "default": "true", + // "description": "Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.", + // "location": "query", + // "type": "boolean" + // }, + // "orderBy": { + // "default": "PUBLISHED", + // "description": "Sort search results", + // "enum": [ + // "published", + // "updated" + // ], + // "enumDescriptions": [ + // "Order by the date the post was published", + // "Order by the date the post was last updated" + // ], + // "location": "query", + // "type": "string" + // }, + // "q": { + // "description": "Query terms to search this blog for matching posts.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/search", + // "response": { + // "$ref": "PostList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} + +// method id "blogger.posts.update": + +type PostsUpdateCall struct { + s *Service + blogId string + postId string + post *Post + opt_ map[string]interface{} +} + +// Update: Update a post. +func (r *PostsService) Update(blogId string, postId string, post *Post) *PostsUpdateCall { + c := &PostsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.postId = postId + c.post = post + return c +} + +func (c *PostsUpdateCall) Do() (*Post, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{blogId}", url.QueryEscape(c.blogId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{postId}", url.QueryEscape(c.postId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Post) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a post.", + // "httpMethod": "PUT", + // "id": "blogger.posts.update", + // "parameterOrder": [ + // "blogId", + // "postId" + // ], + // "parameters": { + // "blogId": { + // "description": "The ID of the Blog.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "postId": { + // "description": "The ID of the Post.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "blogs/{blogId}/posts/{postId}", + // "request": { + // "$ref": "Post" + // }, + // "response": { + // "$ref": "Post" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.users.get": + +type UsersGetCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// Get: Gets one user by id. +func (r *UsersService) Get(userId string) *UsersGetCall { + c := &UsersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +func (c *UsersGetCall) Do() (*User, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(User) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one user by id.", + // "httpMethod": "GET", + // "id": "blogger.users.get", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "description": "The ID of the user to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/{userId}", + // "response": { + // "$ref": "User" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger", + // "https://www.googleapis.com/auth/blogger.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/googleapi/googleapi.go b/third_party/src/code.google.com/p/google-api-go-client/googleapi/googleapi.go new file mode 100644 index 0000000000000..65e77d068c649 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/googleapi/googleapi.go @@ -0,0 +1,307 @@ +// Copyright 2011 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package googleapi contains the common code shared by all Google API +// libraries. +package googleapi + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "io/ioutil" + "mime/multipart" + "net/http" + "net/textproto" + "net/url" + "os" + "strings" +) + +// ContentTyper is an interface for Readers which know (or would like +// to override) their Content-Type. If a media body doesn't implement +// ContentTyper, the type is sniffed from the content using +// http.DetectContentType. +type ContentTyper interface { + ContentType() string +} + +const Version = "0.5" + +// Error contains an error response from the server. +type Error struct { + // Code is the HTTP response status code and will always be populated. + Code int `json:"code"` + // Message is the server response message and is only populated when + // explicitly referenced by the JSON server response. + Message string `json:"message"` + // Body is the raw response returned by the server. + // It is often but not always JSON, depending on how the request fails. + Body string +} + +func (e *Error) Error() string { + if e.Message != "" { + return fmt.Sprintf("googleapi: Error %d: %v", e.Code, e.Message) + } + return fmt.Sprintf("googleapi: got HTTP response code %d with body: %v", e.Code, e.Body) +} + +type errorReply struct { + Error *Error `json:"error"` +} + +// CheckResponse returns an error (of type *Error) if the response +// status code is not 2xx. +func CheckResponse(res *http.Response) error { + if res.StatusCode >= 200 && res.StatusCode <= 299 { + return nil + } + slurp, err := ioutil.ReadAll(res.Body) + if err == nil { + jerr := new(errorReply) + err = json.Unmarshal(slurp, jerr) + if err == nil && jerr.Error != nil { + if jerr.Error.Code == 0 { + jerr.Error.Code = res.StatusCode + } + jerr.Error.Body = string(slurp) + return jerr.Error + } + } + return &Error{ + Code: res.StatusCode, + Body: string(slurp), + } +} + +type MarshalStyle bool + +var WithDataWrapper = MarshalStyle(true) +var WithoutDataWrapper = MarshalStyle(false) + +func (wrap MarshalStyle) JSONReader(v interface{}) (io.Reader, error) { + buf := new(bytes.Buffer) + if wrap { + buf.Write([]byte(`{"data": `)) + } + err := json.NewEncoder(buf).Encode(v) + if err != nil { + return nil, err + } + if wrap { + buf.Write([]byte(`}`)) + } + return buf, nil +} + +func getMediaType(media io.Reader) (io.Reader, string) { + if typer, ok := media.(ContentTyper); ok { + return media, typer.ContentType() + } + + typ := "application/octet-stream" + buf := make([]byte, 1024) + n, err := media.Read(buf) + buf = buf[:n] + if err == nil { + typ = http.DetectContentType(buf) + } + return io.MultiReader(bytes.NewBuffer(buf), media), typ +} + +type Lengther interface { + Len() int +} + +// endingWithErrorReader from r until it returns an error. If the +// final error from r is os.EOF and e is non-nil, e is used instead. +type endingWithErrorReader struct { + r io.Reader + e error +} + +func (er endingWithErrorReader) Read(p []byte) (n int, err error) { + n, err = er.r.Read(p) + if err == io.EOF && er.e != nil { + err = er.e + } + return +} + +func getReaderSize(r io.Reader) (io.Reader, int64) { + // Ideal case, the reader knows its own size. + if lr, ok := r.(Lengther); ok { + return r, int64(lr.Len()) + } + + // But maybe it's a seeker and we can seek to the end to find its size. + if s, ok := r.(io.Seeker); ok { + pos0, err := s.Seek(0, os.SEEK_CUR) + if err == nil { + posend, err := s.Seek(0, os.SEEK_END) + if err == nil { + _, err = s.Seek(pos0, os.SEEK_SET) + if err == nil { + return r, posend - pos0 + } else { + // We moved it forward but can't restore it. + // Seems unlikely, but can't really restore now. + return endingWithErrorReader{strings.NewReader(""), err}, posend - pos0 + } + } + } + } + + // Otherwise we have to make a copy to calculate how big the reader is. + buf := new(bytes.Buffer) + // TODO(bradfitz): put a cap on this copy? spill to disk after + // a certain point? + _, err := io.Copy(buf, r) + return endingWithErrorReader{buf, err}, int64(buf.Len()) +} + +func typeHeader(contentType string) textproto.MIMEHeader { + h := make(textproto.MIMEHeader) + h.Set("Content-Type", contentType) + return h +} + +// countingWriter counts the number of bytes it receives to write, but +// discards them. +type countingWriter struct { + n *int64 +} + +func (w countingWriter) Write(p []byte) (int, error) { + *w.n += int64(len(p)) + return len(p), nil +} + +// ConditionallyIncludeMedia does nothing if media is nil. +// +// bodyp is an in/out parameter. It should initially point to the +// reader of the application/json (or whatever) payload to send in the +// API request. It's updated to point to the multipart body reader. +// +// ctypep is an in/out parameter. It should initially point to the +// content type of the bodyp, usually "application/json". It's updated +// to the "multipart/related" content type, with random boundary. +// +// The return value is the content-length of the entire multpart body. +func ConditionallyIncludeMedia(media io.Reader, bodyp *io.Reader, ctypep *string) (totalContentLength int64, ok bool) { + if media == nil { + return + } + // Get the media type and size. The type check might return a + // different reader instance, so do the size check first, + // which looks at the specific type of the io.Reader. + var mediaType string + if typer, ok := media.(ContentTyper); ok { + mediaType = typer.ContentType() + } + media, mediaSize := getReaderSize(media) + if mediaType == "" { + media, mediaType = getMediaType(media) + } + body, bodyType := *bodyp, *ctypep + body, bodySize := getReaderSize(body) + + // Calculate how big the the multipart will be. + { + totalContentLength = bodySize + mediaSize + mpw := multipart.NewWriter(countingWriter{&totalContentLength}) + mpw.CreatePart(typeHeader(bodyType)) + mpw.CreatePart(typeHeader(mediaType)) + mpw.Close() + } + + pr, pw := io.Pipe() + mpw := multipart.NewWriter(pw) + *bodyp = pr + *ctypep = "multipart/related; boundary=" + mpw.Boundary() + go func() { + defer pw.Close() + defer mpw.Close() + + w, err := mpw.CreatePart(typeHeader(bodyType)) + if err != nil { + return + } + _, err = io.Copy(w, body) + if err != nil { + return + } + + w, err = mpw.CreatePart(typeHeader(mediaType)) + if err != nil { + return + } + _, err = io.Copy(w, media) + if err != nil { + return + } + }() + return totalContentLength, true +} + +func ResolveRelative(basestr, relstr string) string { + u, _ := url.Parse(basestr) + rel, _ := url.Parse(relstr) + u = u.ResolveReference(rel) + us := u.String() + us = strings.Replace(us, "%7B", "{", -1) + us = strings.Replace(us, "%7D", "}", -1) + return us +} + +// has4860Fix is whether this Go environment contains the fix for +// http://golang.org/issue/4860 +var has4860Fix bool + +// init initializes has4860Fix by checking the behavior of the net/http package. +func init() { + r := http.Request{ + URL: &url.URL{ + Scheme: "http", + Opaque: "//opaque", + }, + } + b := &bytes.Buffer{} + r.Write(b) + has4860Fix = bytes.HasPrefix(b.Bytes(), []byte("GET http")) +} + +// SetOpaque sets u.Opaque from u.Path such that HTTP requests to it +// don't alter any hex-escaped characters in u.Path. +func SetOpaque(u *url.URL) { + u.Opaque = "//" + u.Host + u.Path + if !has4860Fix { + u.Opaque = u.Scheme + ":" + u.Opaque + } +} + +// CloseBody is used to close res.Body. +// Prior to calling Close, it also tries to Read a small amount to see an EOF. +// Not seeing an EOF can prevent HTTP Transports from reusing connections. +func CloseBody(res *http.Response) { + if res == nil || res.Body == nil { + return + } + // Justification for 3 byte reads: two for up to "\r\n" after + // a JSON/XML document, and then 1 to see EOF if we haven't yet. + // TODO(bradfitz): detect Go 1.3+ and skip these reads. + // See https://codereview.appspot.com/58240043 + // and https://codereview.appspot.com/49570044 + buf := make([]byte, 1) + for i := 0; i < 3; i++ { + _, err := res.Body.Read(buf) + if err != nil { + break + } + } + res.Body.Close() + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/googleapi/googleapi_test.go b/third_party/src/code.google.com/p/google-api-go-client/googleapi/googleapi_test.go new file mode 100644 index 0000000000000..e646665e3da30 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/googleapi/googleapi_test.go @@ -0,0 +1,152 @@ +// Copyright 2011 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package googleapi + +import ( + "bytes" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "reflect" + "strings" + "testing" +) + +type SetOpaqueTest struct { + in *url.URL + wantRequestURI string +} + +var setOpaqueTests = []SetOpaqueTest{ + // no path + { + &url.URL{ + Scheme: "http", + Host: "www.golang.org", + }, + "http://www.golang.org", + }, + // path + { + &url.URL{ + Scheme: "http", + Host: "www.golang.org", + Path: "/", + }, + "http://www.golang.org/", + }, + // file with hex escaping + { + &url.URL{ + Scheme: "https", + Host: "www.golang.org", + Path: "/file%20one&two", + }, + "https://www.golang.org/file%20one&two", + }, + // query + { + &url.URL{ + Scheme: "http", + Host: "www.golang.org", + Path: "/", + RawQuery: "q=go+language", + }, + "http://www.golang.org/?q=go+language", + }, + // file with hex escaping in path plus query + { + &url.URL{ + Scheme: "https", + Host: "www.golang.org", + Path: "/file%20one&two", + RawQuery: "q=go+language", + }, + "https://www.golang.org/file%20one&two?q=go+language", + }, + // query with hex escaping + { + &url.URL{ + Scheme: "http", + Host: "www.golang.org", + Path: "/", + RawQuery: "q=go%20language", + }, + "http://www.golang.org/?q=go%20language", + }, +} + +// prefixTmpl is a template for the expected prefix of the output of writing +// an HTTP request. +const prefixTmpl = "GET %v HTTP/1.1\r\nHost: %v\r\n" + +func TestSetOpaque(t *testing.T) { + for _, test := range setOpaqueTests { + u := *test.in + SetOpaque(&u) + + w := &bytes.Buffer{} + r := &http.Request{URL: &u} + if err := r.Write(w); err != nil { + t.Errorf("write request: %v", err) + continue + } + + prefix := fmt.Sprintf(prefixTmpl, test.wantRequestURI, test.in.Host) + if got := string(w.Bytes()); !strings.HasPrefix(got, prefix) { + t.Errorf("got %q expected prefix %q", got, prefix) + } + } +} + +type CheckResponseTest struct { + in *http.Response + bodyText string + want error +} + +var checkResponseTests = []CheckResponseTest{ + { + &http.Response{ + StatusCode: http.StatusOK, + }, + "", + nil, + }, + { + &http.Response{ + StatusCode: http.StatusNotFound, + }, + `{"error":{"message":"Error message for StatusNotFound."}}`, + &Error{ + Code: http.StatusNotFound, + Message: "Error message for StatusNotFound.", + Body: `{"error":{"message":"Error message for StatusNotFound."}}`, + }, + }, + { + &http.Response{ + StatusCode: http.StatusBadRequest, + }, + `{"error":"invalid_token","error_description":"Invalid Value"}`, + &Error{ + Code: http.StatusBadRequest, + Body: `{"error":"invalid_token","error_description":"Invalid Value"}`, + }, + }, +} + +func TestCheckResponse(t *testing.T) { + for _, test := range checkResponseTests { + res := test.in + if test.bodyText != "" { + res.Body = ioutil.NopCloser(strings.NewReader(test.bodyText)) + } + if g := CheckResponse(res); !reflect.DeepEqual(g, test.want) { + t.Errorf("CheckResponse: got %v, want %v", g, test.want) + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/googleapi/transport/apikey.go b/third_party/src/code.google.com/p/google-api-go-client/googleapi/transport/apikey.go new file mode 100644 index 0000000000000..eca1ea2507711 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/googleapi/transport/apikey.go @@ -0,0 +1,38 @@ +// Copyright 2012 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package transport contains HTTP transports used to make +// authenticated API requests. +package transport + +import ( + "errors" + "net/http" +) + +// APIKey is an HTTP Transport which wraps an underlying transport and +// appends an API Key "key" parameter to the URL of outgoing requests. +type APIKey struct { + // Key is the API Key to set on requests. + Key string + + // Transport is the underlying HTTP transport. + // If nil, http.DefaultTransport is used. + Transport http.RoundTripper +} + +func (t *APIKey) RoundTrip(req *http.Request) (*http.Response, error) { + rt := t.Transport + if rt == nil { + rt = http.DefaultTransport + if rt == nil { + return nil, errors.New("googleapi/transport: no Transport specified or available") + } + } + newReq := *req + args := newReq.URL.Query() + args.Set("key", t.Key) + newReq.URL.RawQuery = args.Encode() + return rt.RoundTrip(&newReq) +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/googleapi/types.go b/third_party/src/code.google.com/p/google-api-go-client/googleapi/types.go new file mode 100644 index 0000000000000..7ed7dd98233a3 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/googleapi/types.go @@ -0,0 +1,150 @@ +// Copyright 2013 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package googleapi + +import ( + "encoding/json" + "strconv" +) + +// Int64s is a slice of int64s that marshal as quoted strings in JSON. +type Int64s []int64 + +func (q *Int64s) UnmarshalJSON(raw []byte) error { + *q = (*q)[:0] + var ss []string + if err := json.Unmarshal(raw, &ss); err != nil { + return err + } + for _, s := range ss { + v, err := strconv.ParseInt(s, 10, 64) + if err != nil { + return err + } + *q = append(*q, int64(v)) + } + return nil +} + +// Int32s is a slice of int32s that marshal as quoted strings in JSON. +type Int32s []int32 + +func (q *Int32s) UnmarshalJSON(raw []byte) error { + *q = (*q)[:0] + var ss []string + if err := json.Unmarshal(raw, &ss); err != nil { + return err + } + for _, s := range ss { + v, err := strconv.ParseInt(s, 10, 32) + if err != nil { + return err + } + *q = append(*q, int32(v)) + } + return nil +} + +// Uint64s is a slice of uint64s that marshal as quoted strings in JSON. +type Uint64s []uint64 + +func (q *Uint64s) UnmarshalJSON(raw []byte) error { + *q = (*q)[:0] + var ss []string + if err := json.Unmarshal(raw, &ss); err != nil { + return err + } + for _, s := range ss { + v, err := strconv.ParseUint(s, 10, 64) + if err != nil { + return err + } + *q = append(*q, uint64(v)) + } + return nil +} + +// Uint32s is a slice of uint32s that marshal as quoted strings in JSON. +type Uint32s []uint32 + +func (q *Uint32s) UnmarshalJSON(raw []byte) error { + *q = (*q)[:0] + var ss []string + if err := json.Unmarshal(raw, &ss); err != nil { + return err + } + for _, s := range ss { + v, err := strconv.ParseUint(s, 10, 32) + if err != nil { + return err + } + *q = append(*q, uint32(v)) + } + return nil +} + +// Float64s is a slice of float64s that marshal as quoted strings in JSON. +type Float64s []float64 + +func (q *Float64s) UnmarshalJSON(raw []byte) error { + *q = (*q)[:0] + var ss []string + if err := json.Unmarshal(raw, &ss); err != nil { + return err + } + for _, s := range ss { + v, err := strconv.ParseFloat(s, 64) + if err != nil { + return err + } + *q = append(*q, float64(v)) + } + return nil +} + +func quotedList(n int, fn func(dst []byte, i int) []byte) ([]byte, error) { + dst := make([]byte, 0, 2+n*10) // somewhat arbitrary + dst = append(dst, '[') + for i := 0; i < n; i++ { + if i > 0 { + dst = append(dst, ',') + } + dst = append(dst, '"') + dst = fn(dst, i) + dst = append(dst, '"') + } + dst = append(dst, ']') + return dst, nil +} + +func (s Int64s) MarshalJSON() ([]byte, error) { + return quotedList(len(s), func(dst []byte, i int) []byte { + return strconv.AppendInt(dst, s[i], 10) + }) +} + +func (s Int32s) MarshalJSON() ([]byte, error) { + return quotedList(len(s), func(dst []byte, i int) []byte { + return strconv.AppendInt(dst, int64(s[i]), 10) + }) +} + +func (s Uint64s) MarshalJSON() ([]byte, error) { + return quotedList(len(s), func(dst []byte, i int) []byte { + return strconv.AppendUint(dst, s[i], 10) + }) +} + +func (s Uint32s) MarshalJSON() ([]byte, error) { + return quotedList(len(s), func(dst []byte, i int) []byte { + return strconv.AppendUint(dst, uint64(s[i]), 10) + }) +} + +func (s Float64s) MarshalJSON() ([]byte, error) { + return quotedList(len(s), func(dst []byte, i int) []byte { + return strconv.AppendFloat(dst, s[i], 'g', -1, 64) + }) +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/googleapi/types_test.go b/third_party/src/code.google.com/p/google-api-go-client/googleapi/types_test.go new file mode 100644 index 0000000000000..a6b2045156ef7 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/googleapi/types_test.go @@ -0,0 +1,44 @@ +// Copyright 2013 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package googleapi + +import ( + "encoding/json" + "reflect" + "testing" +) + +func TestTypes(t *testing.T) { + type T struct { + I32 Int32s + I64 Int64s + U32 Uint32s + U64 Uint64s + F64 Float64s + } + v := &T{ + I32: Int32s{-1, 2, 3}, + I64: Int64s{-1, 2, 1 << 33}, + U32: Uint32s{1, 2}, + U64: Uint64s{1, 2, 1 << 33}, + F64: Float64s{1.5, 3.33}, + } + got, err := json.Marshal(v) + if err != nil { + t.Fatal(err) + } + want := `{"I32":["-1","2","3"],"I64":["-1","2","8589934592"],"U32":["1","2"],"U64":["1","2","8589934592"],"F64":["1.5","3.33"]}` + if string(got) != want { + t.Fatalf("Marshal mismatch.\n got: %s\nwant: %s\n", got, want) + } + + v2 := new(T) + if err := json.Unmarshal(got, v2); err != nil { + t.Fatalf("Unmarshal: %v", err) + } + if !reflect.DeepEqual(v, v2) { + t.Fatalf("Unmarshal didn't produce same results.\n got: %#v\nwant: %#v\n", v, v2) + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/groupsmigration/v1/groupsmigration-api.json b/third_party/src/code.google.com/p/google-api-go-client/groupsmigration/v1/groupsmigration-api.json new file mode 100644 index 0000000000000..6afdc32562f50 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/groupsmigration/v1/groupsmigration-api.json @@ -0,0 +1,130 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/BJXZBhUL6VndsB8q_Dgu-kIvzFE\"", + "discoveryVersion": "v1", + "id": "groupsmigration:v1", + "name": "groupsmigration", + "canonicalName": "Groups Migration", + "version": "v1", + "title": "Groups Migration API", + "description": "Groups Migration Api.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/discussions-16.gif", + "x32": "http://www.google.com/images/icons/product/discussions-32.gif" + }, + "documentationLink": "https://developers.google.com/google-apps/groups-migration/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/groups/v1/groups/", + "basePath": "/groups/v1/groups/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "groups/v1/groups/", + "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" + } + }, + "schemas": { + "Groups": { + "id": "Groups", + "type": "object", + "description": "JSON response template for groups migration API.", + "properties": { + "kind": { + "type": "string", + "description": "The kind of insert resource this is.", + "default": "groupsmigration#groups" + }, + "responseCode": { + "type": "string", + "description": "The status of the insert request." + } + } + } + }, + "resources": { + "archive": { + "methods": { + "insert": { + "id": "groupsmigration.archive.insert", + "path": "{groupId}/archive", + "httpMethod": "POST", + "description": "Inserts a new mail into the archive of the Google group.", + "parameters": { + "groupId": { + "type": "string", + "description": "The group ID", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "groupId" + ], + "response": { + "$ref": "Groups" + }, + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "message/rfc822" + ], + "maxSize": "16MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/groups/v1/groups/{groupId}/archive" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/groups/v1/groups/{groupId}/archive" + } + } + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/groupsmigration/v1/groupsmigration-gen.go b/third_party/src/code.google.com/p/google-api-go-client/groupsmigration/v1/groupsmigration-gen.go new file mode 100644 index 0000000000000..2d8f5d73bd726 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/groupsmigration/v1/groupsmigration-gen.go @@ -0,0 +1,167 @@ +// Package groupsmigration provides access to the Groups Migration API. +// +// See https://developers.google.com/google-apps/groups-migration/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/groupsmigration/v1" +// ... +// groupsmigrationService, err := groupsmigration.New(oauthHttpClient) +package groupsmigration + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "groupsmigration:v1" +const apiName = "groupsmigration" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/groups/v1/groups/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Archive = NewArchiveService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Archive *ArchiveService +} + +func NewArchiveService(s *Service) *ArchiveService { + rs := &ArchiveService{s: s} + return rs +} + +type ArchiveService struct { + s *Service +} + +type Groups struct { + // Kind: The kind of insert resource this is. + Kind string `json:"kind,omitempty"` + + // ResponseCode: The status of the insert request. + ResponseCode string `json:"responseCode,omitempty"` +} + +// method id "groupsmigration.archive.insert": + +type ArchiveInsertCall struct { + s *Service + groupId string + opt_ map[string]interface{} + media_ io.Reader +} + +// Insert: Inserts a new mail into the archive of the Google group. +func (r *ArchiveService) Insert(groupId string) *ArchiveInsertCall { + c := &ArchiveInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.groupId = groupId + return c +} +func (c *ArchiveInsertCall) Media(r io.Reader) *ArchiveInsertCall { + c.media_ = r + return c +} + +func (c *ArchiveInsertCall) Do() (*Groups, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{groupId}/archive") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{groupId}", url.QueryEscape(c.groupId), 1) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Groups) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new mail into the archive of the Google group.", + // "httpMethod": "POST", + // "id": "groupsmigration.archive.insert", + // "mediaUpload": { + // "accept": [ + // "message/rfc822" + // ], + // "maxSize": "16MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/groups/v1/groups/{groupId}/archive" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/groups/v1/groups/{groupId}/archive" + // } + // } + // }, + // "parameterOrder": [ + // "groupId" + // ], + // "parameters": { + // "groupId": { + // "description": "The group ID", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{groupId}/archive", + // "response": { + // "$ref": "Groups" + // }, + // "supportsMediaUpload": true + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/groupssettings/v1/groupssettings-api.json b/third_party/src/code.google.com/p/google-api-go-client/groupssettings/v1/groupssettings-api.json new file mode 100644 index 0000000000000..0bf2245d060e6 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/groupssettings/v1/groupssettings-api.json @@ -0,0 +1,283 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/jwIJIppaaUqSDha_itkGyYVYL5s\"", + "discoveryVersion": "v1", + "id": "groupssettings:v1", + "name": "groupssettings", + "version": "v1", + "title": "Groups Settings API", + "description": "Lets you manage permission levels and related settings of a group.", + "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/groups-settings/get_started", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/groups/v1/groups/", + "basePath": "/groups/v1/groups/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "groups/v1/groups/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "atom", + "enum": [ + "atom", + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/atom+xml", + "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/apps.groups.settings": { + "description": "View and manage the settings of a Google Apps Group" + } + } + } + }, + "schemas": { + "Groups": { + "id": "Groups", + "type": "object", + "description": "JSON template for Group resource", + "properties": { + "allowExternalMembers": { + "type": "string", + "description": "Are external members allowed to join the group." + }, + "allowGoogleCommunication": { + "type": "string", + "description": "Is google allowed to contact admins." + }, + "allowWebPosting": { + "type": "string", + "description": "If posting from web is allowed." + }, + "archiveOnly": { + "type": "string", + "description": "If the group is archive only" + }, + "customReplyTo": { + "type": "string", + "description": "Default email to which reply to any message should go." + }, + "defaultMessageDenyNotificationText": { + "type": "string", + "description": "Default message deny notification message" + }, + "description": { + "type": "string", + "description": "Description of the group" + }, + "email": { + "type": "string", + "description": "Email id of the group" + }, + "includeInGlobalAddressList": { + "type": "string", + "description": "If this groups should be included in global address list or not." + }, + "isArchived": { + "type": "string", + "description": "If the contents of the group are archived." + }, + "kind": { + "type": "string", + "description": "The type of the resource.", + "default": "groupsSettings#groups" + }, + "maxMessageBytes": { + "type": "integer", + "description": "Maximum message size allowed.", + "format": "int32" + }, + "membersCanPostAsTheGroup": { + "type": "string", + "description": "Can members post using the group email address." + }, + "messageDisplayFont": { + "type": "string", + "description": "Default message display font. Possible values are: DEFAULT_FONT FIXED_WIDTH_FONT" + }, + "messageModerationLevel": { + "type": "string", + "description": "Moderation level for messages. Possible values are: MODERATE_ALL_MESSAGES MODERATE_NON_MEMBERS MODERATE_NEW_MEMBERS MODERATE_NONE" + }, + "name": { + "type": "string", + "description": "Name of the Group" + }, + "primaryLanguage": { + "type": "string", + "description": "Primary language for the group." + }, + "replyTo": { + "type": "string", + "description": "Whome should the default reply to a message go to. Possible values are: REPLY_TO_CUSTOM REPLY_TO_SENDER REPLY_TO_LIST REPLY_TO_OWNER REPLY_TO_IGNORE REPLY_TO_MANAGERS" + }, + "sendMessageDenyNotification": { + "type": "string", + "description": "Should the member be notified if his message is denied by owner." + }, + "showInGroupDirectory": { + "type": "string", + "description": "Is the group listed in groups directory" + }, + "spamModerationLevel": { + "type": "string", + "description": "Moderation level for messages detected as spam. Possible values are: ALLOW MODERATE SILENTLY_MODERATE REJECT" + }, + "whoCanContactOwner": { + "type": "string", + "description": "Permission to contact owner of the group via web UI. Possbile values are: ANYONE_CAN_CONTACT ALL_IN_DOMAIN_CAN_CONTACT ALL_MEMBERS_CAN_CONTACT ALL_MANAGERS_CAN_CONTACT" + }, + "whoCanInvite": { + "type": "string", + "description": "Permissions to invite members. Possbile values are: ALL_MEMBERS_CAN_INVITE ALL_MANAGERS_CAN_INVITE" + }, + "whoCanJoin": { + "type": "string", + "description": "Permissions to join the group. Possible values are: ANYONE_CAN_JOIN ALL_IN_DOMAIN_CAN_JOIN INVITED_CAN_JOIN CAN_REQUEST_TO_JOIN" + }, + "whoCanLeaveGroup": { + "type": "string", + "description": "Permission to leave the group. Possible values are: ALL_MANAGERS_CAN_LEAVE ALL_MEMBERS_CAN_LEAVE" + }, + "whoCanPostMessage": { + "type": "string", + "description": "Permissions to post messages to the group. Possible values are: NONE_CAN_POST ALL_MANAGERS_CAN_POST ALL_MEMBERS_CAN_POST ALL_IN_DOMAIN_CAN_POST ANYONE_CAN_POST" + }, + "whoCanViewGroup": { + "type": "string", + "description": "Permissions to view group. Possbile values are: ANYONE_CAN_VIEW ALL_IN_DOMAIN_CAN_VIEW ALL_MEMBERS_CAN_VIEW ALL_MANAGERS_CAN_VIEW" + }, + "whoCanViewMembership": { + "type": "string", + "description": "Permissions to view membership. Possbile values are: ALL_IN_DOMAIN_CAN_VIEW ALL_MEMBERS_CAN_VIEW ALL_MANAGERS_CAN_VIEW" + } + } + } + }, + "resources": { + "groups": { + "methods": { + "get": { + "id": "groupsSettings.groups.get", + "path": "{groupUniqueId}", + "httpMethod": "GET", + "description": "Gets one resource by id.", + "parameters": { + "groupUniqueId": { + "type": "string", + "description": "The resource ID", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "groupUniqueId" + ], + "response": { + "$ref": "Groups" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.groups.settings" + ] + }, + "patch": { + "id": "groupsSettings.groups.patch", + "path": "{groupUniqueId}", + "httpMethod": "PATCH", + "description": "Updates an existing resource. This method supports patch semantics.", + "parameters": { + "groupUniqueId": { + "type": "string", + "description": "The resource ID", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "groupUniqueId" + ], + "request": { + "$ref": "Groups" + }, + "response": { + "$ref": "Groups" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.groups.settings" + ] + }, + "update": { + "id": "groupsSettings.groups.update", + "path": "{groupUniqueId}", + "httpMethod": "PUT", + "description": "Updates an existing resource.", + "parameters": { + "groupUniqueId": { + "type": "string", + "description": "The resource ID", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "groupUniqueId" + ], + "request": { + "$ref": "Groups" + }, + "response": { + "$ref": "Groups" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.groups.settings" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/groupssettings/v1/groupssettings-gen.go b/third_party/src/code.google.com/p/google-api-go-client/groupssettings/v1/groupssettings-gen.go new file mode 100644 index 0000000000000..717060c2b9c01 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/groupssettings/v1/groupssettings-gen.go @@ -0,0 +1,394 @@ +// Package groupssettings provides access to the Groups Settings API. +// +// See https://developers.google.com/google-apps/groups-settings/get_started +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/groupssettings/v1" +// ... +// groupssettingsService, err := groupssettings.New(oauthHttpClient) +package groupssettings + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "groupssettings:v1" +const apiName = "groupssettings" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/groups/v1/groups/" + +// OAuth2 scopes used by this API. +const ( + // View and manage the settings of a Google Apps Group + AppsGroupsSettingsScope = "https://www.googleapis.com/auth/apps.groups.settings" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Groups = NewGroupsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Groups *GroupsService +} + +func NewGroupsService(s *Service) *GroupsService { + rs := &GroupsService{s: s} + return rs +} + +type GroupsService struct { + s *Service +} + +type Groups struct { + // AllowExternalMembers: Are external members allowed to join the group. + AllowExternalMembers string `json:"allowExternalMembers,omitempty"` + + // AllowGoogleCommunication: Is google allowed to contact admins. + AllowGoogleCommunication string `json:"allowGoogleCommunication,omitempty"` + + // AllowWebPosting: If posting from web is allowed. + AllowWebPosting string `json:"allowWebPosting,omitempty"` + + // ArchiveOnly: If the group is archive only + ArchiveOnly string `json:"archiveOnly,omitempty"` + + // CustomReplyTo: Default email to which reply to any message should go. + CustomReplyTo string `json:"customReplyTo,omitempty"` + + // DefaultMessageDenyNotificationText: Default message deny notification + // message + DefaultMessageDenyNotificationText string `json:"defaultMessageDenyNotificationText,omitempty"` + + // Description: Description of the group + Description string `json:"description,omitempty"` + + // Email: Email id of the group + Email string `json:"email,omitempty"` + + // IncludeInGlobalAddressList: If this groups should be included in + // global address list or not. + IncludeInGlobalAddressList string `json:"includeInGlobalAddressList,omitempty"` + + // IsArchived: If the contents of the group are archived. + IsArchived string `json:"isArchived,omitempty"` + + // Kind: The type of the resource. + Kind string `json:"kind,omitempty"` + + // MaxMessageBytes: Maximum message size allowed. + MaxMessageBytes int64 `json:"maxMessageBytes,omitempty"` + + // MembersCanPostAsTheGroup: Can members post using the group email + // address. + MembersCanPostAsTheGroup string `json:"membersCanPostAsTheGroup,omitempty"` + + // MessageDisplayFont: Default message display font. Possible values + // are: DEFAULT_FONT FIXED_WIDTH_FONT + MessageDisplayFont string `json:"messageDisplayFont,omitempty"` + + // MessageModerationLevel: Moderation level for messages. Possible + // values are: MODERATE_ALL_MESSAGES MODERATE_NON_MEMBERS + // MODERATE_NEW_MEMBERS MODERATE_NONE + MessageModerationLevel string `json:"messageModerationLevel,omitempty"` + + // Name: Name of the Group + Name string `json:"name,omitempty"` + + // PrimaryLanguage: Primary language for the group. + PrimaryLanguage string `json:"primaryLanguage,omitempty"` + + // ReplyTo: Whome should the default reply to a message go to. Possible + // values are: REPLY_TO_CUSTOM REPLY_TO_SENDER REPLY_TO_LIST + // REPLY_TO_OWNER REPLY_TO_IGNORE REPLY_TO_MANAGERS + ReplyTo string `json:"replyTo,omitempty"` + + // SendMessageDenyNotification: Should the member be notified if his + // message is denied by owner. + SendMessageDenyNotification string `json:"sendMessageDenyNotification,omitempty"` + + // ShowInGroupDirectory: Is the group listed in groups directory + ShowInGroupDirectory string `json:"showInGroupDirectory,omitempty"` + + // SpamModerationLevel: Moderation level for messages detected as spam. + // Possible values are: ALLOW MODERATE SILENTLY_MODERATE REJECT + SpamModerationLevel string `json:"spamModerationLevel,omitempty"` + + // WhoCanContactOwner: Permission to contact owner of the group via web + // UI. Possbile values are: ANYONE_CAN_CONTACT ALL_IN_DOMAIN_CAN_CONTACT + // ALL_MEMBERS_CAN_CONTACT ALL_MANAGERS_CAN_CONTACT + WhoCanContactOwner string `json:"whoCanContactOwner,omitempty"` + + // WhoCanInvite: Permissions to invite members. Possbile values are: + // ALL_MEMBERS_CAN_INVITE ALL_MANAGERS_CAN_INVITE + WhoCanInvite string `json:"whoCanInvite,omitempty"` + + // WhoCanJoin: Permissions to join the group. Possible values are: + // ANYONE_CAN_JOIN ALL_IN_DOMAIN_CAN_JOIN INVITED_CAN_JOIN + // CAN_REQUEST_TO_JOIN + WhoCanJoin string `json:"whoCanJoin,omitempty"` + + // WhoCanLeaveGroup: Permission to leave the group. Possible values are: + // ALL_MANAGERS_CAN_LEAVE ALL_MEMBERS_CAN_LEAVE + WhoCanLeaveGroup string `json:"whoCanLeaveGroup,omitempty"` + + // WhoCanPostMessage: Permissions to post messages to the group. + // Possible values are: NONE_CAN_POST ALL_MANAGERS_CAN_POST + // ALL_MEMBERS_CAN_POST ALL_IN_DOMAIN_CAN_POST ANYONE_CAN_POST + WhoCanPostMessage string `json:"whoCanPostMessage,omitempty"` + + // WhoCanViewGroup: Permissions to view group. Possbile values are: + // ANYONE_CAN_VIEW ALL_IN_DOMAIN_CAN_VIEW ALL_MEMBERS_CAN_VIEW + // ALL_MANAGERS_CAN_VIEW + WhoCanViewGroup string `json:"whoCanViewGroup,omitempty"` + + // WhoCanViewMembership: Permissions to view membership. Possbile values + // are: ALL_IN_DOMAIN_CAN_VIEW ALL_MEMBERS_CAN_VIEW + // ALL_MANAGERS_CAN_VIEW + WhoCanViewMembership string `json:"whoCanViewMembership,omitempty"` +} + +// method id "groupsSettings.groups.get": + +type GroupsGetCall struct { + s *Service + groupUniqueId string + opt_ map[string]interface{} +} + +// Get: Gets one resource by id. +func (r *GroupsService) Get(groupUniqueId string) *GroupsGetCall { + c := &GroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.groupUniqueId = groupUniqueId + return c +} + +func (c *GroupsGetCall) Do() (*Groups, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{groupUniqueId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{groupUniqueId}", url.QueryEscape(c.groupUniqueId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Groups) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one resource by id.", + // "httpMethod": "GET", + // "id": "groupsSettings.groups.get", + // "parameterOrder": [ + // "groupUniqueId" + // ], + // "parameters": { + // "groupUniqueId": { + // "description": "The resource ID", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{groupUniqueId}", + // "response": { + // "$ref": "Groups" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.groups.settings" + // ] + // } + +} + +// method id "groupsSettings.groups.patch": + +type GroupsPatchCall struct { + s *Service + groupUniqueId string + groups *Groups + opt_ map[string]interface{} +} + +// Patch: Updates an existing resource. This method supports patch +// semantics. +func (r *GroupsService) Patch(groupUniqueId string, groups *Groups) *GroupsPatchCall { + c := &GroupsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.groupUniqueId = groupUniqueId + c.groups = groups + return c +} + +func (c *GroupsPatchCall) Do() (*Groups, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.groups) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{groupUniqueId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{groupUniqueId}", url.QueryEscape(c.groupUniqueId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Groups) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing resource. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "groupsSettings.groups.patch", + // "parameterOrder": [ + // "groupUniqueId" + // ], + // "parameters": { + // "groupUniqueId": { + // "description": "The resource ID", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{groupUniqueId}", + // "request": { + // "$ref": "Groups" + // }, + // "response": { + // "$ref": "Groups" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.groups.settings" + // ] + // } + +} + +// method id "groupsSettings.groups.update": + +type GroupsUpdateCall struct { + s *Service + groupUniqueId string + groups *Groups + opt_ map[string]interface{} +} + +// Update: Updates an existing resource. +func (r *GroupsService) Update(groupUniqueId string, groups *Groups) *GroupsUpdateCall { + c := &GroupsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.groupUniqueId = groupUniqueId + c.groups = groups + return c +} + +func (c *GroupsUpdateCall) Do() (*Groups, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.groups) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{groupUniqueId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{groupUniqueId}", url.QueryEscape(c.groupUniqueId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Groups) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing resource.", + // "httpMethod": "PUT", + // "id": "groupsSettings.groups.update", + // "parameterOrder": [ + // "groupUniqueId" + // ], + // "parameters": { + // "groupUniqueId": { + // "description": "The resource ID", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{groupUniqueId}", + // "request": { + // "$ref": "Groups" + // }, + // "response": { + // "$ref": "Groups" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.groups.settings" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/identitytoolkit/v3/identitytoolkit-api.json b/third_party/src/code.google.com/p/google-api-go-client/identitytoolkit/v3/identitytoolkit-api.json new file mode 100644 index 0000000000000..7f1cea67dcacb --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/identitytoolkit/v3/identitytoolkit-api.json @@ -0,0 +1,903 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/KRARk1zfvD1Ng7hyNLY5ZbidGLY\"", + "discoveryVersion": "v1", + "id": "identitytoolkit:v3", + "name": "identitytoolkit", + "canonicalName": "Identity Toolkit", + "version": "v3", + "title": "Google Identity Toolkit API", + "description": "Help the third party sites to implement federated login.", + "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/identity-toolkit/v3/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/identitytoolkit/v3/relyingparty/", + "basePath": "/identitytoolkit/v3/relyingparty/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "identitytoolkit/v3/relyingparty/", + "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" + } + }, + "schemas": { + "CreateAuthUriResponse": { + "id": "CreateAuthUriResponse", + "type": "object", + "description": "Response of creating the IDP authentication URL.", + "properties": { + "authUri": { + "type": "string", + "description": "The URI used by the IDP to authenticate the user." + }, + "kind": { + "type": "string", + "description": "The fixed string identitytoolkit#CreateAuthUriResponse\".", + "default": "identitytoolkit#CreateAuthUriResponse" + }, + "providerId": { + "type": "string", + "description": "The provider ID of the auth URI." + }, + "providers": { + "type": "array", + "description": "Existing IDP's for the user.", + "items": { + "type": "string" + } + }, + "registered": { + "type": "boolean", + "description": "Whether the user is registered if the identifier is an email." + } + } + }, + "DeleteAccountResponse": { + "id": "DeleteAccountResponse", + "type": "object", + "description": "Respone of deleting account.", + "properties": { + "kind": { + "type": "string", + "description": "The fixed string \"identitytoolkit#DeleteAccountResponse\".", + "default": "identitytoolkit#DeleteAccountResponse" + } + } + }, + "DownloadAccountResponse": { + "id": "DownloadAccountResponse", + "type": "object", + "description": "Respone of downloading accounts in batch.", + "properties": { + "kind": { + "type": "string", + "description": "The fixed string \"identitytoolkit#DownloadAccountResponse\".", + "default": "identitytoolkit#DownloadAccountResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The next page token. To be used in a subsequent request to return the next page of results." + }, + "users": { + "type": "array", + "description": "The user accounts data.", + "items": { + "$ref": "UserInfo" + } + } + } + }, + "GetAccountInfoResponse": { + "id": "GetAccountInfoResponse", + "type": "object", + "description": "Response of getting account information.", + "properties": { + "kind": { + "type": "string", + "description": "The fixed string \"identitytoolkit#GetAccountInfoResponse\".", + "default": "identitytoolkit#GetAccountInfoResponse" + }, + "users": { + "type": "array", + "description": "The info of the users.", + "items": { + "$ref": "UserInfo" + } + } + } + }, + "GetOobConfirmationCodeResponse": { + "id": "GetOobConfirmationCodeResponse", + "type": "object", + "description": "Response of getting a code for user confirmation (reset password, change email etc.).", + "properties": { + "kind": { + "type": "string", + "description": "The fixed string \"identitytoolkit#GetOobConfirmationCodeResponse\".", + "default": "identitytoolkit#GetOobConfirmationCodeResponse" + }, + "oobCode": { + "type": "string", + "description": "The code to be send to the user." + } + } + }, + "IdentitytoolkitRelyingpartyCreateAuthUriRequest": { + "id": "IdentitytoolkitRelyingpartyCreateAuthUriRequest", + "type": "object", + "description": "Request to get the IDP authentication URL.", + "properties": { + "appId": { + "type": "string", + "description": "The app ID of the mobile app, base64(CERT_SHA1):PACKAGE_NAME for Android, BUNDLE_ID for iOS." + }, + "clientId": { + "type": "string", + "description": "The relying party OAuth client ID." + }, + "context": { + "type": "string", + "description": "The opaque value used by the client to maintain context info between the authentication request and the IDP callback." + }, + "continueUri": { + "type": "string", + "description": "The URI to which the IDP redirects the user after the federated login flow." + }, + "identifier": { + "type": "string", + "description": "The email or federated ID of the user." + }, + "openidRealm": { + "type": "string", + "description": "Optional realm for OpenID protocol. The sub string \"scheme://domain:port\" of the param \"continueUri\" is used if this is not set." + }, + "otaApp": { + "type": "string", + "description": "The native app package for OTA installation." + }, + "providerId": { + "type": "string", + "description": "The IdP ID. For white listed IdPs it's a short domain name e.g. google.com, aol.com, live.net and yahoo.com. For other OpenID IdPs it's the OP identifier." + } + } + }, + "IdentitytoolkitRelyingpartyDeleteAccountRequest": { + "id": "IdentitytoolkitRelyingpartyDeleteAccountRequest", + "type": "object", + "description": "Request to delete account.", + "properties": { + "localId": { + "type": "string", + "description": "The local ID of the user." + } + } + }, + "IdentitytoolkitRelyingpartyDownloadAccountRequest": { + "id": "IdentitytoolkitRelyingpartyDownloadAccountRequest", + "type": "object", + "description": "Request to download user account in batch.", + "properties": { + "maxResults": { + "type": "integer", + "description": "The max number of results to return in the response.", + "format": "uint32" + }, + "nextPageToken": { + "type": "string", + "description": "The token for the next page. This should be taken from the previous response." + } + } + }, + "IdentitytoolkitRelyingpartyGetAccountInfoRequest": { + "id": "IdentitytoolkitRelyingpartyGetAccountInfoRequest", + "type": "object", + "description": "Request to get the account information.", + "properties": { + "email": { + "type": "array", + "description": "The list of emails of the users to inquiry.", + "items": { + "type": "string" + } + }, + "idToken": { + "type": "string", + "description": "The GITKit token of the authenticated user." + }, + "localId": { + "type": "array", + "description": "The list of local ID's of the users to inquiry.", + "items": { + "type": "string" + } + } + } + }, + "IdentitytoolkitRelyingpartyResetPasswordRequest": { + "id": "IdentitytoolkitRelyingpartyResetPasswordRequest", + "type": "object", + "description": "Request to reset the password.", + "properties": { + "email": { + "type": "string", + "description": "The email address of the user." + }, + "newPassword": { + "type": "string", + "description": "The new password inputted by the user." + }, + "oldPassword": { + "type": "string", + "description": "The old password inputted by the user." + }, + "oobCode": { + "type": "string", + "description": "The confirmation code." + } + } + }, + "IdentitytoolkitRelyingpartySetAccountInfoRequest": { + "id": "IdentitytoolkitRelyingpartySetAccountInfoRequest", + "type": "object", + "description": "Request to set the account information.", + "properties": { + "captchaChallenge": { + "type": "string", + "description": "The captcha challenge." + }, + "captchaResponse": { + "type": "string", + "description": "Response to the captcha." + }, + "displayName": { + "type": "string", + "description": "The name of the user." + }, + "email": { + "type": "string", + "description": "The email of the user." + }, + "emailVerified": { + "type": "boolean", + "description": "Mark the email as verified or not." + }, + "idToken": { + "type": "string", + "description": "The GITKit token of the authenticated user." + }, + "localId": { + "type": "string", + "description": "The local ID of the user." + }, + "oobCode": { + "type": "string", + "description": "The out-of-band code of the change email request." + }, + "password": { + "type": "string", + "description": "The new password of the user." + }, + "provider": { + "type": "array", + "description": "The associated IDPs of the user.", + "items": { + "type": "string" + } + }, + "upgradeToFederatedLogin": { + "type": "boolean", + "description": "Mark the user to upgrade to federated login." + } + } + }, + "IdentitytoolkitRelyingpartyUploadAccountRequest": { + "id": "IdentitytoolkitRelyingpartyUploadAccountRequest", + "type": "object", + "description": "Request to upload user account in batch.", + "properties": { + "hashAlgorithm": { + "type": "string" + }, + "memoryCost": { + "type": "integer", + "format": "int32" + }, + "rounds": { + "type": "integer", + "format": "int32" + }, + "saltSeparator": { + "type": "string", + "format": "byte" + }, + "signerKey": { + "type": "string", + "format": "byte" + }, + "users": { + "type": "array", + "description": "The account info to be stored.", + "items": { + "$ref": "UserInfo" + } + } + } + }, + "IdentitytoolkitRelyingpartyVerifyAssertionRequest": { + "id": "IdentitytoolkitRelyingpartyVerifyAssertionRequest", + "type": "object", + "description": "Request to verify the IDP assertion.", + "properties": { + "pendingIdToken": { + "type": "string", + "description": "The GITKit token for the non-trusted IDP pending to be confirmed by the user." + }, + "postBody": { + "type": "string", + "description": "The post body if the request is a HTTP POST." + }, + "requestUri": { + "type": "string", + "description": "The URI to which the IDP redirects the user back. It may contain federated login result params added by the IDP." + } + } + }, + "IdentitytoolkitRelyingpartyVerifyPasswordRequest": { + "id": "IdentitytoolkitRelyingpartyVerifyPasswordRequest", + "type": "object", + "description": "Request to verify the password.", + "properties": { + "captchaChallenge": { + "type": "string", + "description": "The captcha challenge." + }, + "captchaResponse": { + "type": "string", + "description": "Response to the captcha." + }, + "email": { + "type": "string", + "description": "The email of the user." + }, + "password": { + "type": "string", + "description": "The password inputed by the user." + }, + "pendingIdToken": { + "type": "string", + "description": "The GITKit token for the non-trusted IDP, which is to be confirmed by the user." + } + } + }, + "Relyingparty": { + "id": "Relyingparty", + "type": "object", + "description": "Request of getting a code for user confirmation (reset password, change email etc.)", + "properties": { + "captchaResp": { + "type": "string", + "description": "The recaptcha response from the user." + }, + "challenge": { + "type": "string", + "description": "The recaptcha challenge presented to the user." + }, + "email": { + "type": "string", + "description": "The email of the user." + }, + "idToken": { + "type": "string", + "description": "The user's Gitkit login token for email change." + }, + "kind": { + "type": "string", + "description": "The fixed string \"identitytoolkit#relyingparty\".", + "default": "identitytoolkit#relyingparty" + }, + "newEmail": { + "type": "string", + "description": "The new email if the code is for email change." + }, + "requestType": { + "type": "string", + "description": "The request type." + }, + "userIp": { + "type": "string", + "description": "The IP address of the user." + } + } + }, + "ResetPasswordResponse": { + "id": "ResetPasswordResponse", + "type": "object", + "description": "Response of resetting the password.", + "properties": { + "email": { + "type": "string", + "description": "The user's email." + }, + "kind": { + "type": "string", + "description": "The fixed string \"identitytoolkit#ResetPasswordResponse\".", + "default": "identitytoolkit#ResetPasswordResponse" + } + } + }, + "SetAccountInfoResponse": { + "id": "SetAccountInfoResponse", + "type": "object", + "description": "Respone of setting the account information.", + "properties": { + "displayName": { + "type": "string", + "description": "The name of the user." + }, + "email": { + "type": "string", + "description": "The email of the user." + }, + "idToken": { + "type": "string", + "description": "The Gitkit id token to login the newly sign up user." + }, + "kind": { + "type": "string", + "description": "The fixed string \"identitytoolkit#SetAccountInfoResponse\".", + "default": "identitytoolkit#SetAccountInfoResponse" + }, + "providerUserInfo": { + "type": "array", + "description": "The user's profiles at the associated IdPs.", + "items": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "The user's display name at the IDP." + }, + "photoUrl": { + "type": "string", + "description": "The user's photo url at the IDP." + }, + "providerId": { + "type": "string", + "description": "The IdP ID. For whitelisted IdPs it's a short domain name, e.g., google.com, aol.com, live.net and yahoo.com. For other OpenID IdPs it's the OP identifier." + } + } + } + } + } + }, + "UploadAccountResponse": { + "id": "UploadAccountResponse", + "type": "object", + "description": "Respone of uploading accounts in batch.", + "properties": { + "error": { + "type": "array", + "description": "The error encountered while processing the account info.", + "items": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "The index of the malformed account, starting from 0.", + "format": "int32" + }, + "message": { + "type": "string", + "description": "Detailed error message for the account info." + } + } + } + }, + "kind": { + "type": "string", + "description": "The fixed string \"identitytoolkit#UploadAccountResponse\".", + "default": "identitytoolkit#UploadAccountResponse" + } + } + }, + "UserInfo": { + "id": "UserInfo", + "type": "object", + "description": "Template for an individual account info.", + "properties": { + "displayName": { + "type": "string", + "description": "The name of the user." + }, + "email": { + "type": "string", + "description": "The email of the user." + }, + "emailVerified": { + "type": "boolean", + "description": "Whether the email has been verified." + }, + "localId": { + "type": "string", + "description": "The local ID of the user." + }, + "passwordHash": { + "type": "string", + "description": "The user's hashed password.", + "format": "byte" + }, + "passwordUpdatedAt": { + "type": "number", + "description": "The timestamp when the password was last updated.", + "format": "double" + }, + "photoUrl": { + "type": "string", + "description": "The URL of the user profile photo." + }, + "providerUserInfo": { + "type": "array", + "description": "The IDP of the user.", + "items": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "The user's display name at the IDP." + }, + "federatedId": { + "type": "string", + "description": "User's identifier at IDP." + }, + "photoUrl": { + "type": "string", + "description": "The user's photo url at the IDP." + }, + "providerId": { + "type": "string", + "description": "The IdP ID. For white listed IdPs it's a short domain name, e.g., google.com, aol.com, live.net and yahoo.com. For other OpenID IdPs it's the OP identifier." + } + } + } + }, + "salt": { + "type": "string", + "description": "The user's password salt.", + "format": "byte" + }, + "version": { + "type": "integer", + "description": "Version of the user's password.", + "format": "int32" + } + } + }, + "VerifyAssertionResponse": { + "id": "VerifyAssertionResponse", + "type": "object", + "description": "Response of verifying the IDP assertion.", + "properties": { + "action": { + "type": "string", + "description": "The action code." + }, + "appInstallationUrl": { + "type": "string", + "description": "URL for OTA app installation." + }, + "appScheme": { + "type": "string", + "description": "The custom scheme used by mobile app." + }, + "context": { + "type": "string", + "description": "The opaque value used by the client to maintain context info between the authentication request and the IDP callback." + }, + "dateOfBirth": { + "type": "string", + "description": "The birth date of the IdP account." + }, + "displayName": { + "type": "string", + "description": "The display name of the user." + }, + "email": { + "type": "string", + "description": "The email returned by the IdP. NOTE: The federated login user may not own the email." + }, + "emailRecycled": { + "type": "boolean", + "description": "It's true if the email is recycled." + }, + "emailVerified": { + "type": "boolean", + "description": "The value is true if the IDP is also the email provider. It means the user owns the email." + }, + "federatedId": { + "type": "string", + "description": "The unique ID identifies the IdP account." + }, + "firstName": { + "type": "string", + "description": "The first name of the user." + }, + "fullName": { + "type": "string", + "description": "The full name of the user." + }, + "idToken": { + "type": "string", + "description": "The ID token." + }, + "inputEmail": { + "type": "string", + "description": "It's the identifier param in the createAuthUri request if the identifier is an email. It can be used to check whether the user input email is different from the asserted email." + }, + "kind": { + "type": "string", + "description": "The fixed string \"identitytoolkit#VerifyAssertionResponse\".", + "default": "identitytoolkit#VerifyAssertionResponse" + }, + "language": { + "type": "string", + "description": "The language preference of the user." + }, + "lastName": { + "type": "string", + "description": "The last name of the user." + }, + "localId": { + "type": "string", + "description": "The RP local ID if it's already been mapped to the IdP account identified by the federated ID." + }, + "needConfirmation": { + "type": "boolean", + "description": "Whether the assertion is from a non-trusted IDP and need account linking confirmation." + }, + "nickName": { + "type": "string", + "description": "The nick name of the user." + }, + "oauthRequestToken": { + "type": "string", + "description": "The user approved request token for the OpenID OAuth extension." + }, + "oauthScope": { + "type": "string", + "description": "The scope for the OpenID OAuth extension." + }, + "originalEmail": { + "type": "string", + "description": "The original email stored in the mapping storage. It's returned when the federated ID is associated to a different email." + }, + "photoUrl": { + "type": "string", + "description": "The URI of the public accessible profiel picture." + }, + "providerId": { + "type": "string", + "description": "The IdP ID. For white listed IdPs it's a short domain name e.g. google.com, aol.com, live.net and yahoo.com. If the \"providerId\" param is set to OpenID OP identifer other than the whilte listed IdPs the OP identifier is returned. If the \"identifier\" param is federated ID in the createAuthUri request. The domain part of the federated ID is returned." + }, + "timeZone": { + "type": "string", + "description": "The timezone of the user." + }, + "verifiedProvider": { + "type": "array", + "description": "When action is 'map', contains the idps which can be used for confirmation.", + "items": { + "type": "string" + } + } + } + }, + "VerifyPasswordResponse": { + "id": "VerifyPasswordResponse", + "type": "object", + "description": "Request of verifying the password.", + "properties": { + "displayName": { + "type": "string", + "description": "The name of the user." + }, + "email": { + "type": "string", + "description": "The email returned by the IdP. NOTE: The federated login user may not own the email." + }, + "idToken": { + "type": "string", + "description": "The GITKit token for authenticated user." + }, + "kind": { + "type": "string", + "description": "The fixed string \"identitytoolkit#VerifyPasswordResponse\".", + "default": "identitytoolkit#VerifyPasswordResponse" + }, + "localId": { + "type": "string", + "description": "The RP local ID if it's already been mapped to the IdP account identified by the federated ID." + }, + "photoUrl": { + "type": "string", + "description": "The URI of the user's photo at IdP" + }, + "registered": { + "type": "boolean", + "description": "Whether the email is registered." + } + } + } + }, + "resources": { + "relyingparty": { + "methods": { + "createAuthUri": { + "id": "identitytoolkit.relyingparty.createAuthUri", + "path": "createAuthUri", + "httpMethod": "POST", + "description": "Creates the URI used by the IdP to authenticate the user.", + "request": { + "$ref": "IdentitytoolkitRelyingpartyCreateAuthUriRequest" + }, + "response": { + "$ref": "CreateAuthUriResponse" + } + }, + "deleteAccount": { + "id": "identitytoolkit.relyingparty.deleteAccount", + "path": "deleteAccount", + "httpMethod": "POST", + "description": "Delete user account.", + "request": { + "$ref": "IdentitytoolkitRelyingpartyDeleteAccountRequest" + }, + "response": { + "$ref": "DeleteAccountResponse" + } + }, + "downloadAccount": { + "id": "identitytoolkit.relyingparty.downloadAccount", + "path": "downloadAccount", + "httpMethod": "POST", + "description": "Batch download user accounts.", + "request": { + "$ref": "IdentitytoolkitRelyingpartyDownloadAccountRequest" + }, + "response": { + "$ref": "DownloadAccountResponse" + } + }, + "getAccountInfo": { + "id": "identitytoolkit.relyingparty.getAccountInfo", + "path": "getAccountInfo", + "httpMethod": "POST", + "description": "Returns the account info.", + "request": { + "$ref": "IdentitytoolkitRelyingpartyGetAccountInfoRequest" + }, + "response": { + "$ref": "GetAccountInfoResponse" + } + }, + "getOobConfirmationCode": { + "id": "identitytoolkit.relyingparty.getOobConfirmationCode", + "path": "getOobConfirmationCode", + "httpMethod": "POST", + "description": "Get a code for user action confirmation.", + "request": { + "$ref": "Relyingparty" + }, + "response": { + "$ref": "GetOobConfirmationCodeResponse" + } + }, + "resetPassword": { + "id": "identitytoolkit.relyingparty.resetPassword", + "path": "resetPassword", + "httpMethod": "POST", + "description": "Set account info for a user.", + "request": { + "$ref": "IdentitytoolkitRelyingpartyResetPasswordRequest" + }, + "response": { + "$ref": "ResetPasswordResponse" + } + }, + "setAccountInfo": { + "id": "identitytoolkit.relyingparty.setAccountInfo", + "path": "setAccountInfo", + "httpMethod": "POST", + "description": "Set account info for a user.", + "request": { + "$ref": "IdentitytoolkitRelyingpartySetAccountInfoRequest" + }, + "response": { + "$ref": "SetAccountInfoResponse" + } + }, + "uploadAccount": { + "id": "identitytoolkit.relyingparty.uploadAccount", + "path": "uploadAccount", + "httpMethod": "POST", + "description": "Batch upload existing user accounts.", + "request": { + "$ref": "IdentitytoolkitRelyingpartyUploadAccountRequest" + }, + "response": { + "$ref": "UploadAccountResponse" + } + }, + "verifyAssertion": { + "id": "identitytoolkit.relyingparty.verifyAssertion", + "path": "verifyAssertion", + "httpMethod": "POST", + "description": "Verifies the assertion returned by the IdP.", + "request": { + "$ref": "IdentitytoolkitRelyingpartyVerifyAssertionRequest" + }, + "response": { + "$ref": "VerifyAssertionResponse" + } + }, + "verifyPassword": { + "id": "identitytoolkit.relyingparty.verifyPassword", + "path": "verifyPassword", + "httpMethod": "POST", + "description": "Verifies the user entered password.", + "request": { + "$ref": "IdentitytoolkitRelyingpartyVerifyPasswordRequest" + }, + "response": { + "$ref": "VerifyPasswordResponse" + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/identitytoolkit/v3/identitytoolkit-gen.go b/third_party/src/code.google.com/p/google-api-go-client/identitytoolkit/v3/identitytoolkit-gen.go new file mode 100644 index 0000000000000..467b16416c00b --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/identitytoolkit/v3/identitytoolkit-gen.go @@ -0,0 +1,1102 @@ +// Package identitytoolkit provides access to the Google Identity Toolkit API. +// +// See https://developers.google.com/identity-toolkit/v3/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/identitytoolkit/v3" +// ... +// identitytoolkitService, err := identitytoolkit.New(oauthHttpClient) +package identitytoolkit + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "identitytoolkit:v3" +const apiName = "identitytoolkit" +const apiVersion = "v3" +const basePath = "https://www.googleapis.com/identitytoolkit/v3/relyingparty/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Relyingparty = NewRelyingpartyService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Relyingparty *RelyingpartyService +} + +func NewRelyingpartyService(s *Service) *RelyingpartyService { + rs := &RelyingpartyService{s: s} + return rs +} + +type RelyingpartyService struct { + s *Service +} + +type CreateAuthUriResponse struct { + // AuthUri: The URI used by the IDP to authenticate the user. + AuthUri string `json:"authUri,omitempty"` + + // Kind: The fixed string identitytoolkit#CreateAuthUriResponse". + Kind string `json:"kind,omitempty"` + + // ProviderId: The provider ID of the auth URI. + ProviderId string `json:"providerId,omitempty"` + + // Providers: Existing IDP's for the user. + Providers []string `json:"providers,omitempty"` + + // Registered: Whether the user is registered if the identifier is an + // email. + Registered bool `json:"registered,omitempty"` +} + +type DeleteAccountResponse struct { + // Kind: The fixed string "identitytoolkit#DeleteAccountResponse". + Kind string `json:"kind,omitempty"` +} + +type DownloadAccountResponse struct { + // Kind: The fixed string "identitytoolkit#DownloadAccountResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The next page token. To be used in a subsequent + // request to return the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Users: The user accounts data. + Users []*UserInfo `json:"users,omitempty"` +} + +type GetAccountInfoResponse struct { + // Kind: The fixed string "identitytoolkit#GetAccountInfoResponse". + Kind string `json:"kind,omitempty"` + + // Users: The info of the users. + Users []*UserInfo `json:"users,omitempty"` +} + +type GetOobConfirmationCodeResponse struct { + // Kind: The fixed string + // "identitytoolkit#GetOobConfirmationCodeResponse". + Kind string `json:"kind,omitempty"` + + // OobCode: The code to be send to the user. + OobCode string `json:"oobCode,omitempty"` +} + +type IdentitytoolkitRelyingpartyCreateAuthUriRequest struct { + // AppId: The app ID of the mobile app, base64(CERT_SHA1):PACKAGE_NAME + // for Android, BUNDLE_ID for iOS. + AppId string `json:"appId,omitempty"` + + // ClientId: The relying party OAuth client ID. + ClientId string `json:"clientId,omitempty"` + + // Context: The opaque value used by the client to maintain context info + // between the authentication request and the IDP callback. + Context string `json:"context,omitempty"` + + // ContinueUri: The URI to which the IDP redirects the user after the + // federated login flow. + ContinueUri string `json:"continueUri,omitempty"` + + // Identifier: The email or federated ID of the user. + Identifier string `json:"identifier,omitempty"` + + // OpenidRealm: Optional realm for OpenID protocol. The sub string + // "scheme://domain:port" of the param "continueUri" is used if this is + // not set. + OpenidRealm string `json:"openidRealm,omitempty"` + + // OtaApp: The native app package for OTA installation. + OtaApp string `json:"otaApp,omitempty"` + + // ProviderId: The IdP ID. For white listed IdPs it's a short domain + // name e.g. google.com, aol.com, live.net and yahoo.com. For other + // OpenID IdPs it's the OP identifier. + ProviderId string `json:"providerId,omitempty"` +} + +type IdentitytoolkitRelyingpartyDeleteAccountRequest struct { + // LocalId: The local ID of the user. + LocalId string `json:"localId,omitempty"` +} + +type IdentitytoolkitRelyingpartyDownloadAccountRequest struct { + // MaxResults: The max number of results to return in the response. + MaxResults int64 `json:"maxResults,omitempty"` + + // NextPageToken: The token for the next page. This should be taken from + // the previous response. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type IdentitytoolkitRelyingpartyGetAccountInfoRequest struct { + // Email: The list of emails of the users to inquiry. + Email []string `json:"email,omitempty"` + + // IdToken: The GITKit token of the authenticated user. + IdToken string `json:"idToken,omitempty"` + + // LocalId: The list of local ID's of the users to inquiry. + LocalId []string `json:"localId,omitempty"` +} + +type IdentitytoolkitRelyingpartyResetPasswordRequest struct { + // Email: The email address of the user. + Email string `json:"email,omitempty"` + + // NewPassword: The new password inputted by the user. + NewPassword string `json:"newPassword,omitempty"` + + // OldPassword: The old password inputted by the user. + OldPassword string `json:"oldPassword,omitempty"` + + // OobCode: The confirmation code. + OobCode string `json:"oobCode,omitempty"` +} + +type IdentitytoolkitRelyingpartySetAccountInfoRequest struct { + // CaptchaChallenge: The captcha challenge. + CaptchaChallenge string `json:"captchaChallenge,omitempty"` + + // CaptchaResponse: Response to the captcha. + CaptchaResponse string `json:"captchaResponse,omitempty"` + + // DisplayName: The name of the user. + DisplayName string `json:"displayName,omitempty"` + + // Email: The email of the user. + Email string `json:"email,omitempty"` + + // EmailVerified: Mark the email as verified or not. + EmailVerified bool `json:"emailVerified,omitempty"` + + // IdToken: The GITKit token of the authenticated user. + IdToken string `json:"idToken,omitempty"` + + // LocalId: The local ID of the user. + LocalId string `json:"localId,omitempty"` + + // OobCode: The out-of-band code of the change email request. + OobCode string `json:"oobCode,omitempty"` + + // Password: The new password of the user. + Password string `json:"password,omitempty"` + + // Provider: The associated IDPs of the user. + Provider []string `json:"provider,omitempty"` + + // UpgradeToFederatedLogin: Mark the user to upgrade to federated login. + UpgradeToFederatedLogin bool `json:"upgradeToFederatedLogin,omitempty"` +} + +type IdentitytoolkitRelyingpartyUploadAccountRequest struct { + HashAlgorithm string `json:"hashAlgorithm,omitempty"` + + MemoryCost int64 `json:"memoryCost,omitempty"` + + Rounds int64 `json:"rounds,omitempty"` + + SaltSeparator string `json:"saltSeparator,omitempty"` + + SignerKey string `json:"signerKey,omitempty"` + + // Users: The account info to be stored. + Users []*UserInfo `json:"users,omitempty"` +} + +type IdentitytoolkitRelyingpartyVerifyAssertionRequest struct { + // PendingIdToken: The GITKit token for the non-trusted IDP pending to + // be confirmed by the user. + PendingIdToken string `json:"pendingIdToken,omitempty"` + + // PostBody: The post body if the request is a HTTP POST. + PostBody string `json:"postBody,omitempty"` + + // RequestUri: The URI to which the IDP redirects the user back. It may + // contain federated login result params added by the IDP. + RequestUri string `json:"requestUri,omitempty"` +} + +type IdentitytoolkitRelyingpartyVerifyPasswordRequest struct { + // CaptchaChallenge: The captcha challenge. + CaptchaChallenge string `json:"captchaChallenge,omitempty"` + + // CaptchaResponse: Response to the captcha. + CaptchaResponse string `json:"captchaResponse,omitempty"` + + // Email: The email of the user. + Email string `json:"email,omitempty"` + + // Password: The password inputed by the user. + Password string `json:"password,omitempty"` + + // PendingIdToken: The GITKit token for the non-trusted IDP, which is to + // be confirmed by the user. + PendingIdToken string `json:"pendingIdToken,omitempty"` +} + +type Relyingparty struct { + // CaptchaResp: The recaptcha response from the user. + CaptchaResp string `json:"captchaResp,omitempty"` + + // Challenge: The recaptcha challenge presented to the user. + Challenge string `json:"challenge,omitempty"` + + // Email: The email of the user. + Email string `json:"email,omitempty"` + + // IdToken: The user's Gitkit login token for email change. + IdToken string `json:"idToken,omitempty"` + + // Kind: The fixed string "identitytoolkit#relyingparty". + Kind string `json:"kind,omitempty"` + + // NewEmail: The new email if the code is for email change. + NewEmail string `json:"newEmail,omitempty"` + + // RequestType: The request type. + RequestType string `json:"requestType,omitempty"` + + // UserIp: The IP address of the user. + UserIp string `json:"userIp,omitempty"` +} + +type ResetPasswordResponse struct { + // Email: The user's email. + Email string `json:"email,omitempty"` + + // Kind: The fixed string "identitytoolkit#ResetPasswordResponse". + Kind string `json:"kind,omitempty"` +} + +type SetAccountInfoResponse struct { + // DisplayName: The name of the user. + DisplayName string `json:"displayName,omitempty"` + + // Email: The email of the user. + Email string `json:"email,omitempty"` + + // IdToken: The Gitkit id token to login the newly sign up user. + IdToken string `json:"idToken,omitempty"` + + // Kind: The fixed string "identitytoolkit#SetAccountInfoResponse". + Kind string `json:"kind,omitempty"` + + // ProviderUserInfo: The user's profiles at the associated IdPs. + ProviderUserInfo []*SetAccountInfoResponseProviderUserInfo `json:"providerUserInfo,omitempty"` +} + +type SetAccountInfoResponseProviderUserInfo struct { + // DisplayName: The user's display name at the IDP. + DisplayName string `json:"displayName,omitempty"` + + // PhotoUrl: The user's photo url at the IDP. + PhotoUrl string `json:"photoUrl,omitempty"` + + // ProviderId: The IdP ID. For whitelisted IdPs it's a short domain + // name, e.g., google.com, aol.com, live.net and yahoo.com. For other + // OpenID IdPs it's the OP identifier. + ProviderId string `json:"providerId,omitempty"` +} + +type UploadAccountResponse struct { + // Error: The error encountered while processing the account info. + Error []*UploadAccountResponseError `json:"error,omitempty"` + + // Kind: The fixed string "identitytoolkit#UploadAccountResponse". + Kind string `json:"kind,omitempty"` +} + +type UploadAccountResponseError struct { + // Index: The index of the malformed account, starting from 0. + Index int64 `json:"index,omitempty"` + + // Message: Detailed error message for the account info. + Message string `json:"message,omitempty"` +} + +type UserInfo struct { + // DisplayName: The name of the user. + DisplayName string `json:"displayName,omitempty"` + + // Email: The email of the user. + Email string `json:"email,omitempty"` + + // EmailVerified: Whether the email has been verified. + EmailVerified bool `json:"emailVerified,omitempty"` + + // LocalId: The local ID of the user. + LocalId string `json:"localId,omitempty"` + + // PasswordHash: The user's hashed password. + PasswordHash string `json:"passwordHash,omitempty"` + + // PasswordUpdatedAt: The timestamp when the password was last updated. + PasswordUpdatedAt float64 `json:"passwordUpdatedAt,omitempty"` + + // PhotoUrl: The URL of the user profile photo. + PhotoUrl string `json:"photoUrl,omitempty"` + + // ProviderUserInfo: The IDP of the user. + ProviderUserInfo []*UserInfoProviderUserInfo `json:"providerUserInfo,omitempty"` + + // Salt: The user's password salt. + Salt string `json:"salt,omitempty"` + + // Version: Version of the user's password. + Version int64 `json:"version,omitempty"` +} + +type UserInfoProviderUserInfo struct { + // DisplayName: The user's display name at the IDP. + DisplayName string `json:"displayName,omitempty"` + + // FederatedId: User's identifier at IDP. + FederatedId string `json:"federatedId,omitempty"` + + // PhotoUrl: The user's photo url at the IDP. + PhotoUrl string `json:"photoUrl,omitempty"` + + // ProviderId: The IdP ID. For white listed IdPs it's a short domain + // name, e.g., google.com, aol.com, live.net and yahoo.com. For other + // OpenID IdPs it's the OP identifier. + ProviderId string `json:"providerId,omitempty"` +} + +type VerifyAssertionResponse struct { + // Action: The action code. + Action string `json:"action,omitempty"` + + // AppInstallationUrl: URL for OTA app installation. + AppInstallationUrl string `json:"appInstallationUrl,omitempty"` + + // AppScheme: The custom scheme used by mobile app. + AppScheme string `json:"appScheme,omitempty"` + + // Context: The opaque value used by the client to maintain context info + // between the authentication request and the IDP callback. + Context string `json:"context,omitempty"` + + // DateOfBirth: The birth date of the IdP account. + DateOfBirth string `json:"dateOfBirth,omitempty"` + + // DisplayName: The display name of the user. + DisplayName string `json:"displayName,omitempty"` + + // Email: The email returned by the IdP. NOTE: The federated login user + // may not own the email. + Email string `json:"email,omitempty"` + + // EmailRecycled: It's true if the email is recycled. + EmailRecycled bool `json:"emailRecycled,omitempty"` + + // EmailVerified: The value is true if the IDP is also the email + // provider. It means the user owns the email. + EmailVerified bool `json:"emailVerified,omitempty"` + + // FederatedId: The unique ID identifies the IdP account. + FederatedId string `json:"federatedId,omitempty"` + + // FirstName: The first name of the user. + FirstName string `json:"firstName,omitempty"` + + // FullName: The full name of the user. + FullName string `json:"fullName,omitempty"` + + // IdToken: The ID token. + IdToken string `json:"idToken,omitempty"` + + // InputEmail: It's the identifier param in the createAuthUri request if + // the identifier is an email. It can be used to check whether the user + // input email is different from the asserted email. + InputEmail string `json:"inputEmail,omitempty"` + + // Kind: The fixed string "identitytoolkit#VerifyAssertionResponse". + Kind string `json:"kind,omitempty"` + + // Language: The language preference of the user. + Language string `json:"language,omitempty"` + + // LastName: The last name of the user. + LastName string `json:"lastName,omitempty"` + + // LocalId: The RP local ID if it's already been mapped to the IdP + // account identified by the federated ID. + LocalId string `json:"localId,omitempty"` + + // NeedConfirmation: Whether the assertion is from a non-trusted IDP and + // need account linking confirmation. + NeedConfirmation bool `json:"needConfirmation,omitempty"` + + // NickName: The nick name of the user. + NickName string `json:"nickName,omitempty"` + + // OauthRequestToken: The user approved request token for the OpenID + // OAuth extension. + OauthRequestToken string `json:"oauthRequestToken,omitempty"` + + // OauthScope: The scope for the OpenID OAuth extension. + OauthScope string `json:"oauthScope,omitempty"` + + // OriginalEmail: The original email stored in the mapping storage. It's + // returned when the federated ID is associated to a different email. + OriginalEmail string `json:"originalEmail,omitempty"` + + // PhotoUrl: The URI of the public accessible profiel picture. + PhotoUrl string `json:"photoUrl,omitempty"` + + // ProviderId: The IdP ID. For white listed IdPs it's a short domain + // name e.g. google.com, aol.com, live.net and yahoo.com. If the + // "providerId" param is set to OpenID OP identifer other than the + // whilte listed IdPs the OP identifier is returned. If the "identifier" + // param is federated ID in the createAuthUri request. The domain part + // of the federated ID is returned. + ProviderId string `json:"providerId,omitempty"` + + // TimeZone: The timezone of the user. + TimeZone string `json:"timeZone,omitempty"` + + // VerifiedProvider: When action is 'map', contains the idps which can + // be used for confirmation. + VerifiedProvider []string `json:"verifiedProvider,omitempty"` +} + +type VerifyPasswordResponse struct { + // DisplayName: The name of the user. + DisplayName string `json:"displayName,omitempty"` + + // Email: The email returned by the IdP. NOTE: The federated login user + // may not own the email. + Email string `json:"email,omitempty"` + + // IdToken: The GITKit token for authenticated user. + IdToken string `json:"idToken,omitempty"` + + // Kind: The fixed string "identitytoolkit#VerifyPasswordResponse". + Kind string `json:"kind,omitempty"` + + // LocalId: The RP local ID if it's already been mapped to the IdP + // account identified by the federated ID. + LocalId string `json:"localId,omitempty"` + + // PhotoUrl: The URI of the user's photo at IdP + PhotoUrl string `json:"photoUrl,omitempty"` + + // Registered: Whether the email is registered. + Registered bool `json:"registered,omitempty"` +} + +// method id "identitytoolkit.relyingparty.createAuthUri": + +type RelyingpartyCreateAuthUriCall struct { + s *Service + identitytoolkitrelyingpartycreateauthurirequest *IdentitytoolkitRelyingpartyCreateAuthUriRequest + opt_ map[string]interface{} +} + +// CreateAuthUri: Creates the URI used by the IdP to authenticate the +// user. +func (r *RelyingpartyService) CreateAuthUri(identitytoolkitrelyingpartycreateauthurirequest *IdentitytoolkitRelyingpartyCreateAuthUriRequest) *RelyingpartyCreateAuthUriCall { + c := &RelyingpartyCreateAuthUriCall{s: r.s, opt_: make(map[string]interface{})} + c.identitytoolkitrelyingpartycreateauthurirequest = identitytoolkitrelyingpartycreateauthurirequest + return c +} + +func (c *RelyingpartyCreateAuthUriCall) Do() (*CreateAuthUriResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartycreateauthurirequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "createAuthUri") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CreateAuthUriResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates the URI used by the IdP to authenticate the user.", + // "httpMethod": "POST", + // "id": "identitytoolkit.relyingparty.createAuthUri", + // "path": "createAuthUri", + // "request": { + // "$ref": "IdentitytoolkitRelyingpartyCreateAuthUriRequest" + // }, + // "response": { + // "$ref": "CreateAuthUriResponse" + // } + // } + +} + +// method id "identitytoolkit.relyingparty.deleteAccount": + +type RelyingpartyDeleteAccountCall struct { + s *Service + identitytoolkitrelyingpartydeleteaccountrequest *IdentitytoolkitRelyingpartyDeleteAccountRequest + opt_ map[string]interface{} +} + +// DeleteAccount: Delete user account. +func (r *RelyingpartyService) DeleteAccount(identitytoolkitrelyingpartydeleteaccountrequest *IdentitytoolkitRelyingpartyDeleteAccountRequest) *RelyingpartyDeleteAccountCall { + c := &RelyingpartyDeleteAccountCall{s: r.s, opt_: make(map[string]interface{})} + c.identitytoolkitrelyingpartydeleteaccountrequest = identitytoolkitrelyingpartydeleteaccountrequest + return c +} + +func (c *RelyingpartyDeleteAccountCall) Do() (*DeleteAccountResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartydeleteaccountrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "deleteAccount") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DeleteAccountResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Delete user account.", + // "httpMethod": "POST", + // "id": "identitytoolkit.relyingparty.deleteAccount", + // "path": "deleteAccount", + // "request": { + // "$ref": "IdentitytoolkitRelyingpartyDeleteAccountRequest" + // }, + // "response": { + // "$ref": "DeleteAccountResponse" + // } + // } + +} + +// method id "identitytoolkit.relyingparty.downloadAccount": + +type RelyingpartyDownloadAccountCall struct { + s *Service + identitytoolkitrelyingpartydownloadaccountrequest *IdentitytoolkitRelyingpartyDownloadAccountRequest + opt_ map[string]interface{} +} + +// DownloadAccount: Batch download user accounts. +func (r *RelyingpartyService) DownloadAccount(identitytoolkitrelyingpartydownloadaccountrequest *IdentitytoolkitRelyingpartyDownloadAccountRequest) *RelyingpartyDownloadAccountCall { + c := &RelyingpartyDownloadAccountCall{s: r.s, opt_: make(map[string]interface{})} + c.identitytoolkitrelyingpartydownloadaccountrequest = identitytoolkitrelyingpartydownloadaccountrequest + return c +} + +func (c *RelyingpartyDownloadAccountCall) Do() (*DownloadAccountResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartydownloadaccountrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "downloadAccount") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DownloadAccountResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Batch download user accounts.", + // "httpMethod": "POST", + // "id": "identitytoolkit.relyingparty.downloadAccount", + // "path": "downloadAccount", + // "request": { + // "$ref": "IdentitytoolkitRelyingpartyDownloadAccountRequest" + // }, + // "response": { + // "$ref": "DownloadAccountResponse" + // } + // } + +} + +// method id "identitytoolkit.relyingparty.getAccountInfo": + +type RelyingpartyGetAccountInfoCall struct { + s *Service + identitytoolkitrelyingpartygetaccountinforequest *IdentitytoolkitRelyingpartyGetAccountInfoRequest + opt_ map[string]interface{} +} + +// GetAccountInfo: Returns the account info. +func (r *RelyingpartyService) GetAccountInfo(identitytoolkitrelyingpartygetaccountinforequest *IdentitytoolkitRelyingpartyGetAccountInfoRequest) *RelyingpartyGetAccountInfoCall { + c := &RelyingpartyGetAccountInfoCall{s: r.s, opt_: make(map[string]interface{})} + c.identitytoolkitrelyingpartygetaccountinforequest = identitytoolkitrelyingpartygetaccountinforequest + return c +} + +func (c *RelyingpartyGetAccountInfoCall) Do() (*GetAccountInfoResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartygetaccountinforequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "getAccountInfo") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(GetAccountInfoResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the account info.", + // "httpMethod": "POST", + // "id": "identitytoolkit.relyingparty.getAccountInfo", + // "path": "getAccountInfo", + // "request": { + // "$ref": "IdentitytoolkitRelyingpartyGetAccountInfoRequest" + // }, + // "response": { + // "$ref": "GetAccountInfoResponse" + // } + // } + +} + +// method id "identitytoolkit.relyingparty.getOobConfirmationCode": + +type RelyingpartyGetOobConfirmationCodeCall struct { + s *Service + relyingparty *Relyingparty + opt_ map[string]interface{} +} + +// GetOobConfirmationCode: Get a code for user action confirmation. +func (r *RelyingpartyService) GetOobConfirmationCode(relyingparty *Relyingparty) *RelyingpartyGetOobConfirmationCodeCall { + c := &RelyingpartyGetOobConfirmationCodeCall{s: r.s, opt_: make(map[string]interface{})} + c.relyingparty = relyingparty + return c +} + +func (c *RelyingpartyGetOobConfirmationCodeCall) Do() (*GetOobConfirmationCodeResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.relyingparty) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "getOobConfirmationCode") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(GetOobConfirmationCodeResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a code for user action confirmation.", + // "httpMethod": "POST", + // "id": "identitytoolkit.relyingparty.getOobConfirmationCode", + // "path": "getOobConfirmationCode", + // "request": { + // "$ref": "Relyingparty" + // }, + // "response": { + // "$ref": "GetOobConfirmationCodeResponse" + // } + // } + +} + +// method id "identitytoolkit.relyingparty.resetPassword": + +type RelyingpartyResetPasswordCall struct { + s *Service + identitytoolkitrelyingpartyresetpasswordrequest *IdentitytoolkitRelyingpartyResetPasswordRequest + opt_ map[string]interface{} +} + +// ResetPassword: Set account info for a user. +func (r *RelyingpartyService) ResetPassword(identitytoolkitrelyingpartyresetpasswordrequest *IdentitytoolkitRelyingpartyResetPasswordRequest) *RelyingpartyResetPasswordCall { + c := &RelyingpartyResetPasswordCall{s: r.s, opt_: make(map[string]interface{})} + c.identitytoolkitrelyingpartyresetpasswordrequest = identitytoolkitrelyingpartyresetpasswordrequest + return c +} + +func (c *RelyingpartyResetPasswordCall) Do() (*ResetPasswordResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartyresetpasswordrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "resetPassword") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ResetPasswordResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Set account info for a user.", + // "httpMethod": "POST", + // "id": "identitytoolkit.relyingparty.resetPassword", + // "path": "resetPassword", + // "request": { + // "$ref": "IdentitytoolkitRelyingpartyResetPasswordRequest" + // }, + // "response": { + // "$ref": "ResetPasswordResponse" + // } + // } + +} + +// method id "identitytoolkit.relyingparty.setAccountInfo": + +type RelyingpartySetAccountInfoCall struct { + s *Service + identitytoolkitrelyingpartysetaccountinforequest *IdentitytoolkitRelyingpartySetAccountInfoRequest + opt_ map[string]interface{} +} + +// SetAccountInfo: Set account info for a user. +func (r *RelyingpartyService) SetAccountInfo(identitytoolkitrelyingpartysetaccountinforequest *IdentitytoolkitRelyingpartySetAccountInfoRequest) *RelyingpartySetAccountInfoCall { + c := &RelyingpartySetAccountInfoCall{s: r.s, opt_: make(map[string]interface{})} + c.identitytoolkitrelyingpartysetaccountinforequest = identitytoolkitrelyingpartysetaccountinforequest + return c +} + +func (c *RelyingpartySetAccountInfoCall) Do() (*SetAccountInfoResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartysetaccountinforequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "setAccountInfo") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SetAccountInfoResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Set account info for a user.", + // "httpMethod": "POST", + // "id": "identitytoolkit.relyingparty.setAccountInfo", + // "path": "setAccountInfo", + // "request": { + // "$ref": "IdentitytoolkitRelyingpartySetAccountInfoRequest" + // }, + // "response": { + // "$ref": "SetAccountInfoResponse" + // } + // } + +} + +// method id "identitytoolkit.relyingparty.uploadAccount": + +type RelyingpartyUploadAccountCall struct { + s *Service + identitytoolkitrelyingpartyuploadaccountrequest *IdentitytoolkitRelyingpartyUploadAccountRequest + opt_ map[string]interface{} +} + +// UploadAccount: Batch upload existing user accounts. +func (r *RelyingpartyService) UploadAccount(identitytoolkitrelyingpartyuploadaccountrequest *IdentitytoolkitRelyingpartyUploadAccountRequest) *RelyingpartyUploadAccountCall { + c := &RelyingpartyUploadAccountCall{s: r.s, opt_: make(map[string]interface{})} + c.identitytoolkitrelyingpartyuploadaccountrequest = identitytoolkitrelyingpartyuploadaccountrequest + return c +} + +func (c *RelyingpartyUploadAccountCall) Do() (*UploadAccountResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartyuploadaccountrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "uploadAccount") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UploadAccountResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Batch upload existing user accounts.", + // "httpMethod": "POST", + // "id": "identitytoolkit.relyingparty.uploadAccount", + // "path": "uploadAccount", + // "request": { + // "$ref": "IdentitytoolkitRelyingpartyUploadAccountRequest" + // }, + // "response": { + // "$ref": "UploadAccountResponse" + // } + // } + +} + +// method id "identitytoolkit.relyingparty.verifyAssertion": + +type RelyingpartyVerifyAssertionCall struct { + s *Service + identitytoolkitrelyingpartyverifyassertionrequest *IdentitytoolkitRelyingpartyVerifyAssertionRequest + opt_ map[string]interface{} +} + +// VerifyAssertion: Verifies the assertion returned by the IdP. +func (r *RelyingpartyService) VerifyAssertion(identitytoolkitrelyingpartyverifyassertionrequest *IdentitytoolkitRelyingpartyVerifyAssertionRequest) *RelyingpartyVerifyAssertionCall { + c := &RelyingpartyVerifyAssertionCall{s: r.s, opt_: make(map[string]interface{})} + c.identitytoolkitrelyingpartyverifyassertionrequest = identitytoolkitrelyingpartyverifyassertionrequest + return c +} + +func (c *RelyingpartyVerifyAssertionCall) Do() (*VerifyAssertionResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartyverifyassertionrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "verifyAssertion") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(VerifyAssertionResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Verifies the assertion returned by the IdP.", + // "httpMethod": "POST", + // "id": "identitytoolkit.relyingparty.verifyAssertion", + // "path": "verifyAssertion", + // "request": { + // "$ref": "IdentitytoolkitRelyingpartyVerifyAssertionRequest" + // }, + // "response": { + // "$ref": "VerifyAssertionResponse" + // } + // } + +} + +// method id "identitytoolkit.relyingparty.verifyPassword": + +type RelyingpartyVerifyPasswordCall struct { + s *Service + identitytoolkitrelyingpartyverifypasswordrequest *IdentitytoolkitRelyingpartyVerifyPasswordRequest + opt_ map[string]interface{} +} + +// VerifyPassword: Verifies the user entered password. +func (r *RelyingpartyService) VerifyPassword(identitytoolkitrelyingpartyverifypasswordrequest *IdentitytoolkitRelyingpartyVerifyPasswordRequest) *RelyingpartyVerifyPasswordCall { + c := &RelyingpartyVerifyPasswordCall{s: r.s, opt_: make(map[string]interface{})} + c.identitytoolkitrelyingpartyverifypasswordrequest = identitytoolkitrelyingpartyverifypasswordrequest + return c +} + +func (c *RelyingpartyVerifyPasswordCall) Do() (*VerifyPasswordResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.identitytoolkitrelyingpartyverifypasswordrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "verifyPassword") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(VerifyPasswordResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Verifies the user entered password.", + // "httpMethod": "POST", + // "id": "identitytoolkit.relyingparty.verifyPassword", + // "path": "verifyPassword", + // "request": { + // "$ref": "IdentitytoolkitRelyingpartyVerifyPasswordRequest" + // }, + // "response": { + // "$ref": "VerifyPasswordResponse" + // } + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/latitude/v1/latitude-api.json b/third_party/src/code.google.com/p/google-api-go-client/latitude/v1/latitude-api.json new file mode 100644 index 0000000000000..8d48768c7dd52 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/latitude/v1/latitude-api.json @@ -0,0 +1,351 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"BgGnx7p-6wsAbOn4St99QhtBGbA/TKLTAqrqg3ZwD--yrgL0HXd_jYw\"", + "discoveryVersion": "v1", + "id": "latitude:v1", + "name": "latitude", + "version": "v1", + "revision": "20120710", + "title": "Google Latitude API", + "description": "Lets you read and update your current location and work with your location history", + "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/latitude/v1/using", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/latitude/v1/", + "basePath": "/latitude/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "latitude/v1/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "atom", + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/atom+xml", + "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": "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/latitude.all.best": { + "description": "Manage your best-available location and location history" + }, + "https://www.googleapis.com/auth/latitude.all.city": { + "description": "Manage your city-level location and location history" + }, + "https://www.googleapis.com/auth/latitude.current.best": { + "description": "Manage your best-available location" + }, + "https://www.googleapis.com/auth/latitude.current.city": { + "description": "Manage your city-level location" + } + } + } + }, + "features": [ + "dataWrapper" + ], + "schemas": { + "LatitudeCurrentlocationResourceJson": { + "$ref": "Location" + }, + "Location": { + "id": "Location", + "type": "object", + "description": "A Location resource identifies a user's position at a particular time. It may include metadata about the user's position, such as a venue if the location was recorded at the time of a check-in.", + "properties": { + "accuracy": { + "type": "any", + "description": "Accuracy of the latitude and longitude coordinates, in non-negative meters. Optional." + }, + "activityId": { + "type": "any", + "description": "Unique ID of the Buzz message that corresponds to the check-in associated with this location. Available only for check-in locations. Optional." + }, + "altitude": { + "type": "any", + "description": "Altitude of the location, in meters. Optional." + }, + "altitudeAccuracy": { + "type": "any", + "description": "Accuracy of the altitude value, in meters. Optional." + }, + "heading": { + "type": "any", + "description": "Direction of travel of the user when this location was recorded. In degrees, clockwise relative to true north. Optional." + }, + "kind": { + "type": "string", + "description": "Kind of this item.", + "default": "latitude#location" + }, + "latitude": { + "type": "any", + "description": "Latitude of the location, in decimal degrees." + }, + "longitude": { + "type": "any", + "description": "Longitude of the location, in decimal degrees." + }, + "speed": { + "type": "any", + "description": "Ground speed of the user at the time this location was recorded, in meters per second. Non-negative. Optional." + }, + "timestampMs": { + "type": "any", + "description": "Timestamp of the Location Resource, in milliseconds since the epoch (UTC). This is also the Location Resource's unique id." + } + } + }, + "LocationFeed": { + "id": "LocationFeed", + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "Location" + } + }, + "kind": { + "type": "string", + "default": "latitude#locationFeed" + } + } + } + }, + "resources": { + "currentLocation": { + "methods": { + "delete": { + "id": "latitude.currentLocation.delete", + "path": "currentLocation", + "httpMethod": "DELETE", + "description": "Deletes the authenticated user's current location.", + "scopes": [ + "https://www.googleapis.com/auth/latitude.all.best", + "https://www.googleapis.com/auth/latitude.all.city", + "https://www.googleapis.com/auth/latitude.current.best", + "https://www.googleapis.com/auth/latitude.current.city" + ] + }, + "get": { + "id": "latitude.currentLocation.get", + "path": "currentLocation", + "httpMethod": "GET", + "description": "Returns the authenticated user's current location.", + "parameters": { + "granularity": { + "type": "string", + "description": "Granularity of the requested location.", + "default": "city", + "enum": [ + "best", + "city" + ], + "enumDescriptions": [ + "Request best available granularity.", + "Request city-level granularty." + ], + "location": "query" + } + }, + "response": { + "$ref": "LatitudeCurrentlocationResourceJson" + }, + "scopes": [ + "https://www.googleapis.com/auth/latitude.all.best", + "https://www.googleapis.com/auth/latitude.all.city", + "https://www.googleapis.com/auth/latitude.current.best", + "https://www.googleapis.com/auth/latitude.current.city" + ] + }, + "insert": { + "id": "latitude.currentLocation.insert", + "path": "currentLocation", + "httpMethod": "POST", + "description": "Updates or creates the user's current location.", + "request": { + "$ref": "LatitudeCurrentlocationResourceJson" + }, + "response": { + "$ref": "LatitudeCurrentlocationResourceJson" + }, + "scopes": [ + "https://www.googleapis.com/auth/latitude.all.best", + "https://www.googleapis.com/auth/latitude.all.city", + "https://www.googleapis.com/auth/latitude.current.best", + "https://www.googleapis.com/auth/latitude.current.city" + ] + } + } + }, + "location": { + "methods": { + "delete": { + "id": "latitude.location.delete", + "path": "location/{locationId}", + "httpMethod": "DELETE", + "description": "Deletes a location from the user's location history.", + "parameters": { + "locationId": { + "type": "string", + "description": "Timestamp of the location to delete (ms since epoch).", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "locationId" + ], + "scopes": [ + "https://www.googleapis.com/auth/latitude.all.best", + "https://www.googleapis.com/auth/latitude.all.city" + ] + }, + "get": { + "id": "latitude.location.get", + "path": "location/{locationId}", + "httpMethod": "GET", + "description": "Reads a location from the user's location history.", + "parameters": { + "granularity": { + "type": "string", + "description": "Granularity of the location to return.", + "default": "city", + "enum": [ + "best", + "city" + ], + "enumDescriptions": [ + "Request best available granularity.", + "Request city-level granularty." + ], + "location": "query" + }, + "locationId": { + "type": "string", + "description": "Timestamp of the location to read (ms since epoch).", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "locationId" + ], + "response": { + "$ref": "Location" + }, + "scopes": [ + "https://www.googleapis.com/auth/latitude.all.best", + "https://www.googleapis.com/auth/latitude.all.city" + ] + }, + "insert": { + "id": "latitude.location.insert", + "path": "location", + "httpMethod": "POST", + "description": "Inserts or updates a location in the user's location history.", + "request": { + "$ref": "Location" + }, + "response": { + "$ref": "Location" + }, + "scopes": [ + "https://www.googleapis.com/auth/latitude.all.best", + "https://www.googleapis.com/auth/latitude.all.city" + ] + }, + "list": { + "id": "latitude.location.list", + "path": "location", + "httpMethod": "GET", + "description": "Lists the user's location history.", + "parameters": { + "granularity": { + "type": "string", + "description": "Granularity of the requested locations.", + "default": "city", + "enum": [ + "best", + "city" + ], + "enumDescriptions": [ + "Request best available granularity.", + "Request city-level granularty." + ], + "location": "query" + }, + "max-results": { + "type": "string", + "description": "Maximum number of locations to return.", + "location": "query" + }, + "max-time": { + "type": "string", + "description": "Maximum timestamp of locations to return (ms since epoch).", + "location": "query" + }, + "min-time": { + "type": "string", + "description": "Minimum timestamp of locations to return (ms since epoch).", + "location": "query" + } + }, + "response": { + "$ref": "LocationFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/latitude.all.best", + "https://www.googleapis.com/auth/latitude.all.city" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/latitude/v1/latitude-gen.go b/third_party/src/code.google.com/p/google-api-go-client/latitude/v1/latitude-gen.go new file mode 100644 index 0000000000000..c118846d47bb0 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/latitude/v1/latitude-gen.go @@ -0,0 +1,661 @@ +// Package latitude provides access to the Google Latitude API. +// +// See https://developers.google.com/latitude/v1/using +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/latitude/v1" +// ... +// latitudeService, err := latitude.New(oauthHttpClient) +package latitude + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "latitude:v1" +const apiName = "latitude" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/latitude/v1/" + +// OAuth2 scopes used by this API. +const ( + // Manage your best-available location and location history + LatitudeAllBestScope = "https://www.googleapis.com/auth/latitude.all.best" + + // Manage your city-level location and location history + LatitudeAllCityScope = "https://www.googleapis.com/auth/latitude.all.city" + + // Manage your best-available location + LatitudeCurrentBestScope = "https://www.googleapis.com/auth/latitude.current.best" + + // Manage your city-level location + LatitudeCurrentCityScope = "https://www.googleapis.com/auth/latitude.current.city" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client} + s.CurrentLocation = NewCurrentLocationService(s) + s.Location = NewLocationService(s) + return s, nil +} + +type Service struct { + client *http.Client + + CurrentLocation *CurrentLocationService + + Location *LocationService +} + +func NewCurrentLocationService(s *Service) *CurrentLocationService { + rs := &CurrentLocationService{s: s} + return rs +} + +type CurrentLocationService struct { + s *Service +} + +func NewLocationService(s *Service) *LocationService { + rs := &LocationService{s: s} + return rs +} + +type LocationService struct { + s *Service +} + +type LatitudeCurrentlocationResourceJson struct { + Location +} + +type Location struct { + // Accuracy: Accuracy of the latitude and longitude coordinates, in + // non-negative meters. Optional. + Accuracy interface{} `json:"accuracy,omitempty"` + + // ActivityId: Unique ID of the Buzz message that corresponds to the + // check-in associated with this location. Available only for check-in + // locations. Optional. + ActivityId interface{} `json:"activityId,omitempty"` + + // Altitude: Altitude of the location, in meters. Optional. + Altitude interface{} `json:"altitude,omitempty"` + + // AltitudeAccuracy: Accuracy of the altitude value, in meters. + // Optional. + AltitudeAccuracy interface{} `json:"altitudeAccuracy,omitempty"` + + // Heading: Direction of travel of the user when this location was + // recorded. In degrees, clockwise relative to true north. Optional. + Heading interface{} `json:"heading,omitempty"` + + // Kind: Kind of this item. + Kind string `json:"kind,omitempty"` + + // Latitude: Latitude of the location, in decimal degrees. + Latitude interface{} `json:"latitude,omitempty"` + + // Longitude: Longitude of the location, in decimal degrees. + Longitude interface{} `json:"longitude,omitempty"` + + // Speed: Ground speed of the user at the time this location was + // recorded, in meters per second. Non-negative. Optional. + Speed interface{} `json:"speed,omitempty"` + + // TimestampMs: Timestamp of the Location Resource, in milliseconds + // since the epoch (UTC). This is also the Location Resource's unique + // id. + TimestampMs interface{} `json:"timestampMs,omitempty"` +} + +type LocationFeed struct { + Items []*Location `json:"items,omitempty"` + + Kind string `json:"kind,omitempty"` +} + +// method id "latitude.currentLocation.delete": + +type CurrentLocationDeleteCall struct { + s *Service + opt_ map[string]interface{} +} + +// Delete: Deletes the authenticated user's current location. +func (r *CurrentLocationService) Delete() *CurrentLocationDeleteCall { + c := &CurrentLocationDeleteCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *CurrentLocationDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/latitude/v1/", "currentLocation") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the authenticated user's current location.", + // "httpMethod": "DELETE", + // "id": "latitude.currentLocation.delete", + // "path": "currentLocation", + // "scopes": [ + // "https://www.googleapis.com/auth/latitude.all.best", + // "https://www.googleapis.com/auth/latitude.all.city", + // "https://www.googleapis.com/auth/latitude.current.best", + // "https://www.googleapis.com/auth/latitude.current.city" + // ] + // } + +} + +// method id "latitude.currentLocation.get": + +type CurrentLocationGetCall struct { + s *Service + opt_ map[string]interface{} +} + +// Get: Returns the authenticated user's current location. +func (r *CurrentLocationService) Get() *CurrentLocationGetCall { + c := &CurrentLocationGetCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Granularity sets the optional parameter "granularity": Granularity of +// the requested location. +func (c *CurrentLocationGetCall) Granularity(granularity string) *CurrentLocationGetCall { + c.opt_["granularity"] = granularity + return c +} + +func (c *CurrentLocationGetCall) Do() (*LatitudeCurrentlocationResourceJson, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["granularity"]; ok { + params.Set("granularity", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/latitude/v1/", "currentLocation") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(LatitudeCurrentlocationResourceJson) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the authenticated user's current location.", + // "httpMethod": "GET", + // "id": "latitude.currentLocation.get", + // "parameters": { + // "granularity": { + // "default": "city", + // "description": "Granularity of the requested location.", + // "enum": [ + // "best", + // "city" + // ], + // "enumDescriptions": [ + // "Request best available granularity.", + // "Request city-level granularty." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "currentLocation", + // "response": { + // "$ref": "LatitudeCurrentlocationResourceJson" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/latitude.all.best", + // "https://www.googleapis.com/auth/latitude.all.city", + // "https://www.googleapis.com/auth/latitude.current.best", + // "https://www.googleapis.com/auth/latitude.current.city" + // ] + // } + +} + +// method id "latitude.currentLocation.insert": + +type CurrentLocationInsertCall struct { + s *Service + latitudecurrentlocationresourcejson *LatitudeCurrentlocationResourceJson + opt_ map[string]interface{} +} + +// Insert: Updates or creates the user's current location. +func (r *CurrentLocationService) Insert(latitudecurrentlocationresourcejson *LatitudeCurrentlocationResourceJson) *CurrentLocationInsertCall { + c := &CurrentLocationInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.latitudecurrentlocationresourcejson = latitudecurrentlocationresourcejson + return c +} + +func (c *CurrentLocationInsertCall) Do() (*LatitudeCurrentlocationResourceJson, error) { + var body io.Reader = nil + body, err := googleapi.WithDataWrapper.JSONReader(c.latitudecurrentlocationresourcejson) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/latitude/v1/", "currentLocation") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(LatitudeCurrentlocationResourceJson) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates or creates the user's current location.", + // "httpMethod": "POST", + // "id": "latitude.currentLocation.insert", + // "path": "currentLocation", + // "request": { + // "$ref": "LatitudeCurrentlocationResourceJson" + // }, + // "response": { + // "$ref": "LatitudeCurrentlocationResourceJson" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/latitude.all.best", + // "https://www.googleapis.com/auth/latitude.all.city", + // "https://www.googleapis.com/auth/latitude.current.best", + // "https://www.googleapis.com/auth/latitude.current.city" + // ] + // } + +} + +// method id "latitude.location.delete": + +type LocationDeleteCall struct { + s *Service + locationId string + opt_ map[string]interface{} +} + +// Delete: Deletes a location from the user's location history. +func (r *LocationService) Delete(locationId string) *LocationDeleteCall { + c := &LocationDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.locationId = locationId + return c +} + +func (c *LocationDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/latitude/v1/", "location/{locationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{locationId}", url.QueryEscape(c.locationId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a location from the user's location history.", + // "httpMethod": "DELETE", + // "id": "latitude.location.delete", + // "parameterOrder": [ + // "locationId" + // ], + // "parameters": { + // "locationId": { + // "description": "Timestamp of the location to delete (ms since epoch).", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "location/{locationId}", + // "scopes": [ + // "https://www.googleapis.com/auth/latitude.all.best", + // "https://www.googleapis.com/auth/latitude.all.city" + // ] + // } + +} + +// method id "latitude.location.get": + +type LocationGetCall struct { + s *Service + locationId string + opt_ map[string]interface{} +} + +// Get: Reads a location from the user's location history. +func (r *LocationService) Get(locationId string) *LocationGetCall { + c := &LocationGetCall{s: r.s, opt_: make(map[string]interface{})} + c.locationId = locationId + return c +} + +// Granularity sets the optional parameter "granularity": Granularity of +// the location to return. +func (c *LocationGetCall) Granularity(granularity string) *LocationGetCall { + c.opt_["granularity"] = granularity + return c +} + +func (c *LocationGetCall) Do() (*Location, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["granularity"]; ok { + params.Set("granularity", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/latitude/v1/", "location/{locationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{locationId}", url.QueryEscape(c.locationId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Location) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Reads a location from the user's location history.", + // "httpMethod": "GET", + // "id": "latitude.location.get", + // "parameterOrder": [ + // "locationId" + // ], + // "parameters": { + // "granularity": { + // "default": "city", + // "description": "Granularity of the location to return.", + // "enum": [ + // "best", + // "city" + // ], + // "enumDescriptions": [ + // "Request best available granularity.", + // "Request city-level granularty." + // ], + // "location": "query", + // "type": "string" + // }, + // "locationId": { + // "description": "Timestamp of the location to read (ms since epoch).", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "location/{locationId}", + // "response": { + // "$ref": "Location" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/latitude.all.best", + // "https://www.googleapis.com/auth/latitude.all.city" + // ] + // } + +} + +// method id "latitude.location.insert": + +type LocationInsertCall struct { + s *Service + location *Location + opt_ map[string]interface{} +} + +// Insert: Inserts or updates a location in the user's location history. +func (r *LocationService) Insert(location *Location) *LocationInsertCall { + c := &LocationInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.location = location + return c +} + +func (c *LocationInsertCall) Do() (*Location, error) { + var body io.Reader = nil + body, err := googleapi.WithDataWrapper.JSONReader(c.location) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/latitude/v1/", "location") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Location) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts or updates a location in the user's location history.", + // "httpMethod": "POST", + // "id": "latitude.location.insert", + // "path": "location", + // "request": { + // "$ref": "Location" + // }, + // "response": { + // "$ref": "Location" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/latitude.all.best", + // "https://www.googleapis.com/auth/latitude.all.city" + // ] + // } + +} + +// method id "latitude.location.list": + +type LocationListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Lists the user's location history. +func (r *LocationService) List() *LocationListCall { + c := &LocationListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Granularity sets the optional parameter "granularity": Granularity of +// the requested locations. +func (c *LocationListCall) Granularity(granularity string) *LocationListCall { + c.opt_["granularity"] = granularity + return c +} + +// MaxResults sets the optional parameter "max-results": Maximum number +// of locations to return. +func (c *LocationListCall) MaxResults(maxResults string) *LocationListCall { + c.opt_["max-results"] = maxResults + return c +} + +// MaxTime sets the optional parameter "max-time": Maximum timestamp of +// locations to return (ms since epoch). +func (c *LocationListCall) MaxTime(maxTime string) *LocationListCall { + c.opt_["max-time"] = maxTime + return c +} + +// MinTime sets the optional parameter "min-time": Minimum timestamp of +// locations to return (ms since epoch). +func (c *LocationListCall) MinTime(minTime string) *LocationListCall { + c.opt_["min-time"] = minTime + return c +} + +func (c *LocationListCall) Do() (*LocationFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["granularity"]; ok { + params.Set("granularity", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["max-time"]; ok { + params.Set("max-time", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["min-time"]; ok { + params.Set("min-time", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/latitude/v1/", "location") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(LocationFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the user's location history.", + // "httpMethod": "GET", + // "id": "latitude.location.list", + // "parameters": { + // "granularity": { + // "default": "city", + // "description": "Granularity of the requested locations.", + // "enum": [ + // "best", + // "city" + // ], + // "enumDescriptions": [ + // "Request best available granularity.", + // "Request city-level granularty." + // ], + // "location": "query", + // "type": "string" + // }, + // "max-results": { + // "description": "Maximum number of locations to return.", + // "location": "query", + // "type": "string" + // }, + // "max-time": { + // "description": "Maximum timestamp of locations to return (ms since epoch).", + // "location": "query", + // "type": "string" + // }, + // "min-time": { + // "description": "Minimum timestamp of locations to return (ms since epoch).", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "location", + // "response": { + // "$ref": "LocationFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/latitude.all.best", + // "https://www.googleapis.com/auth/latitude.all.city" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/lib/codereview/codereview.cfg b/third_party/src/code.google.com/p/google-api-go-client/lib/codereview/codereview.cfg new file mode 100644 index 0000000000000..2801ebf8d6ea0 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/lib/codereview/codereview.cfg @@ -0,0 +1 @@ +defaultcc: golang-codereviews@googlegroups.com diff --git a/third_party/src/code.google.com/p/google-api-go-client/licensing/v1/licensing-api.json b/third_party/src/code.google.com/p/google-api-go-client/licensing/v1/licensing-api.json new file mode 100644 index 0000000000000..f79b03b35b0ed --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/licensing/v1/licensing-api.json @@ -0,0 +1,426 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/i7ROTyL5fTp9c4DP_LXJg5raK-k\"", + "discoveryVersion": "v1", + "id": "licensing:v1", + "name": "licensing", + "version": "v1", + "title": "Enterprise License Manager API", + "description": "Licensing API to view and manage license for your domain.", + "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/licensing/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/apps/licensing/v1/product/", + "basePath": "/apps/licensing/v1/product/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "apps/licensing/v1/product/", + "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" + } + }, + "schemas": { + "LicenseAssignment": { + "id": "LicenseAssignment", + "type": "object", + "description": "Template for LiscenseAssignment Resource", + "properties": { + "etags": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "Identifies the resource as a LicenseAssignment.", + "default": "licensing#licenseAssignment" + }, + "productId": { + "type": "string", + "description": "Name of the product.", + "annotations": { + "required": [ + "licensing.licenseAssignments.update" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Link to this page." + }, + "skuId": { + "type": "string", + "description": "Name of the sku of the product.", + "annotations": { + "required": [ + "licensing.licenseAssignments.update" + ] + } + }, + "userId": { + "type": "string", + "description": "Email id of the user.", + "annotations": { + "required": [ + "licensing.licenseAssignments.update" + ] + } + } + } + }, + "LicenseAssignmentInsert": { + "id": "LicenseAssignmentInsert", + "type": "object", + "description": "Template for LicenseAssignment Insert request", + "properties": { + "userId": { + "type": "string", + "description": "Email id of the user", + "annotations": { + "required": [ + "licensing.licenseAssignments.insert" + ] + } + } + } + }, + "LicenseAssignmentList": { + "id": "LicenseAssignmentList", + "type": "object", + "description": "LicesnseAssignment List for a given product/sku for a customer.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "items": { + "type": "array", + "description": "The LicenseAssignments in this page of results.", + "items": { + "$ref": "LicenseAssignment" + } + }, + "kind": { + "type": "string", + "description": "Identifies the resource as a collection of LicenseAssignments.", + "default": "licensing#licenseAssignmentList" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + } + } + } + }, + "resources": { + "licenseAssignments": { + "methods": { + "delete": { + "id": "licensing.licenseAssignments.delete", + "path": "{productId}/sku/{skuId}/user/{userId}", + "httpMethod": "DELETE", + "description": "Revoke License.", + "parameters": { + "productId": { + "type": "string", + "description": "Name for product", + "required": true, + "location": "path" + }, + "skuId": { + "type": "string", + "description": "Name for sku", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "email id or unique Id of the user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "productId", + "skuId", + "userId" + ] + }, + "get": { + "id": "licensing.licenseAssignments.get", + "path": "{productId}/sku/{skuId}/user/{userId}", + "httpMethod": "GET", + "description": "Get license assignment of a particular product and sku for a user", + "parameters": { + "productId": { + "type": "string", + "description": "Name for product", + "required": true, + "location": "path" + }, + "skuId": { + "type": "string", + "description": "Name for sku", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "email id or unique Id of the user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "productId", + "skuId", + "userId" + ], + "response": { + "$ref": "LicenseAssignment" + } + }, + "insert": { + "id": "licensing.licenseAssignments.insert", + "path": "{productId}/sku/{skuId}/user", + "httpMethod": "POST", + "description": "Assign License.", + "parameters": { + "productId": { + "type": "string", + "description": "Name for product", + "required": true, + "location": "path" + }, + "skuId": { + "type": "string", + "description": "Name for sku", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "productId", + "skuId" + ], + "request": { + "$ref": "LicenseAssignmentInsert" + }, + "response": { + "$ref": "LicenseAssignment" + } + }, + "listForProduct": { + "id": "licensing.licenseAssignments.listForProduct", + "path": "{productId}/users", + "httpMethod": "GET", + "description": "List license assignments for given product of the customer.", + "parameters": { + "customerId": { + "type": "string", + "description": "CustomerId represents the customer for whom licenseassignments are queried", + "required": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of campaigns to return at one time. Must be positive. Optional. Default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "1", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token to fetch the next page.Optional. By default server will return first page", + "default": "", + "location": "query" + }, + "productId": { + "type": "string", + "description": "Name for product", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "productId", + "customerId" + ], + "response": { + "$ref": "LicenseAssignmentList" + } + }, + "listForProductAndSku": { + "id": "licensing.licenseAssignments.listForProductAndSku", + "path": "{productId}/sku/{skuId}/users", + "httpMethod": "GET", + "description": "List license assignments for given product and sku of the customer.", + "parameters": { + "customerId": { + "type": "string", + "description": "CustomerId represents the customer for whom licenseassignments are queried", + "required": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of campaigns to return at one time. Must be positive. Optional. Default value is 100.", + "default": "100", + "format": "uint32", + "minimum": "1", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token to fetch the next page.Optional. By default server will return first page", + "default": "", + "location": "query" + }, + "productId": { + "type": "string", + "description": "Name for product", + "required": true, + "location": "path" + }, + "skuId": { + "type": "string", + "description": "Name for sku", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "productId", + "skuId", + "customerId" + ], + "response": { + "$ref": "LicenseAssignmentList" + } + }, + "patch": { + "id": "licensing.licenseAssignments.patch", + "path": "{productId}/sku/{skuId}/user/{userId}", + "httpMethod": "PATCH", + "description": "Assign License. This method supports patch semantics.", + "parameters": { + "productId": { + "type": "string", + "description": "Name for product", + "required": true, + "location": "path" + }, + "skuId": { + "type": "string", + "description": "Name for sku for which license would be revoked", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "email id or unique Id of the user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "productId", + "skuId", + "userId" + ], + "request": { + "$ref": "LicenseAssignment" + }, + "response": { + "$ref": "LicenseAssignment" + } + }, + "update": { + "id": "licensing.licenseAssignments.update", + "path": "{productId}/sku/{skuId}/user/{userId}", + "httpMethod": "PUT", + "description": "Assign License.", + "parameters": { + "productId": { + "type": "string", + "description": "Name for product", + "required": true, + "location": "path" + }, + "skuId": { + "type": "string", + "description": "Name for sku for which license would be revoked", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "email id or unique Id of the user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "productId", + "skuId", + "userId" + ], + "request": { + "$ref": "LicenseAssignment" + }, + "response": { + "$ref": "LicenseAssignment" + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/licensing/v1/licensing-gen.go b/third_party/src/code.google.com/p/google-api-go-client/licensing/v1/licensing-gen.go new file mode 100644 index 0000000000000..2117c27f252d5 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/licensing/v1/licensing-gen.go @@ -0,0 +1,754 @@ +// Package licensing provides access to the Enterprise License Manager API. +// +// See https://developers.google.com/google-apps/licensing/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/licensing/v1" +// ... +// licensingService, err := licensing.New(oauthHttpClient) +package licensing + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "licensing:v1" +const apiName = "licensing" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/apps/licensing/v1/product/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.LicenseAssignments = NewLicenseAssignmentsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + LicenseAssignments *LicenseAssignmentsService +} + +func NewLicenseAssignmentsService(s *Service) *LicenseAssignmentsService { + rs := &LicenseAssignmentsService{s: s} + return rs +} + +type LicenseAssignmentsService struct { + s *Service +} + +type LicenseAssignment struct { + // Etags: ETag of the resource. + Etags string `json:"etags,omitempty"` + + // Kind: Identifies the resource as a LicenseAssignment. + Kind string `json:"kind,omitempty"` + + // ProductId: Name of the product. + ProductId string `json:"productId,omitempty"` + + // SelfLink: Link to this page. + SelfLink string `json:"selfLink,omitempty"` + + // SkuId: Name of the sku of the product. + SkuId string `json:"skuId,omitempty"` + + // UserId: Email id of the user. + UserId string `json:"userId,omitempty"` +} + +type LicenseAssignmentInsert struct { + // UserId: Email id of the user + UserId string `json:"userId,omitempty"` +} + +type LicenseAssignmentList struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Items: The LicenseAssignments in this page of results. + Items []*LicenseAssignment `json:"items,omitempty"` + + // Kind: Identifies the resource as a collection of LicenseAssignments. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The continuation token, used to page through large + // result sets. Provide this value in a subsequent request to return the + // next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +// method id "licensing.licenseAssignments.delete": + +type LicenseAssignmentsDeleteCall struct { + s *Service + productId string + skuId string + userId string + opt_ map[string]interface{} +} + +// Delete: Revoke License. +func (r *LicenseAssignmentsService) Delete(productId string, skuId string, userId string) *LicenseAssignmentsDeleteCall { + c := &LicenseAssignmentsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.productId = productId + c.skuId = skuId + c.userId = userId + return c +} + +func (c *LicenseAssignmentsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{productId}/sku/{skuId}/user/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{productId}", url.QueryEscape(c.productId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{skuId}", url.QueryEscape(c.skuId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Revoke License.", + // "httpMethod": "DELETE", + // "id": "licensing.licenseAssignments.delete", + // "parameterOrder": [ + // "productId", + // "skuId", + // "userId" + // ], + // "parameters": { + // "productId": { + // "description": "Name for product", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "skuId": { + // "description": "Name for sku", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "email id or unique Id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{productId}/sku/{skuId}/user/{userId}" + // } + +} + +// method id "licensing.licenseAssignments.get": + +type LicenseAssignmentsGetCall struct { + s *Service + productId string + skuId string + userId string + opt_ map[string]interface{} +} + +// Get: Get license assignment of a particular product and sku for a +// user +func (r *LicenseAssignmentsService) Get(productId string, skuId string, userId string) *LicenseAssignmentsGetCall { + c := &LicenseAssignmentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.productId = productId + c.skuId = skuId + c.userId = userId + return c +} + +func (c *LicenseAssignmentsGetCall) Do() (*LicenseAssignment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{productId}/sku/{skuId}/user/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{productId}", url.QueryEscape(c.productId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{skuId}", url.QueryEscape(c.skuId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(LicenseAssignment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get license assignment of a particular product and sku for a user", + // "httpMethod": "GET", + // "id": "licensing.licenseAssignments.get", + // "parameterOrder": [ + // "productId", + // "skuId", + // "userId" + // ], + // "parameters": { + // "productId": { + // "description": "Name for product", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "skuId": { + // "description": "Name for sku", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "email id or unique Id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{productId}/sku/{skuId}/user/{userId}", + // "response": { + // "$ref": "LicenseAssignment" + // } + // } + +} + +// method id "licensing.licenseAssignments.insert": + +type LicenseAssignmentsInsertCall struct { + s *Service + productId string + skuId string + licenseassignmentinsert *LicenseAssignmentInsert + opt_ map[string]interface{} +} + +// Insert: Assign License. +func (r *LicenseAssignmentsService) Insert(productId string, skuId string, licenseassignmentinsert *LicenseAssignmentInsert) *LicenseAssignmentsInsertCall { + c := &LicenseAssignmentsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.productId = productId + c.skuId = skuId + c.licenseassignmentinsert = licenseassignmentinsert + return c +} + +func (c *LicenseAssignmentsInsertCall) Do() (*LicenseAssignment, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.licenseassignmentinsert) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{productId}/sku/{skuId}/user") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{productId}", url.QueryEscape(c.productId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{skuId}", url.QueryEscape(c.skuId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(LicenseAssignment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Assign License.", + // "httpMethod": "POST", + // "id": "licensing.licenseAssignments.insert", + // "parameterOrder": [ + // "productId", + // "skuId" + // ], + // "parameters": { + // "productId": { + // "description": "Name for product", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "skuId": { + // "description": "Name for sku", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{productId}/sku/{skuId}/user", + // "request": { + // "$ref": "LicenseAssignmentInsert" + // }, + // "response": { + // "$ref": "LicenseAssignment" + // } + // } + +} + +// method id "licensing.licenseAssignments.listForProduct": + +type LicenseAssignmentsListForProductCall struct { + s *Service + productId string + customerId string + opt_ map[string]interface{} +} + +// ListForProduct: List license assignments for given product of the +// customer. +func (r *LicenseAssignmentsService) ListForProduct(productId string, customerId string) *LicenseAssignmentsListForProductCall { + c := &LicenseAssignmentsListForProductCall{s: r.s, opt_: make(map[string]interface{})} + c.productId = productId + c.customerId = customerId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of campaigns to return at one time. Must be positive. Default value +// is 100. +func (c *LicenseAssignmentsListForProductCall) MaxResults(maxResults int64) *LicenseAssignmentsListForProductCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Token to fetch the +// next page. By default server will return first page +func (c *LicenseAssignmentsListForProductCall) PageToken(pageToken string) *LicenseAssignmentsListForProductCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *LicenseAssignmentsListForProductCall) Do() (*LicenseAssignmentList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("customerId", fmt.Sprintf("%v", c.customerId)) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{productId}/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{productId}", url.QueryEscape(c.productId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(LicenseAssignmentList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List license assignments for given product of the customer.", + // "httpMethod": "GET", + // "id": "licensing.licenseAssignments.listForProduct", + // "parameterOrder": [ + // "productId", + // "customerId" + // ], + // "parameters": { + // "customerId": { + // "description": "CustomerId represents the customer for whom licenseassignments are queried", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Maximum number of campaigns to return at one time. Must be positive. Optional. Default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "1000", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "default": "", + // "description": "Token to fetch the next page.Optional. By default server will return first page", + // "location": "query", + // "type": "string" + // }, + // "productId": { + // "description": "Name for product", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{productId}/users", + // "response": { + // "$ref": "LicenseAssignmentList" + // } + // } + +} + +// method id "licensing.licenseAssignments.listForProductAndSku": + +type LicenseAssignmentsListForProductAndSkuCall struct { + s *Service + productId string + skuId string + customerId string + opt_ map[string]interface{} +} + +// ListForProductAndSku: List license assignments for given product and +// sku of the customer. +func (r *LicenseAssignmentsService) ListForProductAndSku(productId string, skuId string, customerId string) *LicenseAssignmentsListForProductAndSkuCall { + c := &LicenseAssignmentsListForProductAndSkuCall{s: r.s, opt_: make(map[string]interface{})} + c.productId = productId + c.skuId = skuId + c.customerId = customerId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of campaigns to return at one time. Must be positive. Default value +// is 100. +func (c *LicenseAssignmentsListForProductAndSkuCall) MaxResults(maxResults int64) *LicenseAssignmentsListForProductAndSkuCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Token to fetch the +// next page. By default server will return first page +func (c *LicenseAssignmentsListForProductAndSkuCall) PageToken(pageToken string) *LicenseAssignmentsListForProductAndSkuCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *LicenseAssignmentsListForProductAndSkuCall) Do() (*LicenseAssignmentList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("customerId", fmt.Sprintf("%v", c.customerId)) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{productId}/sku/{skuId}/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{productId}", url.QueryEscape(c.productId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{skuId}", url.QueryEscape(c.skuId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(LicenseAssignmentList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List license assignments for given product and sku of the customer.", + // "httpMethod": "GET", + // "id": "licensing.licenseAssignments.listForProductAndSku", + // "parameterOrder": [ + // "productId", + // "skuId", + // "customerId" + // ], + // "parameters": { + // "customerId": { + // "description": "CustomerId represents the customer for whom licenseassignments are queried", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Maximum number of campaigns to return at one time. Must be positive. Optional. Default value is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "1000", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "default": "", + // "description": "Token to fetch the next page.Optional. By default server will return first page", + // "location": "query", + // "type": "string" + // }, + // "productId": { + // "description": "Name for product", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "skuId": { + // "description": "Name for sku", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{productId}/sku/{skuId}/users", + // "response": { + // "$ref": "LicenseAssignmentList" + // } + // } + +} + +// method id "licensing.licenseAssignments.patch": + +type LicenseAssignmentsPatchCall struct { + s *Service + productId string + skuId string + userId string + licenseassignment *LicenseAssignment + opt_ map[string]interface{} +} + +// Patch: Assign License. This method supports patch semantics. +func (r *LicenseAssignmentsService) Patch(productId string, skuId string, userId string, licenseassignment *LicenseAssignment) *LicenseAssignmentsPatchCall { + c := &LicenseAssignmentsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.productId = productId + c.skuId = skuId + c.userId = userId + c.licenseassignment = licenseassignment + return c +} + +func (c *LicenseAssignmentsPatchCall) Do() (*LicenseAssignment, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.licenseassignment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{productId}/sku/{skuId}/user/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{productId}", url.QueryEscape(c.productId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{skuId}", url.QueryEscape(c.skuId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(LicenseAssignment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Assign License. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "licensing.licenseAssignments.patch", + // "parameterOrder": [ + // "productId", + // "skuId", + // "userId" + // ], + // "parameters": { + // "productId": { + // "description": "Name for product", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "skuId": { + // "description": "Name for sku for which license would be revoked", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "email id or unique Id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{productId}/sku/{skuId}/user/{userId}", + // "request": { + // "$ref": "LicenseAssignment" + // }, + // "response": { + // "$ref": "LicenseAssignment" + // } + // } + +} + +// method id "licensing.licenseAssignments.update": + +type LicenseAssignmentsUpdateCall struct { + s *Service + productId string + skuId string + userId string + licenseassignment *LicenseAssignment + opt_ map[string]interface{} +} + +// Update: Assign License. +func (r *LicenseAssignmentsService) Update(productId string, skuId string, userId string, licenseassignment *LicenseAssignment) *LicenseAssignmentsUpdateCall { + c := &LicenseAssignmentsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.productId = productId + c.skuId = skuId + c.userId = userId + c.licenseassignment = licenseassignment + return c +} + +func (c *LicenseAssignmentsUpdateCall) Do() (*LicenseAssignment, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.licenseassignment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{productId}/sku/{skuId}/user/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{productId}", url.QueryEscape(c.productId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{skuId}", url.QueryEscape(c.skuId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(LicenseAssignment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Assign License.", + // "httpMethod": "PUT", + // "id": "licensing.licenseAssignments.update", + // "parameterOrder": [ + // "productId", + // "skuId", + // "userId" + // ], + // "parameters": { + // "productId": { + // "description": "Name for product", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "skuId": { + // "description": "Name for sku for which license would be revoked", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "email id or unique Id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{productId}/sku/{skuId}/user/{userId}", + // "request": { + // "$ref": "LicenseAssignment" + // }, + // "response": { + // "$ref": "LicenseAssignment" + // } + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/mapsengine/v1/mapsengine-api.json b/third_party/src/code.google.com/p/google-api-go-client/mapsengine/v1/mapsengine-api.json new file mode 100644 index 0000000000000..c29b5f9fc4913 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/mapsengine/v1/mapsengine-api.json @@ -0,0 +1,3167 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"", + "discoveryVersion": "v1", + "id": "mapsengine:v1", + "name": "mapsengine", + "canonicalName": "Maps Engine", + "version": "v1", + "title": "Google Maps Engine API", + "description": "The Google Maps Engine API allows developers to store and query geospatial vector and raster data.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/maps_engine-16.png", + "x32": "http://www.google.com/images/icons/product/maps_engine-32.png" + }, + "documentationLink": "https://developers.google.com/maps-engine/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/mapsengine/v1/", + "basePath": "/mapsengine/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "mapsengine/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/mapsengine": { + "description": "View and manage your Google Maps Engine data" + }, + "https://www.googleapis.com/auth/mapsengine.readonly": { + "description": "View your Google Maps Engine data" + } + } + } + }, + "schemas": { + "AcquisitionTime": { + "id": "AcquisitionTime", + "type": "object", + "description": "Acquisition time represents acquired time of a raster.", + "properties": { + "end": { + "type": "string", + "description": "The end time if acquisition time is a range. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).", + "format": "date-time" + }, + "precision": { + "type": "string", + "description": "The precision of acquisition time. Valid values include: 'year', 'month', 'day', 'hour', 'minute' and 'second'.", + "enum": [ + "day", + "hour", + "minute", + "month", + "second", + "year" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "start": { + "type": "string", + "description": "The acquisition time, or start time if acquisition time is a range. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).", + "format": "date-time" + } + } + }, + "Border": { + "id": "Border", + "type": "object", + "description": "Border in line style. Both color and width are required.", + "properties": { + "color": { + "type": "string", + "description": "Color of the border.", + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + }, + "opacity": { + "type": "number", + "description": "Opacity of the border.", + "format": "double" + }, + "width": { + "type": "number", + "description": "Width of the border, in pixels.", + "format": "double", + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + } + } + }, + "Color": { + "id": "Color", + "type": "object", + "description": "Basic color used in styling.", + "properties": { + "color": { + "type": "string", + "description": "The CSS style color, can be in format of \"red\" or \"#7733EE\".", + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + }, + "opacity": { + "type": "number", + "description": "Opacity ranges from 0 to 1, inclusive. If not provided, default to 1.", + "format": "double" + } + } + }, + "Datasource": { + "id": "Datasource", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of a datasource." + } + } + }, + "DisplayRule": { + "id": "DisplayRule", + "type": "object", + "description": "A display rule of the vector style.", + "properties": { + "filters": { + "type": "array", + "description": "This display rule will only be applied to features that match all of the filters here. If filters is empty, then the rule applies to all features.", + "items": { + "$ref": "Filter" + } + }, + "lineOptions": { + "$ref": "LineStyle", + "description": "Style applied to lines. Required for LineString Geometry." + }, + "name": { + "type": "string", + "description": "Display rule name. Name is not unique and cannot be used for identification purpose." + }, + "pointOptions": { + "$ref": "PointStyle", + "description": "Style applied to points. Required for Point Geometry." + }, + "polygonOptions": { + "$ref": "PolygonStyle", + "description": "Style applied to polygons. Required for Polygon Geometry." + }, + "zoomLevels": { + "$ref": "ZoomLevels", + "description": "The zoom levels that this display rule apply.", + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + } + } + }, + "Feature": { + "id": "Feature", + "type": "object", + "description": "A feature within a table.", + "properties": { + "geometry": { + "$ref": "GeoJsonGeometry", + "description": "The geometry member of this Feature." + }, + "properties": { + "$ref": "GeoJsonProperties", + "description": "Key/value pairs of this Feature." + }, + "type": { + "type": "string", + "description": "Identifies this object as a feature.", + "default": "Feature" + } + } + }, + "FeatureInfo": { + "id": "FeatureInfo", + "type": "object", + "description": "A feature info contains information about individual feature.", + "properties": { + "content": { + "type": "string", + "description": "HTML template of the info window. If not provided, a default template with all attributes will be generated." + } + } + }, + "FeaturesBatchDeleteRequest": { + "id": "FeaturesBatchDeleteRequest", + "type": "object", + "description": "The request sent to features.BatchDelete.", + "properties": { + "gx_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "primaryKeys": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "FeaturesBatchInsertRequest": { + "id": "FeaturesBatchInsertRequest", + "type": "object", + "description": "The request sent to features.Insert.", + "properties": { + "features": { + "type": "array", + "items": { + "$ref": "Feature" + } + } + } + }, + "FeaturesBatchPatchRequest": { + "id": "FeaturesBatchPatchRequest", + "type": "object", + "description": "The request sent to features.BatchPatch.", + "properties": { + "features": { + "type": "array", + "items": { + "$ref": "Feature" + } + } + } + }, + "FeaturesListResponse": { + "id": "FeaturesListResponse", + "type": "object", + "description": "The response returned by a call to features.List.", + "properties": { + "allowedQueriesPerSecond": { + "type": "number", + "description": "An indicator of the maximum rate at which queries may be made, if all queries were as expensive as this query.", + "format": "double" + }, + "features": { + "type": "array", + "description": "Resources returned.", + "items": { + "$ref": "Feature" + } + }, + "nextPageToken": { + "type": "string", + "description": "Next page token." + }, + "schema": { + "$ref": "Schema", + "description": "The feature schema." + }, + "type": { + "type": "string", + "default": "FeatureCollection" + } + } + }, + "File": { + "id": "File", + "type": "object", + "description": "A single File, which is a component of an Asset.", + "properties": { + "filename": { + "type": "string", + "description": "The name of the file.", + "annotations": { + "required": [ + "mapsengine.rasters.upload", + "mapsengine.tables.upload" + ] + } + }, + "size": { + "type": "string", + "description": "The size of the file in bytes.", + "format": "int64" + }, + "uploadStatus": { + "type": "string", + "description": "The upload status of the file.", + "enum": [ + "canceled", + "complete", + "failed", + "inProgress" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "Filter": { + "id": "Filter", + "type": "object", + "description": "Conditions for filtering features.", + "properties": { + "column": { + "type": "string", + "description": "The column name to filter on.", + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + }, + "operator": { + "type": "string", + "description": "Operation used to evaluate the filter.", + "enum": [ + "!=", + "\u003c", + "\u003c=", + "==", + "\u003e", + "\u003e=", + "contains", + "endsWith", + "startsWith" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + }, + "value": { + "type": "any", + "description": "Value to be evaluated against attribute.", + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + } + } + }, + "GeoJsonGeometry": { + "id": "GeoJsonGeometry", + "description": "A geometry object", + "type": "object", + "variant": { + "discriminant": "type", + "map": [ + { + "type_value": "GeometryCollection", + "$ref": "GeoJsonGeometryCollection" + }, + { + "type_value": "LineString", + "$ref": "GeoJsonLineString" + }, + { + "type_value": "MultiLineString", + "$ref": "GeoJsonMultiLineString" + }, + { + "type_value": "MultiPoint", + "$ref": "GeoJsonMultiPoint" + }, + { + "type_value": "MultiPolygon", + "$ref": "GeoJsonMultiPolygon" + }, + { + "type_value": "Point", + "$ref": "GeoJsonPoint" + }, + { + "type_value": "Polygon", + "$ref": "GeoJsonPolygon" + } + ] + } + }, + "GeoJsonGeometryCollection": { + "id": "GeoJsonGeometryCollection", + "type": "object", + "description": "Geometry Collection", + "properties": { + "geometries": { + "type": "array", + "description": "The geometry objects that are contained within this geometry collection.", + "items": { + "$ref": "GeoJsonGeometry" + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a geometry collection.", + "enum": [ + "GeometryCollection" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonLineString": { + "id": "GeoJsonLineString", + "type": "object", + "description": "Line String", + "properties": { + "coordinates": { + "type": "array", + "description": "The coordinates of this line string as an array of two or more positions.", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a line string.", + "enum": [ + "LineString" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonMultiLineString": { + "id": "GeoJsonMultiLineString", + "type": "object", + "description": "Multi Line String", + "properties": { + "coordinates": { + "type": "array", + "description": "The coordinates of this multi-line string as an array of line string coordinate arrays.", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a multi-line string.", + "enum": [ + "MultiLineString" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonMultiPoint": { + "id": "GeoJsonMultiPoint", + "type": "object", + "properties": { + "coordinates": { + "type": "array", + "description": "The coordinates of this multi-point as an array of positions.", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a multi-point.", + "enum": [ + "MultiPoint" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonMultiPolygon": { + "id": "GeoJsonMultiPolygon", + "type": "object", + "description": "Multi Polygon", + "properties": { + "coordinates": { + "type": "array", + "description": "The coordinates of this multi-polygon as an array of polygon coordinate arrays.", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + } + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a multi-polygon.", + "enum": [ + "MultiPolygon" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonPoint": { + "id": "GeoJsonPoint", + "type": "object", + "properties": { + "coordinates": { + "type": "array", + "description": "The coordinates of this point as a position in [longitude, latitude] or [longitude, latitude, altitude] form.", + "items": { + "type": "number", + "format": "double" + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a point.", + "enum": [ + "Point" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonPolygon": { + "id": "GeoJsonPolygon", + "type": "object", + "description": "Polygon", + "properties": { + "coordinates": { + "type": "array", + "description": "The coordinates of this polygon as an array of linear ring coordinate arrays. A linear ring is a closed line string with 4 or more positions. The first and last positions are equivalent. For polygons with multiple rings, the first must be the exterior ring and any others must be interior rings or holes.", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a polygon.", + "enum": [ + "Polygon" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonProperties": { + "id": "GeoJsonProperties", + "type": "object", + "description": "The properties associated with a feature.", + "additionalProperties": { + "type": "any" + } + }, + "IconStyle": { + "id": "IconStyle", + "type": "object", + "description": "Style for icon, this is part of point style.", + "properties": { + "id": { + "type": "string", + "description": "Custom icon id." + }, + "name": { + "type": "string", + "description": "Stock icon name. To use a stock icon, prefix it with 'gx_'. See Stock icon names for valid icon names. For example, to specify small_red, set name to 'gx_small_red'." + } + } + }, + "Image": { + "id": "Image", + "type": "object", + "description": "A geo-referenced raster.", + "properties": { + "acquisitionTime": { + "$ref": "AcquisitionTime", + "description": "The acquisition time of this Raster." + }, + "attribution": { + "type": "string", + "description": "The name of the attribution to be used for this Raster.", + "annotations": { + "required": [ + "mapsengine.rasters.upload" + ] + } + }, + "bbox": { + "type": "array", + "description": "An array of four numbers (west, south, east, north) which define the rectangular bounding box which contains all of the data in this Raster. The numbers represent latitudes and longitudes in decimal degrees.", + "items": { + "type": "number", + "format": "double" + } + }, + "creationTime": { + "type": "string", + "description": "The creation time of this raster. The value is an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).", + "format": "date-time" + }, + "description": { + "type": "string", + "description": "The description of this Raster, supplied by the author." + }, + "draftAccessList": { + "type": "string", + "description": "The Map Editors access list to share this Raster with.", + "annotations": { + "required": [ + "mapsengine.rasters.upload" + ] + } + }, + "files": { + "type": "array", + "description": "The files associated with this Raster.", + "items": { + "$ref": "File" + } + }, + "id": { + "type": "string", + "description": "A globally unique ID, used to refer to this Raster." + }, + "lastModifiedTime": { + "type": "string", + "description": "The last modified time of this raster. The value is an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).", + "format": "date-time" + }, + "maskType": { + "type": "string", + "description": "The mask processing type of this Raster. Valid values include \"autoMask\", \"alphaChannelMask\", \"noMask\", \"imageMask\".", + "default": "autoMask", + "enum": [ + "alphaChannelMask", + "autoMask", + "imageMask", + "noMask" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "name": { + "type": "string", + "description": "The name of this Raster, supplied by the author.", + "annotations": { + "required": [ + "mapsengine.rasters.upload" + ] + } + }, + "processingStatus": { + "type": "string", + "description": "The processing status of this Raster. The raster processing status values can be:\n\n'notReady': The raster is not ready to be processed - some files have not been uploaded.\n'ready': The raster is queued for processing.\n'processing': The raster is currently processing.\n'complete': Processing has completed successfully.\n'failed': Processing failed to complete.", + "enum": [ + "complete", + "failed", + "notReady", + "processing", + "ready" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "projectId": { + "type": "string", + "description": "The ID of the project that this Raster is in.", + "annotations": { + "required": [ + "mapsengine.rasters.upload" + ] + } + }, + "rasterType": { + "type": "string", + "description": "The type of this Raster. Always \"image\" today.", + "default": "image" + }, + "tags": { + "type": "array", + "description": "Tags of this Raster.", + "items": { + "type": "string" + } + } + } + }, + "LabelStyle": { + "id": "LabelStyle", + "type": "object", + "description": "Text label style.", + "properties": { + "color": { + "type": "string", + "description": "Color of the text. If not provided, default to black." + }, + "column": { + "type": "string", + "description": "The column value of the feature to be displayed.", + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + }, + "fontStyle": { + "type": "string", + "description": "Font style of the label, defaults to 'normal'.", + "enum": [ + "italic", + "normal" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "fontWeight": { + "type": "string", + "description": "Font weight of the label, defaults to 'normal'.", + "enum": [ + "bold", + "normal" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "opacity": { + "type": "number", + "description": "Opacity of the text.", + "format": "double" + }, + "outline": { + "$ref": "Color", + "description": "Outline color of the text." + }, + "size": { + "type": "number", + "description": "Font size of the label, in pixels. 8 \u003c= size \u003c= 15. If not provided, a default size will be provided.", + "format": "double" + } + } + }, + "LatLngBox": { + "id": "LatLngBox", + "type": "array", + "description": "A rectangular geographic bounds.", + "items": { + "type": "number", + "format": "double" + } + }, + "Layer": { + "id": "Layer", + "type": "object", + "description": "A Layer combines multiple datasources, with styling information, for presentation on a map.", + "properties": { + "bbox": { + "type": "array", + "description": "An array of four numbers (west, south, east, north) which define the rectangular bounding box which contains all of the data in this Layer. The numbers represent latitudes and longitudes in decimal degrees.", + "items": { + "type": "number", + "format": "double" + } + }, + "creationTime": { + "type": "string", + "description": "The creation time of this layer. The value is an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).", + "format": "date-time" + }, + "datasourceType": { + "type": "string", + "description": "The type of the datasources used to build this Layer. One of either \"table\" or \"image\".", + "enum": [ + "image", + "table" + ], + "enumDescriptions": [ + "", + "" + ], + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + }, + "datasources": { + "type": "array", + "description": "An array of datasources used to build this Layer. If datasourceType is \"image\", then each element in this array is a reference to an Image or RasterCollection. If datasourceType is \"table\" then each element in this array is a reference to a Vector Table.", + "items": { + "$ref": "Datasource" + } + }, + "description": { + "type": "string", + "description": "The description of this Layer, supplied by the author." + }, + "draftAccessList": { + "type": "string", + "description": "The name of an access list of the Map Editor type. The user on whose behalf the request is being sent must be an editor on that access list. Read About access lists in the Google Maps Engine help center for more information.", + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + }, + "id": { + "type": "string", + "description": "A globally unique ID, used to refer to this Layer." + }, + "lastModifiedTime": { + "type": "string", + "description": "The last modified time of this layer. The value is an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).", + "format": "date-time" + }, + "name": { + "type": "string", + "description": "The name of this Layer, supplied by the author.", + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + }, + "processingStatus": { + "type": "string", + "description": "The processing status of this layer.", + "enum": [ + "complete", + "failed", + "notReady", + "processing", + "ready" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "projectId": { + "type": "string", + "description": "The ID of the project that this Layer is in.", + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + }, + "publishedAccessList": { + "type": "string", + "description": "The access list to whom view permissions are granted. The value must be the name of a Maps Engine access list of the Map Viewer type, and the user must be a viewer on that list. Read About access lists in the Google Maps Engine help center for more information." + }, + "style": { + "$ref": "VectorStyle", + "description": "The Styling information for a vector layer." + }, + "tags": { + "type": "array", + "description": "Tags of this Layer.", + "items": { + "type": "string" + } + } + } + }, + "LayersListResponse": { + "id": "LayersListResponse", + "type": "object", + "description": "The response returned by a call to layers.List.", + "properties": { + "layers": { + "type": "array", + "description": "Resources returned.", + "items": { + "$ref": "Layer" + } + }, + "nextPageToken": { + "type": "string", + "description": "Next page token." + } + } + }, + "LineStyle": { + "id": "LineStyle", + "type": "object", + "description": "Style for lines.", + "properties": { + "border": { + "$ref": "Border", + "description": "Border of the line. 0 \u003c border.width \u003c= 5." + }, + "dash": { + "type": "array", + "description": "Dash defines the pattern of the line, the values are pixel lengths of alternating dash and gap. If dash is not provided, then it means a solid line. Dash can contain up to 10 values and must contain even number of values.", + "items": { + "type": "number", + "format": "double" + } + }, + "label": { + "$ref": "LabelStyle", + "description": "Label style for the line." + }, + "stroke": { + "type": "object", + "description": "Stroke of the line.", + "properties": { + "color": { + "type": "string", + "description": "Color of the line.", + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + }, + "opacity": { + "type": "number", + "description": "Opacity of the line.", + "format": "double" + }, + "width": { + "type": "number", + "description": "Width of the line, in pixels. 0 \u003c= width \u003c= 10. If width is set to 0, the line will be invisible.", + "format": "double", + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + } + } + } + } + }, + "Map": { + "id": "Map", + "type": "object", + "description": "A Map is a collection of Layers, optionally contained within folders.", + "properties": { + "bbox": { + "type": "array", + "description": "An array of four numbers (west, south, east, north) which define the rectangular bounding box which contains all of the data in this Map. The numbers represent latitude and longitude in decimal degrees.", + "items": { + "type": "number", + "format": "double" + } + }, + "contents": { + "type": "array", + "description": "The contents of this Map.", + "items": { + "$ref": "MapItem" + } + }, + "creationTime": { + "type": "string", + "description": "The creation time of this map. The value is an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).", + "format": "date-time" + }, + "defaultViewport": { + "type": "array", + "description": "An array of four numbers (west, south, east, north) which defines the rectangular bounding box of the default viewport. The numbers represent latitude and longitude in decimal degrees.", + "items": { + "type": "number", + "format": "double" + } + }, + "description": { + "type": "string", + "description": "The description of this Map, supplied by the author." + }, + "id": { + "type": "string", + "description": "A globally unique ID, used to refer to this Map." + }, + "lastModifiedTime": { + "type": "string", + "description": "The last modified time of this map. The value is an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).", + "format": "date-time" + }, + "name": { + "type": "string", + "description": "The name of this Map, supplied by the author." + }, + "projectId": { + "type": "string", + "description": "The ID of the project that this Map is in." + }, + "tags": { + "type": "array", + "description": "Tags of this Map.", + "items": { + "type": "string" + } + }, + "versions": { + "type": "array", + "description": "An array containing the available versions of this Map. Currently may only contain \"published\".", + "items": { + "type": "string", + "enum": [ + "draft", + "published" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + } + }, + "MapFolder": { + "id": "MapFolder", + "type": "object", + "properties": { + "contents": { + "type": "array", + "description": "The contents of this Folder.", + "items": { + "$ref": "MapItem" + } + }, + "defaultViewport": { + "$ref": "LatLngBox", + "description": "An array of four numbers (west, south, east, north) which defines the rectangular bounding box of the default viewport. The numbers represent latitude and longitude in decimal degrees." + }, + "key": { + "type": "string", + "description": "A user defined alias for this Folder, specific to this Map." + }, + "name": { + "type": "string", + "description": "The name of this Folder." + }, + "type": { + "type": "string", + "description": "Identifies this object as a Folder. (( constant \"folder\" ))", + "default": "folder" + }, + "visibility": { + "type": "string", + "description": "The visibility setting of this Folder. One of \"defaultOn\" or \"defaultOff\"." + } + } + }, + "MapItem": { + "id": "MapItem", + "description": "A map item.", + "type": "object", + "variant": { + "discriminant": "type", + "map": [ + { + "type_value": "folder", + "$ref": "MapFolder" + }, + { + "type_value": "kmlLink", + "$ref": "MapKmlLink" + }, + { + "type_value": "layer", + "$ref": "MapLayer" + } + ] + } + }, + "MapKmlLink": { + "id": "MapKmlLink", + "type": "object", + "properties": { + "defaultViewport": { + "$ref": "LatLngBox", + "description": "An array of four numbers (west, south, east, north) which defines the rectangular bounding box of the default viewport. The numbers represent latitude and longitude in decimal degrees." + }, + "kmlUrl": { + "type": "string", + "description": "The URL to the KML file represented by this KmlLink." + }, + "name": { + "type": "string", + "description": "The name of this KmlLink." + }, + "type": { + "type": "string", + "description": "Identifies this object as a KmlLink. (( constant \"kmlLink\" ))", + "default": "kmlLink" + }, + "visibility": { + "type": "string", + "description": "The visibility setting of this KmlLink. One of \"defaultOn\" or \"defaultOff\"." + } + } + }, + "MapLayer": { + "id": "MapLayer", + "type": "object", + "properties": { + "defaultViewport": { + "$ref": "LatLngBox", + "description": "An array of four numbers (west, south, east, north) which defines the rectangular bounding box of the default viewport. The numbers represent latitude and longitude in decimal degrees." + }, + "id": { + "type": "string", + "description": "The ID of this Layer. This ID can be used to request more details about this Layer." + }, + "key": { + "type": "string", + "description": "A user defined alias for this Layer, specific to this Map." + }, + "name": { + "type": "string", + "description": "The name of this Layer." + }, + "type": { + "type": "string", + "description": "Identifies this object as a Layer. (( constant \"layer\" ))", + "default": "layer" + }, + "visibility": { + "type": "string", + "description": "The visibility setting of this Layer. One of \"defaultOn\" or \"defaultOff\"." + } + } + }, + "MapsListResponse": { + "id": "MapsListResponse", + "type": "object", + "description": "The response returned by a call to maps.List.", + "properties": { + "maps": { + "type": "array", + "description": "Resources returned.", + "items": { + "$ref": "Map" + } + }, + "nextPageToken": { + "type": "string", + "description": "Next page token." + } + } + }, + "Parent": { + "id": "Parent", + "type": "object", + "description": "A list of the parents of an asset.", + "properties": { + "id": { + "type": "string", + "description": "The ID of this parent." + } + } + }, + "ParentsListResponse": { + "id": "ParentsListResponse", + "type": "object", + "description": "The response returned by a call to parents.List.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "Next page token." + }, + "parents": { + "type": "array", + "description": "Resources returned.", + "items": { + "$ref": "Parent" + } + } + } + }, + "PointStyle": { + "id": "PointStyle", + "type": "object", + "description": "Style for points.", + "properties": { + "icon": { + "$ref": "IconStyle", + "description": "Icon for the point; exactly one field in 'icon' must be set.", + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + }, + "label": { + "$ref": "LabelStyle", + "description": "Label style for the point." + } + } + }, + "PolygonStyle": { + "id": "PolygonStyle", + "type": "object", + "description": "Style for polygons.", + "properties": { + "fill": { + "$ref": "Color", + "description": "Fill color of the polygon. If not provided, the polygon will be transparent and not visible if there is no border." + }, + "stroke": { + "$ref": "Border", + "description": "Border of the polygon. 0 \u003c border.width \u003c= 10." + } + } + }, + "ProcessResponse": { + "id": "ProcessResponse", + "type": "object", + "description": "The response returned by a call to any asset's Process method." + }, + "Project": { + "id": "Project", + "type": "object", + "description": "A project groups a collection of resources.", + "properties": { + "id": { + "type": "string", + "description": "An ID used to refer to this project." + }, + "name": { + "type": "string", + "description": "A user provided name for this project." + } + } + }, + "ProjectsListResponse": { + "id": "ProjectsListResponse", + "type": "object", + "description": "The response returned by a call to projects.List.", + "properties": { + "projects": { + "type": "array", + "description": "Projects returned.", + "items": { + "$ref": "Project" + } + } + } + }, + "PublishResponse": { + "id": "PublishResponse", + "type": "object", + "description": "The response returned by a call to any asset's Publish method." + }, + "Raster": { + "id": "Raster", + "type": "object", + "description": "A raster resource.", + "properties": { + "bbox": { + "type": "array", + "description": "An array of four numbers (west, south, east, north) which define the rectangular bounding box which contains all of the data in this Raster. The numbers represent latitudes and longitudes in decimal degrees.", + "items": { + "type": "number", + "format": "double" + } + }, + "creationTime": { + "type": "string", + "description": "The creation time of this raster. The value is an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).", + "format": "date-time" + }, + "description": { + "type": "string", + "description": "The description of this Raster, supplied by the author." + }, + "id": { + "type": "string", + "description": "A globally unique ID, used to refer to this Raster." + }, + "lastModifiedTime": { + "type": "string", + "description": "The last modified time of this raster. The value is an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).", + "format": "date-time" + }, + "name": { + "type": "string", + "description": "The name of this Raster, supplied by the author." + }, + "projectId": { + "type": "string", + "description": "The ID of the project that this Raster is in." + }, + "rasterType": { + "type": "string", + "description": "The type of this Raster. Always \"image\" today.", + "default": "image" + }, + "tags": { + "type": "array", + "description": "Tags of this Raster.", + "items": { + "type": "string" + } + } + } + }, + "RasterCollection": { + "id": "RasterCollection", + "type": "object", + "description": "A raster collection groups multiple Raster resources for inclusion in a Layer.", + "properties": { + "attribution": { + "type": "string", + "description": "The name of the attribution to be used for this RasterCollection.", + "annotations": { + "required": [ + "mapsengine.rasterCollections.create" + ] + } + }, + "bbox": { + "type": "array", + "description": "An array of four numbers (west, south, east, north) which define the rectangular bounding box which contains all of the data in this RasterCollection. The numbers represent latitudes and longitudes in decimal degrees.", + "items": { + "type": "number", + "format": "double" + } + }, + "creationTime": { + "type": "string", + "description": "The creation time of this rasterCollection. The value is an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).", + "format": "date-time" + }, + "description": { + "type": "string", + "description": "The description of this RasterCollection, supplied by the author." + }, + "draftAccessList": { + "type": "string", + "description": "The name of an access list of the Map Editor type. The user on whose behalf the request is being sent must be an editor on that access list. Read About access lists in the Google Maps Engine help center for more information.", + "annotations": { + "required": [ + "mapsengine.rasterCollections.create" + ] + } + }, + "id": { + "type": "string", + "description": "A globally unique ID, used to refer to this RasterCollection." + }, + "lastModifiedTime": { + "type": "string", + "description": "The last modified time of this rasterCollection. The value is an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).", + "format": "date-time" + }, + "mosaic": { + "type": "boolean", + "description": "True if this RasterCollection is a mosaic.", + "annotations": { + "required": [ + "mapsengine.rasterCollections.create" + ] + } + }, + "name": { + "type": "string", + "description": "The name of this RasterCollection, supplied by the author.", + "annotations": { + "required": [ + "mapsengine.rasterCollections.create" + ] + } + }, + "projectId": { + "type": "string", + "description": "The ID of the project that this RasterCollection is in.", + "annotations": { + "required": [ + "mapsengine.rasterCollections.create" + ] + } + }, + "rasterType": { + "type": "string", + "description": "The type of rasters contained within this RasterCollection.", + "enum": [ + "image" + ], + "enumDescriptions": [ + "" + ], + "annotations": { + "required": [ + "mapsengine.rasterCollections.create" + ] + } + }, + "tags": { + "type": "array", + "description": "Tags of this RasterCollection.", + "items": { + "type": "string" + } + } + } + }, + "RastercollectionsListResponse": { + "id": "RastercollectionsListResponse", + "type": "object", + "description": "The response returned by a call to raster_collections.List.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "Next page token." + }, + "rasterCollections": { + "type": "array", + "description": "Resources returned.", + "items": { + "$ref": "RasterCollection" + } + } + } + }, + "RastersListResponse": { + "id": "RastersListResponse", + "type": "object", + "description": "The response returned by a call to rasterCollections.rasters.List.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "Next page token." + }, + "rasters": { + "type": "array", + "description": "Resources returned.", + "items": { + "$ref": "Raster" + } + } + } + }, + "Resource": { + "id": "Resource", + "type": "object", + "description": "An asset is any Google Maps Engine resource that has a globally unique ID. Assets include maps, layers, vector tables, raster collections, and rasters. Projects and features are not considered assets.\n\nMore detailed information about an asset can be obtained by querying the asset's particular endpoint.", + "properties": { + "bbox": { + "type": "array", + "description": "An array of four numbers (west, south, east, north) which define the rectangular bounding box which contains all of the data in this asset. The numbers represent latitude and longitude in decimal degrees.", + "items": { + "type": "number", + "format": "double" + } + }, + "creationTime": { + "type": "string", + "description": "The creation time of this asset. The value is an RFC 3339-formatted date-time value (for example, 1970-01-01T00:00:00Z).", + "format": "date-time" + }, + "description": { + "type": "string", + "description": "The asset's description." + }, + "id": { + "type": "string", + "description": "The asset's globally unique ID." + }, + "lastModifiedTime": { + "type": "string", + "description": "The last modified time of this asset. The value is an RFC 3339-formatted date-time value (for example, 1970-01-01T00:00:00Z).", + "format": "date-time" + }, + "name": { + "type": "string", + "description": "The asset's name." + }, + "projectId": { + "type": "string", + "description": "The ID of the project to which the asset belongs." + }, + "resource": { + "type": "string", + "description": "The URL to query to retrieve the asset's complete object. The assets endpoint only returns high-level information about a resource." + }, + "tags": { + "type": "array", + "description": "An array of text strings, with each string representing a tag. More information about tags can be found in the Tagging data article of the Maps Engine help center.", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "description": "The type of asset. One of raster, rasterCollection, table, map, or layer.", + "enum": [ + "layer", + "map", + "raster", + "rasterCollection", + "table" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + }, + "ResourcesListResponse": { + "id": "ResourcesListResponse", + "type": "object", + "description": "The response returned by a call to resources.List.", + "properties": { + "assets": { + "type": "array", + "description": "Assets returned.", + "items": { + "$ref": "Resource" + } + }, + "nextPageToken": { + "type": "string", + "description": "Next page token." + } + } + }, + "Schema": { + "id": "Schema", + "type": "object", + "description": "A schema indicating the properties which may be associated with features within a Table, and the types of those properties.", + "properties": { + "columns": { + "type": "array", + "description": "An array of column objects. The first object in the array must be named geometry and be of type points, lineStrings, polygons, or mixedGeometry.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The column name." + }, + "type": { + "type": "string", + "description": "The type of data stored in this column. Accepted values are:\n \n- integer \n- double \n- boolean \n- string \n- mixedGeometry \n- points \n- lineStrings \n- polygons", + "enum": [ + "boolean", + "datetime", + "double", + "integer", + "lineStrings", + "mixedGeometry", + "points", + "polygons", + "string" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "annotations": { + "required": [ + "mapsengine.tables.create" + ] + } + }, + "primaryGeometry": { + "type": "string", + "description": "The name of the column that contains a feature's geometry. This field can be omitted during table create; Google Maps Engine supports only a single geometry column, which must be named geometry and be the first object in the columns array." + }, + "primaryKey": { + "type": "string", + "description": "The name of the column that contains the unique identifier of a Feature." + } + } + }, + "Table": { + "id": "Table", + "type": "object", + "description": "A collection of geographic features, and associated metadata.", + "properties": { + "bbox": { + "type": "array", + "description": "An array of four numbers (west, south, east, north) which define the rectangular bounding box which contains all of the data in this table.", + "items": { + "type": "number", + "format": "double" + } + }, + "creationTime": { + "type": "string", + "description": "The creation time of this table. The value is an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).", + "format": "date-time" + }, + "description": { + "type": "string", + "description": "The description of this table, supplied by the author." + }, + "draftAccessList": { + "type": "string", + "description": "The name of an access list of the Map Editor type. The user on whose behalf the request is being sent must be an editor on that access list. Read About access lists in the Google Maps Engine help center for more information.", + "annotations": { + "required": [ + "mapsengine.tables.create", + "mapsengine.tables.upload" + ] + } + }, + "files": { + "type": "array", + "description": "The files associated with this table.", + "items": { + "$ref": "File" + } + }, + "id": { + "type": "string", + "description": "A globally unique ID, used to refer to this table." + }, + "lastModifiedTime": { + "type": "string", + "description": "The last modified time of this table. The value is an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).", + "format": "date-time" + }, + "name": { + "type": "string", + "description": "The name of this table, supplied by the author.", + "annotations": { + "required": [ + "mapsengine.tables.create", + "mapsengine.tables.upload" + ] + } + }, + "processingStatus": { + "type": "string", + "description": "The processing status of this table. The supported processing status values are:\n \n- notReady: The table is not ready to be processed - some files have not been uploaded. \n- ready: The table is queued for processing. \n- processing: The table is currently processing. \n- complete: Processing has completed successfully. \n- failed: Processing failed to complete.", + "enum": [ + "complete", + "failed", + "notReady", + "processing", + "ready" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "projectId": { + "type": "string", + "description": "The ID of the project to which the table belongs.", + "annotations": { + "required": [ + "mapsengine.tables.create", + "mapsengine.tables.upload" + ] + } + }, + "publishedAccessList": { + "type": "string", + "description": "The access list to whom view permissions are granted. The value must be the name of a Maps Engine access list of the Map Viewer type, and the user must be a viewer on that list. Read About access lists in the Google Maps Engine help center for more information." + }, + "schema": { + "$ref": "Schema", + "description": "The schema for this table." + }, + "sourceEncoding": { + "type": "string", + "description": "Encoding of the uploaded files. Valid values include UTF-8, CP1251, ISO 8859-1, and Shift_JIS.", + "default": "UTF-8" + }, + "tags": { + "type": "array", + "description": "An array of text strings, with each string representing a tag. More information about tags can be found in the Tagging data article of the Maps Engine help center.", + "items": { + "type": "string" + } + } + } + }, + "TablesListResponse": { + "id": "TablesListResponse", + "type": "object", + "description": "The response returned by a call to tables.List.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "Next page token." + }, + "tables": { + "type": "array", + "description": "Resources returned.", + "items": { + "$ref": "Table" + } + } + } + }, + "VectorStyle": { + "id": "VectorStyle", + "type": "object", + "description": "A vector style contains styling information for vector layer.", + "properties": { + "displayRules": { + "type": "array", + "description": "Display rules of the vector style. The first matched rule will apply to the features. If no display rule is provided, a default display rule will be generated according to Geometry type.", + "items": { + "$ref": "DisplayRule" + } + }, + "featureInfo": { + "$ref": "FeatureInfo", + "description": "Individual feature info, this is called Info Window in Maps Engine UI. If not provided, a default template with all attributes will be generated." + }, + "type": { + "type": "string", + "description": "The type of the vector style. Currently, only displayRule is supported.", + "enum": [ + "displayRule" + ], + "enumDescriptions": [ + "" + ], + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + } + } + }, + "ZoomLevels": { + "id": "ZoomLevels", + "type": "object", + "description": "Zoom level range. Zoom levels are restricted between 0 and 24, inclusive.", + "properties": { + "max": { + "type": "integer", + "description": "Maximum zoom level.", + "format": "int32", + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + }, + "min": { + "type": "integer", + "description": "Minimum zoom level.", + "format": "int32", + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + } + } + } + }, + "resources": { + "assets": { + "methods": { + "get": { + "id": "mapsengine.assets.get", + "path": "assets/{id}", + "httpMethod": "GET", + "description": "Return metadata for a particular asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the asset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Resource" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + }, + "list": { + "id": "mapsengine.assets.list", + "path": "assets", + "httpMethod": "GET", + "description": "Return all assets readable by the current user.", + "parameters": { + "bbox": { + "type": "string", + "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.", + "location": "query" + }, + "createdAfter": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.", + "format": "date-time", + "location": "query" + }, + "createdBefore": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.", + "format": "date-time", + "location": "query" + }, + "creatorEmail": { + "type": "string", + "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.", + "format": "uint32", + "location": "query" + }, + "modifiedAfter": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.", + "format": "date-time", + "location": "query" + }, + "modifiedBefore": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.", + "format": "date-time", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + "location": "query" + }, + "projectId": { + "type": "string", + "description": "The ID of a Maps Engine project, used to filter the response. To list all available projects with their IDs, send a Projects: list request. You can also find your project ID as the value of the DashboardPlace:cid URL parameter when signed in to mapsengine.google.com.", + "location": "query" + }, + "type": { + "type": "string", + "description": "An asset type restriction. If set, only resources of this type will be returned.", + "enum": [ + "layer", + "map", + "rasterCollection", + "table" + ], + "enumDescriptions": [ + "Return layers.", + "Return maps.", + "Return raster collections.", + "Return tables." + ], + "location": "query" + } + }, + "response": { + "$ref": "ResourcesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + } + }, + "resources": { + "parents": { + "methods": { + "list": { + "id": "mapsengine.assets.parents.list", + "path": "assets/{id}/parents", + "httpMethod": "GET", + "description": "Return all parent ids of the specified asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the asset whose parents will be listed.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "ParentsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + } + } + } + } + }, + "layers": { + "methods": { + "create": { + "id": "mapsengine.layers.create", + "path": "layers", + "httpMethod": "POST", + "description": "Create a layer asset.", + "parameters": { + "process": { + "type": "boolean", + "description": "Whether to queue the created layer for processing.", + "location": "query" + } + }, + "request": { + "$ref": "Layer" + }, + "response": { + "$ref": "Layer" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "get": { + "id": "mapsengine.layers.get", + "path": "layers/{id}", + "httpMethod": "GET", + "description": "Return metadata for a particular layer.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the layer.", + "required": true, + "location": "path" + }, + "version": { + "type": "string", + "enum": [ + "draft", + "published" + ], + "enumDescriptions": [ + "The draft version.", + "The published version." + ], + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Layer" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + }, + "list": { + "id": "mapsengine.layers.list", + "path": "layers", + "httpMethod": "GET", + "description": "Return all layers readable by the current user.", + "parameters": { + "bbox": { + "type": "string", + "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.", + "location": "query" + }, + "createdAfter": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.", + "format": "date-time", + "location": "query" + }, + "createdBefore": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.", + "format": "date-time", + "location": "query" + }, + "creatorEmail": { + "type": "string", + "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.", + "format": "uint32", + "location": "query" + }, + "modifiedAfter": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.", + "format": "date-time", + "location": "query" + }, + "modifiedBefore": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.", + "format": "date-time", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + "location": "query" + }, + "projectId": { + "type": "string", + "description": "The ID of a Maps Engine project, used to filter the response. To list all available projects with their IDs, send a Projects: list request. You can also find your project ID as the value of the DashboardPlace:cid URL parameter when signed in to mapsengine.google.com.", + "location": "query" + } + }, + "response": { + "$ref": "LayersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + }, + "process": { + "id": "mapsengine.layers.process", + "path": "layers/{id}/process", + "httpMethod": "POST", + "description": "Process a layer asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the layer.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "ProcessResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "publish": { + "id": "mapsengine.layers.publish", + "path": "layers/{id}/publish", + "httpMethod": "POST", + "description": "Publish a layer asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the layer.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "PublishResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + } + }, + "resources": { + "parents": { + "methods": { + "list": { + "id": "mapsengine.layers.parents.list", + "path": "layers/{id}/parents", + "httpMethod": "GET", + "description": "Return all parent ids of the specified layer.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the layer whose parents will be listed.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "ParentsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + } + } + } + } + }, + "maps": { + "methods": { + "get": { + "id": "mapsengine.maps.get", + "path": "maps/{id}", + "httpMethod": "GET", + "description": "Return metadata for a particular map.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the map.", + "required": true, + "location": "path" + }, + "version": { + "type": "string", + "enum": [ + "draft", + "published" + ], + "enumDescriptions": [ + "The draft version.", + "The published version." + ], + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Map" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + }, + "list": { + "id": "mapsengine.maps.list", + "path": "maps", + "httpMethod": "GET", + "description": "Return all maps readable by the current user.", + "parameters": { + "bbox": { + "type": "string", + "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.", + "location": "query" + }, + "createdAfter": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.", + "format": "date-time", + "location": "query" + }, + "createdBefore": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.", + "format": "date-time", + "location": "query" + }, + "creatorEmail": { + "type": "string", + "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.", + "format": "uint32", + "location": "query" + }, + "modifiedAfter": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.", + "format": "date-time", + "location": "query" + }, + "modifiedBefore": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.", + "format": "date-time", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + "location": "query" + }, + "projectId": { + "type": "string", + "description": "The ID of a Maps Engine project, used to filter the response. To list all available projects with their IDs, send a Projects: list request. You can also find your project ID as the value of the DashboardPlace:cid URL parameter when signed in to mapsengine.google.com.", + "location": "query" + } + }, + "response": { + "$ref": "MapsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + } + } + }, + "projects": { + "methods": { + "list": { + "id": "mapsengine.projects.list", + "path": "projects", + "httpMethod": "GET", + "description": "Return all projects readable by the current user.", + "response": { + "$ref": "ProjectsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + } + } + }, + "rasterCollections": { + "methods": { + "create": { + "id": "mapsengine.rasterCollections.create", + "path": "rasterCollections", + "httpMethod": "POST", + "description": "Create a raster collection asset.", + "request": { + "$ref": "RasterCollection" + }, + "response": { + "$ref": "RasterCollection" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "get": { + "id": "mapsengine.rasterCollections.get", + "path": "rasterCollections/{id}", + "httpMethod": "GET", + "description": "Return metadata for a particular raster collection.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the raster collection.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "RasterCollection" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + }, + "list": { + "id": "mapsengine.rasterCollections.list", + "path": "rasterCollections", + "httpMethod": "GET", + "description": "Return all raster collections readable by the current user.", + "parameters": { + "bbox": { + "type": "string", + "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.", + "location": "query" + }, + "createdAfter": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.", + "format": "date-time", + "location": "query" + }, + "createdBefore": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.", + "format": "date-time", + "location": "query" + }, + "creatorEmail": { + "type": "string", + "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.", + "format": "uint32", + "location": "query" + }, + "modifiedAfter": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.", + "format": "date-time", + "location": "query" + }, + "modifiedBefore": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.", + "format": "date-time", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + "location": "query" + }, + "projectId": { + "type": "string", + "description": "The ID of a Maps Engine project, used to filter the response. To list all available projects with their IDs, send a Projects: list request. You can also find your project ID as the value of the DashboardPlace:cid URL parameter when signed in to mapsengine.google.com.", + "location": "query" + } + }, + "response": { + "$ref": "RastercollectionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + } + }, + "resources": { + "parents": { + "methods": { + "list": { + "id": "mapsengine.rasterCollections.parents.list", + "path": "rasterCollections/{id}/parents", + "httpMethod": "GET", + "description": "Return all parent ids of the specified raster collection.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the raster collection whose parents will be listed.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "ParentsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + } + } + }, + "rasters": { + "methods": { + "list": { + "id": "mapsengine.rasterCollections.rasters.list", + "path": "rasterCollections/{id}/rasters", + "httpMethod": "GET", + "description": "Return all rasters within a raster collection.", + "parameters": { + "bbox": { + "type": "string", + "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.", + "location": "query" + }, + "createdAfter": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.", + "format": "date-time", + "location": "query" + }, + "createdBefore": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.", + "format": "date-time", + "location": "query" + }, + "creatorEmail": { + "type": "string", + "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.", + "location": "query" + }, + "id": { + "type": "string", + "description": "The ID of the raster collection to which these rasters belong.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.", + "format": "uint32", + "location": "query" + }, + "modifiedAfter": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.", + "format": "date-time", + "location": "query" + }, + "modifiedBefore": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.", + "format": "date-time", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "RastersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + } + } + } + } + }, + "rasters": { + "methods": { + "get": { + "id": "mapsengine.rasters.get", + "path": "rasters/{id}", + "httpMethod": "GET", + "description": "Return metadata for a single raster.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the raster.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Image" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + }, + "upload": { + "id": "mapsengine.rasters.upload", + "path": "rasters/upload", + "httpMethod": "POST", + "description": "Create a skeleton raster asset for upload.", + "request": { + "$ref": "Image" + }, + "response": { + "$ref": "Image" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + } + }, + "resources": { + "files": { + "methods": { + "insert": { + "id": "mapsengine.rasters.files.insert", + "path": "rasters/{id}/files", + "httpMethod": "POST", + "description": "Upload a file to a raster asset.", + "parameters": { + "filename": { + "type": "string", + "description": "The file name of this uploaded file.", + "required": true, + "location": "query" + }, + "id": { + "type": "string", + "description": "The ID of the raster asset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id", + "filename" + ], + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "maxSize": "1GB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/mapsengine/v1/rasters/{id}/files" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/mapsengine/v1/rasters/{id}/files" + } + } + } + } + } + }, + "parents": { + "methods": { + "list": { + "id": "mapsengine.rasters.parents.list", + "path": "rasters/{id}/parents", + "httpMethod": "GET", + "description": "Return all parent ids of the specified rasters.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the rasters whose parents will be listed.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "ParentsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + } + } + } + } + }, + "tables": { + "methods": { + "create": { + "id": "mapsengine.tables.create", + "path": "tables", + "httpMethod": "POST", + "description": "Create a table asset.", + "request": { + "$ref": "Table" + }, + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "get": { + "id": "mapsengine.tables.get", + "path": "tables/{id}", + "httpMethod": "GET", + "description": "Return metadata for a particular table, including the schema.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the table.", + "required": true, + "location": "path" + }, + "version": { + "type": "string", + "enum": [ + "draft", + "published" + ], + "enumDescriptions": [ + "The draft version.", + "The published version." + ], + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + }, + "list": { + "id": "mapsengine.tables.list", + "path": "tables", + "httpMethod": "GET", + "description": "Return all tables readable by the current user.", + "parameters": { + "bbox": { + "type": "string", + "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.", + "location": "query" + }, + "createdAfter": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.", + "format": "date-time", + "location": "query" + }, + "createdBefore": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.", + "format": "date-time", + "location": "query" + }, + "creatorEmail": { + "type": "string", + "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.", + "format": "uint32", + "location": "query" + }, + "modifiedAfter": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.", + "format": "date-time", + "location": "query" + }, + "modifiedBefore": { + "type": "string", + "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.", + "format": "date-time", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + "location": "query" + }, + "projectId": { + "type": "string", + "description": "The ID of a Maps Engine project, used to filter the response. To list all available projects with their IDs, send a Projects: list request. You can also find your project ID as the value of the DashboardPlace:cid URL parameter when signed in to mapsengine.google.com.", + "location": "query" + } + }, + "response": { + "$ref": "TablesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + }, + "upload": { + "id": "mapsengine.tables.upload", + "path": "tables/upload", + "httpMethod": "POST", + "description": "Create a placeholder table asset to which table files can be uploaded.\nOnce the placeholder has been created, files are uploaded to the https://www.googleapis.com/upload/mapsengine/v1/tables/table_id/files endpoint.\nSee Table Upload in the Developer's Guide or Table.files: insert in the reference documentation for more information.", + "request": { + "$ref": "Table" + }, + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + } + }, + "resources": { + "features": { + "methods": { + "batchDelete": { + "id": "mapsengine.tables.features.batchDelete", + "path": "tables/{id}/features/batchDelete", + "httpMethod": "POST", + "description": "Delete all features matching the given IDs.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the table that contains the features to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "FeaturesBatchDeleteRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "batchInsert": { + "id": "mapsengine.tables.features.batchInsert", + "path": "tables/{id}/features/batchInsert", + "httpMethod": "POST", + "description": "Append features to an existing table.\n\nA single batchInsert request can create:\n\n- Up to 50 features.\n- A combined total of 10 000 vertices.\nFeature limits are documented in the Supported data formats and limits article of the Google Maps Engine help center. Note that free and paid accounts have different limits.\n\nFor more information about inserting features, read Creating features in the Google Maps Engine developer's guide.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the table to append the features to.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "FeaturesBatchInsertRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "batchPatch": { + "id": "mapsengine.tables.features.batchPatch", + "path": "tables/{id}/features/batchPatch", + "httpMethod": "POST", + "description": "Update the supplied features.\n\nA single batchPatch request can update:\n\n- Up to 50 features.\n- A combined total of 10 000 vertices.\nFeature limits are documented in the Supported data formats and limits article of the Google Maps Engine help center. Note that free and paid accounts have different limits.\n\nFeature updates use HTTP PATCH semantics:\n\n- A supplied value replaces an existing value (if any) in that field.\n- Omitted fields remain unchanged.\n- Complex values in geometries and properties must be replaced as atomic units. For example, providing just the coordinates of a geometry is not allowed; the complete geometry, including type, must be supplied.\n- Setting a property's value to null deletes that property.\nFor more information about updating features, read Updating features in the Google Maps Engine developer's guide.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the table containing the features to be patched.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "FeaturesBatchPatchRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "get": { + "id": "mapsengine.tables.features.get", + "path": "tables/{tableId}/features/{id}", + "httpMethod": "GET", + "description": "Return a single feature, given its ID.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the feature to get.", + "required": true, + "location": "path" + }, + "select": { + "type": "string", + "description": "A SQL-like projection clause used to specify returned properties. If this parameter is not included, all properties are returned.", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "The ID of the table.", + "required": true, + "location": "path" + }, + "version": { + "type": "string", + "description": "The table version to access. See Accessing Public Data for information.", + "enum": [ + "draft", + "published" + ], + "enumDescriptions": [ + "The draft version.", + "The published version." + ], + "location": "query" + } + }, + "parameterOrder": [ + "tableId", + "id" + ], + "response": { + "$ref": "Feature" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + }, + "list": { + "id": "mapsengine.tables.features.list", + "path": "tables/{id}/features", + "httpMethod": "GET", + "description": "Return all features readable by the current user.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the table to which these features belong.", + "required": true, + "location": "path" + }, + "include": { + "type": "string", + "description": "A comma separated list of optional data to include. Optional data available: schema.", + "location": "query" + }, + "intersects": { + "type": "string", + "description": "A geometry literal that specifies the spatial restriction of the query.", + "location": "query" + }, + "limit": { + "type": "integer", + "description": "The total number of features to return from the query, irrespective of the number of pages.", + "format": "uint32", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of items to include in the response, used for paging.", + "format": "uint32", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "An SQL-like order by clause used to sort results. If this parameter is not included, the order of features is undefined.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + "location": "query" + }, + "select": { + "type": "string", + "description": "A SQL-like projection clause used to specify returned properties. If this parameter is not included, all properties are returned.", + "location": "query" + }, + "version": { + "type": "string", + "description": "The table version to access. See Accessing Public Data for information.", + "enum": [ + "draft", + "published" + ], + "enumDescriptions": [ + "The draft version.", + "The published version." + ], + "location": "query" + }, + "where": { + "type": "string", + "description": "An SQL-like predicate used to filter results.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "FeaturesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + } + } + }, + "files": { + "methods": { + "insert": { + "id": "mapsengine.tables.files.insert", + "path": "tables/{id}/files", + "httpMethod": "POST", + "description": "Upload a file to a placeholder table asset. See Table Upload in the Developer's Guide for more information.\nSupported file types are listed in the Supported data formats and limits article of the Google Maps Engine help center.", + "parameters": { + "filename": { + "type": "string", + "description": "The file name of this uploaded file.", + "required": true, + "location": "query" + }, + "id": { + "type": "string", + "description": "The ID of the table asset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id", + "filename" + ], + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "maxSize": "1GB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/mapsengine/v1/tables/{id}/files" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/mapsengine/v1/tables/{id}/files" + } + } + } + } + } + }, + "parents": { + "methods": { + "list": { + "id": "mapsengine.tables.parents.list", + "path": "tables/{id}/parents", + "httpMethod": "GET", + "description": "Return all parent ids of the specified table.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the table whose parents will be listed.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "ParentsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + } + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/mapsengine/v1/mapsengine-gen.go b/third_party/src/code.google.com/p/google-api-go-client/mapsengine/v1/mapsengine-gen.go new file mode 100644 index 0000000000000..83b5ae71b8411 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/mapsengine/v1/mapsengine-gen.go @@ -0,0 +1,4601 @@ +// Package mapsengine provides access to the Google Maps Engine API. +// +// See https://developers.google.com/maps-engine/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/mapsengine/v1" +// ... +// mapsengineService, err := mapsengine.New(oauthHttpClient) +package mapsengine + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "mapsengine:v1" +const apiName = "mapsengine" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/mapsengine/v1/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Google Maps Engine data + MapsengineScope = "https://www.googleapis.com/auth/mapsengine" + + // View your Google Maps Engine data + MapsengineReadonlyScope = "https://www.googleapis.com/auth/mapsengine.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.Assets = NewAssetsService(s) + s.Layers = NewLayersService(s) + s.Maps = NewMapsService(s) + s.Projects = NewProjectsService(s) + s.RasterCollections = NewRasterCollectionsService(s) + s.Rasters = NewRastersService(s) + s.Tables = NewTablesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Assets *AssetsService + + Layers *LayersService + + Maps *MapsService + + Projects *ProjectsService + + RasterCollections *RasterCollectionsService + + Rasters *RastersService + + Tables *TablesService +} + +func NewAssetsService(s *Service) *AssetsService { + rs := &AssetsService{s: s} + rs.Parents = NewAssetsParentsService(s) + return rs +} + +type AssetsService struct { + s *Service + + Parents *AssetsParentsService +} + +func NewAssetsParentsService(s *Service) *AssetsParentsService { + rs := &AssetsParentsService{s: s} + return rs +} + +type AssetsParentsService struct { + s *Service +} + +func NewLayersService(s *Service) *LayersService { + rs := &LayersService{s: s} + rs.Parents = NewLayersParentsService(s) + return rs +} + +type LayersService struct { + s *Service + + Parents *LayersParentsService +} + +func NewLayersParentsService(s *Service) *LayersParentsService { + rs := &LayersParentsService{s: s} + return rs +} + +type LayersParentsService struct { + s *Service +} + +func NewMapsService(s *Service) *MapsService { + rs := &MapsService{s: s} + return rs +} + +type MapsService struct { + s *Service +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + return rs +} + +type ProjectsService struct { + s *Service +} + +func NewRasterCollectionsService(s *Service) *RasterCollectionsService { + rs := &RasterCollectionsService{s: s} + rs.Parents = NewRasterCollectionsParentsService(s) + rs.Rasters = NewRasterCollectionsRastersService(s) + return rs +} + +type RasterCollectionsService struct { + s *Service + + Parents *RasterCollectionsParentsService + + Rasters *RasterCollectionsRastersService +} + +func NewRasterCollectionsParentsService(s *Service) *RasterCollectionsParentsService { + rs := &RasterCollectionsParentsService{s: s} + return rs +} + +type RasterCollectionsParentsService struct { + s *Service +} + +func NewRasterCollectionsRastersService(s *Service) *RasterCollectionsRastersService { + rs := &RasterCollectionsRastersService{s: s} + return rs +} + +type RasterCollectionsRastersService struct { + s *Service +} + +func NewRastersService(s *Service) *RastersService { + rs := &RastersService{s: s} + rs.Files = NewRastersFilesService(s) + rs.Parents = NewRastersParentsService(s) + return rs +} + +type RastersService struct { + s *Service + + Files *RastersFilesService + + Parents *RastersParentsService +} + +func NewRastersFilesService(s *Service) *RastersFilesService { + rs := &RastersFilesService{s: s} + return rs +} + +type RastersFilesService struct { + s *Service +} + +func NewRastersParentsService(s *Service) *RastersParentsService { + rs := &RastersParentsService{s: s} + return rs +} + +type RastersParentsService struct { + s *Service +} + +func NewTablesService(s *Service) *TablesService { + rs := &TablesService{s: s} + rs.Features = NewTablesFeaturesService(s) + rs.Files = NewTablesFilesService(s) + rs.Parents = NewTablesParentsService(s) + return rs +} + +type TablesService struct { + s *Service + + Features *TablesFeaturesService + + Files *TablesFilesService + + Parents *TablesParentsService +} + +func NewTablesFeaturesService(s *Service) *TablesFeaturesService { + rs := &TablesFeaturesService{s: s} + return rs +} + +type TablesFeaturesService struct { + s *Service +} + +func NewTablesFilesService(s *Service) *TablesFilesService { + rs := &TablesFilesService{s: s} + return rs +} + +type TablesFilesService struct { + s *Service +} + +func NewTablesParentsService(s *Service) *TablesParentsService { + rs := &TablesParentsService{s: s} + return rs +} + +type TablesParentsService struct { + s *Service +} + +type AcquisitionTime struct { + // End: The end time if acquisition time is a range. The value is an RFC + // 3339 formatted date-time value (1970-01-01T00:00:00Z). + End string `json:"end,omitempty"` + + // Precision: The precision of acquisition time. Valid values include: + // 'year', 'month', 'day', 'hour', 'minute' and 'second'. + Precision string `json:"precision,omitempty"` + + // Start: The acquisition time, or start time if acquisition time is a + // range. The value is an RFC 3339 formatted date-time value + // (1970-01-01T00:00:00Z). + Start string `json:"start,omitempty"` +} + +type Border struct { + // Color: Color of the border. + Color string `json:"color,omitempty"` + + // Opacity: Opacity of the border. + Opacity float64 `json:"opacity,omitempty"` + + // Width: Width of the border, in pixels. + Width float64 `json:"width,omitempty"` +} + +type Color struct { + // Color: The CSS style color, can be in format of "red" or "#7733EE". + Color string `json:"color,omitempty"` + + // Opacity: Opacity ranges from 0 to 1, inclusive. If not provided, + // default to 1. + Opacity float64 `json:"opacity,omitempty"` +} + +type Datasource struct { + // Id: The ID of a datasource. + Id string `json:"id,omitempty"` +} + +type DisplayRule struct { + // Filters: This display rule will only be applied to features that + // match all of the filters here. If filters is empty, then the rule + // applies to all features. + Filters []*Filter `json:"filters,omitempty"` + + // LineOptions: Style applied to lines. Required for LineString + // Geometry. + LineOptions *LineStyle `json:"lineOptions,omitempty"` + + // Name: Display rule name. Name is not unique and cannot be used for + // identification purpose. + Name string `json:"name,omitempty"` + + // PointOptions: Style applied to points. Required for Point Geometry. + PointOptions *PointStyle `json:"pointOptions,omitempty"` + + // PolygonOptions: Style applied to polygons. Required for Polygon + // Geometry. + PolygonOptions *PolygonStyle `json:"polygonOptions,omitempty"` + + // ZoomLevels: The zoom levels that this display rule apply. + ZoomLevels *ZoomLevels `json:"zoomLevels,omitempty"` +} + +type Feature struct { + // Geometry: The geometry member of this Feature. + Geometry *GeoJsonGeometry `json:"geometry,omitempty"` + + // Properties: Key/value pairs of this Feature. + Properties *GeoJsonProperties `json:"properties,omitempty"` + + // Type: Identifies this object as a feature. + Type string `json:"type,omitempty"` +} + +type FeatureInfo struct { + // Content: HTML template of the info window. If not provided, a default + // template with all attributes will be generated. + Content string `json:"content,omitempty"` +} + +type FeaturesBatchDeleteRequest struct { + Gx_ids []string `json:"gx_ids,omitempty"` + + PrimaryKeys []string `json:"primaryKeys,omitempty"` +} + +type FeaturesBatchInsertRequest struct { + Features []*Feature `json:"features,omitempty"` +} + +type FeaturesBatchPatchRequest struct { + Features []*Feature `json:"features,omitempty"` +} + +type FeaturesListResponse struct { + // AllowedQueriesPerSecond: An indicator of the maximum rate at which + // queries may be made, if all queries were as expensive as this query. + AllowedQueriesPerSecond float64 `json:"allowedQueriesPerSecond,omitempty"` + + // Features: Resources returned. + Features []*Feature `json:"features,omitempty"` + + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Schema: The feature schema. + Schema *Schema `json:"schema,omitempty"` + + Type string `json:"type,omitempty"` +} + +type File struct { + // Filename: The name of the file. + Filename string `json:"filename,omitempty"` + + // Size: The size of the file in bytes. + Size int64 `json:"size,omitempty,string"` + + // UploadStatus: The upload status of the file. + UploadStatus string `json:"uploadStatus,omitempty"` +} + +type Filter struct { + // Column: The column name to filter on. + Column string `json:"column,omitempty"` + + // Operator: Operation used to evaluate the filter. + Operator string `json:"operator,omitempty"` + + // Value: Value to be evaluated against attribute. + Value interface{} `json:"value,omitempty"` +} + +type GeoJsonGeometry struct { +} + +type GeoJsonGeometryCollection struct { + // Geometries: The geometry objects that are contained within this + // geometry collection. + Geometries []*GeoJsonGeometry `json:"geometries,omitempty"` + + // Type: Identifies this object as a geometry collection. + Type string `json:"type,omitempty"` +} + +type GeoJsonLineString struct { + // Coordinates: The coordinates of this line string as an array of two + // or more positions. + Coordinates [][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a line string. + Type string `json:"type,omitempty"` +} + +type GeoJsonMultiLineString struct { + // Coordinates: The coordinates of this multi-line string as an array of + // line string coordinate arrays. + Coordinates [][][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a multi-line string. + Type string `json:"type,omitempty"` +} + +type GeoJsonMultiPoint struct { + // Coordinates: The coordinates of this multi-point as an array of + // positions. + Coordinates [][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a multi-point. + Type string `json:"type,omitempty"` +} + +type GeoJsonMultiPolygon struct { + // Coordinates: The coordinates of this multi-polygon as an array of + // polygon coordinate arrays. + Coordinates [][][][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a multi-polygon. + Type string `json:"type,omitempty"` +} + +type GeoJsonPoint struct { + // Coordinates: The coordinates of this point as a position in + // [longitude, latitude] or [longitude, latitude, altitude] form. + Coordinates []float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a point. + Type string `json:"type,omitempty"` +} + +type GeoJsonPolygon struct { + // Coordinates: The coordinates of this polygon as an array of linear + // ring coordinate arrays. A linear ring is a closed line string with 4 + // or more positions. The first and last positions are equivalent. For + // polygons with multiple rings, the first must be the exterior ring and + // any others must be interior rings or holes. + Coordinates [][][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a polygon. + Type string `json:"type,omitempty"` +} + +type GeoJsonProperties struct { +} + +type IconStyle struct { + // Id: Custom icon id. + Id string `json:"id,omitempty"` + + // Name: Stock icon name. To use a stock icon, prefix it with 'gx_'. See + // Stock icon names for valid icon names. For example, to specify + // small_red, set name to 'gx_small_red'. + Name string `json:"name,omitempty"` +} + +type Image struct { + // AcquisitionTime: The acquisition time of this Raster. + AcquisitionTime *AcquisitionTime `json:"acquisitionTime,omitempty"` + + // Attribution: The name of the attribution to be used for this Raster. + Attribution string `json:"attribution,omitempty"` + + // Bbox: An array of four numbers (west, south, east, north) which + // define the rectangular bounding box which contains all of the data in + // this Raster. The numbers represent latitudes and longitudes in + // decimal degrees. + Bbox []float64 `json:"bbox,omitempty"` + + // CreationTime: The creation time of this raster. The value is an RFC + // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). + CreationTime string `json:"creationTime,omitempty"` + + // Description: The description of this Raster, supplied by the author. + Description string `json:"description,omitempty"` + + // DraftAccessList: The Map Editors access list to share this Raster + // with. + DraftAccessList string `json:"draftAccessList,omitempty"` + + // Files: The files associated with this Raster. + Files []*File `json:"files,omitempty"` + + // Id: A globally unique ID, used to refer to this Raster. + Id string `json:"id,omitempty"` + + // LastModifiedTime: The last modified time of this raster. The value is + // an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). + LastModifiedTime string `json:"lastModifiedTime,omitempty"` + + // MaskType: The mask processing type of this Raster. Valid values + // include "autoMask", "alphaChannelMask", "noMask", "imageMask". + MaskType string `json:"maskType,omitempty"` + + // Name: The name of this Raster, supplied by the author. + Name string `json:"name,omitempty"` + + // ProcessingStatus: The processing status of this Raster. The raster + // processing status values can be: + // + // 'notReady': The raster is not ready + // to be processed - some files have not been uploaded. + // 'ready': The + // raster is queued for processing. + // 'processing': The raster is + // currently processing. + // 'complete': Processing has completed + // successfully. + // 'failed': Processing failed to complete. + ProcessingStatus string `json:"processingStatus,omitempty"` + + // ProjectId: The ID of the project that this Raster is in. + ProjectId string `json:"projectId,omitempty"` + + // RasterType: The type of this Raster. Always "image" today. + RasterType string `json:"rasterType,omitempty"` + + // Tags: Tags of this Raster. + Tags []string `json:"tags,omitempty"` +} + +type LabelStyle struct { + // Color: Color of the text. If not provided, default to black. + Color string `json:"color,omitempty"` + + // Column: The column value of the feature to be displayed. + Column string `json:"column,omitempty"` + + // FontStyle: Font style of the label, defaults to 'normal'. + FontStyle string `json:"fontStyle,omitempty"` + + // FontWeight: Font weight of the label, defaults to 'normal'. + FontWeight string `json:"fontWeight,omitempty"` + + // Opacity: Opacity of the text. + Opacity float64 `json:"opacity,omitempty"` + + // Outline: Outline color of the text. + Outline *Color `json:"outline,omitempty"` + + // Size: Font size of the label, in pixels. 8 <= size <= 15. If not + // provided, a default size will be provided. + Size float64 `json:"size,omitempty"` +} + +type Layer struct { + // Bbox: An array of four numbers (west, south, east, north) which + // define the rectangular bounding box which contains all of the data in + // this Layer. The numbers represent latitudes and longitudes in decimal + // degrees. + Bbox []float64 `json:"bbox,omitempty"` + + // CreationTime: The creation time of this layer. The value is an RFC + // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). + CreationTime string `json:"creationTime,omitempty"` + + // DatasourceType: The type of the datasources used to build this Layer. + // One of either "table" or "image". + DatasourceType string `json:"datasourceType,omitempty"` + + // Datasources: An array of datasources used to build this Layer. If + // datasourceType is "image", then each element in this array is a + // reference to an Image or RasterCollection. If datasourceType is + // "table" then each element in this array is a reference to a Vector + // Table. + Datasources []*Datasource `json:"datasources,omitempty"` + + // Description: The description of this Layer, supplied by the author. + Description string `json:"description,omitempty"` + + // DraftAccessList: The name of an access list of the Map Editor type. + // The user on whose behalf the request is being sent must be an editor + // on that access list. Read About access lists in the Google Maps + // Engine help center for more information. + DraftAccessList string `json:"draftAccessList,omitempty"` + + // Id: A globally unique ID, used to refer to this Layer. + Id string `json:"id,omitempty"` + + // LastModifiedTime: The last modified time of this layer. The value is + // an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). + LastModifiedTime string `json:"lastModifiedTime,omitempty"` + + // Name: The name of this Layer, supplied by the author. + Name string `json:"name,omitempty"` + + // ProcessingStatus: The processing status of this layer. + ProcessingStatus string `json:"processingStatus,omitempty"` + + // ProjectId: The ID of the project that this Layer is in. + ProjectId string `json:"projectId,omitempty"` + + // PublishedAccessList: The access list to whom view permissions are + // granted. The value must be the name of a Maps Engine access list of + // the Map Viewer type, and the user must be a viewer on that list. Read + // About access lists in the Google Maps Engine help center for more + // information. + PublishedAccessList string `json:"publishedAccessList,omitempty"` + + // Style: The Styling information for a vector layer. + Style *VectorStyle `json:"style,omitempty"` + + // Tags: Tags of this Layer. + Tags []string `json:"tags,omitempty"` +} + +type LayersListResponse struct { + // Layers: Resources returned. + Layers []*Layer `json:"layers,omitempty"` + + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type LineStyle struct { + // Border: Border of the line. 0 < border.width <= 5. + Border *Border `json:"border,omitempty"` + + // Dash: Dash defines the pattern of the line, the values are pixel + // lengths of alternating dash and gap. If dash is not provided, then it + // means a solid line. Dash can contain up to 10 values and must contain + // even number of values. + Dash []float64 `json:"dash,omitempty"` + + // Label: Label style for the line. + Label *LabelStyle `json:"label,omitempty"` + + // Stroke: Stroke of the line. + Stroke *LineStyleStroke `json:"stroke,omitempty"` +} + +type LineStyleStroke struct { + // Color: Color of the line. + Color string `json:"color,omitempty"` + + // Opacity: Opacity of the line. + Opacity float64 `json:"opacity,omitempty"` + + // Width: Width of the line, in pixels. 0 <= width <= 10. If width is + // set to 0, the line will be invisible. + Width float64 `json:"width,omitempty"` +} + +type Map struct { + // Bbox: An array of four numbers (west, south, east, north) which + // define the rectangular bounding box which contains all of the data in + // this Map. The numbers represent latitude and longitude in decimal + // degrees. + Bbox []float64 `json:"bbox,omitempty"` + + // Contents: The contents of this Map. + Contents []*MapItem `json:"contents,omitempty"` + + // CreationTime: The creation time of this map. The value is an RFC 3339 + // formatted date-time value (e.g. 1970-01-01T00:00:00Z). + CreationTime string `json:"creationTime,omitempty"` + + // DefaultViewport: An array of four numbers (west, south, east, north) + // which defines the rectangular bounding box of the default viewport. + // The numbers represent latitude and longitude in decimal degrees. + DefaultViewport []float64 `json:"defaultViewport,omitempty"` + + // Description: The description of this Map, supplied by the author. + Description string `json:"description,omitempty"` + + // Id: A globally unique ID, used to refer to this Map. + Id string `json:"id,omitempty"` + + // LastModifiedTime: The last modified time of this map. The value is an + // RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). + LastModifiedTime string `json:"lastModifiedTime,omitempty"` + + // Name: The name of this Map, supplied by the author. + Name string `json:"name,omitempty"` + + // ProjectId: The ID of the project that this Map is in. + ProjectId string `json:"projectId,omitempty"` + + // Tags: Tags of this Map. + Tags []string `json:"tags,omitempty"` + + // Versions: An array containing the available versions of this Map. + // Currently may only contain "published". + Versions []string `json:"versions,omitempty"` +} + +type MapFolder struct { + // Contents: The contents of this Folder. + Contents []*MapItem `json:"contents,omitempty"` + + // DefaultViewport: An array of four numbers (west, south, east, north) + // which defines the rectangular bounding box of the default viewport. + // The numbers represent latitude and longitude in decimal degrees. + DefaultViewport []float64 `json:"defaultViewport,omitempty"` + + // Key: A user defined alias for this Folder, specific to this Map. + Key string `json:"key,omitempty"` + + // Name: The name of this Folder. + Name string `json:"name,omitempty"` + + // Type: Identifies this object as a Folder. (( constant "folder" )) + Type string `json:"type,omitempty"` + + // Visibility: The visibility setting of this Folder. One of "defaultOn" + // or "defaultOff". + Visibility string `json:"visibility,omitempty"` +} + +type MapItem struct { +} + +type MapKmlLink struct { + // DefaultViewport: An array of four numbers (west, south, east, north) + // which defines the rectangular bounding box of the default viewport. + // The numbers represent latitude and longitude in decimal degrees. + DefaultViewport []float64 `json:"defaultViewport,omitempty"` + + // KmlUrl: The URL to the KML file represented by this KmlLink. + KmlUrl string `json:"kmlUrl,omitempty"` + + // Name: The name of this KmlLink. + Name string `json:"name,omitempty"` + + // Type: Identifies this object as a KmlLink. (( constant "kmlLink" )) + Type string `json:"type,omitempty"` + + // Visibility: The visibility setting of this KmlLink. One of + // "defaultOn" or "defaultOff". + Visibility string `json:"visibility,omitempty"` +} + +type MapLayer struct { + // DefaultViewport: An array of four numbers (west, south, east, north) + // which defines the rectangular bounding box of the default viewport. + // The numbers represent latitude and longitude in decimal degrees. + DefaultViewport []float64 `json:"defaultViewport,omitempty"` + + // Id: The ID of this Layer. This ID can be used to request more details + // about this Layer. + Id string `json:"id,omitempty"` + + // Key: A user defined alias for this Layer, specific to this Map. + Key string `json:"key,omitempty"` + + // Name: The name of this Layer. + Name string `json:"name,omitempty"` + + // Type: Identifies this object as a Layer. (( constant "layer" )) + Type string `json:"type,omitempty"` + + // Visibility: The visibility setting of this Layer. One of "defaultOn" + // or "defaultOff". + Visibility string `json:"visibility,omitempty"` +} + +type MapsListResponse struct { + // Maps: Resources returned. + Maps []*Map `json:"maps,omitempty"` + + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Parent struct { + // Id: The ID of this parent. + Id string `json:"id,omitempty"` +} + +type ParentsListResponse struct { + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Parents: Resources returned. + Parents []*Parent `json:"parents,omitempty"` +} + +type PointStyle struct { + // Icon: Icon for the point; exactly one field in 'icon' must be set. + Icon *IconStyle `json:"icon,omitempty"` + + // Label: Label style for the point. + Label *LabelStyle `json:"label,omitempty"` +} + +type PolygonStyle struct { + // Fill: Fill color of the polygon. If not provided, the polygon will be + // transparent and not visible if there is no border. + Fill *Color `json:"fill,omitempty"` + + // Stroke: Border of the polygon. 0 < border.width <= 10. + Stroke *Border `json:"stroke,omitempty"` +} + +type ProcessResponse struct { +} + +type Project struct { + // Id: An ID used to refer to this project. + Id string `json:"id,omitempty"` + + // Name: A user provided name for this project. + Name string `json:"name,omitempty"` +} + +type ProjectsListResponse struct { + // Projects: Projects returned. + Projects []*Project `json:"projects,omitempty"` +} + +type PublishResponse struct { +} + +type Raster struct { + // Bbox: An array of four numbers (west, south, east, north) which + // define the rectangular bounding box which contains all of the data in + // this Raster. The numbers represent latitudes and longitudes in + // decimal degrees. + Bbox []float64 `json:"bbox,omitempty"` + + // CreationTime: The creation time of this raster. The value is an RFC + // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). + CreationTime string `json:"creationTime,omitempty"` + + // Description: The description of this Raster, supplied by the author. + Description string `json:"description,omitempty"` + + // Id: A globally unique ID, used to refer to this Raster. + Id string `json:"id,omitempty"` + + // LastModifiedTime: The last modified time of this raster. The value is + // an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). + LastModifiedTime string `json:"lastModifiedTime,omitempty"` + + // Name: The name of this Raster, supplied by the author. + Name string `json:"name,omitempty"` + + // ProjectId: The ID of the project that this Raster is in. + ProjectId string `json:"projectId,omitempty"` + + // RasterType: The type of this Raster. Always "image" today. + RasterType string `json:"rasterType,omitempty"` + + // Tags: Tags of this Raster. + Tags []string `json:"tags,omitempty"` +} + +type RasterCollection struct { + // Attribution: The name of the attribution to be used for this + // RasterCollection. + Attribution string `json:"attribution,omitempty"` + + // Bbox: An array of four numbers (west, south, east, north) which + // define the rectangular bounding box which contains all of the data in + // this RasterCollection. The numbers represent latitudes and longitudes + // in decimal degrees. + Bbox []float64 `json:"bbox,omitempty"` + + // CreationTime: The creation time of this rasterCollection. The value + // is an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). + CreationTime string `json:"creationTime,omitempty"` + + // Description: The description of this RasterCollection, supplied by + // the author. + Description string `json:"description,omitempty"` + + // DraftAccessList: The name of an access list of the Map Editor type. + // The user on whose behalf the request is being sent must be an editor + // on that access list. Read About access lists in the Google Maps + // Engine help center for more information. + DraftAccessList string `json:"draftAccessList,omitempty"` + + // Id: A globally unique ID, used to refer to this RasterCollection. + Id string `json:"id,omitempty"` + + // LastModifiedTime: The last modified time of this rasterCollection. + // The value is an RFC 3339 formatted date-time value (e.g. + // 1970-01-01T00:00:00Z). + LastModifiedTime string `json:"lastModifiedTime,omitempty"` + + // Mosaic: True if this RasterCollection is a mosaic. + Mosaic bool `json:"mosaic,omitempty"` + + // Name: The name of this RasterCollection, supplied by the author. + Name string `json:"name,omitempty"` + + // ProjectId: The ID of the project that this RasterCollection is in. + ProjectId string `json:"projectId,omitempty"` + + // RasterType: The type of rasters contained within this + // RasterCollection. + RasterType string `json:"rasterType,omitempty"` + + // Tags: Tags of this RasterCollection. + Tags []string `json:"tags,omitempty"` +} + +type RastercollectionsListResponse struct { + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // RasterCollections: Resources returned. + RasterCollections []*RasterCollection `json:"rasterCollections,omitempty"` +} + +type RastersListResponse struct { + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Rasters: Resources returned. + Rasters []*Raster `json:"rasters,omitempty"` +} + +type Resource struct { + // Bbox: An array of four numbers (west, south, east, north) which + // define the rectangular bounding box which contains all of the data in + // this asset. The numbers represent latitude and longitude in decimal + // degrees. + Bbox []float64 `json:"bbox,omitempty"` + + // CreationTime: The creation time of this asset. The value is an RFC + // 3339-formatted date-time value (for example, 1970-01-01T00:00:00Z). + CreationTime string `json:"creationTime,omitempty"` + + // Description: The asset's description. + Description string `json:"description,omitempty"` + + // Id: The asset's globally unique ID. + Id string `json:"id,omitempty"` + + // LastModifiedTime: The last modified time of this asset. The value is + // an RFC 3339-formatted date-time value (for example, + // 1970-01-01T00:00:00Z). + LastModifiedTime string `json:"lastModifiedTime,omitempty"` + + // Name: The asset's name. + Name string `json:"name,omitempty"` + + // ProjectId: The ID of the project to which the asset belongs. + ProjectId string `json:"projectId,omitempty"` + + // Resource: The URL to query to retrieve the asset's complete object. + // The assets endpoint only returns high-level information about a + // resource. + Resource string `json:"resource,omitempty"` + + // Tags: An array of text strings, with each string representing a tag. + // More information about tags can be found in the Tagging data article + // of the Maps Engine help center. + Tags []string `json:"tags,omitempty"` + + // Type: The type of asset. One of raster, rasterCollection, table, map, + // or layer. + Type string `json:"type,omitempty"` +} + +type ResourcesListResponse struct { + // Assets: Assets returned. + Assets []*Resource `json:"assets,omitempty"` + + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Schema struct { + // Columns: An array of column objects. The first object in the array + // must be named geometry and be of type points, lineStrings, polygons, + // or mixedGeometry. + Columns []*SchemaColumns `json:"columns,omitempty"` + + // PrimaryGeometry: The name of the column that contains a feature's + // geometry. This field can be omitted during table create; Google Maps + // Engine supports only a single geometry column, which must be named + // geometry and be the first object in the columns array. + PrimaryGeometry string `json:"primaryGeometry,omitempty"` + + // PrimaryKey: The name of the column that contains the unique + // identifier of a Feature. + PrimaryKey string `json:"primaryKey,omitempty"` +} + +type SchemaColumns struct { + // Name: The column name. + Name string `json:"name,omitempty"` + + // Type: The type of data stored in this column. Accepted values are: + // + // + // - integer + // - double + // - boolean + // - string + // - mixedGeometry + // - points + // + // - lineStrings + // - polygons + Type string `json:"type,omitempty"` +} + +type Table struct { + // Bbox: An array of four numbers (west, south, east, north) which + // define the rectangular bounding box which contains all of the data in + // this table. + Bbox []float64 `json:"bbox,omitempty"` + + // CreationTime: The creation time of this table. The value is an RFC + // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). + CreationTime string `json:"creationTime,omitempty"` + + // Description: The description of this table, supplied by the author. + Description string `json:"description,omitempty"` + + // DraftAccessList: The name of an access list of the Map Editor type. + // The user on whose behalf the request is being sent must be an editor + // on that access list. Read About access lists in the Google Maps + // Engine help center for more information. + DraftAccessList string `json:"draftAccessList,omitempty"` + + // Files: The files associated with this table. + Files []*File `json:"files,omitempty"` + + // Id: A globally unique ID, used to refer to this table. + Id string `json:"id,omitempty"` + + // LastModifiedTime: The last modified time of this table. The value is + // an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). + LastModifiedTime string `json:"lastModifiedTime,omitempty"` + + // Name: The name of this table, supplied by the author. + Name string `json:"name,omitempty"` + + // ProcessingStatus: The processing status of this table. The supported + // processing status values are: + // + // - notReady: The table is not ready to + // be processed - some files have not been uploaded. + // - ready: The table + // is queued for processing. + // - processing: The table is currently + // processing. + // - complete: Processing has completed successfully. + // - + // failed: Processing failed to complete. + ProcessingStatus string `json:"processingStatus,omitempty"` + + // ProjectId: The ID of the project to which the table belongs. + ProjectId string `json:"projectId,omitempty"` + + // PublishedAccessList: The access list to whom view permissions are + // granted. The value must be the name of a Maps Engine access list of + // the Map Viewer type, and the user must be a viewer on that list. Read + // About access lists in the Google Maps Engine help center for more + // information. + PublishedAccessList string `json:"publishedAccessList,omitempty"` + + // Schema: The schema for this table. + Schema *Schema `json:"schema,omitempty"` + + // SourceEncoding: Encoding of the uploaded files. Valid values include + // UTF-8, CP1251, ISO 8859-1, and Shift_JIS. + SourceEncoding string `json:"sourceEncoding,omitempty"` + + // Tags: An array of text strings, with each string representing a tag. + // More information about tags can be found in the Tagging data article + // of the Maps Engine help center. + Tags []string `json:"tags,omitempty"` +} + +type TablesListResponse struct { + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Tables: Resources returned. + Tables []*Table `json:"tables,omitempty"` +} + +type VectorStyle struct { + // DisplayRules: Display rules of the vector style. The first matched + // rule will apply to the features. If no display rule is provided, a + // default display rule will be generated according to Geometry type. + DisplayRules []*DisplayRule `json:"displayRules,omitempty"` + + // FeatureInfo: Individual feature info, this is called Info Window in + // Maps Engine UI. If not provided, a default template with all + // attributes will be generated. + FeatureInfo *FeatureInfo `json:"featureInfo,omitempty"` + + // Type: The type of the vector style. Currently, only displayRule is + // supported. + Type string `json:"type,omitempty"` +} + +type ZoomLevels struct { + // Max: Maximum zoom level. + Max int64 `json:"max,omitempty"` + + // Min: Minimum zoom level. + Min int64 `json:"min,omitempty"` +} + +// method id "mapsengine.assets.get": + +type AssetsGetCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Get: Return metadata for a particular asset. +func (r *AssetsService) Get(id string) *AssetsGetCall { + c := &AssetsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *AssetsGetCall) Do() (*Resource, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "assets/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Resource) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return metadata for a particular asset.", + // "httpMethod": "GET", + // "id": "mapsengine.assets.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "assets/{id}", + // "response": { + // "$ref": "Resource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.assets.list": + +type AssetsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Return all assets readable by the current user. +func (r *AssetsService) List() *AssetsListCall { + c := &AssetsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Bbox sets the optional parameter "bbox": A bounding box, expressed as +// "west,south,east,north". If set, only assets which intersect this +// bounding box will be returned. +func (c *AssetsListCall) Bbox(bbox string) *AssetsListCall { + c.opt_["bbox"] = bbox + return c +} + +// CreatedAfter sets the optional parameter "createdAfter": An RFC 3339 +// formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been created at or after this time. +func (c *AssetsListCall) CreatedAfter(createdAfter string) *AssetsListCall { + c.opt_["createdAfter"] = createdAfter + return c +} + +// CreatedBefore sets the optional parameter "createdBefore": An RFC +// 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been created at or before this time. +func (c *AssetsListCall) CreatedBefore(createdBefore string) *AssetsListCall { + c.opt_["createdBefore"] = createdBefore + return c +} + +// CreatorEmail sets the optional parameter "creatorEmail": An email +// address representing a user. Returned assets that have been created +// by the user associated with the provided email address. +func (c *AssetsListCall) CreatorEmail(creatorEmail string) *AssetsListCall { + c.opt_["creatorEmail"] = creatorEmail + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of items to include in a single response page. The maximum +// supported value is 100. +func (c *AssetsListCall) MaxResults(maxResults int64) *AssetsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// ModifiedAfter sets the optional parameter "modifiedAfter": An RFC +// 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been modified at or after this time. +func (c *AssetsListCall) ModifiedAfter(modifiedAfter string) *AssetsListCall { + c.opt_["modifiedAfter"] = modifiedAfter + return c +} + +// ModifiedBefore sets the optional parameter "modifiedBefore": An RFC +// 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been modified at or before this time. +func (c *AssetsListCall) ModifiedBefore(modifiedBefore string) *AssetsListCall { + c.opt_["modifiedBefore"] = modifiedBefore + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, used to page through large result sets. To get the next page +// of results, set this parameter to the value of nextPageToken from the +// previous response. +func (c *AssetsListCall) PageToken(pageToken string) *AssetsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ProjectId sets the optional parameter "projectId": The ID of a Maps +// Engine project, used to filter the response. To list all available +// projects with their IDs, send a Projects: list request. You can also +// find your project ID as the value of the DashboardPlace:cid URL +// parameter when signed in to mapsengine.google.com. +func (c *AssetsListCall) ProjectId(projectId string) *AssetsListCall { + c.opt_["projectId"] = projectId + return c +} + +// Type sets the optional parameter "type": An asset type restriction. +// If set, only resources of this type will be returned. +func (c *AssetsListCall) Type(type_ string) *AssetsListCall { + c.opt_["type"] = type_ + return c +} + +func (c *AssetsListCall) Do() (*ResourcesListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["bbox"]; ok { + params.Set("bbox", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["createdAfter"]; ok { + params.Set("createdAfter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["createdBefore"]; ok { + params.Set("createdBefore", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["creatorEmail"]; ok { + params.Set("creatorEmail", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["modifiedAfter"]; ok { + params.Set("modifiedAfter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["modifiedBefore"]; ok { + params.Set("modifiedBefore", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["type"]; ok { + params.Set("type", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "assets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ResourcesListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all assets readable by the current user.", + // "httpMethod": "GET", + // "id": "mapsengine.assets.list", + // "parameters": { + // "bbox": { + // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.", + // "location": "query", + // "type": "string" + // }, + // "createdAfter": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "createdBefore": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "creatorEmail": { + // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "modifiedAfter": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "modifiedBefore": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "projectId": { + // "description": "The ID of a Maps Engine project, used to filter the response. To list all available projects with their IDs, send a Projects: list request. You can also find your project ID as the value of the DashboardPlace:cid URL parameter when signed in to mapsengine.google.com.", + // "location": "query", + // "type": "string" + // }, + // "type": { + // "description": "An asset type restriction. If set, only resources of this type will be returned.", + // "enum": [ + // "layer", + // "map", + // "rasterCollection", + // "table" + // ], + // "enumDescriptions": [ + // "Return layers.", + // "Return maps.", + // "Return raster collections.", + // "Return tables." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "assets", + // "response": { + // "$ref": "ResourcesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.assets.parents.list": + +type AssetsParentsListCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// List: Return all parent ids of the specified asset. +func (r *AssetsParentsService) List(id string) *AssetsParentsListCall { + c := &AssetsParentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of items to include in a single response page. The maximum +// supported value is 50. +func (c *AssetsParentsListCall) MaxResults(maxResults int64) *AssetsParentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, used to page through large result sets. To get the next page +// of results, set this parameter to the value of nextPageToken from the +// previous response. +func (c *AssetsParentsListCall) PageToken(pageToken string) *AssetsParentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AssetsParentsListCall) Do() (*ParentsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "assets/{id}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ParentsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all parent ids of the specified asset.", + // "httpMethod": "GET", + // "id": "mapsengine.assets.parents.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset whose parents will be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "assets/{id}/parents", + // "response": { + // "$ref": "ParentsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.layers.create": + +type LayersCreateCall struct { + s *Service + layer *Layer + opt_ map[string]interface{} +} + +// Create: Create a layer asset. +func (r *LayersService) Create(layer *Layer) *LayersCreateCall { + c := &LayersCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.layer = layer + return c +} + +// Process sets the optional parameter "process": Whether to queue the +// created layer for processing. +func (c *LayersCreateCall) Process(process bool) *LayersCreateCall { + c.opt_["process"] = process + return c +} + +func (c *LayersCreateCall) Do() (*Layer, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.layer) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["process"]; ok { + params.Set("process", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Layer) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a layer asset.", + // "httpMethod": "POST", + // "id": "mapsengine.layers.create", + // "parameters": { + // "process": { + // "description": "Whether to queue the created layer for processing.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "layers", + // "request": { + // "$ref": "Layer" + // }, + // "response": { + // "$ref": "Layer" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.layers.get": + +type LayersGetCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Get: Return metadata for a particular layer. +func (r *LayersService) Get(id string) *LayersGetCall { + c := &LayersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Version sets the optional parameter "version": +func (c *LayersGetCall) Version(version string) *LayersGetCall { + c.opt_["version"] = version + return c +} + +func (c *LayersGetCall) Do() (*Layer, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["version"]; ok { + params.Set("version", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Layer) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return metadata for a particular layer.", + // "httpMethod": "GET", + // "id": "mapsengine.layers.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the layer.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "version": { + // "enum": [ + // "draft", + // "published" + // ], + // "enumDescriptions": [ + // "The draft version.", + // "The published version." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "layers/{id}", + // "response": { + // "$ref": "Layer" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.layers.list": + +type LayersListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Return all layers readable by the current user. +func (r *LayersService) List() *LayersListCall { + c := &LayersListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Bbox sets the optional parameter "bbox": A bounding box, expressed as +// "west,south,east,north". If set, only assets which intersect this +// bounding box will be returned. +func (c *LayersListCall) Bbox(bbox string) *LayersListCall { + c.opt_["bbox"] = bbox + return c +} + +// CreatedAfter sets the optional parameter "createdAfter": An RFC 3339 +// formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been created at or after this time. +func (c *LayersListCall) CreatedAfter(createdAfter string) *LayersListCall { + c.opt_["createdAfter"] = createdAfter + return c +} + +// CreatedBefore sets the optional parameter "createdBefore": An RFC +// 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been created at or before this time. +func (c *LayersListCall) CreatedBefore(createdBefore string) *LayersListCall { + c.opt_["createdBefore"] = createdBefore + return c +} + +// CreatorEmail sets the optional parameter "creatorEmail": An email +// address representing a user. Returned assets that have been created +// by the user associated with the provided email address. +func (c *LayersListCall) CreatorEmail(creatorEmail string) *LayersListCall { + c.opt_["creatorEmail"] = creatorEmail + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of items to include in a single response page. The maximum +// supported value is 100. +func (c *LayersListCall) MaxResults(maxResults int64) *LayersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// ModifiedAfter sets the optional parameter "modifiedAfter": An RFC +// 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been modified at or after this time. +func (c *LayersListCall) ModifiedAfter(modifiedAfter string) *LayersListCall { + c.opt_["modifiedAfter"] = modifiedAfter + return c +} + +// ModifiedBefore sets the optional parameter "modifiedBefore": An RFC +// 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been modified at or before this time. +func (c *LayersListCall) ModifiedBefore(modifiedBefore string) *LayersListCall { + c.opt_["modifiedBefore"] = modifiedBefore + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, used to page through large result sets. To get the next page +// of results, set this parameter to the value of nextPageToken from the +// previous response. +func (c *LayersListCall) PageToken(pageToken string) *LayersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ProjectId sets the optional parameter "projectId": The ID of a Maps +// Engine project, used to filter the response. To list all available +// projects with their IDs, send a Projects: list request. You can also +// find your project ID as the value of the DashboardPlace:cid URL +// parameter when signed in to mapsengine.google.com. +func (c *LayersListCall) ProjectId(projectId string) *LayersListCall { + c.opt_["projectId"] = projectId + return c +} + +func (c *LayersListCall) Do() (*LayersListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["bbox"]; ok { + params.Set("bbox", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["createdAfter"]; ok { + params.Set("createdAfter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["createdBefore"]; ok { + params.Set("createdBefore", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["creatorEmail"]; ok { + params.Set("creatorEmail", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["modifiedAfter"]; ok { + params.Set("modifiedAfter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["modifiedBefore"]; ok { + params.Set("modifiedBefore", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(LayersListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all layers readable by the current user.", + // "httpMethod": "GET", + // "id": "mapsengine.layers.list", + // "parameters": { + // "bbox": { + // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.", + // "location": "query", + // "type": "string" + // }, + // "createdAfter": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "createdBefore": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "creatorEmail": { + // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "modifiedAfter": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "modifiedBefore": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "projectId": { + // "description": "The ID of a Maps Engine project, used to filter the response. To list all available projects with their IDs, send a Projects: list request. You can also find your project ID as the value of the DashboardPlace:cid URL parameter when signed in to mapsengine.google.com.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "layers", + // "response": { + // "$ref": "LayersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.layers.process": + +type LayersProcessCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Process: Process a layer asset. +func (r *LayersService) Process(id string) *LayersProcessCall { + c := &LayersProcessCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *LayersProcessCall) Do() (*ProcessResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/process") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ProcessResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Process a layer asset.", + // "httpMethod": "POST", + // "id": "mapsengine.layers.process", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the layer.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "layers/{id}/process", + // "response": { + // "$ref": "ProcessResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.layers.publish": + +type LayersPublishCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Publish: Publish a layer asset. +func (r *LayersService) Publish(id string) *LayersPublishCall { + c := &LayersPublishCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *LayersPublishCall) Do() (*PublishResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/publish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PublishResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Publish a layer asset.", + // "httpMethod": "POST", + // "id": "mapsengine.layers.publish", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the layer.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "layers/{id}/publish", + // "response": { + // "$ref": "PublishResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.layers.parents.list": + +type LayersParentsListCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// List: Return all parent ids of the specified layer. +func (r *LayersParentsService) List(id string) *LayersParentsListCall { + c := &LayersParentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of items to include in a single response page. The maximum +// supported value is 50. +func (c *LayersParentsListCall) MaxResults(maxResults int64) *LayersParentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, used to page through large result sets. To get the next page +// of results, set this parameter to the value of nextPageToken from the +// previous response. +func (c *LayersParentsListCall) PageToken(pageToken string) *LayersParentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *LayersParentsListCall) Do() (*ParentsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ParentsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all parent ids of the specified layer.", + // "httpMethod": "GET", + // "id": "mapsengine.layers.parents.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the layer whose parents will be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "layers/{id}/parents", + // "response": { + // "$ref": "ParentsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.maps.get": + +type MapsGetCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Get: Return metadata for a particular map. +func (r *MapsService) Get(id string) *MapsGetCall { + c := &MapsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Version sets the optional parameter "version": +func (c *MapsGetCall) Version(version string) *MapsGetCall { + c.opt_["version"] = version + return c +} + +func (c *MapsGetCall) Do() (*Map, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["version"]; ok { + params.Set("version", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Map) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return metadata for a particular map.", + // "httpMethod": "GET", + // "id": "mapsengine.maps.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the map.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "version": { + // "enum": [ + // "draft", + // "published" + // ], + // "enumDescriptions": [ + // "The draft version.", + // "The published version." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "maps/{id}", + // "response": { + // "$ref": "Map" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.maps.list": + +type MapsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Return all maps readable by the current user. +func (r *MapsService) List() *MapsListCall { + c := &MapsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Bbox sets the optional parameter "bbox": A bounding box, expressed as +// "west,south,east,north". If set, only assets which intersect this +// bounding box will be returned. +func (c *MapsListCall) Bbox(bbox string) *MapsListCall { + c.opt_["bbox"] = bbox + return c +} + +// CreatedAfter sets the optional parameter "createdAfter": An RFC 3339 +// formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been created at or after this time. +func (c *MapsListCall) CreatedAfter(createdAfter string) *MapsListCall { + c.opt_["createdAfter"] = createdAfter + return c +} + +// CreatedBefore sets the optional parameter "createdBefore": An RFC +// 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been created at or before this time. +func (c *MapsListCall) CreatedBefore(createdBefore string) *MapsListCall { + c.opt_["createdBefore"] = createdBefore + return c +} + +// CreatorEmail sets the optional parameter "creatorEmail": An email +// address representing a user. Returned assets that have been created +// by the user associated with the provided email address. +func (c *MapsListCall) CreatorEmail(creatorEmail string) *MapsListCall { + c.opt_["creatorEmail"] = creatorEmail + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of items to include in a single response page. The maximum +// supported value is 100. +func (c *MapsListCall) MaxResults(maxResults int64) *MapsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// ModifiedAfter sets the optional parameter "modifiedAfter": An RFC +// 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been modified at or after this time. +func (c *MapsListCall) ModifiedAfter(modifiedAfter string) *MapsListCall { + c.opt_["modifiedAfter"] = modifiedAfter + return c +} + +// ModifiedBefore sets the optional parameter "modifiedBefore": An RFC +// 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been modified at or before this time. +func (c *MapsListCall) ModifiedBefore(modifiedBefore string) *MapsListCall { + c.opt_["modifiedBefore"] = modifiedBefore + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, used to page through large result sets. To get the next page +// of results, set this parameter to the value of nextPageToken from the +// previous response. +func (c *MapsListCall) PageToken(pageToken string) *MapsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ProjectId sets the optional parameter "projectId": The ID of a Maps +// Engine project, used to filter the response. To list all available +// projects with their IDs, send a Projects: list request. You can also +// find your project ID as the value of the DashboardPlace:cid URL +// parameter when signed in to mapsengine.google.com. +func (c *MapsListCall) ProjectId(projectId string) *MapsListCall { + c.opt_["projectId"] = projectId + return c +} + +func (c *MapsListCall) Do() (*MapsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["bbox"]; ok { + params.Set("bbox", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["createdAfter"]; ok { + params.Set("createdAfter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["createdBefore"]; ok { + params.Set("createdBefore", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["creatorEmail"]; ok { + params.Set("creatorEmail", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["modifiedAfter"]; ok { + params.Set("modifiedAfter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["modifiedBefore"]; ok { + params.Set("modifiedBefore", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(MapsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all maps readable by the current user.", + // "httpMethod": "GET", + // "id": "mapsengine.maps.list", + // "parameters": { + // "bbox": { + // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.", + // "location": "query", + // "type": "string" + // }, + // "createdAfter": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "createdBefore": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "creatorEmail": { + // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "modifiedAfter": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "modifiedBefore": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "projectId": { + // "description": "The ID of a Maps Engine project, used to filter the response. To list all available projects with their IDs, send a Projects: list request. You can also find your project ID as the value of the DashboardPlace:cid URL parameter when signed in to mapsengine.google.com.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "maps", + // "response": { + // "$ref": "MapsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.projects.list": + +type ProjectsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Return all projects readable by the current user. +func (r *ProjectsService) List() *ProjectsListCall { + c := &ProjectsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *ProjectsListCall) Do() (*ProjectsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ProjectsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all projects readable by the current user.", + // "httpMethod": "GET", + // "id": "mapsengine.projects.list", + // "path": "projects", + // "response": { + // "$ref": "ProjectsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.create": + +type RasterCollectionsCreateCall struct { + s *Service + rastercollection *RasterCollection + opt_ map[string]interface{} +} + +// Create: Create a raster collection asset. +func (r *RasterCollectionsService) Create(rastercollection *RasterCollection) *RasterCollectionsCreateCall { + c := &RasterCollectionsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.rastercollection = rastercollection + return c +} + +func (c *RasterCollectionsCreateCall) Do() (*RasterCollection, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.rastercollection) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RasterCollection) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a raster collection asset.", + // "httpMethod": "POST", + // "id": "mapsengine.rasterCollections.create", + // "path": "rasterCollections", + // "request": { + // "$ref": "RasterCollection" + // }, + // "response": { + // "$ref": "RasterCollection" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.get": + +type RasterCollectionsGetCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Get: Return metadata for a particular raster collection. +func (r *RasterCollectionsService) Get(id string) *RasterCollectionsGetCall { + c := &RasterCollectionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *RasterCollectionsGetCall) Do() (*RasterCollection, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RasterCollection) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return metadata for a particular raster collection.", + // "httpMethod": "GET", + // "id": "mapsengine.rasterCollections.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster collection.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}", + // "response": { + // "$ref": "RasterCollection" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.list": + +type RasterCollectionsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Return all raster collections readable by the current user. +func (r *RasterCollectionsService) List() *RasterCollectionsListCall { + c := &RasterCollectionsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Bbox sets the optional parameter "bbox": A bounding box, expressed as +// "west,south,east,north". If set, only assets which intersect this +// bounding box will be returned. +func (c *RasterCollectionsListCall) Bbox(bbox string) *RasterCollectionsListCall { + c.opt_["bbox"] = bbox + return c +} + +// CreatedAfter sets the optional parameter "createdAfter": An RFC 3339 +// formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been created at or after this time. +func (c *RasterCollectionsListCall) CreatedAfter(createdAfter string) *RasterCollectionsListCall { + c.opt_["createdAfter"] = createdAfter + return c +} + +// CreatedBefore sets the optional parameter "createdBefore": An RFC +// 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been created at or before this time. +func (c *RasterCollectionsListCall) CreatedBefore(createdBefore string) *RasterCollectionsListCall { + c.opt_["createdBefore"] = createdBefore + return c +} + +// CreatorEmail sets the optional parameter "creatorEmail": An email +// address representing a user. Returned assets that have been created +// by the user associated with the provided email address. +func (c *RasterCollectionsListCall) CreatorEmail(creatorEmail string) *RasterCollectionsListCall { + c.opt_["creatorEmail"] = creatorEmail + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of items to include in a single response page. The maximum +// supported value is 100. +func (c *RasterCollectionsListCall) MaxResults(maxResults int64) *RasterCollectionsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// ModifiedAfter sets the optional parameter "modifiedAfter": An RFC +// 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been modified at or after this time. +func (c *RasterCollectionsListCall) ModifiedAfter(modifiedAfter string) *RasterCollectionsListCall { + c.opt_["modifiedAfter"] = modifiedAfter + return c +} + +// ModifiedBefore sets the optional parameter "modifiedBefore": An RFC +// 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been modified at or before this time. +func (c *RasterCollectionsListCall) ModifiedBefore(modifiedBefore string) *RasterCollectionsListCall { + c.opt_["modifiedBefore"] = modifiedBefore + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, used to page through large result sets. To get the next page +// of results, set this parameter to the value of nextPageToken from the +// previous response. +func (c *RasterCollectionsListCall) PageToken(pageToken string) *RasterCollectionsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ProjectId sets the optional parameter "projectId": The ID of a Maps +// Engine project, used to filter the response. To list all available +// projects with their IDs, send a Projects: list request. You can also +// find your project ID as the value of the DashboardPlace:cid URL +// parameter when signed in to mapsengine.google.com. +func (c *RasterCollectionsListCall) ProjectId(projectId string) *RasterCollectionsListCall { + c.opt_["projectId"] = projectId + return c +} + +func (c *RasterCollectionsListCall) Do() (*RastercollectionsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["bbox"]; ok { + params.Set("bbox", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["createdAfter"]; ok { + params.Set("createdAfter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["createdBefore"]; ok { + params.Set("createdBefore", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["creatorEmail"]; ok { + params.Set("creatorEmail", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["modifiedAfter"]; ok { + params.Set("modifiedAfter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["modifiedBefore"]; ok { + params.Set("modifiedBefore", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RastercollectionsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all raster collections readable by the current user.", + // "httpMethod": "GET", + // "id": "mapsengine.rasterCollections.list", + // "parameters": { + // "bbox": { + // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.", + // "location": "query", + // "type": "string" + // }, + // "createdAfter": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "createdBefore": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "creatorEmail": { + // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "modifiedAfter": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "modifiedBefore": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "projectId": { + // "description": "The ID of a Maps Engine project, used to filter the response. To list all available projects with their IDs, send a Projects: list request. You can also find your project ID as the value of the DashboardPlace:cid URL parameter when signed in to mapsengine.google.com.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "rasterCollections", + // "response": { + // "$ref": "RastercollectionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.parents.list": + +type RasterCollectionsParentsListCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// List: Return all parent ids of the specified raster collection. +func (r *RasterCollectionsParentsService) List(id string) *RasterCollectionsParentsListCall { + c := &RasterCollectionsParentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of items to include in a single response page. The maximum +// supported value is 50. +func (c *RasterCollectionsParentsListCall) MaxResults(maxResults int64) *RasterCollectionsParentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, used to page through large result sets. To get the next page +// of results, set this parameter to the value of nextPageToken from the +// previous response. +func (c *RasterCollectionsParentsListCall) PageToken(pageToken string) *RasterCollectionsParentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *RasterCollectionsParentsListCall) Do() (*ParentsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ParentsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all parent ids of the specified raster collection.", + // "httpMethod": "GET", + // "id": "mapsengine.rasterCollections.parents.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster collection whose parents will be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}/parents", + // "response": { + // "$ref": "ParentsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.rasters.list": + +type RasterCollectionsRastersListCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// List: Return all rasters within a raster collection. +func (r *RasterCollectionsRastersService) List(id string) *RasterCollectionsRastersListCall { + c := &RasterCollectionsRastersListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Bbox sets the optional parameter "bbox": A bounding box, expressed as +// "west,south,east,north". If set, only assets which intersect this +// bounding box will be returned. +func (c *RasterCollectionsRastersListCall) Bbox(bbox string) *RasterCollectionsRastersListCall { + c.opt_["bbox"] = bbox + return c +} + +// CreatedAfter sets the optional parameter "createdAfter": An RFC 3339 +// formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been created at or after this time. +func (c *RasterCollectionsRastersListCall) CreatedAfter(createdAfter string) *RasterCollectionsRastersListCall { + c.opt_["createdAfter"] = createdAfter + return c +} + +// CreatedBefore sets the optional parameter "createdBefore": An RFC +// 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been created at or before this time. +func (c *RasterCollectionsRastersListCall) CreatedBefore(createdBefore string) *RasterCollectionsRastersListCall { + c.opt_["createdBefore"] = createdBefore + return c +} + +// CreatorEmail sets the optional parameter "creatorEmail": An email +// address representing a user. Returned assets that have been created +// by the user associated with the provided email address. +func (c *RasterCollectionsRastersListCall) CreatorEmail(creatorEmail string) *RasterCollectionsRastersListCall { + c.opt_["creatorEmail"] = creatorEmail + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of items to include in a single response page. The maximum +// supported value is 100. +func (c *RasterCollectionsRastersListCall) MaxResults(maxResults int64) *RasterCollectionsRastersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// ModifiedAfter sets the optional parameter "modifiedAfter": An RFC +// 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been modified at or after this time. +func (c *RasterCollectionsRastersListCall) ModifiedAfter(modifiedAfter string) *RasterCollectionsRastersListCall { + c.opt_["modifiedAfter"] = modifiedAfter + return c +} + +// ModifiedBefore sets the optional parameter "modifiedBefore": An RFC +// 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been modified at or before this time. +func (c *RasterCollectionsRastersListCall) ModifiedBefore(modifiedBefore string) *RasterCollectionsRastersListCall { + c.opt_["modifiedBefore"] = modifiedBefore + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, used to page through large result sets. To get the next page +// of results, set this parameter to the value of nextPageToken from the +// previous response. +func (c *RasterCollectionsRastersListCall) PageToken(pageToken string) *RasterCollectionsRastersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *RasterCollectionsRastersListCall) Do() (*RastersListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["bbox"]; ok { + params.Set("bbox", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["createdAfter"]; ok { + params.Set("createdAfter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["createdBefore"]; ok { + params.Set("createdBefore", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["creatorEmail"]; ok { + params.Set("creatorEmail", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["modifiedAfter"]; ok { + params.Set("modifiedAfter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["modifiedBefore"]; ok { + params.Set("modifiedBefore", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/rasters") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(RastersListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all rasters within a raster collection.", + // "httpMethod": "GET", + // "id": "mapsengine.rasterCollections.rasters.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "bbox": { + // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.", + // "location": "query", + // "type": "string" + // }, + // "createdAfter": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "createdBefore": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "creatorEmail": { + // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.", + // "location": "query", + // "type": "string" + // }, + // "id": { + // "description": "The ID of the raster collection to which these rasters belong.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "modifiedAfter": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "modifiedBefore": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}/rasters", + // "response": { + // "$ref": "RastersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.rasters.get": + +type RastersGetCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Get: Return metadata for a single raster. +func (r *RastersService) Get(id string) *RastersGetCall { + c := &RastersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *RastersGetCall) Do() (*Image, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Image) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return metadata for a single raster.", + // "httpMethod": "GET", + // "id": "mapsengine.rasters.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasters/{id}", + // "response": { + // "$ref": "Image" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.rasters.upload": + +type RastersUploadCall struct { + s *Service + image *Image + opt_ map[string]interface{} +} + +// Upload: Create a skeleton raster asset for upload. +func (r *RastersService) Upload(image *Image) *RastersUploadCall { + c := &RastersUploadCall{s: r.s, opt_: make(map[string]interface{})} + c.image = image + return c +} + +func (c *RastersUploadCall) Do() (*Image, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.image) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/upload") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Image) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a skeleton raster asset for upload.", + // "httpMethod": "POST", + // "id": "mapsengine.rasters.upload", + // "path": "rasters/upload", + // "request": { + // "$ref": "Image" + // }, + // "response": { + // "$ref": "Image" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasters.files.insert": + +type RastersFilesInsertCall struct { + s *Service + id string + filename string + opt_ map[string]interface{} + media_ io.Reader +} + +// Insert: Upload a file to a raster asset. +func (r *RastersFilesService) Insert(id string, filename string) *RastersFilesInsertCall { + c := &RastersFilesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.filename = filename + return c +} +func (c *RastersFilesInsertCall) Media(r io.Reader) *RastersFilesInsertCall { + c.media_ = r + return c +} + +func (c *RastersFilesInsertCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("filename", fmt.Sprintf("%v", c.filename)) + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/files") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Upload a file to a raster asset.", + // "httpMethod": "POST", + // "id": "mapsengine.rasters.files.insert", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "maxSize": "1GB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/mapsengine/v1/rasters/{id}/files" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/mapsengine/v1/rasters/{id}/files" + // } + // } + // }, + // "parameterOrder": [ + // "id", + // "filename" + // ], + // "parameters": { + // "filename": { + // "description": "The file name of this uploaded file.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "The ID of the raster asset.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasters/{id}/files", + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "mapsengine.rasters.parents.list": + +type RastersParentsListCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// List: Return all parent ids of the specified rasters. +func (r *RastersParentsService) List(id string) *RastersParentsListCall { + c := &RastersParentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of items to include in a single response page. The maximum +// supported value is 50. +func (c *RastersParentsListCall) MaxResults(maxResults int64) *RastersParentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, used to page through large result sets. To get the next page +// of results, set this parameter to the value of nextPageToken from the +// previous response. +func (c *RastersParentsListCall) PageToken(pageToken string) *RastersParentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *RastersParentsListCall) Do() (*ParentsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ParentsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all parent ids of the specified rasters.", + // "httpMethod": "GET", + // "id": "mapsengine.rasters.parents.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the rasters whose parents will be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "rasters/{id}/parents", + // "response": { + // "$ref": "ParentsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.tables.create": + +type TablesCreateCall struct { + s *Service + table *Table + opt_ map[string]interface{} +} + +// Create: Create a table asset. +func (r *TablesService) Create(table *Table) *TablesCreateCall { + c := &TablesCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.table = table + return c +} + +func (c *TablesCreateCall) Do() (*Table, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.table) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "tables") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Table) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a table asset.", + // "httpMethod": "POST", + // "id": "mapsengine.tables.create", + // "path": "tables", + // "request": { + // "$ref": "Table" + // }, + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.tables.get": + +type TablesGetCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Get: Return metadata for a particular table, including the schema. +func (r *TablesService) Get(id string) *TablesGetCall { + c := &TablesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Version sets the optional parameter "version": +func (c *TablesGetCall) Version(version string) *TablesGetCall { + c.opt_["version"] = version + return c +} + +func (c *TablesGetCall) Do() (*Table, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["version"]; ok { + params.Set("version", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Table) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return metadata for a particular table, including the schema.", + // "httpMethod": "GET", + // "id": "mapsengine.tables.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the table.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "version": { + // "enum": [ + // "draft", + // "published" + // ], + // "enumDescriptions": [ + // "The draft version.", + // "The published version." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "tables/{id}", + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.tables.list": + +type TablesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Return all tables readable by the current user. +func (r *TablesService) List() *TablesListCall { + c := &TablesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Bbox sets the optional parameter "bbox": A bounding box, expressed as +// "west,south,east,north". If set, only assets which intersect this +// bounding box will be returned. +func (c *TablesListCall) Bbox(bbox string) *TablesListCall { + c.opt_["bbox"] = bbox + return c +} + +// CreatedAfter sets the optional parameter "createdAfter": An RFC 3339 +// formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been created at or after this time. +func (c *TablesListCall) CreatedAfter(createdAfter string) *TablesListCall { + c.opt_["createdAfter"] = createdAfter + return c +} + +// CreatedBefore sets the optional parameter "createdBefore": An RFC +// 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been created at or before this time. +func (c *TablesListCall) CreatedBefore(createdBefore string) *TablesListCall { + c.opt_["createdBefore"] = createdBefore + return c +} + +// CreatorEmail sets the optional parameter "creatorEmail": An email +// address representing a user. Returned assets that have been created +// by the user associated with the provided email address. +func (c *TablesListCall) CreatorEmail(creatorEmail string) *TablesListCall { + c.opt_["creatorEmail"] = creatorEmail + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of items to include in a single response page. The maximum +// supported value is 100. +func (c *TablesListCall) MaxResults(maxResults int64) *TablesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// ModifiedAfter sets the optional parameter "modifiedAfter": An RFC +// 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been modified at or after this time. +func (c *TablesListCall) ModifiedAfter(modifiedAfter string) *TablesListCall { + c.opt_["modifiedAfter"] = modifiedAfter + return c +} + +// ModifiedBefore sets the optional parameter "modifiedBefore": An RFC +// 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned +// assets will have been modified at or before this time. +func (c *TablesListCall) ModifiedBefore(modifiedBefore string) *TablesListCall { + c.opt_["modifiedBefore"] = modifiedBefore + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, used to page through large result sets. To get the next page +// of results, set this parameter to the value of nextPageToken from the +// previous response. +func (c *TablesListCall) PageToken(pageToken string) *TablesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ProjectId sets the optional parameter "projectId": The ID of a Maps +// Engine project, used to filter the response. To list all available +// projects with their IDs, send a Projects: list request. You can also +// find your project ID as the value of the DashboardPlace:cid URL +// parameter when signed in to mapsengine.google.com. +func (c *TablesListCall) ProjectId(projectId string) *TablesListCall { + c.opt_["projectId"] = projectId + return c +} + +func (c *TablesListCall) Do() (*TablesListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["bbox"]; ok { + params.Set("bbox", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["createdAfter"]; ok { + params.Set("createdAfter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["createdBefore"]; ok { + params.Set("createdBefore", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["creatorEmail"]; ok { + params.Set("creatorEmail", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["modifiedAfter"]; ok { + params.Set("modifiedAfter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["modifiedBefore"]; ok { + params.Set("modifiedBefore", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TablesListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all tables readable by the current user.", + // "httpMethod": "GET", + // "id": "mapsengine.tables.list", + // "parameters": { + // "bbox": { + // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.", + // "location": "query", + // "type": "string" + // }, + // "createdAfter": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "createdBefore": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "creatorEmail": { + // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "modifiedAfter": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "modifiedBefore": { + // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.", + // "format": "date-time", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "projectId": { + // "description": "The ID of a Maps Engine project, used to filter the response. To list all available projects with their IDs, send a Projects: list request. You can also find your project ID as the value of the DashboardPlace:cid URL parameter when signed in to mapsengine.google.com.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "tables", + // "response": { + // "$ref": "TablesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.tables.upload": + +type TablesUploadCall struct { + s *Service + table *Table + opt_ map[string]interface{} +} + +// Upload: Create a placeholder table asset to which table files can be +// uploaded. +// Once the placeholder has been created, files are uploaded +// to the +// https://www.googleapis.com/upload/mapsengine/v1/tables/table_id/files +// endpoint. +// See Table Upload in the Developer's Guide or Table.files: +// insert in the reference documentation for more information. +func (r *TablesService) Upload(table *Table) *TablesUploadCall { + c := &TablesUploadCall{s: r.s, opt_: make(map[string]interface{})} + c.table = table + return c +} + +func (c *TablesUploadCall) Do() (*Table, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.table) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/upload") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Table) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a placeholder table asset to which table files can be uploaded.\nOnce the placeholder has been created, files are uploaded to the https://www.googleapis.com/upload/mapsengine/v1/tables/table_id/files endpoint.\nSee Table Upload in the Developer's Guide or Table.files: insert in the reference documentation for more information.", + // "httpMethod": "POST", + // "id": "mapsengine.tables.upload", + // "path": "tables/upload", + // "request": { + // "$ref": "Table" + // }, + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.tables.features.batchDelete": + +type TablesFeaturesBatchDeleteCall struct { + s *Service + id string + featuresbatchdeleterequest *FeaturesBatchDeleteRequest + opt_ map[string]interface{} +} + +// BatchDelete: Delete all features matching the given IDs. +func (r *TablesFeaturesService) BatchDelete(id string, featuresbatchdeleterequest *FeaturesBatchDeleteRequest) *TablesFeaturesBatchDeleteCall { + c := &TablesFeaturesBatchDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.featuresbatchdeleterequest = featuresbatchdeleterequest + return c +} + +func (c *TablesFeaturesBatchDeleteCall) Do() error { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.featuresbatchdeleterequest) + if err != nil { + return err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features/batchDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete all features matching the given IDs.", + // "httpMethod": "POST", + // "id": "mapsengine.tables.features.batchDelete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the table that contains the features to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{id}/features/batchDelete", + // "request": { + // "$ref": "FeaturesBatchDeleteRequest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.tables.features.batchInsert": + +type TablesFeaturesBatchInsertCall struct { + s *Service + id string + featuresbatchinsertrequest *FeaturesBatchInsertRequest + opt_ map[string]interface{} +} + +// BatchInsert: Append features to an existing table. +// +// A single +// batchInsert request can create: +// +// - Up to 50 features. +// - A combined +// total of 10 000 vertices. +// Feature limits are documented in the +// Supported data formats and limits article of the Google Maps Engine +// help center. Note that free and paid accounts have different +// limits. +// +// For more information about inserting features, read Creating +// features in the Google Maps Engine developer's guide. +func (r *TablesFeaturesService) BatchInsert(id string, featuresbatchinsertrequest *FeaturesBatchInsertRequest) *TablesFeaturesBatchInsertCall { + c := &TablesFeaturesBatchInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.featuresbatchinsertrequest = featuresbatchinsertrequest + return c +} + +func (c *TablesFeaturesBatchInsertCall) Do() error { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.featuresbatchinsertrequest) + if err != nil { + return err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features/batchInsert") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Append features to an existing table.\n\nA single batchInsert request can create:\n\n- Up to 50 features.\n- A combined total of 10 000 vertices.\nFeature limits are documented in the Supported data formats and limits article of the Google Maps Engine help center. Note that free and paid accounts have different limits.\n\nFor more information about inserting features, read Creating features in the Google Maps Engine developer's guide.", + // "httpMethod": "POST", + // "id": "mapsengine.tables.features.batchInsert", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the table to append the features to.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{id}/features/batchInsert", + // "request": { + // "$ref": "FeaturesBatchInsertRequest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.tables.features.batchPatch": + +type TablesFeaturesBatchPatchCall struct { + s *Service + id string + featuresbatchpatchrequest *FeaturesBatchPatchRequest + opt_ map[string]interface{} +} + +// BatchPatch: Update the supplied features. +// +// A single batchPatch +// request can update: +// +// - Up to 50 features. +// - A combined total of +// 10 000 vertices. +// Feature limits are documented in the Supported +// data formats and limits article of the Google Maps Engine help +// center. Note that free and paid accounts have different +// limits. +// +// Feature updates use HTTP PATCH semantics: +// +// - A supplied +// value replaces an existing value (if any) in that field. +// - Omitted +// fields remain unchanged. +// - Complex values in geometries and +// properties must be replaced as atomic units. For example, providing +// just the coordinates of a geometry is not allowed; the complete +// geometry, including type, must be supplied. +// - Setting a property's +// value to null deletes that property. +// For more information about +// updating features, read Updating features in the Google Maps Engine +// developer's guide. +func (r *TablesFeaturesService) BatchPatch(id string, featuresbatchpatchrequest *FeaturesBatchPatchRequest) *TablesFeaturesBatchPatchCall { + c := &TablesFeaturesBatchPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.featuresbatchpatchrequest = featuresbatchpatchrequest + return c +} + +func (c *TablesFeaturesBatchPatchCall) Do() error { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.featuresbatchpatchrequest) + if err != nil { + return err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features/batchPatch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Update the supplied features.\n\nA single batchPatch request can update:\n\n- Up to 50 features.\n- A combined total of 10 000 vertices.\nFeature limits are documented in the Supported data formats and limits article of the Google Maps Engine help center. Note that free and paid accounts have different limits.\n\nFeature updates use HTTP PATCH semantics:\n\n- A supplied value replaces an existing value (if any) in that field.\n- Omitted fields remain unchanged.\n- Complex values in geometries and properties must be replaced as atomic units. For example, providing just the coordinates of a geometry is not allowed; the complete geometry, including type, must be supplied.\n- Setting a property's value to null deletes that property.\nFor more information about updating features, read Updating features in the Google Maps Engine developer's guide.", + // "httpMethod": "POST", + // "id": "mapsengine.tables.features.batchPatch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the table containing the features to be patched.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{id}/features/batchPatch", + // "request": { + // "$ref": "FeaturesBatchPatchRequest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.tables.features.get": + +type TablesFeaturesGetCall struct { + s *Service + tableId string + id string + opt_ map[string]interface{} +} + +// Get: Return a single feature, given its ID. +func (r *TablesFeaturesService) Get(tableId string, id string) *TablesFeaturesGetCall { + c := &TablesFeaturesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.id = id + return c +} + +// Select sets the optional parameter "select": A SQL-like projection +// clause used to specify returned properties. If this parameter is not +// included, all properties are returned. +func (c *TablesFeaturesGetCall) Select(select_ string) *TablesFeaturesGetCall { + c.opt_["select"] = select_ + return c +} + +// Version sets the optional parameter "version": The table version to +// access. See Accessing Public Data for information. +func (c *TablesFeaturesGetCall) Version(version string) *TablesFeaturesGetCall { + c.opt_["version"] = version + return c +} + +func (c *TablesFeaturesGetCall) Do() (*Feature, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["select"]; ok { + params.Set("select", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["version"]; ok { + params.Set("version", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/features/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{tableId}", url.QueryEscape(c.tableId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Feature) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return a single feature, given its ID.", + // "httpMethod": "GET", + // "id": "mapsengine.tables.features.get", + // "parameterOrder": [ + // "tableId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the feature to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "select": { + // "description": "A SQL-like projection clause used to specify returned properties. If this parameter is not included, all properties are returned.", + // "location": "query", + // "type": "string" + // }, + // "tableId": { + // "description": "The ID of the table.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "version": { + // "description": "The table version to access. See Accessing Public Data for information.", + // "enum": [ + // "draft", + // "published" + // ], + // "enumDescriptions": [ + // "The draft version.", + // "The published version." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/features/{id}", + // "response": { + // "$ref": "Feature" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.tables.features.list": + +type TablesFeaturesListCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// List: Return all features readable by the current user. +func (r *TablesFeaturesService) List(id string) *TablesFeaturesListCall { + c := &TablesFeaturesListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Include sets the optional parameter "include": A comma separated list +// of optional data to include. Optional data available: schema. +func (c *TablesFeaturesListCall) Include(include string) *TablesFeaturesListCall { + c.opt_["include"] = include + return c +} + +// Intersects sets the optional parameter "intersects": A geometry +// literal that specifies the spatial restriction of the query. +func (c *TablesFeaturesListCall) Intersects(intersects string) *TablesFeaturesListCall { + c.opt_["intersects"] = intersects + return c +} + +// Limit sets the optional parameter "limit": The total number of +// features to return from the query, irrespective of the number of +// pages. +func (c *TablesFeaturesListCall) Limit(limit int64) *TablesFeaturesListCall { + c.opt_["limit"] = limit + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of items to include in the response, used for paging. +func (c *TablesFeaturesListCall) MaxResults(maxResults int64) *TablesFeaturesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": An SQL-like order by +// clause used to sort results. If this parameter is not included, the +// order of features is undefined. +func (c *TablesFeaturesListCall) OrderBy(orderBy string) *TablesFeaturesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, used to page through large result sets. To get the next page +// of results, set this parameter to the value of nextPageToken from the +// previous response. +func (c *TablesFeaturesListCall) PageToken(pageToken string) *TablesFeaturesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Select sets the optional parameter "select": A SQL-like projection +// clause used to specify returned properties. If this parameter is not +// included, all properties are returned. +func (c *TablesFeaturesListCall) Select(select_ string) *TablesFeaturesListCall { + c.opt_["select"] = select_ + return c +} + +// Version sets the optional parameter "version": The table version to +// access. See Accessing Public Data for information. +func (c *TablesFeaturesListCall) Version(version string) *TablesFeaturesListCall { + c.opt_["version"] = version + return c +} + +// Where sets the optional parameter "where": An SQL-like predicate used +// to filter results. +func (c *TablesFeaturesListCall) Where(where string) *TablesFeaturesListCall { + c.opt_["where"] = where + return c +} + +func (c *TablesFeaturesListCall) Do() (*FeaturesListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["include"]; ok { + params.Set("include", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["intersects"]; ok { + params.Set("intersects", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["limit"]; ok { + params.Set("limit", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["select"]; ok { + params.Set("select", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["version"]; ok { + params.Set("version", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["where"]; ok { + params.Set("where", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(FeaturesListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all features readable by the current user.", + // "httpMethod": "GET", + // "id": "mapsengine.tables.features.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the table to which these features belong.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "include": { + // "description": "A comma separated list of optional data to include. Optional data available: schema.", + // "location": "query", + // "type": "string" + // }, + // "intersects": { + // "description": "A geometry literal that specifies the spatial restriction of the query.", + // "location": "query", + // "type": "string" + // }, + // "limit": { + // "description": "The total number of features to return from the query, irrespective of the number of pages.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "maxResults": { + // "description": "The maximum number of items to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "orderBy": { + // "description": "An SQL-like order by clause used to sort results. If this parameter is not included, the order of features is undefined.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "select": { + // "description": "A SQL-like projection clause used to specify returned properties. If this parameter is not included, all properties are returned.", + // "location": "query", + // "type": "string" + // }, + // "version": { + // "description": "The table version to access. See Accessing Public Data for information.", + // "enum": [ + // "draft", + // "published" + // ], + // "enumDescriptions": [ + // "The draft version.", + // "The published version." + // ], + // "location": "query", + // "type": "string" + // }, + // "where": { + // "description": "An SQL-like predicate used to filter results.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "tables/{id}/features", + // "response": { + // "$ref": "FeaturesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.tables.files.insert": + +type TablesFilesInsertCall struct { + s *Service + id string + filename string + opt_ map[string]interface{} + media_ io.Reader +} + +// Insert: Upload a file to a placeholder table asset. See Table Upload +// in the Developer's Guide for more information. +// Supported file types +// are listed in the Supported data formats and limits article of the +// Google Maps Engine help center. +func (r *TablesFilesService) Insert(id string, filename string) *TablesFilesInsertCall { + c := &TablesFilesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.filename = filename + return c +} +func (c *TablesFilesInsertCall) Media(r io.Reader) *TablesFilesInsertCall { + c.media_ = r + return c +} + +func (c *TablesFilesInsertCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("filename", fmt.Sprintf("%v", c.filename)) + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/files") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Upload a file to a placeholder table asset. See Table Upload in the Developer's Guide for more information.\nSupported file types are listed in the Supported data formats and limits article of the Google Maps Engine help center.", + // "httpMethod": "POST", + // "id": "mapsengine.tables.files.insert", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "maxSize": "1GB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/mapsengine/v1/tables/{id}/files" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/mapsengine/v1/tables/{id}/files" + // } + // } + // }, + // "parameterOrder": [ + // "id", + // "filename" + // ], + // "parameters": { + // "filename": { + // "description": "The file name of this uploaded file.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "The ID of the table asset.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{id}/files", + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "mapsengine.tables.parents.list": + +type TablesParentsListCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// List: Return all parent ids of the specified table. +func (r *TablesParentsService) List(id string) *TablesParentsListCall { + c := &TablesParentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of items to include in a single response page. The maximum +// supported value is 50. +func (c *TablesParentsListCall) MaxResults(maxResults int64) *TablesParentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, used to page through large result sets. To get the next page +// of results, set this parameter to the value of nextPageToken from the +// previous response. +func (c *TablesParentsListCall) PageToken(pageToken string) *TablesParentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *TablesParentsListCall) Do() (*ParentsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ParentsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all parent ids of the specified table.", + // "httpMethod": "GET", + // "id": "mapsengine.tables.parents.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the table whose parents will be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "tables/{id}/parents", + // "response": { + // "$ref": "ParentsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/mirror/v1/mirror-api.json b/third_party/src/code.google.com/p/google-api-go-client/mirror/v1/mirror-api.json new file mode 100644 index 0000000000000..eb639be50cf11 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/mirror/v1/mirror-api.json @@ -0,0 +1,1338 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"5M1WkxnZyJhziV-cW1kdtwscs8E/cLXdvPSJ73RAjLVWqio6ofbcpRI\"", + "discoveryVersion": "v1", + "id": "mirror:v1", + "name": "mirror", + "version": "v1", + "title": "Google Mirror API", + "description": "API for interacting with Glass users via the timeline.", + "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/glass", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/mirror/v1/", + "basePath": "/mirror/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "mirror/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/glass.location": { + "description": "View your location" + }, + "https://www.googleapis.com/auth/glass.timeline": { + "description": "View and manage your Glass timeline" + } + } + } + }, + "schemas": { + "Account": { + "id": "Account", + "type": "object", + "description": "Represents an account passed into the Account Manager on Glass.", + "properties": { + "authTokens": { + "type": "array", + "items": { + "$ref": "AuthToken" + } + }, + "features": { + "type": "array", + "items": { + "type": "string" + } + }, + "password": { + "type": "string" + }, + "userData": { + "type": "array", + "items": { + "$ref": "UserData" + } + } + } + }, + "Attachment": { + "id": "Attachment", + "type": "object", + "description": "Represents media content, such as a photo, that can be attached to a timeline item.", + "properties": { + "contentType": { + "type": "string", + "description": "The MIME type of the attachment." + }, + "contentUrl": { + "type": "string", + "description": "The URL for the content." + }, + "id": { + "type": "string", + "description": "The ID of the attachment." + }, + "isProcessingContent": { + "type": "boolean", + "description": "Indicates that the contentUrl is not available because the attachment content is still being processed. If the caller wishes to retrieve the content, it should try again later." + } + } + }, + "AttachmentsListResponse": { + "id": "AttachmentsListResponse", + "type": "object", + "description": "A list of Attachments. This is the response from the server to GET requests on the attachments collection.", + "properties": { + "items": { + "type": "array", + "description": "The list of attachments.", + "items": { + "$ref": "Attachment" + } + }, + "kind": { + "type": "string", + "description": "The type of resource. This is always mirror#attachmentsList.", + "default": "mirror#attachmentsList" + } + } + }, + "AuthToken": { + "id": "AuthToken", + "type": "object", + "properties": { + "authToken": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "Command": { + "id": "Command", + "type": "object", + "description": "A single menu command that is part of a Contact.", + "properties": { + "type": { + "type": "string", + "description": "The type of operation this command corresponds to. Allowed values are: \n- TAKE_A_NOTE - Shares a timeline item with the transcription of user speech from the \"Take a note\" voice menu command. \n- POST_AN_UPDATE - Shares a timeline item with the transcription of user speech from the \"Post an update\" voice menu command.", + "annotations": { + "required": [ + "mirror.contacts.insert", + "mirror.contacts.update" + ] + } + } + } + }, + "Contact": { + "id": "Contact", + "type": "object", + "description": "A person or group that can be used as a creator or a contact.", + "properties": { + "acceptCommands": { + "type": "array", + "description": "A list of voice menu commands that a contact can handle. Glass shows up to three contacts for each voice menu command. If there are more than that, the three contacts with the highest priority are shown for that particular command.", + "items": { + "$ref": "Command" + } + }, + "acceptTypes": { + "type": "array", + "description": "A list of MIME types that a contact supports. The contact will be shown to the user if any of its acceptTypes matches any of the types of the attachments on the item. If no acceptTypes are given, the contact will be shown for all items.", + "items": { + "type": "string" + } + }, + "displayName": { + "type": "string", + "description": "The name to display for this contact.", + "annotations": { + "required": [ + "mirror.contacts.insert", + "mirror.contacts.update" + ] + } + }, + "id": { + "type": "string", + "description": "An ID for this contact. This is generated by the application and is treated as an opaque token.", + "annotations": { + "required": [ + "mirror.contacts.insert", + "mirror.contacts.update" + ] + } + }, + "imageUrls": { + "type": "array", + "description": "Set of image URLs to display for a contact. Most contacts will have a single image, but a \"group\" contact may include up to 8 image URLs and they will be resized and cropped into a mosaic on the client.", + "items": { + "type": "string" + }, + "annotations": { + "required": [ + "mirror.contacts.insert", + "mirror.contacts.update" + ] + } + }, + "kind": { + "type": "string", + "description": "The type of resource. This is always mirror#contact.", + "default": "mirror#contact" + }, + "phoneNumber": { + "type": "string", + "description": "Primary phone number for the contact. This can be a fully-qualified number, with country calling code and area code, or a local number." + }, + "priority": { + "type": "integer", + "description": "Priority for the contact to determine ordering in a list of contacts. Contacts with higher priorities will be shown before ones with lower priorities.", + "format": "uint32" + }, + "sharingFeatures": { + "type": "array", + "description": "A list of sharing features that a contact can handle. Allowed values are: \n- ADD_CAPTION", + "items": { + "type": "string" + } + }, + "source": { + "type": "string", + "description": "The ID of the application that created this contact. This is populated by the API" + }, + "speakableName": { + "type": "string", + "description": "Name of this contact as it should be pronounced. If this contact's name must be spoken as part of a voice disambiguation menu, this name is used as the expected pronunciation. This is useful for contact names with unpronounceable characters or whose display spelling is otherwise not phonetic." + }, + "type": { + "type": "string", + "description": "The type for this contact. This is used for sorting in UIs. Allowed values are: \n- INDIVIDUAL - Represents a single person. This is the default. \n- GROUP - Represents more than a single person." + } + } + }, + "ContactsListResponse": { + "id": "ContactsListResponse", + "type": "object", + "description": "A list of Contacts representing contacts. This is the response from the server to GET requests on the contacts collection.", + "properties": { + "items": { + "type": "array", + "description": "Contact list.", + "items": { + "$ref": "Contact" + } + }, + "kind": { + "type": "string", + "description": "The type of resource. This is always mirror#contacts.", + "default": "mirror#contacts" + } + } + }, + "Location": { + "id": "Location", + "type": "object", + "description": "A geographic location that can be associated with a timeline item.", + "properties": { + "accuracy": { + "type": "number", + "description": "The accuracy of the location fix in meters.", + "format": "double" + }, + "address": { + "type": "string", + "description": "The full address of the location." + }, + "displayName": { + "type": "string", + "description": "The name to be displayed. This may be a business name or a user-defined place, such as \"Home\"." + }, + "id": { + "type": "string", + "description": "The ID of the location." + }, + "kind": { + "type": "string", + "description": "The type of resource. This is always mirror#location.", + "default": "mirror#location" + }, + "latitude": { + "type": "number", + "description": "The latitude, in degrees.", + "format": "double" + }, + "longitude": { + "type": "number", + "description": "The longitude, in degrees.", + "format": "double" + }, + "timestamp": { + "type": "string", + "description": "The time at which this location was captured, formatted according to RFC 3339.", + "format": "date-time" + } + } + }, + "LocationsListResponse": { + "id": "LocationsListResponse", + "type": "object", + "description": "A list of Locations. This is the response from the server to GET requests on the locations collection.", + "properties": { + "items": { + "type": "array", + "description": "The list of locations.", + "items": { + "$ref": "Location" + } + }, + "kind": { + "type": "string", + "description": "The type of resource. This is always mirror#locationsList.", + "default": "mirror#locationsList" + } + } + }, + "MenuItem": { + "id": "MenuItem", + "type": "object", + "description": "A custom menu item that can be presented to the user by a timeline item.", + "properties": { + "action": { + "type": "string", + "description": "Controls the behavior when the user picks the menu option. Allowed values are: \n- CUSTOM - Custom action set by the service. When the user selects this menuItem, the API triggers a notification to your callbackUrl with the userActions.type set to CUSTOM and the userActions.payload set to the ID of this menu item. This is the default value. \n- Built-in actions: \n- REPLY - Initiate a reply to the timeline item using the voice recording UI. The creator attribute must be set in the timeline item for this menu to be available. \n- REPLY_ALL - Same behavior as REPLY. The original timeline item's recipients will be added to the reply item. \n- DELETE - Delete the timeline item. \n- SHARE - Share the timeline item with the available contacts. \n- READ_ALOUD - Read the timeline item's speakableText aloud; if this field is not set, read the text field; if none of those fields are set, this menu item is ignored. \n- GET_MEDIA_INPUT - Allow users to provide media payloads to Glassware from a menu item (currently, only transcribed text from voice input is supported). Subscribe to notifications when users invoke this menu item to receive the timeline item ID. Retrieve the media from the timeline item in the payload property. \n- VOICE_CALL - Initiate a phone call using the timeline item's creator.phoneNumber attribute as recipient. \n- NAVIGATE - Navigate to the timeline item's location. \n- TOGGLE_PINNED - Toggle the isPinned state of the timeline item. \n- OPEN_URI - Open the payload of the menu item in the browser. \n- PLAY_VIDEO - Open the payload of the menu item in the Glass video player. \n- SEND_MESSAGE - Initiate sending a message to the timeline item's creator: \n- If the creator.phoneNumber is set and Glass is connected to an Android phone, the message is an SMS. \n- Otherwise, if the creator.email is set, the message is an email." + }, + "id": { + "type": "string", + "description": "The ID for this menu item. This is generated by the application and is treated as an opaque token." + }, + "payload": { + "type": "string", + "description": "A generic payload whose meaning changes depending on this MenuItem's action. \n- When the action is OPEN_URI, the payload is the URL of the website to view. \n- When the action is PLAY_VIDEO, the payload is the streaming URL of the video \n- When the action is GET_MEDIA_INPUT, the payload is the text transcription of a user's speech input" + }, + "removeWhenSelected": { + "type": "boolean", + "description": "If set to true on a CUSTOM menu item, that item will be removed from the menu after it is selected." + }, + "values": { + "type": "array", + "description": "For CUSTOM items, a list of values controlling the appearance of the menu item in each of its states. A value for the DEFAULT state must be provided. If the PENDING or CONFIRMED states are missing, they will not be shown.", + "items": { + "$ref": "MenuValue" + } + } + } + }, + "MenuValue": { + "id": "MenuValue", + "type": "object", + "description": "A single value that is part of a MenuItem.", + "properties": { + "displayName": { + "type": "string", + "description": "The name to display for the menu item. If you specify this property for a built-in menu item, the default contextual voice command for that menu item is not shown." + }, + "iconUrl": { + "type": "string", + "description": "URL of an icon to display with the menu item." + }, + "state": { + "type": "string", + "description": "The state that this value applies to. Allowed values are: \n- DEFAULT - Default value shown when displayed in the menuItems list. \n- PENDING - Value shown when the menuItem has been selected by the user but can still be cancelled. \n- CONFIRMED - Value shown when the menuItem has been selected by the user and can no longer be cancelled." + } + } + }, + "Notification": { + "id": "Notification", + "type": "object", + "description": "A notification delivered by the API.", + "properties": { + "collection": { + "type": "string", + "description": "The collection that generated the notification." + }, + "itemId": { + "type": "string", + "description": "The ID of the item that generated the notification." + }, + "operation": { + "type": "string", + "description": "The type of operation that generated the notification." + }, + "userActions": { + "type": "array", + "description": "A list of actions taken by the user that triggered the notification.", + "items": { + "$ref": "UserAction" + } + }, + "userToken": { + "type": "string", + "description": "The user token provided by the service when it subscribed for notifications." + }, + "verifyToken": { + "type": "string", + "description": "The secret verify token provided by the service when it subscribed for notifications." + } + } + }, + "NotificationConfig": { + "id": "NotificationConfig", + "type": "object", + "description": "Controls how notifications for a timeline item are presented to the user.", + "properties": { + "deliveryTime": { + "type": "string", + "description": "The time at which the notification should be delivered.", + "format": "date-time" + }, + "level": { + "type": "string", + "description": "Describes how important the notification is. Allowed values are: \n- DEFAULT - Notifications of default importance. A chime will be played to alert users." + } + } + }, + "Subscription": { + "id": "Subscription", + "type": "object", + "description": "A subscription to events on a collection.", + "properties": { + "callbackUrl": { + "type": "string", + "description": "The URL where notifications should be delivered (must start with https://).", + "annotations": { + "required": [ + "mirror.subscriptions.insert", + "mirror.subscriptions.update" + ] + } + }, + "collection": { + "type": "string", + "description": "The collection to subscribe to. Allowed values are: \n- timeline - Changes in the timeline including insertion, deletion, and updates. \n- locations - Location updates.", + "annotations": { + "required": [ + "mirror.subscriptions.insert", + "mirror.subscriptions.update" + ] + } + }, + "id": { + "type": "string", + "description": "The ID of the subscription." + }, + "kind": { + "type": "string", + "description": "The type of resource. This is always mirror#subscription.", + "default": "mirror#subscription" + }, + "notification": { + "$ref": "Notification", + "description": "Container object for notifications. This is not populated in the Subscription resource." + }, + "operation": { + "type": "array", + "description": "A list of operations that should be subscribed to. An empty list indicates that all operations on the collection should be subscribed to. Allowed values are: \n- UPDATE - The item has been updated. \n- INSERT - A new item has been inserted. \n- DELETE - The item has been deleted. \n- MENU_ACTION - A custom menu item has been triggered by the user.", + "items": { + "type": "string" + } + }, + "updated": { + "type": "string", + "description": "The time at which this subscription was last modified, formatted according to RFC 3339.", + "format": "date-time" + }, + "userToken": { + "type": "string", + "description": "An opaque token sent to the subscriber in notifications so that it can determine the ID of the user." + }, + "verifyToken": { + "type": "string", + "description": "A secret token sent to the subscriber in notifications so that it can verify that the notification was generated by Google." + } + } + }, + "SubscriptionsListResponse": { + "id": "SubscriptionsListResponse", + "type": "object", + "description": "A list of Subscriptions. This is the response from the server to GET requests on the subscription collection.", + "properties": { + "items": { + "type": "array", + "description": "The list of subscriptions.", + "items": { + "$ref": "Subscription" + } + }, + "kind": { + "type": "string", + "description": "The type of resource. This is always mirror#subscriptionsList.", + "default": "mirror#subscriptionsList" + } + } + }, + "TimelineItem": { + "id": "TimelineItem", + "type": "object", + "description": "Each item in the user's timeline is represented as a TimelineItem JSON structure, described below.", + "properties": { + "attachments": { + "type": "array", + "description": "A list of media attachments associated with this item. As a convenience, you can refer to attachments in your HTML payloads with the attachment or cid scheme. For example: \n- attachment: \u003cimg src=\"attachment:attachment_index\"\u003e where attachment_index is the 0-based index of this array. \n- cid: \u003cimg src=\"cid:attachment_id\"\u003e where attachment_id is the ID of the attachment.", + "items": { + "$ref": "Attachment" + } + }, + "bundleId": { + "type": "string", + "description": "The bundle ID for this item. Services can specify a bundleId to group many items together. They appear under a single top-level item on the device." + }, + "canonicalUrl": { + "type": "string", + "description": "A canonical URL pointing to the canonical/high quality version of the data represented by the timeline item." + }, + "created": { + "type": "string", + "description": "The time at which this item was created, formatted according to RFC 3339.", + "format": "date-time" + }, + "creator": { + "$ref": "Contact", + "description": "The user or group that created this item." + }, + "displayTime": { + "type": "string", + "description": "The time that should be displayed when this item is viewed in the timeline, formatted according to RFC 3339. This user's timeline is sorted chronologically on display time, so this will also determine where the item is displayed in the timeline. If not set by the service, the display time defaults to the updated time.", + "format": "date-time" + }, + "etag": { + "type": "string", + "description": "ETag for this item." + }, + "html": { + "type": "string", + "description": "HTML content for this item. If both text and html are provided for an item, the html will be rendered in the timeline.\nAllowed HTML elements - You can use these elements in your timeline cards.\n \n- Headers: h1, h2, h3, h4, h5, h6 \n- Images: img \n- Lists: li, ol, ul \n- HTML5 semantics: article, aside, details, figure, figcaption, footer, header, nav, section, summary, time \n- Structural: blockquote, br, div, hr, p, span \n- Style: b, big, center, em, i, u, s, small, strike, strong, style, sub, sup \n- Tables: table, tbody, td, tfoot, th, thead, tr \nBlocked HTML elements: These elements and their contents are removed from HTML payloads.\n \n- Document headers: head, title \n- Embeds: audio, embed, object, source, video \n- Frames: frame, frameset \n- Scripting: applet, script \nOther elements: Any elements that aren't listed are removed, but their contents are preserved." + }, + "id": { + "type": "string", + "description": "The ID of the timeline item. This is unique within a user's timeline." + }, + "inReplyTo": { + "type": "string", + "description": "If this item was generated as a reply to another item, this field will be set to the ID of the item being replied to. This can be used to attach a reply to the appropriate conversation or post." + }, + "isBundleCover": { + "type": "boolean", + "description": "Whether this item is a bundle cover.\n\nIf an item is marked as a bundle cover, it will be the entry point to the bundle of items that have the same bundleId as that item. It will be shown only on the main timeline — not within the opened bundle.\n\nOn the main timeline, items that are shown are: \n- Items that have isBundleCover set to true \n- Items that do not have a bundleId In a bundle sub-timeline, items that are shown are: \n- Items that have the bundleId in question AND isBundleCover set to false" + }, + "isDeleted": { + "type": "boolean", + "description": "When true, indicates this item is deleted, and only the ID property is set." + }, + "isPinned": { + "type": "boolean", + "description": "When true, indicates this item is pinned, which means it's grouped alongside \"active\" items like navigation and hangouts, on the opposite side of the home screen from historical (non-pinned) timeline items. You can allow the user to toggle the value of this property with the TOGGLE_PINNED built-in menu item." + }, + "kind": { + "type": "string", + "description": "The type of resource. This is always mirror#timelineItem.", + "default": "mirror#timelineItem" + }, + "location": { + "$ref": "Location", + "description": "The geographic location associated with this item." + }, + "menuItems": { + "type": "array", + "description": "A list of menu items that will be presented to the user when this item is selected in the timeline.", + "items": { + "$ref": "MenuItem" + } + }, + "notification": { + "$ref": "NotificationConfig", + "description": "Controls how notifications for this item are presented on the device. If this is missing, no notification will be generated." + }, + "pinScore": { + "type": "integer", + "description": "For pinned items, this determines the order in which the item is displayed in the timeline, with a higher score appearing closer to the clock. Note: setting this field is currently not supported.", + "format": "int32" + }, + "recipients": { + "type": "array", + "description": "A list of users or groups that this item has been shared with.", + "items": { + "$ref": "Contact" + } + }, + "selfLink": { + "type": "string", + "description": "A URL that can be used to retrieve this item." + }, + "sourceItemId": { + "type": "string", + "description": "Opaque string you can use to map a timeline item to data in your own service." + }, + "speakableText": { + "type": "string", + "description": "The speakable version of the content of this item. Along with the READ_ALOUD menu item, use this field to provide text that would be clearer when read aloud, or to provide extended information to what is displayed visually on Glass.\n\nGlassware should also specify the speakableType field, which will be spoken before this text in cases where the additional context is useful, for example when the user requests that the item be read aloud following a notification." + }, + "speakableType": { + "type": "string", + "description": "A speakable description of the type of this item. This will be announced to the user prior to reading the content of the item in cases where the additional context is useful, for example when the user requests that the item be read aloud following a notification.\n\nThis should be a short, simple noun phrase such as \"Email\", \"Text message\", or \"Daily Planet News Update\".\n\nGlassware are encouraged to populate this field for every timeline item, even if the item does not contain speakableText or text so that the user can learn the type of the item without looking at the screen." + }, + "text": { + "type": "string", + "description": "Text content of this item." + }, + "title": { + "type": "string", + "description": "The title of this item." + }, + "updated": { + "type": "string", + "description": "The time at which this item was last modified, formatted according to RFC 3339.", + "format": "date-time" + } + } + }, + "TimelineListResponse": { + "id": "TimelineListResponse", + "type": "object", + "description": "A list of timeline items. This is the response from the server to GET requests on the timeline collection.", + "properties": { + "items": { + "type": "array", + "description": "Items in the timeline.", + "items": { + "$ref": "TimelineItem" + } + }, + "kind": { + "type": "string", + "description": "The type of resource. This is always mirror#timeline.", + "default": "mirror#timeline" + }, + "nextPageToken": { + "type": "string", + "description": "The next page token. Provide this as the pageToken parameter in the request to retrieve the next page of results." + } + } + }, + "UserAction": { + "id": "UserAction", + "type": "object", + "description": "Represents an action taken by the user that triggered a notification.", + "properties": { + "payload": { + "type": "string", + "description": "An optional payload for the action.\n\nFor actions of type CUSTOM, this is the ID of the custom menu item that was selected." + }, + "type": { + "type": "string", + "description": "The type of action. The value of this can be: \n- SHARE - the user shared an item. \n- REPLY - the user replied to an item. \n- REPLY_ALL - the user replied to all recipients of an item. \n- CUSTOM - the user selected a custom menu item on the timeline item. \n- DELETE - the user deleted the item. \n- PIN - the user pinned the item. \n- UNPIN - the user unpinned the item. \n- LAUNCH - the user initiated a voice command. In the future, additional types may be added. UserActions with unrecognized types should be ignored." + } + } + }, + "UserData": { + "id": "UserData", + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "resources": { + "accounts": { + "methods": { + "insert": { + "id": "mirror.accounts.insert", + "path": "accounts/{userToken}/{accountType}/{accountName}", + "httpMethod": "POST", + "description": "Inserts a new account for a user", + "parameters": { + "accountName": { + "type": "string", + "description": "The name of the account to be passed to the Android Account Manager.", + "required": true, + "location": "path" + }, + "accountType": { + "type": "string", + "description": "Account type to be passed to Android Account Manager.", + "required": true, + "location": "path" + }, + "userToken": { + "type": "string", + "description": "The ID for the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userToken", + "accountType", + "accountName" + ], + "request": { + "$ref": "Account" + }, + "response": { + "$ref": "Account" + } + } + } + }, + "contacts": { + "methods": { + "delete": { + "id": "mirror.contacts.delete", + "path": "contacts/{id}", + "httpMethod": "DELETE", + "description": "Deletes a contact.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the contact.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/glass.timeline" + ] + }, + "get": { + "id": "mirror.contacts.get", + "path": "contacts/{id}", + "httpMethod": "GET", + "description": "Gets a single contact by ID.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the contact.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Contact" + }, + "scopes": [ + "https://www.googleapis.com/auth/glass.timeline" + ] + }, + "insert": { + "id": "mirror.contacts.insert", + "path": "contacts", + "httpMethod": "POST", + "description": "Inserts a new contact.", + "request": { + "$ref": "Contact" + }, + "response": { + "$ref": "Contact" + }, + "scopes": [ + "https://www.googleapis.com/auth/glass.timeline" + ] + }, + "list": { + "id": "mirror.contacts.list", + "path": "contacts", + "httpMethod": "GET", + "description": "Retrieves a list of contacts for the authenticated user.", + "response": { + "$ref": "ContactsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/glass.timeline" + ] + }, + "patch": { + "id": "mirror.contacts.patch", + "path": "contacts/{id}", + "httpMethod": "PATCH", + "description": "Updates a contact in place. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the contact.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "Contact" + }, + "response": { + "$ref": "Contact" + }, + "scopes": [ + "https://www.googleapis.com/auth/glass.timeline" + ] + }, + "update": { + "id": "mirror.contacts.update", + "path": "contacts/{id}", + "httpMethod": "PUT", + "description": "Updates a contact in place.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the contact.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "Contact" + }, + "response": { + "$ref": "Contact" + }, + "scopes": [ + "https://www.googleapis.com/auth/glass.timeline" + ] + } + } + }, + "locations": { + "methods": { + "get": { + "id": "mirror.locations.get", + "path": "locations/{id}", + "httpMethod": "GET", + "description": "Gets a single location by ID.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the location or latest for the last known location.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Location" + }, + "scopes": [ + "https://www.googleapis.com/auth/glass.location", + "https://www.googleapis.com/auth/glass.timeline" + ] + }, + "list": { + "id": "mirror.locations.list", + "path": "locations", + "httpMethod": "GET", + "description": "Retrieves a list of locations for the user.", + "response": { + "$ref": "LocationsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/glass.location", + "https://www.googleapis.com/auth/glass.timeline" + ] + } + } + }, + "subscriptions": { + "methods": { + "delete": { + "id": "mirror.subscriptions.delete", + "path": "subscriptions/{id}", + "httpMethod": "DELETE", + "description": "Deletes a subscription.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the subscription.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/glass.timeline" + ] + }, + "insert": { + "id": "mirror.subscriptions.insert", + "path": "subscriptions", + "httpMethod": "POST", + "description": "Creates a new subscription.", + "request": { + "$ref": "Subscription" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/glass.timeline" + ] + }, + "list": { + "id": "mirror.subscriptions.list", + "path": "subscriptions", + "httpMethod": "GET", + "description": "Retrieves a list of subscriptions for the authenticated user and service.", + "response": { + "$ref": "SubscriptionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/glass.timeline" + ] + }, + "update": { + "id": "mirror.subscriptions.update", + "path": "subscriptions/{id}", + "httpMethod": "PUT", + "description": "Updates an existing subscription in place.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the subscription.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "Subscription" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/glass.timeline" + ] + } + } + }, + "timeline": { + "methods": { + "delete": { + "id": "mirror.timeline.delete", + "path": "timeline/{id}", + "httpMethod": "DELETE", + "description": "Deletes a timeline item.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the timeline item.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/glass.location", + "https://www.googleapis.com/auth/glass.timeline" + ] + }, + "get": { + "id": "mirror.timeline.get", + "path": "timeline/{id}", + "httpMethod": "GET", + "description": "Gets a single timeline item by ID.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the timeline item.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "TimelineItem" + }, + "scopes": [ + "https://www.googleapis.com/auth/glass.location", + "https://www.googleapis.com/auth/glass.timeline" + ] + }, + "insert": { + "id": "mirror.timeline.insert", + "path": "timeline", + "httpMethod": "POST", + "description": "Inserts a new item into the timeline.", + "request": { + "$ref": "TimelineItem" + }, + "response": { + "$ref": "TimelineItem" + }, + "scopes": [ + "https://www.googleapis.com/auth/glass.location", + "https://www.googleapis.com/auth/glass.timeline" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "audio/*", + "image/*", + "video/*" + ], + "maxSize": "10MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/mirror/v1/timeline" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/mirror/v1/timeline" + } + } + } + }, + "list": { + "id": "mirror.timeline.list", + "path": "timeline", + "httpMethod": "GET", + "description": "Retrieves a list of timeline items for the authenticated user.", + "parameters": { + "bundleId": { + "type": "string", + "description": "If provided, only items with the given bundleId will be returned.", + "location": "query" + }, + "includeDeleted": { + "type": "boolean", + "description": "If true, tombstone records for deleted items will be returned.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of items to include in the response, used for paging.", + "format": "uint32", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Controls the order in which timeline items are returned.", + "enum": [ + "displayTime", + "writeTime" + ], + "enumDescriptions": [ + "Results will be ordered by displayTime (default). This is the same ordering as is used in the timeline on the device.", + "Results will be ordered by the time at which they were last written to the data store." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token for the page of results to return.", + "location": "query" + }, + "pinnedOnly": { + "type": "boolean", + "description": "If true, only pinned items will be returned.", + "location": "query" + }, + "sourceItemId": { + "type": "string", + "description": "If provided, only items with the given sourceItemId will be returned.", + "location": "query" + } + }, + "response": { + "$ref": "TimelineListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/glass.location", + "https://www.googleapis.com/auth/glass.timeline" + ] + }, + "patch": { + "id": "mirror.timeline.patch", + "path": "timeline/{id}", + "httpMethod": "PATCH", + "description": "Updates a timeline item in place. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the timeline item.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "TimelineItem" + }, + "response": { + "$ref": "TimelineItem" + }, + "scopes": [ + "https://www.googleapis.com/auth/glass.location", + "https://www.googleapis.com/auth/glass.timeline" + ] + }, + "update": { + "id": "mirror.timeline.update", + "path": "timeline/{id}", + "httpMethod": "PUT", + "description": "Updates a timeline item in place.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the timeline item.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "TimelineItem" + }, + "response": { + "$ref": "TimelineItem" + }, + "scopes": [ + "https://www.googleapis.com/auth/glass.location", + "https://www.googleapis.com/auth/glass.timeline" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "audio/*", + "image/*", + "video/*" + ], + "maxSize": "10MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/mirror/v1/timeline/{id}" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/mirror/v1/timeline/{id}" + } + } + } + } + }, + "resources": { + "attachments": { + "methods": { + "delete": { + "id": "mirror.timeline.attachments.delete", + "path": "timeline/{itemId}/attachments/{attachmentId}", + "httpMethod": "DELETE", + "description": "Deletes an attachment from a timeline item.", + "parameters": { + "attachmentId": { + "type": "string", + "description": "The ID of the attachment.", + "required": true, + "location": "path" + }, + "itemId": { + "type": "string", + "description": "The ID of the timeline item the attachment belongs to.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "itemId", + "attachmentId" + ], + "scopes": [ + "https://www.googleapis.com/auth/glass.timeline" + ] + }, + "get": { + "id": "mirror.timeline.attachments.get", + "path": "timeline/{itemId}/attachments/{attachmentId}", + "httpMethod": "GET", + "description": "Retrieves an attachment on a timeline item by item ID and attachment ID.", + "parameters": { + "attachmentId": { + "type": "string", + "description": "The ID of the attachment.", + "required": true, + "location": "path" + }, + "itemId": { + "type": "string", + "description": "The ID of the timeline item the attachment belongs to.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "itemId", + "attachmentId" + ], + "response": { + "$ref": "Attachment" + }, + "scopes": [ + "https://www.googleapis.com/auth/glass.timeline" + ], + "supportsMediaDownload": true + }, + "insert": { + "id": "mirror.timeline.attachments.insert", + "path": "timeline/{itemId}/attachments", + "httpMethod": "POST", + "description": "Adds a new attachment to a timeline item.", + "parameters": { + "itemId": { + "type": "string", + "description": "The ID of the timeline item the attachment belongs to.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "itemId" + ], + "response": { + "$ref": "Attachment" + }, + "scopes": [ + "https://www.googleapis.com/auth/glass.timeline" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "audio/*", + "image/*", + "video/*" + ], + "maxSize": "10MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/mirror/v1/timeline/{itemId}/attachments" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/mirror/v1/timeline/{itemId}/attachments" + } + } + } + }, + "list": { + "id": "mirror.timeline.attachments.list", + "path": "timeline/{itemId}/attachments", + "httpMethod": "GET", + "description": "Returns a list of attachments for a timeline item.", + "parameters": { + "itemId": { + "type": "string", + "description": "The ID of the timeline item whose attachments should be listed.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "itemId" + ], + "response": { + "$ref": "AttachmentsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/glass.timeline" + ] + } + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/mirror/v1/mirror-gen.go b/third_party/src/code.google.com/p/google-api-go-client/mirror/v1/mirror-gen.go new file mode 100644 index 0000000000000..b305f016eaf86 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/mirror/v1/mirror-gen.go @@ -0,0 +1,2406 @@ +// Package mirror provides access to the Google Mirror API. +// +// See https://developers.google.com/glass +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/mirror/v1" +// ... +// mirrorService, err := mirror.New(oauthHttpClient) +package mirror + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "mirror:v1" +const apiName = "mirror" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/mirror/v1/" + +// OAuth2 scopes used by this API. +const ( + // View your location + GlassLocationScope = "https://www.googleapis.com/auth/glass.location" + + // View and manage your Glass timeline + GlassTimelineScope = "https://www.googleapis.com/auth/glass.timeline" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + s.Contacts = NewContactsService(s) + s.Locations = NewLocationsService(s) + s.Subscriptions = NewSubscriptionsService(s) + s.Timeline = NewTimelineService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Accounts *AccountsService + + Contacts *ContactsService + + Locations *LocationsService + + Subscriptions *SubscriptionsService + + Timeline *TimelineService +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + return rs +} + +type AccountsService struct { + s *Service +} + +func NewContactsService(s *Service) *ContactsService { + rs := &ContactsService{s: s} + return rs +} + +type ContactsService struct { + s *Service +} + +func NewLocationsService(s *Service) *LocationsService { + rs := &LocationsService{s: s} + return rs +} + +type LocationsService struct { + s *Service +} + +func NewSubscriptionsService(s *Service) *SubscriptionsService { + rs := &SubscriptionsService{s: s} + return rs +} + +type SubscriptionsService struct { + s *Service +} + +func NewTimelineService(s *Service) *TimelineService { + rs := &TimelineService{s: s} + rs.Attachments = NewTimelineAttachmentsService(s) + return rs +} + +type TimelineService struct { + s *Service + + Attachments *TimelineAttachmentsService +} + +func NewTimelineAttachmentsService(s *Service) *TimelineAttachmentsService { + rs := &TimelineAttachmentsService{s: s} + return rs +} + +type TimelineAttachmentsService struct { + s *Service +} + +type Account struct { + AuthTokens []*AuthToken `json:"authTokens,omitempty"` + + Features []string `json:"features,omitempty"` + + Password string `json:"password,omitempty"` + + UserData []*UserData `json:"userData,omitempty"` +} + +type Attachment struct { + // ContentType: The MIME type of the attachment. + ContentType string `json:"contentType,omitempty"` + + // ContentUrl: The URL for the content. + ContentUrl string `json:"contentUrl,omitempty"` + + // Id: The ID of the attachment. + Id string `json:"id,omitempty"` + + // IsProcessingContent: Indicates that the contentUrl is not available + // because the attachment content is still being processed. If the + // caller wishes to retrieve the content, it should try again later. + IsProcessingContent bool `json:"isProcessingContent,omitempty"` +} + +type AttachmentsListResponse struct { + // Items: The list of attachments. + Items []*Attachment `json:"items,omitempty"` + + // Kind: The type of resource. This is always mirror#attachmentsList. + Kind string `json:"kind,omitempty"` +} + +type AuthToken struct { + AuthToken string `json:"authToken,omitempty"` + + Type string `json:"type,omitempty"` +} + +type Command struct { + // Type: The type of operation this command corresponds to. Allowed + // values are: + // - TAKE_A_NOTE - Shares a timeline item with the + // transcription of user speech from the "Take a note" voice menu + // command. + // - POST_AN_UPDATE - Shares a timeline item with the + // transcription of user speech from the "Post an update" voice menu + // command. + Type string `json:"type,omitempty"` +} + +type Contact struct { + // AcceptCommands: A list of voice menu commands that a contact can + // handle. Glass shows up to three contacts for each voice menu command. + // If there are more than that, the three contacts with the highest + // priority are shown for that particular command. + AcceptCommands []*Command `json:"acceptCommands,omitempty"` + + // AcceptTypes: A list of MIME types that a contact supports. The + // contact will be shown to the user if any of its acceptTypes matches + // any of the types of the attachments on the item. If no acceptTypes + // are given, the contact will be shown for all items. + AcceptTypes []string `json:"acceptTypes,omitempty"` + + // DisplayName: The name to display for this contact. + DisplayName string `json:"displayName,omitempty"` + + // Id: An ID for this contact. This is generated by the application and + // is treated as an opaque token. + Id string `json:"id,omitempty"` + + // ImageUrls: Set of image URLs to display for a contact. Most contacts + // will have a single image, but a "group" contact may include up to 8 + // image URLs and they will be resized and cropped into a mosaic on the + // client. + ImageUrls []string `json:"imageUrls,omitempty"` + + // Kind: The type of resource. This is always mirror#contact. + Kind string `json:"kind,omitempty"` + + // PhoneNumber: Primary phone number for the contact. This can be a + // fully-qualified number, with country calling code and area code, or a + // local number. + PhoneNumber string `json:"phoneNumber,omitempty"` + + // Priority: Priority for the contact to determine ordering in a list of + // contacts. Contacts with higher priorities will be shown before ones + // with lower priorities. + Priority int64 `json:"priority,omitempty"` + + // SharingFeatures: A list of sharing features that a contact can + // handle. Allowed values are: + // - ADD_CAPTION + SharingFeatures []string `json:"sharingFeatures,omitempty"` + + // Source: The ID of the application that created this contact. This is + // populated by the API + Source string `json:"source,omitempty"` + + // SpeakableName: Name of this contact as it should be pronounced. If + // this contact's name must be spoken as part of a voice disambiguation + // menu, this name is used as the expected pronunciation. This is useful + // for contact names with unpronounceable characters or whose display + // spelling is otherwise not phonetic. + SpeakableName string `json:"speakableName,omitempty"` + + // Type: The type for this contact. This is used for sorting in UIs. + // Allowed values are: + // - INDIVIDUAL - Represents a single person. This + // is the default. + // - GROUP - Represents more than a single person. + Type string `json:"type,omitempty"` +} + +type ContactsListResponse struct { + // Items: Contact list. + Items []*Contact `json:"items,omitempty"` + + // Kind: The type of resource. This is always mirror#contacts. + Kind string `json:"kind,omitempty"` +} + +type Location struct { + // Accuracy: The accuracy of the location fix in meters. + Accuracy float64 `json:"accuracy,omitempty"` + + // Address: The full address of the location. + Address string `json:"address,omitempty"` + + // DisplayName: The name to be displayed. This may be a business name or + // a user-defined place, such as "Home". + DisplayName string `json:"displayName,omitempty"` + + // Id: The ID of the location. + Id string `json:"id,omitempty"` + + // Kind: The type of resource. This is always mirror#location. + Kind string `json:"kind,omitempty"` + + // Latitude: The latitude, in degrees. + Latitude float64 `json:"latitude,omitempty"` + + // Longitude: The longitude, in degrees. + Longitude float64 `json:"longitude,omitempty"` + + // Timestamp: The time at which this location was captured, formatted + // according to RFC 3339. + Timestamp string `json:"timestamp,omitempty"` +} + +type LocationsListResponse struct { + // Items: The list of locations. + Items []*Location `json:"items,omitempty"` + + // Kind: The type of resource. This is always mirror#locationsList. + Kind string `json:"kind,omitempty"` +} + +type MenuItem struct { + // Action: Controls the behavior when the user picks the menu option. + // Allowed values are: + // - CUSTOM - Custom action set by the service. + // When the user selects this menuItem, the API triggers a notification + // to your callbackUrl with the userActions.type set to CUSTOM and the + // userActions.payload set to the ID of this menu item. This is the + // default value. + // - Built-in actions: + // - REPLY - Initiate a reply to + // the timeline item using the voice recording UI. The creator attribute + // must be set in the timeline item for this menu to be available. + // - + // REPLY_ALL - Same behavior as REPLY. The original timeline item's + // recipients will be added to the reply item. + // - DELETE - Delete the + // timeline item. + // - SHARE - Share the timeline item with the available + // contacts. + // - READ_ALOUD - Read the timeline item's speakableText + // aloud; if this field is not set, read the text field; if none of + // those fields are set, this menu item is ignored. + // - GET_MEDIA_INPUT - + // Allow users to provide media payloads to Glassware from a menu item + // (currently, only transcribed text from voice input is supported). + // Subscribe to notifications when users invoke this menu item to + // receive the timeline item ID. Retrieve the media from the timeline + // item in the payload property. + // - VOICE_CALL - Initiate a phone call + // using the timeline item's creator.phoneNumber attribute as recipient. + // + // - NAVIGATE - Navigate to the timeline item's location. + // - + // TOGGLE_PINNED - Toggle the isPinned state of the timeline item. + // - + // OPEN_URI - Open the payload of the menu item in the browser. + // - + // PLAY_VIDEO - Open the payload of the menu item in the Glass video + // player. + // - SEND_MESSAGE - Initiate sending a message to the timeline + // item's creator: + // - If the creator.phoneNumber is set and Glass is + // connected to an Android phone, the message is an SMS. + // - Otherwise, + // if the creator.email is set, the message is an email. + Action string `json:"action,omitempty"` + + // Id: The ID for this menu item. This is generated by the application + // and is treated as an opaque token. + Id string `json:"id,omitempty"` + + // Payload: A generic payload whose meaning changes depending on this + // MenuItem's action. + // - When the action is OPEN_URI, the payload is + // the URL of the website to view. + // - When the action is PLAY_VIDEO, the + // payload is the streaming URL of the video + // - When the action is + // GET_MEDIA_INPUT, the payload is the text transcription of a user's + // speech input + Payload string `json:"payload,omitempty"` + + // RemoveWhenSelected: If set to true on a CUSTOM menu item, that item + // will be removed from the menu after it is selected. + RemoveWhenSelected bool `json:"removeWhenSelected,omitempty"` + + // Values: For CUSTOM items, a list of values controlling the appearance + // of the menu item in each of its states. A value for the DEFAULT state + // must be provided. If the PENDING or CONFIRMED states are missing, + // they will not be shown. + Values []*MenuValue `json:"values,omitempty"` +} + +type MenuValue struct { + // DisplayName: The name to display for the menu item. If you specify + // this property for a built-in menu item, the default contextual voice + // command for that menu item is not shown. + DisplayName string `json:"displayName,omitempty"` + + // IconUrl: URL of an icon to display with the menu item. + IconUrl string `json:"iconUrl,omitempty"` + + // State: The state that this value applies to. Allowed values are: + // - + // DEFAULT - Default value shown when displayed in the menuItems list. + // + // - PENDING - Value shown when the menuItem has been selected by the + // user but can still be cancelled. + // - CONFIRMED - Value shown when the + // menuItem has been selected by the user and can no longer be + // cancelled. + State string `json:"state,omitempty"` +} + +type Notification struct { + // Collection: The collection that generated the notification. + Collection string `json:"collection,omitempty"` + + // ItemId: The ID of the item that generated the notification. + ItemId string `json:"itemId,omitempty"` + + // Operation: The type of operation that generated the notification. + Operation string `json:"operation,omitempty"` + + // UserActions: A list of actions taken by the user that triggered the + // notification. + UserActions []*UserAction `json:"userActions,omitempty"` + + // UserToken: The user token provided by the service when it subscribed + // for notifications. + UserToken string `json:"userToken,omitempty"` + + // VerifyToken: The secret verify token provided by the service when it + // subscribed for notifications. + VerifyToken string `json:"verifyToken,omitempty"` +} + +type NotificationConfig struct { + // DeliveryTime: The time at which the notification should be delivered. + DeliveryTime string `json:"deliveryTime,omitempty"` + + // Level: Describes how important the notification is. Allowed values + // are: + // - DEFAULT - Notifications of default importance. A chime will + // be played to alert users. + Level string `json:"level,omitempty"` +} + +type Subscription struct { + // CallbackUrl: The URL where notifications should be delivered (must + // start with https://). + CallbackUrl string `json:"callbackUrl,omitempty"` + + // Collection: The collection to subscribe to. Allowed values are: + // - + // timeline - Changes in the timeline including insertion, deletion, and + // updates. + // - locations - Location updates. + Collection string `json:"collection,omitempty"` + + // Id: The ID of the subscription. + Id string `json:"id,omitempty"` + + // Kind: The type of resource. This is always mirror#subscription. + Kind string `json:"kind,omitempty"` + + // Notification: Container object for notifications. This is not + // populated in the Subscription resource. + Notification *Notification `json:"notification,omitempty"` + + // Operation: A list of operations that should be subscribed to. An + // empty list indicates that all operations on the collection should be + // subscribed to. Allowed values are: + // - UPDATE - The item has been + // updated. + // - INSERT - A new item has been inserted. + // - DELETE - The + // item has been deleted. + // - MENU_ACTION - A custom menu item has been + // triggered by the user. + Operation []string `json:"operation,omitempty"` + + // Updated: The time at which this subscription was last modified, + // formatted according to RFC 3339. + Updated string `json:"updated,omitempty"` + + // UserToken: An opaque token sent to the subscriber in notifications so + // that it can determine the ID of the user. + UserToken string `json:"userToken,omitempty"` + + // VerifyToken: A secret token sent to the subscriber in notifications + // so that it can verify that the notification was generated by Google. + VerifyToken string `json:"verifyToken,omitempty"` +} + +type SubscriptionsListResponse struct { + // Items: The list of subscriptions. + Items []*Subscription `json:"items,omitempty"` + + // Kind: The type of resource. This is always mirror#subscriptionsList. + Kind string `json:"kind,omitempty"` +} + +type TimelineItem struct { + // Attachments: A list of media attachments associated with this item. + // As a convenience, you can refer to attachments in your HTML payloads + // with the attachment or cid scheme. For example: + // - attachment: where attachment_index is the + // 0-based index of this array. + // - cid: + // where attachment_id is the ID of the attachment. + Attachments []*Attachment `json:"attachments,omitempty"` + + // BundleId: The bundle ID for this item. Services can specify a + // bundleId to group many items together. They appear under a single + // top-level item on the device. + BundleId string `json:"bundleId,omitempty"` + + // CanonicalUrl: A canonical URL pointing to the canonical/high quality + // version of the data represented by the timeline item. + CanonicalUrl string `json:"canonicalUrl,omitempty"` + + // Created: The time at which this item was created, formatted according + // to RFC 3339. + Created string `json:"created,omitempty"` + + // Creator: The user or group that created this item. + Creator *Contact `json:"creator,omitempty"` + + // DisplayTime: The time that should be displayed when this item is + // viewed in the timeline, formatted according to RFC 3339. This user's + // timeline is sorted chronologically on display time, so this will also + // determine where the item is displayed in the timeline. If not set by + // the service, the display time defaults to the updated time. + DisplayTime string `json:"displayTime,omitempty"` + + // Etag: ETag for this item. + Etag string `json:"etag,omitempty"` + + // Html: HTML content for this item. If both text and html are provided + // for an item, the html will be rendered in the timeline. + // Allowed HTML + // elements - You can use these elements in your timeline cards. + // + // - + // Headers: h1, h2, h3, h4, h5, h6 + // - Images: img + // - Lists: li, ol, ul + // + // - HTML5 semantics: article, aside, details, figure, figcaption, + // footer, header, nav, section, summary, time + // - Structural: + // blockquote, br, div, hr, p, span + // - Style: b, big, center, em, i, u, + // s, small, strike, strong, style, sub, sup + // - Tables: table, tbody, + // td, tfoot, th, thead, tr + // Blocked HTML elements: These elements and + // their contents are removed from HTML payloads. + // + // - Document headers: + // head, title + // - Embeds: audio, embed, object, source, video + // - Frames: + // frame, frameset + // - Scripting: applet, script + // Other elements: Any + // elements that aren't listed are removed, but their contents are + // preserved. + Html string `json:"html,omitempty"` + + // Id: The ID of the timeline item. This is unique within a user's + // timeline. + Id string `json:"id,omitempty"` + + // InReplyTo: If this item was generated as a reply to another item, + // this field will be set to the ID of the item being replied to. This + // can be used to attach a reply to the appropriate conversation or + // post. + InReplyTo string `json:"inReplyTo,omitempty"` + + // IsBundleCover: Whether this item is a bundle cover. + // + // If an item is + // marked as a bundle cover, it will be the entry point to the bundle of + // items that have the same bundleId as that item. It will be shown only + // on the main timeline — not within the opened bundle. + // + // On the main + // timeline, items that are shown are: + // - Items that have isBundleCover + // set to true + // - Items that do not have a bundleId In a bundle + // sub-timeline, items that are shown are: + // - Items that have the + // bundleId in question AND isBundleCover set to false + IsBundleCover bool `json:"isBundleCover,omitempty"` + + // IsDeleted: When true, indicates this item is deleted, and only the ID + // property is set. + IsDeleted bool `json:"isDeleted,omitempty"` + + // IsPinned: When true, indicates this item is pinned, which means it's + // grouped alongside "active" items like navigation and hangouts, on the + // opposite side of the home screen from historical (non-pinned) + // timeline items. You can allow the user to toggle the value of this + // property with the TOGGLE_PINNED built-in menu item. + IsPinned bool `json:"isPinned,omitempty"` + + // Kind: The type of resource. This is always mirror#timelineItem. + Kind string `json:"kind,omitempty"` + + // Location: The geographic location associated with this item. + Location *Location `json:"location,omitempty"` + + // MenuItems: A list of menu items that will be presented to the user + // when this item is selected in the timeline. + MenuItems []*MenuItem `json:"menuItems,omitempty"` + + // Notification: Controls how notifications for this item are presented + // on the device. If this is missing, no notification will be generated. + Notification *NotificationConfig `json:"notification,omitempty"` + + // PinScore: For pinned items, this determines the order in which the + // item is displayed in the timeline, with a higher score appearing + // closer to the clock. Note: setting this field is currently not + // supported. + PinScore int64 `json:"pinScore,omitempty"` + + // Recipients: A list of users or groups that this item has been shared + // with. + Recipients []*Contact `json:"recipients,omitempty"` + + // SelfLink: A URL that can be used to retrieve this item. + SelfLink string `json:"selfLink,omitempty"` + + // SourceItemId: Opaque string you can use to map a timeline item to + // data in your own service. + SourceItemId string `json:"sourceItemId,omitempty"` + + // SpeakableText: The speakable version of the content of this item. + // Along with the READ_ALOUD menu item, use this field to provide text + // that would be clearer when read aloud, or to provide extended + // information to what is displayed visually on Glass. + // + // Glassware should + // also specify the speakableType field, which will be spoken before + // this text in cases where the additional context is useful, for + // example when the user requests that the item be read aloud following + // a notification. + SpeakableText string `json:"speakableText,omitempty"` + + // SpeakableType: A speakable description of the type of this item. This + // will be announced to the user prior to reading the content of the + // item in cases where the additional context is useful, for example + // when the user requests that the item be read aloud following a + // notification. + // + // This should be a short, simple noun phrase such as + // "Email", "Text message", or "Daily Planet News Update". + // + // Glassware + // are encouraged to populate this field for every timeline item, even + // if the item does not contain speakableText or text so that the user + // can learn the type of the item without looking at the screen. + SpeakableType string `json:"speakableType,omitempty"` + + // Text: Text content of this item. + Text string `json:"text,omitempty"` + + // Title: The title of this item. + Title string `json:"title,omitempty"` + + // Updated: The time at which this item was last modified, formatted + // according to RFC 3339. + Updated string `json:"updated,omitempty"` +} + +type TimelineListResponse struct { + // Items: Items in the timeline. + Items []*TimelineItem `json:"items,omitempty"` + + // Kind: The type of resource. This is always mirror#timeline. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The next page token. Provide this as the pageToken + // parameter in the request to retrieve the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type UserAction struct { + // Payload: An optional payload for the action. + // + // For actions of type + // CUSTOM, this is the ID of the custom menu item that was selected. + Payload string `json:"payload,omitempty"` + + // Type: The type of action. The value of this can be: + // - SHARE - the + // user shared an item. + // - REPLY - the user replied to an item. + // - + // REPLY_ALL - the user replied to all recipients of an item. + // - CUSTOM + // - the user selected a custom menu item on the timeline item. + // - + // DELETE - the user deleted the item. + // - PIN - the user pinned the + // item. + // - UNPIN - the user unpinned the item. + // - LAUNCH - the user + // initiated a voice command. In the future, additional types may be + // added. UserActions with unrecognized types should be ignored. + Type string `json:"type,omitempty"` +} + +type UserData struct { + Key string `json:"key,omitempty"` + + Value string `json:"value,omitempty"` +} + +// method id "mirror.accounts.insert": + +type AccountsInsertCall struct { + s *Service + userToken string + accountType string + accountName string + account *Account + opt_ map[string]interface{} +} + +// Insert: Inserts a new account for a user +func (r *AccountsService) Insert(userToken string, accountType string, accountName string, account *Account) *AccountsInsertCall { + c := &AccountsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.userToken = userToken + c.accountType = accountType + c.accountName = accountName + c.account = account + return c +} + +func (c *AccountsInsertCall) Do() (*Account, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{userToken}/{accountType}/{accountName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userToken}", url.QueryEscape(c.userToken), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{accountType}", url.QueryEscape(c.accountType), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{accountName}", url.QueryEscape(c.accountName), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Account) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new account for a user", + // "httpMethod": "POST", + // "id": "mirror.accounts.insert", + // "parameterOrder": [ + // "userToken", + // "accountType", + // "accountName" + // ], + // "parameters": { + // "accountName": { + // "description": "The name of the account to be passed to the Android Account Manager.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "accountType": { + // "description": "Account type to be passed to Android Account Manager.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userToken": { + // "description": "The ID for the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{userToken}/{accountType}/{accountName}", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // } + // } + +} + +// method id "mirror.contacts.delete": + +type ContactsDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Delete: Deletes a contact. +func (r *ContactsService) Delete(id string) *ContactsDeleteCall { + c := &ContactsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *ContactsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a contact.", + // "httpMethod": "DELETE", + // "id": "mirror.contacts.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the contact.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "contacts/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} + +// method id "mirror.contacts.get": + +type ContactsGetCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Get: Gets a single contact by ID. +func (r *ContactsService) Get(id string) *ContactsGetCall { + c := &ContactsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *ContactsGetCall) Do() (*Contact, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Contact) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a single contact by ID.", + // "httpMethod": "GET", + // "id": "mirror.contacts.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the contact.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "contacts/{id}", + // "response": { + // "$ref": "Contact" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} + +// method id "mirror.contacts.insert": + +type ContactsInsertCall struct { + s *Service + contact *Contact + opt_ map[string]interface{} +} + +// Insert: Inserts a new contact. +func (r *ContactsService) Insert(contact *Contact) *ContactsInsertCall { + c := &ContactsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.contact = contact + return c +} + +func (c *ContactsInsertCall) Do() (*Contact, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.contact) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "contacts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Contact) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new contact.", + // "httpMethod": "POST", + // "id": "mirror.contacts.insert", + // "path": "contacts", + // "request": { + // "$ref": "Contact" + // }, + // "response": { + // "$ref": "Contact" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} + +// method id "mirror.contacts.list": + +type ContactsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves a list of contacts for the authenticated user. +func (r *ContactsService) List() *ContactsListCall { + c := &ContactsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *ContactsListCall) Do() (*ContactsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "contacts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ContactsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of contacts for the authenticated user.", + // "httpMethod": "GET", + // "id": "mirror.contacts.list", + // "path": "contacts", + // "response": { + // "$ref": "ContactsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} + +// method id "mirror.contacts.patch": + +type ContactsPatchCall struct { + s *Service + id string + contact *Contact + opt_ map[string]interface{} +} + +// Patch: Updates a contact in place. This method supports patch +// semantics. +func (r *ContactsService) Patch(id string, contact *Contact) *ContactsPatchCall { + c := &ContactsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.contact = contact + return c +} + +func (c *ContactsPatchCall) Do() (*Contact, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.contact) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Contact) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a contact in place. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "mirror.contacts.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the contact.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "contacts/{id}", + // "request": { + // "$ref": "Contact" + // }, + // "response": { + // "$ref": "Contact" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} + +// method id "mirror.contacts.update": + +type ContactsUpdateCall struct { + s *Service + id string + contact *Contact + opt_ map[string]interface{} +} + +// Update: Updates a contact in place. +func (r *ContactsService) Update(id string, contact *Contact) *ContactsUpdateCall { + c := &ContactsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.contact = contact + return c +} + +func (c *ContactsUpdateCall) Do() (*Contact, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.contact) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Contact) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a contact in place.", + // "httpMethod": "PUT", + // "id": "mirror.contacts.update", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the contact.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "contacts/{id}", + // "request": { + // "$ref": "Contact" + // }, + // "response": { + // "$ref": "Contact" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} + +// method id "mirror.locations.get": + +type LocationsGetCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Get: Gets a single location by ID. +func (r *LocationsService) Get(id string) *LocationsGetCall { + c := &LocationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *LocationsGetCall) Do() (*Location, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "locations/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Location) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a single location by ID.", + // "httpMethod": "GET", + // "id": "mirror.locations.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the location or latest for the last known location.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "locations/{id}", + // "response": { + // "$ref": "Location" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.location", + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} + +// method id "mirror.locations.list": + +type LocationsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves a list of locations for the user. +func (r *LocationsService) List() *LocationsListCall { + c := &LocationsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *LocationsListCall) Do() (*LocationsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "locations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(LocationsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of locations for the user.", + // "httpMethod": "GET", + // "id": "mirror.locations.list", + // "path": "locations", + // "response": { + // "$ref": "LocationsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.location", + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} + +// method id "mirror.subscriptions.delete": + +type SubscriptionsDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Delete: Deletes a subscription. +func (r *SubscriptionsService) Delete(id string) *SubscriptionsDeleteCall { + c := &SubscriptionsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *SubscriptionsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a subscription.", + // "httpMethod": "DELETE", + // "id": "mirror.subscriptions.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the subscription.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "subscriptions/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} + +// method id "mirror.subscriptions.insert": + +type SubscriptionsInsertCall struct { + s *Service + subscription *Subscription + opt_ map[string]interface{} +} + +// Insert: Creates a new subscription. +func (r *SubscriptionsService) Insert(subscription *Subscription) *SubscriptionsInsertCall { + c := &SubscriptionsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + return c +} + +func (c *SubscriptionsInsertCall) Do() (*Subscription, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Subscription) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new subscription.", + // "httpMethod": "POST", + // "id": "mirror.subscriptions.insert", + // "path": "subscriptions", + // "request": { + // "$ref": "Subscription" + // }, + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} + +// method id "mirror.subscriptions.list": + +type SubscriptionsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves a list of subscriptions for the authenticated user +// and service. +func (r *SubscriptionsService) List() *SubscriptionsListCall { + c := &SubscriptionsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *SubscriptionsListCall) Do() (*SubscriptionsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SubscriptionsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of subscriptions for the authenticated user and service.", + // "httpMethod": "GET", + // "id": "mirror.subscriptions.list", + // "path": "subscriptions", + // "response": { + // "$ref": "SubscriptionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} + +// method id "mirror.subscriptions.update": + +type SubscriptionsUpdateCall struct { + s *Service + id string + subscription *Subscription + opt_ map[string]interface{} +} + +// Update: Updates an existing subscription in place. +func (r *SubscriptionsService) Update(id string, subscription *Subscription) *SubscriptionsUpdateCall { + c := &SubscriptionsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.subscription = subscription + return c +} + +func (c *SubscriptionsUpdateCall) Do() (*Subscription, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Subscription) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing subscription in place.", + // "httpMethod": "PUT", + // "id": "mirror.subscriptions.update", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the subscription.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "subscriptions/{id}", + // "request": { + // "$ref": "Subscription" + // }, + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} + +// method id "mirror.timeline.delete": + +type TimelineDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Delete: Deletes a timeline item. +func (r *TimelineService) Delete(id string) *TimelineDeleteCall { + c := &TimelineDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *TimelineDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a timeline item.", + // "httpMethod": "DELETE", + // "id": "mirror.timeline.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the timeline item.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "timeline/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/glass.location", + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} + +// method id "mirror.timeline.get": + +type TimelineGetCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Get: Gets a single timeline item by ID. +func (r *TimelineService) Get(id string) *TimelineGetCall { + c := &TimelineGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *TimelineGetCall) Do() (*TimelineItem, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TimelineItem) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a single timeline item by ID.", + // "httpMethod": "GET", + // "id": "mirror.timeline.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the timeline item.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "timeline/{id}", + // "response": { + // "$ref": "TimelineItem" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.location", + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} + +// method id "mirror.timeline.insert": + +type TimelineInsertCall struct { + s *Service + timelineitem *TimelineItem + opt_ map[string]interface{} + media_ io.Reader +} + +// Insert: Inserts a new item into the timeline. +func (r *TimelineService) Insert(timelineitem *TimelineItem) *TimelineInsertCall { + c := &TimelineInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.timelineitem = timelineitem + return c +} +func (c *TimelineInsertCall) Media(r io.Reader) *TimelineInsertCall { + c.media_ = r + return c +} + +func (c *TimelineInsertCall) Do() (*TimelineItem, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.timelineitem) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TimelineItem) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new item into the timeline.", + // "httpMethod": "POST", + // "id": "mirror.timeline.insert", + // "mediaUpload": { + // "accept": [ + // "audio/*", + // "image/*", + // "video/*" + // ], + // "maxSize": "10MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/mirror/v1/timeline" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/mirror/v1/timeline" + // } + // } + // }, + // "path": "timeline", + // "request": { + // "$ref": "TimelineItem" + // }, + // "response": { + // "$ref": "TimelineItem" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.location", + // "https://www.googleapis.com/auth/glass.timeline" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "mirror.timeline.list": + +type TimelineListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves a list of timeline items for the authenticated user. +func (r *TimelineService) List() *TimelineListCall { + c := &TimelineListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// BundleId sets the optional parameter "bundleId": If provided, only +// items with the given bundleId will be returned. +func (c *TimelineListCall) BundleId(bundleId string) *TimelineListCall { + c.opt_["bundleId"] = bundleId + return c +} + +// IncludeDeleted sets the optional parameter "includeDeleted": If true, +// tombstone records for deleted items will be returned. +func (c *TimelineListCall) IncludeDeleted(includeDeleted bool) *TimelineListCall { + c.opt_["includeDeleted"] = includeDeleted + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of items to include in the response, used for paging. +func (c *TimelineListCall) MaxResults(maxResults int64) *TimelineListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Controls the order in +// which timeline items are returned. +func (c *TimelineListCall) OrderBy(orderBy string) *TimelineListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Token for the page +// of results to return. +func (c *TimelineListCall) PageToken(pageToken string) *TimelineListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PinnedOnly sets the optional parameter "pinnedOnly": If true, only +// pinned items will be returned. +func (c *TimelineListCall) PinnedOnly(pinnedOnly bool) *TimelineListCall { + c.opt_["pinnedOnly"] = pinnedOnly + return c +} + +// SourceItemId sets the optional parameter "sourceItemId": If provided, +// only items with the given sourceItemId will be returned. +func (c *TimelineListCall) SourceItemId(sourceItemId string) *TimelineListCall { + c.opt_["sourceItemId"] = sourceItemId + return c +} + +func (c *TimelineListCall) Do() (*TimelineListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["bundleId"]; ok { + params.Set("bundleId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["includeDeleted"]; ok { + params.Set("includeDeleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pinnedOnly"]; ok { + params.Set("pinnedOnly", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sourceItemId"]; ok { + params.Set("sourceItemId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TimelineListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of timeline items for the authenticated user.", + // "httpMethod": "GET", + // "id": "mirror.timeline.list", + // "parameters": { + // "bundleId": { + // "description": "If provided, only items with the given bundleId will be returned.", + // "location": "query", + // "type": "string" + // }, + // "includeDeleted": { + // "description": "If true, tombstone records for deleted items will be returned.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of items to include in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Controls the order in which timeline items are returned.", + // "enum": [ + // "displayTime", + // "writeTime" + // ], + // "enumDescriptions": [ + // "Results will be ordered by displayTime (default). This is the same ordering as is used in the timeline on the device.", + // "Results will be ordered by the time at which they were last written to the data store." + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Token for the page of results to return.", + // "location": "query", + // "type": "string" + // }, + // "pinnedOnly": { + // "description": "If true, only pinned items will be returned.", + // "location": "query", + // "type": "boolean" + // }, + // "sourceItemId": { + // "description": "If provided, only items with the given sourceItemId will be returned.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "timeline", + // "response": { + // "$ref": "TimelineListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.location", + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} + +// method id "mirror.timeline.patch": + +type TimelinePatchCall struct { + s *Service + id string + timelineitem *TimelineItem + opt_ map[string]interface{} +} + +// Patch: Updates a timeline item in place. This method supports patch +// semantics. +func (r *TimelineService) Patch(id string, timelineitem *TimelineItem) *TimelinePatchCall { + c := &TimelinePatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.timelineitem = timelineitem + return c +} + +func (c *TimelinePatchCall) Do() (*TimelineItem, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.timelineitem) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TimelineItem) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a timeline item in place. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "mirror.timeline.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the timeline item.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "timeline/{id}", + // "request": { + // "$ref": "TimelineItem" + // }, + // "response": { + // "$ref": "TimelineItem" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.location", + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} + +// method id "mirror.timeline.update": + +type TimelineUpdateCall struct { + s *Service + id string + timelineitem *TimelineItem + opt_ map[string]interface{} + media_ io.Reader +} + +// Update: Updates a timeline item in place. +func (r *TimelineService) Update(id string, timelineitem *TimelineItem) *TimelineUpdateCall { + c := &TimelineUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.timelineitem = timelineitem + return c +} +func (c *TimelineUpdateCall) Media(r io.Reader) *TimelineUpdateCall { + c.media_ = r + return c +} + +func (c *TimelineUpdateCall) Do() (*TimelineItem, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.timelineitem) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TimelineItem) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a timeline item in place.", + // "httpMethod": "PUT", + // "id": "mirror.timeline.update", + // "mediaUpload": { + // "accept": [ + // "audio/*", + // "image/*", + // "video/*" + // ], + // "maxSize": "10MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/mirror/v1/timeline/{id}" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/mirror/v1/timeline/{id}" + // } + // } + // }, + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the timeline item.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "timeline/{id}", + // "request": { + // "$ref": "TimelineItem" + // }, + // "response": { + // "$ref": "TimelineItem" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.location", + // "https://www.googleapis.com/auth/glass.timeline" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "mirror.timeline.attachments.delete": + +type TimelineAttachmentsDeleteCall struct { + s *Service + itemId string + attachmentId string + opt_ map[string]interface{} +} + +// Delete: Deletes an attachment from a timeline item. +func (r *TimelineAttachmentsService) Delete(itemId string, attachmentId string) *TimelineAttachmentsDeleteCall { + c := &TimelineAttachmentsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.itemId = itemId + c.attachmentId = attachmentId + return c +} + +func (c *TimelineAttachmentsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments/{attachmentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{itemId}", url.QueryEscape(c.itemId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{attachmentId}", url.QueryEscape(c.attachmentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an attachment from a timeline item.", + // "httpMethod": "DELETE", + // "id": "mirror.timeline.attachments.delete", + // "parameterOrder": [ + // "itemId", + // "attachmentId" + // ], + // "parameters": { + // "attachmentId": { + // "description": "The ID of the attachment.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "itemId": { + // "description": "The ID of the timeline item the attachment belongs to.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "timeline/{itemId}/attachments/{attachmentId}", + // "scopes": [ + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} + +// method id "mirror.timeline.attachments.get": + +type TimelineAttachmentsGetCall struct { + s *Service + itemId string + attachmentId string + opt_ map[string]interface{} +} + +// Get: Retrieves an attachment on a timeline item by item ID and +// attachment ID. +func (r *TimelineAttachmentsService) Get(itemId string, attachmentId string) *TimelineAttachmentsGetCall { + c := &TimelineAttachmentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.itemId = itemId + c.attachmentId = attachmentId + return c +} + +func (c *TimelineAttachmentsGetCall) Do() (*Attachment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments/{attachmentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{itemId}", url.QueryEscape(c.itemId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{attachmentId}", url.QueryEscape(c.attachmentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Attachment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves an attachment on a timeline item by item ID and attachment ID.", + // "httpMethod": "GET", + // "id": "mirror.timeline.attachments.get", + // "parameterOrder": [ + // "itemId", + // "attachmentId" + // ], + // "parameters": { + // "attachmentId": { + // "description": "The ID of the attachment.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "itemId": { + // "description": "The ID of the timeline item the attachment belongs to.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "timeline/{itemId}/attachments/{attachmentId}", + // "response": { + // "$ref": "Attachment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.timeline" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "mirror.timeline.attachments.insert": + +type TimelineAttachmentsInsertCall struct { + s *Service + itemId string + opt_ map[string]interface{} + media_ io.Reader +} + +// Insert: Adds a new attachment to a timeline item. +func (r *TimelineAttachmentsService) Insert(itemId string) *TimelineAttachmentsInsertCall { + c := &TimelineAttachmentsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.itemId = itemId + return c +} +func (c *TimelineAttachmentsInsertCall) Media(r io.Reader) *TimelineAttachmentsInsertCall { + c.media_ = r + return c +} + +func (c *TimelineAttachmentsInsertCall) Do() (*Attachment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{itemId}", url.QueryEscape(c.itemId), 1) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Attachment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a new attachment to a timeline item.", + // "httpMethod": "POST", + // "id": "mirror.timeline.attachments.insert", + // "mediaUpload": { + // "accept": [ + // "audio/*", + // "image/*", + // "video/*" + // ], + // "maxSize": "10MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/mirror/v1/timeline/{itemId}/attachments" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/mirror/v1/timeline/{itemId}/attachments" + // } + // } + // }, + // "parameterOrder": [ + // "itemId" + // ], + // "parameters": { + // "itemId": { + // "description": "The ID of the timeline item the attachment belongs to.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "timeline/{itemId}/attachments", + // "response": { + // "$ref": "Attachment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.timeline" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "mirror.timeline.attachments.list": + +type TimelineAttachmentsListCall struct { + s *Service + itemId string + opt_ map[string]interface{} +} + +// List: Returns a list of attachments for a timeline item. +func (r *TimelineAttachmentsService) List(itemId string) *TimelineAttachmentsListCall { + c := &TimelineAttachmentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.itemId = itemId + return c +} + +func (c *TimelineAttachmentsListCall) Do() (*AttachmentsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{itemId}", url.QueryEscape(c.itemId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AttachmentsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of attachments for a timeline item.", + // "httpMethod": "GET", + // "id": "mirror.timeline.attachments.list", + // "parameterOrder": [ + // "itemId" + // ], + // "parameters": { + // "itemId": { + // "description": "The ID of the timeline item whose attachments should be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "timeline/{itemId}/attachments", + // "response": { + // "$ref": "AttachmentsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/moderator/v1/moderator-api.json b/third_party/src/code.google.com/p/google-api-go-client/moderator/v1/moderator-api.json new file mode 100644 index 0000000000000..2becaf0531581 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/moderator/v1/moderator-api.json @@ -0,0 +1,1769 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"a3GBuXuTtUYW9BV1SIieU5LiL7w/0W9ODbl6hqMnzt7N9_K7ILXgS_I\"", + "discoveryVersion": "v1", + "id": "moderator:v1", + "name": "moderator", + "version": "v1", + "revision": "19700115", + "title": "Moderator API", + "description": "Moderator API", + "icons": { + "x16": "http://www.google.com/images/icons/product/moderator-32.png", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "http://code.google.com/apis/moderator/v1/using_rest.html", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/moderator/v1/", + "basePath": "/moderator/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "moderator/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": "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/moderator": { + "description": "Manage your activity in Google Moderator" + } + } + } + }, + "features": [ + "dataWrapper" + ], + "schemas": { + "ModeratorTopicsResourcePartial": { + "id": "ModeratorTopicsResourcePartial", + "type": "object", + "properties": { + "id": { + "type": "object", + "properties": { + "seriesId": { + "type": "string", + "format": "int64" + }, + "topicId": { + "type": "string", + "format": "int64" + } + } + } + } + }, + "ModeratorVotesResourcePartial": { + "id": "ModeratorVotesResourcePartial", + "type": "object", + "properties": { + "flag": { + "type": "string" + }, + "vote": { + "type": "string" + } + } + }, + "Profile": { + "id": "Profile", + "type": "object", + "properties": { + "attribution": { + "type": "object", + "properties": { + "avatarUrl": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "geo": { + "type": "object", + "properties": { + "latitude": { + "type": "number", + "format": "double" + }, + "location": { + "type": "string" + }, + "longitude": { + "type": "number", + "format": "double" + } + } + }, + "location": { + "type": "string" + } + } + }, + "id": { + "type": "object", + "properties": { + "user": { + "type": "string" + } + } + }, + "kind": { + "type": "string", + "default": "moderator#profile" + } + } + }, + "Series": { + "id": "Series", + "type": "object", + "properties": { + "anonymousSubmissionAllowed": { + "type": "boolean" + }, + "counters": { + "type": "object", + "properties": { + "anonymousSubmissions": { + "type": "integer", + "format": "int32" + }, + "minusVotes": { + "type": "integer", + "format": "int32" + }, + "noneVotes": { + "type": "integer", + "format": "int32" + }, + "plusVotes": { + "type": "integer", + "format": "int32" + }, + "submissions": { + "type": "integer", + "format": "int32" + }, + "users": { + "type": "integer", + "format": "int32" + }, + "videoSubmissions": { + "type": "integer", + "format": "int32" + } + } + }, + "description": { + "type": "string" + }, + "id": { + "type": "object", + "properties": { + "seriesId": { + "type": "string", + "format": "int64" + } + } + }, + "kind": { + "type": "string", + "default": "moderator#series" + }, + "name": { + "type": "string" + }, + "numTopics": { + "type": "integer", + "format": "int32" + }, + "rules": { + "type": "object", + "properties": { + "submissions": { + "type": "object", + "properties": { + "close": { + "type": "string", + "format": "uint64" + }, + "open": { + "type": "string", + "format": "uint64" + } + } + }, + "votes": { + "type": "object", + "properties": { + "close": { + "type": "string", + "format": "uint64" + }, + "open": { + "type": "string", + "format": "uint64" + } + } + } + } + }, + "unauthSubmissionAllowed": { + "type": "boolean" + }, + "unauthVotingAllowed": { + "type": "boolean" + }, + "videoSubmissionAllowed": { + "type": "boolean" + } + } + }, + "SeriesList": { + "id": "SeriesList", + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "Series" + } + }, + "kind": { + "type": "string", + "default": "moderator#seriesList" + } + } + }, + "Submission": { + "id": "Submission", + "type": "object", + "properties": { + "attachmentUrl": { + "type": "string" + }, + "attribution": { + "type": "object", + "properties": { + "avatarUrl": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "location": { + "type": "string" + } + } + }, + "author": { + "type": "string" + }, + "counters": { + "type": "object", + "properties": { + "minusVotes": { + "type": "integer", + "format": "int32" + }, + "noneVotes": { + "type": "integer", + "format": "int32" + }, + "plusVotes": { + "type": "integer", + "format": "int32" + } + } + }, + "created": { + "type": "string", + "format": "uint64" + }, + "geo": { + "type": "object", + "properties": { + "latitude": { + "type": "number", + "format": "double" + }, + "location": { + "type": "string" + }, + "longitude": { + "type": "number", + "format": "double" + } + } + }, + "id": { + "type": "object", + "properties": { + "seriesId": { + "type": "string", + "format": "int64" + }, + "submissionId": { + "type": "string", + "format": "int64" + } + } + }, + "kind": { + "type": "string", + "default": "moderator#submission" + }, + "parentSubmissionId": { + "type": "object", + "properties": { + "seriesId": { + "type": "string", + "format": "int64" + }, + "submissionId": { + "type": "string", + "format": "int64" + } + } + }, + "text": { + "type": "string" + }, + "topics": { + "type": "array", + "items": { + "$ref": "ModeratorTopicsResourcePartial" + } + }, + "translations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "lang": { + "type": "string" + }, + "text": { + "type": "string" + } + } + } + }, + "vote": { + "$ref": "ModeratorVotesResourcePartial" + } + } + }, + "SubmissionList": { + "id": "SubmissionList", + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "Submission" + } + }, + "kind": { + "type": "string", + "default": "moderator#submissionList" + } + } + }, + "Tag": { + "id": "Tag", + "type": "object", + "properties": { + "id": { + "type": "object", + "properties": { + "seriesId": { + "type": "string", + "format": "int64" + }, + "submissionId": { + "type": "string", + "format": "int64" + }, + "tagId": { + "type": "string" + } + } + }, + "kind": { + "type": "string", + "default": "moderator#tag" + }, + "text": { + "type": "string" + } + } + }, + "TagList": { + "id": "TagList", + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "Tag" + } + }, + "kind": { + "type": "string", + "default": "moderator#tagList" + } + } + }, + "Topic": { + "id": "Topic", + "type": "object", + "properties": { + "counters": { + "type": "object", + "properties": { + "minusVotes": { + "type": "integer", + "format": "int32" + }, + "noneVotes": { + "type": "integer", + "format": "int32" + }, + "plusVotes": { + "type": "integer", + "format": "int32" + }, + "submissions": { + "type": "integer", + "format": "int32" + }, + "users": { + "type": "integer", + "format": "int32" + }, + "videoSubmissions": { + "type": "integer", + "format": "int32" + } + } + }, + "description": { + "type": "string" + }, + "featuredSubmission": { + "$ref": "Submission" + }, + "id": { + "type": "object", + "properties": { + "seriesId": { + "type": "string", + "format": "int64" + }, + "topicId": { + "type": "string", + "format": "int64" + } + } + }, + "kind": { + "type": "string", + "default": "moderator#topic" + }, + "name": { + "type": "string" + }, + "presenter": { + "type": "string" + }, + "rules": { + "type": "object", + "properties": { + "submissions": { + "type": "object", + "properties": { + "close": { + "type": "string", + "format": "uint64" + }, + "open": { + "type": "string", + "format": "uint64" + } + } + }, + "votes": { + "type": "object", + "properties": { + "close": { + "type": "string", + "format": "uint64" + }, + "open": { + "type": "string", + "format": "uint64" + } + } + } + } + } + } + }, + "TopicList": { + "id": "TopicList", + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "Topic" + } + }, + "kind": { + "type": "string", + "default": "moderator#topicList" + } + } + }, + "Vote": { + "id": "Vote", + "type": "object", + "properties": { + "flag": { + "type": "string" + }, + "id": { + "type": "object", + "properties": { + "seriesId": { + "type": "string", + "format": "int64" + }, + "submissionId": { + "type": "string", + "format": "int64" + } + } + }, + "kind": { + "type": "string", + "default": "moderator#vote" + }, + "vote": { + "type": "string" + } + } + }, + "VoteList": { + "id": "VoteList", + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "Vote" + } + }, + "kind": { + "type": "string", + "default": "moderator#voteList" + } + } + } + }, + "resources": { + "featured": { + "resources": { + "series": { + "methods": { + "list": { + "id": "moderator.featured.series.list", + "path": "series/featured", + "httpMethod": "GET", + "description": "Lists the featured series.", + "response": { + "$ref": "SeriesList" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + } + } + } + } + }, + "global": { + "resources": { + "series": { + "methods": { + "list": { + "id": "moderator.global.series.list", + "path": "search", + "httpMethod": "GET", + "description": "Searches the public series and returns the search results.", + "parameters": { + "max-results": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "uint32", + "location": "query" + }, + "q": { + "type": "string", + "description": "Search query.", + "location": "query" + }, + "start-index": { + "type": "integer", + "description": "Index of the first result to be retrieved.", + "format": "uint32", + "location": "query" + } + }, + "response": { + "$ref": "SeriesList" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + } + } + } + } + }, + "my": { + "resources": { + "series": { + "methods": { + "list": { + "id": "moderator.my.series.list", + "path": "series/@me/mine", + "httpMethod": "GET", + "description": "Lists all series created by the authenticated user.", + "response": { + "$ref": "SeriesList" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + } + } + } + } + }, + "myrecent": { + "resources": { + "series": { + "methods": { + "list": { + "id": "moderator.myrecent.series.list", + "path": "series/@me/recent", + "httpMethod": "GET", + "description": "Lists the series the authenticated user has visited.", + "response": { + "$ref": "SeriesList" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + } + } + } + } + }, + "profiles": { + "methods": { + "get": { + "id": "moderator.profiles.get", + "path": "profiles/@me", + "httpMethod": "GET", + "description": "Returns the profile information for the authenticated user.", + "response": { + "$ref": "Profile" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + }, + "patch": { + "id": "moderator.profiles.patch", + "path": "profiles/@me", + "httpMethod": "PATCH", + "description": "Updates the profile information for the authenticated user. This method supports patch semantics.", + "request": { + "$ref": "Profile" + }, + "response": { + "$ref": "Profile" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + }, + "update": { + "id": "moderator.profiles.update", + "path": "profiles/@me", + "httpMethod": "PUT", + "description": "Updates the profile information for the authenticated user.", + "request": { + "$ref": "Profile" + }, + "response": { + "$ref": "Profile" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + } + } + }, + "responses": { + "methods": { + "insert": { + "id": "moderator.responses.insert", + "path": "series/{seriesId}/topics/{topicId}/submissions/{parentSubmissionId}/responses", + "httpMethod": "POST", + "description": "Inserts a response for the specified submission in the specified topic within the specified series.", + "parameters": { + "anonymous": { + "type": "boolean", + "description": "Set to true to mark the new submission as anonymous.", + "location": "query" + }, + "parentSubmissionId": { + "type": "integer", + "description": "The decimal ID of the parent Submission within the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "topicId": { + "type": "integer", + "description": "The decimal ID of the Topic within the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "unauthToken": { + "type": "string", + "description": "User identifier for unauthenticated usage mode", + "location": "query" + } + }, + "parameterOrder": [ + "seriesId", + "topicId", + "parentSubmissionId" + ], + "request": { + "$ref": "Submission" + }, + "response": { + "$ref": "Submission" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + }, + "list": { + "id": "moderator.responses.list", + "path": "series/{seriesId}/submissions/{submissionId}/responses", + "httpMethod": "GET", + "description": "Lists or searches the responses for the specified submission within the specified series and returns the search results.", + "parameters": { + "author": { + "type": "string", + "description": "Restricts the results to submissions by a specific author.", + "location": "query" + }, + "hasAttachedVideo": { + "type": "boolean", + "description": "Specifies whether to restrict to submissions that have videos attached.", + "location": "query" + }, + "max-results": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "uint32", + "location": "query" + }, + "q": { + "type": "string", + "description": "Search query.", + "location": "query" + }, + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "sort": { + "type": "string", + "description": "Sort order.", + "location": "query" + }, + "start-index": { + "type": "integer", + "description": "Index of the first result to be retrieved.", + "format": "uint32", + "location": "query" + }, + "submissionId": { + "type": "integer", + "description": "The decimal ID of the Submission within the Series.", + "required": true, + "format": "uint32", + "location": "path" + } + }, + "parameterOrder": [ + "seriesId", + "submissionId" + ], + "response": { + "$ref": "SubmissionList" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + } + } + }, + "series": { + "methods": { + "get": { + "id": "moderator.series.get", + "path": "series/{seriesId}", + "httpMethod": "GET", + "description": "Returns the specified series.", + "parameters": { + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + } + }, + "parameterOrder": [ + "seriesId" + ], + "response": { + "$ref": "Series" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + }, + "insert": { + "id": "moderator.series.insert", + "path": "series", + "httpMethod": "POST", + "description": "Inserts a new series.", + "request": { + "$ref": "Series" + }, + "response": { + "$ref": "Series" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + }, + "list": { + "id": "moderator.series.list", + "path": "series", + "httpMethod": "GET", + "description": "Searches the series and returns the search results.", + "parameters": { + "max-results": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "uint32", + "location": "query" + }, + "q": { + "type": "string", + "description": "Search query.", + "location": "query" + }, + "start-index": { + "type": "integer", + "description": "Index of the first result to be retrieved.", + "format": "uint32", + "location": "query" + } + }, + "response": { + "$ref": "SeriesList" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + }, + "patch": { + "id": "moderator.series.patch", + "path": "series/{seriesId}", + "httpMethod": "PATCH", + "description": "Updates the specified series. This method supports patch semantics.", + "parameters": { + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + } + }, + "parameterOrder": [ + "seriesId" + ], + "request": { + "$ref": "Series" + }, + "response": { + "$ref": "Series" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + }, + "update": { + "id": "moderator.series.update", + "path": "series/{seriesId}", + "httpMethod": "PUT", + "description": "Updates the specified series.", + "parameters": { + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + } + }, + "parameterOrder": [ + "seriesId" + ], + "request": { + "$ref": "Series" + }, + "response": { + "$ref": "Series" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + } + }, + "resources": { + "responses": { + "methods": { + "list": { + "id": "moderator.series.responses.list", + "path": "series/{seriesId}/responses", + "httpMethod": "GET", + "description": "Searches the responses for the specified series and returns the search results.", + "parameters": { + "author": { + "type": "string", + "description": "Restricts the results to submissions by a specific author.", + "location": "query" + }, + "hasAttachedVideo": { + "type": "boolean", + "description": "Specifies whether to restrict to submissions that have videos attached.", + "location": "query" + }, + "max-results": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "uint32", + "location": "query" + }, + "q": { + "type": "string", + "description": "Search query.", + "location": "query" + }, + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "sort": { + "type": "string", + "description": "Sort order.", + "location": "query" + }, + "start-index": { + "type": "integer", + "description": "Index of the first result to be retrieved.", + "format": "uint32", + "location": "query" + } + }, + "parameterOrder": [ + "seriesId" + ], + "response": { + "$ref": "SeriesList" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + } + } + }, + "submissions": { + "methods": { + "list": { + "id": "moderator.series.submissions.list", + "path": "series/{seriesId}/submissions", + "httpMethod": "GET", + "description": "Searches the submissions for the specified series and returns the search results.", + "parameters": { + "author": { + "type": "string", + "description": "Restricts the results to submissions by a specific author.", + "location": "query" + }, + "hasAttachedVideo": { + "type": "boolean", + "description": "Specifies whether to restrict to submissions that have videos attached.", + "location": "query" + }, + "includeVotes": { + "type": "boolean", + "description": "Specifies whether to include the current user's vote", + "location": "query" + }, + "lang": { + "type": "string", + "description": "The language code for the language the client prefers resuls in.", + "location": "query" + }, + "max-results": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "uint32", + "location": "query" + }, + "q": { + "type": "string", + "description": "Search query.", + "location": "query" + }, + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "sort": { + "type": "string", + "description": "Sort order.", + "location": "query" + }, + "start-index": { + "type": "integer", + "description": "Index of the first result to be retrieved.", + "format": "uint32", + "location": "query" + } + }, + "parameterOrder": [ + "seriesId" + ], + "response": { + "$ref": "SubmissionList" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + } + } + } + } + }, + "submissions": { + "methods": { + "get": { + "id": "moderator.submissions.get", + "path": "series/{seriesId}/submissions/{submissionId}", + "httpMethod": "GET", + "description": "Returns the specified submission within the specified series.", + "parameters": { + "includeVotes": { + "type": "boolean", + "description": "Specifies whether to include the current user's vote", + "location": "query" + }, + "lang": { + "type": "string", + "description": "The language code for the language the client prefers resuls in.", + "location": "query" + }, + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "submissionId": { + "type": "integer", + "description": "The decimal ID of the Submission within the Series.", + "required": true, + "format": "uint32", + "location": "path" + } + }, + "parameterOrder": [ + "seriesId", + "submissionId" + ], + "response": { + "$ref": "Submission" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + }, + "insert": { + "id": "moderator.submissions.insert", + "path": "series/{seriesId}/topics/{topicId}/submissions", + "httpMethod": "POST", + "description": "Inserts a new submission in the specified topic within the specified series.", + "parameters": { + "anonymous": { + "type": "boolean", + "description": "Set to true to mark the new submission as anonymous.", + "location": "query" + }, + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "topicId": { + "type": "integer", + "description": "The decimal ID of the Topic within the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "unauthToken": { + "type": "string", + "description": "User identifier for unauthenticated usage mode", + "location": "query" + } + }, + "parameterOrder": [ + "seriesId", + "topicId" + ], + "request": { + "$ref": "Submission" + }, + "response": { + "$ref": "Submission" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + } + } + }, + "tags": { + "methods": { + "delete": { + "id": "moderator.tags.delete", + "path": "series/{seriesId}/submissions/{submissionId}/tags/{tagId}", + "httpMethod": "DELETE", + "description": "Deletes the specified tag from the specified submission within the specified series.", + "parameters": { + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "submissionId": { + "type": "integer", + "description": "The decimal ID of the Submission within the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "tagId": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "seriesId", + "submissionId", + "tagId" + ], + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + }, + "insert": { + "id": "moderator.tags.insert", + "path": "series/{seriesId}/submissions/{submissionId}/tags", + "httpMethod": "POST", + "description": "Inserts a new tag for the specified submission within the specified series.", + "parameters": { + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "submissionId": { + "type": "integer", + "description": "The decimal ID of the Submission within the Series.", + "required": true, + "format": "uint32", + "location": "path" + } + }, + "parameterOrder": [ + "seriesId", + "submissionId" + ], + "request": { + "$ref": "Tag" + }, + "response": { + "$ref": "Tag" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + }, + "list": { + "id": "moderator.tags.list", + "path": "series/{seriesId}/submissions/{submissionId}/tags", + "httpMethod": "GET", + "description": "Lists all tags for the specified submission within the specified series.", + "parameters": { + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "submissionId": { + "type": "integer", + "description": "The decimal ID of the Submission within the Series.", + "required": true, + "format": "uint32", + "location": "path" + } + }, + "parameterOrder": [ + "seriesId", + "submissionId" + ], + "response": { + "$ref": "TagList" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + } + } + }, + "topics": { + "methods": { + "get": { + "id": "moderator.topics.get", + "path": "series/{seriesId}/topics/{topicId}", + "httpMethod": "GET", + "description": "Returns the specified topic from the specified series.", + "parameters": { + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "topicId": { + "type": "integer", + "description": "The decimal ID of the Topic within the Series.", + "required": true, + "format": "uint32", + "location": "path" + } + }, + "parameterOrder": [ + "seriesId", + "topicId" + ], + "response": { + "$ref": "Topic" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + }, + "insert": { + "id": "moderator.topics.insert", + "path": "series/{seriesId}/topics", + "httpMethod": "POST", + "description": "Inserts a new topic into the specified series.", + "parameters": { + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + } + }, + "parameterOrder": [ + "seriesId" + ], + "request": { + "$ref": "Topic" + }, + "response": { + "$ref": "Topic" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + }, + "list": { + "id": "moderator.topics.list", + "path": "series/{seriesId}/topics", + "httpMethod": "GET", + "description": "Searches the topics within the specified series and returns the search results.", + "parameters": { + "max-results": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "uint32", + "location": "query" + }, + "mode": { + "type": "string", + "location": "query" + }, + "q": { + "type": "string", + "description": "Search query.", + "location": "query" + }, + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "start-index": { + "type": "integer", + "description": "Index of the first result to be retrieved.", + "format": "uint32", + "location": "query" + } + }, + "parameterOrder": [ + "seriesId" + ], + "response": { + "$ref": "TopicList" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + }, + "update": { + "id": "moderator.topics.update", + "path": "series/{seriesId}/topics/{topicId}", + "httpMethod": "PUT", + "description": "Updates the specified topic within the specified series.", + "parameters": { + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "topicId": { + "type": "integer", + "description": "The decimal ID of the Topic within the Series.", + "required": true, + "format": "uint32", + "location": "path" + } + }, + "parameterOrder": [ + "seriesId", + "topicId" + ], + "request": { + "$ref": "Topic" + }, + "response": { + "$ref": "Topic" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + } + }, + "resources": { + "submissions": { + "methods": { + "list": { + "id": "moderator.topics.submissions.list", + "path": "series/{seriesId}/topics/{topicId}/submissions", + "httpMethod": "GET", + "description": "Searches the submissions for the specified topic within the specified series and returns the search results.", + "parameters": { + "author": { + "type": "string", + "description": "Restricts the results to submissions by a specific author.", + "location": "query" + }, + "hasAttachedVideo": { + "type": "boolean", + "description": "Specifies whether to restrict to submissions that have videos attached.", + "location": "query" + }, + "includeVotes": { + "type": "boolean", + "description": "Specifies whether to include the current user's vote", + "location": "query" + }, + "max-results": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "uint32", + "location": "query" + }, + "q": { + "type": "string", + "description": "Search query.", + "location": "query" + }, + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "sort": { + "type": "string", + "description": "Sort order.", + "location": "query" + }, + "start-index": { + "type": "integer", + "description": "Index of the first result to be retrieved.", + "format": "uint32", + "location": "query" + }, + "topicId": { + "type": "integer", + "description": "The decimal ID of the Topic within the Series.", + "required": true, + "format": "uint32", + "location": "path" + } + }, + "parameterOrder": [ + "seriesId", + "topicId" + ], + "response": { + "$ref": "SubmissionList" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + } + } + } + } + }, + "votes": { + "methods": { + "get": { + "id": "moderator.votes.get", + "path": "series/{seriesId}/submissions/{submissionId}/votes/@me", + "httpMethod": "GET", + "description": "Returns the votes by the authenticated user for the specified submission within the specified series.", + "parameters": { + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "submissionId": { + "type": "integer", + "description": "The decimal ID of the Submission within the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "unauthToken": { + "type": "string", + "description": "User identifier for unauthenticated usage mode", + "location": "query" + }, + "userId": { + "type": "string", + "location": "query" + } + }, + "parameterOrder": [ + "seriesId", + "submissionId" + ], + "response": { + "$ref": "Vote" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + }, + "insert": { + "id": "moderator.votes.insert", + "path": "series/{seriesId}/submissions/{submissionId}/votes/@me", + "httpMethod": "POST", + "description": "Inserts a new vote by the authenticated user for the specified submission within the specified series.", + "parameters": { + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "submissionId": { + "type": "integer", + "description": "The decimal ID of the Submission within the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "unauthToken": { + "type": "string", + "description": "User identifier for unauthenticated usage mode", + "location": "query" + } + }, + "parameterOrder": [ + "seriesId", + "submissionId" + ], + "request": { + "$ref": "Vote" + }, + "response": { + "$ref": "Vote" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + }, + "list": { + "id": "moderator.votes.list", + "path": "series/{seriesId}/votes/@me", + "httpMethod": "GET", + "description": "Lists the votes by the authenticated user for the given series.", + "parameters": { + "max-results": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "uint32", + "location": "query" + }, + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "start-index": { + "type": "integer", + "description": "Index of the first result to be retrieved.", + "format": "uint32", + "location": "query" + } + }, + "parameterOrder": [ + "seriesId" + ], + "response": { + "$ref": "VoteList" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + }, + "patch": { + "id": "moderator.votes.patch", + "path": "series/{seriesId}/submissions/{submissionId}/votes/@me", + "httpMethod": "PATCH", + "description": "Updates the votes by the authenticated user for the specified submission within the specified series. This method supports patch semantics.", + "parameters": { + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "submissionId": { + "type": "integer", + "description": "The decimal ID of the Submission within the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "unauthToken": { + "type": "string", + "description": "User identifier for unauthenticated usage mode", + "location": "query" + }, + "userId": { + "type": "string", + "location": "query" + } + }, + "parameterOrder": [ + "seriesId", + "submissionId" + ], + "request": { + "$ref": "Vote" + }, + "response": { + "$ref": "Vote" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + }, + "update": { + "id": "moderator.votes.update", + "path": "series/{seriesId}/submissions/{submissionId}/votes/@me", + "httpMethod": "PUT", + "description": "Updates the votes by the authenticated user for the specified submission within the specified series.", + "parameters": { + "seriesId": { + "type": "integer", + "description": "The decimal ID of the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "submissionId": { + "type": "integer", + "description": "The decimal ID of the Submission within the Series.", + "required": true, + "format": "uint32", + "location": "path" + }, + "unauthToken": { + "type": "string", + "description": "User identifier for unauthenticated usage mode", + "location": "query" + }, + "userId": { + "type": "string", + "location": "query" + } + }, + "parameterOrder": [ + "seriesId", + "submissionId" + ], + "request": { + "$ref": "Vote" + }, + "response": { + "$ref": "Vote" + }, + "scopes": [ + "https://www.googleapis.com/auth/moderator" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/moderator/v1/moderator-gen.go b/third_party/src/code.google.com/p/google-api-go-client/moderator/v1/moderator-gen.go new file mode 100644 index 0000000000000..c20da411a3496 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/moderator/v1/moderator-gen.go @@ -0,0 +1,2606 @@ +// Package moderator provides access to the Moderator API. +// +// See http://code.google.com/apis/moderator/v1/using_rest.html +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/moderator/v1" +// ... +// moderatorService, err := moderator.New(oauthHttpClient) +package moderator + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New + +const apiId = "moderator:v1" +const apiName = "moderator" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/moderator/v1/" + +// OAuth2 scopes used by this API. +const ( + // Manage your activity in Google Moderator + ModeratorScope = "https://www.googleapis.com/auth/moderator" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client} + s.Featured = &FeaturedService{s: s} + s.Global = &GlobalService{s: s} + s.My = &MyService{s: s} + s.Myrecent = &MyrecentService{s: s} + s.Profiles = &ProfilesService{s: s} + s.Responses = &ResponsesService{s: s} + s.Series = &SeriesService{s: s} + s.Submissions = &SubmissionsService{s: s} + s.Tags = &TagsService{s: s} + s.Topics = &TopicsService{s: s} + s.Votes = &VotesService{s: s} + return s, nil +} + +type Service struct { + client *http.Client + + Featured *FeaturedService + + Global *GlobalService + + My *MyService + + Myrecent *MyrecentService + + Profiles *ProfilesService + + Responses *ResponsesService + + Series *SeriesService + + Submissions *SubmissionsService + + Tags *TagsService + + Topics *TopicsService + + Votes *VotesService +} + +type FeaturedService struct { + s *Service +} + +type GlobalService struct { + s *Service +} + +type MyService struct { + s *Service +} + +type MyrecentService struct { + s *Service +} + +type ProfilesService struct { + s *Service +} + +type ResponsesService struct { + s *Service +} + +type SeriesService struct { + s *Service +} + +type SubmissionsService struct { + s *Service +} + +type TagsService struct { + s *Service +} + +type TopicsService struct { + s *Service +} + +type VotesService struct { + s *Service +} + +type ModeratorTopicsResourcePartial struct { + Id *ModeratorTopicsResourcePartialId `json:"id,omitempty"` +} + +type ModeratorTopicsResourcePartialId struct { + SeriesId int64 `json:"seriesId,omitempty,string"` + + TopicId int64 `json:"topicId,omitempty,string"` +} + +type ModeratorVotesResourcePartial struct { + Flag string `json:"flag,omitempty"` + + Vote string `json:"vote,omitempty"` +} + +type Profile struct { + Attribution *ProfileAttribution `json:"attribution,omitempty"` + + Id *ProfileId `json:"id,omitempty"` + + Kind string `json:"kind,omitempty"` +} + +type ProfileAttribution struct { + AvatarUrl string `json:"avatarUrl,omitempty"` + + DisplayName string `json:"displayName,omitempty"` + + Geo *ProfileAttributionGeo `json:"geo,omitempty"` + + Location string `json:"location,omitempty"` +} + +type ProfileAttributionGeo struct { + Latitude float64 `json:"latitude,omitempty"` + + Location string `json:"location,omitempty"` + + Longitude float64 `json:"longitude,omitempty"` +} + +type ProfileId struct { + User string `json:"user,omitempty"` +} + +type Series struct { + AnonymousSubmissionAllowed bool `json:"anonymousSubmissionAllowed,omitempty"` + + Counters *SeriesCounters `json:"counters,omitempty"` + + Description string `json:"description,omitempty"` + + Id *SeriesId `json:"id,omitempty"` + + Kind string `json:"kind,omitempty"` + + Name string `json:"name,omitempty"` + + NumTopics int64 `json:"numTopics,omitempty"` + + Rules *SeriesRules `json:"rules,omitempty"` + + UnauthSubmissionAllowed bool `json:"unauthSubmissionAllowed,omitempty"` + + UnauthVotingAllowed bool `json:"unauthVotingAllowed,omitempty"` + + VideoSubmissionAllowed bool `json:"videoSubmissionAllowed,omitempty"` +} + +type SeriesCounters struct { + AnonymousSubmissions int64 `json:"anonymousSubmissions,omitempty"` + + MinusVotes int64 `json:"minusVotes,omitempty"` + + NoneVotes int64 `json:"noneVotes,omitempty"` + + PlusVotes int64 `json:"plusVotes,omitempty"` + + Submissions int64 `json:"submissions,omitempty"` + + Users int64 `json:"users,omitempty"` + + VideoSubmissions int64 `json:"videoSubmissions,omitempty"` +} + +type SeriesId struct { + SeriesId int64 `json:"seriesId,omitempty,string"` +} + +type SeriesRules struct { + Submissions *SeriesRulesSubmissions `json:"submissions,omitempty"` + + Votes *SeriesRulesVotes `json:"votes,omitempty"` +} + +type SeriesRulesSubmissions struct { + Close uint64 `json:"close,omitempty,string"` + + Open uint64 `json:"open,omitempty,string"` +} + +type SeriesRulesVotes struct { + Close uint64 `json:"close,omitempty,string"` + + Open uint64 `json:"open,omitempty,string"` +} + +type SeriesList struct { + Items []*Series `json:"items,omitempty"` + + Kind string `json:"kind,omitempty"` +} + +type Submission struct { + AttachmentUrl string `json:"attachmentUrl,omitempty"` + + Attribution *SubmissionAttribution `json:"attribution,omitempty"` + + Author string `json:"author,omitempty"` + + Counters *SubmissionCounters `json:"counters,omitempty"` + + Created uint64 `json:"created,omitempty,string"` + + Geo *SubmissionGeo `json:"geo,omitempty"` + + Id *SubmissionId `json:"id,omitempty"` + + Kind string `json:"kind,omitempty"` + + ParentSubmissionId *SubmissionParentSubmissionId `json:"parentSubmissionId,omitempty"` + + Text string `json:"text,omitempty"` + + Topics []*ModeratorTopicsResourcePartial `json:"topics,omitempty"` + + Translations []*SubmissionTranslations `json:"translations,omitempty"` + + Vote *ModeratorVotesResourcePartial `json:"vote,omitempty"` +} + +type SubmissionAttribution struct { + AvatarUrl string `json:"avatarUrl,omitempty"` + + DisplayName string `json:"displayName,omitempty"` + + Location string `json:"location,omitempty"` +} + +type SubmissionCounters struct { + MinusVotes int64 `json:"minusVotes,omitempty"` + + NoneVotes int64 `json:"noneVotes,omitempty"` + + PlusVotes int64 `json:"plusVotes,omitempty"` +} + +type SubmissionGeo struct { + Latitude float64 `json:"latitude,omitempty"` + + Location string `json:"location,omitempty"` + + Longitude float64 `json:"longitude,omitempty"` +} + +type SubmissionId struct { + SeriesId int64 `json:"seriesId,omitempty,string"` + + SubmissionId int64 `json:"submissionId,omitempty,string"` +} + +type SubmissionParentSubmissionId struct { + SeriesId int64 `json:"seriesId,omitempty,string"` + + SubmissionId int64 `json:"submissionId,omitempty,string"` +} + +type SubmissionTranslations struct { + Lang string `json:"lang,omitempty"` + + Text string `json:"text,omitempty"` +} + +type SubmissionList struct { + Items []*Submission `json:"items,omitempty"` + + Kind string `json:"kind,omitempty"` +} + +type Tag struct { + Id *TagId `json:"id,omitempty"` + + Kind string `json:"kind,omitempty"` + + Text string `json:"text,omitempty"` +} + +type TagId struct { + SeriesId int64 `json:"seriesId,omitempty,string"` + + SubmissionId int64 `json:"submissionId,omitempty,string"` + + TagId string `json:"tagId,omitempty"` +} + +type TagList struct { + Items []*Tag `json:"items,omitempty"` + + Kind string `json:"kind,omitempty"` +} + +type Topic struct { + Counters *TopicCounters `json:"counters,omitempty"` + + Description string `json:"description,omitempty"` + + FeaturedSubmission *Submission `json:"featuredSubmission,omitempty"` + + Id *TopicId `json:"id,omitempty"` + + Kind string `json:"kind,omitempty"` + + Name string `json:"name,omitempty"` + + Presenter string `json:"presenter,omitempty"` + + Rules *TopicRules `json:"rules,omitempty"` +} + +type TopicCounters struct { + MinusVotes int64 `json:"minusVotes,omitempty"` + + NoneVotes int64 `json:"noneVotes,omitempty"` + + PlusVotes int64 `json:"plusVotes,omitempty"` + + Submissions int64 `json:"submissions,omitempty"` + + Users int64 `json:"users,omitempty"` + + VideoSubmissions int64 `json:"videoSubmissions,omitempty"` +} + +type TopicId struct { + SeriesId int64 `json:"seriesId,omitempty,string"` + + TopicId int64 `json:"topicId,omitempty,string"` +} + +type TopicRules struct { + Submissions *TopicRulesSubmissions `json:"submissions,omitempty"` + + Votes *TopicRulesVotes `json:"votes,omitempty"` +} + +type TopicRulesSubmissions struct { + Close uint64 `json:"close,omitempty,string"` + + Open uint64 `json:"open,omitempty,string"` +} + +type TopicRulesVotes struct { + Close uint64 `json:"close,omitempty,string"` + + Open uint64 `json:"open,omitempty,string"` +} + +type TopicList struct { + Items []*Topic `json:"items,omitempty"` + + Kind string `json:"kind,omitempty"` +} + +type Vote struct { + Flag string `json:"flag,omitempty"` + + Id *VoteId `json:"id,omitempty"` + + Kind string `json:"kind,omitempty"` + + Vote string `json:"vote,omitempty"` +} + +type VoteId struct { + SeriesId int64 `json:"seriesId,omitempty,string"` + + SubmissionId int64 `json:"submissionId,omitempty,string"` +} + +type VoteList struct { + Items []*Vote `json:"items,omitempty"` + + Kind string `json:"kind,omitempty"` +} + +// method id "moderator.profiles.get": + +type ProfilesGetCall struct { + s *Service + opt_ map[string]interface{} +} + +// Get: Returns the profile information for the authenticated user. +func (r *ProfilesService) Get() *ProfilesGetCall { + c := &ProfilesGetCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *ProfilesGetCall) Do() (*Profile, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "profiles/@me") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Profile) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the profile information for the authenticated user.", + // "httpMethod": "GET", + // "id": "moderator.profiles.get", + // "path": "profiles/@me", + // "response": { + // "$ref": "Profile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.profiles.patch": + +type ProfilesPatchCall struct { + s *Service + profile *Profile + opt_ map[string]interface{} +} + +// Patch: Updates the profile information for the authenticated user. +// This method supports patch semantics. +func (r *ProfilesService) Patch(profile *Profile) *ProfilesPatchCall { + c := &ProfilesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profile = profile + return c +} + +func (c *ProfilesPatchCall) Do() (*Profile, error) { + var body io.Reader = nil + body, err := googleapi.WithDataWrapper.JSONReader(c.profile) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "profiles/@me") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Profile) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the profile information for the authenticated user. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "moderator.profiles.patch", + // "path": "profiles/@me", + // "request": { + // "$ref": "Profile" + // }, + // "response": { + // "$ref": "Profile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.profiles.update": + +type ProfilesUpdateCall struct { + s *Service + profile *Profile + opt_ map[string]interface{} +} + +// Update: Updates the profile information for the authenticated user. +func (r *ProfilesService) Update(profile *Profile) *ProfilesUpdateCall { + c := &ProfilesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profile = profile + return c +} + +func (c *ProfilesUpdateCall) Do() (*Profile, error) { + var body io.Reader = nil + body, err := googleapi.WithDataWrapper.JSONReader(c.profile) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "profiles/@me") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Profile) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the profile information for the authenticated user.", + // "httpMethod": "PUT", + // "id": "moderator.profiles.update", + // "path": "profiles/@me", + // "request": { + // "$ref": "Profile" + // }, + // "response": { + // "$ref": "Profile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.responses.insert": + +type ResponsesInsertCall struct { + s *Service + seriesId int64 + topicId int64 + parentSubmissionId int64 + submission *Submission + opt_ map[string]interface{} +} + +// Insert: Inserts a response for the specified submission in the +// specified topic within the specified series. +func (r *ResponsesService) Insert(seriesId int64, topicId int64, parentSubmissionId int64, submission *Submission) *ResponsesInsertCall { + c := &ResponsesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + c.topicId = topicId + c.parentSubmissionId = parentSubmissionId + c.submission = submission + return c +} + +// Anonymous sets the optional parameter "anonymous": Set to true to +// mark the new submission as anonymous. +func (c *ResponsesInsertCall) Anonymous(anonymous bool) *ResponsesInsertCall { + c.opt_["anonymous"] = anonymous + return c +} + +// UnauthToken sets the optional parameter "unauthToken": User +// identifier for unauthenticated usage mode +func (c *ResponsesInsertCall) UnauthToken(unauthToken string) *ResponsesInsertCall { + c.opt_["unauthToken"] = unauthToken + return c +} + +func (c *ResponsesInsertCall) Do() (*Submission, error) { + var body io.Reader = nil + body, err := googleapi.WithDataWrapper.JSONReader(c.submission) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["anonymous"]; ok { + params.Set("anonymous", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["unauthToken"]; ok { + params.Set("unauthToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}/topics/{topicId}/submissions/{parentSubmissionId}/responses") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls = strings.Replace(urls, "{topicId}", strconv.FormatInt(c.topicId, 10), 1) + urls = strings.Replace(urls, "{parentSubmissionId}", strconv.FormatInt(c.parentSubmissionId, 10), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Submission) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a response for the specified submission in the specified topic within the specified series.", + // "httpMethod": "POST", + // "id": "moderator.responses.insert", + // "parameterOrder": [ + // "seriesId", + // "topicId", + // "parentSubmissionId" + // ], + // "parameters": { + // "anonymous": { + // "description": "Set to true to mark the new submission as anonymous.", + // "location": "query", + // "type": "boolean" + // }, + // "parentSubmissionId": { + // "description": "The decimal ID of the parent Submission within the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "topicId": { + // "description": "The decimal ID of the Topic within the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "unauthToken": { + // "description": "User identifier for unauthenticated usage mode", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "series/{seriesId}/topics/{topicId}/submissions/{parentSubmissionId}/responses", + // "request": { + // "$ref": "Submission" + // }, + // "response": { + // "$ref": "Submission" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.responses.list": + +type ResponsesListCall struct { + s *Service + seriesId int64 + submissionId int64 + opt_ map[string]interface{} +} + +// List: Lists or searches the responses for the specified submission +// within the specified series and returns the search results. +func (r *ResponsesService) List(seriesId int64, submissionId int64) *ResponsesListCall { + c := &ResponsesListCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + c.submissionId = submissionId + return c +} + +// Author sets the optional parameter "author": Restricts the results to +// submissions by a specific author. +func (c *ResponsesListCall) Author(author string) *ResponsesListCall { + c.opt_["author"] = author + return c +} + +// HasAttachedVideo sets the optional parameter "hasAttachedVideo": +// Specifies whether to restrict to submissions that have videos +// attached. +func (c *ResponsesListCall) HasAttachedVideo(hasAttachedVideo bool) *ResponsesListCall { + c.opt_["hasAttachedVideo"] = hasAttachedVideo + return c +} + +// MaxResults sets the optional parameter "max-results": Maximum number +// of results to return. +func (c *ResponsesListCall) MaxResults(maxResults int64) *ResponsesListCall { + c.opt_["max-results"] = maxResults + return c +} + +// Q sets the optional parameter "q": Search query. +func (c *ResponsesListCall) Q(q string) *ResponsesListCall { + c.opt_["q"] = q + return c +} + +// Sort sets the optional parameter "sort": Sort order. +func (c *ResponsesListCall) Sort(sort string) *ResponsesListCall { + c.opt_["sort"] = sort + return c +} + +// StartIndex sets the optional parameter "start-index": Index of the +// first result to be retrieved. +func (c *ResponsesListCall) StartIndex(startIndex int64) *ResponsesListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *ResponsesListCall) Do() (*SubmissionList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["author"]; ok { + params.Set("author", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["hasAttachedVideo"]; ok { + params.Set("hasAttachedVideo", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["q"]; ok { + params.Set("q", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}/submissions/{submissionId}/responses") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls = strings.Replace(urls, "{submissionId}", strconv.FormatInt(c.submissionId, 10), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SubmissionList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists or searches the responses for the specified submission within the specified series and returns the search results.", + // "httpMethod": "GET", + // "id": "moderator.responses.list", + // "parameterOrder": [ + // "seriesId", + // "submissionId" + // ], + // "parameters": { + // "author": { + // "description": "Restricts the results to submissions by a specific author.", + // "location": "query", + // "type": "string" + // }, + // "hasAttachedVideo": { + // "description": "Specifies whether to restrict to submissions that have videos attached.", + // "location": "query", + // "type": "boolean" + // }, + // "max-results": { + // "description": "Maximum number of results to return.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "q": { + // "description": "Search query.", + // "location": "query", + // "type": "string" + // }, + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "sort": { + // "description": "Sort order.", + // "location": "query", + // "type": "string" + // }, + // "start-index": { + // "description": "Index of the first result to be retrieved.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "submissionId": { + // "description": "The decimal ID of the Submission within the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "series/{seriesId}/submissions/{submissionId}/responses", + // "response": { + // "$ref": "SubmissionList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.series.get": + +type SeriesGetCall struct { + s *Service + seriesId int64 + opt_ map[string]interface{} +} + +// Get: Returns the specified series. +func (r *SeriesService) Get(seriesId int64) *SeriesGetCall { + c := &SeriesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + return c +} + +func (c *SeriesGetCall) Do() (*Series, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Series) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified series.", + // "httpMethod": "GET", + // "id": "moderator.series.get", + // "parameterOrder": [ + // "seriesId" + // ], + // "parameters": { + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "series/{seriesId}", + // "response": { + // "$ref": "Series" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.series.insert": + +type SeriesInsertCall struct { + s *Service + series *Series + opt_ map[string]interface{} +} + +// Insert: Inserts a new series. +func (r *SeriesService) Insert(series *Series) *SeriesInsertCall { + c := &SeriesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.series = series + return c +} + +func (c *SeriesInsertCall) Do() (*Series, error) { + var body io.Reader = nil + body, err := googleapi.WithDataWrapper.JSONReader(c.series) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Series) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new series.", + // "httpMethod": "POST", + // "id": "moderator.series.insert", + // "path": "series", + // "request": { + // "$ref": "Series" + // }, + // "response": { + // "$ref": "Series" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.series.list": + +type SeriesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Searches the series and returns the search results. +func (r *SeriesService) List() *SeriesListCall { + c := &SeriesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "max-results": Maximum number +// of results to return. +func (c *SeriesListCall) MaxResults(maxResults int64) *SeriesListCall { + c.opt_["max-results"] = maxResults + return c +} + +// Q sets the optional parameter "q": Search query. +func (c *SeriesListCall) Q(q string) *SeriesListCall { + c.opt_["q"] = q + return c +} + +// StartIndex sets the optional parameter "start-index": Index of the +// first result to be retrieved. +func (c *SeriesListCall) StartIndex(startIndex int64) *SeriesListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *SeriesListCall) Do() (*SeriesList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["q"]; ok { + params.Set("q", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SeriesList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Searches the series and returns the search results.", + // "httpMethod": "GET", + // "id": "moderator.series.list", + // "parameters": { + // "max-results": { + // "description": "Maximum number of results to return.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "q": { + // "description": "Search query.", + // "location": "query", + // "type": "string" + // }, + // "start-index": { + // "description": "Index of the first result to be retrieved.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // } + // }, + // "path": "series", + // "response": { + // "$ref": "SeriesList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.series.patch": + +type SeriesPatchCall struct { + s *Service + seriesId int64 + series *Series + opt_ map[string]interface{} +} + +// Patch: Updates the specified series. This method supports patch +// semantics. +func (r *SeriesService) Patch(seriesId int64, series *Series) *SeriesPatchCall { + c := &SeriesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + c.series = series + return c +} + +func (c *SeriesPatchCall) Do() (*Series, error) { + var body io.Reader = nil + body, err := googleapi.WithDataWrapper.JSONReader(c.series) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Series) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified series. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "moderator.series.patch", + // "parameterOrder": [ + // "seriesId" + // ], + // "parameters": { + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "series/{seriesId}", + // "request": { + // "$ref": "Series" + // }, + // "response": { + // "$ref": "Series" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.series.update": + +type SeriesUpdateCall struct { + s *Service + seriesId int64 + series *Series + opt_ map[string]interface{} +} + +// Update: Updates the specified series. +func (r *SeriesService) Update(seriesId int64, series *Series) *SeriesUpdateCall { + c := &SeriesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + c.series = series + return c +} + +func (c *SeriesUpdateCall) Do() (*Series, error) { + var body io.Reader = nil + body, err := googleapi.WithDataWrapper.JSONReader(c.series) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Series) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified series.", + // "httpMethod": "PUT", + // "id": "moderator.series.update", + // "parameterOrder": [ + // "seriesId" + // ], + // "parameters": { + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "series/{seriesId}", + // "request": { + // "$ref": "Series" + // }, + // "response": { + // "$ref": "Series" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.submissions.get": + +type SubmissionsGetCall struct { + s *Service + seriesId int64 + submissionId int64 + opt_ map[string]interface{} +} + +// Get: Returns the specified submission within the specified series. +func (r *SubmissionsService) Get(seriesId int64, submissionId int64) *SubmissionsGetCall { + c := &SubmissionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + c.submissionId = submissionId + return c +} + +// IncludeVotes sets the optional parameter "includeVotes": Specifies +// whether to include the current user's vote +func (c *SubmissionsGetCall) IncludeVotes(includeVotes bool) *SubmissionsGetCall { + c.opt_["includeVotes"] = includeVotes + return c +} + +// Lang sets the optional parameter "lang": The language code for the +// language the client prefers resuls in. +func (c *SubmissionsGetCall) Lang(lang string) *SubmissionsGetCall { + c.opt_["lang"] = lang + return c +} + +func (c *SubmissionsGetCall) Do() (*Submission, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["includeVotes"]; ok { + params.Set("includeVotes", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["lang"]; ok { + params.Set("lang", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}/submissions/{submissionId}") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls = strings.Replace(urls, "{submissionId}", strconv.FormatInt(c.submissionId, 10), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Submission) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified submission within the specified series.", + // "httpMethod": "GET", + // "id": "moderator.submissions.get", + // "parameterOrder": [ + // "seriesId", + // "submissionId" + // ], + // "parameters": { + // "includeVotes": { + // "description": "Specifies whether to include the current user's vote", + // "location": "query", + // "type": "boolean" + // }, + // "lang": { + // "description": "The language code for the language the client prefers resuls in.", + // "location": "query", + // "type": "string" + // }, + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "submissionId": { + // "description": "The decimal ID of the Submission within the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "series/{seriesId}/submissions/{submissionId}", + // "response": { + // "$ref": "Submission" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.submissions.insert": + +type SubmissionsInsertCall struct { + s *Service + seriesId int64 + topicId int64 + submission *Submission + opt_ map[string]interface{} +} + +// Insert: Inserts a new submission in the specified topic within the +// specified series. +func (r *SubmissionsService) Insert(seriesId int64, topicId int64, submission *Submission) *SubmissionsInsertCall { + c := &SubmissionsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + c.topicId = topicId + c.submission = submission + return c +} + +// Anonymous sets the optional parameter "anonymous": Set to true to +// mark the new submission as anonymous. +func (c *SubmissionsInsertCall) Anonymous(anonymous bool) *SubmissionsInsertCall { + c.opt_["anonymous"] = anonymous + return c +} + +// UnauthToken sets the optional parameter "unauthToken": User +// identifier for unauthenticated usage mode +func (c *SubmissionsInsertCall) UnauthToken(unauthToken string) *SubmissionsInsertCall { + c.opt_["unauthToken"] = unauthToken + return c +} + +func (c *SubmissionsInsertCall) Do() (*Submission, error) { + var body io.Reader = nil + body, err := googleapi.WithDataWrapper.JSONReader(c.submission) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["anonymous"]; ok { + params.Set("anonymous", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["unauthToken"]; ok { + params.Set("unauthToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}/topics/{topicId}/submissions") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls = strings.Replace(urls, "{topicId}", strconv.FormatInt(c.topicId, 10), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Submission) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new submission in the specified topic within the specified series.", + // "httpMethod": "POST", + // "id": "moderator.submissions.insert", + // "parameterOrder": [ + // "seriesId", + // "topicId" + // ], + // "parameters": { + // "anonymous": { + // "description": "Set to true to mark the new submission as anonymous.", + // "location": "query", + // "type": "boolean" + // }, + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "topicId": { + // "description": "The decimal ID of the Topic within the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "unauthToken": { + // "description": "User identifier for unauthenticated usage mode", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "series/{seriesId}/topics/{topicId}/submissions", + // "request": { + // "$ref": "Submission" + // }, + // "response": { + // "$ref": "Submission" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.tags.delete": + +type TagsDeleteCall struct { + s *Service + seriesId int64 + submissionId int64 + tagId string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified tag from the specified submission +// within the specified series. +func (r *TagsService) Delete(seriesId int64, submissionId int64, tagId string) *TagsDeleteCall { + c := &TagsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + c.submissionId = submissionId + c.tagId = tagId + return c +} + +func (c *TagsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}/submissions/{submissionId}/tags/{tagId}") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls = strings.Replace(urls, "{submissionId}", strconv.FormatInt(c.submissionId, 10), 1) + urls = strings.Replace(urls, "{tagId}", cleanPathString(c.tagId), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified tag from the specified submission within the specified series.", + // "httpMethod": "DELETE", + // "id": "moderator.tags.delete", + // "parameterOrder": [ + // "seriesId", + // "submissionId", + // "tagId" + // ], + // "parameters": { + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "submissionId": { + // "description": "The decimal ID of the Submission within the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "tagId": { + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "series/{seriesId}/submissions/{submissionId}/tags/{tagId}", + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.tags.insert": + +type TagsInsertCall struct { + s *Service + seriesId int64 + submissionId int64 + tag *Tag + opt_ map[string]interface{} +} + +// Insert: Inserts a new tag for the specified submission within the +// specified series. +func (r *TagsService) Insert(seriesId int64, submissionId int64, tag *Tag) *TagsInsertCall { + c := &TagsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + c.submissionId = submissionId + c.tag = tag + return c +} + +func (c *TagsInsertCall) Do() (*Tag, error) { + var body io.Reader = nil + body, err := googleapi.WithDataWrapper.JSONReader(c.tag) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}/submissions/{submissionId}/tags") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls = strings.Replace(urls, "{submissionId}", strconv.FormatInt(c.submissionId, 10), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Tag) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new tag for the specified submission within the specified series.", + // "httpMethod": "POST", + // "id": "moderator.tags.insert", + // "parameterOrder": [ + // "seriesId", + // "submissionId" + // ], + // "parameters": { + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "submissionId": { + // "description": "The decimal ID of the Submission within the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "series/{seriesId}/submissions/{submissionId}/tags", + // "request": { + // "$ref": "Tag" + // }, + // "response": { + // "$ref": "Tag" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.tags.list": + +type TagsListCall struct { + s *Service + seriesId int64 + submissionId int64 + opt_ map[string]interface{} +} + +// List: Lists all tags for the specified submission within the +// specified series. +func (r *TagsService) List(seriesId int64, submissionId int64) *TagsListCall { + c := &TagsListCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + c.submissionId = submissionId + return c +} + +func (c *TagsListCall) Do() (*TagList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}/submissions/{submissionId}/tags") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls = strings.Replace(urls, "{submissionId}", strconv.FormatInt(c.submissionId, 10), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TagList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all tags for the specified submission within the specified series.", + // "httpMethod": "GET", + // "id": "moderator.tags.list", + // "parameterOrder": [ + // "seriesId", + // "submissionId" + // ], + // "parameters": { + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "submissionId": { + // "description": "The decimal ID of the Submission within the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "series/{seriesId}/submissions/{submissionId}/tags", + // "response": { + // "$ref": "TagList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.topics.get": + +type TopicsGetCall struct { + s *Service + seriesId int64 + topicId int64 + opt_ map[string]interface{} +} + +// Get: Returns the specified topic from the specified series. +func (r *TopicsService) Get(seriesId int64, topicId int64) *TopicsGetCall { + c := &TopicsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + c.topicId = topicId + return c +} + +func (c *TopicsGetCall) Do() (*Topic, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}/topics/{topicId}") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls = strings.Replace(urls, "{topicId}", strconv.FormatInt(c.topicId, 10), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Topic) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified topic from the specified series.", + // "httpMethod": "GET", + // "id": "moderator.topics.get", + // "parameterOrder": [ + // "seriesId", + // "topicId" + // ], + // "parameters": { + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "topicId": { + // "description": "The decimal ID of the Topic within the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "series/{seriesId}/topics/{topicId}", + // "response": { + // "$ref": "Topic" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.topics.insert": + +type TopicsInsertCall struct { + s *Service + seriesId int64 + topic *Topic + opt_ map[string]interface{} +} + +// Insert: Inserts a new topic into the specified series. +func (r *TopicsService) Insert(seriesId int64, topic *Topic) *TopicsInsertCall { + c := &TopicsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + c.topic = topic + return c +} + +func (c *TopicsInsertCall) Do() (*Topic, error) { + var body io.Reader = nil + body, err := googleapi.WithDataWrapper.JSONReader(c.topic) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}/topics") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Topic) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new topic into the specified series.", + // "httpMethod": "POST", + // "id": "moderator.topics.insert", + // "parameterOrder": [ + // "seriesId" + // ], + // "parameters": { + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "series/{seriesId}/topics", + // "request": { + // "$ref": "Topic" + // }, + // "response": { + // "$ref": "Topic" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.topics.list": + +type TopicsListCall struct { + s *Service + seriesId int64 + opt_ map[string]interface{} +} + +// List: Searches the topics within the specified series and returns the +// search results. +func (r *TopicsService) List(seriesId int64) *TopicsListCall { + c := &TopicsListCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + return c +} + +// MaxResults sets the optional parameter "max-results": Maximum number +// of results to return. +func (c *TopicsListCall) MaxResults(maxResults int64) *TopicsListCall { + c.opt_["max-results"] = maxResults + return c +} + +// Mode sets the optional parameter "mode": +func (c *TopicsListCall) Mode(mode string) *TopicsListCall { + c.opt_["mode"] = mode + return c +} + +// Q sets the optional parameter "q": Search query. +func (c *TopicsListCall) Q(q string) *TopicsListCall { + c.opt_["q"] = q + return c +} + +// StartIndex sets the optional parameter "start-index": Index of the +// first result to be retrieved. +func (c *TopicsListCall) StartIndex(startIndex int64) *TopicsListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *TopicsListCall) Do() (*TopicList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["mode"]; ok { + params.Set("mode", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["q"]; ok { + params.Set("q", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}/topics") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TopicList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Searches the topics within the specified series and returns the search results.", + // "httpMethod": "GET", + // "id": "moderator.topics.list", + // "parameterOrder": [ + // "seriesId" + // ], + // "parameters": { + // "max-results": { + // "description": "Maximum number of results to return.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "mode": { + // "location": "query", + // "type": "string" + // }, + // "q": { + // "description": "Search query.", + // "location": "query", + // "type": "string" + // }, + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "start-index": { + // "description": "Index of the first result to be retrieved.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // } + // }, + // "path": "series/{seriesId}/topics", + // "response": { + // "$ref": "TopicList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.topics.update": + +type TopicsUpdateCall struct { + s *Service + seriesId int64 + topicId int64 + topic *Topic + opt_ map[string]interface{} +} + +// Update: Updates the specified topic within the specified series. +func (r *TopicsService) Update(seriesId int64, topicId int64, topic *Topic) *TopicsUpdateCall { + c := &TopicsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + c.topicId = topicId + c.topic = topic + return c +} + +func (c *TopicsUpdateCall) Do() (*Topic, error) { + var body io.Reader = nil + body, err := googleapi.WithDataWrapper.JSONReader(c.topic) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}/topics/{topicId}") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls = strings.Replace(urls, "{topicId}", strconv.FormatInt(c.topicId, 10), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Topic) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified topic within the specified series.", + // "httpMethod": "PUT", + // "id": "moderator.topics.update", + // "parameterOrder": [ + // "seriesId", + // "topicId" + // ], + // "parameters": { + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "topicId": { + // "description": "The decimal ID of the Topic within the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "series/{seriesId}/topics/{topicId}", + // "request": { + // "$ref": "Topic" + // }, + // "response": { + // "$ref": "Topic" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.votes.get": + +type VotesGetCall struct { + s *Service + seriesId int64 + submissionId int64 + opt_ map[string]interface{} +} + +// Get: Returns the votes by the authenticated user for the specified +// submission within the specified series. +func (r *VotesService) Get(seriesId int64, submissionId int64) *VotesGetCall { + c := &VotesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + c.submissionId = submissionId + return c +} + +// UnauthToken sets the optional parameter "unauthToken": User +// identifier for unauthenticated usage mode +func (c *VotesGetCall) UnauthToken(unauthToken string) *VotesGetCall { + c.opt_["unauthToken"] = unauthToken + return c +} + +// UserId sets the optional parameter "userId": +func (c *VotesGetCall) UserId(userId string) *VotesGetCall { + c.opt_["userId"] = userId + return c +} + +func (c *VotesGetCall) Do() (*Vote, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["unauthToken"]; ok { + params.Set("unauthToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["userId"]; ok { + params.Set("userId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}/submissions/{submissionId}/votes/@me") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls = strings.Replace(urls, "{submissionId}", strconv.FormatInt(c.submissionId, 10), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Vote) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the votes by the authenticated user for the specified submission within the specified series.", + // "httpMethod": "GET", + // "id": "moderator.votes.get", + // "parameterOrder": [ + // "seriesId", + // "submissionId" + // ], + // "parameters": { + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "submissionId": { + // "description": "The decimal ID of the Submission within the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "unauthToken": { + // "description": "User identifier for unauthenticated usage mode", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "location": "query", + // "type": "string" + // } + // }, + // "path": "series/{seriesId}/submissions/{submissionId}/votes/@me", + // "response": { + // "$ref": "Vote" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.votes.insert": + +type VotesInsertCall struct { + s *Service + seriesId int64 + submissionId int64 + vote *Vote + opt_ map[string]interface{} +} + +// Insert: Inserts a new vote by the authenticated user for the +// specified submission within the specified series. +func (r *VotesService) Insert(seriesId int64, submissionId int64, vote *Vote) *VotesInsertCall { + c := &VotesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + c.submissionId = submissionId + c.vote = vote + return c +} + +// UnauthToken sets the optional parameter "unauthToken": User +// identifier for unauthenticated usage mode +func (c *VotesInsertCall) UnauthToken(unauthToken string) *VotesInsertCall { + c.opt_["unauthToken"] = unauthToken + return c +} + +func (c *VotesInsertCall) Do() (*Vote, error) { + var body io.Reader = nil + body, err := googleapi.WithDataWrapper.JSONReader(c.vote) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["unauthToken"]; ok { + params.Set("unauthToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}/submissions/{submissionId}/votes/@me") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls = strings.Replace(urls, "{submissionId}", strconv.FormatInt(c.submissionId, 10), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Vote) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new vote by the authenticated user for the specified submission within the specified series.", + // "httpMethod": "POST", + // "id": "moderator.votes.insert", + // "parameterOrder": [ + // "seriesId", + // "submissionId" + // ], + // "parameters": { + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "submissionId": { + // "description": "The decimal ID of the Submission within the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "unauthToken": { + // "description": "User identifier for unauthenticated usage mode", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "series/{seriesId}/submissions/{submissionId}/votes/@me", + // "request": { + // "$ref": "Vote" + // }, + // "response": { + // "$ref": "Vote" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.votes.list": + +type VotesListCall struct { + s *Service + seriesId int64 + opt_ map[string]interface{} +} + +// List: Lists the votes by the authenticated user for the given series. +func (r *VotesService) List(seriesId int64) *VotesListCall { + c := &VotesListCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + return c +} + +// MaxResults sets the optional parameter "max-results": Maximum number +// of results to return. +func (c *VotesListCall) MaxResults(maxResults int64) *VotesListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": Index of the +// first result to be retrieved. +func (c *VotesListCall) StartIndex(startIndex int64) *VotesListCall { + c.opt_["start-index"] = startIndex + return c +} + +func (c *VotesListCall) Do() (*VoteList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-index"]; ok { + params.Set("start-index", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}/votes/@me") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(VoteList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the votes by the authenticated user for the given series.", + // "httpMethod": "GET", + // "id": "moderator.votes.list", + // "parameterOrder": [ + // "seriesId" + // ], + // "parameters": { + // "max-results": { + // "description": "Maximum number of results to return.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "start-index": { + // "description": "Index of the first result to be retrieved.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // } + // }, + // "path": "series/{seriesId}/votes/@me", + // "response": { + // "$ref": "VoteList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.votes.patch": + +type VotesPatchCall struct { + s *Service + seriesId int64 + submissionId int64 + vote *Vote + opt_ map[string]interface{} +} + +// Patch: Updates the votes by the authenticated user for the specified +// submission within the specified series. This method supports patch +// semantics. +func (r *VotesService) Patch(seriesId int64, submissionId int64, vote *Vote) *VotesPatchCall { + c := &VotesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + c.submissionId = submissionId + c.vote = vote + return c +} + +// UnauthToken sets the optional parameter "unauthToken": User +// identifier for unauthenticated usage mode +func (c *VotesPatchCall) UnauthToken(unauthToken string) *VotesPatchCall { + c.opt_["unauthToken"] = unauthToken + return c +} + +// UserId sets the optional parameter "userId": +func (c *VotesPatchCall) UserId(userId string) *VotesPatchCall { + c.opt_["userId"] = userId + return c +} + +func (c *VotesPatchCall) Do() (*Vote, error) { + var body io.Reader = nil + body, err := googleapi.WithDataWrapper.JSONReader(c.vote) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["unauthToken"]; ok { + params.Set("unauthToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["userId"]; ok { + params.Set("userId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}/submissions/{submissionId}/votes/@me") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls = strings.Replace(urls, "{submissionId}", strconv.FormatInt(c.submissionId, 10), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Vote) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the votes by the authenticated user for the specified submission within the specified series. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "moderator.votes.patch", + // "parameterOrder": [ + // "seriesId", + // "submissionId" + // ], + // "parameters": { + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "submissionId": { + // "description": "The decimal ID of the Submission within the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "unauthToken": { + // "description": "User identifier for unauthenticated usage mode", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "location": "query", + // "type": "string" + // } + // }, + // "path": "series/{seriesId}/submissions/{submissionId}/votes/@me", + // "request": { + // "$ref": "Vote" + // }, + // "response": { + // "$ref": "Vote" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +// method id "moderator.votes.update": + +type VotesUpdateCall struct { + s *Service + seriesId int64 + submissionId int64 + vote *Vote + opt_ map[string]interface{} +} + +// Update: Updates the votes by the authenticated user for the specified +// submission within the specified series. +func (r *VotesService) Update(seriesId int64, submissionId int64, vote *Vote) *VotesUpdateCall { + c := &VotesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.seriesId = seriesId + c.submissionId = submissionId + c.vote = vote + return c +} + +// UnauthToken sets the optional parameter "unauthToken": User +// identifier for unauthenticated usage mode +func (c *VotesUpdateCall) UnauthToken(unauthToken string) *VotesUpdateCall { + c.opt_["unauthToken"] = unauthToken + return c +} + +// UserId sets the optional parameter "userId": +func (c *VotesUpdateCall) UserId(userId string) *VotesUpdateCall { + c.opt_["userId"] = userId + return c +} + +func (c *VotesUpdateCall) Do() (*Vote, error) { + var body io.Reader = nil + body, err := googleapi.WithDataWrapper.JSONReader(c.vote) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["unauthToken"]; ok { + params.Set("unauthToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["userId"]; ok { + params.Set("userId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/moderator/v1/", "series/{seriesId}/submissions/{submissionId}/votes/@me") + urls = strings.Replace(urls, "{seriesId}", strconv.FormatInt(c.seriesId, 10), 1) + urls = strings.Replace(urls, "{submissionId}", strconv.FormatInt(c.submissionId, 10), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Vote) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the votes by the authenticated user for the specified submission within the specified series.", + // "httpMethod": "PUT", + // "id": "moderator.votes.update", + // "parameterOrder": [ + // "seriesId", + // "submissionId" + // ], + // "parameters": { + // "seriesId": { + // "description": "The decimal ID of the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "submissionId": { + // "description": "The decimal ID of the Submission within the Series.", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "unauthToken": { + // "description": "User identifier for unauthenticated usage mode", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "location": "query", + // "type": "string" + // } + // }, + // "path": "series/{seriesId}/submissions/{submissionId}/votes/@me", + // "request": { + // "$ref": "Vote" + // }, + // "response": { + // "$ref": "Vote" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/moderator" + // ] + // } + +} + +func cleanPathString(s string) string { + return strings.Map(func(r rune) rune { + if r >= 0x2d && r <= 0x7a || r == '~' { + return r + } + return -1 + }, s) +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/oauth2/v1/oauth2-api.json b/third_party/src/code.google.com/p/google-api-go-client/oauth2/v1/oauth2-api.json new file mode 100644 index 0000000000000..906c48223ba31 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/oauth2/v1/oauth2-api.json @@ -0,0 +1,264 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/WlcQEurGo0sEddzjdUrIBdx9npM\"", + "discoveryVersion": "v1", + "id": "oauth2:v1", + "name": "oauth2", + "version": "v1", + "title": "Google OAuth2 API", + "description": "Lets you access OAuth2 protocol related APIs.", + "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/accounts/docs/OAuth2", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/", + "basePath": "/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "", + "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/plus.login": { + "description": "Know your basic profile info and list of people in your circles." + }, + "https://www.googleapis.com/auth/plus.me": { + "description": "Know who you are on Google" + }, + "https://www.googleapis.com/auth/userinfo.email": { + "description": "View your email address" + }, + "https://www.googleapis.com/auth/userinfo.profile": { + "description": "View basic information about your account" + } + } + } + }, + "schemas": { + "Tokeninfo": { + "id": "Tokeninfo", + "type": "object", + "properties": { + "access_type": { + "type": "string", + "description": "The access type granted with this token. It can be offline or online." + }, + "audience": { + "type": "string", + "description": "Who is the intended audience for this token. In general the same as issued_to." + }, + "email": { + "type": "string", + "description": "The email address of the user. Present only if the email scope is present in the request." + }, + "email_verified": { + "type": "boolean", + "description": "Boolean flag which is true if the email address is verified. Present only if the email scope is present in the request." + }, + "expires_in": { + "type": "integer", + "description": "The expiry time of the token, as number of seconds left until expiry.", + "format": "int32" + }, + "issued_at": { + "type": "integer", + "description": "The issue time of the token, as number of seconds.", + "format": "int32" + }, + "issued_to": { + "type": "string", + "description": "To whom was the token issued to. In general the same as audience." + }, + "issuer": { + "type": "string", + "description": "Who issued the token." + }, + "nonce": { + "type": "string", + "description": "Nonce of the id token." + }, + "scope": { + "type": "string", + "description": "The space separated list of scopes granted to this token." + }, + "user_id": { + "type": "string", + "description": "The Gaia obfuscated user id." + }, + "verified_email": { + "type": "boolean", + "description": "Boolean flag which is true if the email address is verified. Present only if the email scope is present in the request." + } + } + }, + "Userinfoplus": { + "id": "Userinfoplus", + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The user's email address." + }, + "family_name": { + "type": "string", + "description": "The user's last name." + }, + "gender": { + "type": "string", + "description": "The user's gender." + }, + "given_name": { + "type": "string", + "description": "The user's first name." + }, + "hd": { + "type": "string", + "description": "The hosted domain e.g. example.com if the user is Google apps user." + }, + "id": { + "type": "string", + "description": "The focus obfuscated gaia id of the user." + }, + "link": { + "type": "string", + "description": "URL of the profile page." + }, + "locale": { + "type": "string", + "description": "The user's preferred locale." + }, + "name": { + "type": "string", + "description": "The user's full name." + }, + "picture": { + "type": "string", + "description": "URL of the user's picture image." + }, + "verified_email": { + "type": "boolean", + "description": "Boolean flag which is true if the email address is verified. Always verified because we only return the user's primary email address.", + "default": "true" + } + } + } + }, + "methods": { + "tokeninfo": { + "id": "oauth2.tokeninfo", + "path": "oauth2/v1/tokeninfo", + "httpMethod": "POST", + "description": "Get token info", + "parameters": { + "access_token": { + "type": "string", + "description": "The oauth2 access token", + "location": "query" + }, + "id_token": { + "type": "string", + "description": "The ID token", + "location": "query" + } + }, + "response": { + "$ref": "Tokeninfo" + } + } + }, + "resources": { + "userinfo": { + "methods": { + "get": { + "id": "oauth2.userinfo.get", + "path": "oauth2/v1/userinfo", + "httpMethod": "GET", + "description": "Get user info", + "response": { + "$ref": "Userinfoplus" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me", + "https://www.googleapis.com/auth/userinfo.email", + "https://www.googleapis.com/auth/userinfo.profile" + ] + } + }, + "resources": { + "v2": { + "resources": { + "me": { + "methods": { + "get": { + "id": "oauth2.userinfo.v2.me.get", + "path": "userinfo/v2/me", + "httpMethod": "GET", + "description": "Get user info", + "response": { + "$ref": "Userinfoplus" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me", + "https://www.googleapis.com/auth/userinfo.email", + "https://www.googleapis.com/auth/userinfo.profile" + ] + } + } + } + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/oauth2/v1/oauth2-gen.go b/third_party/src/code.google.com/p/google-api-go-client/oauth2/v1/oauth2-gen.go new file mode 100644 index 0000000000000..d142f5190baf3 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/oauth2/v1/oauth2-gen.go @@ -0,0 +1,371 @@ +// Package oauth2 provides access to the Google OAuth2 API. +// +// See https://developers.google.com/accounts/docs/OAuth2 +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/oauth2/v1" +// ... +// oauth2Service, err := oauth2.New(oauthHttpClient) +package oauth2 + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "oauth2:v1" +const apiName = "oauth2" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // Know your basic profile info and list of people in your circles. + PlusLoginScope = "https://www.googleapis.com/auth/plus.login" + + // Know who you are on Google + PlusMeScope = "https://www.googleapis.com/auth/plus.me" + + // View your email address + UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email" + + // View basic information about your account + UserinfoProfileScope = "https://www.googleapis.com/auth/userinfo.profile" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Userinfo = NewUserinfoService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Userinfo *UserinfoService +} + +func NewUserinfoService(s *Service) *UserinfoService { + rs := &UserinfoService{s: s} + rs.V2 = NewUserinfoV2Service(s) + return rs +} + +type UserinfoService struct { + s *Service + + V2 *UserinfoV2Service +} + +func NewUserinfoV2Service(s *Service) *UserinfoV2Service { + rs := &UserinfoV2Service{s: s} + rs.Me = NewUserinfoV2MeService(s) + return rs +} + +type UserinfoV2Service struct { + s *Service + + Me *UserinfoV2MeService +} + +func NewUserinfoV2MeService(s *Service) *UserinfoV2MeService { + rs := &UserinfoV2MeService{s: s} + return rs +} + +type UserinfoV2MeService struct { + s *Service +} + +type Tokeninfo struct { + // Access_type: The access type granted with this token. It can be + // offline or online. + Access_type string `json:"access_type,omitempty"` + + // Audience: Who is the intended audience for this token. In general the + // same as issued_to. + Audience string `json:"audience,omitempty"` + + // Email: The email address of the user. Present only if the email scope + // is present in the request. + Email string `json:"email,omitempty"` + + // Email_verified: Boolean flag which is true if the email address is + // verified. Present only if the email scope is present in the request. + Email_verified bool `json:"email_verified,omitempty"` + + // Expires_in: The expiry time of the token, as number of seconds left + // until expiry. + Expires_in int64 `json:"expires_in,omitempty"` + + // Issued_at: The issue time of the token, as number of seconds. + Issued_at int64 `json:"issued_at,omitempty"` + + // Issued_to: To whom was the token issued to. In general the same as + // audience. + Issued_to string `json:"issued_to,omitempty"` + + // Issuer: Who issued the token. + Issuer string `json:"issuer,omitempty"` + + // Nonce: Nonce of the id token. + Nonce string `json:"nonce,omitempty"` + + // Scope: The space separated list of scopes granted to this token. + Scope string `json:"scope,omitempty"` + + // User_id: The Gaia obfuscated user id. + User_id string `json:"user_id,omitempty"` + + // Verified_email: Boolean flag which is true if the email address is + // verified. Present only if the email scope is present in the request. + Verified_email bool `json:"verified_email,omitempty"` +} + +type Userinfoplus struct { + // Email: The user's email address. + Email string `json:"email,omitempty"` + + // Family_name: The user's last name. + Family_name string `json:"family_name,omitempty"` + + // Gender: The user's gender. + Gender string `json:"gender,omitempty"` + + // Given_name: The user's first name. + Given_name string `json:"given_name,omitempty"` + + // Hd: The hosted domain e.g. example.com if the user is Google apps + // user. + Hd string `json:"hd,omitempty"` + + // Id: The focus obfuscated gaia id of the user. + Id string `json:"id,omitempty"` + + // Link: URL of the profile page. + Link string `json:"link,omitempty"` + + // Locale: The user's preferred locale. + Locale string `json:"locale,omitempty"` + + // Name: The user's full name. + Name string `json:"name,omitempty"` + + // Picture: URL of the user's picture image. + Picture string `json:"picture,omitempty"` + + // Verified_email: Boolean flag which is true if the email address is + // verified. Always verified because we only return the user's primary + // email address. + Verified_email bool `json:"verified_email,omitempty"` +} + +// method id "oauth2.tokeninfo": + +type TokeninfoCall struct { + s *Service + opt_ map[string]interface{} +} + +// Tokeninfo: Get token info +func (s *Service) Tokeninfo() *TokeninfoCall { + c := &TokeninfoCall{s: s, opt_: make(map[string]interface{})} + return c +} + +// Access_token sets the optional parameter "access_token": The oauth2 +// access token +func (c *TokeninfoCall) Access_token(access_token string) *TokeninfoCall { + c.opt_["access_token"] = access_token + return c +} + +// Id_token sets the optional parameter "id_token": The ID token +func (c *TokeninfoCall) Id_token(id_token string) *TokeninfoCall { + c.opt_["id_token"] = id_token + return c +} + +func (c *TokeninfoCall) Do() (*Tokeninfo, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["access_token"]; ok { + params.Set("access_token", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["id_token"]; ok { + params.Set("id_token", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "oauth2/v1/tokeninfo") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Tokeninfo) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get token info", + // "httpMethod": "POST", + // "id": "oauth2.tokeninfo", + // "parameters": { + // "access_token": { + // "description": "The oauth2 access token", + // "location": "query", + // "type": "string" + // }, + // "id_token": { + // "description": "The ID token", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "oauth2/v1/tokeninfo", + // "response": { + // "$ref": "Tokeninfo" + // } + // } + +} + +// method id "oauth2.userinfo.get": + +type UserinfoGetCall struct { + s *Service + opt_ map[string]interface{} +} + +// Get: Get user info +func (r *UserinfoService) Get() *UserinfoGetCall { + c := &UserinfoGetCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *UserinfoGetCall) Do() (*Userinfoplus, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "oauth2/v1/userinfo") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Userinfoplus) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get user info", + // "httpMethod": "GET", + // "id": "oauth2.userinfo.get", + // "path": "oauth2/v1/userinfo", + // "response": { + // "$ref": "Userinfoplus" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me", + // "https://www.googleapis.com/auth/userinfo.email", + // "https://www.googleapis.com/auth/userinfo.profile" + // ] + // } + +} + +// method id "oauth2.userinfo.v2.me.get": + +type UserinfoV2MeGetCall struct { + s *Service + opt_ map[string]interface{} +} + +// Get: Get user info +func (r *UserinfoV2MeService) Get() *UserinfoV2MeGetCall { + c := &UserinfoV2MeGetCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *UserinfoV2MeGetCall) Do() (*Userinfoplus, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userinfo/v2/me") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Userinfoplus) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get user info", + // "httpMethod": "GET", + // "id": "oauth2.userinfo.v2.me.get", + // "path": "userinfo/v2/me", + // "response": { + // "$ref": "Userinfoplus" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me", + // "https://www.googleapis.com/auth/userinfo.email", + // "https://www.googleapis.com/auth/userinfo.profile" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/oauth2/v2/oauth2-api.json b/third_party/src/code.google.com/p/google-api-go-client/oauth2/v2/oauth2-api.json new file mode 100644 index 0000000000000..f2dc9f4b90497 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/oauth2/v2/oauth2-api.json @@ -0,0 +1,242 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/czsLFT9it2ZNLIudcLONTk9pYrY\"", + "discoveryVersion": "v1", + "id": "oauth2:v2", + "name": "oauth2", + "version": "v2", + "title": "Google OAuth2 API", + "description": "Lets you access OAuth2 protocol related APIs.", + "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/accounts/docs/OAuth2", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/", + "basePath": "/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "", + "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/plus.login": { + "description": "Know your basic profile info and list of people in your circles." + }, + "https://www.googleapis.com/auth/plus.me": { + "description": "Know who you are on Google" + }, + "https://www.googleapis.com/auth/userinfo.email": { + "description": "View your email address" + }, + "https://www.googleapis.com/auth/userinfo.profile": { + "description": "View basic information about your account" + } + } + } + }, + "schemas": { + "Tokeninfo": { + "id": "Tokeninfo", + "type": "object", + "properties": { + "access_type": { + "type": "string", + "description": "The access type granted with this token. It can be offline or online." + }, + "audience": { + "type": "string", + "description": "Who is the intended audience for this token. In general the same as issued_to." + }, + "email": { + "type": "string", + "description": "The email address of the user. Present only if the email scope is present in the request." + }, + "expires_in": { + "type": "integer", + "description": "The expiry time of the token, as number of seconds left until expiry.", + "format": "int32" + }, + "issued_to": { + "type": "string", + "description": "To whom was the token issued to. In general the same as audience." + }, + "scope": { + "type": "string", + "description": "The space separated list of scopes granted to this token." + }, + "user_id": { + "type": "string", + "description": "The Gaia obfuscated user id." + }, + "verified_email": { + "type": "boolean", + "description": "Boolean flag which is true if the email address is verified. Present only if the email scope is present in the request." + } + } + }, + "Userinfoplus": { + "id": "Userinfoplus", + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The user's email address." + }, + "family_name": { + "type": "string", + "description": "The user's last name." + }, + "gender": { + "type": "string", + "description": "The user's gender." + }, + "given_name": { + "type": "string", + "description": "The user's first name." + }, + "hd": { + "type": "string", + "description": "The hosted domain e.g. example.com if the user is Google apps user." + }, + "id": { + "type": "string", + "description": "The focus obfuscated gaia id of the user." + }, + "link": { + "type": "string", + "description": "URL of the profile page." + }, + "locale": { + "type": "string", + "description": "The user's preferred locale." + }, + "name": { + "type": "string", + "description": "The user's full name." + }, + "picture": { + "type": "string", + "description": "URL of the user's picture image." + }, + "verified_email": { + "type": "boolean", + "description": "Boolean flag which is true if the email address is verified. Always verified because we only return the user's primary email address.", + "default": "true" + } + } + } + }, + "methods": { + "tokeninfo": { + "id": "oauth2.tokeninfo", + "path": "oauth2/v2/tokeninfo", + "httpMethod": "POST", + "parameters": { + "access_token": { + "type": "string", + "location": "query" + }, + "id_token": { + "type": "string", + "location": "query" + } + }, + "response": { + "$ref": "Tokeninfo" + } + } + }, + "resources": { + "userinfo": { + "methods": { + "get": { + "id": "oauth2.userinfo.get", + "path": "oauth2/v2/userinfo", + "httpMethod": "GET", + "response": { + "$ref": "Userinfoplus" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me", + "https://www.googleapis.com/auth/userinfo.email", + "https://www.googleapis.com/auth/userinfo.profile" + ] + } + }, + "resources": { + "v2": { + "resources": { + "me": { + "methods": { + "get": { + "id": "oauth2.userinfo.v2.me.get", + "path": "userinfo/v2/me", + "httpMethod": "GET", + "response": { + "$ref": "Userinfoplus" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me", + "https://www.googleapis.com/auth/userinfo.email", + "https://www.googleapis.com/auth/userinfo.profile" + ] + } + } + } + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/oauth2/v2/oauth2-gen.go b/third_party/src/code.google.com/p/google-api-go-client/oauth2/v2/oauth2-gen.go new file mode 100644 index 0000000000000..bfa61293568b2 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/oauth2/v2/oauth2-gen.go @@ -0,0 +1,352 @@ +// Package oauth2 provides access to the Google OAuth2 API. +// +// See https://developers.google.com/accounts/docs/OAuth2 +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/oauth2/v2" +// ... +// oauth2Service, err := oauth2.New(oauthHttpClient) +package oauth2 + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "oauth2:v2" +const apiName = "oauth2" +const apiVersion = "v2" +const basePath = "https://www.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // Know your basic profile info and list of people in your circles. + PlusLoginScope = "https://www.googleapis.com/auth/plus.login" + + // Know who you are on Google + PlusMeScope = "https://www.googleapis.com/auth/plus.me" + + // View your email address + UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email" + + // View basic information about your account + UserinfoProfileScope = "https://www.googleapis.com/auth/userinfo.profile" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Userinfo = NewUserinfoService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Userinfo *UserinfoService +} + +func NewUserinfoService(s *Service) *UserinfoService { + rs := &UserinfoService{s: s} + rs.V2 = NewUserinfoV2Service(s) + return rs +} + +type UserinfoService struct { + s *Service + + V2 *UserinfoV2Service +} + +func NewUserinfoV2Service(s *Service) *UserinfoV2Service { + rs := &UserinfoV2Service{s: s} + rs.Me = NewUserinfoV2MeService(s) + return rs +} + +type UserinfoV2Service struct { + s *Service + + Me *UserinfoV2MeService +} + +func NewUserinfoV2MeService(s *Service) *UserinfoV2MeService { + rs := &UserinfoV2MeService{s: s} + return rs +} + +type UserinfoV2MeService struct { + s *Service +} + +type Tokeninfo struct { + // Access_type: The access type granted with this token. It can be + // offline or online. + Access_type string `json:"access_type,omitempty"` + + // Audience: Who is the intended audience for this token. In general the + // same as issued_to. + Audience string `json:"audience,omitempty"` + + // Email: The email address of the user. Present only if the email scope + // is present in the request. + Email string `json:"email,omitempty"` + + // Expires_in: The expiry time of the token, as number of seconds left + // until expiry. + Expires_in int64 `json:"expires_in,omitempty"` + + // Issued_to: To whom was the token issued to. In general the same as + // audience. + Issued_to string `json:"issued_to,omitempty"` + + // Scope: The space separated list of scopes granted to this token. + Scope string `json:"scope,omitempty"` + + // User_id: The Gaia obfuscated user id. + User_id string `json:"user_id,omitempty"` + + // Verified_email: Boolean flag which is true if the email address is + // verified. Present only if the email scope is present in the request. + Verified_email bool `json:"verified_email,omitempty"` +} + +type Userinfoplus struct { + // Email: The user's email address. + Email string `json:"email,omitempty"` + + // Family_name: The user's last name. + Family_name string `json:"family_name,omitempty"` + + // Gender: The user's gender. + Gender string `json:"gender,omitempty"` + + // Given_name: The user's first name. + Given_name string `json:"given_name,omitempty"` + + // Hd: The hosted domain e.g. example.com if the user is Google apps + // user. + Hd string `json:"hd,omitempty"` + + // Id: The focus obfuscated gaia id of the user. + Id string `json:"id,omitempty"` + + // Link: URL of the profile page. + Link string `json:"link,omitempty"` + + // Locale: The user's preferred locale. + Locale string `json:"locale,omitempty"` + + // Name: The user's full name. + Name string `json:"name,omitempty"` + + // Picture: URL of the user's picture image. + Picture string `json:"picture,omitempty"` + + // Verified_email: Boolean flag which is true if the email address is + // verified. Always verified because we only return the user's primary + // email address. + Verified_email bool `json:"verified_email,omitempty"` +} + +// method id "oauth2.tokeninfo": + +type TokeninfoCall struct { + s *Service + opt_ map[string]interface{} +} + +// Tokeninfo: +func (s *Service) Tokeninfo() *TokeninfoCall { + c := &TokeninfoCall{s: s, opt_: make(map[string]interface{})} + return c +} + +// Access_token sets the optional parameter "access_token": +func (c *TokeninfoCall) Access_token(access_token string) *TokeninfoCall { + c.opt_["access_token"] = access_token + return c +} + +// Id_token sets the optional parameter "id_token": +func (c *TokeninfoCall) Id_token(id_token string) *TokeninfoCall { + c.opt_["id_token"] = id_token + return c +} + +func (c *TokeninfoCall) Do() (*Tokeninfo, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["access_token"]; ok { + params.Set("access_token", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["id_token"]; ok { + params.Set("id_token", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "oauth2/v2/tokeninfo") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Tokeninfo) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "POST", + // "id": "oauth2.tokeninfo", + // "parameters": { + // "access_token": { + // "location": "query", + // "type": "string" + // }, + // "id_token": { + // "location": "query", + // "type": "string" + // } + // }, + // "path": "oauth2/v2/tokeninfo", + // "response": { + // "$ref": "Tokeninfo" + // } + // } + +} + +// method id "oauth2.userinfo.get": + +type UserinfoGetCall struct { + s *Service + opt_ map[string]interface{} +} + +// Get: +func (r *UserinfoService) Get() *UserinfoGetCall { + c := &UserinfoGetCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *UserinfoGetCall) Do() (*Userinfoplus, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "oauth2/v2/userinfo") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Userinfoplus) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "oauth2.userinfo.get", + // "path": "oauth2/v2/userinfo", + // "response": { + // "$ref": "Userinfoplus" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me", + // "https://www.googleapis.com/auth/userinfo.email", + // "https://www.googleapis.com/auth/userinfo.profile" + // ] + // } + +} + +// method id "oauth2.userinfo.v2.me.get": + +type UserinfoV2MeGetCall struct { + s *Service + opt_ map[string]interface{} +} + +// Get: +func (r *UserinfoV2MeService) Get() *UserinfoV2MeGetCall { + c := &UserinfoV2MeGetCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *UserinfoV2MeGetCall) Do() (*Userinfoplus, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "userinfo/v2/me") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Userinfoplus) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "oauth2.userinfo.v2.me.get", + // "path": "userinfo/v2/me", + // "response": { + // "$ref": "Userinfoplus" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me", + // "https://www.googleapis.com/auth/userinfo.email", + // "https://www.googleapis.com/auth/userinfo.profile" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/orkut/v2/orkut-api.json b/third_party/src/code.google.com/p/google-api-go-client/orkut/v2/orkut-api.json new file mode 100644 index 0000000000000..aee0d749e3c95 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/orkut/v2/orkut-api.json @@ -0,0 +1,2451 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/xiMdcGrwm4vNaftUqbcmg_X46_0\"", + "discoveryVersion": "v1", + "id": "orkut:v2", + "name": "orkut", + "version": "v2", + "title": "Orkut API", + "description": "Lets you manage activities, comments and badges in Orkut. More stuff coming in time.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/orkut-16.png", + "x32": "http://www.google.com/images/icons/product/orkut-32.png" + }, + "documentationLink": "http://code.google.com/apis/orkut/v2/reference.html", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/orkut/v2/", + "basePath": "/orkut/v2/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "orkut/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/orkut": { + "description": "Manage your Orkut activity" + }, + "https://www.googleapis.com/auth/orkut.readonly": { + "description": "View your Orkut data" + } + } + } + }, + "schemas": { + "Acl": { + "id": "Acl", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Human readable description of the access granted." + }, + "items": { + "type": "array", + "description": "The list of ACL entries.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the entity. For entities of type \"person\" or \"circle\", this is the ID of the resource. For other types, this will be unset." + }, + "type": { + "type": "string", + "description": "The type of entity to whom access is granted." + } + } + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as an access control list. Value: \"orkut#acl\"", + "default": "orkut#acl" + }, + "totalParticipants": { + "type": "integer", + "description": "The total count of participants of the parent resource.", + "format": "int32" + } + } + }, + "Activity": { + "id": "Activity", + "type": "object", + "properties": { + "access": { + "$ref": "Acl", + "description": "Identifies who has access to see this activity." + }, + "actor": { + "$ref": "OrkutAuthorResource", + "description": "The person who performed the activity." + }, + "id": { + "type": "string", + "description": "The ID for the activity." + }, + "kind": { + "type": "string", + "description": "The kind of activity. Always orkut#activity.", + "default": "orkut#activity" + }, + "links": { + "type": "array", + "description": "Links to resources related to this activity.", + "items": { + "$ref": "OrkutLinkResource" + } + }, + "object": { + "type": "object", + "description": "The activity's object.", + "properties": { + "content": { + "type": "string", + "description": "The HTML-formatted content, suitable for display. When updating an activity's content, post the changes to this property, using the value of originalContent as a starting point. If the update is successful, the server adds HTML formatting and responds with this formatted content." + }, + "items": { + "type": "array", + "description": "The list of additional items.", + "items": { + "$ref": "OrkutActivityobjectsResource" + } + }, + "objectType": { + "type": "string", + "description": "The type of the object affected by the activity. Clients can use this information to style the rendered activity object differently depending on the content." + }, + "replies": { + "type": "object", + "description": "Comments in reply to this activity.", + "properties": { + "items": { + "type": "array", + "description": "The list of comments.", + "items": { + "$ref": "Comment" + } + }, + "totalItems": { + "type": "string", + "description": "Total number of comments.", + "format": "uint64" + }, + "url": { + "type": "string", + "description": "URL for the collection of comments in reply to this activity." + } + } + } + } + }, + "published": { + "type": "string", + "description": "The time at which the activity was initially published.", + "format": "date-time" + }, + "title": { + "type": "string", + "description": "Title of the activity." + }, + "updated": { + "type": "string", + "description": "The time at which the activity was last updated.", + "format": "date-time" + }, + "verb": { + "type": "string", + "description": "This activity's verb, indicating what action was performed. Possible values are: \n- add - User added new content to profile or album, e.g. video, photo. \n- post - User publish content to the stream, e.g. status, scrap. \n- update - User commented on an activity. \n- make-friend - User added a new friend. \n- birthday - User has a birthday." + } + } + }, + "ActivityList": { + "id": "ActivityList", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "List of activities retrieved.", + "items": { + "$ref": "Activity" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of activities. Value: \"orkut#activityList\"", + "default": "orkut#activityList" + }, + "nextPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in activities.list request to get the next page, if there are more to retrieve." + } + } + }, + "Badge": { + "id": "Badge", + "type": "object", + "properties": { + "badgeLargeLogo": { + "type": "string", + "description": "The URL for the 64x64 badge logo." + }, + "badgeSmallLogo": { + "type": "string", + "description": "The URL for the 24x24 badge logo." + }, + "caption": { + "type": "string", + "description": "The name of the badge, suitable for display." + }, + "description": { + "type": "string", + "description": "The description for the badge, suitable for display." + }, + "id": { + "type": "string", + "description": "The unique ID for the badge.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a badge. Value: \"orkut#badge\"", + "default": "orkut#badge" + }, + "sponsorLogo": { + "type": "string", + "description": "The URL for the 32x32 badge sponsor logo." + }, + "sponsorName": { + "type": "string", + "description": "The name of the badge sponsor, suitable for display." + }, + "sponsorUrl": { + "type": "string", + "description": "The URL for the badge sponsor." + } + } + }, + "BadgeList": { + "id": "BadgeList", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "List of badges retrieved.", + "items": { + "$ref": "Badge" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of badges. Value: \"orkut#badgeList\"", + "default": "orkut#badgeList" + } + } + }, + "Comment": { + "id": "Comment", + "type": "object", + "properties": { + "actor": { + "$ref": "OrkutAuthorResource", + "description": "The person who posted the comment." + }, + "content": { + "type": "string", + "description": "The content of the comment in text/html" + }, + "id": { + "type": "string", + "description": "The unique ID for the comment." + }, + "inReplyTo": { + "type": "object", + "description": "Link to the original activity where this comment was posted.", + "properties": { + "href": { + "type": "string", + "description": "Link to the post on activity stream being commented." + }, + "ref": { + "type": "string", + "description": "Unique identifier of the post on activity stream being commented." + }, + "rel": { + "type": "string", + "description": "Relationship between the comment and the post on activity stream being commented. Always inReplyTo.", + "default": "inReplyTo" + }, + "type": { + "type": "string", + "description": "Type of the post on activity stream being commented. Always text/html." + } + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a comment. Value: \"orkut#comment\"", + "default": "orkut#comment" + }, + "links": { + "type": "array", + "description": "List of resources for the comment.", + "items": { + "$ref": "OrkutLinkResource" + } + }, + "published": { + "type": "string", + "description": "The time the comment was initially published, in RFC 3339 format.", + "format": "date-time" + } + } + }, + "CommentList": { + "id": "CommentList", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "List of comments retrieved.", + "items": { + "$ref": "Comment" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of comments. Value: \"orkut#commentList\"", + "default": "orkut#commentList" + }, + "nextPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in comments.list request to get the next page, if there are more to retrieve." + }, + "previousPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in comments.list request to get the previous page, if there are more to retrieve." + } + } + }, + "Community": { + "id": "Community", + "type": "object", + "properties": { + "category": { + "type": "string", + "description": "The category of the community." + }, + "co_owners": { + "type": "array", + "description": "The co-owners of the community.", + "items": { + "$ref": "OrkutAuthorResource" + } + }, + "creation_date": { + "type": "string", + "description": "The time the community was created, in RFC 3339 format.", + "format": "date-time" + }, + "description": { + "type": "string", + "description": "The description of the community." + }, + "id": { + "type": "integer", + "description": "The id of the community.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a community. Value: \"orkut#community\"", + "default": "orkut#community" + }, + "language": { + "type": "string", + "description": "The official language of the community." + }, + "links": { + "type": "array", + "description": "List of resources for the community.", + "items": { + "$ref": "OrkutLinkResource" + } + }, + "location": { + "type": "string", + "description": "The location of the community." + }, + "member_count": { + "type": "integer", + "description": "The number of users who are part of the community. This number may be approximate, so do not rely on it for iteration.", + "format": "int32" + }, + "moderators": { + "type": "array", + "description": "The list of moderators of the community.", + "items": { + "$ref": "OrkutAuthorResource" + } + }, + "name": { + "type": "string", + "description": "The name of the community." + }, + "owner": { + "$ref": "OrkutAuthorResource", + "description": "The person who owns the community." + }, + "photo_url": { + "type": "string", + "description": "The photo of the community." + } + } + }, + "CommunityList": { + "id": "CommunityList", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "List of communities retrieved.", + "items": { + "$ref": "Community" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of communities. Value: \"orkut#communityList\"", + "default": "orkut#communityList" + } + } + }, + "CommunityMembers": { + "id": "CommunityMembers", + "type": "object", + "properties": { + "communityMembershipStatus": { + "$ref": "CommunityMembershipStatus", + "description": "Status and permissions of the user related to the community." + }, + "kind": { + "type": "string", + "description": "Kind of this item. Always orkut#communityMembers.", + "default": "orkut#communityMembers" + }, + "person": { + "$ref": "OrkutActivitypersonResource", + "description": "Description of the community member." + } + } + }, + "CommunityMembersList": { + "id": "CommunityMembersList", + "type": "object", + "properties": { + "firstPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_members.list request to get the first page." + }, + "items": { + "type": "array", + "description": "List of community members retrieved.", + "items": { + "$ref": "CommunityMembers" + } + }, + "kind": { + "type": "string", + "description": "Kind of this item. Always orkut#communityMembersList.", + "default": "orkut#communityMembersList" + }, + "lastPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_members.list request to get the last page." + }, + "nextPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_members.list request to get the next page, if there are more to retrieve." + }, + "prevPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_members.list request to get the previous page, if there are more to retrieve." + } + } + }, + "CommunityMembershipStatus": { + "id": "CommunityMembershipStatus", + "type": "object", + "properties": { + "canCreatePoll": { + "type": "boolean", + "description": "Whether the user can create a poll in this community." + }, + "canCreateTopic": { + "type": "boolean", + "description": "Whether the user can create a topic in this community." + }, + "canShout": { + "type": "boolean", + "description": "Whether the user can perform a shout operation in this community." + }, + "isCoOwner": { + "type": "boolean", + "description": "Whether the session user is a community co-owner." + }, + "isFollowing": { + "type": "boolean", + "description": "Whether the user is following this community." + }, + "isModerator": { + "type": "boolean", + "description": "Whether the session user is a community moderator." + }, + "isOwner": { + "type": "boolean", + "description": "Whether the session user is the community owner." + }, + "isRestoreAvailable": { + "type": "boolean", + "description": "Whether the restore operation is available for the community." + }, + "isTakebackAvailable": { + "type": "boolean", + "description": "Whether the take-back operation is available for the community." + }, + "kind": { + "type": "string", + "description": "Kind of this item. Always orkut#communityMembershipStatus.", + "default": "orkut#communityMembershipStatus" + }, + "status": { + "type": "string", + "description": "The status of the current link between the community and the user." + } + } + }, + "CommunityMessage": { + "id": "CommunityMessage", + "type": "object", + "properties": { + "addedDate": { + "type": "string", + "description": "The timestamp of the date when the message was added, in RFC 3339 format.", + "format": "date-time" + }, + "author": { + "$ref": "OrkutAuthorResource", + "description": "The creator of the message. If ommited, the message is annonimous." + }, + "body": { + "type": "string", + "description": "The body of the message." + }, + "id": { + "type": "string", + "description": "The ID of the message.", + "format": "int64" + }, + "isSpam": { + "type": "boolean", + "description": "Whether this post was marked as spam by the viewer, when he/she is not the community owner or one of its moderators." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a community message. Value: \"orkut#communityMessage\"", + "default": "orkut#communityMessage" + }, + "links": { + "type": "array", + "description": "List of resources for the community message.", + "items": { + "$ref": "OrkutLinkResource" + } + }, + "subject": { + "type": "string", + "description": "The subject of the message." + } + } + }, + "CommunityMessageList": { + "id": "CommunityMessageList", + "type": "object", + "properties": { + "firstPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_messages.list request to get the first page." + }, + "items": { + "type": "array", + "description": "List of messages retrieved.", + "items": { + "$ref": "CommunityMessage" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of community messages. Value: \"orkut#communityMessageList\"", + "default": "orkut#communityMessageList" + }, + "lastPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_messages.list request to get the last page." + }, + "nextPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_messages.list request to get the next page, if there are more to retrieve." + }, + "prevPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_messages.list request to get the previous page, if there are more to retrieve." + } + } + }, + "CommunityPoll": { + "id": "CommunityPoll", + "type": "object", + "properties": { + "author": { + "$ref": "OrkutAuthorResource", + "description": "The person who created the poll." + }, + "communityId": { + "type": "integer", + "description": "The ID of the community.", + "format": "int32" + }, + "creationTime": { + "type": "string", + "description": "The date of creation of this poll", + "format": "date-time" + }, + "description": { + "type": "string", + "description": "The poll description." + }, + "endingTime": { + "type": "string", + "description": "The ending date of this poll or empty if the poll doesn't have one.", + "format": "date-time" + }, + "hasVoted": { + "type": "boolean", + "description": "Whether the user has voted on this poll." + }, + "id": { + "type": "string", + "description": "The poll ID." + }, + "image": { + "type": "object", + "description": "The image representing the poll. Field is omitted if no image exists.", + "properties": { + "url": { + "type": "string", + "description": "A URL that points to an image of the poll." + } + } + }, + "isClosed": { + "type": "boolean", + "description": "Whether the poll is not expired if there is an expiration date. A poll is open (that is, not closed for voting) if it either is not expired or doesn't have an expiration date at all. Note that just because a poll is open, it doesn't mean that the requester can vote on it." + }, + "isMultipleAnswers": { + "type": "boolean", + "description": "Whether this poll allows voting for more than one option." + }, + "isOpenForVoting": { + "type": "boolean", + "description": "Whether this poll is still opened for voting. A poll is open for voting if it is not closed, the user has not yet voted on it and the user has the permission to do so, which happens if he/she is either a community member or the poll is open for everybody." + }, + "isRestricted": { + "type": "boolean", + "description": "Whether this poll is restricted for members only. If a poll is open but the user can't vote on it, it's been restricted to members only. This information is important to tell this case apart from the one where the user can't vote simply because the poll is already closed." + }, + "isSpam": { + "type": "boolean", + "description": "Whether the user has marked this poll as spam. This only affects the poll for this user, not globally." + }, + "isUsersVotePublic": { + "type": "boolean", + "description": "If user has already voted, whether his vote is publicly visible." + }, + "isVotingAllowedForNonMembers": { + "type": "boolean", + "description": "Whether non-members of the community can vote on the poll." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a community poll. Value: \"orkut#communityPoll\"", + "default": "orkut#communityPoll" + }, + "lastUpdate": { + "type": "string", + "description": "The date of the last update of this poll.", + "format": "date-time" + }, + "links": { + "type": "array", + "description": "List of resources for the community poll.", + "items": { + "$ref": "OrkutLinkResource" + } + }, + "options": { + "type": "array", + "description": "List of options of this poll.", + "items": { + "$ref": "OrkutCommunitypolloptionResource" + } + }, + "question": { + "type": "string", + "description": "The poll question." + }, + "totalNumberOfVotes": { + "type": "integer", + "description": "The total number of votes this poll has received.", + "format": "int32" + }, + "votedOptions": { + "type": "array", + "description": "List of options the user has voted on, if there are any.", + "items": { + "type": "integer", + "format": "int32" + } + } + } + }, + "CommunityPollComment": { + "id": "CommunityPollComment", + "type": "object", + "properties": { + "addedDate": { + "type": "string", + "description": "The date when the message was added, in RFC 3339 format.", + "format": "date-time" + }, + "author": { + "$ref": "OrkutAuthorResource", + "description": "The creator of the comment." + }, + "body": { + "type": "string", + "description": "The body of the message." + }, + "id": { + "type": "integer", + "description": "The ID of the comment.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a community poll comment. Value: \"orkut#communityPollComment\"", + "default": "orkut#communityPollComment" + } + } + }, + "CommunityPollCommentList": { + "id": "CommunityPollCommentList", + "type": "object", + "properties": { + "firstPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_poll_comments.list request to get the first page." + }, + "items": { + "type": "array", + "description": "List of community poll comments retrieved.", + "items": { + "$ref": "CommunityPollComment" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of community poll comments. Value: \"orkut#CommunityPollCommentList\"", + "default": "orkut#CommunityPollCommentList" + }, + "lastPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_poll_comments.list request to get the last page." + }, + "nextPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_poll_comments.list request to get the next page, if there are more to retrieve." + }, + "prevPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_poll_comments.list request to get the previous page, if there are more to retrieve." + } + } + }, + "CommunityPollList": { + "id": "CommunityPollList", + "type": "object", + "properties": { + "firstPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_polls.list request to get the first page." + }, + "items": { + "type": "array", + "description": "List of community polls retrieved.", + "items": { + "$ref": "CommunityPoll" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of community polls. Value: \"orkut#communityPollList\"", + "default": "orkut#communityPollList" + }, + "lastPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_polls.list request to get the last page." + }, + "nextPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_polls.list request to get the next page, if there are more to retrieve." + }, + "prevPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_polls.list request to get the previous page, if there are more to retrieve." + } + } + }, + "CommunityPollVote": { + "id": "CommunityPollVote", + "type": "object", + "properties": { + "isVotevisible": { + "type": "boolean", + "description": "Whether this vote is visible to other users or not." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a community poll vote. Value: \"orkut#communityPollVote\"", + "default": "orkut#communityPollVote" + }, + "optionIds": { + "type": "array", + "description": "The ids of the voted options.", + "items": { + "type": "integer", + "format": "int32" + } + } + } + }, + "CommunityTopic": { + "id": "CommunityTopic", + "type": "object", + "properties": { + "author": { + "$ref": "OrkutAuthorResource", + "description": "The creator of the topic." + }, + "body": { + "type": "string", + "description": "The body of the topic." + }, + "id": { + "type": "string", + "description": "The ID of the topic.", + "format": "int64" + }, + "isClosed": { + "type": "boolean", + "description": "Whether the topic is closed for new messages." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a community topic. Value: \"orkut#communityTopic\"", + "default": "orkut#communityTopic" + }, + "lastUpdate": { + "type": "string", + "description": "The timestamp of the last update, in RFC 3339 format.", + "format": "date-time" + }, + "latestMessageSnippet": { + "type": "string", + "description": "Snippet of the last message posted on this topic." + }, + "links": { + "type": "array", + "description": "List of resources for the community.", + "items": { + "$ref": "OrkutLinkResource" + } + }, + "messages": { + "type": "array", + "description": "Most recent messages.", + "items": { + "$ref": "CommunityMessage" + } + }, + "numberOfReplies": { + "type": "integer", + "description": "The total number of replies this topic has received.", + "format": "int32" + }, + "title": { + "type": "string", + "description": "The title of the topic." + } + } + }, + "CommunityTopicList": { + "id": "CommunityTopicList", + "type": "object", + "properties": { + "firstPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_topic.list request to get the first page." + }, + "items": { + "type": "array", + "description": "List of topics retrieved.", + "items": { + "$ref": "CommunityTopic" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of community topics. Value: \"orkut#communityTopicList\"", + "default": "orkut#communityTopicList" + }, + "lastPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_topic.list request to get the last page." + }, + "nextPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_topic.list request to get the next page, if there are more to retrieve." + }, + "prevPageToken": { + "type": "string", + "description": "The value of pageToken query parameter in community_topic.list request to get the previous page, if there are more to retrieve." + } + } + }, + "Counters": { + "id": "Counters", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "List of counters retrieved.", + "items": { + "$ref": "OrkutCounterResource" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of counters. Value: \"orkut#counters\"", + "default": "orkut#counters" + } + } + }, + "OrkutActivityobjectsResource": { + "id": "OrkutActivityobjectsResource", + "type": "object", + "properties": { + "community": { + "$ref": "Community", + "description": "The community which is related with this activity, e.g. a joined community." + }, + "content": { + "type": "string", + "description": "The HTML-formatted content, suitable for display. When updating an activity's content, post the changes to this property, using the value of originalContent as a starting point. If the update is successful, the server adds HTML formatting and responds with this formatted content." + }, + "displayName": { + "type": "string", + "description": "The title of the object." + }, + "id": { + "type": "string", + "description": "The ID for the object." + }, + "links": { + "type": "array", + "description": "Links to other resources related to this object.", + "items": { + "$ref": "OrkutLinkResource" + } + }, + "objectType": { + "type": "string", + "description": "The object type." + }, + "person": { + "$ref": "OrkutActivitypersonResource", + "description": "The person who is related with this activity, e.g. an Added User." + } + } + }, + "OrkutActivitypersonResource": { + "id": "OrkutActivitypersonResource", + "type": "object", + "properties": { + "birthday": { + "type": "string", + "description": "The person's date of birth, represented as YYYY-MM-DD." + }, + "gender": { + "type": "string", + "description": "The person's gender. Values include \"male\", \"female\", and \"other\"." + }, + "id": { + "type": "string", + "description": "The person's opensocial ID." + }, + "image": { + "type": "object", + "description": "The person's profile photo. This is adapted from Google+ and was originaly introduced as extra OpenSocial convenience fields.", + "properties": { + "url": { + "type": "string", + "description": "The URL of the person's profile photo." + } + } + }, + "name": { + "type": "object", + "description": "An object that encapsulates the individual components of a person's name.", + "properties": { + "familyName": { + "type": "string", + "description": "The family name (last name) of this person." + }, + "givenName": { + "type": "string", + "description": "The given name (first name) of this person." + } + } + }, + "url": { + "type": "string", + "description": "The person's profile url. This is adapted from Google+ and was originaly introduced as extra OpenSocial convenience fields." + } + } + }, + "OrkutAuthorResource": { + "id": "OrkutAuthorResource", + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "The name of the author, suitable for display." + }, + "id": { + "type": "string", + "description": "Unique identifier of the person who posted the comment. This is the person's OpenSocial ID." + }, + "image": { + "type": "object", + "description": "Image data about the author.", + "properties": { + "url": { + "type": "string", + "description": "A URL that points to a thumbnail photo of the author." + } + } + }, + "url": { + "type": "string", + "description": "The URL of the author who posted the comment [not yet implemented]" + } + } + }, + "OrkutCommunitypolloptionResource": { + "id": "OrkutCommunitypolloptionResource", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "The option description." + }, + "image": { + "type": "object", + "description": "Image data about the poll option. Field is omitted if no image exists.", + "properties": { + "url": { + "type": "string", + "description": "A URL that points to an image of the poll question." + } + } + }, + "numberOfVotes": { + "type": "integer", + "description": "The total number of votes that this option received.", + "format": "int32" + }, + "optionId": { + "type": "integer", + "description": "The poll option ID", + "format": "int32" + } + } + }, + "OrkutCounterResource": { + "id": "OrkutCounterResource", + "type": "object", + "properties": { + "link": { + "$ref": "OrkutLinkResource", + "description": "Link to the collection being counted." + }, + "name": { + "type": "string", + "description": "The name of the counted collection. Currently supported collections are: \n- scraps - The scraps of the user. \n- photos - The photos of the user. \n- videos - The videos of the user. \n- pendingTestimonials - The pending testimonials of the user." + }, + "total": { + "type": "integer", + "description": "The number of resources on the counted collection.", + "format": "int32" + } + } + }, + "OrkutLinkResource": { + "id": "OrkutLinkResource", + "type": "object", + "description": "Links to resources related to the parent object.", + "properties": { + "href": { + "type": "string", + "description": "URL of the link." + }, + "rel": { + "type": "string", + "description": "Relation between the resource and the parent object." + }, + "title": { + "type": "string", + "description": "Title of the link." + }, + "type": { + "type": "string", + "description": "Media type of the link." + } + } + }, + "Visibility": { + "id": "Visibility", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies this resource as a visibility item. Value: \"orkut#visibility\"", + "default": "orkut#visibility" + }, + "links": { + "type": "array", + "description": "List of resources for the visibility item.", + "items": { + "$ref": "OrkutLinkResource" + } + }, + "visibility": { + "type": "string", + "description": "The visibility of the resource. Possible values are: \n- default: not hidden by the user \n- hidden: hidden" + } + } + } + }, + "resources": { + "acl": { + "methods": { + "delete": { + "id": "orkut.acl.delete", + "path": "activities/{activityId}/acl/{userId}", + "httpMethod": "DELETE", + "description": "Excludes an element from the ACL of the activity.", + "parameters": { + "activityId": { + "type": "string", + "description": "ID of the activity.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "ID of the user to be removed from the activity.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "activityId", + "userId" + ], + "scopes": [ + "https://www.googleapis.com/auth/orkut" + ] + } + } + }, + "activities": { + "methods": { + "delete": { + "id": "orkut.activities.delete", + "path": "activities/{activityId}", + "httpMethod": "DELETE", + "description": "Deletes an existing activity, if the access controls allow it.", + "parameters": { + "activityId": { + "type": "string", + "description": "ID of the activity to remove.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "activityId" + ], + "scopes": [ + "https://www.googleapis.com/auth/orkut" + ] + }, + "list": { + "id": "orkut.activities.list", + "path": "people/{userId}/activities/{collection}", + "httpMethod": "GET", + "description": "Retrieves a list of activities.", + "parameters": { + "collection": { + "type": "string", + "description": "The collection of activities to list.", + "required": true, + "enum": [ + "all", + "scraps", + "stream" + ], + "enumDescriptions": [ + "All activities created by the specified user that the authenticated user is authorized to view.", + "The specified user's scrapbook.", + "The specified user's stream feed, intended for consumption. This includes activities posted by people that the user is following, and activities in which the user has been mentioned." + ], + "location": "path" + }, + "hl": { + "type": "string", + "description": "Specifies the interface language (host language) of your user interface.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of activities to include in the response.", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token that allows pagination.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user whose activities will be listed. Can be me to refer to the viewer (i.e. the authenticated user).", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "collection" + ], + "response": { + "$ref": "ActivityList" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut", + "https://www.googleapis.com/auth/orkut.readonly" + ] + } + } + }, + "activityVisibility": { + "methods": { + "get": { + "id": "orkut.activityVisibility.get", + "path": "activities/{activityId}/visibility", + "httpMethod": "GET", + "description": "Gets the visibility of an existing activity.", + "parameters": { + "activityId": { + "type": "string", + "description": "ID of the activity to get the visibility.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "activityId" + ], + "response": { + "$ref": "Visibility" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut", + "https://www.googleapis.com/auth/orkut.readonly" + ] + }, + "patch": { + "id": "orkut.activityVisibility.patch", + "path": "activities/{activityId}/visibility", + "httpMethod": "PATCH", + "description": "Updates the visibility of an existing activity. This method supports patch semantics.", + "parameters": { + "activityId": { + "type": "string", + "description": "ID of the activity.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "activityId" + ], + "request": { + "$ref": "Visibility" + }, + "response": { + "$ref": "Visibility" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut" + ] + }, + "update": { + "id": "orkut.activityVisibility.update", + "path": "activities/{activityId}/visibility", + "httpMethod": "PUT", + "description": "Updates the visibility of an existing activity.", + "parameters": { + "activityId": { + "type": "string", + "description": "ID of the activity.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "activityId" + ], + "request": { + "$ref": "Visibility" + }, + "response": { + "$ref": "Visibility" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut" + ] + } + } + }, + "badges": { + "methods": { + "get": { + "id": "orkut.badges.get", + "path": "people/{userId}/badges/{badgeId}", + "httpMethod": "GET", + "description": "Retrieves a badge from a user.", + "parameters": { + "badgeId": { + "type": "string", + "description": "The ID of the badge that will be retrieved.", + "required": true, + "format": "int64", + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user whose badges will be listed. Can be me to refer to caller.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "badgeId" + ], + "response": { + "$ref": "Badge" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut", + "https://www.googleapis.com/auth/orkut.readonly" + ] + }, + "list": { + "id": "orkut.badges.list", + "path": "people/{userId}/badges", + "httpMethod": "GET", + "description": "Retrieves the list of visible badges of a user.", + "parameters": { + "userId": { + "type": "string", + "description": "The id of the user whose badges will be listed. Can be me to refer to caller.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "BadgeList" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut", + "https://www.googleapis.com/auth/orkut.readonly" + ] + } + } + }, + "comments": { + "methods": { + "delete": { + "id": "orkut.comments.delete", + "path": "comments/{commentId}", + "httpMethod": "DELETE", + "description": "Deletes an existing comment.", + "parameters": { + "commentId": { + "type": "string", + "description": "ID of the comment to remove.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "commentId" + ], + "scopes": [ + "https://www.googleapis.com/auth/orkut" + ] + }, + "get": { + "id": "orkut.comments.get", + "path": "comments/{commentId}", + "httpMethod": "GET", + "description": "Retrieves an existing comment.", + "parameters": { + "commentId": { + "type": "string", + "description": "ID of the comment to get.", + "required": true, + "location": "path" + }, + "hl": { + "type": "string", + "description": "Specifies the interface language (host language) of your user interface.", + "location": "query" + } + }, + "parameterOrder": [ + "commentId" + ], + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut", + "https://www.googleapis.com/auth/orkut.readonly" + ] + }, + "insert": { + "id": "orkut.comments.insert", + "path": "activities/{activityId}/comments", + "httpMethod": "POST", + "description": "Inserts a new comment to an activity.", + "parameters": { + "activityId": { + "type": "string", + "description": "The ID of the activity to contain the new comment.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "activityId" + ], + "request": { + "$ref": "Comment" + }, + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut" + ] + }, + "list": { + "id": "orkut.comments.list", + "path": "activities/{activityId}/comments", + "httpMethod": "GET", + "description": "Retrieves a list of comments, possibly filtered.", + "parameters": { + "activityId": { + "type": "string", + "description": "The ID of the activity containing the comments.", + "required": true, + "location": "path" + }, + "hl": { + "type": "string", + "description": "Specifies the interface language (host language) of your user interface.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of activities to include in the response.", + "format": "uint32", + "minimum": "1", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sort search results.", + "default": "DESCENDING_SORT", + "enum": [ + "ascending", + "descending" + ], + "enumDescriptions": [ + "Use ascending sort order.", + "Use descending sort order." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token that allows pagination.", + "location": "query" + } + }, + "parameterOrder": [ + "activityId" + ], + "response": { + "$ref": "CommentList" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut", + "https://www.googleapis.com/auth/orkut.readonly" + ] + } + } + }, + "communities": { + "methods": { + "get": { + "id": "orkut.communities.get", + "path": "communities/{communityId}", + "httpMethod": "GET", + "description": "Retrieves the basic information (aka. profile) of a community.", + "parameters": { + "communityId": { + "type": "integer", + "description": "The ID of the community to get.", + "required": true, + "format": "int32", + "location": "path" + }, + "hl": { + "type": "string", + "description": "Specifies the interface language (host language) of your user interface.", + "location": "query" + } + }, + "parameterOrder": [ + "communityId" + ], + "response": { + "$ref": "Community" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut", + "https://www.googleapis.com/auth/orkut.readonly" + ] + }, + "list": { + "id": "orkut.communities.list", + "path": "people/{userId}/communities", + "httpMethod": "GET", + "description": "Retrieves the list of communities the current user is a member of.", + "parameters": { + "hl": { + "type": "string", + "description": "Specifies the interface language (host language) of your user interface.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of communities to include in the response.", + "format": "uint32", + "minimum": "1", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "How to order the communities by.", + "enum": [ + "id", + "ranked" + ], + "enumDescriptions": [ + "Returns the communities sorted by a fixed, natural order.", + "Returns the communities ranked accordingly to how they are displayed on the orkut web application." + ], + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user whose communities will be listed. Can be me to refer to caller.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "CommunityList" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut", + "https://www.googleapis.com/auth/orkut.readonly" + ] + } + } + }, + "communityFollow": { + "methods": { + "delete": { + "id": "orkut.communityFollow.delete", + "path": "communities/{communityId}/followers/{userId}", + "httpMethod": "DELETE", + "description": "Removes a user from the followers of a community.", + "parameters": { + "communityId": { + "type": "integer", + "description": "ID of the community.", + "required": true, + "format": "int32", + "location": "path" + }, + "userId": { + "type": "string", + "description": "ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "communityId", + "userId" + ], + "scopes": [ + "https://www.googleapis.com/auth/orkut" + ] + }, + "insert": { + "id": "orkut.communityFollow.insert", + "path": "communities/{communityId}/followers/{userId}", + "httpMethod": "POST", + "description": "Adds a user as a follower of a community.", + "parameters": { + "communityId": { + "type": "integer", + "description": "ID of the community.", + "required": true, + "format": "int32", + "location": "path" + }, + "userId": { + "type": "string", + "description": "ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "communityId", + "userId" + ], + "response": { + "$ref": "CommunityMembers" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut" + ] + } + } + }, + "communityMembers": { + "methods": { + "delete": { + "id": "orkut.communityMembers.delete", + "path": "communities/{communityId}/members/{userId}", + "httpMethod": "DELETE", + "description": "Makes the user leave a community.", + "parameters": { + "communityId": { + "type": "integer", + "description": "ID of the community.", + "required": true, + "format": "int32", + "location": "path" + }, + "userId": { + "type": "string", + "description": "ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "communityId", + "userId" + ], + "scopes": [ + "https://www.googleapis.com/auth/orkut" + ] + }, + "get": { + "id": "orkut.communityMembers.get", + "path": "communities/{communityId}/members/{userId}", + "httpMethod": "GET", + "description": "Retrieves the relationship between a user and a community.", + "parameters": { + "communityId": { + "type": "integer", + "description": "ID of the community.", + "required": true, + "format": "int32", + "location": "path" + }, + "hl": { + "type": "string", + "description": "Specifies the interface language (host language) of your user interface.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "communityId", + "userId" + ], + "response": { + "$ref": "CommunityMembers" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut", + "https://www.googleapis.com/auth/orkut.readonly" + ] + }, + "insert": { + "id": "orkut.communityMembers.insert", + "path": "communities/{communityId}/members/{userId}", + "httpMethod": "POST", + "description": "Makes the user join a community.", + "parameters": { + "communityId": { + "type": "integer", + "description": "ID of the community.", + "required": true, + "format": "int32", + "location": "path" + }, + "userId": { + "type": "string", + "description": "ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "communityId", + "userId" + ], + "response": { + "$ref": "CommunityMembers" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut" + ] + }, + "list": { + "id": "orkut.communityMembers.list", + "path": "communities/{communityId}/members", + "httpMethod": "GET", + "description": "Lists members of a community. Use the pagination tokens to retrieve the full list; do not rely on the member count available in the community profile information to know when to stop iterating, as that count may be approximate.", + "parameters": { + "communityId": { + "type": "integer", + "description": "The ID of the community whose members will be listed.", + "required": true, + "format": "int32", + "location": "path" + }, + "friendsOnly": { + "type": "boolean", + "description": "Whether to list only community members who are friends of the user.", + "location": "query" + }, + "hl": { + "type": "string", + "description": "Specifies the interface language (host language) of your user interface.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of members to include in the response.", + "format": "uint32", + "minimum": "1", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token that allows pagination.", + "location": "query" + } + }, + "parameterOrder": [ + "communityId" + ], + "response": { + "$ref": "CommunityMembersList" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut", + "https://www.googleapis.com/auth/orkut.readonly" + ] + } + } + }, + "communityMessages": { + "methods": { + "delete": { + "id": "orkut.communityMessages.delete", + "path": "communities/{communityId}/topics/{topicId}/messages/{messageId}", + "httpMethod": "DELETE", + "description": "Moves a message of the community to the trash folder.", + "parameters": { + "communityId": { + "type": "integer", + "description": "The ID of the community whose message will be moved to the trash folder.", + "required": true, + "format": "int32", + "location": "path" + }, + "messageId": { + "type": "string", + "description": "The ID of the message to be moved to the trash folder.", + "required": true, + "format": "int64", + "location": "path" + }, + "topicId": { + "type": "string", + "description": "The ID of the topic whose message will be moved to the trash folder.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "communityId", + "topicId", + "messageId" + ], + "scopes": [ + "https://www.googleapis.com/auth/orkut" + ] + }, + "insert": { + "id": "orkut.communityMessages.insert", + "path": "communities/{communityId}/topics/{topicId}/messages", + "httpMethod": "POST", + "description": "Adds a message to a given community topic.", + "parameters": { + "communityId": { + "type": "integer", + "description": "The ID of the community the message should be added to.", + "required": true, + "format": "int32", + "location": "path" + }, + "topicId": { + "type": "string", + "description": "The ID of the topic the message should be added to.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "communityId", + "topicId" + ], + "request": { + "$ref": "CommunityMessage" + }, + "response": { + "$ref": "CommunityMessage" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut" + ] + }, + "list": { + "id": "orkut.communityMessages.list", + "path": "communities/{communityId}/topics/{topicId}/messages", + "httpMethod": "GET", + "description": "Retrieves the messages of a topic of a community.", + "parameters": { + "communityId": { + "type": "integer", + "description": "The ID of the community which messages will be listed.", + "required": true, + "format": "int32", + "location": "path" + }, + "hl": { + "type": "string", + "description": "Specifies the interface language (host language) of your user interface.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of messages to include in the response.", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token that allows pagination.", + "location": "query" + }, + "topicId": { + "type": "string", + "description": "The ID of the topic which messages will be listed.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "communityId", + "topicId" + ], + "response": { + "$ref": "CommunityMessageList" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut", + "https://www.googleapis.com/auth/orkut.readonly" + ] + } + } + }, + "communityPollComments": { + "methods": { + "insert": { + "id": "orkut.communityPollComments.insert", + "path": "communities/{communityId}/polls/{pollId}/comments", + "httpMethod": "POST", + "description": "Adds a comment on a community poll.", + "parameters": { + "communityId": { + "type": "integer", + "description": "The ID of the community whose poll is being commented.", + "required": true, + "format": "int32", + "location": "path" + }, + "pollId": { + "type": "string", + "description": "The ID of the poll being commented.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "communityId", + "pollId" + ], + "request": { + "$ref": "CommunityPollComment" + }, + "response": { + "$ref": "CommunityPollComment" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut" + ] + }, + "list": { + "id": "orkut.communityPollComments.list", + "path": "communities/{communityId}/polls/{pollId}/comments", + "httpMethod": "GET", + "description": "Retrieves the comments of a community poll.", + "parameters": { + "communityId": { + "type": "integer", + "description": "The ID of the community whose poll is having its comments listed.", + "required": true, + "format": "int32", + "location": "path" + }, + "hl": { + "type": "string", + "description": "Specifies the interface language (host language) of your user interface.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of comments to include in the response.", + "format": "uint32", + "minimum": "1", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token that allows pagination.", + "location": "query" + }, + "pollId": { + "type": "string", + "description": "The ID of the community whose polls will be listed.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "communityId", + "pollId" + ], + "response": { + "$ref": "CommunityPollCommentList" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut", + "https://www.googleapis.com/auth/orkut.readonly" + ] + } + } + }, + "communityPollVotes": { + "methods": { + "insert": { + "id": "orkut.communityPollVotes.insert", + "path": "communities/{communityId}/polls/{pollId}/votes", + "httpMethod": "POST", + "description": "Votes on a community poll.", + "parameters": { + "communityId": { + "type": "integer", + "description": "The ID of the community whose poll is being voted.", + "required": true, + "format": "int32", + "location": "path" + }, + "pollId": { + "type": "string", + "description": "The ID of the poll being voted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "communityId", + "pollId" + ], + "request": { + "$ref": "CommunityPollVote" + }, + "response": { + "$ref": "CommunityPollVote" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut" + ] + } + } + }, + "communityPolls": { + "methods": { + "get": { + "id": "orkut.communityPolls.get", + "path": "communities/{communityId}/polls/{pollId}", + "httpMethod": "GET", + "description": "Retrieves one specific poll of a community.", + "parameters": { + "communityId": { + "type": "integer", + "description": "The ID of the community for whose poll will be retrieved.", + "required": true, + "format": "int32", + "location": "path" + }, + "hl": { + "type": "string", + "description": "Specifies the interface language (host language) of your user interface.", + "location": "query" + }, + "pollId": { + "type": "string", + "description": "The ID of the poll to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "communityId", + "pollId" + ], + "response": { + "$ref": "CommunityPoll" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut", + "https://www.googleapis.com/auth/orkut.readonly" + ] + }, + "list": { + "id": "orkut.communityPolls.list", + "path": "communities/{communityId}/polls", + "httpMethod": "GET", + "description": "Retrieves the polls of a community.", + "parameters": { + "communityId": { + "type": "integer", + "description": "The ID of the community which polls will be listed.", + "required": true, + "format": "int32", + "location": "path" + }, + "hl": { + "type": "string", + "description": "Specifies the interface language (host language) of your user interface.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of polls to include in the response.", + "format": "uint32", + "minimum": "1", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token that allows pagination.", + "location": "query" + } + }, + "parameterOrder": [ + "communityId" + ], + "response": { + "$ref": "CommunityPollList" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut", + "https://www.googleapis.com/auth/orkut.readonly" + ] + } + } + }, + "communityRelated": { + "methods": { + "list": { + "id": "orkut.communityRelated.list", + "path": "communities/{communityId}/related", + "httpMethod": "GET", + "description": "Retrieves the communities related to another one.", + "parameters": { + "communityId": { + "type": "integer", + "description": "The ID of the community whose related communities will be listed.", + "required": true, + "format": "int32", + "location": "path" + }, + "hl": { + "type": "string", + "description": "Specifies the interface language (host language) of your user interface.", + "location": "query" + } + }, + "parameterOrder": [ + "communityId" + ], + "response": { + "$ref": "CommunityList" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut", + "https://www.googleapis.com/auth/orkut.readonly" + ] + } + } + }, + "communityTopics": { + "methods": { + "delete": { + "id": "orkut.communityTopics.delete", + "path": "communities/{communityId}/topics/{topicId}", + "httpMethod": "DELETE", + "description": "Moves a topic of the community to the trash folder.", + "parameters": { + "communityId": { + "type": "integer", + "description": "The ID of the community whose topic will be moved to the trash folder.", + "required": true, + "format": "int32", + "location": "path" + }, + "topicId": { + "type": "string", + "description": "The ID of the topic to be moved to the trash folder.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "communityId", + "topicId" + ], + "scopes": [ + "https://www.googleapis.com/auth/orkut" + ] + }, + "get": { + "id": "orkut.communityTopics.get", + "path": "communities/{communityId}/topics/{topicId}", + "httpMethod": "GET", + "description": "Retrieves a topic of a community.", + "parameters": { + "communityId": { + "type": "integer", + "description": "The ID of the community whose topic will be retrieved.", + "required": true, + "format": "int32", + "location": "path" + }, + "hl": { + "type": "string", + "description": "Specifies the interface language (host language) of your user interface.", + "location": "query" + }, + "topicId": { + "type": "string", + "description": "The ID of the topic to get.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "communityId", + "topicId" + ], + "response": { + "$ref": "CommunityTopic" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut", + "https://www.googleapis.com/auth/orkut.readonly" + ] + }, + "insert": { + "id": "orkut.communityTopics.insert", + "path": "communities/{communityId}/topics", + "httpMethod": "POST", + "description": "Adds a topic to a given community.", + "parameters": { + "communityId": { + "type": "integer", + "description": "The ID of the community the topic should be added to.", + "required": true, + "format": "int32", + "location": "path" + }, + "isShout": { + "type": "boolean", + "description": "Whether this topic is a shout.", + "location": "query" + } + }, + "parameterOrder": [ + "communityId" + ], + "request": { + "$ref": "CommunityTopic" + }, + "response": { + "$ref": "CommunityTopic" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut" + ] + }, + "list": { + "id": "orkut.communityTopics.list", + "path": "communities/{communityId}/topics", + "httpMethod": "GET", + "description": "Retrieves the topics of a community.", + "parameters": { + "communityId": { + "type": "integer", + "description": "The ID of the community which topics will be listed.", + "required": true, + "format": "int32", + "location": "path" + }, + "hl": { + "type": "string", + "description": "Specifies the interface language (host language) of your user interface.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of topics to include in the response.", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token that allows pagination.", + "location": "query" + } + }, + "parameterOrder": [ + "communityId" + ], + "response": { + "$ref": "CommunityTopicList" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut", + "https://www.googleapis.com/auth/orkut.readonly" + ] + } + } + }, + "counters": { + "methods": { + "list": { + "id": "orkut.counters.list", + "path": "people/{userId}/counters", + "httpMethod": "GET", + "description": "Retrieves the counters of a user.", + "parameters": { + "userId": { + "type": "string", + "description": "The ID of the user whose counters will be listed. Can be me to refer to caller.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "Counters" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut", + "https://www.googleapis.com/auth/orkut.readonly" + ] + } + } + }, + "scraps": { + "methods": { + "insert": { + "id": "orkut.scraps.insert", + "path": "activities/scraps", + "httpMethod": "POST", + "description": "Creates a new scrap.", + "request": { + "$ref": "Activity" + }, + "response": { + "$ref": "Activity" + }, + "scopes": [ + "https://www.googleapis.com/auth/orkut" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/orkut/v2/orkut-gen.go b/third_party/src/code.google.com/p/google-api-go-client/orkut/v2/orkut-gen.go new file mode 100644 index 0000000000000..2c7141ceddb5d --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/orkut/v2/orkut-gen.go @@ -0,0 +1,4095 @@ +// Package orkut provides access to the Orkut API. +// +// See http://code.google.com/apis/orkut/v2/reference.html +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/orkut/v2" +// ... +// orkutService, err := orkut.New(oauthHttpClient) +package orkut + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "orkut:v2" +const apiName = "orkut" +const apiVersion = "v2" +const basePath = "https://www.googleapis.com/orkut/v2/" + +// OAuth2 scopes used by this API. +const ( + // Manage your Orkut activity + OrkutScope = "https://www.googleapis.com/auth/orkut" + + // View your Orkut data + OrkutReadonlyScope = "https://www.googleapis.com/auth/orkut.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.Acl = NewAclService(s) + s.Activities = NewActivitiesService(s) + s.ActivityVisibility = NewActivityVisibilityService(s) + s.Badges = NewBadgesService(s) + s.Comments = NewCommentsService(s) + s.Communities = NewCommunitiesService(s) + s.CommunityFollow = NewCommunityFollowService(s) + s.CommunityMembers = NewCommunityMembersService(s) + s.CommunityMessages = NewCommunityMessagesService(s) + s.CommunityPollComments = NewCommunityPollCommentsService(s) + s.CommunityPollVotes = NewCommunityPollVotesService(s) + s.CommunityPolls = NewCommunityPollsService(s) + s.CommunityRelated = NewCommunityRelatedService(s) + s.CommunityTopics = NewCommunityTopicsService(s) + s.Counters = NewCountersService(s) + s.Scraps = NewScrapsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Acl *AclService + + Activities *ActivitiesService + + ActivityVisibility *ActivityVisibilityService + + Badges *BadgesService + + Comments *CommentsService + + Communities *CommunitiesService + + CommunityFollow *CommunityFollowService + + CommunityMembers *CommunityMembersService + + CommunityMessages *CommunityMessagesService + + CommunityPollComments *CommunityPollCommentsService + + CommunityPollVotes *CommunityPollVotesService + + CommunityPolls *CommunityPollsService + + CommunityRelated *CommunityRelatedService + + CommunityTopics *CommunityTopicsService + + Counters *CountersService + + Scraps *ScrapsService +} + +func NewAclService(s *Service) *AclService { + rs := &AclService{s: s} + return rs +} + +type AclService struct { + s *Service +} + +func NewActivitiesService(s *Service) *ActivitiesService { + rs := &ActivitiesService{s: s} + return rs +} + +type ActivitiesService struct { + s *Service +} + +func NewActivityVisibilityService(s *Service) *ActivityVisibilityService { + rs := &ActivityVisibilityService{s: s} + return rs +} + +type ActivityVisibilityService struct { + s *Service +} + +func NewBadgesService(s *Service) *BadgesService { + rs := &BadgesService{s: s} + return rs +} + +type BadgesService struct { + s *Service +} + +func NewCommentsService(s *Service) *CommentsService { + rs := &CommentsService{s: s} + return rs +} + +type CommentsService struct { + s *Service +} + +func NewCommunitiesService(s *Service) *CommunitiesService { + rs := &CommunitiesService{s: s} + return rs +} + +type CommunitiesService struct { + s *Service +} + +func NewCommunityFollowService(s *Service) *CommunityFollowService { + rs := &CommunityFollowService{s: s} + return rs +} + +type CommunityFollowService struct { + s *Service +} + +func NewCommunityMembersService(s *Service) *CommunityMembersService { + rs := &CommunityMembersService{s: s} + return rs +} + +type CommunityMembersService struct { + s *Service +} + +func NewCommunityMessagesService(s *Service) *CommunityMessagesService { + rs := &CommunityMessagesService{s: s} + return rs +} + +type CommunityMessagesService struct { + s *Service +} + +func NewCommunityPollCommentsService(s *Service) *CommunityPollCommentsService { + rs := &CommunityPollCommentsService{s: s} + return rs +} + +type CommunityPollCommentsService struct { + s *Service +} + +func NewCommunityPollVotesService(s *Service) *CommunityPollVotesService { + rs := &CommunityPollVotesService{s: s} + return rs +} + +type CommunityPollVotesService struct { + s *Service +} + +func NewCommunityPollsService(s *Service) *CommunityPollsService { + rs := &CommunityPollsService{s: s} + return rs +} + +type CommunityPollsService struct { + s *Service +} + +func NewCommunityRelatedService(s *Service) *CommunityRelatedService { + rs := &CommunityRelatedService{s: s} + return rs +} + +type CommunityRelatedService struct { + s *Service +} + +func NewCommunityTopicsService(s *Service) *CommunityTopicsService { + rs := &CommunityTopicsService{s: s} + return rs +} + +type CommunityTopicsService struct { + s *Service +} + +func NewCountersService(s *Service) *CountersService { + rs := &CountersService{s: s} + return rs +} + +type CountersService struct { + s *Service +} + +func NewScrapsService(s *Service) *ScrapsService { + rs := &ScrapsService{s: s} + return rs +} + +type ScrapsService struct { + s *Service +} + +type Acl struct { + // Description: Human readable description of the access granted. + Description string `json:"description,omitempty"` + + // Items: The list of ACL entries. + Items []*AclItems `json:"items,omitempty"` + + // Kind: Identifies this resource as an access control list. Value: + // "orkut#acl" + Kind string `json:"kind,omitempty"` + + // TotalParticipants: The total count of participants of the parent + // resource. + TotalParticipants int64 `json:"totalParticipants,omitempty"` +} + +type AclItems struct { + // Id: The ID of the entity. For entities of type "person" or "circle", + // this is the ID of the resource. For other types, this will be unset. + Id string `json:"id,omitempty"` + + // Type: The type of entity to whom access is granted. + Type string `json:"type,omitempty"` +} + +type Activity struct { + // Access: Identifies who has access to see this activity. + Access *Acl `json:"access,omitempty"` + + // Actor: The person who performed the activity. + Actor *OrkutAuthorResource `json:"actor,omitempty"` + + // Id: The ID for the activity. + Id string `json:"id,omitempty"` + + // Kind: The kind of activity. Always orkut#activity. + Kind string `json:"kind,omitempty"` + + // Links: Links to resources related to this activity. + Links []*OrkutLinkResource `json:"links,omitempty"` + + // Object: The activity's object. + Object *ActivityObject `json:"object,omitempty"` + + // Published: The time at which the activity was initially published. + Published string `json:"published,omitempty"` + + // Title: Title of the activity. + Title string `json:"title,omitempty"` + + // Updated: The time at which the activity was last updated. + Updated string `json:"updated,omitempty"` + + // Verb: This activity's verb, indicating what action was performed. + // Possible values are: + // - add - User added new content to profile or + // album, e.g. video, photo. + // - post - User publish content to the + // stream, e.g. status, scrap. + // - update - User commented on an + // activity. + // - make-friend - User added a new friend. + // - birthday - + // User has a birthday. + Verb string `json:"verb,omitempty"` +} + +type ActivityObject struct { + // Content: The HTML-formatted content, suitable for display. When + // updating an activity's content, post the changes to this property, + // using the value of originalContent as a starting point. If the update + // is successful, the server adds HTML formatting and responds with this + // formatted content. + Content string `json:"content,omitempty"` + + // Items: The list of additional items. + Items []*OrkutActivityobjectsResource `json:"items,omitempty"` + + // ObjectType: The type of the object affected by the activity. Clients + // can use this information to style the rendered activity object + // differently depending on the content. + ObjectType string `json:"objectType,omitempty"` + + // Replies: Comments in reply to this activity. + Replies *ActivityObjectReplies `json:"replies,omitempty"` +} + +type ActivityObjectReplies struct { + // Items: The list of comments. + Items []*Comment `json:"items,omitempty"` + + // TotalItems: Total number of comments. + TotalItems uint64 `json:"totalItems,omitempty,string"` + + // Url: URL for the collection of comments in reply to this activity. + Url string `json:"url,omitempty"` +} + +type ActivityList struct { + // Items: List of activities retrieved. + Items []*Activity `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of activities. Value: + // "orkut#activityList" + Kind string `json:"kind,omitempty"` + + // NextPageToken: The value of pageToken query parameter in + // activities.list request to get the next page, if there are more to + // retrieve. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Badge struct { + // BadgeLargeLogo: The URL for the 64x64 badge logo. + BadgeLargeLogo string `json:"badgeLargeLogo,omitempty"` + + // BadgeSmallLogo: The URL for the 24x24 badge logo. + BadgeSmallLogo string `json:"badgeSmallLogo,omitempty"` + + // Caption: The name of the badge, suitable for display. + Caption string `json:"caption,omitempty"` + + // Description: The description for the badge, suitable for display. + Description string `json:"description,omitempty"` + + // Id: The unique ID for the badge. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies this resource as a badge. Value: "orkut#badge" + Kind string `json:"kind,omitempty"` + + // SponsorLogo: The URL for the 32x32 badge sponsor logo. + SponsorLogo string `json:"sponsorLogo,omitempty"` + + // SponsorName: The name of the badge sponsor, suitable for display. + SponsorName string `json:"sponsorName,omitempty"` + + // SponsorUrl: The URL for the badge sponsor. + SponsorUrl string `json:"sponsorUrl,omitempty"` +} + +type BadgeList struct { + // Items: List of badges retrieved. + Items []*Badge `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of badges. Value: + // "orkut#badgeList" + Kind string `json:"kind,omitempty"` +} + +type Comment struct { + // Actor: The person who posted the comment. + Actor *OrkutAuthorResource `json:"actor,omitempty"` + + // Content: The content of the comment in text/html + Content string `json:"content,omitempty"` + + // Id: The unique ID for the comment. + Id string `json:"id,omitempty"` + + // InReplyTo: Link to the original activity where this comment was + // posted. + InReplyTo *CommentInReplyTo `json:"inReplyTo,omitempty"` + + // Kind: Identifies this resource as a comment. Value: "orkut#comment" + Kind string `json:"kind,omitempty"` + + // Links: List of resources for the comment. + Links []*OrkutLinkResource `json:"links,omitempty"` + + // Published: The time the comment was initially published, in RFC 3339 + // format. + Published string `json:"published,omitempty"` +} + +type CommentInReplyTo struct { + // Href: Link to the post on activity stream being commented. + Href string `json:"href,omitempty"` + + // Ref: Unique identifier of the post on activity stream being + // commented. + Ref string `json:"ref,omitempty"` + + // Rel: Relationship between the comment and the post on activity stream + // being commented. Always inReplyTo. + Rel string `json:"rel,omitempty"` + + // Type: Type of the post on activity stream being commented. Always + // text/html. + Type string `json:"type,omitempty"` +} + +type CommentList struct { + // Items: List of comments retrieved. + Items []*Comment `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of comments. Value: + // "orkut#commentList" + Kind string `json:"kind,omitempty"` + + // NextPageToken: The value of pageToken query parameter in + // comments.list request to get the next page, if there are more to + // retrieve. + NextPageToken string `json:"nextPageToken,omitempty"` + + // PreviousPageToken: The value of pageToken query parameter in + // comments.list request to get the previous page, if there are more to + // retrieve. + PreviousPageToken string `json:"previousPageToken,omitempty"` +} + +type Community struct { + // Category: The category of the community. + Category string `json:"category,omitempty"` + + // Co_owners: The co-owners of the community. + Co_owners []*OrkutAuthorResource `json:"co_owners,omitempty"` + + // Creation_date: The time the community was created, in RFC 3339 + // format. + Creation_date string `json:"creation_date,omitempty"` + + // Description: The description of the community. + Description string `json:"description,omitempty"` + + // Id: The id of the community. + Id int64 `json:"id,omitempty"` + + // Kind: Identifies this resource as a community. Value: + // "orkut#community" + Kind string `json:"kind,omitempty"` + + // Language: The official language of the community. + Language string `json:"language,omitempty"` + + // Links: List of resources for the community. + Links []*OrkutLinkResource `json:"links,omitempty"` + + // Location: The location of the community. + Location string `json:"location,omitempty"` + + // Member_count: The number of users who are part of the community. This + // number may be approximate, so do not rely on it for iteration. + Member_count int64 `json:"member_count,omitempty"` + + // Moderators: The list of moderators of the community. + Moderators []*OrkutAuthorResource `json:"moderators,omitempty"` + + // Name: The name of the community. + Name string `json:"name,omitempty"` + + // Owner: The person who owns the community. + Owner *OrkutAuthorResource `json:"owner,omitempty"` + + // Photo_url: The photo of the community. + Photo_url string `json:"photo_url,omitempty"` +} + +type CommunityList struct { + // Items: List of communities retrieved. + Items []*Community `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of communities. Value: + // "orkut#communityList" + Kind string `json:"kind,omitempty"` +} + +type CommunityMembers struct { + // CommunityMembershipStatus: Status and permissions of the user related + // to the community. + CommunityMembershipStatus *CommunityMembershipStatus `json:"communityMembershipStatus,omitempty"` + + // Kind: Kind of this item. Always orkut#communityMembers. + Kind string `json:"kind,omitempty"` + + // Person: Description of the community member. + Person *OrkutActivitypersonResource `json:"person,omitempty"` +} + +type CommunityMembersList struct { + // FirstPageToken: The value of pageToken query parameter in + // community_members.list request to get the first page. + FirstPageToken string `json:"firstPageToken,omitempty"` + + // Items: List of community members retrieved. + Items []*CommunityMembers `json:"items,omitempty"` + + // Kind: Kind of this item. Always orkut#communityMembersList. + Kind string `json:"kind,omitempty"` + + // LastPageToken: The value of pageToken query parameter in + // community_members.list request to get the last page. + LastPageToken string `json:"lastPageToken,omitempty"` + + // NextPageToken: The value of pageToken query parameter in + // community_members.list request to get the next page, if there are + // more to retrieve. + NextPageToken string `json:"nextPageToken,omitempty"` + + // PrevPageToken: The value of pageToken query parameter in + // community_members.list request to get the previous page, if there are + // more to retrieve. + PrevPageToken string `json:"prevPageToken,omitempty"` +} + +type CommunityMembershipStatus struct { + // CanCreatePoll: Whether the user can create a poll in this community. + CanCreatePoll bool `json:"canCreatePoll,omitempty"` + + // CanCreateTopic: Whether the user can create a topic in this + // community. + CanCreateTopic bool `json:"canCreateTopic,omitempty"` + + // CanShout: Whether the user can perform a shout operation in this + // community. + CanShout bool `json:"canShout,omitempty"` + + // IsCoOwner: Whether the session user is a community co-owner. + IsCoOwner bool `json:"isCoOwner,omitempty"` + + // IsFollowing: Whether the user is following this community. + IsFollowing bool `json:"isFollowing,omitempty"` + + // IsModerator: Whether the session user is a community moderator. + IsModerator bool `json:"isModerator,omitempty"` + + // IsOwner: Whether the session user is the community owner. + IsOwner bool `json:"isOwner,omitempty"` + + // IsRestoreAvailable: Whether the restore operation is available for + // the community. + IsRestoreAvailable bool `json:"isRestoreAvailable,omitempty"` + + // IsTakebackAvailable: Whether the take-back operation is available for + // the community. + IsTakebackAvailable bool `json:"isTakebackAvailable,omitempty"` + + // Kind: Kind of this item. Always orkut#communityMembershipStatus. + Kind string `json:"kind,omitempty"` + + // Status: The status of the current link between the community and the + // user. + Status string `json:"status,omitempty"` +} + +type CommunityMessage struct { + // AddedDate: The timestamp of the date when the message was added, in + // RFC 3339 format. + AddedDate string `json:"addedDate,omitempty"` + + // Author: The creator of the message. If ommited, the message is + // annonimous. + Author *OrkutAuthorResource `json:"author,omitempty"` + + // Body: The body of the message. + Body string `json:"body,omitempty"` + + // Id: The ID of the message. + Id int64 `json:"id,omitempty,string"` + + // IsSpam: Whether this post was marked as spam by the viewer, when + // he/she is not the community owner or one of its moderators. + IsSpam bool `json:"isSpam,omitempty"` + + // Kind: Identifies this resource as a community message. Value: + // "orkut#communityMessage" + Kind string `json:"kind,omitempty"` + + // Links: List of resources for the community message. + Links []*OrkutLinkResource `json:"links,omitempty"` + + // Subject: The subject of the message. + Subject string `json:"subject,omitempty"` +} + +type CommunityMessageList struct { + // FirstPageToken: The value of pageToken query parameter in + // community_messages.list request to get the first page. + FirstPageToken string `json:"firstPageToken,omitempty"` + + // Items: List of messages retrieved. + Items []*CommunityMessage `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of community messages. + // Value: "orkut#communityMessageList" + Kind string `json:"kind,omitempty"` + + // LastPageToken: The value of pageToken query parameter in + // community_messages.list request to get the last page. + LastPageToken string `json:"lastPageToken,omitempty"` + + // NextPageToken: The value of pageToken query parameter in + // community_messages.list request to get the next page, if there are + // more to retrieve. + NextPageToken string `json:"nextPageToken,omitempty"` + + // PrevPageToken: The value of pageToken query parameter in + // community_messages.list request to get the previous page, if there + // are more to retrieve. + PrevPageToken string `json:"prevPageToken,omitempty"` +} + +type CommunityPoll struct { + // Author: The person who created the poll. + Author *OrkutAuthorResource `json:"author,omitempty"` + + // CommunityId: The ID of the community. + CommunityId int64 `json:"communityId,omitempty"` + + // CreationTime: The date of creation of this poll + CreationTime string `json:"creationTime,omitempty"` + + // Description: The poll description. + Description string `json:"description,omitempty"` + + // EndingTime: The ending date of this poll or empty if the poll doesn't + // have one. + EndingTime string `json:"endingTime,omitempty"` + + // HasVoted: Whether the user has voted on this poll. + HasVoted bool `json:"hasVoted,omitempty"` + + // Id: The poll ID. + Id string `json:"id,omitempty"` + + // Image: The image representing the poll. Field is omitted if no image + // exists. + Image *CommunityPollImage `json:"image,omitempty"` + + // IsClosed: Whether the poll is not expired if there is an expiration + // date. A poll is open (that is, not closed for voting) if it either is + // not expired or doesn't have an expiration date at all. Note that just + // because a poll is open, it doesn't mean that the requester can vote + // on it. + IsClosed bool `json:"isClosed,omitempty"` + + // IsMultipleAnswers: Whether this poll allows voting for more than one + // option. + IsMultipleAnswers bool `json:"isMultipleAnswers,omitempty"` + + // IsOpenForVoting: Whether this poll is still opened for voting. A poll + // is open for voting if it is not closed, the user has not yet voted on + // it and the user has the permission to do so, which happens if he/she + // is either a community member or the poll is open for everybody. + IsOpenForVoting bool `json:"isOpenForVoting,omitempty"` + + // IsRestricted: Whether this poll is restricted for members only. If a + // poll is open but the user can't vote on it, it's been restricted to + // members only. This information is important to tell this case apart + // from the one where the user can't vote simply because the poll is + // already closed. + IsRestricted bool `json:"isRestricted,omitempty"` + + // IsSpam: Whether the user has marked this poll as spam. This only + // affects the poll for this user, not globally. + IsSpam bool `json:"isSpam,omitempty"` + + // IsUsersVotePublic: If user has already voted, whether his vote is + // publicly visible. + IsUsersVotePublic bool `json:"isUsersVotePublic,omitempty"` + + // IsVotingAllowedForNonMembers: Whether non-members of the community + // can vote on the poll. + IsVotingAllowedForNonMembers bool `json:"isVotingAllowedForNonMembers,omitempty"` + + // Kind: Identifies this resource as a community poll. Value: + // "orkut#communityPoll" + Kind string `json:"kind,omitempty"` + + // LastUpdate: The date of the last update of this poll. + LastUpdate string `json:"lastUpdate,omitempty"` + + // Links: List of resources for the community poll. + Links []*OrkutLinkResource `json:"links,omitempty"` + + // Options: List of options of this poll. + Options []*OrkutCommunitypolloptionResource `json:"options,omitempty"` + + // Question: The poll question. + Question string `json:"question,omitempty"` + + // TotalNumberOfVotes: The total number of votes this poll has received. + TotalNumberOfVotes int64 `json:"totalNumberOfVotes,omitempty"` + + // VotedOptions: List of options the user has voted on, if there are + // any. + VotedOptions []int64 `json:"votedOptions,omitempty"` +} + +type CommunityPollImage struct { + // Url: A URL that points to an image of the poll. + Url string `json:"url,omitempty"` +} + +type CommunityPollComment struct { + // AddedDate: The date when the message was added, in RFC 3339 format. + AddedDate string `json:"addedDate,omitempty"` + + // Author: The creator of the comment. + Author *OrkutAuthorResource `json:"author,omitempty"` + + // Body: The body of the message. + Body string `json:"body,omitempty"` + + // Id: The ID of the comment. + Id int64 `json:"id,omitempty"` + + // Kind: Identifies this resource as a community poll comment. Value: + // "orkut#communityPollComment" + Kind string `json:"kind,omitempty"` +} + +type CommunityPollCommentList struct { + // FirstPageToken: The value of pageToken query parameter in + // community_poll_comments.list request to get the first page. + FirstPageToken string `json:"firstPageToken,omitempty"` + + // Items: List of community poll comments retrieved. + Items []*CommunityPollComment `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of community poll + // comments. Value: "orkut#CommunityPollCommentList" + Kind string `json:"kind,omitempty"` + + // LastPageToken: The value of pageToken query parameter in + // community_poll_comments.list request to get the last page. + LastPageToken string `json:"lastPageToken,omitempty"` + + // NextPageToken: The value of pageToken query parameter in + // community_poll_comments.list request to get the next page, if there + // are more to retrieve. + NextPageToken string `json:"nextPageToken,omitempty"` + + // PrevPageToken: The value of pageToken query parameter in + // community_poll_comments.list request to get the previous page, if + // there are more to retrieve. + PrevPageToken string `json:"prevPageToken,omitempty"` +} + +type CommunityPollList struct { + // FirstPageToken: The value of pageToken query parameter in + // community_polls.list request to get the first page. + FirstPageToken string `json:"firstPageToken,omitempty"` + + // Items: List of community polls retrieved. + Items []*CommunityPoll `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of community polls. + // Value: "orkut#communityPollList" + Kind string `json:"kind,omitempty"` + + // LastPageToken: The value of pageToken query parameter in + // community_polls.list request to get the last page. + LastPageToken string `json:"lastPageToken,omitempty"` + + // NextPageToken: The value of pageToken query parameter in + // community_polls.list request to get the next page, if there are more + // to retrieve. + NextPageToken string `json:"nextPageToken,omitempty"` + + // PrevPageToken: The value of pageToken query parameter in + // community_polls.list request to get the previous page, if there are + // more to retrieve. + PrevPageToken string `json:"prevPageToken,omitempty"` +} + +type CommunityPollVote struct { + // IsVotevisible: Whether this vote is visible to other users or not. + IsVotevisible bool `json:"isVotevisible,omitempty"` + + // Kind: Identifies this resource as a community poll vote. Value: + // "orkut#communityPollVote" + Kind string `json:"kind,omitempty"` + + // OptionIds: The ids of the voted options. + OptionIds []int64 `json:"optionIds,omitempty"` +} + +type CommunityTopic struct { + // Author: The creator of the topic. + Author *OrkutAuthorResource `json:"author,omitempty"` + + // Body: The body of the topic. + Body string `json:"body,omitempty"` + + // Id: The ID of the topic. + Id int64 `json:"id,omitempty,string"` + + // IsClosed: Whether the topic is closed for new messages. + IsClosed bool `json:"isClosed,omitempty"` + + // Kind: Identifies this resource as a community topic. Value: + // "orkut#communityTopic" + Kind string `json:"kind,omitempty"` + + // LastUpdate: The timestamp of the last update, in RFC 3339 format. + LastUpdate string `json:"lastUpdate,omitempty"` + + // LatestMessageSnippet: Snippet of the last message posted on this + // topic. + LatestMessageSnippet string `json:"latestMessageSnippet,omitempty"` + + // Links: List of resources for the community. + Links []*OrkutLinkResource `json:"links,omitempty"` + + // Messages: Most recent messages. + Messages []*CommunityMessage `json:"messages,omitempty"` + + // NumberOfReplies: The total number of replies this topic has received. + NumberOfReplies int64 `json:"numberOfReplies,omitempty"` + + // Title: The title of the topic. + Title string `json:"title,omitempty"` +} + +type CommunityTopicList struct { + // FirstPageToken: The value of pageToken query parameter in + // community_topic.list request to get the first page. + FirstPageToken string `json:"firstPageToken,omitempty"` + + // Items: List of topics retrieved. + Items []*CommunityTopic `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of community topics. + // Value: "orkut#communityTopicList" + Kind string `json:"kind,omitempty"` + + // LastPageToken: The value of pageToken query parameter in + // community_topic.list request to get the last page. + LastPageToken string `json:"lastPageToken,omitempty"` + + // NextPageToken: The value of pageToken query parameter in + // community_topic.list request to get the next page, if there are more + // to retrieve. + NextPageToken string `json:"nextPageToken,omitempty"` + + // PrevPageToken: The value of pageToken query parameter in + // community_topic.list request to get the previous page, if there are + // more to retrieve. + PrevPageToken string `json:"prevPageToken,omitempty"` +} + +type Counters struct { + // Items: List of counters retrieved. + Items []*OrkutCounterResource `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of counters. Value: + // "orkut#counters" + Kind string `json:"kind,omitempty"` +} + +type OrkutActivityobjectsResource struct { + // Community: The community which is related with this activity, e.g. a + // joined community. + Community *Community `json:"community,omitempty"` + + // Content: The HTML-formatted content, suitable for display. When + // updating an activity's content, post the changes to this property, + // using the value of originalContent as a starting point. If the update + // is successful, the server adds HTML formatting and responds with this + // formatted content. + Content string `json:"content,omitempty"` + + // DisplayName: The title of the object. + DisplayName string `json:"displayName,omitempty"` + + // Id: The ID for the object. + Id string `json:"id,omitempty"` + + // Links: Links to other resources related to this object. + Links []*OrkutLinkResource `json:"links,omitempty"` + + // ObjectType: The object type. + ObjectType string `json:"objectType,omitempty"` + + // Person: The person who is related with this activity, e.g. an Added + // User. + Person *OrkutActivitypersonResource `json:"person,omitempty"` +} + +type OrkutActivitypersonResource struct { + // Birthday: The person's date of birth, represented as YYYY-MM-DD. + Birthday string `json:"birthday,omitempty"` + + // Gender: The person's gender. Values include "male", "female", and + // "other". + Gender string `json:"gender,omitempty"` + + // Id: The person's opensocial ID. + Id string `json:"id,omitempty"` + + // Image: The person's profile photo. This is adapted from Google+ and + // was originaly introduced as extra OpenSocial convenience fields. + Image *OrkutActivitypersonResourceImage `json:"image,omitempty"` + + // Name: An object that encapsulates the individual components of a + // person's name. + Name *OrkutActivitypersonResourceName `json:"name,omitempty"` + + // Url: The person's profile url. This is adapted from Google+ and was + // originaly introduced as extra OpenSocial convenience fields. + Url string `json:"url,omitempty"` +} + +type OrkutActivitypersonResourceImage struct { + // Url: The URL of the person's profile photo. + Url string `json:"url,omitempty"` +} + +type OrkutActivitypersonResourceName struct { + // FamilyName: The family name (last name) of this person. + FamilyName string `json:"familyName,omitempty"` + + // GivenName: The given name (first name) of this person. + GivenName string `json:"givenName,omitempty"` +} + +type OrkutAuthorResource struct { + // DisplayName: The name of the author, suitable for display. + DisplayName string `json:"displayName,omitempty"` + + // Id: Unique identifier of the person who posted the comment. This is + // the person's OpenSocial ID. + Id string `json:"id,omitempty"` + + // Image: Image data about the author. + Image *OrkutAuthorResourceImage `json:"image,omitempty"` + + // Url: The URL of the author who posted the comment [not yet + // implemented] + Url string `json:"url,omitempty"` +} + +type OrkutAuthorResourceImage struct { + // Url: A URL that points to a thumbnail photo of the author. + Url string `json:"url,omitempty"` +} + +type OrkutCommunitypolloptionResource struct { + // Description: The option description. + Description string `json:"description,omitempty"` + + // Image: Image data about the poll option. Field is omitted if no image + // exists. + Image *OrkutCommunitypolloptionResourceImage `json:"image,omitempty"` + + // NumberOfVotes: The total number of votes that this option received. + NumberOfVotes int64 `json:"numberOfVotes,omitempty"` + + // OptionId: The poll option ID + OptionId int64 `json:"optionId,omitempty"` +} + +type OrkutCommunitypolloptionResourceImage struct { + // Url: A URL that points to an image of the poll question. + Url string `json:"url,omitempty"` +} + +type OrkutCounterResource struct { + // Link: Link to the collection being counted. + Link *OrkutLinkResource `json:"link,omitempty"` + + // Name: The name of the counted collection. Currently supported + // collections are: + // - scraps - The scraps of the user. + // - photos - The + // photos of the user. + // - videos - The videos of the user. + // - + // pendingTestimonials - The pending testimonials of the user. + Name string `json:"name,omitempty"` + + // Total: The number of resources on the counted collection. + Total int64 `json:"total,omitempty"` +} + +type OrkutLinkResource struct { + // Href: URL of the link. + Href string `json:"href,omitempty"` + + // Rel: Relation between the resource and the parent object. + Rel string `json:"rel,omitempty"` + + // Title: Title of the link. + Title string `json:"title,omitempty"` + + // Type: Media type of the link. + Type string `json:"type,omitempty"` +} + +type Visibility struct { + // Kind: Identifies this resource as a visibility item. Value: + // "orkut#visibility" + Kind string `json:"kind,omitempty"` + + // Links: List of resources for the visibility item. + Links []*OrkutLinkResource `json:"links,omitempty"` + + // Visibility: The visibility of the resource. Possible values are: + // - + // default: not hidden by the user + // - hidden: hidden + Visibility string `json:"visibility,omitempty"` +} + +// method id "orkut.acl.delete": + +type AclDeleteCall struct { + s *Service + activityId string + userId string + opt_ map[string]interface{} +} + +// Delete: Excludes an element from the ACL of the activity. +func (r *AclService) Delete(activityId string, userId string) *AclDeleteCall { + c := &AclDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.activityId = activityId + c.userId = userId + return c +} + +func (c *AclDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}/acl/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{activityId}", url.QueryEscape(c.activityId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Excludes an element from the ACL of the activity.", + // "httpMethod": "DELETE", + // "id": "orkut.acl.delete", + // "parameterOrder": [ + // "activityId", + // "userId" + // ], + // "parameters": { + // "activityId": { + // "description": "ID of the activity.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "ID of the user to be removed from the activity.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "activities/{activityId}/acl/{userId}", + // "scopes": [ + // "https://www.googleapis.com/auth/orkut" + // ] + // } + +} + +// method id "orkut.activities.delete": + +type ActivitiesDeleteCall struct { + s *Service + activityId string + opt_ map[string]interface{} +} + +// Delete: Deletes an existing activity, if the access controls allow +// it. +func (r *ActivitiesService) Delete(activityId string) *ActivitiesDeleteCall { + c := &ActivitiesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.activityId = activityId + return c +} + +func (c *ActivitiesDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{activityId}", url.QueryEscape(c.activityId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing activity, if the access controls allow it.", + // "httpMethod": "DELETE", + // "id": "orkut.activities.delete", + // "parameterOrder": [ + // "activityId" + // ], + // "parameters": { + // "activityId": { + // "description": "ID of the activity to remove.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "activities/{activityId}", + // "scopes": [ + // "https://www.googleapis.com/auth/orkut" + // ] + // } + +} + +// method id "orkut.activities.list": + +type ActivitiesListCall struct { + s *Service + userId string + collection string + opt_ map[string]interface{} +} + +// List: Retrieves a list of activities. +func (r *ActivitiesService) List(userId string, collection string) *ActivitiesListCall { + c := &ActivitiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.collection = collection + return c +} + +// Hl sets the optional parameter "hl": Specifies the interface language +// (host language) of your user interface. +func (c *ActivitiesListCall) Hl(hl string) *ActivitiesListCall { + c.opt_["hl"] = hl + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of activities to include in the response. +func (c *ActivitiesListCall) MaxResults(maxResults int64) *ActivitiesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token that allows pagination. +func (c *ActivitiesListCall) PageToken(pageToken string) *ActivitiesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ActivitiesListCall) Do() (*ActivityList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["hl"]; ok { + params.Set("hl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/activities/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{collection}", url.QueryEscape(c.collection), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ActivityList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of activities.", + // "httpMethod": "GET", + // "id": "orkut.activities.list", + // "parameterOrder": [ + // "userId", + // "collection" + // ], + // "parameters": { + // "collection": { + // "description": "The collection of activities to list.", + // "enum": [ + // "all", + // "scraps", + // "stream" + // ], + // "enumDescriptions": [ + // "All activities created by the specified user that the authenticated user is authorized to view.", + // "The specified user's scrapbook.", + // "The specified user's stream feed, intended for consumption. This includes activities posted by people that the user is following, and activities in which the user has been mentioned." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "hl": { + // "description": "Specifies the interface language (host language) of your user interface.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of activities to include in the response.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token that allows pagination.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user whose activities will be listed. Can be me to refer to the viewer (i.e. the authenticated user).", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/activities/{collection}", + // "response": { + // "$ref": "ActivityList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut", + // "https://www.googleapis.com/auth/orkut.readonly" + // ] + // } + +} + +// method id "orkut.activityVisibility.get": + +type ActivityVisibilityGetCall struct { + s *Service + activityId string + opt_ map[string]interface{} +} + +// Get: Gets the visibility of an existing activity. +func (r *ActivityVisibilityService) Get(activityId string) *ActivityVisibilityGetCall { + c := &ActivityVisibilityGetCall{s: r.s, opt_: make(map[string]interface{})} + c.activityId = activityId + return c +} + +func (c *ActivityVisibilityGetCall) Do() (*Visibility, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}/visibility") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{activityId}", url.QueryEscape(c.activityId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Visibility) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the visibility of an existing activity.", + // "httpMethod": "GET", + // "id": "orkut.activityVisibility.get", + // "parameterOrder": [ + // "activityId" + // ], + // "parameters": { + // "activityId": { + // "description": "ID of the activity to get the visibility.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "activities/{activityId}/visibility", + // "response": { + // "$ref": "Visibility" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut", + // "https://www.googleapis.com/auth/orkut.readonly" + // ] + // } + +} + +// method id "orkut.activityVisibility.patch": + +type ActivityVisibilityPatchCall struct { + s *Service + activityId string + visibility *Visibility + opt_ map[string]interface{} +} + +// Patch: Updates the visibility of an existing activity. This method +// supports patch semantics. +func (r *ActivityVisibilityService) Patch(activityId string, visibility *Visibility) *ActivityVisibilityPatchCall { + c := &ActivityVisibilityPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.activityId = activityId + c.visibility = visibility + return c +} + +func (c *ActivityVisibilityPatchCall) Do() (*Visibility, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.visibility) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}/visibility") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{activityId}", url.QueryEscape(c.activityId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Visibility) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the visibility of an existing activity. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "orkut.activityVisibility.patch", + // "parameterOrder": [ + // "activityId" + // ], + // "parameters": { + // "activityId": { + // "description": "ID of the activity.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "activities/{activityId}/visibility", + // "request": { + // "$ref": "Visibility" + // }, + // "response": { + // "$ref": "Visibility" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut" + // ] + // } + +} + +// method id "orkut.activityVisibility.update": + +type ActivityVisibilityUpdateCall struct { + s *Service + activityId string + visibility *Visibility + opt_ map[string]interface{} +} + +// Update: Updates the visibility of an existing activity. +func (r *ActivityVisibilityService) Update(activityId string, visibility *Visibility) *ActivityVisibilityUpdateCall { + c := &ActivityVisibilityUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.activityId = activityId + c.visibility = visibility + return c +} + +func (c *ActivityVisibilityUpdateCall) Do() (*Visibility, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.visibility) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}/visibility") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{activityId}", url.QueryEscape(c.activityId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Visibility) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the visibility of an existing activity.", + // "httpMethod": "PUT", + // "id": "orkut.activityVisibility.update", + // "parameterOrder": [ + // "activityId" + // ], + // "parameters": { + // "activityId": { + // "description": "ID of the activity.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "activities/{activityId}/visibility", + // "request": { + // "$ref": "Visibility" + // }, + // "response": { + // "$ref": "Visibility" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut" + // ] + // } + +} + +// method id "orkut.badges.get": + +type BadgesGetCall struct { + s *Service + userId string + badgeId int64 + opt_ map[string]interface{} +} + +// Get: Retrieves a badge from a user. +func (r *BadgesService) Get(userId string, badgeId int64) *BadgesGetCall { + c := &BadgesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.badgeId = badgeId + return c +} + +func (c *BadgesGetCall) Do() (*Badge, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/badges/{badgeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{badgeId}", strconv.FormatInt(c.badgeId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Badge) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a badge from a user.", + // "httpMethod": "GET", + // "id": "orkut.badges.get", + // "parameterOrder": [ + // "userId", + // "badgeId" + // ], + // "parameters": { + // "badgeId": { + // "description": "The ID of the badge that will be retrieved.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user whose badges will be listed. Can be me to refer to caller.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/badges/{badgeId}", + // "response": { + // "$ref": "Badge" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut", + // "https://www.googleapis.com/auth/orkut.readonly" + // ] + // } + +} + +// method id "orkut.badges.list": + +type BadgesListCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// List: Retrieves the list of visible badges of a user. +func (r *BadgesService) List(userId string) *BadgesListCall { + c := &BadgesListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +func (c *BadgesListCall) Do() (*BadgeList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/badges") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BadgeList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of visible badges of a user.", + // "httpMethod": "GET", + // "id": "orkut.badges.list", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "description": "The id of the user whose badges will be listed. Can be me to refer to caller.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/badges", + // "response": { + // "$ref": "BadgeList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut", + // "https://www.googleapis.com/auth/orkut.readonly" + // ] + // } + +} + +// method id "orkut.comments.delete": + +type CommentsDeleteCall struct { + s *Service + commentId string + opt_ map[string]interface{} +} + +// Delete: Deletes an existing comment. +func (r *CommentsService) Delete(commentId string) *CommentsDeleteCall { + c := &CommentsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.commentId = commentId + return c +} + +func (c *CommentsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing comment.", + // "httpMethod": "DELETE", + // "id": "orkut.comments.delete", + // "parameterOrder": [ + // "commentId" + // ], + // "parameters": { + // "commentId": { + // "description": "ID of the comment to remove.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "comments/{commentId}", + // "scopes": [ + // "https://www.googleapis.com/auth/orkut" + // ] + // } + +} + +// method id "orkut.comments.get": + +type CommentsGetCall struct { + s *Service + commentId string + opt_ map[string]interface{} +} + +// Get: Retrieves an existing comment. +func (r *CommentsService) Get(commentId string) *CommentsGetCall { + c := &CommentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.commentId = commentId + return c +} + +// Hl sets the optional parameter "hl": Specifies the interface language +// (host language) of your user interface. +func (c *CommentsGetCall) Hl(hl string) *CommentsGetCall { + c.opt_["hl"] = hl + return c +} + +func (c *CommentsGetCall) Do() (*Comment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["hl"]; ok { + params.Set("hl", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves an existing comment.", + // "httpMethod": "GET", + // "id": "orkut.comments.get", + // "parameterOrder": [ + // "commentId" + // ], + // "parameters": { + // "commentId": { + // "description": "ID of the comment to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "hl": { + // "description": "Specifies the interface language (host language) of your user interface.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "comments/{commentId}", + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut", + // "https://www.googleapis.com/auth/orkut.readonly" + // ] + // } + +} + +// method id "orkut.comments.insert": + +type CommentsInsertCall struct { + s *Service + activityId string + comment *Comment + opt_ map[string]interface{} +} + +// Insert: Inserts a new comment to an activity. +func (r *CommentsService) Insert(activityId string, comment *Comment) *CommentsInsertCall { + c := &CommentsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.activityId = activityId + c.comment = comment + return c +} + +func (c *CommentsInsertCall) Do() (*Comment, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{activityId}", url.QueryEscape(c.activityId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new comment to an activity.", + // "httpMethod": "POST", + // "id": "orkut.comments.insert", + // "parameterOrder": [ + // "activityId" + // ], + // "parameters": { + // "activityId": { + // "description": "The ID of the activity to contain the new comment.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "activities/{activityId}/comments", + // "request": { + // "$ref": "Comment" + // }, + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut" + // ] + // } + +} + +// method id "orkut.comments.list": + +type CommentsListCall struct { + s *Service + activityId string + opt_ map[string]interface{} +} + +// List: Retrieves a list of comments, possibly filtered. +func (r *CommentsService) List(activityId string) *CommentsListCall { + c := &CommentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.activityId = activityId + return c +} + +// Hl sets the optional parameter "hl": Specifies the interface language +// (host language) of your user interface. +func (c *CommentsListCall) Hl(hl string) *CommentsListCall { + c.opt_["hl"] = hl + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of activities to include in the response. +func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sort search results. +func (c *CommentsListCall) OrderBy(orderBy string) *CommentsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token that allows pagination. +func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CommentsListCall) Do() (*CommentList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["hl"]; ok { + params.Set("hl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{activityId}", url.QueryEscape(c.activityId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommentList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of comments, possibly filtered.", + // "httpMethod": "GET", + // "id": "orkut.comments.list", + // "parameterOrder": [ + // "activityId" + // ], + // "parameters": { + // "activityId": { + // "description": "The ID of the activity containing the comments.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "hl": { + // "description": "Specifies the interface language (host language) of your user interface.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of activities to include in the response.", + // "format": "uint32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "orderBy": { + // "default": "DESCENDING_SORT", + // "description": "Sort search results.", + // "enum": [ + // "ascending", + // "descending" + // ], + // "enumDescriptions": [ + // "Use ascending sort order.", + // "Use descending sort order." + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "A continuation token that allows pagination.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "activities/{activityId}/comments", + // "response": { + // "$ref": "CommentList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut", + // "https://www.googleapis.com/auth/orkut.readonly" + // ] + // } + +} + +// method id "orkut.communities.get": + +type CommunitiesGetCall struct { + s *Service + communityId int64 + opt_ map[string]interface{} +} + +// Get: Retrieves the basic information (aka. profile) of a community. +func (r *CommunitiesService) Get(communityId int64) *CommunitiesGetCall { + c := &CommunitiesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + return c +} + +// Hl sets the optional parameter "hl": Specifies the interface language +// (host language) of your user interface. +func (c *CommunitiesGetCall) Hl(hl string) *CommunitiesGetCall { + c.opt_["hl"] = hl + return c +} + +func (c *CommunitiesGetCall) Do() (*Community, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["hl"]; ok { + params.Set("hl", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Community) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the basic information (aka. profile) of a community.", + // "httpMethod": "GET", + // "id": "orkut.communities.get", + // "parameterOrder": [ + // "communityId" + // ], + // "parameters": { + // "communityId": { + // "description": "The ID of the community to get.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "hl": { + // "description": "Specifies the interface language (host language) of your user interface.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "communities/{communityId}", + // "response": { + // "$ref": "Community" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut", + // "https://www.googleapis.com/auth/orkut.readonly" + // ] + // } + +} + +// method id "orkut.communities.list": + +type CommunitiesListCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// List: Retrieves the list of communities the current user is a member +// of. +func (r *CommunitiesService) List(userId string) *CommunitiesListCall { + c := &CommunitiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// Hl sets the optional parameter "hl": Specifies the interface language +// (host language) of your user interface. +func (c *CommunitiesListCall) Hl(hl string) *CommunitiesListCall { + c.opt_["hl"] = hl + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of communities to include in the response. +func (c *CommunitiesListCall) MaxResults(maxResults int64) *CommunitiesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": How to order the +// communities by. +func (c *CommunitiesListCall) OrderBy(orderBy string) *CommunitiesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +func (c *CommunitiesListCall) Do() (*CommunityList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["hl"]; ok { + params.Set("hl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/communities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommunityList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of communities the current user is a member of.", + // "httpMethod": "GET", + // "id": "orkut.communities.list", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "hl": { + // "description": "Specifies the interface language (host language) of your user interface.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of communities to include in the response.", + // "format": "uint32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "orderBy": { + // "description": "How to order the communities by.", + // "enum": [ + // "id", + // "ranked" + // ], + // "enumDescriptions": [ + // "Returns the communities sorted by a fixed, natural order.", + // "Returns the communities ranked accordingly to how they are displayed on the orkut web application." + // ], + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user whose communities will be listed. Can be me to refer to caller.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/communities", + // "response": { + // "$ref": "CommunityList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut", + // "https://www.googleapis.com/auth/orkut.readonly" + // ] + // } + +} + +// method id "orkut.communityFollow.delete": + +type CommunityFollowDeleteCall struct { + s *Service + communityId int64 + userId string + opt_ map[string]interface{} +} + +// Delete: Removes a user from the followers of a community. +func (r *CommunityFollowService) Delete(communityId int64, userId string) *CommunityFollowDeleteCall { + c := &CommunityFollowDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + c.userId = userId + return c +} + +func (c *CommunityFollowDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/followers/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Removes a user from the followers of a community.", + // "httpMethod": "DELETE", + // "id": "orkut.communityFollow.delete", + // "parameterOrder": [ + // "communityId", + // "userId" + // ], + // "parameters": { + // "communityId": { + // "description": "ID of the community.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "userId": { + // "description": "ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "communities/{communityId}/followers/{userId}", + // "scopes": [ + // "https://www.googleapis.com/auth/orkut" + // ] + // } + +} + +// method id "orkut.communityFollow.insert": + +type CommunityFollowInsertCall struct { + s *Service + communityId int64 + userId string + opt_ map[string]interface{} +} + +// Insert: Adds a user as a follower of a community. +func (r *CommunityFollowService) Insert(communityId int64, userId string) *CommunityFollowInsertCall { + c := &CommunityFollowInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + c.userId = userId + return c +} + +func (c *CommunityFollowInsertCall) Do() (*CommunityMembers, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/followers/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommunityMembers) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a user as a follower of a community.", + // "httpMethod": "POST", + // "id": "orkut.communityFollow.insert", + // "parameterOrder": [ + // "communityId", + // "userId" + // ], + // "parameters": { + // "communityId": { + // "description": "ID of the community.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "userId": { + // "description": "ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "communities/{communityId}/followers/{userId}", + // "response": { + // "$ref": "CommunityMembers" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut" + // ] + // } + +} + +// method id "orkut.communityMembers.delete": + +type CommunityMembersDeleteCall struct { + s *Service + communityId int64 + userId string + opt_ map[string]interface{} +} + +// Delete: Makes the user leave a community. +func (r *CommunityMembersService) Delete(communityId int64, userId string) *CommunityMembersDeleteCall { + c := &CommunityMembersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + c.userId = userId + return c +} + +func (c *CommunityMembersDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/members/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Makes the user leave a community.", + // "httpMethod": "DELETE", + // "id": "orkut.communityMembers.delete", + // "parameterOrder": [ + // "communityId", + // "userId" + // ], + // "parameters": { + // "communityId": { + // "description": "ID of the community.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "userId": { + // "description": "ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "communities/{communityId}/members/{userId}", + // "scopes": [ + // "https://www.googleapis.com/auth/orkut" + // ] + // } + +} + +// method id "orkut.communityMembers.get": + +type CommunityMembersGetCall struct { + s *Service + communityId int64 + userId string + opt_ map[string]interface{} +} + +// Get: Retrieves the relationship between a user and a community. +func (r *CommunityMembersService) Get(communityId int64, userId string) *CommunityMembersGetCall { + c := &CommunityMembersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + c.userId = userId + return c +} + +// Hl sets the optional parameter "hl": Specifies the interface language +// (host language) of your user interface. +func (c *CommunityMembersGetCall) Hl(hl string) *CommunityMembersGetCall { + c.opt_["hl"] = hl + return c +} + +func (c *CommunityMembersGetCall) Do() (*CommunityMembers, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["hl"]; ok { + params.Set("hl", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/members/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommunityMembers) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the relationship between a user and a community.", + // "httpMethod": "GET", + // "id": "orkut.communityMembers.get", + // "parameterOrder": [ + // "communityId", + // "userId" + // ], + // "parameters": { + // "communityId": { + // "description": "ID of the community.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "hl": { + // "description": "Specifies the interface language (host language) of your user interface.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "communities/{communityId}/members/{userId}", + // "response": { + // "$ref": "CommunityMembers" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut", + // "https://www.googleapis.com/auth/orkut.readonly" + // ] + // } + +} + +// method id "orkut.communityMembers.insert": + +type CommunityMembersInsertCall struct { + s *Service + communityId int64 + userId string + opt_ map[string]interface{} +} + +// Insert: Makes the user join a community. +func (r *CommunityMembersService) Insert(communityId int64, userId string) *CommunityMembersInsertCall { + c := &CommunityMembersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + c.userId = userId + return c +} + +func (c *CommunityMembersInsertCall) Do() (*CommunityMembers, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/members/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommunityMembers) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Makes the user join a community.", + // "httpMethod": "POST", + // "id": "orkut.communityMembers.insert", + // "parameterOrder": [ + // "communityId", + // "userId" + // ], + // "parameters": { + // "communityId": { + // "description": "ID of the community.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "userId": { + // "description": "ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "communities/{communityId}/members/{userId}", + // "response": { + // "$ref": "CommunityMembers" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut" + // ] + // } + +} + +// method id "orkut.communityMembers.list": + +type CommunityMembersListCall struct { + s *Service + communityId int64 + opt_ map[string]interface{} +} + +// List: Lists members of a community. Use the pagination tokens to +// retrieve the full list; do not rely on the member count available in +// the community profile information to know when to stop iterating, as +// that count may be approximate. +func (r *CommunityMembersService) List(communityId int64) *CommunityMembersListCall { + c := &CommunityMembersListCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + return c +} + +// FriendsOnly sets the optional parameter "friendsOnly": Whether to +// list only community members who are friends of the user. +func (c *CommunityMembersListCall) FriendsOnly(friendsOnly bool) *CommunityMembersListCall { + c.opt_["friendsOnly"] = friendsOnly + return c +} + +// Hl sets the optional parameter "hl": Specifies the interface language +// (host language) of your user interface. +func (c *CommunityMembersListCall) Hl(hl string) *CommunityMembersListCall { + c.opt_["hl"] = hl + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of members to include in the response. +func (c *CommunityMembersListCall) MaxResults(maxResults int64) *CommunityMembersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token that allows pagination. +func (c *CommunityMembersListCall) PageToken(pageToken string) *CommunityMembersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CommunityMembersListCall) Do() (*CommunityMembersList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["friendsOnly"]; ok { + params.Set("friendsOnly", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["hl"]; ok { + params.Set("hl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/members") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommunityMembersList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists members of a community. Use the pagination tokens to retrieve the full list; do not rely on the member count available in the community profile information to know when to stop iterating, as that count may be approximate.", + // "httpMethod": "GET", + // "id": "orkut.communityMembers.list", + // "parameterOrder": [ + // "communityId" + // ], + // "parameters": { + // "communityId": { + // "description": "The ID of the community whose members will be listed.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "friendsOnly": { + // "description": "Whether to list only community members who are friends of the user.", + // "location": "query", + // "type": "boolean" + // }, + // "hl": { + // "description": "Specifies the interface language (host language) of your user interface.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of members to include in the response.", + // "format": "uint32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token that allows pagination.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "communities/{communityId}/members", + // "response": { + // "$ref": "CommunityMembersList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut", + // "https://www.googleapis.com/auth/orkut.readonly" + // ] + // } + +} + +// method id "orkut.communityMessages.delete": + +type CommunityMessagesDeleteCall struct { + s *Service + communityId int64 + topicId int64 + messageId int64 + opt_ map[string]interface{} +} + +// Delete: Moves a message of the community to the trash folder. +func (r *CommunityMessagesService) Delete(communityId int64, topicId int64, messageId int64) *CommunityMessagesDeleteCall { + c := &CommunityMessagesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + c.topicId = topicId + c.messageId = messageId + return c +} + +func (c *CommunityMessagesDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/topics/{topicId}/messages/{messageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{topicId}", strconv.FormatInt(c.topicId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{messageId}", strconv.FormatInt(c.messageId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Moves a message of the community to the trash folder.", + // "httpMethod": "DELETE", + // "id": "orkut.communityMessages.delete", + // "parameterOrder": [ + // "communityId", + // "topicId", + // "messageId" + // ], + // "parameters": { + // "communityId": { + // "description": "The ID of the community whose message will be moved to the trash folder.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "messageId": { + // "description": "The ID of the message to be moved to the trash folder.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "topicId": { + // "description": "The ID of the topic whose message will be moved to the trash folder.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "communities/{communityId}/topics/{topicId}/messages/{messageId}", + // "scopes": [ + // "https://www.googleapis.com/auth/orkut" + // ] + // } + +} + +// method id "orkut.communityMessages.insert": + +type CommunityMessagesInsertCall struct { + s *Service + communityId int64 + topicId int64 + communitymessage *CommunityMessage + opt_ map[string]interface{} +} + +// Insert: Adds a message to a given community topic. +func (r *CommunityMessagesService) Insert(communityId int64, topicId int64, communitymessage *CommunityMessage) *CommunityMessagesInsertCall { + c := &CommunityMessagesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + c.topicId = topicId + c.communitymessage = communitymessage + return c +} + +func (c *CommunityMessagesInsertCall) Do() (*CommunityMessage, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.communitymessage) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/topics/{topicId}/messages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{topicId}", strconv.FormatInt(c.topicId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommunityMessage) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a message to a given community topic.", + // "httpMethod": "POST", + // "id": "orkut.communityMessages.insert", + // "parameterOrder": [ + // "communityId", + // "topicId" + // ], + // "parameters": { + // "communityId": { + // "description": "The ID of the community the message should be added to.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "topicId": { + // "description": "The ID of the topic the message should be added to.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "communities/{communityId}/topics/{topicId}/messages", + // "request": { + // "$ref": "CommunityMessage" + // }, + // "response": { + // "$ref": "CommunityMessage" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut" + // ] + // } + +} + +// method id "orkut.communityMessages.list": + +type CommunityMessagesListCall struct { + s *Service + communityId int64 + topicId int64 + opt_ map[string]interface{} +} + +// List: Retrieves the messages of a topic of a community. +func (r *CommunityMessagesService) List(communityId int64, topicId int64) *CommunityMessagesListCall { + c := &CommunityMessagesListCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + c.topicId = topicId + return c +} + +// Hl sets the optional parameter "hl": Specifies the interface language +// (host language) of your user interface. +func (c *CommunityMessagesListCall) Hl(hl string) *CommunityMessagesListCall { + c.opt_["hl"] = hl + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of messages to include in the response. +func (c *CommunityMessagesListCall) MaxResults(maxResults int64) *CommunityMessagesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token that allows pagination. +func (c *CommunityMessagesListCall) PageToken(pageToken string) *CommunityMessagesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CommunityMessagesListCall) Do() (*CommunityMessageList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["hl"]; ok { + params.Set("hl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/topics/{topicId}/messages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{topicId}", strconv.FormatInt(c.topicId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommunityMessageList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the messages of a topic of a community.", + // "httpMethod": "GET", + // "id": "orkut.communityMessages.list", + // "parameterOrder": [ + // "communityId", + // "topicId" + // ], + // "parameters": { + // "communityId": { + // "description": "The ID of the community which messages will be listed.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "hl": { + // "description": "Specifies the interface language (host language) of your user interface.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of messages to include in the response.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token that allows pagination.", + // "location": "query", + // "type": "string" + // }, + // "topicId": { + // "description": "The ID of the topic which messages will be listed.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "communities/{communityId}/topics/{topicId}/messages", + // "response": { + // "$ref": "CommunityMessageList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut", + // "https://www.googleapis.com/auth/orkut.readonly" + // ] + // } + +} + +// method id "orkut.communityPollComments.insert": + +type CommunityPollCommentsInsertCall struct { + s *Service + communityId int64 + pollId string + communitypollcomment *CommunityPollComment + opt_ map[string]interface{} +} + +// Insert: Adds a comment on a community poll. +func (r *CommunityPollCommentsService) Insert(communityId int64, pollId string, communitypollcomment *CommunityPollComment) *CommunityPollCommentsInsertCall { + c := &CommunityPollCommentsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + c.pollId = pollId + c.communitypollcomment = communitypollcomment + return c +} + +func (c *CommunityPollCommentsInsertCall) Do() (*CommunityPollComment, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.communitypollcomment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/polls/{pollId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{pollId}", url.QueryEscape(c.pollId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommunityPollComment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a comment on a community poll.", + // "httpMethod": "POST", + // "id": "orkut.communityPollComments.insert", + // "parameterOrder": [ + // "communityId", + // "pollId" + // ], + // "parameters": { + // "communityId": { + // "description": "The ID of the community whose poll is being commented.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "pollId": { + // "description": "The ID of the poll being commented.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "communities/{communityId}/polls/{pollId}/comments", + // "request": { + // "$ref": "CommunityPollComment" + // }, + // "response": { + // "$ref": "CommunityPollComment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut" + // ] + // } + +} + +// method id "orkut.communityPollComments.list": + +type CommunityPollCommentsListCall struct { + s *Service + communityId int64 + pollId string + opt_ map[string]interface{} +} + +// List: Retrieves the comments of a community poll. +func (r *CommunityPollCommentsService) List(communityId int64, pollId string) *CommunityPollCommentsListCall { + c := &CommunityPollCommentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + c.pollId = pollId + return c +} + +// Hl sets the optional parameter "hl": Specifies the interface language +// (host language) of your user interface. +func (c *CommunityPollCommentsListCall) Hl(hl string) *CommunityPollCommentsListCall { + c.opt_["hl"] = hl + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of comments to include in the response. +func (c *CommunityPollCommentsListCall) MaxResults(maxResults int64) *CommunityPollCommentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token that allows pagination. +func (c *CommunityPollCommentsListCall) PageToken(pageToken string) *CommunityPollCommentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CommunityPollCommentsListCall) Do() (*CommunityPollCommentList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["hl"]; ok { + params.Set("hl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/polls/{pollId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{pollId}", url.QueryEscape(c.pollId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommunityPollCommentList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the comments of a community poll.", + // "httpMethod": "GET", + // "id": "orkut.communityPollComments.list", + // "parameterOrder": [ + // "communityId", + // "pollId" + // ], + // "parameters": { + // "communityId": { + // "description": "The ID of the community whose poll is having its comments listed.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "hl": { + // "description": "Specifies the interface language (host language) of your user interface.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of comments to include in the response.", + // "format": "uint32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token that allows pagination.", + // "location": "query", + // "type": "string" + // }, + // "pollId": { + // "description": "The ID of the community whose polls will be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "communities/{communityId}/polls/{pollId}/comments", + // "response": { + // "$ref": "CommunityPollCommentList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut", + // "https://www.googleapis.com/auth/orkut.readonly" + // ] + // } + +} + +// method id "orkut.communityPollVotes.insert": + +type CommunityPollVotesInsertCall struct { + s *Service + communityId int64 + pollId string + communitypollvote *CommunityPollVote + opt_ map[string]interface{} +} + +// Insert: Votes on a community poll. +func (r *CommunityPollVotesService) Insert(communityId int64, pollId string, communitypollvote *CommunityPollVote) *CommunityPollVotesInsertCall { + c := &CommunityPollVotesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + c.pollId = pollId + c.communitypollvote = communitypollvote + return c +} + +func (c *CommunityPollVotesInsertCall) Do() (*CommunityPollVote, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.communitypollvote) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/polls/{pollId}/votes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{pollId}", url.QueryEscape(c.pollId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommunityPollVote) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Votes on a community poll.", + // "httpMethod": "POST", + // "id": "orkut.communityPollVotes.insert", + // "parameterOrder": [ + // "communityId", + // "pollId" + // ], + // "parameters": { + // "communityId": { + // "description": "The ID of the community whose poll is being voted.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "pollId": { + // "description": "The ID of the poll being voted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "communities/{communityId}/polls/{pollId}/votes", + // "request": { + // "$ref": "CommunityPollVote" + // }, + // "response": { + // "$ref": "CommunityPollVote" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut" + // ] + // } + +} + +// method id "orkut.communityPolls.get": + +type CommunityPollsGetCall struct { + s *Service + communityId int64 + pollId string + opt_ map[string]interface{} +} + +// Get: Retrieves one specific poll of a community. +func (r *CommunityPollsService) Get(communityId int64, pollId string) *CommunityPollsGetCall { + c := &CommunityPollsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + c.pollId = pollId + return c +} + +// Hl sets the optional parameter "hl": Specifies the interface language +// (host language) of your user interface. +func (c *CommunityPollsGetCall) Hl(hl string) *CommunityPollsGetCall { + c.opt_["hl"] = hl + return c +} + +func (c *CommunityPollsGetCall) Do() (*CommunityPoll, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["hl"]; ok { + params.Set("hl", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/polls/{pollId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{pollId}", url.QueryEscape(c.pollId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommunityPoll) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves one specific poll of a community.", + // "httpMethod": "GET", + // "id": "orkut.communityPolls.get", + // "parameterOrder": [ + // "communityId", + // "pollId" + // ], + // "parameters": { + // "communityId": { + // "description": "The ID of the community for whose poll will be retrieved.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "hl": { + // "description": "Specifies the interface language (host language) of your user interface.", + // "location": "query", + // "type": "string" + // }, + // "pollId": { + // "description": "The ID of the poll to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "communities/{communityId}/polls/{pollId}", + // "response": { + // "$ref": "CommunityPoll" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut", + // "https://www.googleapis.com/auth/orkut.readonly" + // ] + // } + +} + +// method id "orkut.communityPolls.list": + +type CommunityPollsListCall struct { + s *Service + communityId int64 + opt_ map[string]interface{} +} + +// List: Retrieves the polls of a community. +func (r *CommunityPollsService) List(communityId int64) *CommunityPollsListCall { + c := &CommunityPollsListCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + return c +} + +// Hl sets the optional parameter "hl": Specifies the interface language +// (host language) of your user interface. +func (c *CommunityPollsListCall) Hl(hl string) *CommunityPollsListCall { + c.opt_["hl"] = hl + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of polls to include in the response. +func (c *CommunityPollsListCall) MaxResults(maxResults int64) *CommunityPollsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token that allows pagination. +func (c *CommunityPollsListCall) PageToken(pageToken string) *CommunityPollsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CommunityPollsListCall) Do() (*CommunityPollList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["hl"]; ok { + params.Set("hl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/polls") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommunityPollList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the polls of a community.", + // "httpMethod": "GET", + // "id": "orkut.communityPolls.list", + // "parameterOrder": [ + // "communityId" + // ], + // "parameters": { + // "communityId": { + // "description": "The ID of the community which polls will be listed.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "hl": { + // "description": "Specifies the interface language (host language) of your user interface.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of polls to include in the response.", + // "format": "uint32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token that allows pagination.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "communities/{communityId}/polls", + // "response": { + // "$ref": "CommunityPollList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut", + // "https://www.googleapis.com/auth/orkut.readonly" + // ] + // } + +} + +// method id "orkut.communityRelated.list": + +type CommunityRelatedListCall struct { + s *Service + communityId int64 + opt_ map[string]interface{} +} + +// List: Retrieves the communities related to another one. +func (r *CommunityRelatedService) List(communityId int64) *CommunityRelatedListCall { + c := &CommunityRelatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + return c +} + +// Hl sets the optional parameter "hl": Specifies the interface language +// (host language) of your user interface. +func (c *CommunityRelatedListCall) Hl(hl string) *CommunityRelatedListCall { + c.opt_["hl"] = hl + return c +} + +func (c *CommunityRelatedListCall) Do() (*CommunityList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["hl"]; ok { + params.Set("hl", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/related") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommunityList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the communities related to another one.", + // "httpMethod": "GET", + // "id": "orkut.communityRelated.list", + // "parameterOrder": [ + // "communityId" + // ], + // "parameters": { + // "communityId": { + // "description": "The ID of the community whose related communities will be listed.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "hl": { + // "description": "Specifies the interface language (host language) of your user interface.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "communities/{communityId}/related", + // "response": { + // "$ref": "CommunityList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut", + // "https://www.googleapis.com/auth/orkut.readonly" + // ] + // } + +} + +// method id "orkut.communityTopics.delete": + +type CommunityTopicsDeleteCall struct { + s *Service + communityId int64 + topicId int64 + opt_ map[string]interface{} +} + +// Delete: Moves a topic of the community to the trash folder. +func (r *CommunityTopicsService) Delete(communityId int64, topicId int64) *CommunityTopicsDeleteCall { + c := &CommunityTopicsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + c.topicId = topicId + return c +} + +func (c *CommunityTopicsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/topics/{topicId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{topicId}", strconv.FormatInt(c.topicId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Moves a topic of the community to the trash folder.", + // "httpMethod": "DELETE", + // "id": "orkut.communityTopics.delete", + // "parameterOrder": [ + // "communityId", + // "topicId" + // ], + // "parameters": { + // "communityId": { + // "description": "The ID of the community whose topic will be moved to the trash folder.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "topicId": { + // "description": "The ID of the topic to be moved to the trash folder.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "communities/{communityId}/topics/{topicId}", + // "scopes": [ + // "https://www.googleapis.com/auth/orkut" + // ] + // } + +} + +// method id "orkut.communityTopics.get": + +type CommunityTopicsGetCall struct { + s *Service + communityId int64 + topicId int64 + opt_ map[string]interface{} +} + +// Get: Retrieves a topic of a community. +func (r *CommunityTopicsService) Get(communityId int64, topicId int64) *CommunityTopicsGetCall { + c := &CommunityTopicsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + c.topicId = topicId + return c +} + +// Hl sets the optional parameter "hl": Specifies the interface language +// (host language) of your user interface. +func (c *CommunityTopicsGetCall) Hl(hl string) *CommunityTopicsGetCall { + c.opt_["hl"] = hl + return c +} + +func (c *CommunityTopicsGetCall) Do() (*CommunityTopic, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["hl"]; ok { + params.Set("hl", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/topics/{topicId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{topicId}", strconv.FormatInt(c.topicId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommunityTopic) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a topic of a community.", + // "httpMethod": "GET", + // "id": "orkut.communityTopics.get", + // "parameterOrder": [ + // "communityId", + // "topicId" + // ], + // "parameters": { + // "communityId": { + // "description": "The ID of the community whose topic will be retrieved.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "hl": { + // "description": "Specifies the interface language (host language) of your user interface.", + // "location": "query", + // "type": "string" + // }, + // "topicId": { + // "description": "The ID of the topic to get.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "communities/{communityId}/topics/{topicId}", + // "response": { + // "$ref": "CommunityTopic" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut", + // "https://www.googleapis.com/auth/orkut.readonly" + // ] + // } + +} + +// method id "orkut.communityTopics.insert": + +type CommunityTopicsInsertCall struct { + s *Service + communityId int64 + communitytopic *CommunityTopic + opt_ map[string]interface{} +} + +// Insert: Adds a topic to a given community. +func (r *CommunityTopicsService) Insert(communityId int64, communitytopic *CommunityTopic) *CommunityTopicsInsertCall { + c := &CommunityTopicsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + c.communitytopic = communitytopic + return c +} + +// IsShout sets the optional parameter "isShout": Whether this topic is +// a shout. +func (c *CommunityTopicsInsertCall) IsShout(isShout bool) *CommunityTopicsInsertCall { + c.opt_["isShout"] = isShout + return c +} + +func (c *CommunityTopicsInsertCall) Do() (*CommunityTopic, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.communitytopic) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["isShout"]; ok { + params.Set("isShout", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/topics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommunityTopic) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a topic to a given community.", + // "httpMethod": "POST", + // "id": "orkut.communityTopics.insert", + // "parameterOrder": [ + // "communityId" + // ], + // "parameters": { + // "communityId": { + // "description": "The ID of the community the topic should be added to.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "isShout": { + // "description": "Whether this topic is a shout.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "communities/{communityId}/topics", + // "request": { + // "$ref": "CommunityTopic" + // }, + // "response": { + // "$ref": "CommunityTopic" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut" + // ] + // } + +} + +// method id "orkut.communityTopics.list": + +type CommunityTopicsListCall struct { + s *Service + communityId int64 + opt_ map[string]interface{} +} + +// List: Retrieves the topics of a community. +func (r *CommunityTopicsService) List(communityId int64) *CommunityTopicsListCall { + c := &CommunityTopicsListCall{s: r.s, opt_: make(map[string]interface{})} + c.communityId = communityId + return c +} + +// Hl sets the optional parameter "hl": Specifies the interface language +// (host language) of your user interface. +func (c *CommunityTopicsListCall) Hl(hl string) *CommunityTopicsListCall { + c.opt_["hl"] = hl + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of topics to include in the response. +func (c *CommunityTopicsListCall) MaxResults(maxResults int64) *CommunityTopicsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation +// token that allows pagination. +func (c *CommunityTopicsListCall) PageToken(pageToken string) *CommunityTopicsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CommunityTopicsListCall) Do() (*CommunityTopicList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["hl"]; ok { + params.Set("hl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "communities/{communityId}/topics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{communityId}", strconv.FormatInt(c.communityId, 10), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommunityTopicList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the topics of a community.", + // "httpMethod": "GET", + // "id": "orkut.communityTopics.list", + // "parameterOrder": [ + // "communityId" + // ], + // "parameters": { + // "communityId": { + // "description": "The ID of the community which topics will be listed.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "hl": { + // "description": "Specifies the interface language (host language) of your user interface.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of topics to include in the response.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A continuation token that allows pagination.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "communities/{communityId}/topics", + // "response": { + // "$ref": "CommunityTopicList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut", + // "https://www.googleapis.com/auth/orkut.readonly" + // ] + // } + +} + +// method id "orkut.counters.list": + +type CountersListCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// List: Retrieves the counters of a user. +func (r *CountersService) List(userId string) *CountersListCall { + c := &CountersListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +func (c *CountersListCall) Do() (*Counters, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/counters") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Counters) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the counters of a user.", + // "httpMethod": "GET", + // "id": "orkut.counters.list", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "description": "The ID of the user whose counters will be listed. Can be me to refer to caller.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/counters", + // "response": { + // "$ref": "Counters" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut", + // "https://www.googleapis.com/auth/orkut.readonly" + // ] + // } + +} + +// method id "orkut.scraps.insert": + +type ScrapsInsertCall struct { + s *Service + activity *Activity + opt_ map[string]interface{} +} + +// Insert: Creates a new scrap. +func (r *ScrapsService) Insert(activity *Activity) *ScrapsInsertCall { + c := &ScrapsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.activity = activity + return c +} + +func (c *ScrapsInsertCall) Do() (*Activity, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.activity) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/scraps") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Activity) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new scrap.", + // "httpMethod": "POST", + // "id": "orkut.scraps.insert", + // "path": "activities/scraps", + // "request": { + // "$ref": "Activity" + // }, + // "response": { + // "$ref": "Activity" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/orkut" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/pagespeedonline/v1/pagespeedonline-api.json b/third_party/src/code.google.com/p/google-api-go-client/pagespeedonline/v1/pagespeedonline-api.json new file mode 100644 index 0000000000000..58dfb4b9ee330 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/pagespeedonline/v1/pagespeedonline-api.json @@ -0,0 +1,420 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/_7T_t50z1qoOGh9ZOpbii06YKEs\"", + "discoveryVersion": "v1", + "id": "pagespeedonline:v1", + "name": "pagespeedonline", + "version": "v1", + "title": "PageSpeed Insights API", + "description": "Lets you analyze the performance of a web page and get tailored suggestions to make that page faster.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/pagespeed-16.png", + "x32": "http://www.google.com/images/icons/product/pagespeed-32.png" + }, + "documentationLink": "https://developers.google.com/speed/docs/insights/v1/getting_started", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/pagespeedonline/v1/", + "basePath": "/pagespeedonline/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "pagespeedonline/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" + } + }, + "schemas": { + "Result": { + "id": "Result", + "type": "object", + "properties": { + "formattedResults": { + "type": "object", + "description": "Localized Page Speed results. Contains a ruleResults entry for each Page Speed rule instantiated and run by the server.", + "properties": { + "locale": { + "type": "string", + "description": "The locale of the formattedResults, e.g. \"en_US\"." + }, + "ruleResults": { + "type": "object", + "description": "Dictionary of formatted rule results, with one entry for each Page Speed rule instantiated and run by the server.", + "additionalProperties": { + "type": "object", + "description": "The enum-like identifier for this rule. For instance \"EnableKeepAlive\" or \"AvoidCssImport\". Not localized.", + "properties": { + "localizedRuleName": { + "type": "string", + "description": "Localized name of the rule, intended for presentation to a user." + }, + "ruleImpact": { + "type": "number", + "description": "The impact (unbounded floating point value) that implementing the suggestions for this rule would have on making the page faster. Impact is comparable between rules to determine which rule's suggestions would have a higher or lower impact on making a page faster. For instance, if enabling compression would save 1MB, while optimizing images would save 500kB, the enable compression rule would have 2x the impact of the image optimization rule, all other things being equal.", + "format": "double" + }, + "urlBlocks": { + "type": "array", + "description": "List of blocks of URLs. Each block may contain a heading and a list of URLs. Each URL may optionally include additional details.", + "items": { + "type": "object", + "properties": { + "header": { + "type": "object", + "description": "Heading to be displayed with the list of URLs.", + "properties": { + "args": { + "type": "array", + "description": "List of arguments for the format string.", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of argument. One of URL, STRING_LITERAL, INT_LITERAL, BYTES, or DURATION." + }, + "value": { + "type": "string", + "description": "Argument value, as a localized string." + } + } + } + }, + "format": { + "type": "string", + "description": "A localized format string with $N placeholders, where N is the 1-indexed argument number, e.g. 'Minifying the following $1 resources would save a total of $2 bytes'." + } + } + }, + "urls": { + "type": "array", + "description": "List of entries that provide information about URLs in the url block. Optional.", + "items": { + "type": "object", + "properties": { + "details": { + "type": "array", + "description": "List of entries that provide additional details about a single URL. Optional.", + "items": { + "type": "object", + "properties": { + "args": { + "type": "array", + "description": "List of arguments for the format string.", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of argument. One of URL, STRING_LITERAL, INT_LITERAL, BYTES, or DURATION." + }, + "value": { + "type": "string", + "description": "Argument value, as a localized string." + } + } + } + }, + "format": { + "type": "string", + "description": "A localized format string with $N placeholders, where N is the 1-indexed argument number, e.g. 'Unnecessary metadata for this resource adds an additional $1 bytes to its download size'." + } + } + } + }, + "result": { + "type": "object", + "description": "A format string that gives information about the URL, and a list of arguments for that format string.", + "properties": { + "args": { + "type": "array", + "description": "List of arguments for the format string.", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of argument. One of URL, STRING_LITERAL, INT_LITERAL, BYTES, or DURATION." + }, + "value": { + "type": "string", + "description": "Argument value, as a localized string." + } + } + } + }, + "format": { + "type": "string", + "description": "A localized format string with $N placeholders, where N is the 1-indexed argument number, e.g. 'Minifying the resource at URL $1 can save $2 bytes'." + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "id": { + "type": "string", + "description": "Canonicalized and final URL for the document, after following page redirects (if any)." + }, + "invalidRules": { + "type": "array", + "description": "List of rules that were specified in the request, but which the server did not know how to instantiate.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "Kind of result.", + "default": "pagespeedonline#result" + }, + "pageStats": { + "type": "object", + "description": "Summary statistics for the page, such as number of JavaScript bytes, number of HTML bytes, etc.", + "properties": { + "cssResponseBytes": { + "type": "string", + "description": "Number of uncompressed response bytes for CSS resources on the page.", + "format": "int64" + }, + "flashResponseBytes": { + "type": "string", + "description": "Number of response bytes for flash resources on the page.", + "format": "int64" + }, + "htmlResponseBytes": { + "type": "string", + "description": "Number of uncompressed response bytes for the main HTML document and all iframes on the page.", + "format": "int64" + }, + "imageResponseBytes": { + "type": "string", + "description": "Number of response bytes for image resources on the page.", + "format": "int64" + }, + "javascriptResponseBytes": { + "type": "string", + "description": "Number of uncompressed response bytes for JS resources on the page.", + "format": "int64" + }, + "numberCssResources": { + "type": "integer", + "description": "Number of CSS resources referenced by the page.", + "format": "int32" + }, + "numberHosts": { + "type": "integer", + "description": "Number of unique hosts referenced by the page.", + "format": "int32" + }, + "numberJsResources": { + "type": "integer", + "description": "Number of JavaScript resources referenced by the page.", + "format": "int32" + }, + "numberResources": { + "type": "integer", + "description": "Number of HTTP resources loaded by the page.", + "format": "int32" + }, + "numberStaticResources": { + "type": "integer", + "description": "Number of static (i.e. cacheable) resources on the page.", + "format": "int32" + }, + "otherResponseBytes": { + "type": "string", + "description": "Number of response bytes for other resources on the page.", + "format": "int64" + }, + "textResponseBytes": { + "type": "string", + "description": "Number of uncompressed response bytes for text resources not covered by other statistics (i.e non-HTML, non-script, non-CSS resources) on the page.", + "format": "int64" + }, + "totalRequestBytes": { + "type": "string", + "description": "Total size of all request bytes sent by the page.", + "format": "int64" + } + } + }, + "responseCode": { + "type": "integer", + "description": "Response code for the document. 200 indicates a normal page load. 4xx/5xx indicates an error.", + "format": "int32" + }, + "score": { + "type": "integer", + "description": "The Page Speed Score (0-100), which indicates how much faster a page could be. A high score indicates little room for improvement, while a lower score indicates more room for improvement.", + "format": "int32" + }, + "screenshot": { + "type": "object", + "description": "Base64 encoded screenshot of the page that was analyzed.", + "properties": { + "data": { + "type": "string", + "description": "Image data base64 encoded.", + "format": "byte" + }, + "height": { + "type": "integer", + "description": "Height of screenshot in pixels.", + "format": "int32" + }, + "mime_type": { + "type": "string", + "description": "Mime type of image data. E.g. \"image/jpeg\"." + }, + "width": { + "type": "integer", + "description": "Width of screenshot in pixels.", + "format": "int32" + } + } + }, + "title": { + "type": "string", + "description": "Title of the page, as displayed in the browser's title bar." + }, + "version": { + "type": "object", + "description": "The version of the Page Speed SDK used to generate these results.", + "properties": { + "major": { + "type": "integer", + "description": "The major version number of the Page Speed SDK used to generate these results.", + "format": "int32" + }, + "minor": { + "type": "integer", + "description": "The minor version number of the Page Speed SDK used to generate these results.", + "format": "int32" + } + } + } + } + } + }, + "resources": { + "pagespeedapi": { + "methods": { + "runpagespeed": { + "id": "pagespeedonline.pagespeedapi.runpagespeed", + "path": "runPagespeed", + "httpMethod": "GET", + "description": "Runs Page Speed analysis on the page at the specified URL, and returns a Page Speed score, a list of suggestions to make that page faster, and other information.", + "parameters": { + "filter_third_party_resources": { + "type": "boolean", + "description": "Indicates if third party resources should be filtered out before PageSpeed analysis.", + "default": "false", + "location": "query" + }, + "locale": { + "type": "string", + "description": "The locale used to localize formatted results", + "pattern": "[a-zA-Z]+(_[a-zA-Z]+)?", + "location": "query" + }, + "rule": { + "type": "string", + "description": "A Page Speed rule to run; if none are given, all rules are run", + "pattern": "[a-zA-Z]+", + "repeated": true, + "location": "query" + }, + "screenshot": { + "type": "boolean", + "description": "Indicates if binary data containing a screenshot should be included", + "default": "false", + "location": "query" + }, + "snapshots": { + "type": "boolean", + "description": "Indicates if binary data containing snapshot images should be included", + "default": "false", + "location": "query" + }, + "strategy": { + "type": "string", + "description": "The analysis strategy to use", + "enum": [ + "desktop", + "mobile" + ], + "enumDescriptions": [ + "Fetch and analyze the URL for desktop browsers", + "Fetch and analyze the URL for mobile devices" + ], + "location": "query" + }, + "url": { + "type": "string", + "description": "The URL to fetch and analyze", + "required": true, + "pattern": "http(s)?://.*", + "location": "query" + } + }, + "parameterOrder": [ + "url" + ], + "response": { + "$ref": "Result" + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/pagespeedonline/v1/pagespeedonline-gen.go b/third_party/src/code.google.com/p/google-api-go-client/pagespeedonline/v1/pagespeedonline-gen.go new file mode 100644 index 0000000000000..51b2b86e313d1 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/pagespeedonline/v1/pagespeedonline-gen.go @@ -0,0 +1,362 @@ +// Package pagespeedonline provides access to the PageSpeed Insights API. +// +// See https://developers.google.com/speed/docs/insights/v1/getting_started +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/pagespeedonline/v1" +// ... +// pagespeedonlineService, err := pagespeedonline.New(oauthHttpClient) +package pagespeedonline + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "pagespeedonline:v1" +const apiName = "pagespeedonline" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/pagespeedonline/v1/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Pagespeedapi = NewPagespeedapiService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Pagespeedapi *PagespeedapiService +} + +func NewPagespeedapiService(s *Service) *PagespeedapiService { + rs := &PagespeedapiService{s: s} + return rs +} + +type PagespeedapiService struct { + s *Service +} + +type Result struct { + // FormattedResults: Localized Page Speed results. Contains a + // ruleResults entry for each Page Speed rule instantiated and run by + // the server. + FormattedResults *ResultFormattedResults `json:"formattedResults,omitempty"` + + // Id: Canonicalized and final URL for the document, after following + // page redirects (if any). + Id string `json:"id,omitempty"` + + // InvalidRules: List of rules that were specified in the request, but + // which the server did not know how to instantiate. + InvalidRules []string `json:"invalidRules,omitempty"` + + // Kind: Kind of result. + Kind string `json:"kind,omitempty"` + + // PageStats: Summary statistics for the page, such as number of + // JavaScript bytes, number of HTML bytes, etc. + PageStats *ResultPageStats `json:"pageStats,omitempty"` + + // ResponseCode: Response code for the document. 200 indicates a normal + // page load. 4xx/5xx indicates an error. + ResponseCode int64 `json:"responseCode,omitempty"` + + // Score: The Page Speed Score (0-100), which indicates how much faster + // a page could be. A high score indicates little room for improvement, + // while a lower score indicates more room for improvement. + Score int64 `json:"score,omitempty"` + + // Screenshot: Base64 encoded screenshot of the page that was analyzed. + Screenshot *ResultScreenshot `json:"screenshot,omitempty"` + + // Title: Title of the page, as displayed in the browser's title bar. + Title string `json:"title,omitempty"` + + // Version: The version of the Page Speed SDK used to generate these + // results. + Version *ResultVersion `json:"version,omitempty"` +} + +type ResultFormattedResults struct { + // Locale: The locale of the formattedResults, e.g. "en_US". + Locale string `json:"locale,omitempty"` + + // RuleResults: Dictionary of formatted rule results, with one entry for + // each Page Speed rule instantiated and run by the server. + RuleResults *ResultFormattedResultsRuleResults `json:"ruleResults,omitempty"` +} + +type ResultFormattedResultsRuleResults struct { +} + +type ResultPageStats struct { + // CssResponseBytes: Number of uncompressed response bytes for CSS + // resources on the page. + CssResponseBytes int64 `json:"cssResponseBytes,omitempty,string"` + + // FlashResponseBytes: Number of response bytes for flash resources on + // the page. + FlashResponseBytes int64 `json:"flashResponseBytes,omitempty,string"` + + // HtmlResponseBytes: Number of uncompressed response bytes for the main + // HTML document and all iframes on the page. + HtmlResponseBytes int64 `json:"htmlResponseBytes,omitempty,string"` + + // ImageResponseBytes: Number of response bytes for image resources on + // the page. + ImageResponseBytes int64 `json:"imageResponseBytes,omitempty,string"` + + // JavascriptResponseBytes: Number of uncompressed response bytes for JS + // resources on the page. + JavascriptResponseBytes int64 `json:"javascriptResponseBytes,omitempty,string"` + + // NumberCssResources: Number of CSS resources referenced by the page. + NumberCssResources int64 `json:"numberCssResources,omitempty"` + + // NumberHosts: Number of unique hosts referenced by the page. + NumberHosts int64 `json:"numberHosts,omitempty"` + + // NumberJsResources: Number of JavaScript resources referenced by the + // page. + NumberJsResources int64 `json:"numberJsResources,omitempty"` + + // NumberResources: Number of HTTP resources loaded by the page. + NumberResources int64 `json:"numberResources,omitempty"` + + // NumberStaticResources: Number of static (i.e. cacheable) resources on + // the page. + NumberStaticResources int64 `json:"numberStaticResources,omitempty"` + + // OtherResponseBytes: Number of response bytes for other resources on + // the page. + OtherResponseBytes int64 `json:"otherResponseBytes,omitempty,string"` + + // TextResponseBytes: Number of uncompressed response bytes for text + // resources not covered by other statistics (i.e non-HTML, non-script, + // non-CSS resources) on the page. + TextResponseBytes int64 `json:"textResponseBytes,omitempty,string"` + + // TotalRequestBytes: Total size of all request bytes sent by the page. + TotalRequestBytes int64 `json:"totalRequestBytes,omitempty,string"` +} + +type ResultScreenshot struct { + // Data: Image data base64 encoded. + Data string `json:"data,omitempty"` + + // Height: Height of screenshot in pixels. + Height int64 `json:"height,omitempty"` + + // Mime_type: Mime type of image data. E.g. "image/jpeg". + Mime_type string `json:"mime_type,omitempty"` + + // Width: Width of screenshot in pixels. + Width int64 `json:"width,omitempty"` +} + +type ResultVersion struct { + // Major: The major version number of the Page Speed SDK used to + // generate these results. + Major int64 `json:"major,omitempty"` + + // Minor: The minor version number of the Page Speed SDK used to + // generate these results. + Minor int64 `json:"minor,omitempty"` +} + +// method id "pagespeedonline.pagespeedapi.runpagespeed": + +type PagespeedapiRunpagespeedCall struct { + s *Service + url string + opt_ map[string]interface{} +} + +// Runpagespeed: Runs Page Speed analysis on the page at the specified +// URL, and returns a Page Speed score, a list of suggestions to make +// that page faster, and other information. +func (r *PagespeedapiService) Runpagespeed(url string) *PagespeedapiRunpagespeedCall { + c := &PagespeedapiRunpagespeedCall{s: r.s, opt_: make(map[string]interface{})} + c.url = url + return c +} + +// Filter_third_party_resources sets the optional parameter +// "filter_third_party_resources": Indicates if third party resources +// should be filtered out before PageSpeed analysis. +func (c *PagespeedapiRunpagespeedCall) Filter_third_party_resources(filter_third_party_resources bool) *PagespeedapiRunpagespeedCall { + c.opt_["filter_third_party_resources"] = filter_third_party_resources + return c +} + +// Locale sets the optional parameter "locale": The locale used to +// localize formatted results +func (c *PagespeedapiRunpagespeedCall) Locale(locale string) *PagespeedapiRunpagespeedCall { + c.opt_["locale"] = locale + return c +} + +// Rule sets the optional parameter "rule": A Page Speed rule to run; if +// none are given, all rules are run +func (c *PagespeedapiRunpagespeedCall) Rule(rule string) *PagespeedapiRunpagespeedCall { + c.opt_["rule"] = rule + return c +} + +// Screenshot sets the optional parameter "screenshot": Indicates if +// binary data containing a screenshot should be included +func (c *PagespeedapiRunpagespeedCall) Screenshot(screenshot bool) *PagespeedapiRunpagespeedCall { + c.opt_["screenshot"] = screenshot + return c +} + +// Snapshots sets the optional parameter "snapshots": Indicates if +// binary data containing snapshot images should be included +func (c *PagespeedapiRunpagespeedCall) Snapshots(snapshots bool) *PagespeedapiRunpagespeedCall { + c.opt_["snapshots"] = snapshots + return c +} + +// Strategy sets the optional parameter "strategy": The analysis +// strategy to use +func (c *PagespeedapiRunpagespeedCall) Strategy(strategy string) *PagespeedapiRunpagespeedCall { + c.opt_["strategy"] = strategy + return c +} + +func (c *PagespeedapiRunpagespeedCall) Do() (*Result, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("url", fmt.Sprintf("%v", c.url)) + if v, ok := c.opt_["filter_third_party_resources"]; ok { + params.Set("filter_third_party_resources", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["rule"]; ok { + params.Set("rule", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["screenshot"]; ok { + params.Set("screenshot", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["snapshots"]; ok { + params.Set("snapshots", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["strategy"]; ok { + params.Set("strategy", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "runPagespeed") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Result) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Runs Page Speed analysis on the page at the specified URL, and returns a Page Speed score, a list of suggestions to make that page faster, and other information.", + // "httpMethod": "GET", + // "id": "pagespeedonline.pagespeedapi.runpagespeed", + // "parameterOrder": [ + // "url" + // ], + // "parameters": { + // "filter_third_party_resources": { + // "default": "false", + // "description": "Indicates if third party resources should be filtered out before PageSpeed analysis.", + // "location": "query", + // "type": "boolean" + // }, + // "locale": { + // "description": "The locale used to localize formatted results", + // "location": "query", + // "pattern": "[a-zA-Z]+(_[a-zA-Z]+)?", + // "type": "string" + // }, + // "rule": { + // "description": "A Page Speed rule to run; if none are given, all rules are run", + // "location": "query", + // "pattern": "[a-zA-Z]+", + // "repeated": true, + // "type": "string" + // }, + // "screenshot": { + // "default": "false", + // "description": "Indicates if binary data containing a screenshot should be included", + // "location": "query", + // "type": "boolean" + // }, + // "snapshots": { + // "default": "false", + // "description": "Indicates if binary data containing snapshot images should be included", + // "location": "query", + // "type": "boolean" + // }, + // "strategy": { + // "description": "The analysis strategy to use", + // "enum": [ + // "desktop", + // "mobile" + // ], + // "enumDescriptions": [ + // "Fetch and analyze the URL for desktop browsers", + // "Fetch and analyze the URL for mobile devices" + // ], + // "location": "query", + // "type": "string" + // }, + // "url": { + // "description": "The URL to fetch and analyze", + // "location": "query", + // "pattern": "http(s)?://.*", + // "required": true, + // "type": "string" + // } + // }, + // "path": "runPagespeed", + // "response": { + // "$ref": "Result" + // } + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/plus/v1/plus-api.json b/third_party/src/code.google.com/p/google-api-go-client/plus/v1/plus-api.json new file mode 100644 index 0000000000000..597008c4278cc --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/plus/v1/plus-api.json @@ -0,0 +1,1945 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/NWyyDxpG_jUB4-BRItKBh_G9Iew\"", + "discoveryVersion": "v1", + "id": "plus:v1", + "name": "plus", + "version": "v1", + "title": "Google+ API", + "description": "The Google+ API enables developers to build on top of the Google+ platform.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/gplus-16.png", + "x32": "http://www.google.com/images/icons/product/gplus-32.png" + }, + "documentationLink": "https://developers.google.com/+/api/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/plus/v1/", + "basePath": "/plus/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "plus/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/plus.login": { + "description": "Know your basic profile info and list of people in your circles." + }, + "https://www.googleapis.com/auth/plus.me": { + "description": "Know who you are on Google" + }, + "https://www.googleapis.com/auth/userinfo.email": { + "description": "View your email address" + }, + "https://www.googleapis.com/auth/userinfo.profile": { + "description": "View basic information about your account" + } + } + } + }, + "schemas": { + "Acl": { + "id": "Acl", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Description of the access granted, suitable for display." + }, + "items": { + "type": "array", + "description": "The list of access entries.", + "items": { + "$ref": "PlusAclentryResource" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of access controls. Value: \"plus#acl\".", + "default": "plus#acl" + } + } + }, + "Activity": { + "id": "Activity", + "type": "object", + "properties": { + "access": { + "$ref": "Acl", + "description": "Identifies who has access to see this activity." + }, + "actor": { + "type": "object", + "description": "The person who performed this activity.", + "properties": { + "displayName": { + "type": "string", + "description": "The name of the actor, suitable for display." + }, + "id": { + "type": "string", + "description": "The ID of the actor's Person resource." + }, + "image": { + "type": "object", + "description": "The image representation of the actor.", + "properties": { + "url": { + "type": "string", + "description": "The URL of the actor's profile photo. To resize the image and crop it to a square, append the query string ?sz=x, where x is the dimension in pixels of each side." + } + } + }, + "name": { + "type": "object", + "description": "An object representation of the individual components of name.", + "properties": { + "familyName": { + "type": "string", + "description": "The family name (\"last name\") of the actor." + }, + "givenName": { + "type": "string", + "description": "The given name (\"first name\") of the actor." + } + } + }, + "url": { + "type": "string", + "description": "The link to the actor's Google profile." + } + } + }, + "address": { + "type": "string", + "description": "Street address where this activity occurred." + }, + "annotation": { + "type": "string", + "description": "Additional content added by the person who shared this activity, applicable only when resharing an activity." + }, + "crosspostSource": { + "type": "string", + "description": "If this activity is a crosspost from another system, this property specifies the ID of the original activity." + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "geocode": { + "type": "string", + "description": "Latitude and longitude where this activity occurred. Format is latitude followed by longitude, space separated." + }, + "id": { + "type": "string", + "description": "The ID of this activity." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as an activity. Value: \"plus#activity\".", + "default": "plus#activity" + }, + "location": { + "$ref": "Place", + "description": "The location where this activity occurred." + }, + "object": { + "type": "object", + "description": "The object of this activity.", + "properties": { + "actor": { + "type": "object", + "description": "If this activity's object is itself another activity, such as when a person reshares an activity, this property specifies the original activity's actor.", + "properties": { + "displayName": { + "type": "string", + "description": "The original actor's name, which is suitable for display." + }, + "id": { + "type": "string", + "description": "ID of the original actor." + }, + "image": { + "type": "object", + "description": "The image representation of the original actor.", + "properties": { + "url": { + "type": "string", + "description": "A URL that points to a thumbnail photo of the original actor." + } + } + }, + "url": { + "type": "string", + "description": "A link to the original actor's Google profile." + } + } + }, + "attachments": { + "type": "array", + "description": "The media objects attached to this activity.", + "items": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "If the attachment is an article, this property contains a snippet of text from the article. It can also include descriptions for other types." + }, + "displayName": { + "type": "string", + "description": "The title of the attachment, such as a photo caption or an article title." + }, + "embed": { + "type": "object", + "description": "If the attachment is a video, the embeddable link.", + "properties": { + "type": { + "type": "string", + "description": "Media type of the link." + }, + "url": { + "type": "string", + "description": "URL of the link." + } + } + }, + "fullImage": { + "type": "object", + "description": "The full image URL for photo attachments.", + "properties": { + "height": { + "type": "integer", + "description": "The height, in pixels, of the linked resource.", + "format": "uint32" + }, + "type": { + "type": "string", + "description": "Media type of the link." + }, + "url": { + "type": "string", + "description": "URL of the image." + }, + "width": { + "type": "integer", + "description": "The width, in pixels, of the linked resource.", + "format": "uint32" + } + } + }, + "id": { + "type": "string", + "description": "The ID of the attachment." + }, + "image": { + "type": "object", + "description": "The preview image for photos or videos.", + "properties": { + "height": { + "type": "integer", + "description": "The height, in pixels, of the linked resource.", + "format": "uint32" + }, + "type": { + "type": "string", + "description": "Media type of the link." + }, + "url": { + "type": "string", + "description": "Image URL." + }, + "width": { + "type": "integer", + "description": "The width, in pixels, of the linked resource.", + "format": "uint32" + } + } + }, + "objectType": { + "type": "string", + "description": "The type of media object. Possible values include, but are not limited to, the following values: \n- \"photo\" - A photo. \n- \"album\" - A photo album. \n- \"video\" - A video. \n- \"article\" - An article, specified by a link." + }, + "thumbnails": { + "type": "array", + "description": "If the attachment is an album, this property is a list of potential additional thumbnails from the album.", + "items": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Potential name of the thumbnail." + }, + "image": { + "type": "object", + "description": "Image resource.", + "properties": { + "height": { + "type": "integer", + "description": "The height, in pixels, of the linked resource.", + "format": "uint32" + }, + "type": { + "type": "string", + "description": "Media type of the link." + }, + "url": { + "type": "string", + "description": "Image url." + }, + "width": { + "type": "integer", + "description": "The width, in pixels, of the linked resource.", + "format": "uint32" + } + } + }, + "url": { + "type": "string", + "description": "URL of the webpage containing the image." + } + } + } + }, + "url": { + "type": "string", + "description": "The link to the attachment, which should be of type text/html." + } + } + } + }, + "content": { + "type": "string", + "description": "The HTML-formatted content, which is suitable for display." + }, + "id": { + "type": "string", + "description": "The ID of the object. When resharing an activity, this is the ID of the activity that is being reshared." + }, + "objectType": { + "type": "string", + "description": "The type of the object. Possible values include, but are not limited to, the following values: \n- \"note\" - Textual content. \n- \"activity\" - A Google+ activity." + }, + "originalContent": { + "type": "string", + "description": "The content (text) as provided by the author, which is stored without any HTML formatting. When creating or updating an activity, this value must be supplied as plain text in the request." + }, + "plusoners": { + "type": "object", + "description": "People who +1'd this activity.", + "properties": { + "selfLink": { + "type": "string", + "description": "The URL for the collection of people who +1'd this activity." + }, + "totalItems": { + "type": "integer", + "description": "Total number of people who +1'd this activity.", + "format": "uint32" + } + } + }, + "replies": { + "type": "object", + "description": "Comments in reply to this activity.", + "properties": { + "selfLink": { + "type": "string", + "description": "The URL for the collection of comments in reply to this activity." + }, + "totalItems": { + "type": "integer", + "description": "Total number of comments on this activity.", + "format": "uint32" + } + } + }, + "resharers": { + "type": "object", + "description": "People who reshared this activity.", + "properties": { + "selfLink": { + "type": "string", + "description": "The URL for the collection of resharers." + }, + "totalItems": { + "type": "integer", + "description": "Total number of people who reshared this activity.", + "format": "uint32" + } + } + }, + "url": { + "type": "string", + "description": "The URL that points to the linked resource." + } + } + }, + "placeId": { + "type": "string", + "description": "ID of the place where this activity occurred." + }, + "placeName": { + "type": "string", + "description": "Name of the place where this activity occurred." + }, + "provider": { + "type": "object", + "description": "The service provider that initially published this activity.", + "properties": { + "title": { + "type": "string", + "description": "Name of the service provider." + } + } + }, + "published": { + "type": "string", + "description": "The time at which this activity was initially published. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "radius": { + "type": "string", + "description": "Radius, in meters, of the region where this activity occurred, centered at the latitude and longitude identified in geocode." + }, + "title": { + "type": "string", + "description": "Title of this activity." + }, + "updated": { + "type": "string", + "description": "The time at which this activity was last updated. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "url": { + "type": "string", + "description": "The link to this activity." + }, + "verb": { + "type": "string", + "description": "This activity's verb, which indicates the action that was performed. Possible values include, but are not limited to, the following values: \n- \"post\" - Publish content to the stream. \n- \"share\" - Reshare an activity." + } + } + }, + "ActivityFeed": { + "id": "ActivityFeed", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID of this collection of activities. Deprecated." + }, + "items": { + "type": "array", + "description": "The activities in this page of results.", + "items": { + "$ref": "Activity" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of activities. Value: \"plus#activityFeed\".", + "default": "plus#activityFeed" + }, + "nextLink": { + "type": "string", + "description": "Link to the next page of activities." + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "selfLink": { + "type": "string", + "description": "Link to this activity resource." + }, + "title": { + "type": "string", + "description": "The title of this collection of activities, which is a truncated portion of the content." + }, + "updated": { + "type": "string", + "description": "The time at which this collection of activities was last updated. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + } + } + }, + "Comment": { + "id": "Comment", + "type": "object", + "properties": { + "actor": { + "type": "object", + "description": "The person who posted this comment.", + "properties": { + "displayName": { + "type": "string", + "description": "The name of this actor, suitable for display." + }, + "id": { + "type": "string", + "description": "The ID of the actor." + }, + "image": { + "type": "object", + "description": "The image representation of this actor.", + "properties": { + "url": { + "type": "string", + "description": "The URL of the actor's profile photo. To resize the image and crop it to a square, append the query string ?sz=x, where x is the dimension in pixels of each side." + } + } + }, + "url": { + "type": "string", + "description": "A link to the Person resource for this actor." + } + } + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID of this comment." + }, + "inReplyTo": { + "type": "array", + "description": "The activity this comment replied to.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the activity." + }, + "url": { + "type": "string", + "description": "The URL of the activity." + } + } + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a comment. Value: \"plus#comment\".", + "default": "plus#comment" + }, + "object": { + "type": "object", + "description": "The object of this comment.", + "properties": { + "content": { + "type": "string", + "description": "The HTML-formatted content, suitable for display." + }, + "objectType": { + "type": "string", + "description": "The object type of this comment. Possible values are: \n- \"comment\" - A comment in reply to an activity.", + "default": "comment" + }, + "originalContent": { + "type": "string", + "description": "The content (text) as provided by the author, stored without any HTML formatting. When creating or updating a comment, this value must be supplied as plain text in the request." + } + } + }, + "plusoners": { + "type": "object", + "description": "People who +1'd this comment.", + "properties": { + "totalItems": { + "type": "integer", + "description": "Total number of people who +1'd this comment.", + "format": "uint32" + } + } + }, + "published": { + "type": "string", + "description": "The time at which this comment was initially published. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "selfLink": { + "type": "string", + "description": "Link to this comment resource." + }, + "updated": { + "type": "string", + "description": "The time at which this comment was last updated. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "verb": { + "type": "string", + "description": "This comment's verb, indicating what action was performed. Possible values are: \n- \"post\" - Publish content to the stream.", + "default": "post" + } + } + }, + "CommentFeed": { + "id": "CommentFeed", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID of this collection of comments." + }, + "items": { + "type": "array", + "description": "The comments in this page of results.", + "items": { + "$ref": "Comment" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of comments. Value: \"plus#commentFeed\".", + "default": "plus#commentFeed" + }, + "nextLink": { + "type": "string", + "description": "Link to the next page of activities." + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "title": { + "type": "string", + "description": "The title of this collection of comments." + }, + "updated": { + "type": "string", + "description": "The time at which this collection of comments was last updated. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + } + } + }, + "ItemScope": { + "id": "ItemScope", + "type": "object", + "properties": { + "about": { + "$ref": "ItemScope", + "description": "The subject matter of the content." + }, + "additionalName": { + "type": "array", + "description": "An additional name for a Person, can be used for a middle name.", + "items": { + "type": "string" + } + }, + "address": { + "$ref": "ItemScope", + "description": "Postal address." + }, + "addressCountry": { + "type": "string", + "description": "Address country." + }, + "addressLocality": { + "type": "string", + "description": "Address locality." + }, + "addressRegion": { + "type": "string", + "description": "Address region." + }, + "associated_media": { + "type": "array", + "description": "The encoding.", + "items": { + "$ref": "ItemScope" + } + }, + "attendeeCount": { + "type": "integer", + "description": "Number of attendees.", + "format": "int32" + }, + "attendees": { + "type": "array", + "description": "A person attending the event.", + "items": { + "$ref": "ItemScope" + } + }, + "audio": { + "$ref": "ItemScope", + "description": "From http://schema.org/MusicRecording, the audio file." + }, + "author": { + "type": "array", + "description": "The person or persons who created this result. In the example of restaurant reviews, this might be the reviewer's name.", + "items": { + "$ref": "ItemScope" + } + }, + "bestRating": { + "type": "string", + "description": "Best possible rating value that a result might obtain. This property defines the upper bound for the ratingValue. For example, you might have a 5 star rating scale, you would provide 5 as the value for this property." + }, + "birthDate": { + "type": "string", + "description": "Date of birth." + }, + "byArtist": { + "$ref": "ItemScope", + "description": "From http://schema.org/MusicRecording, the artist that performed this recording." + }, + "caption": { + "type": "string", + "description": "The caption for this object." + }, + "contentSize": { + "type": "string", + "description": "File size in (mega/kilo) bytes." + }, + "contentUrl": { + "type": "string", + "description": "Actual bytes of the media object, for example the image file or video file." + }, + "contributor": { + "type": "array", + "description": "A list of contributors to this result.", + "items": { + "$ref": "ItemScope" + } + }, + "dateCreated": { + "type": "string", + "description": "The date the result was created such as the date that a review was first created." + }, + "dateModified": { + "type": "string", + "description": "The date the result was last modified such as the date that a review was last edited." + }, + "datePublished": { + "type": "string", + "description": "The initial date that the result was published. For example, a user writes a comment on a blog, which has a result.dateCreated of when they submit it. If the blog users comment moderation, the result.datePublished value would match the date when the owner approved the message." + }, + "description": { + "type": "string", + "description": "The string that describes the content of the result." + }, + "duration": { + "type": "string", + "description": "The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format." + }, + "embedUrl": { + "type": "string", + "description": "A URL pointing to a player for a specific video. In general, this is the information in the src element of an embed tag and should not be the same as the content of the loc tag." + }, + "endDate": { + "type": "string", + "description": "The end date and time of the event (in ISO 8601 date format)." + }, + "familyName": { + "type": "string", + "description": "Family name. This property can be used with givenName instead of the name property." + }, + "gender": { + "type": "string", + "description": "Gender of the person." + }, + "geo": { + "$ref": "ItemScope", + "description": "Geo coordinates." + }, + "givenName": { + "type": "string", + "description": "Given name. This property can be used with familyName instead of the name property." + }, + "height": { + "type": "string", + "description": "The height of the media object." + }, + "id": { + "type": "string", + "description": "An identifier for the target. Your app can choose how to identify targets. The target.id is required if you are writing an activity that does not have a corresponding web page or target.url property." + }, + "image": { + "type": "string", + "description": "A URL to the image that represents this result. For example, if a user writes a review of a restaurant and attaches a photo of their meal, you might use that photo as the result.image." + }, + "inAlbum": { + "$ref": "ItemScope", + "description": "From http://schema.org/MusicRecording, which album a song is in." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as an itemScope.", + "default": "plus#itemScope" + }, + "latitude": { + "type": "number", + "description": "Latitude.", + "format": "double" + }, + "location": { + "$ref": "ItemScope", + "description": "The location of the event or organization." + }, + "longitude": { + "type": "number", + "description": "Longitude.", + "format": "double" + }, + "name": { + "type": "string", + "description": "The name of the result. In the example of a restaurant review, this might be the summary the user gave their review such as \"Great ambiance, but overpriced.\"" + }, + "partOfTVSeries": { + "$ref": "ItemScope", + "description": "Property of http://schema.org/TVEpisode indicating which series the episode belongs to." + }, + "performers": { + "type": "array", + "description": "The main performer or performers of the event-for example, a presenter, musician, or actor.", + "items": { + "$ref": "ItemScope" + } + }, + "playerType": { + "type": "string", + "description": "Player type that is required. For example: Flash or Silverlight." + }, + "postOfficeBoxNumber": { + "type": "string", + "description": "Post office box number." + }, + "postalCode": { + "type": "string", + "description": "Postal code." + }, + "ratingValue": { + "type": "string", + "description": "Rating value." + }, + "reviewRating": { + "$ref": "ItemScope", + "description": "Review rating." + }, + "startDate": { + "type": "string", + "description": "The start date and time of the event (in ISO 8601 date format)." + }, + "streetAddress": { + "type": "string", + "description": "Street address." + }, + "text": { + "type": "string", + "description": "The text that is the result of the app activity. For example, if a user leaves a review of a restaurant, this might be the text of the review." + }, + "thumbnail": { + "$ref": "ItemScope", + "description": "Thumbnail image for an image or video." + }, + "thumbnailUrl": { + "type": "string", + "description": "A URL to a thumbnail image that represents this result." + }, + "tickerSymbol": { + "type": "string", + "description": "The exchange traded instrument associated with a Corporation object. The tickerSymbol is expressed as an exchange and an instrument name separated by a space character. For the exchange component of the tickerSymbol attribute, we recommend using the controlled vocabulary of Market Identifier Codes (MIC) specified in ISO15022." + }, + "type": { + "type": "string", + "description": "The schema.org URL that best describes the referenced target and matches the type of moment." + }, + "url": { + "type": "string", + "description": "The URL that points to the result object. For example, a permalink directly to a restaurant reviewer's comment." + }, + "width": { + "type": "string", + "description": "The width of the media object." + }, + "worstRating": { + "type": "string", + "description": "Worst possible rating value that a result might obtain. This property defines the lower bound for the ratingValue." + } + } + }, + "Moment": { + "id": "Moment", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The moment ID." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a moment.", + "default": "plus#moment" + }, + "result": { + "$ref": "ItemScope", + "description": "The object generated by performing the action on the target. For example, a user writes a review of a restaurant, the target is the restaurant and the result is the review." + }, + "startDate": { + "type": "string", + "description": "Time stamp of when the action occurred in RFC3339 format.", + "format": "date-time" + }, + "target": { + "$ref": "ItemScope", + "description": "The object on which the action was performed.", + "annotations": { + "required": [ + "plus.moments.insert" + ] + } + }, + "type": { + "type": "string", + "description": "The Google schema for the type of moment to write. For example, http://schemas.google.com/AddActivity.", + "annotations": { + "required": [ + "plus.moments.insert" + ] + } + } + } + }, + "MomentsFeed": { + "id": "MomentsFeed", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The moments in this page of results.", + "items": { + "$ref": "Moment" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of moments. Value: \"plus#momentsFeed\".", + "default": "plus#momentsFeed" + }, + "nextLink": { + "type": "string", + "description": "Link to the next page of moments." + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "selfLink": { + "type": "string", + "description": "Link to this page of moments." + }, + "title": { + "type": "string", + "description": "The title of this collection of moments." + }, + "updated": { + "type": "string", + "description": "The RFC 339 timestamp for when this collection of moments was last updated.", + "format": "date-time" + } + } + }, + "PeopleFeed": { + "id": "PeopleFeed", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The people in this page of results. Each item includes the id, displayName, image, and url for the person. To retrieve additional profile data, see the people.get method.", + "items": { + "$ref": "Person" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of people. Value: \"plus#peopleFeed\".", + "default": "plus#peopleFeed" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "selfLink": { + "type": "string", + "description": "Link to this resource." + }, + "title": { + "type": "string", + "description": "The title of this collection of people." + }, + "totalItems": { + "type": "integer", + "description": "The total number of people available in this list. The number of people in a response might be smaller due to paging. This might not be set for all collections.", + "format": "int32" + } + } + }, + "Person": { + "id": "Person", + "type": "object", + "properties": { + "aboutMe": { + "type": "string", + "description": "A short biography for this person." + }, + "ageRange": { + "type": "object", + "description": "The age range of the person. Valid ranges are 17 or younger, 18 to 20, and 21 or older. Age is determined from the user's birthday using Western age reckoning.", + "properties": { + "max": { + "type": "integer", + "description": "The age range's upper bound, if any. Possible values include, but are not limited to, the following: \n- \"17\" - for age 17 \n- \"20\" - for age 20", + "format": "int32" + }, + "min": { + "type": "integer", + "description": "The age range's lower bound, if any. Possible values include, but are not limited to, the following: \n- \"21\" - for age 21 \n- \"18\" - for age 18", + "format": "int32" + } + } + }, + "birthday": { + "type": "string", + "description": "The person's date of birth, represented as YYYY-MM-DD." + }, + "braggingRights": { + "type": "string", + "description": "The \"bragging rights\" line of this person." + }, + "circledByCount": { + "type": "integer", + "description": "For followers who are visible, the number of people who have added this person or page to a circle.", + "format": "int32" + }, + "cover": { + "type": "object", + "description": "The cover photo content.", + "properties": { + "coverInfo": { + "type": "object", + "description": "Extra information about the cover photo.", + "properties": { + "leftImageOffset": { + "type": "integer", + "description": "The difference between the left position of the cover image and the actual displayed cover image. Only valid for banner layout.", + "format": "int32" + }, + "topImageOffset": { + "type": "integer", + "description": "The difference between the top position of the cover image and the actual displayed cover image. Only valid for banner layout.", + "format": "int32" + } + } + }, + "coverPhoto": { + "type": "object", + "description": "The person's primary cover image.", + "properties": { + "height": { + "type": "integer", + "description": "The height of the image.", + "format": "int32" + }, + "url": { + "type": "string", + "description": "The URL of the image." + }, + "width": { + "type": "integer", + "description": "The width of the image.", + "format": "int32" + } + } + }, + "layout": { + "type": "string", + "description": "The layout of the cover art. Possible values include, but are not limited to, the following values: \n- \"banner\" - One large image banner." + } + } + }, + "currentLocation": { + "type": "string", + "description": "The current location for this person." + }, + "displayName": { + "type": "string", + "description": "The name of this person, which is suitable for display." + }, + "domain": { + "type": "string", + "description": "The hosted domain name for the user's Google Apps account. For instance, example.com. The plus.profile.emails.read or email scope is needed to get this domain name." + }, + "emails": { + "type": "array", + "description": "A list of email addresses that this person has, including their Google account email address, and the public verified email addresses on their Google+ profile. The plus.profile.emails.read scope is needed to retrieve these email addresses, or the email scope can be used to retrieve just the Google account email address.", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The type of address. Possible values include, but are not limited to, the following values: \n- \"account\" - Google account email address. \n- \"home\" - Home email address. \n- \"work\" - Work email address. \n- \"other\" - Other." + }, + "value": { + "type": "string", + "description": "The email address." + } + } + } + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "gender": { + "type": "string", + "description": "The person's gender. Possible values include, but are not limited to, the following values: \n- \"male\" - Male gender. \n- \"female\" - Female gender. \n- \"other\" - Other." + }, + "id": { + "type": "string", + "description": "The ID of this person." + }, + "image": { + "type": "object", + "description": "The representation of the person's profile photo.", + "properties": { + "url": { + "type": "string", + "description": "The URL of the person's profile photo. To resize the image and crop it to a square, append the query string ?sz=x, where x is the dimension in pixels of each side." + } + } + }, + "isPlusUser": { + "type": "boolean", + "description": "Whether this user has signed up for Google+." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a person. Value: \"plus#person\".", + "default": "plus#person" + }, + "language": { + "type": "string", + "description": "The user's preferred language for rendering." + }, + "name": { + "type": "object", + "description": "An object representation of the individual components of a person's name.", + "properties": { + "familyName": { + "type": "string", + "description": "The family name (last name) of this person." + }, + "formatted": { + "type": "string", + "description": "The full name of this person, including middle names, suffixes, etc." + }, + "givenName": { + "type": "string", + "description": "The given name (first name) of this person." + }, + "honorificPrefix": { + "type": "string", + "description": "The honorific prefixes (such as \"Dr.\" or \"Mrs.\") for this person." + }, + "honorificSuffix": { + "type": "string", + "description": "The honorific suffixes (such as \"Jr.\") for this person." + }, + "middleName": { + "type": "string", + "description": "The middle name of this person." + } + } + }, + "nickname": { + "type": "string", + "description": "The nickname of this person." + }, + "objectType": { + "type": "string", + "description": "Type of person within Google+. Possible values include, but are not limited to, the following values: \n- \"person\" - represents an actual person. \n- \"page\" - represents a page." + }, + "occupation": { + "type": "string", + "description": "The occupation of this person." + }, + "organizations": { + "type": "array", + "description": "A list of current or past organizations with which this person is associated.", + "items": { + "type": "object", + "properties": { + "department": { + "type": "string", + "description": "The department within the organization. Deprecated." + }, + "description": { + "type": "string", + "description": "A short description of the person's role in this organization. Deprecated." + }, + "endDate": { + "type": "string", + "description": "The date that the person left this organization." + }, + "location": { + "type": "string", + "description": "The location of this organization. Deprecated." + }, + "name": { + "type": "string", + "description": "The name of the organization." + }, + "primary": { + "type": "boolean", + "description": "If \"true\", indicates this organization is the person's primary one, which is typically interpreted as the current one." + }, + "startDate": { + "type": "string", + "description": "The date that the person joined this organization." + }, + "title": { + "type": "string", + "description": "The person's job title or role within the organization." + }, + "type": { + "type": "string", + "description": "The type of organization. Possible values include, but are not limited to, the following values: \n- \"work\" - Work. \n- \"school\" - School." + } + } + } + }, + "placesLived": { + "type": "array", + "description": "A list of places where this person has lived.", + "items": { + "type": "object", + "properties": { + "primary": { + "type": "boolean", + "description": "If \"true\", this place of residence is this person's primary residence." + }, + "value": { + "type": "string", + "description": "A place where this person has lived. For example: \"Seattle, WA\", \"Near Toronto\"." + } + } + } + }, + "plusOneCount": { + "type": "integer", + "description": "If a Google+ Page, the number of people who have +1'd this page.", + "format": "int32" + }, + "relationshipStatus": { + "type": "string", + "description": "The person's relationship status. Possible values include, but are not limited to, the following values: \n- \"single\" - Person is single. \n- \"in_a_relationship\" - Person is in a relationship. \n- \"engaged\" - Person is engaged. \n- \"married\" - Person is married. \n- \"its_complicated\" - The relationship is complicated. \n- \"open_relationship\" - Person is in an open relationship. \n- \"widowed\" - Person is widowed. \n- \"in_domestic_partnership\" - Person is in a domestic partnership. \n- \"in_civil_union\" - Person is in a civil union." + }, + "skills": { + "type": "string", + "description": "The person's skills." + }, + "tagline": { + "type": "string", + "description": "The brief description (tagline) of this person." + }, + "url": { + "type": "string", + "description": "The URL of this person's profile." + }, + "urls": { + "type": "array", + "description": "A list of URLs for this person.", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "The label of the URL." + }, + "type": { + "type": "string", + "description": "The type of URL. Possible values include, but are not limited to, the following values: \n- \"otherProfile\" - URL for another profile. \n- \"contributor\" - URL to a site for which this person is a contributor. \n- \"website\" - URL for this Google+ Page's primary website. \n- \"other\" - Other URL." + }, + "value": { + "type": "string", + "description": "The URL value." + } + } + } + }, + "verified": { + "type": "boolean", + "description": "Whether the person or Google+ Page has been verified." + } + } + }, + "Place": { + "id": "Place", + "type": "object", + "properties": { + "address": { + "type": "object", + "description": "The physical address of the place.", + "properties": { + "formatted": { + "type": "string", + "description": "The formatted address for display." + } + } + }, + "displayName": { + "type": "string", + "description": "The display name of the place." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a place. Value: \"plus#place\".", + "default": "plus#place" + }, + "position": { + "type": "object", + "description": "The position of the place.", + "properties": { + "latitude": { + "type": "number", + "description": "The latitude of this position.", + "format": "double" + }, + "longitude": { + "type": "number", + "description": "The longitude of this position.", + "format": "double" + } + } + } + } + }, + "PlusAclentryResource": { + "id": "PlusAclentryResource", + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "A descriptive name for this entry. Suitable for display." + }, + "id": { + "type": "string", + "description": "The ID of the entry. For entries of type \"person\" or \"circle\", this is the ID of the resource. For other types, this property is not set." + }, + "type": { + "type": "string", + "description": "The type of entry describing to whom access is granted. Possible values are: \n- \"person\" - Access to an individual. \n- \"circle\" - Access to members of a circle. \n- \"myCircles\" - Access to members of all the person's circles. \n- \"extendedCircles\" - Access to members of all the person's circles, plus all of the people in their circles. \n- \"domain\" - Access to members of the person's Google Apps domain. \n- \"public\" - Access to anyone on the web." + } + } + } + }, + "resources": { + "activities": { + "methods": { + "get": { + "id": "plus.activities.get", + "path": "activities/{activityId}", + "httpMethod": "GET", + "description": "Get an activity.", + "parameters": { + "activityId": { + "type": "string", + "description": "The ID of the activity to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "activityId" + ], + "response": { + "$ref": "Activity" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me" + ] + }, + "list": { + "id": "plus.activities.list", + "path": "people/{userId}/activities/{collection}", + "httpMethod": "GET", + "description": "List all of the activities in the specified collection for a particular user.", + "parameters": { + "collection": { + "type": "string", + "description": "The collection of activities to list.", + "required": true, + "enum": [ + "public" + ], + "enumDescriptions": [ + "All public activities created by the specified user." + ], + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user to get activities for. The special value \"me\" can be used to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "collection" + ], + "response": { + "$ref": "ActivityFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me" + ] + }, + "search": { + "id": "plus.activities.search", + "path": "activities", + "httpMethod": "GET", + "description": "Search public activities.", + "parameters": { + "language": { + "type": "string", + "description": "Specify the preferred language to search with. See search language codes for available values.", + "default": "en-US", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "10", + "format": "uint32", + "minimum": "1", + "maximum": "20", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Specifies how to order search results.", + "default": "recent", + "enum": [ + "best", + "recent" + ], + "enumDescriptions": [ + "Sort activities by relevance to the user, most relevant first.", + "Sort activities by published date, most recent first." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response. This token can be of any length.", + "location": "query" + }, + "query": { + "type": "string", + "description": "Full-text search query string.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "query" + ], + "response": { + "$ref": "ActivityFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me" + ] + } + } + }, + "comments": { + "methods": { + "get": { + "id": "plus.comments.get", + "path": "comments/{commentId}", + "httpMethod": "GET", + "description": "Get a comment.", + "parameters": { + "commentId": { + "type": "string", + "description": "The ID of the comment to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "commentId" + ], + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me" + ] + }, + "list": { + "id": "plus.comments.list", + "path": "activities/{activityId}/comments", + "httpMethod": "GET", + "description": "List all of the comments for an activity.", + "parameters": { + "activityId": { + "type": "string", + "description": "The ID of the activity to get comments for.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of comments to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "The order in which to sort the list of comments.", + "default": "ascending", + "enum": [ + "ascending", + "descending" + ], + "enumDescriptions": [ + "Sort oldest comments first.", + "Sort newest comments first." + ], + "location": "query" + } + }, + "parameterOrder": [ + "activityId" + ], + "response": { + "$ref": "CommentFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me" + ] + } + } + }, + "moments": { + "methods": { + "insert": { + "id": "plus.moments.insert", + "path": "people/{userId}/moments/{collection}", + "httpMethod": "POST", + "description": "Record a moment representing a user's activity such as making a purchase or commenting on a blog.", + "parameters": { + "collection": { + "type": "string", + "description": "The collection to which to write moments.", + "required": true, + "enum": [ + "vault" + ], + "enumDescriptions": [ + "The default collection for writing new moments." + ], + "location": "path" + }, + "debug": { + "type": "boolean", + "description": "Return the moment as written. Should be used only for debugging.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user to record activities for. The only valid values are \"me\" and the ID of the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "collection" + ], + "request": { + "$ref": "Moment" + }, + "response": { + "$ref": "Moment" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me" + ] + }, + "list": { + "id": "plus.moments.list", + "path": "people/{userId}/moments/{collection}", + "httpMethod": "GET", + "description": "List all of the moments for a particular user.", + "parameters": { + "collection": { + "type": "string", + "description": "The collection of moments to list.", + "required": true, + "enum": [ + "vault" + ], + "enumDescriptions": [ + "All moments created by the requesting application for the authenticated user." + ], + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of moments to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + }, + "targetUrl": { + "type": "string", + "description": "Only moments containing this targetUrl will be returned.", + "location": "query" + }, + "type": { + "type": "string", + "description": "Only moments of this type will be returned.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user to get moments for. The special value \"me\" can be used to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "collection" + ], + "response": { + "$ref": "MomentsFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me" + ] + }, + "remove": { + "id": "plus.moments.remove", + "path": "moments/{id}", + "httpMethod": "DELETE", + "description": "Delete a moment.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the moment to delete.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/plus.login" + ] + } + } + }, + "people": { + "methods": { + "get": { + "id": "plus.people.get", + "path": "people/{userId}", + "httpMethod": "GET", + "description": "Get a person's profile. If your app uses scope https://www.googleapis.com/auth/plus.login, this method is guaranteed to return ageRange and language.", + "parameters": { + "userId": { + "type": "string", + "description": "The ID of the person to get the profile for. The special value \"me\" can be used to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "Person" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me", + "https://www.googleapis.com/auth/userinfo.email", + "https://www.googleapis.com/auth/userinfo.profile" + ] + }, + "list": { + "id": "plus.people.list", + "path": "people/{userId}/people/{collection}", + "httpMethod": "GET", + "description": "List all of the people in the specified collection.", + "parameters": { + "collection": { + "type": "string", + "description": "The collection of people to list.", + "required": true, + "enum": [ + "connected", + "visible" + ], + "enumDescriptions": [ + "The list of visible people in the authenticated user's circles who also use the requesting app. This list is limited to users who made their app activities visible to the authenticated user.", + "The list of people who this user has added to one or more circles, limited to the circles visible to the requesting application." + ], + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "100", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "The order to return people in.", + "enum": [ + "alphabetical", + "best" + ], + "enumDescriptions": [ + "Order the people by their display name.", + "Order people based on the relevence to the viewer." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "Get the collection of people for the person identified. Use \"me\" to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "collection" + ], + "response": { + "$ref": "PeopleFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me" + ] + }, + "listByActivity": { + "id": "plus.people.listByActivity", + "path": "activities/{activityId}/people/{collection}", + "httpMethod": "GET", + "description": "List all of the people in the specified collection for a particular activity.", + "parameters": { + "activityId": { + "type": "string", + "description": "The ID of the activity to get the list of people for.", + "required": true, + "location": "path" + }, + "collection": { + "type": "string", + "description": "The collection of people to list.", + "required": true, + "enum": [ + "plusoners", + "resharers" + ], + "enumDescriptions": [ + "List all people who have +1'd this activity.", + "List all people who have reshared this activity." + ], + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "activityId", + "collection" + ], + "response": { + "$ref": "PeopleFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me" + ] + }, + "search": { + "id": "plus.people.search", + "path": "people", + "httpMethod": "GET", + "description": "Search all public profiles.", + "parameters": { + "language": { + "type": "string", + "description": "Specify the preferred language to search with. See search language codes for available values.", + "default": "en-US", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "25", + "format": "uint32", + "minimum": "1", + "maximum": "50", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response. This token can be of any length.", + "location": "query" + }, + "query": { + "type": "string", + "description": "Specify a query string for full text search of public text in all profiles.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "query" + ], + "response": { + "$ref": "PeopleFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/plus/v1/plus-gen.go b/third_party/src/code.google.com/p/google-api-go-client/plus/v1/plus-gen.go new file mode 100644 index 0000000000000..981982e06a33c --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/plus/v1/plus-gen.go @@ -0,0 +1,2507 @@ +// Package plus provides access to the Google+ API. +// +// See https://developers.google.com/+/api/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/plus/v1" +// ... +// plusService, err := plus.New(oauthHttpClient) +package plus + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "plus:v1" +const apiName = "plus" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/plus/v1/" + +// OAuth2 scopes used by this API. +const ( + // Know your basic profile info and list of people in your circles. + PlusLoginScope = "https://www.googleapis.com/auth/plus.login" + + // Know who you are on Google + PlusMeScope = "https://www.googleapis.com/auth/plus.me" + + // View your email address + UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email" + + // View basic information about your account + UserinfoProfileScope = "https://www.googleapis.com/auth/userinfo.profile" +) + +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) + s.Comments = NewCommentsService(s) + s.Moments = NewMomentsService(s) + s.People = NewPeopleService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Activities *ActivitiesService + + Comments *CommentsService + + Moments *MomentsService + + People *PeopleService +} + +func NewActivitiesService(s *Service) *ActivitiesService { + rs := &ActivitiesService{s: s} + return rs +} + +type ActivitiesService struct { + s *Service +} + +func NewCommentsService(s *Service) *CommentsService { + rs := &CommentsService{s: s} + return rs +} + +type CommentsService struct { + s *Service +} + +func NewMomentsService(s *Service) *MomentsService { + rs := &MomentsService{s: s} + return rs +} + +type MomentsService struct { + s *Service +} + +func NewPeopleService(s *Service) *PeopleService { + rs := &PeopleService{s: s} + return rs +} + +type PeopleService struct { + s *Service +} + +type Acl struct { + // Description: Description of the access granted, suitable for display. + Description string `json:"description,omitempty"` + + // Items: The list of access entries. + Items []*PlusAclentryResource `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of access controls. + // Value: "plus#acl". + Kind string `json:"kind,omitempty"` +} + +type Activity struct { + // Access: Identifies who has access to see this activity. + Access *Acl `json:"access,omitempty"` + + // Actor: The person who performed this activity. + Actor *ActivityActor `json:"actor,omitempty"` + + // Address: Street address where this activity occurred. + Address string `json:"address,omitempty"` + + // Annotation: Additional content added by the person who shared this + // activity, applicable only when resharing an activity. + Annotation string `json:"annotation,omitempty"` + + // CrosspostSource: If this activity is a crosspost from another system, + // this property specifies the ID of the original activity. + CrosspostSource string `json:"crosspostSource,omitempty"` + + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Geocode: Latitude and longitude where this activity occurred. Format + // is latitude followed by longitude, space separated. + Geocode string `json:"geocode,omitempty"` + + // Id: The ID of this activity. + Id string `json:"id,omitempty"` + + // Kind: Identifies this resource as an activity. Value: + // "plus#activity". + Kind string `json:"kind,omitempty"` + + // Location: The location where this activity occurred. + Location *Place `json:"location,omitempty"` + + // Object: The object of this activity. + Object *ActivityObject `json:"object,omitempty"` + + // PlaceId: ID of the place where this activity occurred. + PlaceId string `json:"placeId,omitempty"` + + // PlaceName: Name of the place where this activity occurred. + PlaceName string `json:"placeName,omitempty"` + + // Provider: The service provider that initially published this + // activity. + Provider *ActivityProvider `json:"provider,omitempty"` + + // Published: The time at which this activity was initially published. + // Formatted as an RFC 3339 timestamp. + Published string `json:"published,omitempty"` + + // Radius: Radius, in meters, of the region where this activity + // occurred, centered at the latitude and longitude identified in + // geocode. + Radius string `json:"radius,omitempty"` + + // Title: Title of this activity. + Title string `json:"title,omitempty"` + + // Updated: The time at which this activity was last updated. Formatted + // as an RFC 3339 timestamp. + Updated string `json:"updated,omitempty"` + + // Url: The link to this activity. + Url string `json:"url,omitempty"` + + // Verb: This activity's verb, which indicates the action that was + // performed. Possible values include, but are not limited to, the + // following values: + // - "post" - Publish content to the stream. + // - + // "share" - Reshare an activity. + Verb string `json:"verb,omitempty"` +} + +type ActivityActor struct { + // DisplayName: The name of the actor, suitable for display. + DisplayName string `json:"displayName,omitempty"` + + // Id: The ID of the actor's Person resource. + Id string `json:"id,omitempty"` + + // Image: The image representation of the actor. + Image *ActivityActorImage `json:"image,omitempty"` + + // Name: An object representation of the individual components of name. + Name *ActivityActorName `json:"name,omitempty"` + + // Url: The link to the actor's Google profile. + Url string `json:"url,omitempty"` +} + +type ActivityActorImage struct { + // Url: The URL of the actor's profile photo. To resize the image and + // crop it to a square, append the query string ?sz=x, where x is the + // dimension in pixels of each side. + Url string `json:"url,omitempty"` +} + +type ActivityActorName struct { + // FamilyName: The family name ("last name") of the actor. + FamilyName string `json:"familyName,omitempty"` + + // GivenName: The given name ("first name") of the actor. + GivenName string `json:"givenName,omitempty"` +} + +type ActivityObject struct { + // Actor: If this activity's object is itself another activity, such as + // when a person reshares an activity, this property specifies the + // original activity's actor. + Actor *ActivityObjectActor `json:"actor,omitempty"` + + // Attachments: The media objects attached to this activity. + Attachments []*ActivityObjectAttachments `json:"attachments,omitempty"` + + // Content: The HTML-formatted content, which is suitable for display. + Content string `json:"content,omitempty"` + + // Id: The ID of the object. When resharing an activity, this is the ID + // of the activity that is being reshared. + Id string `json:"id,omitempty"` + + // ObjectType: The type of the object. Possible values include, but are + // not limited to, the following values: + // - "note" - Textual content. + // + // - "activity" - A Google+ activity. + ObjectType string `json:"objectType,omitempty"` + + // OriginalContent: The content (text) as provided by the author, which + // is stored without any HTML formatting. When creating or updating an + // activity, this value must be supplied as plain text in the request. + OriginalContent string `json:"originalContent,omitempty"` + + // Plusoners: People who +1'd this activity. + Plusoners *ActivityObjectPlusoners `json:"plusoners,omitempty"` + + // Replies: Comments in reply to this activity. + Replies *ActivityObjectReplies `json:"replies,omitempty"` + + // Resharers: People who reshared this activity. + Resharers *ActivityObjectResharers `json:"resharers,omitempty"` + + // Url: The URL that points to the linked resource. + Url string `json:"url,omitempty"` +} + +type ActivityObjectActor struct { + // DisplayName: The original actor's name, which is suitable for + // display. + DisplayName string `json:"displayName,omitempty"` + + // Id: ID of the original actor. + Id string `json:"id,omitempty"` + + // Image: The image representation of the original actor. + Image *ActivityObjectActorImage `json:"image,omitempty"` + + // Url: A link to the original actor's Google profile. + Url string `json:"url,omitempty"` +} + +type ActivityObjectActorImage struct { + // Url: A URL that points to a thumbnail photo of the original actor. + Url string `json:"url,omitempty"` +} + +type ActivityObjectAttachments struct { + // Content: If the attachment is an article, this property contains a + // snippet of text from the article. It can also include descriptions + // for other types. + Content string `json:"content,omitempty"` + + // DisplayName: The title of the attachment, such as a photo caption or + // an article title. + DisplayName string `json:"displayName,omitempty"` + + // Embed: If the attachment is a video, the embeddable link. + Embed *ActivityObjectAttachmentsEmbed `json:"embed,omitempty"` + + // FullImage: The full image URL for photo attachments. + FullImage *ActivityObjectAttachmentsFullImage `json:"fullImage,omitempty"` + + // Id: The ID of the attachment. + Id string `json:"id,omitempty"` + + // Image: The preview image for photos or videos. + Image *ActivityObjectAttachmentsImage `json:"image,omitempty"` + + // ObjectType: The type of media object. Possible values include, but + // are not limited to, the following values: + // - "photo" - A photo. + // - + // "album" - A photo album. + // - "video" - A video. + // - "article" - An + // article, specified by a link. + ObjectType string `json:"objectType,omitempty"` + + // Thumbnails: If the attachment is an album, this property is a list of + // potential additional thumbnails from the album. + Thumbnails []*ActivityObjectAttachmentsThumbnails `json:"thumbnails,omitempty"` + + // Url: The link to the attachment, which should be of type text/html. + Url string `json:"url,omitempty"` +} + +type ActivityObjectAttachmentsEmbed struct { + // Type: Media type of the link. + Type string `json:"type,omitempty"` + + // Url: URL of the link. + Url string `json:"url,omitempty"` +} + +type ActivityObjectAttachmentsFullImage struct { + // Height: The height, in pixels, of the linked resource. + Height int64 `json:"height,omitempty"` + + // Type: Media type of the link. + Type string `json:"type,omitempty"` + + // Url: URL of the image. + Url string `json:"url,omitempty"` + + // Width: The width, in pixels, of the linked resource. + Width int64 `json:"width,omitempty"` +} + +type ActivityObjectAttachmentsImage struct { + // Height: The height, in pixels, of the linked resource. + Height int64 `json:"height,omitempty"` + + // Type: Media type of the link. + Type string `json:"type,omitempty"` + + // Url: Image URL. + Url string `json:"url,omitempty"` + + // Width: The width, in pixels, of the linked resource. + Width int64 `json:"width,omitempty"` +} + +type ActivityObjectAttachmentsThumbnails struct { + // Description: Potential name of the thumbnail. + Description string `json:"description,omitempty"` + + // Image: Image resource. + Image *ActivityObjectAttachmentsThumbnailsImage `json:"image,omitempty"` + + // Url: URL of the webpage containing the image. + Url string `json:"url,omitempty"` +} + +type ActivityObjectAttachmentsThumbnailsImage struct { + // Height: The height, in pixels, of the linked resource. + Height int64 `json:"height,omitempty"` + + // Type: Media type of the link. + Type string `json:"type,omitempty"` + + // Url: Image url. + Url string `json:"url,omitempty"` + + // Width: The width, in pixels, of the linked resource. + Width int64 `json:"width,omitempty"` +} + +type ActivityObjectPlusoners struct { + // SelfLink: The URL for the collection of people who +1'd this + // activity. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: Total number of people who +1'd this activity. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type ActivityObjectReplies struct { + // SelfLink: The URL for the collection of comments in reply to this + // activity. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: Total number of comments on this activity. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type ActivityObjectResharers struct { + // SelfLink: The URL for the collection of resharers. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: Total number of people who reshared this activity. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type ActivityProvider struct { + // Title: Name of the service provider. + Title string `json:"title,omitempty"` +} + +type ActivityFeed struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Id: The ID of this collection of activities. Deprecated. + Id string `json:"id,omitempty"` + + // Items: The activities in this page of results. + Items []*Activity `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of activities. Value: + // "plus#activityFeed". + Kind string `json:"kind,omitempty"` + + // NextLink: Link to the next page of activities. + NextLink string `json:"nextLink,omitempty"` + + // NextPageToken: The continuation token, which is used to page through + // large result sets. Provide this value in a subsequent request to + // return the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Link to this activity resource. + SelfLink string `json:"selfLink,omitempty"` + + // Title: The title of this collection of activities, which is a + // truncated portion of the content. + Title string `json:"title,omitempty"` + + // Updated: The time at which this collection of activities was last + // updated. Formatted as an RFC 3339 timestamp. + Updated string `json:"updated,omitempty"` +} + +type Comment struct { + // Actor: The person who posted this comment. + Actor *CommentActor `json:"actor,omitempty"` + + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Id: The ID of this comment. + Id string `json:"id,omitempty"` + + // InReplyTo: The activity this comment replied to. + InReplyTo []*CommentInReplyTo `json:"inReplyTo,omitempty"` + + // Kind: Identifies this resource as a comment. Value: "plus#comment". + Kind string `json:"kind,omitempty"` + + // Object: The object of this comment. + Object *CommentObject `json:"object,omitempty"` + + // Plusoners: People who +1'd this comment. + Plusoners *CommentPlusoners `json:"plusoners,omitempty"` + + // Published: The time at which this comment was initially published. + // Formatted as an RFC 3339 timestamp. + Published string `json:"published,omitempty"` + + // SelfLink: Link to this comment resource. + SelfLink string `json:"selfLink,omitempty"` + + // Updated: The time at which this comment was last updated. Formatted + // as an RFC 3339 timestamp. + Updated string `json:"updated,omitempty"` + + // Verb: This comment's verb, indicating what action was performed. + // Possible values are: + // - "post" - Publish content to the stream. + Verb string `json:"verb,omitempty"` +} + +type CommentActor struct { + // DisplayName: The name of this actor, suitable for display. + DisplayName string `json:"displayName,omitempty"` + + // Id: The ID of the actor. + Id string `json:"id,omitempty"` + + // Image: The image representation of this actor. + Image *CommentActorImage `json:"image,omitempty"` + + // Url: A link to the Person resource for this actor. + Url string `json:"url,omitempty"` +} + +type CommentActorImage struct { + // Url: The URL of the actor's profile photo. To resize the image and + // crop it to a square, append the query string ?sz=x, where x is the + // dimension in pixels of each side. + Url string `json:"url,omitempty"` +} + +type CommentInReplyTo struct { + // Id: The ID of the activity. + Id string `json:"id,omitempty"` + + // Url: The URL of the activity. + Url string `json:"url,omitempty"` +} + +type CommentObject struct { + // Content: The HTML-formatted content, suitable for display. + Content string `json:"content,omitempty"` + + // ObjectType: The object type of this comment. Possible values are: + // - + // "comment" - A comment in reply to an activity. + ObjectType string `json:"objectType,omitempty"` + + // OriginalContent: The content (text) as provided by the author, stored + // without any HTML formatting. When creating or updating a comment, + // this value must be supplied as plain text in the request. + OriginalContent string `json:"originalContent,omitempty"` +} + +type CommentPlusoners struct { + // TotalItems: Total number of people who +1'd this comment. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type CommentFeed struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Id: The ID of this collection of comments. + Id string `json:"id,omitempty"` + + // Items: The comments in this page of results. + Items []*Comment `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of comments. Value: + // "plus#commentFeed". + Kind string `json:"kind,omitempty"` + + // NextLink: Link to the next page of activities. + NextLink string `json:"nextLink,omitempty"` + + // NextPageToken: The continuation token, which is used to page through + // large result sets. Provide this value in a subsequent request to + // return the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Title: The title of this collection of comments. + Title string `json:"title,omitempty"` + + // Updated: The time at which this collection of comments was last + // updated. Formatted as an RFC 3339 timestamp. + Updated string `json:"updated,omitempty"` +} + +type ItemScope struct { + // About: The subject matter of the content. + About *ItemScope `json:"about,omitempty"` + + // AdditionalName: An additional name for a Person, can be used for a + // middle name. + AdditionalName []string `json:"additionalName,omitempty"` + + // Address: Postal address. + Address *ItemScope `json:"address,omitempty"` + + // AddressCountry: Address country. + AddressCountry string `json:"addressCountry,omitempty"` + + // AddressLocality: Address locality. + AddressLocality string `json:"addressLocality,omitempty"` + + // AddressRegion: Address region. + AddressRegion string `json:"addressRegion,omitempty"` + + // Associated_media: The encoding. + Associated_media []*ItemScope `json:"associated_media,omitempty"` + + // AttendeeCount: Number of attendees. + AttendeeCount int64 `json:"attendeeCount,omitempty"` + + // Attendees: A person attending the event. + Attendees []*ItemScope `json:"attendees,omitempty"` + + // Audio: From http://schema.org/MusicRecording, the audio file. + Audio *ItemScope `json:"audio,omitempty"` + + // Author: The person or persons who created this result. In the example + // of restaurant reviews, this might be the reviewer's name. + Author []*ItemScope `json:"author,omitempty"` + + // BestRating: Best possible rating value that a result might obtain. + // This property defines the upper bound for the ratingValue. For + // example, you might have a 5 star rating scale, you would provide 5 as + // the value for this property. + BestRating string `json:"bestRating,omitempty"` + + // BirthDate: Date of birth. + BirthDate string `json:"birthDate,omitempty"` + + // ByArtist: From http://schema.org/MusicRecording, the artist that + // performed this recording. + ByArtist *ItemScope `json:"byArtist,omitempty"` + + // Caption: The caption for this object. + Caption string `json:"caption,omitempty"` + + // ContentSize: File size in (mega/kilo) bytes. + ContentSize string `json:"contentSize,omitempty"` + + // ContentUrl: Actual bytes of the media object, for example the image + // file or video file. + ContentUrl string `json:"contentUrl,omitempty"` + + // Contributor: A list of contributors to this result. + Contributor []*ItemScope `json:"contributor,omitempty"` + + // DateCreated: The date the result was created such as the date that a + // review was first created. + DateCreated string `json:"dateCreated,omitempty"` + + // DateModified: The date the result was last modified such as the date + // that a review was last edited. + DateModified string `json:"dateModified,omitempty"` + + // DatePublished: The initial date that the result was published. For + // example, a user writes a comment on a blog, which has a + // result.dateCreated of when they submit it. If the blog users comment + // moderation, the result.datePublished value would match the date when + // the owner approved the message. + DatePublished string `json:"datePublished,omitempty"` + + // Description: The string that describes the content of the result. + Description string `json:"description,omitempty"` + + // Duration: The duration of the item (movie, audio recording, event, + // etc.) in ISO 8601 date format. + Duration string `json:"duration,omitempty"` + + // EmbedUrl: A URL pointing to a player for a specific video. In + // general, this is the information in the src element of an embed tag + // and should not be the same as the content of the loc tag. + EmbedUrl string `json:"embedUrl,omitempty"` + + // EndDate: The end date and time of the event (in ISO 8601 date + // format). + EndDate string `json:"endDate,omitempty"` + + // FamilyName: Family name. This property can be used with givenName + // instead of the name property. + FamilyName string `json:"familyName,omitempty"` + + // Gender: Gender of the person. + Gender string `json:"gender,omitempty"` + + // Geo: Geo coordinates. + Geo *ItemScope `json:"geo,omitempty"` + + // GivenName: Given name. This property can be used with familyName + // instead of the name property. + GivenName string `json:"givenName,omitempty"` + + // Height: The height of the media object. + Height string `json:"height,omitempty"` + + // Id: An identifier for the target. Your app can choose how to identify + // targets. The target.id is required if you are writing an activity + // that does not have a corresponding web page or target.url property. + Id string `json:"id,omitempty"` + + // Image: A URL to the image that represents this result. For example, + // if a user writes a review of a restaurant and attaches a photo of + // their meal, you might use that photo as the result.image. + Image string `json:"image,omitempty"` + + // InAlbum: From http://schema.org/MusicRecording, which album a song is + // in. + InAlbum *ItemScope `json:"inAlbum,omitempty"` + + // Kind: Identifies this resource as an itemScope. + Kind string `json:"kind,omitempty"` + + // Latitude: Latitude. + Latitude float64 `json:"latitude,omitempty"` + + // Location: The location of the event or organization. + Location *ItemScope `json:"location,omitempty"` + + // Longitude: Longitude. + Longitude float64 `json:"longitude,omitempty"` + + // Name: The name of the result. In the example of a restaurant review, + // this might be the summary the user gave their review such as "Great + // ambiance, but overpriced." + Name string `json:"name,omitempty"` + + // PartOfTVSeries: Property of http://schema.org/TVEpisode indicating + // which series the episode belongs to. + PartOfTVSeries *ItemScope `json:"partOfTVSeries,omitempty"` + + // Performers: The main performer or performers of the event-for + // example, a presenter, musician, or actor. + Performers []*ItemScope `json:"performers,omitempty"` + + // PlayerType: Player type that is required. For example: Flash or + // Silverlight. + PlayerType string `json:"playerType,omitempty"` + + // PostOfficeBoxNumber: Post office box number. + PostOfficeBoxNumber string `json:"postOfficeBoxNumber,omitempty"` + + // PostalCode: Postal code. + PostalCode string `json:"postalCode,omitempty"` + + // RatingValue: Rating value. + RatingValue string `json:"ratingValue,omitempty"` + + // ReviewRating: Review rating. + ReviewRating *ItemScope `json:"reviewRating,omitempty"` + + // StartDate: The start date and time of the event (in ISO 8601 date + // format). + StartDate string `json:"startDate,omitempty"` + + // StreetAddress: Street address. + StreetAddress string `json:"streetAddress,omitempty"` + + // Text: The text that is the result of the app activity. For example, + // if a user leaves a review of a restaurant, this might be the text of + // the review. + Text string `json:"text,omitempty"` + + // Thumbnail: Thumbnail image for an image or video. + Thumbnail *ItemScope `json:"thumbnail,omitempty"` + + // ThumbnailUrl: A URL to a thumbnail image that represents this result. + ThumbnailUrl string `json:"thumbnailUrl,omitempty"` + + // TickerSymbol: The exchange traded instrument associated with a + // Corporation object. The tickerSymbol is expressed as an exchange and + // an instrument name separated by a space character. For the exchange + // component of the tickerSymbol attribute, we recommend using the + // controlled vocabulary of Market Identifier Codes (MIC) specified in + // ISO15022. + TickerSymbol string `json:"tickerSymbol,omitempty"` + + // Type: The schema.org URL that best describes the referenced target + // and matches the type of moment. + Type string `json:"type,omitempty"` + + // Url: The URL that points to the result object. For example, a + // permalink directly to a restaurant reviewer's comment. + Url string `json:"url,omitempty"` + + // Width: The width of the media object. + Width string `json:"width,omitempty"` + + // WorstRating: Worst possible rating value that a result might obtain. + // This property defines the lower bound for the ratingValue. + WorstRating string `json:"worstRating,omitempty"` +} + +type Moment struct { + // Id: The moment ID. + Id string `json:"id,omitempty"` + + // Kind: Identifies this resource as a moment. + Kind string `json:"kind,omitempty"` + + // Result: The object generated by performing the action on the target. + // For example, a user writes a review of a restaurant, the target is + // the restaurant and the result is the review. + Result *ItemScope `json:"result,omitempty"` + + // StartDate: Time stamp of when the action occurred in RFC3339 format. + StartDate string `json:"startDate,omitempty"` + + // Target: The object on which the action was performed. + Target *ItemScope `json:"target,omitempty"` + + // Type: The Google schema for the type of moment to write. For example, + // http://schemas.google.com/AddActivity. + Type string `json:"type,omitempty"` +} + +type MomentsFeed struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The moments in this page of results. + Items []*Moment `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of moments. Value: + // "plus#momentsFeed". + Kind string `json:"kind,omitempty"` + + // NextLink: Link to the next page of moments. + NextLink string `json:"nextLink,omitempty"` + + // NextPageToken: The continuation token, which is used to page through + // large result sets. Provide this value in a subsequent request to + // return the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Link to this page of moments. + SelfLink string `json:"selfLink,omitempty"` + + // Title: The title of this collection of moments. + Title string `json:"title,omitempty"` + + // Updated: The RFC 339 timestamp for when this collection of moments + // was last updated. + Updated string `json:"updated,omitempty"` +} + +type PeopleFeed struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The people in this page of results. Each item includes the id, + // displayName, image, and url for the person. To retrieve additional + // profile data, see the people.get method. + Items []*Person `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of people. Value: + // "plus#peopleFeed". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The continuation token, which is used to page through + // large result sets. Provide this value in a subsequent request to + // return the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Link to this resource. + SelfLink string `json:"selfLink,omitempty"` + + // Title: The title of this collection of people. + Title string `json:"title,omitempty"` + + // TotalItems: The total number of people available in this list. The + // number of people in a response might be smaller due to paging. This + // might not be set for all collections. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type Person struct { + // AboutMe: A short biography for this person. + AboutMe string `json:"aboutMe,omitempty"` + + // AgeRange: The age range of the person. Valid ranges are 17 or + // younger, 18 to 20, and 21 or older. Age is determined from the user's + // birthday using Western age reckoning. + AgeRange *PersonAgeRange `json:"ageRange,omitempty"` + + // Birthday: The person's date of birth, represented as YYYY-MM-DD. + Birthday string `json:"birthday,omitempty"` + + // BraggingRights: The "bragging rights" line of this person. + BraggingRights string `json:"braggingRights,omitempty"` + + // CircledByCount: For followers who are visible, the number of people + // who have added this person or page to a circle. + CircledByCount int64 `json:"circledByCount,omitempty"` + + // Cover: The cover photo content. + Cover *PersonCover `json:"cover,omitempty"` + + // CurrentLocation: The current location for this person. + CurrentLocation string `json:"currentLocation,omitempty"` + + // DisplayName: The name of this person, which is suitable for display. + DisplayName string `json:"displayName,omitempty"` + + // Domain: The hosted domain name for the user's Google Apps account. + // For instance, example.com. The plus.profile.emails.read or email + // scope is needed to get this domain name. + Domain string `json:"domain,omitempty"` + + // Emails: A list of email addresses that this person has, including + // their Google account email address, and the public verified email + // addresses on their Google+ profile. The plus.profile.emails.read + // scope is needed to retrieve these email addresses, or the email scope + // can be used to retrieve just the Google account email address. + Emails []*PersonEmails `json:"emails,omitempty"` + + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Gender: The person's gender. Possible values include, but are not + // limited to, the following values: + // - "male" - Male gender. + // - + // "female" - Female gender. + // - "other" - Other. + Gender string `json:"gender,omitempty"` + + // Id: The ID of this person. + Id string `json:"id,omitempty"` + + // Image: The representation of the person's profile photo. + Image *PersonImage `json:"image,omitempty"` + + // IsPlusUser: Whether this user has signed up for Google+. + IsPlusUser bool `json:"isPlusUser,omitempty"` + + // Kind: Identifies this resource as a person. Value: "plus#person". + Kind string `json:"kind,omitempty"` + + // Language: The user's preferred language for rendering. + Language string `json:"language,omitempty"` + + // Name: An object representation of the individual components of a + // person's name. + Name *PersonName `json:"name,omitempty"` + + // Nickname: The nickname of this person. + Nickname string `json:"nickname,omitempty"` + + // ObjectType: Type of person within Google+. Possible values include, + // but are not limited to, the following values: + // - "person" - + // represents an actual person. + // - "page" - represents a page. + ObjectType string `json:"objectType,omitempty"` + + // Occupation: The occupation of this person. + Occupation string `json:"occupation,omitempty"` + + // Organizations: A list of current or past organizations with which + // this person is associated. + Organizations []*PersonOrganizations `json:"organizations,omitempty"` + + // PlacesLived: A list of places where this person has lived. + PlacesLived []*PersonPlacesLived `json:"placesLived,omitempty"` + + // PlusOneCount: If a Google+ Page, the number of people who have +1'd + // this page. + PlusOneCount int64 `json:"plusOneCount,omitempty"` + + // RelationshipStatus: The person's relationship status. Possible values + // include, but are not limited to, the following values: + // - "single" - + // Person is single. + // - "in_a_relationship" - Person is in a + // relationship. + // - "engaged" - Person is engaged. + // - "married" - Person + // is married. + // - "its_complicated" - The relationship is complicated. + // + // - "open_relationship" - Person is in an open relationship. + // - + // "widowed" - Person is widowed. + // - "in_domestic_partnership" - Person + // is in a domestic partnership. + // - "in_civil_union" - Person is in a + // civil union. + RelationshipStatus string `json:"relationshipStatus,omitempty"` + + // Skills: The person's skills. + Skills string `json:"skills,omitempty"` + + // Tagline: The brief description (tagline) of this person. + Tagline string `json:"tagline,omitempty"` + + // Url: The URL of this person's profile. + Url string `json:"url,omitempty"` + + // Urls: A list of URLs for this person. + Urls []*PersonUrls `json:"urls,omitempty"` + + // Verified: Whether the person or Google+ Page has been verified. + Verified bool `json:"verified,omitempty"` +} + +type PersonAgeRange struct { + // Max: The age range's upper bound, if any. Possible values include, + // but are not limited to, the following: + // - "17" - for age 17 + // - "20" + // - for age 20 + Max int64 `json:"max,omitempty"` + + // Min: The age range's lower bound, if any. Possible values include, + // but are not limited to, the following: + // - "21" - for age 21 + // - "18" + // - for age 18 + Min int64 `json:"min,omitempty"` +} + +type PersonCover struct { + // CoverInfo: Extra information about the cover photo. + CoverInfo *PersonCoverCoverInfo `json:"coverInfo,omitempty"` + + // CoverPhoto: The person's primary cover image. + CoverPhoto *PersonCoverCoverPhoto `json:"coverPhoto,omitempty"` + + // Layout: The layout of the cover art. Possible values include, but are + // not limited to, the following values: + // - "banner" - One large image + // banner. + Layout string `json:"layout,omitempty"` +} + +type PersonCoverCoverInfo struct { + // LeftImageOffset: The difference between the left position of the + // cover image and the actual displayed cover image. Only valid for + // banner layout. + LeftImageOffset int64 `json:"leftImageOffset,omitempty"` + + // TopImageOffset: The difference between the top position of the cover + // image and the actual displayed cover image. Only valid for banner + // layout. + TopImageOffset int64 `json:"topImageOffset,omitempty"` +} + +type PersonCoverCoverPhoto struct { + // Height: The height of the image. + Height int64 `json:"height,omitempty"` + + // Url: The URL of the image. + Url string `json:"url,omitempty"` + + // Width: The width of the image. + Width int64 `json:"width,omitempty"` +} + +type PersonEmails struct { + // Type: The type of address. Possible values include, but are not + // limited to, the following values: + // - "account" - Google account + // email address. + // - "home" - Home email address. + // - "work" - Work email + // address. + // - "other" - Other. + Type string `json:"type,omitempty"` + + // Value: The email address. + Value string `json:"value,omitempty"` +} + +type PersonImage struct { + // Url: The URL of the person's profile photo. To resize the image and + // crop it to a square, append the query string ?sz=x, where x is the + // dimension in pixels of each side. + Url string `json:"url,omitempty"` +} + +type PersonName struct { + // FamilyName: The family name (last name) of this person. + FamilyName string `json:"familyName,omitempty"` + + // Formatted: The full name of this person, including middle names, + // suffixes, etc. + Formatted string `json:"formatted,omitempty"` + + // GivenName: The given name (first name) of this person. + GivenName string `json:"givenName,omitempty"` + + // HonorificPrefix: The honorific prefixes (such as "Dr." or "Mrs.") for + // this person. + HonorificPrefix string `json:"honorificPrefix,omitempty"` + + // HonorificSuffix: The honorific suffixes (such as "Jr.") for this + // person. + HonorificSuffix string `json:"honorificSuffix,omitempty"` + + // MiddleName: The middle name of this person. + MiddleName string `json:"middleName,omitempty"` +} + +type PersonOrganizations struct { + // Department: The department within the organization. Deprecated. + Department string `json:"department,omitempty"` + + // Description: A short description of the person's role in this + // organization. Deprecated. + Description string `json:"description,omitempty"` + + // EndDate: The date that the person left this organization. + EndDate string `json:"endDate,omitempty"` + + // Location: The location of this organization. Deprecated. + Location string `json:"location,omitempty"` + + // Name: The name of the organization. + Name string `json:"name,omitempty"` + + // Primary: If "true", indicates this organization is the person's + // primary one, which is typically interpreted as the current one. + Primary bool `json:"primary,omitempty"` + + // StartDate: The date that the person joined this organization. + StartDate string `json:"startDate,omitempty"` + + // Title: The person's job title or role within the organization. + Title string `json:"title,omitempty"` + + // Type: The type of organization. Possible values include, but are not + // limited to, the following values: + // - "work" - Work. + // - "school" - + // School. + Type string `json:"type,omitempty"` +} + +type PersonPlacesLived struct { + // Primary: If "true", this place of residence is this person's primary + // residence. + Primary bool `json:"primary,omitempty"` + + // Value: A place where this person has lived. For example: "Seattle, + // WA", "Near Toronto". + Value string `json:"value,omitempty"` +} + +type PersonUrls struct { + // Label: The label of the URL. + Label string `json:"label,omitempty"` + + // Type: The type of URL. Possible values include, but are not limited + // to, the following values: + // - "otherProfile" - URL for another + // profile. + // - "contributor" - URL to a site for which this person is a + // contributor. + // - "website" - URL for this Google+ Page's primary + // website. + // - "other" - Other URL. + Type string `json:"type,omitempty"` + + // Value: The URL value. + Value string `json:"value,omitempty"` +} + +type Place struct { + // Address: The physical address of the place. + Address *PlaceAddress `json:"address,omitempty"` + + // DisplayName: The display name of the place. + DisplayName string `json:"displayName,omitempty"` + + // Kind: Identifies this resource as a place. Value: "plus#place". + Kind string `json:"kind,omitempty"` + + // Position: The position of the place. + Position *PlacePosition `json:"position,omitempty"` +} + +type PlaceAddress struct { + // Formatted: The formatted address for display. + Formatted string `json:"formatted,omitempty"` +} + +type PlacePosition struct { + // Latitude: The latitude of this position. + Latitude float64 `json:"latitude,omitempty"` + + // Longitude: The longitude of this position. + Longitude float64 `json:"longitude,omitempty"` +} + +type PlusAclentryResource struct { + // DisplayName: A descriptive name for this entry. Suitable for display. + DisplayName string `json:"displayName,omitempty"` + + // Id: The ID of the entry. For entries of type "person" or "circle", + // this is the ID of the resource. For other types, this property is not + // set. + Id string `json:"id,omitempty"` + + // Type: The type of entry describing to whom access is granted. + // Possible values are: + // - "person" - Access to an individual. + // - + // "circle" - Access to members of a circle. + // - "myCircles" - Access to + // members of all the person's circles. + // - "extendedCircles" - Access to + // members of all the person's circles, plus all of the people in their + // circles. + // - "domain" - Access to members of the person's Google Apps + // domain. + // - "public" - Access to anyone on the web. + Type string `json:"type,omitempty"` +} + +// method id "plus.activities.get": + +type ActivitiesGetCall struct { + s *Service + activityId string + opt_ map[string]interface{} +} + +// Get: Get an activity. +func (r *ActivitiesService) Get(activityId string) *ActivitiesGetCall { + c := &ActivitiesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.activityId = activityId + return c +} + +func (c *ActivitiesGetCall) Do() (*Activity, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{activityId}", url.QueryEscape(c.activityId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Activity) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get an activity.", + // "httpMethod": "GET", + // "id": "plus.activities.get", + // "parameterOrder": [ + // "activityId" + // ], + // "parameters": { + // "activityId": { + // "description": "The ID of the activity to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "activities/{activityId}", + // "response": { + // "$ref": "Activity" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me" + // ] + // } + +} + +// method id "plus.activities.list": + +type ActivitiesListCall struct { + s *Service + userId string + collection string + opt_ map[string]interface{} +} + +// List: List all of the activities in the specified collection for a +// particular user. +func (r *ActivitiesService) List(userId string, collection string) *ActivitiesListCall { + c := &ActivitiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.collection = collection + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of activities to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *ActivitiesListCall) MaxResults(maxResults int64) *ActivitiesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *ActivitiesListCall) PageToken(pageToken string) *ActivitiesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ActivitiesListCall) Do() (*ActivityFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/activities/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{collection}", url.QueryEscape(c.collection), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ActivityFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the activities in the specified collection for a particular user.", + // "httpMethod": "GET", + // "id": "plus.activities.list", + // "parameterOrder": [ + // "userId", + // "collection" + // ], + // "parameters": { + // "collection": { + // "description": "The collection of activities to list.", + // "enum": [ + // "public" + // ], + // "enumDescriptions": [ + // "All public activities created by the specified user." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "20", + // "description": "The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user to get activities for. The special value \"me\" can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/activities/{collection}", + // "response": { + // "$ref": "ActivityFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me" + // ] + // } + +} + +// method id "plus.activities.search": + +type ActivitiesSearchCall struct { + s *Service + query string + opt_ map[string]interface{} +} + +// Search: Search public activities. +func (r *ActivitiesService) Search(query string) *ActivitiesSearchCall { + c := &ActivitiesSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.query = query + return c +} + +// Language sets the optional parameter "language": Specify the +// preferred language to search with. See search language codes for +// available values. +func (c *ActivitiesSearchCall) Language(language string) *ActivitiesSearchCall { + c.opt_["language"] = language + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of activities to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *ActivitiesSearchCall) MaxResults(maxResults int64) *ActivitiesSearchCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Specifies how to order +// search results. +func (c *ActivitiesSearchCall) OrderBy(orderBy string) *ActivitiesSearchCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. This token can be of any +// length. +func (c *ActivitiesSearchCall) PageToken(pageToken string) *ActivitiesSearchCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ActivitiesSearchCall) Do() (*ActivityFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("query", fmt.Sprintf("%v", c.query)) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", 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", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ActivityFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Search public activities.", + // "httpMethod": "GET", + // "id": "plus.activities.search", + // "parameterOrder": [ + // "query" + // ], + // "parameters": { + // "language": { + // "default": "en-US", + // "description": "Specify the preferred language to search with. See search language codes for available values.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "10", + // "description": "The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "20", + // "minimum": "1", + // "type": "integer" + // }, + // "orderBy": { + // "default": "recent", + // "description": "Specifies how to order search results.", + // "enum": [ + // "best", + // "recent" + // ], + // "enumDescriptions": [ + // "Sort activities by relevance to the user, most relevant first.", + // "Sort activities by published date, most recent first." + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response. This token can be of any length.", + // "location": "query", + // "type": "string" + // }, + // "query": { + // "description": "Full-text search query string.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "activities", + // "response": { + // "$ref": "ActivityFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me" + // ] + // } + +} + +// method id "plus.comments.get": + +type CommentsGetCall struct { + s *Service + commentId string + opt_ map[string]interface{} +} + +// Get: Get a comment. +func (r *CommentsService) Get(commentId string) *CommentsGetCall { + c := &CommentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.commentId = commentId + return c +} + +func (c *CommentsGetCall) Do() (*Comment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a comment.", + // "httpMethod": "GET", + // "id": "plus.comments.get", + // "parameterOrder": [ + // "commentId" + // ], + // "parameters": { + // "commentId": { + // "description": "The ID of the comment to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "comments/{commentId}", + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me" + // ] + // } + +} + +// method id "plus.comments.list": + +type CommentsListCall struct { + s *Service + activityId string + opt_ map[string]interface{} +} + +// List: List all of the comments for an activity. +func (r *CommentsService) List(activityId string) *CommentsListCall { + c := &CommentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.activityId = activityId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of comments to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortOrder sets the optional parameter "sortOrder": The order in which +// to sort the list of comments. +func (c *CommentsListCall) SortOrder(sortOrder string) *CommentsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *CommentsListCall) Do() (*CommentFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{activityId}", url.QueryEscape(c.activityId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommentFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the comments for an activity.", + // "httpMethod": "GET", + // "id": "plus.comments.list", + // "parameterOrder": [ + // "activityId" + // ], + // "parameters": { + // "activityId": { + // "description": "The ID of the activity to get comments for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "20", + // "description": "The maximum number of comments to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "default": "ascending", + // "description": "The order in which to sort the list of comments.", + // "enum": [ + // "ascending", + // "descending" + // ], + // "enumDescriptions": [ + // "Sort oldest comments first.", + // "Sort newest comments first." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "activities/{activityId}/comments", + // "response": { + // "$ref": "CommentFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me" + // ] + // } + +} + +// method id "plus.moments.insert": + +type MomentsInsertCall struct { + s *Service + userId string + collection string + moment *Moment + opt_ map[string]interface{} +} + +// Insert: Record a moment representing a user's activity such as making +// a purchase or commenting on a blog. +func (r *MomentsService) Insert(userId string, collection string, moment *Moment) *MomentsInsertCall { + c := &MomentsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.collection = collection + c.moment = moment + return c +} + +// Debug sets the optional parameter "debug": Return the moment as +// written. Should be used only for debugging. +func (c *MomentsInsertCall) Debug(debug bool) *MomentsInsertCall { + c.opt_["debug"] = debug + return c +} + +func (c *MomentsInsertCall) Do() (*Moment, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.moment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["debug"]; ok { + params.Set("debug", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/moments/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{collection}", url.QueryEscape(c.collection), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Moment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Record a moment representing a user's activity such as making a purchase or commenting on a blog.", + // "httpMethod": "POST", + // "id": "plus.moments.insert", + // "parameterOrder": [ + // "userId", + // "collection" + // ], + // "parameters": { + // "collection": { + // "description": "The collection to which to write moments.", + // "enum": [ + // "vault" + // ], + // "enumDescriptions": [ + // "The default collection for writing new moments." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "debug": { + // "description": "Return the moment as written. Should be used only for debugging.", + // "location": "query", + // "type": "boolean" + // }, + // "userId": { + // "description": "The ID of the user to record activities for. The only valid values are \"me\" and the ID of the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/moments/{collection}", + // "request": { + // "$ref": "Moment" + // }, + // "response": { + // "$ref": "Moment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me" + // ] + // } + +} + +// method id "plus.moments.list": + +type MomentsListCall struct { + s *Service + userId string + collection string + opt_ map[string]interface{} +} + +// List: List all of the moments for a particular user. +func (r *MomentsService) List(userId string, collection string) *MomentsListCall { + c := &MomentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.collection = collection + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of moments to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *MomentsListCall) MaxResults(maxResults int64) *MomentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *MomentsListCall) PageToken(pageToken string) *MomentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// TargetUrl sets the optional parameter "targetUrl": Only moments +// containing this targetUrl will be returned. +func (c *MomentsListCall) TargetUrl(targetUrl string) *MomentsListCall { + c.opt_["targetUrl"] = targetUrl + return c +} + +// Type sets the optional parameter "type": Only moments of this type +// will be returned. +func (c *MomentsListCall) Type(type_ string) *MomentsListCall { + c.opt_["type"] = type_ + return c +} + +func (c *MomentsListCall) Do() (*MomentsFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["targetUrl"]; ok { + params.Set("targetUrl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["type"]; ok { + params.Set("type", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/moments/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{collection}", url.QueryEscape(c.collection), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(MomentsFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the moments for a particular user.", + // "httpMethod": "GET", + // "id": "plus.moments.list", + // "parameterOrder": [ + // "userId", + // "collection" + // ], + // "parameters": { + // "collection": { + // "description": "The collection of moments to list.", + // "enum": [ + // "vault" + // ], + // "enumDescriptions": [ + // "All moments created by the requesting application for the authenticated user." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "20", + // "description": "The maximum number of moments to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "targetUrl": { + // "description": "Only moments containing this targetUrl will be returned.", + // "location": "query", + // "type": "string" + // }, + // "type": { + // "description": "Only moments of this type will be returned.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user to get moments for. The special value \"me\" can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/moments/{collection}", + // "response": { + // "$ref": "MomentsFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me" + // ] + // } + +} + +// method id "plus.moments.remove": + +type MomentsRemoveCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Remove: Delete a moment. +func (r *MomentsService) Remove(id string) *MomentsRemoveCall { + c := &MomentsRemoveCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *MomentsRemoveCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "moments/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a moment.", + // "httpMethod": "DELETE", + // "id": "plus.moments.remove", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the moment to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "moments/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "plus.people.get": + +type PeopleGetCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// Get: Get a person's profile. If your app uses scope +// https://www.googleapis.com/auth/plus.login, this method is guaranteed +// to return ageRange and language. +func (r *PeopleService) Get(userId string) *PeopleGetCall { + c := &PeopleGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +func (c *PeopleGetCall) Do() (*Person, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Person) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a person's profile. If your app uses scope https://www.googleapis.com/auth/plus.login, this method is guaranteed to return ageRange and language.", + // "httpMethod": "GET", + // "id": "plus.people.get", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "description": "The ID of the person to get the profile for. The special value \"me\" can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}", + // "response": { + // "$ref": "Person" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me", + // "https://www.googleapis.com/auth/userinfo.email", + // "https://www.googleapis.com/auth/userinfo.profile" + // ] + // } + +} + +// method id "plus.people.list": + +type PeopleListCall struct { + s *Service + userId string + collection string + opt_ map[string]interface{} +} + +// List: List all of the people in the specified collection. +func (r *PeopleService) List(userId string, collection string) *PeopleListCall { + c := &PeopleListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.collection = collection + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of people to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *PeopleListCall) MaxResults(maxResults int64) *PeopleListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": The order to return +// people in. +func (c *PeopleListCall) OrderBy(orderBy string) *PeopleListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *PeopleListCall) PageToken(pageToken string) *PeopleListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *PeopleListCall) Do() (*PeopleFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/people/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{collection}", url.QueryEscape(c.collection), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PeopleFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the people in the specified collection.", + // "httpMethod": "GET", + // "id": "plus.people.list", + // "parameterOrder": [ + // "userId", + // "collection" + // ], + // "parameters": { + // "collection": { + // "description": "The collection of people to list.", + // "enum": [ + // "connected", + // "visible" + // ], + // "enumDescriptions": [ + // "The list of visible people in the authenticated user's circles who also use the requesting app. This list is limited to users who made their app activities visible to the authenticated user.", + // "The list of people who this user has added to one or more circles, limited to the circles visible to the requesting application." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "orderBy": { + // "description": "The order to return people in.", + // "enum": [ + // "alphabetical", + // "best" + // ], + // "enumDescriptions": [ + // "Order the people by their display name.", + // "Order people based on the relevence to the viewer." + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "Get the collection of people for the person identified. Use \"me\" to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/people/{collection}", + // "response": { + // "$ref": "PeopleFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me" + // ] + // } + +} + +// method id "plus.people.listByActivity": + +type PeopleListByActivityCall struct { + s *Service + activityId string + collection string + opt_ map[string]interface{} +} + +// ListByActivity: List all of the people in the specified collection +// for a particular activity. +func (r *PeopleService) ListByActivity(activityId string, collection string) *PeopleListByActivityCall { + c := &PeopleListByActivityCall{s: r.s, opt_: make(map[string]interface{})} + c.activityId = activityId + c.collection = collection + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of people to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *PeopleListByActivityCall) MaxResults(maxResults int64) *PeopleListByActivityCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *PeopleListByActivityCall) PageToken(pageToken string) *PeopleListByActivityCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *PeopleListByActivityCall) Do() (*PeopleFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}/people/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{activityId}", url.QueryEscape(c.activityId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{collection}", url.QueryEscape(c.collection), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PeopleFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the people in the specified collection for a particular activity.", + // "httpMethod": "GET", + // "id": "plus.people.listByActivity", + // "parameterOrder": [ + // "activityId", + // "collection" + // ], + // "parameters": { + // "activityId": { + // "description": "The ID of the activity to get the list of people for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "collection": { + // "description": "The collection of people to list.", + // "enum": [ + // "plusoners", + // "resharers" + // ], + // "enumDescriptions": [ + // "List all people who have +1'd this activity.", + // "List all people who have reshared this activity." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "20", + // "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "activities/{activityId}/people/{collection}", + // "response": { + // "$ref": "PeopleFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me" + // ] + // } + +} + +// method id "plus.people.search": + +type PeopleSearchCall struct { + s *Service + query string + opt_ map[string]interface{} +} + +// Search: Search all public profiles. +func (r *PeopleService) Search(query string) *PeopleSearchCall { + c := &PeopleSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.query = query + return c +} + +// Language sets the optional parameter "language": Specify the +// preferred language to search with. See search language codes for +// available values. +func (c *PeopleSearchCall) Language(language string) *PeopleSearchCall { + c.opt_["language"] = language + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of people to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *PeopleSearchCall) MaxResults(maxResults int64) *PeopleSearchCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. This token can be of any +// length. +func (c *PeopleSearchCall) PageToken(pageToken string) *PeopleSearchCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *PeopleSearchCall) Do() (*PeopleFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("query", fmt.Sprintf("%v", c.query)) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PeopleFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Search all public profiles.", + // "httpMethod": "GET", + // "id": "plus.people.search", + // "parameterOrder": [ + // "query" + // ], + // "parameters": { + // "language": { + // "default": "en-US", + // "description": "Specify the preferred language to search with. See search language codes for available values.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "25", + // "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "50", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response. This token can be of any length.", + // "location": "query", + // "type": "string" + // }, + // "query": { + // "description": "Specify a query string for full text search of public text in all profiles.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people", + // "response": { + // "$ref": "PeopleFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/plus/v1domains/plus-api.json b/third_party/src/code.google.com/p/google-api-go-client/plus/v1domains/plus-api.json new file mode 100644 index 0000000000000..9b4552fce50a3 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/plus/v1domains/plus-api.json @@ -0,0 +1,2118 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"wtgj9ZncHCe-ShJM8RewHb1DgWI/osZuPoYT5hJnE0hEpTbvxVAA6M0\"", + "discoveryVersion": "v1", + "id": "plus:v1domains", + "name": "plus", + "version": "v1domains", + "revision": "20130726", + "title": "Google+ API", + "description": "The Google+ API enables developers to build on top of the Google+ platform.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/gplus-16.png", + "x32": "http://www.google.com/images/icons/product/gplus-32.png" + }, + "documentationLink": "https://developers.google.com/+/api/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/plus/v1domains/", + "basePath": "/plus/v1domains/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "plus/v1domains/", + "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/plus.circles.read": { + "description": "View your circles and people in them" + }, + "https://www.googleapis.com/auth/plus.circles.write": { + "description": "Manage your circles and add people" + }, + "https://www.googleapis.com/auth/plus.login": { + "description": "Know your name, basic info, and list of people you're connected to on Google+" + }, + "https://www.googleapis.com/auth/plus.me": { + "description": "Know who you are on Google" + }, + "https://www.googleapis.com/auth/plus.media.upload": { + "description": "Send your photos and videos to Google+" + }, + "https://www.googleapis.com/auth/plus.profiles.read": { + "description": "View your own Google+ profile and profiles shared with you" + }, + "https://www.googleapis.com/auth/plus.stream.read": { + "description": "View your posts, comments, and stream" + }, + "https://www.googleapis.com/auth/plus.stream.write": { + "description": "Manage your posts, comments, and stream" + } + } + } + }, + "schemas": { + "Acl": { + "id": "Acl", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Description of the access granted, suitable for display." + }, + "domainRestricted": { + "type": "boolean", + "description": "Whether access is restricted to the domain." + }, + "items": { + "type": "array", + "description": "The list of access entries.", + "items": { + "$ref": "PlusAclentryResource" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of access controls. Value: \"plus#acl\".", + "default": "plus#acl" + } + } + }, + "Activity": { + "id": "Activity", + "type": "object", + "properties": { + "access": { + "$ref": "Acl", + "description": "Identifies who has access to see this activity." + }, + "actor": { + "type": "object", + "description": "The person who performed this activity.", + "properties": { + "displayName": { + "type": "string", + "description": "The name of the actor, suitable for display." + }, + "id": { + "type": "string", + "description": "The ID of the actor's Person resource." + }, + "image": { + "type": "object", + "description": "The image representation of the actor.", + "properties": { + "url": { + "type": "string", + "description": "The URL of the actor's profile photo. To resize the image and crop it to a square, append the query string ?sz=x, where x is the dimension in pixels of each side." + } + } + }, + "name": { + "type": "object", + "description": "An object representation of the individual components of name.", + "properties": { + "familyName": { + "type": "string", + "description": "The family name (\"last name\") of the actor." + }, + "givenName": { + "type": "string", + "description": "The given name (\"first name\") of the actor." + } + } + }, + "url": { + "type": "string", + "description": "The link to the actor's Google profile." + } + } + }, + "address": { + "type": "string", + "description": "Street address where this activity occurred." + }, + "annotation": { + "type": "string", + "description": "Additional content added by the person who shared this activity, applicable only when resharing an activity." + }, + "crosspostSource": { + "type": "string", + "description": "If this activity is a crosspost from another system, this property specifies the ID of the original activity." + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "geocode": { + "type": "string", + "description": "Latitude and longitude where this activity occurred. Format is latitude followed by longitude, space separated." + }, + "id": { + "type": "string", + "description": "The ID of this activity." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as an activity. Value: \"plus#activity\".", + "default": "plus#activity" + }, + "location": { + "$ref": "Place", + "description": "The location where this activity occurred." + }, + "object": { + "type": "object", + "description": "The object of this activity.", + "properties": { + "actor": { + "type": "object", + "description": "If this activity's object is itself another activity, such as when a person reshares an activity, this property specifies the original activity's actor.", + "properties": { + "displayName": { + "type": "string", + "description": "The original actor's name, which is suitable for display." + }, + "id": { + "type": "string", + "description": "ID of the original actor." + }, + "image": { + "type": "object", + "description": "The image representation of the original actor.", + "properties": { + "url": { + "type": "string", + "description": "A URL that points to a thumbnail photo of the original actor." + } + } + }, + "url": { + "type": "string", + "description": "A link to the original actor's Google profile." + } + } + }, + "attachments": { + "type": "array", + "description": "The media objects attached to this activity.", + "items": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "If the attachment is an article, this property contains a snippet of text from the article. It can also include descriptions for other types." + }, + "displayName": { + "type": "string", + "description": "The title of the attachment, such as a photo caption or an article title." + }, + "embed": { + "type": "object", + "description": "If the attachment is a video, the embeddable link.", + "properties": { + "type": { + "type": "string", + "description": "Media type of the link." + }, + "url": { + "type": "string", + "description": "URL of the link." + } + } + }, + "fullImage": { + "type": "object", + "description": "The full image URL for photo attachments.", + "properties": { + "height": { + "type": "integer", + "description": "The height, in pixels, of the linked resource.", + "format": "uint32" + }, + "type": { + "type": "string", + "description": "Media type of the link." + }, + "url": { + "type": "string", + "description": "URL of the image." + }, + "width": { + "type": "integer", + "description": "The width, in pixels, of the linked resource.", + "format": "uint32" + } + } + }, + "id": { + "type": "string", + "description": "The ID of the attachment." + }, + "image": { + "type": "object", + "description": "The preview image for photos or videos.", + "properties": { + "height": { + "type": "integer", + "description": "The height, in pixels, of the linked resource.", + "format": "uint32" + }, + "type": { + "type": "string", + "description": "Media type of the link." + }, + "url": { + "type": "string", + "description": "Image URL." + }, + "width": { + "type": "integer", + "description": "The width, in pixels, of the linked resource.", + "format": "uint32" + } + } + }, + "objectType": { + "type": "string", + "description": "The type of media object. Possible values include, but are not limited to, the following values: \n- \"photo\" - A photo. \n- \"album\" - A photo album. \n- \"video\" - A video. \n- \"article\" - An article, specified by a link." + }, + "previewThumbnails": { + "type": "array", + "description": "When previewing, these are the optional thumbnails for the post. When posting an article, choose one by setting the attachment.image.url property. If you don't choose one, one will be chosen for you.", + "items": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "URL of the thumbnail image." + } + } + } + }, + "thumbnails": { + "type": "array", + "description": "If the attachment is an album, this property is a list of potential additional thumbnails from the album.", + "items": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Potential name of the thumbnail." + }, + "image": { + "type": "object", + "description": "Image resource.", + "properties": { + "height": { + "type": "integer", + "description": "The height, in pixels, of the linked resource.", + "format": "uint32" + }, + "type": { + "type": "string", + "description": "Media type of the link." + }, + "url": { + "type": "string", + "description": "Image url." + }, + "width": { + "type": "integer", + "description": "The width, in pixels, of the linked resource.", + "format": "uint32" + } + } + }, + "url": { + "type": "string", + "description": "URL of the webpage containing the image." + } + } + } + }, + "url": { + "type": "string", + "description": "The link to the attachment; should be of type text/html." + } + } + } + }, + "content": { + "type": "string", + "description": "The HTML-formatted content, which is suitable for display." + }, + "id": { + "type": "string", + "description": "The ID of the object. When resharing an activity, this is the ID of the activity that is being reshared." + }, + "objectType": { + "type": "string", + "description": "The type of the object. Possible values include, but are not limited to, the following values: \n- \"note\" - Textual content. \n- \"activity\" - A Google+ activity." + }, + "originalContent": { + "type": "string", + "description": "The content (text) as provided by the author, which is stored without any HTML formatting. When creating or updating an activity, this value must be supplied as plain text in the request.", + "annotations": { + "required": [ + "plus.activities.insert" + ] + } + }, + "plusoners": { + "type": "object", + "description": "People who +1'd this activity.", + "properties": { + "selfLink": { + "type": "string", + "description": "The URL for the collection of people who +1'd this activity." + }, + "totalItems": { + "type": "integer", + "description": "Total number of people who +1'd this activity.", + "format": "uint32" + } + } + }, + "replies": { + "type": "object", + "description": "Comments in reply to this activity.", + "properties": { + "selfLink": { + "type": "string", + "description": "The URL for the collection of comments in reply to this activity." + }, + "totalItems": { + "type": "integer", + "description": "Total number of comments on this activity.", + "format": "uint32" + } + } + }, + "resharers": { + "type": "object", + "description": "People who reshared this activity.", + "properties": { + "selfLink": { + "type": "string", + "description": "The URL for the collection of resharers." + }, + "totalItems": { + "type": "integer", + "description": "Total number of people who reshared this activity.", + "format": "uint32" + } + } + }, + "statusForViewer": { + "type": "object", + "description": "Status of the activity as seen by the viewer.", + "properties": { + "canComment": { + "type": "boolean", + "description": "Whether the viewer can comment on the activity." + }, + "canPlusone": { + "type": "boolean", + "description": "Whether the viewer can +1 the activity." + }, + "isPlusOned": { + "type": "boolean", + "description": "Whether the viewer has +1'd the activity." + }, + "resharingDisabled": { + "type": "boolean", + "description": "Whether reshares are disabled for the activity." + } + } + }, + "url": { + "type": "string", + "description": "The URL that points to the linked resource." + } + } + }, + "placeId": { + "type": "string", + "description": "ID of the place where this activity occurred." + }, + "placeName": { + "type": "string", + "description": "Name of the place where this activity occurred." + }, + "provider": { + "type": "object", + "description": "The service provider that initially published this activity.", + "properties": { + "title": { + "type": "string", + "description": "Name of the service provider." + } + } + }, + "published": { + "type": "string", + "description": "The time at which this activity was initially published. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "radius": { + "type": "string", + "description": "Radius, in meters, of the region where this activity occurred, centered at the latitude and longitude identified in geocode." + }, + "title": { + "type": "string", + "description": "Title of this activity." + }, + "updated": { + "type": "string", + "description": "The time at which this activity was last updated. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "url": { + "type": "string", + "description": "The link to this activity." + }, + "verb": { + "type": "string", + "description": "This activity's verb, which indicates the action that was performed. Possible values include, but are not limited to, the following values: \n- \"post\" - Publish content to the stream. \n- \"share\" - Reshare an activity." + } + } + }, + "ActivityFeed": { + "id": "ActivityFeed", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID of this collection of activities. Deprecated." + }, + "items": { + "type": "array", + "description": "The activities in this page of results.", + "items": { + "$ref": "Activity" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of activities. Value: \"plus#activityFeed\".", + "default": "plus#activityFeed" + }, + "nextLink": { + "type": "string", + "description": "Link to the next page of activities." + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "selfLink": { + "type": "string", + "description": "Link to this activities resource." + }, + "title": { + "type": "string", + "description": "The title of this collection of activities, which is a truncated portion of the content." + }, + "updated": { + "type": "string", + "description": "The time at which this collection of activities was last updated. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + } + } + }, + "Audience": { + "id": "Audience", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "item": { + "$ref": "PlusAclentryResource", + "description": "The access control list entry." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as an audience. Value: \"plus#audience\".", + "default": "plus#audience" + }, + "visibility": { + "type": "string", + "description": "The circle members' visibility as chosen by the owner of the circle. This only applies for items with \"item.type\" equals \"circle\". Possible values are: \n- \"public\" - Members are visible to the public. \n- \"limited\" - Members are visible to a limited audience. \n- \"private\" - Members are visible to the owner only." + } + } + }, + "AudiencesFeed": { + "id": "AudiencesFeed", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The audiences in this result.", + "items": { + "$ref": "Audience" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of audiences. Value: \"plus#audienceFeed\".", + "default": "plus#audiencesFeed" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "totalItems": { + "type": "integer", + "description": "The total number of ACL entries. The number of entries in this response may be smaller due to paging.", + "format": "int32" + } + } + }, + "Circle": { + "id": "Circle", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "The description of this circle." + }, + "displayName": { + "type": "string", + "description": "The circle name.", + "annotations": { + "required": [ + "plus.circles.insert" + ] + } + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID of the circle." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a circle. Value: \"plus#circle\".", + "default": "plus#circle" + }, + "people": { + "type": "object", + "description": "The people in this circle.", + "properties": { + "totalItems": { + "type": "integer", + "description": "The total number of people in this circle.", + "format": "uint32" + } + } + }, + "selfLink": { + "type": "string", + "description": "Link to this circle resource" + } + } + }, + "CircleFeed": { + "id": "CircleFeed", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The circles in this page of results.", + "items": { + "$ref": "Circle" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of circles. Value: \"plus#circleFeed\".", + "default": "plus#circleFeed" + }, + "nextLink": { + "type": "string", + "description": "Link to the next page of circles." + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "selfLink": { + "type": "string", + "description": "Link to this page of circles." + }, + "title": { + "type": "string", + "description": "The title of this list of resources." + }, + "totalItems": { + "type": "integer", + "description": "The total number of circles. The number of circles in this response may be smaller due to paging.", + "format": "int32" + } + } + }, + "Comment": { + "id": "Comment", + "type": "object", + "properties": { + "actor": { + "type": "object", + "description": "The person who posted this comment.", + "properties": { + "displayName": { + "type": "string", + "description": "The name of this actor, suitable for display." + }, + "id": { + "type": "string", + "description": "The ID of the actor." + }, + "image": { + "type": "object", + "description": "The image representation of this actor.", + "properties": { + "url": { + "type": "string", + "description": "The URL of the actor's profile photo. To resize the image and crop it to a square, append the query string ?sz=x, where x is the dimension in pixels of each side." + } + } + }, + "url": { + "type": "string", + "description": "A link to the Person resource for this actor." + } + } + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID of this comment." + }, + "inReplyTo": { + "type": "array", + "description": "The activity this comment replied to.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the activity." + }, + "url": { + "type": "string", + "description": "The URL of the activity." + } + } + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a comment. Value: \"plus#comment\".", + "default": "plus#comment" + }, + "object": { + "type": "object", + "description": "The object of this comment.", + "properties": { + "content": { + "type": "string", + "description": "The HTML-formatted content, suitable for display." + }, + "objectType": { + "type": "string", + "description": "The object type of this comment. Possible values are: \n- \"comment\" - A comment in reply to an activity.", + "default": "comment" + }, + "originalContent": { + "type": "string", + "description": "The content (text) as provided by the author, stored without any HTML formatting. When creating or updating a comment, this value must be supplied as plain text in the request.", + "annotations": { + "required": [ + "plus.comments.insert" + ] + } + } + } + }, + "plusoners": { + "type": "object", + "description": "People who +1'd this comment.", + "properties": { + "totalItems": { + "type": "integer", + "description": "Total number of people who +1'd this comment.", + "format": "uint32" + } + } + }, + "published": { + "type": "string", + "description": "The time at which this comment was initially published. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "selfLink": { + "type": "string", + "description": "Link to this comment resource." + }, + "updated": { + "type": "string", + "description": "The time at which this comment was last updated. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "verb": { + "type": "string", + "description": "This comment's verb, indicating what action was performed. Possible values are: \n- \"post\" - Publish content to the stream.", + "default": "post" + } + } + }, + "CommentFeed": { + "id": "CommentFeed", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID of this collection of comments." + }, + "items": { + "type": "array", + "description": "The comments in this page of results.", + "items": { + "$ref": "Comment" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of comments. Value: \"plus#commentFeed\".", + "default": "plus#commentFeed" + }, + "nextLink": { + "type": "string", + "description": "Link to the next page of activities." + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "title": { + "type": "string", + "description": "The title of this collection of comments." + }, + "updated": { + "type": "string", + "description": "The time at which this collection of comments was last updated. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + } + } + }, + "Media": { + "id": "Media", + "type": "object", + "properties": { + "author": { + "type": "object", + "description": "The person who uploaded this media.", + "properties": { + "displayName": { + "type": "string", + "description": "The author's name." + }, + "id": { + "type": "string", + "description": "ID of the author." + }, + "image": { + "type": "object", + "description": "The author's Google profile image.", + "properties": { + "url": { + "type": "string", + "description": "The URL of the author's profile photo. To resize the image and crop it to a square, append the query string ?sz=x, where x is the dimension in pixels of each side." + } + } + }, + "url": { + "type": "string", + "description": "A link to the author's Google profile." + } + } + }, + "displayName": { + "type": "string", + "description": "The display name for this media." + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "exif": { + "type": "object", + "description": "Exif information of the media item.", + "properties": { + "time": { + "type": "string", + "description": "The time the media was captured. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + } + } + }, + "height": { + "type": "integer", + "description": "The height in pixels of the original image.", + "format": "uint32" + }, + "id": { + "type": "string", + "description": "ID of this media, which is generated by the API." + }, + "kind": { + "type": "string", + "description": "The type of resource.", + "default": "plus#media" + }, + "mediaUrl": { + "type": "string", + "description": "The URL of this photo or video's still image." + }, + "published": { + "type": "string", + "description": "The time at which this media was uploaded. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "sizeBytes": { + "type": "string", + "description": "The size in bytes of this video.", + "format": "int64" + }, + "streams": { + "type": "array", + "description": "The list of video streams for this video. There might be several different streams available for a single video, either Flash or MPEG, of various sizes", + "items": { + "$ref": "Videostream" + } + }, + "summary": { + "type": "string", + "description": "A description, or caption, for this media." + }, + "updated": { + "type": "string", + "description": "The time at which this media was last updated. This includes changes to media metadata. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "url": { + "type": "string", + "description": "The URL for the page that hosts this media." + }, + "videoDuration": { + "type": "string", + "description": "The duration in milliseconds of this video.", + "format": "int64" + }, + "videoStatus": { + "type": "string", + "description": "The encoding status of this video. Possible values are: \n- \"PENDING\" - Video not yet processed. \n- \"FAILED\" - Video processing failed. \n- \"READY\" - A single video stream is playable. \n- \"FINAL\" - All video streams are playable." + }, + "width": { + "type": "integer", + "description": "The width in pixels of the original image.", + "format": "uint32" + } + } + }, + "PeopleFeed": { + "id": "PeopleFeed", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The people in this page of results. Each item includes the id, displayName, image, and url for the person. To retrieve additional profile data, see the people.get method.", + "items": { + "$ref": "Person" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of people. Value: \"plus#peopleFeed\".", + "default": "plus#peopleFeed" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "selfLink": { + "type": "string", + "description": "Link to this resource." + }, + "title": { + "type": "string", + "description": "The title of this collection of people." + }, + "totalItems": { + "type": "integer", + "description": "The total number of people available in this list. The number of people in a response might be smaller due to paging. This might not be set for all collections.", + "format": "int32" + } + } + }, + "Person": { + "id": "Person", + "type": "object", + "properties": { + "aboutMe": { + "type": "string", + "description": "A short biography for this person." + }, + "birthday": { + "type": "string", + "description": "The person's date of birth, represented as YYYY-MM-DD." + }, + "braggingRights": { + "type": "string", + "description": "The \"bragging rights\" line of this person." + }, + "circledByCount": { + "type": "integer", + "description": "If a Google+ Page and for followers who are visible, the number of people who have added this page to a circle.", + "format": "int32" + }, + "cover": { + "type": "object", + "description": "The cover photo content.", + "properties": { + "coverInfo": { + "type": "object", + "description": "Extra information about the cover photo.", + "properties": { + "leftImageOffset": { + "type": "integer", + "description": "The difference between the left position of the cover image and the actual displayed cover image. Only valid for banner layout.", + "format": "int32" + }, + "topImageOffset": { + "type": "integer", + "description": "The difference between the top position of the cover image and the actual displayed cover image. Only valid for banner layout.", + "format": "int32" + } + } + }, + "coverPhoto": { + "type": "object", + "description": "The person's primary cover image.", + "properties": { + "height": { + "type": "integer", + "description": "The height of the image.", + "format": "int32" + }, + "url": { + "type": "string", + "description": "The URL of the image." + }, + "width": { + "type": "integer", + "description": "The width of the image.", + "format": "int32" + } + } + }, + "layout": { + "type": "string", + "description": "The layout of the cover art. Possible values include, but are not limited to, the following values: \n- \"banner\" - One large image banner." + } + } + }, + "currentLocation": { + "type": "string", + "description": "The current location for this person." + }, + "displayName": { + "type": "string", + "description": "The name of this person, which is suitable for display." + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "gender": { + "type": "string", + "description": "The person's gender. Possible values include, but are not limited to, the following values: \n- \"male\" - Male gender. \n- \"female\" - Female gender. \n- \"other\" - Other." + }, + "id": { + "type": "string", + "description": "The ID of this person." + }, + "image": { + "type": "object", + "description": "The representation of the person's profile photo.", + "properties": { + "url": { + "type": "string", + "description": "The URL of the person's profile photo. To resize the image and crop it to a square, append the query string ?sz=x, where x is the dimension in pixels of each side." + } + } + }, + "isPlusUser": { + "type": "boolean", + "description": "Whether this user has signed up for Google+." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a person. Value: \"plus#person\".", + "default": "plus#person" + }, + "name": { + "type": "object", + "description": "An object representation of the individual components of a person's name.", + "properties": { + "familyName": { + "type": "string", + "description": "The family name (last name) of this person." + }, + "formatted": { + "type": "string", + "description": "The full name of this person, including middle names, suffixes, etc." + }, + "givenName": { + "type": "string", + "description": "The given name (first name) of this person." + }, + "honorificPrefix": { + "type": "string", + "description": "The honorific prefixes (such as \"Dr.\" or \"Mrs.\") for this person." + }, + "honorificSuffix": { + "type": "string", + "description": "The honorific suffixes (such as \"Jr.\") for this person." + }, + "middleName": { + "type": "string", + "description": "The middle name of this person." + } + } + }, + "nickname": { + "type": "string", + "description": "The nickname of this person." + }, + "objectType": { + "type": "string", + "description": "Type of person within Google+. Possible values include, but are not limited to, the following values: \n- \"person\" - represents an actual person. \n- \"page\" - represents a page." + }, + "organizations": { + "type": "array", + "description": "A list of current or past organizations with which this person is associated.", + "items": { + "type": "object", + "properties": { + "department": { + "type": "string", + "description": "The department within the organization. Deprecated." + }, + "description": { + "type": "string", + "description": "A short description of the person's role in this organization. Deprecated." + }, + "endDate": { + "type": "string", + "description": "The date that the person left this organization." + }, + "location": { + "type": "string", + "description": "The location of this organization. Deprecated." + }, + "name": { + "type": "string", + "description": "The name of the organization." + }, + "primary": { + "type": "boolean", + "description": "If \"true\", indicates this organization is the person's primary one, which is typically interpreted as the current one." + }, + "startDate": { + "type": "string", + "description": "The date that the person joined this organization." + }, + "title": { + "type": "string", + "description": "The person's job title or role within the organization." + }, + "type": { + "type": "string", + "description": "The type of organization. Possible values include, but are not limited to, the following values: \n- \"work\" - Work. \n- \"school\" - School." + } + } + } + }, + "placesLived": { + "type": "array", + "description": "A list of places where this person has lived.", + "items": { + "type": "object", + "properties": { + "primary": { + "type": "boolean", + "description": "If \"true\", this place of residence is this person's primary residence." + }, + "value": { + "type": "string", + "description": "A place where this person has lived. For example: \"Seattle, WA\", \"Near Toronto\"." + } + } + } + }, + "plusOneCount": { + "type": "integer", + "description": "If a Google+ Page, the number of people who have +1'd this page.", + "format": "int32" + }, + "relationshipStatus": { + "type": "string", + "description": "The person's relationship status. Possible values include, but are not limited to, the following values: \n- \"single\" - Person is single. \n- \"in_a_relationship\" - Person is in a relationship. \n- \"engaged\" - Person is engaged. \n- \"married\" - Person is married. \n- \"its_complicated\" - The relationship is complicated. \n- \"open_relationship\" - Person is in an open relationship. \n- \"widowed\" - Person is widowed. \n- \"in_domestic_partnership\" - Person is in a domestic partnership. \n- \"in_civil_union\" - Person is in a civil union." + }, + "tagline": { + "type": "string", + "description": "The brief description (tagline) of this person." + }, + "url": { + "type": "string", + "description": "The URL of this person's profile." + }, + "urls": { + "type": "array", + "description": "A list of URLs for this person.", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "The label of the URL." + }, + "type": { + "type": "string", + "description": "The type of URL. Possible values include, but are not limited to, the following values: \n- \"otherProfile\" - URL for another profile. \n- \"contributor\" - URL to a site for which this person is a contributor. \n- \"website\" - URL for this Google+ Page's primary website. \n- \"other\" - Other URL." + }, + "value": { + "type": "string", + "description": "The URL value." + } + } + } + }, + "verified": { + "type": "boolean", + "description": "Whether the person or Google+ Page has been verified." + } + } + }, + "Place": { + "id": "Place", + "type": "object", + "properties": { + "address": { + "type": "object", + "description": "The physical address of the place.", + "properties": { + "formatted": { + "type": "string", + "description": "The formatted address for display." + } + } + }, + "displayName": { + "type": "string", + "description": "The display name of the place." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a place. Value: \"plus#place\".", + "default": "plus#place" + }, + "position": { + "type": "object", + "description": "The position of the place.", + "properties": { + "latitude": { + "type": "number", + "description": "The latitude of this position.", + "format": "double" + }, + "longitude": { + "type": "number", + "description": "The longitude of this position.", + "format": "double" + } + } + } + } + }, + "PlusAclentryResource": { + "id": "PlusAclentryResource", + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "A descriptive name for this entry. Suitable for display." + }, + "id": { + "type": "string", + "description": "The ID of the entry. For entries of type \"person\" or \"circle\", this is the ID of the resource. For other types, this property is not set." + }, + "type": { + "type": "string", + "description": "The type of entry describing to whom access is granted. Possible values are: \n- \"person\" - Access to an individual. \n- \"circle\" - Access to members of a circle. \n- \"myCircles\" - Access to members of all the person's circles. \n- \"extendedCircles\" - Access to members of all the person's circles, plus all of the people in their circles. \n- \"domain\" - Access to members of the person's Google Apps domain. \n- \"public\" - Access to anyone on the web." + } + } + }, + "Videostream": { + "id": "Videostream", + "type": "object", + "properties": { + "height": { + "type": "integer", + "description": "The height, in pixels, of the video resource.", + "format": "int32" + }, + "type": { + "type": "string", + "description": "MIME type of the video stream." + }, + "url": { + "type": "string", + "description": "URL of the video stream." + }, + "width": { + "type": "integer", + "description": "The width, in pixels, of the video resource.", + "format": "int32" + } + } + } + }, + "resources": { + "activities": { + "methods": { + "get": { + "id": "plus.activities.get", + "path": "activities/{activityId}", + "httpMethod": "GET", + "description": "Get an activity.", + "parameters": { + "activityId": { + "type": "string", + "description": "The ID of the activity to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "activityId" + ], + "response": { + "$ref": "Activity" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me", + "https://www.googleapis.com/auth/plus.stream.read" + ] + }, + "insert": { + "id": "plus.activities.insert", + "path": "people/{userId}/activities", + "httpMethod": "POST", + "description": "Create a new activity for the authenticated user.", + "parameters": { + "preview": { + "type": "boolean", + "description": "If \"true\", extract the potential media attachments for a URL. The response will include all possible attachments for a URL, including video, photos, and articles based on the content of the page.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user to create the activity on behalf of. Its value should be \"me\", to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "request": { + "$ref": "Activity" + }, + "response": { + "$ref": "Activity" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me", + "https://www.googleapis.com/auth/plus.stream.write" + ] + }, + "list": { + "id": "plus.activities.list", + "path": "people/{userId}/activities/{collection}", + "httpMethod": "GET", + "description": "List all of the activities in the specified collection for a particular user.", + "parameters": { + "collection": { + "type": "string", + "description": "The collection of activities to list.", + "required": true, + "enum": [ + "user" + ], + "enumDescriptions": [ + "All activities created by the specified user that the authenticated user is authorized to view." + ], + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user to get activities for. The special value \"me\" can be used to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "collection" + ], + "response": { + "$ref": "ActivityFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me", + "https://www.googleapis.com/auth/plus.stream.read" + ] + } + } + }, + "audiences": { + "methods": { + "list": { + "id": "plus.audiences.list", + "path": "people/{userId}/audiences", + "httpMethod": "GET", + "description": "List all of the audiences to which a user can share.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of circles to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user to get audiences for. The special value \"me\" can be used to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "AudiencesFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.read", + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me" + ] + } + } + }, + "circles": { + "methods": { + "addPeople": { + "id": "plus.circles.addPeople", + "path": "circles/{circleId}/people", + "httpMethod": "PUT", + "description": "Add a person to a circle. Google+ limits certain circle operations, including the number of circle adds. Learn More.", + "parameters": { + "circleId": { + "type": "string", + "description": "The ID of the circle to add the person to.", + "required": true, + "location": "path" + }, + "email": { + "type": "string", + "description": "Email of the people to add to the circle. Optional, can be repeated.", + "repeated": true, + "location": "query" + }, + "userId": { + "type": "string", + "description": "IDs of the people to add to the circle. Optional, can be repeated.", + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "circleId" + ], + "response": { + "$ref": "Circle" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.write", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "get": { + "id": "plus.circles.get", + "path": "circles/{circleId}", + "httpMethod": "GET", + "description": "Get a circle.", + "parameters": { + "circleId": { + "type": "string", + "description": "The ID of the circle to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "circleId" + ], + "response": { + "$ref": "Circle" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.read", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "insert": { + "id": "plus.circles.insert", + "path": "people/{userId}/circles", + "httpMethod": "POST", + "description": "Create a new circle for the authenticated user.", + "parameters": { + "userId": { + "type": "string", + "description": "The ID of the user to create the circle on behalf of. The value \"me\" can be used to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "request": { + "$ref": "Circle" + }, + "response": { + "$ref": "Circle" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.write", + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me" + ] + }, + "list": { + "id": "plus.circles.list", + "path": "people/{userId}/circles", + "httpMethod": "GET", + "description": "List all of the circles for a user.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of circles to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user to get circles for. The special value \"me\" can be used to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "CircleFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.read", + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me" + ] + }, + "patch": { + "id": "plus.circles.patch", + "path": "circles/{circleId}", + "httpMethod": "PATCH", + "description": "Update a circle's description. This method supports patch semantics.", + "parameters": { + "circleId": { + "type": "string", + "description": "The ID of the circle to update.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "circleId" + ], + "request": { + "$ref": "Circle" + }, + "response": { + "$ref": "Circle" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.write", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "remove": { + "id": "plus.circles.remove", + "path": "circles/{circleId}", + "httpMethod": "DELETE", + "description": "Delete a circle.", + "parameters": { + "circleId": { + "type": "string", + "description": "The ID of the circle to delete.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "circleId" + ], + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.write", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "removePeople": { + "id": "plus.circles.removePeople", + "path": "circles/{circleId}/people", + "httpMethod": "DELETE", + "description": "Remove a person from a circle.", + "parameters": { + "circleId": { + "type": "string", + "description": "The ID of the circle to remove the person from.", + "required": true, + "location": "path" + }, + "email": { + "type": "string", + "description": "Email of the people to add to the circle. Optional, can be repeated.", + "repeated": true, + "location": "query" + }, + "userId": { + "type": "string", + "description": "IDs of the people to remove from the circle. Optional, can be repeated.", + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "circleId" + ], + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.write", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "update": { + "id": "plus.circles.update", + "path": "circles/{circleId}", + "httpMethod": "PUT", + "description": "Update a circle's description.", + "parameters": { + "circleId": { + "type": "string", + "description": "The ID of the circle to update.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "circleId" + ], + "request": { + "$ref": "Circle" + }, + "response": { + "$ref": "Circle" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.write", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + }, + "comments": { + "methods": { + "get": { + "id": "plus.comments.get", + "path": "comments/{commentId}", + "httpMethod": "GET", + "description": "Get a comment.", + "parameters": { + "commentId": { + "type": "string", + "description": "The ID of the comment to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "commentId" + ], + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.stream.read" + ] + }, + "insert": { + "id": "plus.comments.insert", + "path": "activities/{activityId}/comments", + "httpMethod": "POST", + "description": "Create a new comment in reply to an activity.", + "parameters": { + "activityId": { + "type": "string", + "description": "The ID of the activity to reply to.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "activityId" + ], + "request": { + "$ref": "Comment" + }, + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.stream.write" + ] + }, + "list": { + "id": "plus.comments.list", + "path": "activities/{activityId}/comments", + "httpMethod": "GET", + "description": "List all of the comments for an activity.", + "parameters": { + "activityId": { + "type": "string", + "description": "The ID of the activity to get comments for.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of comments to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "The order in which to sort the list of comments.", + "default": "ascending", + "enum": [ + "ascending", + "descending" + ], + "enumDescriptions": [ + "Sort oldest comments first.", + "Sort newest comments first." + ], + "location": "query" + } + }, + "parameterOrder": [ + "activityId" + ], + "response": { + "$ref": "CommentFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.stream.read" + ] + } + } + }, + "media": { + "methods": { + "insert": { + "id": "plus.media.insert", + "path": "people/{userId}/media/{collection}", + "httpMethod": "POST", + "description": "Add a new media item to an album. The current upload size limitations are 36MB for a photo and 1GB for a video. Uploads do not count against quota if photos are less than 2048 pixels on their longest side or videos are less than 15 minutes in length.", + "parameters": { + "collection": { + "type": "string", + "required": true, + "enum": [ + "cloud" + ], + "enumDescriptions": [ + "Upload the media to share on Google+." + ], + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user to create the activity on behalf of.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "collection" + ], + "request": { + "$ref": "Media" + }, + "response": { + "$ref": "Media" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.media.upload" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "image/*", + "video/*" + ], + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/plus/v1domains/people/{userId}/media/{collection}" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/plus/v1domains/people/{userId}/media/{collection}" + } + } + } + } + } + }, + "people": { + "methods": { + "get": { + "id": "plus.people.get", + "path": "people/{userId}", + "httpMethod": "GET", + "description": "Get a person's profile.", + "parameters": { + "userId": { + "type": "string", + "description": "The ID of the person to get the profile for. The special value \"me\" can be used to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "Person" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me", + "https://www.googleapis.com/auth/plus.profiles.read" + ] + }, + "list": { + "id": "plus.people.list", + "path": "people/{userId}/people/{collection}", + "httpMethod": "GET", + "description": "List all of the people in the specified collection.", + "parameters": { + "collection": { + "type": "string", + "description": "The collection of people to list.", + "required": true, + "enum": [ + "circled" + ], + "enumDescriptions": [ + "The list of people who this user has added to one or more circles." + ], + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "100", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "The order to return people in.", + "enum": [ + "alphabetical", + "best" + ], + "enumDescriptions": [ + "Order the people by their display name.", + "Order people based on the relevence to the viewer." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "Get the collection of people for the person identified. Use \"me\" to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "collection" + ], + "response": { + "$ref": "PeopleFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.read", + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me" + ] + }, + "listByActivity": { + "id": "plus.people.listByActivity", + "path": "activities/{activityId}/people/{collection}", + "httpMethod": "GET", + "description": "List all of the people in the specified collection for a particular activity.", + "parameters": { + "activityId": { + "type": "string", + "description": "The ID of the activity to get the list of people for.", + "required": true, + "location": "path" + }, + "collection": { + "type": "string", + "description": "The collection of people to list.", + "required": true, + "enum": [ + "plusoners", + "resharers", + "sharedto" + ], + "enumDescriptions": [ + "List all people who have +1'd this activity.", + "List all people who have reshared this activity.", + "List all people who this activity was shared to." + ], + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "activityId", + "collection" + ], + "response": { + "$ref": "PeopleFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.stream.read" + ] + }, + "listByCircle": { + "id": "plus.people.listByCircle", + "path": "circles/{circleId}/people", + "httpMethod": "GET", + "description": "List all of the people who are members of a circle.", + "parameters": { + "circleId": { + "type": "string", + "description": "The ID of the circle to get the members of.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "circleId" + ], + "response": { + "$ref": "PeopleFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.read", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/plus/v1domains/plus-gen.go b/third_party/src/code.google.com/p/google-api-go-client/plus/v1domains/plus-gen.go new file mode 100644 index 0000000000000..f35ef3e084b3a --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/plus/v1domains/plus-gen.go @@ -0,0 +1,3029 @@ +// Package plus provides access to the Google+ API. +// +// See https://developers.google.com/+/api/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/plus/v1domains" +// ... +// plusService, err := plus.New(oauthHttpClient) +package plus + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "plus:v1domains" +const apiName = "plus" +const apiVersion = "v1domains" +const basePath = "https://www.googleapis.com/plus/v1domains/" + +// OAuth2 scopes used by this API. +const ( + // View your circles and people in them + PlusCirclesReadScope = "https://www.googleapis.com/auth/plus.circles.read" + + // Manage your circles and add people + PlusCirclesWriteScope = "https://www.googleapis.com/auth/plus.circles.write" + + // Know your name, basic info, and list of people you're connected to on + // Google+ + PlusLoginScope = "https://www.googleapis.com/auth/plus.login" + + // Know who you are on Google + PlusMeScope = "https://www.googleapis.com/auth/plus.me" + + // Send your photos and videos to Google+ + PlusMediaUploadScope = "https://www.googleapis.com/auth/plus.media.upload" + + // View your own Google+ profile and profiles shared with you + PlusProfilesReadScope = "https://www.googleapis.com/auth/plus.profiles.read" + + // View your posts, comments, and stream + PlusStreamReadScope = "https://www.googleapis.com/auth/plus.stream.read" + + // Manage your posts, comments, and stream + PlusStreamWriteScope = "https://www.googleapis.com/auth/plus.stream.write" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client} + s.Activities = NewActivitiesService(s) + s.Audiences = NewAudiencesService(s) + s.Circles = NewCirclesService(s) + s.Comments = NewCommentsService(s) + s.Media = NewMediaService(s) + s.People = NewPeopleService(s) + return s, nil +} + +type Service struct { + client *http.Client + + Activities *ActivitiesService + + Audiences *AudiencesService + + Circles *CirclesService + + Comments *CommentsService + + Media *MediaService + + People *PeopleService +} + +func NewActivitiesService(s *Service) *ActivitiesService { + rs := &ActivitiesService{s: s} + return rs +} + +type ActivitiesService struct { + s *Service +} + +func NewAudiencesService(s *Service) *AudiencesService { + rs := &AudiencesService{s: s} + return rs +} + +type AudiencesService struct { + s *Service +} + +func NewCirclesService(s *Service) *CirclesService { + rs := &CirclesService{s: s} + return rs +} + +type CirclesService struct { + s *Service +} + +func NewCommentsService(s *Service) *CommentsService { + rs := &CommentsService{s: s} + return rs +} + +type CommentsService struct { + s *Service +} + +func NewMediaService(s *Service) *MediaService { + rs := &MediaService{s: s} + return rs +} + +type MediaService struct { + s *Service +} + +func NewPeopleService(s *Service) *PeopleService { + rs := &PeopleService{s: s} + return rs +} + +type PeopleService struct { + s *Service +} + +type Acl struct { + // Description: Description of the access granted, suitable for display. + Description string `json:"description,omitempty"` + + // DomainRestricted: Whether access is restricted to the domain. + DomainRestricted bool `json:"domainRestricted,omitempty"` + + // Items: The list of access entries. + Items []*PlusAclentryResource `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of access controls. + // Value: "plus#acl". + Kind string `json:"kind,omitempty"` +} + +type Activity struct { + // Access: Identifies who has access to see this activity. + Access *Acl `json:"access,omitempty"` + + // Actor: The person who performed this activity. + Actor *ActivityActor `json:"actor,omitempty"` + + // Address: Street address where this activity occurred. + Address string `json:"address,omitempty"` + + // Annotation: Additional content added by the person who shared this + // activity, applicable only when resharing an activity. + Annotation string `json:"annotation,omitempty"` + + // CrosspostSource: If this activity is a crosspost from another system, + // this property specifies the ID of the original activity. + CrosspostSource string `json:"crosspostSource,omitempty"` + + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Geocode: Latitude and longitude where this activity occurred. Format + // is latitude followed by longitude, space separated. + Geocode string `json:"geocode,omitempty"` + + // Id: The ID of this activity. + Id string `json:"id,omitempty"` + + // Kind: Identifies this resource as an activity. Value: + // "plus#activity". + Kind string `json:"kind,omitempty"` + + // Location: The location where this activity occurred. + Location *Place `json:"location,omitempty"` + + // Object: The object of this activity. + Object *ActivityObject `json:"object,omitempty"` + + // PlaceId: ID of the place where this activity occurred. + PlaceId string `json:"placeId,omitempty"` + + // PlaceName: Name of the place where this activity occurred. + PlaceName string `json:"placeName,omitempty"` + + // Provider: The service provider that initially published this + // activity. + Provider *ActivityProvider `json:"provider,omitempty"` + + // Published: The time at which this activity was initially published. + // Formatted as an RFC 3339 timestamp. + Published string `json:"published,omitempty"` + + // Radius: Radius, in meters, of the region where this activity + // occurred, centered at the latitude and longitude identified in + // geocode. + Radius string `json:"radius,omitempty"` + + // Title: Title of this activity. + Title string `json:"title,omitempty"` + + // Updated: The time at which this activity was last updated. Formatted + // as an RFC 3339 timestamp. + Updated string `json:"updated,omitempty"` + + // Url: The link to this activity. + Url string `json:"url,omitempty"` + + // Verb: This activity's verb, which indicates the action that was + // performed. Possible values include, but are not limited to, the + // following values: + // - "post" - Publish content to the stream. + // - + // "share" - Reshare an activity. + Verb string `json:"verb,omitempty"` +} + +type ActivityActor struct { + // DisplayName: The name of the actor, suitable for display. + DisplayName string `json:"displayName,omitempty"` + + // Id: The ID of the actor's Person resource. + Id string `json:"id,omitempty"` + + // Image: The image representation of the actor. + Image *ActivityActorImage `json:"image,omitempty"` + + // Name: An object representation of the individual components of name. + Name *ActivityActorName `json:"name,omitempty"` + + // Url: The link to the actor's Google profile. + Url string `json:"url,omitempty"` +} + +type ActivityActorImage struct { + // Url: The URL of the actor's profile photo. To resize the image and + // crop it to a square, append the query string ?sz=x, where x is the + // dimension in pixels of each side. + Url string `json:"url,omitempty"` +} + +type ActivityActorName struct { + // FamilyName: The family name ("last name") of the actor. + FamilyName string `json:"familyName,omitempty"` + + // GivenName: The given name ("first name") of the actor. + GivenName string `json:"givenName,omitempty"` +} + +type ActivityObject struct { + // Actor: If this activity's object is itself another activity, such as + // when a person reshares an activity, this property specifies the + // original activity's actor. + Actor *ActivityObjectActor `json:"actor,omitempty"` + + // Attachments: The media objects attached to this activity. + Attachments []*ActivityObjectAttachments `json:"attachments,omitempty"` + + // Content: The HTML-formatted content, which is suitable for display. + Content string `json:"content,omitempty"` + + // Id: The ID of the object. When resharing an activity, this is the ID + // of the activity that is being reshared. + Id string `json:"id,omitempty"` + + // ObjectType: The type of the object. Possible values include, but are + // not limited to, the following values: + // - "note" - Textual content. + // + // - "activity" - A Google+ activity. + ObjectType string `json:"objectType,omitempty"` + + // OriginalContent: The content (text) as provided by the author, which + // is stored without any HTML formatting. When creating or updating an + // activity, this value must be supplied as plain text in the request. + OriginalContent string `json:"originalContent,omitempty"` + + // Plusoners: People who +1'd this activity. + Plusoners *ActivityObjectPlusoners `json:"plusoners,omitempty"` + + // Replies: Comments in reply to this activity. + Replies *ActivityObjectReplies `json:"replies,omitempty"` + + // Resharers: People who reshared this activity. + Resharers *ActivityObjectResharers `json:"resharers,omitempty"` + + // StatusForViewer: Status of the activity as seen by the viewer. + StatusForViewer *ActivityObjectStatusForViewer `json:"statusForViewer,omitempty"` + + // Url: The URL that points to the linked resource. + Url string `json:"url,omitempty"` +} + +type ActivityObjectActor struct { + // DisplayName: The original actor's name, which is suitable for + // display. + DisplayName string `json:"displayName,omitempty"` + + // Id: ID of the original actor. + Id string `json:"id,omitempty"` + + // Image: The image representation of the original actor. + Image *ActivityObjectActorImage `json:"image,omitempty"` + + // Url: A link to the original actor's Google profile. + Url string `json:"url,omitempty"` +} + +type ActivityObjectActorImage struct { + // Url: A URL that points to a thumbnail photo of the original actor. + Url string `json:"url,omitempty"` +} + +type ActivityObjectAttachments struct { + // Content: If the attachment is an article, this property contains a + // snippet of text from the article. It can also include descriptions + // for other types. + Content string `json:"content,omitempty"` + + // DisplayName: The title of the attachment, such as a photo caption or + // an article title. + DisplayName string `json:"displayName,omitempty"` + + // Embed: If the attachment is a video, the embeddable link. + Embed *ActivityObjectAttachmentsEmbed `json:"embed,omitempty"` + + // FullImage: The full image URL for photo attachments. + FullImage *ActivityObjectAttachmentsFullImage `json:"fullImage,omitempty"` + + // Id: The ID of the attachment. + Id string `json:"id,omitempty"` + + // Image: The preview image for photos or videos. + Image *ActivityObjectAttachmentsImage `json:"image,omitempty"` + + // ObjectType: The type of media object. Possible values include, but + // are not limited to, the following values: + // - "photo" - A photo. + // - + // "album" - A photo album. + // - "video" - A video. + // - "article" - An + // article, specified by a link. + ObjectType string `json:"objectType,omitempty"` + + // PreviewThumbnails: When previewing, these are the optional thumbnails + // for the post. When posting an article, choose one by setting the + // attachment.image.url property. If you don't choose one, one will be + // chosen for you. + PreviewThumbnails []*ActivityObjectAttachmentsPreviewThumbnails `json:"previewThumbnails,omitempty"` + + // Thumbnails: If the attachment is an album, this property is a list of + // potential additional thumbnails from the album. + Thumbnails []*ActivityObjectAttachmentsThumbnails `json:"thumbnails,omitempty"` + + // Url: The link to the attachment; should be of type text/html. + Url string `json:"url,omitempty"` +} + +type ActivityObjectAttachmentsEmbed struct { + // Type: Media type of the link. + Type string `json:"type,omitempty"` + + // Url: URL of the link. + Url string `json:"url,omitempty"` +} + +type ActivityObjectAttachmentsFullImage struct { + // Height: The height, in pixels, of the linked resource. + Height int64 `json:"height,omitempty"` + + // Type: Media type of the link. + Type string `json:"type,omitempty"` + + // Url: URL of the image. + Url string `json:"url,omitempty"` + + // Width: The width, in pixels, of the linked resource. + Width int64 `json:"width,omitempty"` +} + +type ActivityObjectAttachmentsImage struct { + // Height: The height, in pixels, of the linked resource. + Height int64 `json:"height,omitempty"` + + // Type: Media type of the link. + Type string `json:"type,omitempty"` + + // Url: Image URL. + Url string `json:"url,omitempty"` + + // Width: The width, in pixels, of the linked resource. + Width int64 `json:"width,omitempty"` +} + +type ActivityObjectAttachmentsPreviewThumbnails struct { + // Url: URL of the thumbnail image. + Url string `json:"url,omitempty"` +} + +type ActivityObjectAttachmentsThumbnails struct { + // Description: Potential name of the thumbnail. + Description string `json:"description,omitempty"` + + // Image: Image resource. + Image *ActivityObjectAttachmentsThumbnailsImage `json:"image,omitempty"` + + // Url: URL of the webpage containing the image. + Url string `json:"url,omitempty"` +} + +type ActivityObjectAttachmentsThumbnailsImage struct { + // Height: The height, in pixels, of the linked resource. + Height int64 `json:"height,omitempty"` + + // Type: Media type of the link. + Type string `json:"type,omitempty"` + + // Url: Image url. + Url string `json:"url,omitempty"` + + // Width: The width, in pixels, of the linked resource. + Width int64 `json:"width,omitempty"` +} + +type ActivityObjectPlusoners struct { + // SelfLink: The URL for the collection of people who +1'd this + // activity. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: Total number of people who +1'd this activity. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type ActivityObjectReplies struct { + // SelfLink: The URL for the collection of comments in reply to this + // activity. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: Total number of comments on this activity. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type ActivityObjectResharers struct { + // SelfLink: The URL for the collection of resharers. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: Total number of people who reshared this activity. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type ActivityObjectStatusForViewer struct { + // CanComment: Whether the viewer can comment on the activity. + CanComment bool `json:"canComment,omitempty"` + + // CanPlusone: Whether the viewer can +1 the activity. + CanPlusone bool `json:"canPlusone,omitempty"` + + // IsPlusOned: Whether the viewer has +1'd the activity. + IsPlusOned bool `json:"isPlusOned,omitempty"` + + // ResharingDisabled: Whether reshares are disabled for the activity. + ResharingDisabled bool `json:"resharingDisabled,omitempty"` +} + +type ActivityProvider struct { + // Title: Name of the service provider. + Title string `json:"title,omitempty"` +} + +type ActivityFeed struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Id: The ID of this collection of activities. Deprecated. + Id string `json:"id,omitempty"` + + // Items: The activities in this page of results. + Items []*Activity `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of activities. Value: + // "plus#activityFeed". + Kind string `json:"kind,omitempty"` + + // NextLink: Link to the next page of activities. + NextLink string `json:"nextLink,omitempty"` + + // NextPageToken: The continuation token, which is used to page through + // large result sets. Provide this value in a subsequent request to + // return the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Link to this activities resource. + SelfLink string `json:"selfLink,omitempty"` + + // Title: The title of this collection of activities, which is a + // truncated portion of the content. + Title string `json:"title,omitempty"` + + // Updated: The time at which this collection of activities was last + // updated. Formatted as an RFC 3339 timestamp. + Updated string `json:"updated,omitempty"` +} + +type Audience struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Item: The access control list entry. + Item *PlusAclentryResource `json:"item,omitempty"` + + // Kind: Identifies this resource as an audience. Value: + // "plus#audience". + Kind string `json:"kind,omitempty"` + + // Visibility: The circle members' visibility as chosen by the owner of + // the circle. This only applies for items with "item.type" equals + // "circle". Possible values are: + // - "public" - Members are visible to + // the public. + // - "limited" - Members are visible to a limited audience. + // + // - "private" - Members are visible to the owner only. + Visibility string `json:"visibility,omitempty"` +} + +type AudiencesFeed struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The audiences in this result. + Items []*Audience `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of audiences. Value: + // "plus#audienceFeed". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The continuation token, which is used to page through + // large result sets. Provide this value in a subsequent request to + // return the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TotalItems: The total number of ACL entries. The number of entries in + // this response may be smaller due to paging. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type Circle struct { + // Description: The description of this circle. + Description string `json:"description,omitempty"` + + // DisplayName: The circle name. + DisplayName string `json:"displayName,omitempty"` + + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Id: The ID of the circle. + Id string `json:"id,omitempty"` + + // Kind: Identifies this resource as a circle. Value: "plus#circle". + Kind string `json:"kind,omitempty"` + + // People: The people in this circle. + People *CirclePeople `json:"people,omitempty"` + + // SelfLink: Link to this circle resource + SelfLink string `json:"selfLink,omitempty"` +} + +type CirclePeople struct { + // TotalItems: The total number of people in this circle. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type CircleFeed struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The circles in this page of results. + Items []*Circle `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of circles. Value: + // "plus#circleFeed". + Kind string `json:"kind,omitempty"` + + // NextLink: Link to the next page of circles. + NextLink string `json:"nextLink,omitempty"` + + // NextPageToken: The continuation token, which is used to page through + // large result sets. Provide this value in a subsequent request to + // return the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Link to this page of circles. + SelfLink string `json:"selfLink,omitempty"` + + // Title: The title of this list of resources. + Title string `json:"title,omitempty"` + + // TotalItems: The total number of circles. The number of circles in + // this response may be smaller due to paging. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type Comment struct { + // Actor: The person who posted this comment. + Actor *CommentActor `json:"actor,omitempty"` + + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Id: The ID of this comment. + Id string `json:"id,omitempty"` + + // InReplyTo: The activity this comment replied to. + InReplyTo []*CommentInReplyTo `json:"inReplyTo,omitempty"` + + // Kind: Identifies this resource as a comment. Value: "plus#comment". + Kind string `json:"kind,omitempty"` + + // Object: The object of this comment. + Object *CommentObject `json:"object,omitempty"` + + // Plusoners: People who +1'd this comment. + Plusoners *CommentPlusoners `json:"plusoners,omitempty"` + + // Published: The time at which this comment was initially published. + // Formatted as an RFC 3339 timestamp. + Published string `json:"published,omitempty"` + + // SelfLink: Link to this comment resource. + SelfLink string `json:"selfLink,omitempty"` + + // Updated: The time at which this comment was last updated. Formatted + // as an RFC 3339 timestamp. + Updated string `json:"updated,omitempty"` + + // Verb: This comment's verb, indicating what action was performed. + // Possible values are: + // - "post" - Publish content to the stream. + Verb string `json:"verb,omitempty"` +} + +type CommentActor struct { + // DisplayName: The name of this actor, suitable for display. + DisplayName string `json:"displayName,omitempty"` + + // Id: The ID of the actor. + Id string `json:"id,omitempty"` + + // Image: The image representation of this actor. + Image *CommentActorImage `json:"image,omitempty"` + + // Url: A link to the Person resource for this actor. + Url string `json:"url,omitempty"` +} + +type CommentActorImage struct { + // Url: The URL of the actor's profile photo. To resize the image and + // crop it to a square, append the query string ?sz=x, where x is the + // dimension in pixels of each side. + Url string `json:"url,omitempty"` +} + +type CommentInReplyTo struct { + // Id: The ID of the activity. + Id string `json:"id,omitempty"` + + // Url: The URL of the activity. + Url string `json:"url,omitempty"` +} + +type CommentObject struct { + // Content: The HTML-formatted content, suitable for display. + Content string `json:"content,omitempty"` + + // ObjectType: The object type of this comment. Possible values are: + // - + // "comment" - A comment in reply to an activity. + ObjectType string `json:"objectType,omitempty"` + + // OriginalContent: The content (text) as provided by the author, stored + // without any HTML formatting. When creating or updating a comment, + // this value must be supplied as plain text in the request. + OriginalContent string `json:"originalContent,omitempty"` +} + +type CommentPlusoners struct { + // TotalItems: Total number of people who +1'd this comment. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type CommentFeed struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Id: The ID of this collection of comments. + Id string `json:"id,omitempty"` + + // Items: The comments in this page of results. + Items []*Comment `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of comments. Value: + // "plus#commentFeed". + Kind string `json:"kind,omitempty"` + + // NextLink: Link to the next page of activities. + NextLink string `json:"nextLink,omitempty"` + + // NextPageToken: The continuation token, which is used to page through + // large result sets. Provide this value in a subsequent request to + // return the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Title: The title of this collection of comments. + Title string `json:"title,omitempty"` + + // Updated: The time at which this collection of comments was last + // updated. Formatted as an RFC 3339 timestamp. + Updated string `json:"updated,omitempty"` +} + +type Media struct { + // Author: The person who uploaded this media. + Author *MediaAuthor `json:"author,omitempty"` + + // DisplayName: The display name for this media. + DisplayName string `json:"displayName,omitempty"` + + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Exif: Exif information of the media item. + Exif *MediaExif `json:"exif,omitempty"` + + // Height: The height in pixels of the original image. + Height int64 `json:"height,omitempty"` + + // Id: ID of this media, which is generated by the API. + Id string `json:"id,omitempty"` + + // Kind: The type of resource. + Kind string `json:"kind,omitempty"` + + // MediaUrl: The URL of this photo or video's still image. + MediaUrl string `json:"mediaUrl,omitempty"` + + // Published: The time at which this media was uploaded. Formatted as an + // RFC 3339 timestamp. + Published string `json:"published,omitempty"` + + // SizeBytes: The size in bytes of this video. + SizeBytes int64 `json:"sizeBytes,omitempty,string"` + + // Streams: The list of video streams for this video. There might be + // several different streams available for a single video, either Flash + // or MPEG, of various sizes + Streams []*Videostream `json:"streams,omitempty"` + + // Summary: A description, or caption, for this media. + Summary string `json:"summary,omitempty"` + + // Updated: The time at which this media was last updated. This includes + // changes to media metadata. Formatted as an RFC 3339 timestamp. + Updated string `json:"updated,omitempty"` + + // Url: The URL for the page that hosts this media. + Url string `json:"url,omitempty"` + + // VideoDuration: The duration in milliseconds of this video. + VideoDuration int64 `json:"videoDuration,omitempty,string"` + + // VideoStatus: The encoding status of this video. Possible values are: + // + // - "PENDING" - Video not yet processed. + // - "FAILED" - Video + // processing failed. + // - "READY" - A single video stream is playable. + // - + // "FINAL" - All video streams are playable. + VideoStatus string `json:"videoStatus,omitempty"` + + // Width: The width in pixels of the original image. + Width int64 `json:"width,omitempty"` +} + +type MediaAuthor struct { + // DisplayName: The author's name. + DisplayName string `json:"displayName,omitempty"` + + // Id: ID of the author. + Id string `json:"id,omitempty"` + + // Image: The author's Google profile image. + Image *MediaAuthorImage `json:"image,omitempty"` + + // Url: A link to the author's Google profile. + Url string `json:"url,omitempty"` +} + +type MediaAuthorImage struct { + // Url: The URL of the author's profile photo. To resize the image and + // crop it to a square, append the query string ?sz=x, where x is the + // dimension in pixels of each side. + Url string `json:"url,omitempty"` +} + +type MediaExif struct { + // Time: The time the media was captured. Formatted as an RFC 3339 + // timestamp. + Time string `json:"time,omitempty"` +} + +type PeopleFeed struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The people in this page of results. Each item includes the id, + // displayName, image, and url for the person. To retrieve additional + // profile data, see the people.get method. + Items []*Person `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of people. Value: + // "plus#peopleFeed". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The continuation token, which is used to page through + // large result sets. Provide this value in a subsequent request to + // return the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Link to this resource. + SelfLink string `json:"selfLink,omitempty"` + + // Title: The title of this collection of people. + Title string `json:"title,omitempty"` + + // TotalItems: The total number of people available in this list. The + // number of people in a response might be smaller due to paging. This + // might not be set for all collections. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type Person struct { + // AboutMe: A short biography for this person. + AboutMe string `json:"aboutMe,omitempty"` + + // Birthday: The person's date of birth, represented as YYYY-MM-DD. + Birthday string `json:"birthday,omitempty"` + + // BraggingRights: The "bragging rights" line of this person. + BraggingRights string `json:"braggingRights,omitempty"` + + // CircledByCount: If a Google+ Page and for followers who are visible, + // the number of people who have added this page to a circle. + CircledByCount int64 `json:"circledByCount,omitempty"` + + // Cover: The cover photo content. + Cover *PersonCover `json:"cover,omitempty"` + + // CurrentLocation: The current location for this person. + CurrentLocation string `json:"currentLocation,omitempty"` + + // DisplayName: The name of this person, which is suitable for display. + DisplayName string `json:"displayName,omitempty"` + + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Gender: The person's gender. Possible values include, but are not + // limited to, the following values: + // - "male" - Male gender. + // - + // "female" - Female gender. + // - "other" - Other. + Gender string `json:"gender,omitempty"` + + // Id: The ID of this person. + Id string `json:"id,omitempty"` + + // Image: The representation of the person's profile photo. + Image *PersonImage `json:"image,omitempty"` + + // IsPlusUser: Whether this user has signed up for Google+. + IsPlusUser bool `json:"isPlusUser,omitempty"` + + // Kind: Identifies this resource as a person. Value: "plus#person". + Kind string `json:"kind,omitempty"` + + // Name: An object representation of the individual components of a + // person's name. + Name *PersonName `json:"name,omitempty"` + + // Nickname: The nickname of this person. + Nickname string `json:"nickname,omitempty"` + + // ObjectType: Type of person within Google+. Possible values include, + // but are not limited to, the following values: + // - "person" - + // represents an actual person. + // - "page" - represents a page. + ObjectType string `json:"objectType,omitempty"` + + // Organizations: A list of current or past organizations with which + // this person is associated. + Organizations []*PersonOrganizations `json:"organizations,omitempty"` + + // PlacesLived: A list of places where this person has lived. + PlacesLived []*PersonPlacesLived `json:"placesLived,omitempty"` + + // PlusOneCount: If a Google+ Page, the number of people who have +1'd + // this page. + PlusOneCount int64 `json:"plusOneCount,omitempty"` + + // RelationshipStatus: The person's relationship status. Possible values + // include, but are not limited to, the following values: + // - "single" - + // Person is single. + // - "in_a_relationship" - Person is in a + // relationship. + // - "engaged" - Person is engaged. + // - "married" - Person + // is married. + // - "its_complicated" - The relationship is complicated. + // + // - "open_relationship" - Person is in an open relationship. + // - + // "widowed" - Person is widowed. + // - "in_domestic_partnership" - Person + // is in a domestic partnership. + // - "in_civil_union" - Person is in a + // civil union. + RelationshipStatus string `json:"relationshipStatus,omitempty"` + + // Tagline: The brief description (tagline) of this person. + Tagline string `json:"tagline,omitempty"` + + // Url: The URL of this person's profile. + Url string `json:"url,omitempty"` + + // Urls: A list of URLs for this person. + Urls []*PersonUrls `json:"urls,omitempty"` + + // Verified: Whether the person or Google+ Page has been verified. + Verified bool `json:"verified,omitempty"` +} + +type PersonCover struct { + // CoverInfo: Extra information about the cover photo. + CoverInfo *PersonCoverCoverInfo `json:"coverInfo,omitempty"` + + // CoverPhoto: The person's primary cover image. + CoverPhoto *PersonCoverCoverPhoto `json:"coverPhoto,omitempty"` + + // Layout: The layout of the cover art. Possible values include, but are + // not limited to, the following values: + // - "banner" - One large image + // banner. + Layout string `json:"layout,omitempty"` +} + +type PersonCoverCoverInfo struct { + // LeftImageOffset: The difference between the left position of the + // cover image and the actual displayed cover image. Only valid for + // banner layout. + LeftImageOffset int64 `json:"leftImageOffset,omitempty"` + + // TopImageOffset: The difference between the top position of the cover + // image and the actual displayed cover image. Only valid for banner + // layout. + TopImageOffset int64 `json:"topImageOffset,omitempty"` +} + +type PersonCoverCoverPhoto struct { + // Height: The height of the image. + Height int64 `json:"height,omitempty"` + + // Url: The URL of the image. + Url string `json:"url,omitempty"` + + // Width: The width of the image. + Width int64 `json:"width,omitempty"` +} + +type PersonImage struct { + // Url: The URL of the person's profile photo. To resize the image and + // crop it to a square, append the query string ?sz=x, where x is the + // dimension in pixels of each side. + Url string `json:"url,omitempty"` +} + +type PersonName struct { + // FamilyName: The family name (last name) of this person. + FamilyName string `json:"familyName,omitempty"` + + // Formatted: The full name of this person, including middle names, + // suffixes, etc. + Formatted string `json:"formatted,omitempty"` + + // GivenName: The given name (first name) of this person. + GivenName string `json:"givenName,omitempty"` + + // HonorificPrefix: The honorific prefixes (such as "Dr." or "Mrs.") for + // this person. + HonorificPrefix string `json:"honorificPrefix,omitempty"` + + // HonorificSuffix: The honorific suffixes (such as "Jr.") for this + // person. + HonorificSuffix string `json:"honorificSuffix,omitempty"` + + // MiddleName: The middle name of this person. + MiddleName string `json:"middleName,omitempty"` +} + +type PersonOrganizations struct { + // Department: The department within the organization. Deprecated. + Department string `json:"department,omitempty"` + + // Description: A short description of the person's role in this + // organization. Deprecated. + Description string `json:"description,omitempty"` + + // EndDate: The date that the person left this organization. + EndDate string `json:"endDate,omitempty"` + + // Location: The location of this organization. Deprecated. + Location string `json:"location,omitempty"` + + // Name: The name of the organization. + Name string `json:"name,omitempty"` + + // Primary: If "true", indicates this organization is the person's + // primary one, which is typically interpreted as the current one. + Primary bool `json:"primary,omitempty"` + + // StartDate: The date that the person joined this organization. + StartDate string `json:"startDate,omitempty"` + + // Title: The person's job title or role within the organization. + Title string `json:"title,omitempty"` + + // Type: The type of organization. Possible values include, but are not + // limited to, the following values: + // - "work" - Work. + // - "school" - + // School. + Type string `json:"type,omitempty"` +} + +type PersonPlacesLived struct { + // Primary: If "true", this place of residence is this person's primary + // residence. + Primary bool `json:"primary,omitempty"` + + // Value: A place where this person has lived. For example: "Seattle, + // WA", "Near Toronto". + Value string `json:"value,omitempty"` +} + +type PersonUrls struct { + // Label: The label of the URL. + Label string `json:"label,omitempty"` + + // Type: The type of URL. Possible values include, but are not limited + // to, the following values: + // - "otherProfile" - URL for another + // profile. + // - "contributor" - URL to a site for which this person is a + // contributor. + // - "website" - URL for this Google+ Page's primary + // website. + // - "other" - Other URL. + Type string `json:"type,omitempty"` + + // Value: The URL value. + Value string `json:"value,omitempty"` +} + +type Place struct { + // Address: The physical address of the place. + Address *PlaceAddress `json:"address,omitempty"` + + // DisplayName: The display name of the place. + DisplayName string `json:"displayName,omitempty"` + + // Kind: Identifies this resource as a place. Value: "plus#place". + Kind string `json:"kind,omitempty"` + + // Position: The position of the place. + Position *PlacePosition `json:"position,omitempty"` +} + +type PlaceAddress struct { + // Formatted: The formatted address for display. + Formatted string `json:"formatted,omitempty"` +} + +type PlacePosition struct { + // Latitude: The latitude of this position. + Latitude float64 `json:"latitude,omitempty"` + + // Longitude: The longitude of this position. + Longitude float64 `json:"longitude,omitempty"` +} + +type PlusAclentryResource struct { + // DisplayName: A descriptive name for this entry. Suitable for display. + DisplayName string `json:"displayName,omitempty"` + + // Id: The ID of the entry. For entries of type "person" or "circle", + // this is the ID of the resource. For other types, this property is not + // set. + Id string `json:"id,omitempty"` + + // Type: The type of entry describing to whom access is granted. + // Possible values are: + // - "person" - Access to an individual. + // - + // "circle" - Access to members of a circle. + // - "myCircles" - Access to + // members of all the person's circles. + // - "extendedCircles" - Access to + // members of all the person's circles, plus all of the people in their + // circles. + // - "domain" - Access to members of the person's Google Apps + // domain. + // - "public" - Access to anyone on the web. + Type string `json:"type,omitempty"` +} + +type Videostream struct { + // Height: The height, in pixels, of the video resource. + Height int64 `json:"height,omitempty"` + + // Type: MIME type of the video stream. + Type string `json:"type,omitempty"` + + // Url: URL of the video stream. + Url string `json:"url,omitempty"` + + // Width: The width, in pixels, of the video resource. + Width int64 `json:"width,omitempty"` +} + +// method id "plus.activities.get": + +type ActivitiesGetCall struct { + s *Service + activityId string + opt_ map[string]interface{} +} + +// Get: Get an activity. +func (r *ActivitiesService) Get(activityId string) *ActivitiesGetCall { + c := &ActivitiesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.activityId = activityId + return c +} + +func (c *ActivitiesGetCall) Do() (*Activity, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "activities/{activityId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{activityId}", url.QueryEscape(c.activityId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Activity) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get an activity.", + // "httpMethod": "GET", + // "id": "plus.activities.get", + // "parameterOrder": [ + // "activityId" + // ], + // "parameters": { + // "activityId": { + // "description": "The ID of the activity to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "activities/{activityId}", + // "response": { + // "$ref": "Activity" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me", + // "https://www.googleapis.com/auth/plus.stream.read" + // ] + // } + +} + +// method id "plus.activities.insert": + +type ActivitiesInsertCall struct { + s *Service + userId string + activity *Activity + opt_ map[string]interface{} +} + +// Insert: Create a new activity for the authenticated user. +func (r *ActivitiesService) Insert(userId string, activity *Activity) *ActivitiesInsertCall { + c := &ActivitiesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.activity = activity + return c +} + +// Preview sets the optional parameter "preview": If "true", extract the +// potential media attachments for a URL. The response will include all +// possible attachments for a URL, including video, photos, and articles +// based on the content of the page. +func (c *ActivitiesInsertCall) Preview(preview bool) *ActivitiesInsertCall { + c.opt_["preview"] = preview + return c +} + +func (c *ActivitiesInsertCall) Do() (*Activity, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.activity) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["preview"]; ok { + params.Set("preview", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "people/{userId}/activities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Activity) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a new activity for the authenticated user.", + // "httpMethod": "POST", + // "id": "plus.activities.insert", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "preview": { + // "description": "If \"true\", extract the potential media attachments for a URL. The response will include all possible attachments for a URL, including video, photos, and articles based on the content of the page.", + // "location": "query", + // "type": "boolean" + // }, + // "userId": { + // "description": "The ID of the user to create the activity on behalf of. Its value should be \"me\", to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/activities", + // "request": { + // "$ref": "Activity" + // }, + // "response": { + // "$ref": "Activity" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me", + // "https://www.googleapis.com/auth/plus.stream.write" + // ] + // } + +} + +// method id "plus.activities.list": + +type ActivitiesListCall struct { + s *Service + userId string + collection string + opt_ map[string]interface{} +} + +// List: List all of the activities in the specified collection for a +// particular user. +func (r *ActivitiesService) List(userId string, collection string) *ActivitiesListCall { + c := &ActivitiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.collection = collection + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of activities to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *ActivitiesListCall) MaxResults(maxResults int64) *ActivitiesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *ActivitiesListCall) PageToken(pageToken string) *ActivitiesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ActivitiesListCall) Do() (*ActivityFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "people/{userId}/activities/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{collection}", url.QueryEscape(c.collection), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ActivityFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the activities in the specified collection for a particular user.", + // "httpMethod": "GET", + // "id": "plus.activities.list", + // "parameterOrder": [ + // "userId", + // "collection" + // ], + // "parameters": { + // "collection": { + // "description": "The collection of activities to list.", + // "enum": [ + // "user" + // ], + // "enumDescriptions": [ + // "All activities created by the specified user that the authenticated user is authorized to view." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "20", + // "description": "The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user to get activities for. The special value \"me\" can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/activities/{collection}", + // "response": { + // "$ref": "ActivityFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me", + // "https://www.googleapis.com/auth/plus.stream.read" + // ] + // } + +} + +// method id "plus.audiences.list": + +type AudiencesListCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// List: List all of the audiences to which a user can share. +func (r *AudiencesService) List(userId string) *AudiencesListCall { + c := &AudiencesListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of circles to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *AudiencesListCall) MaxResults(maxResults int64) *AudiencesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *AudiencesListCall) PageToken(pageToken string) *AudiencesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AudiencesListCall) Do() (*AudiencesFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "people/{userId}/audiences") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AudiencesFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the audiences to which a user can share.", + // "httpMethod": "GET", + // "id": "plus.audiences.list", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "maxResults": { + // "default": "20", + // "description": "The maximum number of circles to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user to get audiences for. The special value \"me\" can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/audiences", + // "response": { + // "$ref": "AudiencesFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.read", + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me" + // ] + // } + +} + +// method id "plus.circles.addPeople": + +type CirclesAddPeopleCall struct { + s *Service + circleId string + opt_ map[string]interface{} +} + +// AddPeople: Add a person to a circle. Google+ limits certain circle +// operations, including the number of circle adds. Learn More. +func (r *CirclesService) AddPeople(circleId string) *CirclesAddPeopleCall { + c := &CirclesAddPeopleCall{s: r.s, opt_: make(map[string]interface{})} + c.circleId = circleId + return c +} + +// Email sets the optional parameter "email": Email of the people to add +// to the circle. Optional, can be repeated. +func (c *CirclesAddPeopleCall) Email(email string) *CirclesAddPeopleCall { + c.opt_["email"] = email + return c +} + +// UserId sets the optional parameter "userId": IDs of the people to add +// to the circle. Optional, can be repeated. +func (c *CirclesAddPeopleCall) UserId(userId string) *CirclesAddPeopleCall { + c.opt_["userId"] = userId + return c +} + +func (c *CirclesAddPeopleCall) Do() (*Circle, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["email"]; ok { + params.Set("email", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["userId"]; ok { + params.Set("userId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "circles/{circleId}/people") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{circleId}", url.QueryEscape(c.circleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Circle) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add a person to a circle. Google+ limits certain circle operations, including the number of circle adds. Learn More.", + // "httpMethod": "PUT", + // "id": "plus.circles.addPeople", + // "parameterOrder": [ + // "circleId" + // ], + // "parameters": { + // "circleId": { + // "description": "The ID of the circle to add the person to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "email": { + // "description": "Email of the people to add to the circle. Optional, can be repeated.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "userId": { + // "description": "IDs of the people to add to the circle. Optional, can be repeated.", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "circles/{circleId}/people", + // "response": { + // "$ref": "Circle" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.write", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "plus.circles.get": + +type CirclesGetCall struct { + s *Service + circleId string + opt_ map[string]interface{} +} + +// Get: Get a circle. +func (r *CirclesService) Get(circleId string) *CirclesGetCall { + c := &CirclesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.circleId = circleId + return c +} + +func (c *CirclesGetCall) Do() (*Circle, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "circles/{circleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{circleId}", url.QueryEscape(c.circleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Circle) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a circle.", + // "httpMethod": "GET", + // "id": "plus.circles.get", + // "parameterOrder": [ + // "circleId" + // ], + // "parameters": { + // "circleId": { + // "description": "The ID of the circle to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "circles/{circleId}", + // "response": { + // "$ref": "Circle" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.read", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "plus.circles.insert": + +type CirclesInsertCall struct { + s *Service + userId string + circle *Circle + opt_ map[string]interface{} +} + +// Insert: Create a new circle for the authenticated user. +func (r *CirclesService) Insert(userId string, circle *Circle) *CirclesInsertCall { + c := &CirclesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.circle = circle + return c +} + +func (c *CirclesInsertCall) Do() (*Circle, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.circle) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "people/{userId}/circles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Circle) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a new circle for the authenticated user.", + // "httpMethod": "POST", + // "id": "plus.circles.insert", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "description": "The ID of the user to create the circle on behalf of. The value \"me\" can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/circles", + // "request": { + // "$ref": "Circle" + // }, + // "response": { + // "$ref": "Circle" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.write", + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me" + // ] + // } + +} + +// method id "plus.circles.list": + +type CirclesListCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// List: List all of the circles for a user. +func (r *CirclesService) List(userId string) *CirclesListCall { + c := &CirclesListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of circles to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *CirclesListCall) MaxResults(maxResults int64) *CirclesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *CirclesListCall) PageToken(pageToken string) *CirclesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CirclesListCall) Do() (*CircleFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "people/{userId}/circles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CircleFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the circles for a user.", + // "httpMethod": "GET", + // "id": "plus.circles.list", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "maxResults": { + // "default": "20", + // "description": "The maximum number of circles to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user to get circles for. The special value \"me\" can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/circles", + // "response": { + // "$ref": "CircleFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.read", + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me" + // ] + // } + +} + +// method id "plus.circles.patch": + +type CirclesPatchCall struct { + s *Service + circleId string + circle *Circle + opt_ map[string]interface{} +} + +// Patch: Update a circle's description. This method supports patch +// semantics. +func (r *CirclesService) Patch(circleId string, circle *Circle) *CirclesPatchCall { + c := &CirclesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.circleId = circleId + c.circle = circle + return c +} + +func (c *CirclesPatchCall) Do() (*Circle, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.circle) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "circles/{circleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{circleId}", url.QueryEscape(c.circleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Circle) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a circle's description. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "plus.circles.patch", + // "parameterOrder": [ + // "circleId" + // ], + // "parameters": { + // "circleId": { + // "description": "The ID of the circle to update.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "circles/{circleId}", + // "request": { + // "$ref": "Circle" + // }, + // "response": { + // "$ref": "Circle" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.write", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "plus.circles.remove": + +type CirclesRemoveCall struct { + s *Service + circleId string + opt_ map[string]interface{} +} + +// Remove: Delete a circle. +func (r *CirclesService) Remove(circleId string) *CirclesRemoveCall { + c := &CirclesRemoveCall{s: r.s, opt_: make(map[string]interface{})} + c.circleId = circleId + return c +} + +func (c *CirclesRemoveCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "circles/{circleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{circleId}", url.QueryEscape(c.circleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a circle.", + // "httpMethod": "DELETE", + // "id": "plus.circles.remove", + // "parameterOrder": [ + // "circleId" + // ], + // "parameters": { + // "circleId": { + // "description": "The ID of the circle to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "circles/{circleId}", + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.write", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "plus.circles.removePeople": + +type CirclesRemovePeopleCall struct { + s *Service + circleId string + opt_ map[string]interface{} +} + +// RemovePeople: Remove a person from a circle. +func (r *CirclesService) RemovePeople(circleId string) *CirclesRemovePeopleCall { + c := &CirclesRemovePeopleCall{s: r.s, opt_: make(map[string]interface{})} + c.circleId = circleId + return c +} + +// Email sets the optional parameter "email": Email of the people to add +// to the circle. Optional, can be repeated. +func (c *CirclesRemovePeopleCall) Email(email string) *CirclesRemovePeopleCall { + c.opt_["email"] = email + return c +} + +// UserId sets the optional parameter "userId": IDs of the people to +// remove from the circle. Optional, can be repeated. +func (c *CirclesRemovePeopleCall) UserId(userId string) *CirclesRemovePeopleCall { + c.opt_["userId"] = userId + return c +} + +func (c *CirclesRemovePeopleCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["email"]; ok { + params.Set("email", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["userId"]; ok { + params.Set("userId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "circles/{circleId}/people") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{circleId}", url.QueryEscape(c.circleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Remove a person from a circle.", + // "httpMethod": "DELETE", + // "id": "plus.circles.removePeople", + // "parameterOrder": [ + // "circleId" + // ], + // "parameters": { + // "circleId": { + // "description": "The ID of the circle to remove the person from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "email": { + // "description": "Email of the people to add to the circle. Optional, can be repeated.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "userId": { + // "description": "IDs of the people to remove from the circle. Optional, can be repeated.", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "circles/{circleId}/people", + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.write", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "plus.circles.update": + +type CirclesUpdateCall struct { + s *Service + circleId string + circle *Circle + opt_ map[string]interface{} +} + +// Update: Update a circle's description. +func (r *CirclesService) Update(circleId string, circle *Circle) *CirclesUpdateCall { + c := &CirclesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.circleId = circleId + c.circle = circle + return c +} + +func (c *CirclesUpdateCall) Do() (*Circle, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.circle) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "circles/{circleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{circleId}", url.QueryEscape(c.circleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Circle) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a circle's description.", + // "httpMethod": "PUT", + // "id": "plus.circles.update", + // "parameterOrder": [ + // "circleId" + // ], + // "parameters": { + // "circleId": { + // "description": "The ID of the circle to update.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "circles/{circleId}", + // "request": { + // "$ref": "Circle" + // }, + // "response": { + // "$ref": "Circle" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.write", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "plus.comments.get": + +type CommentsGetCall struct { + s *Service + commentId string + opt_ map[string]interface{} +} + +// Get: Get a comment. +func (r *CommentsService) Get(commentId string) *CommentsGetCall { + c := &CommentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.commentId = commentId + return c +} + +func (c *CommentsGetCall) Do() (*Comment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a comment.", + // "httpMethod": "GET", + // "id": "plus.comments.get", + // "parameterOrder": [ + // "commentId" + // ], + // "parameters": { + // "commentId": { + // "description": "The ID of the comment to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "comments/{commentId}", + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.stream.read" + // ] + // } + +} + +// method id "plus.comments.insert": + +type CommentsInsertCall struct { + s *Service + activityId string + comment *Comment + opt_ map[string]interface{} +} + +// Insert: Create a new comment in reply to an activity. +func (r *CommentsService) Insert(activityId string, comment *Comment) *CommentsInsertCall { + c := &CommentsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.activityId = activityId + c.comment = comment + return c +} + +func (c *CommentsInsertCall) Do() (*Comment, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "activities/{activityId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{activityId}", url.QueryEscape(c.activityId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a new comment in reply to an activity.", + // "httpMethod": "POST", + // "id": "plus.comments.insert", + // "parameterOrder": [ + // "activityId" + // ], + // "parameters": { + // "activityId": { + // "description": "The ID of the activity to reply to.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "activities/{activityId}/comments", + // "request": { + // "$ref": "Comment" + // }, + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.stream.write" + // ] + // } + +} + +// method id "plus.comments.list": + +type CommentsListCall struct { + s *Service + activityId string + opt_ map[string]interface{} +} + +// List: List all of the comments for an activity. +func (r *CommentsService) List(activityId string) *CommentsListCall { + c := &CommentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.activityId = activityId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of comments to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortOrder sets the optional parameter "sortOrder": The order in which +// to sort the list of comments. +func (c *CommentsListCall) SortOrder(sortOrder string) *CommentsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *CommentsListCall) Do() (*CommentFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "activities/{activityId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{activityId}", url.QueryEscape(c.activityId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommentFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the comments for an activity.", + // "httpMethod": "GET", + // "id": "plus.comments.list", + // "parameterOrder": [ + // "activityId" + // ], + // "parameters": { + // "activityId": { + // "description": "The ID of the activity to get comments for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "20", + // "description": "The maximum number of comments to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "default": "ascending", + // "description": "The order in which to sort the list of comments.", + // "enum": [ + // "ascending", + // "descending" + // ], + // "enumDescriptions": [ + // "Sort oldest comments first.", + // "Sort newest comments first." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "activities/{activityId}/comments", + // "response": { + // "$ref": "CommentFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.stream.read" + // ] + // } + +} + +// method id "plus.media.insert": + +type MediaInsertCall struct { + s *Service + userId string + collection string + media *Media + opt_ map[string]interface{} + media_ io.Reader +} + +// Insert: Add a new media item to an album. The current upload size +// limitations are 36MB for a photo and 1GB for a video. Uploads do not +// count against quota if photos are less than 2048 pixels on their +// longest side or videos are less than 15 minutes in length. +func (r *MediaService) Insert(userId string, collection string, media *Media) *MediaInsertCall { + c := &MediaInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.collection = collection + c.media = media + return c +} +func (c *MediaInsertCall) Media(r io.Reader) *MediaInsertCall { + c.media_ = r + return c +} + +func (c *MediaInsertCall) Do() (*Media, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.media) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "people/{userId}/media/{collection}") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{collection}", url.QueryEscape(c.collection), 1) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Media) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add a new media item to an album. The current upload size limitations are 36MB for a photo and 1GB for a video. Uploads do not count against quota if photos are less than 2048 pixels on their longest side or videos are less than 15 minutes in length.", + // "httpMethod": "POST", + // "id": "plus.media.insert", + // "mediaUpload": { + // "accept": [ + // "image/*", + // "video/*" + // ], + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/plus/v1domains/people/{userId}/media/{collection}" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/plus/v1domains/people/{userId}/media/{collection}" + // } + // } + // }, + // "parameterOrder": [ + // "userId", + // "collection" + // ], + // "parameters": { + // "collection": { + // "enum": [ + // "cloud" + // ], + // "enumDescriptions": [ + // "Upload the media to share on Google+." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user to create the activity on behalf of.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/media/{collection}", + // "request": { + // "$ref": "Media" + // }, + // "response": { + // "$ref": "Media" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.media.upload" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "plus.people.get": + +type PeopleGetCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// Get: Get a person's profile. +func (r *PeopleService) Get(userId string) *PeopleGetCall { + c := &PeopleGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +func (c *PeopleGetCall) Do() (*Person, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "people/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Person) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a person's profile.", + // "httpMethod": "GET", + // "id": "plus.people.get", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "description": "The ID of the person to get the profile for. The special value \"me\" can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}", + // "response": { + // "$ref": "Person" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me", + // "https://www.googleapis.com/auth/plus.profiles.read" + // ] + // } + +} + +// method id "plus.people.list": + +type PeopleListCall struct { + s *Service + userId string + collection string + opt_ map[string]interface{} +} + +// List: List all of the people in the specified collection. +func (r *PeopleService) List(userId string, collection string) *PeopleListCall { + c := &PeopleListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.collection = collection + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of people to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *PeopleListCall) MaxResults(maxResults int64) *PeopleListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": The order to return +// people in. +func (c *PeopleListCall) OrderBy(orderBy string) *PeopleListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *PeopleListCall) PageToken(pageToken string) *PeopleListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *PeopleListCall) Do() (*PeopleFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "people/{userId}/people/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{collection}", url.QueryEscape(c.collection), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PeopleFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the people in the specified collection.", + // "httpMethod": "GET", + // "id": "plus.people.list", + // "parameterOrder": [ + // "userId", + // "collection" + // ], + // "parameters": { + // "collection": { + // "description": "The collection of people to list.", + // "enum": [ + // "circled" + // ], + // "enumDescriptions": [ + // "The list of people who this user has added to one or more circles." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "orderBy": { + // "description": "The order to return people in.", + // "enum": [ + // "alphabetical", + // "best" + // ], + // "enumDescriptions": [ + // "Order the people by their display name.", + // "Order people based on the relevence to the viewer." + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "Get the collection of people for the person identified. Use \"me\" to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/people/{collection}", + // "response": { + // "$ref": "PeopleFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.read", + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me" + // ] + // } + +} + +// method id "plus.people.listByActivity": + +type PeopleListByActivityCall struct { + s *Service + activityId string + collection string + opt_ map[string]interface{} +} + +// ListByActivity: List all of the people in the specified collection +// for a particular activity. +func (r *PeopleService) ListByActivity(activityId string, collection string) *PeopleListByActivityCall { + c := &PeopleListByActivityCall{s: r.s, opt_: make(map[string]interface{})} + c.activityId = activityId + c.collection = collection + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of people to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *PeopleListByActivityCall) MaxResults(maxResults int64) *PeopleListByActivityCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *PeopleListByActivityCall) PageToken(pageToken string) *PeopleListByActivityCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *PeopleListByActivityCall) Do() (*PeopleFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "activities/{activityId}/people/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{activityId}", url.QueryEscape(c.activityId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{collection}", url.QueryEscape(c.collection), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PeopleFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the people in the specified collection for a particular activity.", + // "httpMethod": "GET", + // "id": "plus.people.listByActivity", + // "parameterOrder": [ + // "activityId", + // "collection" + // ], + // "parameters": { + // "activityId": { + // "description": "The ID of the activity to get the list of people for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "collection": { + // "description": "The collection of people to list.", + // "enum": [ + // "plusoners", + // "resharers", + // "sharedto" + // ], + // "enumDescriptions": [ + // "List all people who have +1'd this activity.", + // "List all people who have reshared this activity.", + // "List all people who this activity was shared to." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "20", + // "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "activities/{activityId}/people/{collection}", + // "response": { + // "$ref": "PeopleFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.stream.read" + // ] + // } + +} + +// method id "plus.people.listByCircle": + +type PeopleListByCircleCall struct { + s *Service + circleId string + opt_ map[string]interface{} +} + +// ListByCircle: List all of the people who are members of a circle. +func (r *PeopleService) ListByCircle(circleId string) *PeopleListByCircleCall { + c := &PeopleListByCircleCall{s: r.s, opt_: make(map[string]interface{})} + c.circleId = circleId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of people to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *PeopleListByCircleCall) MaxResults(maxResults int64) *PeopleListByCircleCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *PeopleListByCircleCall) PageToken(pageToken string) *PeopleListByCircleCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *PeopleListByCircleCall) Do() (*PeopleFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1domains/", "circles/{circleId}/people") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{circleId}", url.QueryEscape(c.circleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PeopleFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the people who are members of a circle.", + // "httpMethod": "GET", + // "id": "plus.people.listByCircle", + // "parameterOrder": [ + // "circleId" + // ], + // "parameters": { + // "circleId": { + // "description": "The ID of the circle to get the members of.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "20", + // "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "circles/{circleId}/people", + // "response": { + // "$ref": "PeopleFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.read", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/plus/v1moments/plus-api.json b/third_party/src/code.google.com/p/google-api-go-client/plus/v1moments/plus-api.json new file mode 100644 index 0000000000000..19a5797800262 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/plus/v1moments/plus-api.json @@ -0,0 +1,409 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"-vXktEC13RBC5q_wkxEsszrjKM4/fRqXZNx5yvahLJC3dn8LITx-zWM\"", + "discoveryVersion": "v1", + "id": "plus:v1moments", + "name": "plus", + "version": "v1moments", + "revision": "20121127", + "title": "Google+ API", + "description": "The Google+ API enables developers to build on top of the Google+ platform.", + "icons": { + "x16": "http://www.google.com/images/icons/product/gplus-16.png", + "x32": "http://www.google.com/images/icons/product/gplus-32.png" + }, + "documentationLink": "https://developers.google.com/+/history/", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/plus/v1moments/people/", + "basePath": "/plus/v1moments/people/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "plus/v1moments/people/", + "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" + } + }, + "schemas": { + "ItemScope": { + "id": "ItemScope", + "type": "object", + "properties": { + "about": { + "$ref": "ItemScope", + "description": "The subject matter of the content." + }, + "additionalName": { + "type": "array", + "description": "An additional name for a Person, can be used for a middle name.", + "items": { + "type": "string" + } + }, + "address": { + "$ref": "ItemScope", + "description": "Postal address." + }, + "addressCountry": { + "type": "string", + "description": "Address country." + }, + "addressLocality": { + "type": "string", + "description": "Address locality." + }, + "addressRegion": { + "type": "string", + "description": "Address region." + }, + "associated_media": { + "type": "array", + "description": "The encoding.", + "items": { + "$ref": "ItemScope" + } + }, + "attendeeCount": { + "type": "integer", + "description": "Number of attendees.", + "format": "int32" + }, + "attendees": { + "type": "array", + "description": "A person attending the event.", + "items": { + "$ref": "ItemScope" + } + }, + "audio": { + "$ref": "ItemScope", + "description": "From http://schema.org/MusicRecording, the audio file." + }, + "author": { + "type": "array", + "description": "The person or persons who created this result. In the example of restaurant reviews, this might be the reviewer's name.", + "items": { + "$ref": "ItemScope" + } + }, + "bestRating": { + "type": "string", + "description": "Best possible rating value that a result might obtain. This property defines the upper bound for the ratingValue. For example, you might have a 5 star rating scale, you would provide 5 as the value for this property." + }, + "birthDate": { + "type": "string", + "description": "Date of birth." + }, + "byArtist": { + "$ref": "ItemScope", + "description": "From http://schema.org/MusicRecording, the artist that performed this recording." + }, + "caption": { + "type": "string", + "description": "The caption for this object." + }, + "contentSize": { + "type": "string", + "description": "File size in (mega/kilo) bytes." + }, + "contentUrl": { + "type": "string", + "description": "Actual bytes of the media object, for example the image file or video file." + }, + "contributor": { + "type": "array", + "description": "A list of contributors to this result.", + "items": { + "$ref": "ItemScope" + } + }, + "dateCreated": { + "type": "string", + "description": "The date the result was created such as the date that a review was first created." + }, + "dateModified": { + "type": "string", + "description": "The date the result was last modified such as the date that a review was last edited." + }, + "datePublished": { + "type": "string", + "description": "The initial date that the result was published. For example, a user writes a comment on a blog, which has a result.dateCreated of when they submit it. If the blog users comment moderation, the result.datePublished value would match the date when the owner approved the message." + }, + "description": { + "type": "string", + "description": "The string that describes the content of the result." + }, + "duration": { + "type": "string", + "description": "The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format." + }, + "embedUrl": { + "type": "string", + "description": "A URL pointing to a player for a specific video. In general, this is the information in the src element of an embed tag and should not be the same as the content of the loc tag." + }, + "endDate": { + "type": "string", + "description": "The end date and time of the event (in ISO 8601 date format)." + }, + "familyName": { + "type": "string", + "description": "Family name. This property can be used with givenName instead of the name property." + }, + "gender": { + "type": "string", + "description": "Gender of the person." + }, + "geo": { + "$ref": "ItemScope", + "description": "Geo coordinates." + }, + "givenName": { + "type": "string", + "description": "Given name. This property can be used with familyName instead of the name property." + }, + "height": { + "type": "string", + "description": "The height of the media object." + }, + "id": { + "type": "string", + "description": "An identifier for the target. Your app can choose how to identify targets. The target.id is required if you are writing an activity that does not have a corresponding web page or target.url property." + }, + "image": { + "type": "string", + "description": "A URL to the image that represents this result. For example, if a user writes a review of a restaurant and attaches a photo of their meal, you might use that photo as the result.image." + }, + "inAlbum": { + "$ref": "ItemScope", + "description": "From http://schema.org/MusicRecording, which album a song is in." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as an itemScope.", + "default": "plus#itemScope" + }, + "latitude": { + "type": "number", + "description": "Latitude.", + "format": "double" + }, + "location": { + "$ref": "ItemScope", + "description": "The location of the event or organization." + }, + "longitude": { + "type": "number", + "description": "Longitude.", + "format": "double" + }, + "name": { + "type": "string", + "description": "The name of the result. In the example of a restaurant review, this might be the summary the user gave their review such as \"Great ambiance, but overpriced.\"" + }, + "partOfTVSeries": { + "$ref": "ItemScope", + "description": "Property of http://schema.org/TVEpisode indicating which series the episode belongs to." + }, + "performers": { + "type": "array", + "description": "The main performer or performers of the event-for example, a presenter, musician, or actor.", + "items": { + "$ref": "ItemScope" + } + }, + "playerType": { + "type": "string", + "description": "Player type that is required. For example: Flash or Silverlight." + }, + "postOfficeBoxNumber": { + "type": "string", + "description": "Post office box number." + }, + "postalCode": { + "type": "string", + "description": "Postal code." + }, + "ratingValue": { + "type": "string", + "description": "Rating value." + }, + "reviewRating": { + "$ref": "ItemScope", + "description": "Review rating." + }, + "startDate": { + "type": "string", + "description": "The start date and time of the event (in ISO 8601 date format)." + }, + "streetAddress": { + "type": "string", + "description": "Street address." + }, + "text": { + "type": "string", + "description": "The text that is the result of the app activity. For example, if a user leaves a review of a restaurant, this might be the text of the review." + }, + "thumbnail": { + "$ref": "ItemScope", + "description": "Thumbnail image for an image or video." + }, + "thumbnailUrl": { + "type": "string", + "description": "A URL to a thumbnail image that represents this result." + }, + "tickerSymbol": { + "type": "string", + "description": "The exchange traded instrument associated with a Corporation object. The tickerSymbol is expressed as an exchange and an instrument name separated by a space character. For the exchange component of the tickerSymbol attribute, we reccommend using the controlled vocaulary of Market Identifier Codes (MIC) specified in ISO15022." + }, + "type": { + "type": "string", + "description": "The schema.org URL that best describes the referenced target and matches the type of moment." + }, + "url": { + "type": "string", + "description": "The URL that points to the result object. For example, a permalink directly to a restaurant reviewer's comment." + }, + "width": { + "type": "string", + "description": "The width of the media object." + }, + "worstRating": { + "type": "string", + "description": "Worst possible rating value that a result might obtain. This property defines the lower bound for the ratingValue." + } + } + }, + "Moment": { + "id": "Moment", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The moment ID." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a moment.", + "default": "plus#moment" + }, + "result": { + "$ref": "ItemScope", + "description": "The object generated by performing the action on the target. For example, a user writes a review of a restaurant, the target is the restaurant and the result is the review." + }, + "startDate": { + "type": "string", + "description": "Time stamp of when the action occurred in RFC3339 format.", + "format": "date-time" + }, + "target": { + "$ref": "ItemScope", + "description": "The object on which the action was performed.", + "annotations": { + "required": [ + "plus.moments.insert" + ] + } + }, + "type": { + "type": "string", + "description": "The Google schema for the type of moment to write. For example, http://schemas.google.com/AddActivity.", + "annotations": { + "required": [ + "plus.moments.insert" + ] + } + } + } + } + }, + "resources": { + "moments": { + "methods": { + "insert": { + "id": "plus.moments.insert", + "path": "{userId}/moments/{collection}", + "httpMethod": "POST", + "description": "Record a moment representing a user's activity such as making a purchase or commenting on a blog.", + "parameters": { + "collection": { + "type": "string", + "description": "The collection to which to write moments.", + "required": true, + "enum": [ + "vault" + ], + "enumDescriptions": [ + "The default collection for writing new moments." + ], + "location": "path" + }, + "debug": { + "type": "boolean", + "description": "Return the moment as written. Should be used only for debugging.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user to record activities for. The only valid values are \"me\" and the ID of the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "collection" + ], + "request": { + "$ref": "Moment" + }, + "response": { + "$ref": "Moment" + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/plus/v1moments/plus-gen.go b/third_party/src/code.google.com/p/google-api-go-client/plus/v1moments/plus-gen.go new file mode 100644 index 0000000000000..69a62f489cfdf --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/plus/v1moments/plus-gen.go @@ -0,0 +1,397 @@ +// Package plus provides access to the Google+ API. +// +// See https://developers.google.com/+/history/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/plus/v1moments" +// ... +// plusService, err := plus.New(oauthHttpClient) +package plus + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New + +const apiId = "plus:v1moments" +const apiName = "plus" +const apiVersion = "v1moments" +const basePath = "https://www.googleapis.com/plus/v1moments/people/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client} + s.Moments = &MomentsService{s: s} + return s, nil +} + +type Service struct { + client *http.Client + + Moments *MomentsService +} + +type MomentsService struct { + s *Service +} + +type ItemScope struct { + // About: The subject matter of the content. + About *ItemScope `json:"about,omitempty"` + + // AdditionalName: An additional name for a Person, can be used for a + // middle name. + AdditionalName []string `json:"additionalName,omitempty"` + + // Address: Postal address. + Address *ItemScope `json:"address,omitempty"` + + // AddressCountry: Address country. + AddressCountry string `json:"addressCountry,omitempty"` + + // AddressLocality: Address locality. + AddressLocality string `json:"addressLocality,omitempty"` + + // AddressRegion: Address region. + AddressRegion string `json:"addressRegion,omitempty"` + + // Associated_media: The encoding. + Associated_media []*ItemScope `json:"associated_media,omitempty"` + + // AttendeeCount: Number of attendees. + AttendeeCount int64 `json:"attendeeCount,omitempty"` + + // Attendees: A person attending the event. + Attendees []*ItemScope `json:"attendees,omitempty"` + + // Audio: From http://schema.org/MusicRecording, the audio file. + Audio *ItemScope `json:"audio,omitempty"` + + // Author: The person or persons who created this result. In the example + // of restaurant reviews, this might be the reviewer's name. + Author []*ItemScope `json:"author,omitempty"` + + // BestRating: Best possible rating value that a result might obtain. + // This property defines the upper bound for the ratingValue. For + // example, you might have a 5 star rating scale, you would provide 5 as + // the value for this property. + BestRating string `json:"bestRating,omitempty"` + + // BirthDate: Date of birth. + BirthDate string `json:"birthDate,omitempty"` + + // ByArtist: From http://schema.org/MusicRecording, the artist that + // performed this recording. + ByArtist *ItemScope `json:"byArtist,omitempty"` + + // Caption: The caption for this object. + Caption string `json:"caption,omitempty"` + + // ContentSize: File size in (mega/kilo) bytes. + ContentSize string `json:"contentSize,omitempty"` + + // ContentUrl: Actual bytes of the media object, for example the image + // file or video file. + ContentUrl string `json:"contentUrl,omitempty"` + + // Contributor: A list of contributors to this result. + Contributor []*ItemScope `json:"contributor,omitempty"` + + // DateCreated: The date the result was created such as the date that a + // review was first created. + DateCreated string `json:"dateCreated,omitempty"` + + // DateModified: The date the result was last modified such as the date + // that a review was last edited. + DateModified string `json:"dateModified,omitempty"` + + // DatePublished: The initial date that the result was published. For + // example, a user writes a comment on a blog, which has a + // result.dateCreated of when they submit it. If the blog users comment + // moderation, the result.datePublished value would match the date when + // the owner approved the message. + DatePublished string `json:"datePublished,omitempty"` + + // Description: The string that describes the content of the result. + Description string `json:"description,omitempty"` + + // Duration: The duration of the item (movie, audio recording, event, + // etc.) in ISO 8601 date format. + Duration string `json:"duration,omitempty"` + + // EmbedUrl: A URL pointing to a player for a specific video. In + // general, this is the information in the src element of an embed tag + // and should not be the same as the content of the loc tag. + EmbedUrl string `json:"embedUrl,omitempty"` + + // EndDate: The end date and time of the event (in ISO 8601 date + // format). + EndDate string `json:"endDate,omitempty"` + + // FamilyName: Family name. This property can be used with givenName + // instead of the name property. + FamilyName string `json:"familyName,omitempty"` + + // Gender: Gender of the person. + Gender string `json:"gender,omitempty"` + + // Geo: Geo coordinates. + Geo *ItemScope `json:"geo,omitempty"` + + // GivenName: Given name. This property can be used with familyName + // instead of the name property. + GivenName string `json:"givenName,omitempty"` + + // Height: The height of the media object. + Height string `json:"height,omitempty"` + + // Id: An identifier for the target. Your app can choose how to identify + // targets. The target.id is required if you are writing an activity + // that does not have a corresponding web page or target.url property. + Id string `json:"id,omitempty"` + + // Image: A URL to the image that represents this result. For example, + // if a user writes a review of a restaurant and attaches a photo of + // their meal, you might use that photo as the result.image. + Image string `json:"image,omitempty"` + + // InAlbum: From http://schema.org/MusicRecording, which album a song is + // in. + InAlbum *ItemScope `json:"inAlbum,omitempty"` + + // Kind: Identifies this resource as an itemScope. + Kind string `json:"kind,omitempty"` + + // Latitude: Latitude. + Latitude float64 `json:"latitude,omitempty"` + + // Location: The location of the event or organization. + Location *ItemScope `json:"location,omitempty"` + + // Longitude: Longitude. + Longitude float64 `json:"longitude,omitempty"` + + // Name: The name of the result. In the example of a restaurant review, + // this might be the summary the user gave their review such as "Great + // ambiance, but overpriced." + Name string `json:"name,omitempty"` + + // PartOfTVSeries: Property of http://schema.org/TVEpisode indicating + // which series the episode belongs to. + PartOfTVSeries *ItemScope `json:"partOfTVSeries,omitempty"` + + // Performers: The main performer or performers of the event-for + // example, a presenter, musician, or actor. + Performers []*ItemScope `json:"performers,omitempty"` + + // PlayerType: Player type that is required. For example: Flash or + // Silverlight. + PlayerType string `json:"playerType,omitempty"` + + // PostOfficeBoxNumber: Post office box number. + PostOfficeBoxNumber string `json:"postOfficeBoxNumber,omitempty"` + + // PostalCode: Postal code. + PostalCode string `json:"postalCode,omitempty"` + + // RatingValue: Rating value. + RatingValue string `json:"ratingValue,omitempty"` + + // ReviewRating: Review rating. + ReviewRating *ItemScope `json:"reviewRating,omitempty"` + + // StartDate: The start date and time of the event (in ISO 8601 date + // format). + StartDate string `json:"startDate,omitempty"` + + // StreetAddress: Street address. + StreetAddress string `json:"streetAddress,omitempty"` + + // Text: The text that is the result of the app activity. For example, + // if a user leaves a review of a restaurant, this might be the text of + // the review. + Text string `json:"text,omitempty"` + + // Thumbnail: Thumbnail image for an image or video. + Thumbnail *ItemScope `json:"thumbnail,omitempty"` + + // ThumbnailUrl: A URL to a thumbnail image that represents this result. + ThumbnailUrl string `json:"thumbnailUrl,omitempty"` + + // TickerSymbol: The exchange traded instrument associated with a + // Corporation object. The tickerSymbol is expressed as an exchange and + // an instrument name separated by a space character. For the exchange + // component of the tickerSymbol attribute, we reccommend using the + // controlled vocaulary of Market Identifier Codes (MIC) specified in + // ISO15022. + TickerSymbol string `json:"tickerSymbol,omitempty"` + + // Type: The schema.org URL that best describes the referenced target + // and matches the type of moment. + Type string `json:"type,omitempty"` + + // Url: The URL that points to the result object. For example, a + // permalink directly to a restaurant reviewer's comment. + Url string `json:"url,omitempty"` + + // Width: The width of the media object. + Width string `json:"width,omitempty"` + + // WorstRating: Worst possible rating value that a result might obtain. + // This property defines the lower bound for the ratingValue. + WorstRating string `json:"worstRating,omitempty"` +} + +type Moment struct { + // Id: The moment ID. + Id string `json:"id,omitempty"` + + // Kind: Identifies this resource as a moment. + Kind string `json:"kind,omitempty"` + + // Result: The object generated by performing the action on the target. + // For example, a user writes a review of a restaurant, the target is + // the restaurant and the result is the review. + Result *ItemScope `json:"result,omitempty"` + + // StartDate: Time stamp of when the action occurred in RFC3339 format. + StartDate string `json:"startDate,omitempty"` + + // Target: The object on which the action was performed. + Target *ItemScope `json:"target,omitempty"` + + // Type: The Google schema for the type of moment to write. For example, + // http://schemas.google.com/AddActivity. + Type string `json:"type,omitempty"` +} + +// method id "plus.moments.insert": + +type MomentsInsertCall struct { + s *Service + userId string + collection string + moment *Moment + opt_ map[string]interface{} +} + +// Insert: Record a moment representing a user's activity such as making +// a purchase or commenting on a blog. +func (r *MomentsService) Insert(userId string, collection string, moment *Moment) *MomentsInsertCall { + c := &MomentsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.collection = collection + c.moment = moment + return c +} + +// Debug sets the optional parameter "debug": Return the moment as +// written. Should be used only for debugging. +func (c *MomentsInsertCall) Debug(debug bool) *MomentsInsertCall { + c.opt_["debug"] = debug + return c +} + +func (c *MomentsInsertCall) Do() (*Moment, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.moment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["debug"]; ok { + params.Set("debug", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/plus/v1moments/people/", "{userId}/moments/{collection}") + urls = strings.Replace(urls, "{userId}", cleanPathString(c.userId), 1) + urls = strings.Replace(urls, "{collection}", cleanPathString(c.collection), 1) + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Moment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Record a moment representing a user's activity such as making a purchase or commenting on a blog.", + // "httpMethod": "POST", + // "id": "plus.moments.insert", + // "parameterOrder": [ + // "userId", + // "collection" + // ], + // "parameters": { + // "collection": { + // "description": "The collection to which to write moments.", + // "enum": [ + // "vault" + // ], + // "enumDescriptions": [ + // "The default collection for writing new moments." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "debug": { + // "description": "Return the moment as written. Should be used only for debugging.", + // "location": "query", + // "type": "boolean" + // }, + // "userId": { + // "description": "The ID of the user to record activities for. The only valid values are \"me\" and the ID of the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/moments/{collection}", + // "request": { + // "$ref": "Moment" + // }, + // "response": { + // "$ref": "Moment" + // } + // } + +} + +func cleanPathString(s string) string { + return strings.Map(func(r rune) rune { + if r >= 0x2d && r <= 0x7a || r == '~' { + return r + } + return -1 + }, s) +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/plusdomains/v1/plusdomains-api.json b/third_party/src/code.google.com/p/google-api-go-client/plusdomains/v1/plusdomains-api.json new file mode 100644 index 0000000000000..e0b7fe2e08d94 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/plusdomains/v1/plusdomains-api.json @@ -0,0 +1,2153 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/WecM2nVo3OjpAn6UNY8qcfnUtHQ\"", + "discoveryVersion": "v1", + "id": "plusDomains:v1", + "name": "plusDomains", + "version": "v1", + "title": "Google+ Domains API", + "description": "The Google+ API enables developers to build on top of the Google+ platform.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/gplus-16.png", + "x32": "http://www.google.com/images/icons/product/gplus-32.png" + }, + "documentationLink": "https://developers.google.com/+/domains/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/plusDomains/v1/", + "basePath": "/plusDomains/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "plusDomains/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/plus.circles.read": { + "description": "View your circles and the people and pages in them" + }, + "https://www.googleapis.com/auth/plus.circles.write": { + "description": "Manage your circles and add people and pages, who will be notified and may appear on your public Google+ profile" + }, + "https://www.googleapis.com/auth/plus.login": { + "description": "Know your basic profile info and list of people in your circles." + }, + "https://www.googleapis.com/auth/plus.me": { + "description": "Know who you are on Google" + }, + "https://www.googleapis.com/auth/plus.media.upload": { + "description": "Send your photos and videos to Google+" + }, + "https://www.googleapis.com/auth/plus.profiles.read": { + "description": "View your own Google+ profile and profiles visible to you" + }, + "https://www.googleapis.com/auth/plus.stream.read": { + "description": "View your Google+ posts, comments, and stream" + }, + "https://www.googleapis.com/auth/plus.stream.write": { + "description": "Manage your Google+ posts, comments, and stream" + }, + "https://www.googleapis.com/auth/userinfo.email": { + "description": "View your email address" + }, + "https://www.googleapis.com/auth/userinfo.profile": { + "description": "View basic information about your account" + } + } + } + }, + "schemas": { + "Acl": { + "id": "Acl", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Description of the access granted, suitable for display." + }, + "domainRestricted": { + "type": "boolean", + "description": "Whether access is restricted to the domain." + }, + "items": { + "type": "array", + "description": "The list of access entries.", + "items": { + "$ref": "PlusDomainsAclentryResource" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of access controls. Value: \"plus#acl\".", + "default": "plus#acl" + } + } + }, + "Activity": { + "id": "Activity", + "type": "object", + "properties": { + "access": { + "$ref": "Acl", + "description": "Identifies who has access to see this activity." + }, + "actor": { + "type": "object", + "description": "The person who performed this activity.", + "properties": { + "displayName": { + "type": "string", + "description": "The name of the actor, suitable for display." + }, + "id": { + "type": "string", + "description": "The ID of the actor's Person resource." + }, + "image": { + "type": "object", + "description": "The image representation of the actor.", + "properties": { + "url": { + "type": "string", + "description": "The URL of the actor's profile photo. To resize the image and crop it to a square, append the query string ?sz=x, where x is the dimension in pixels of each side." + } + } + }, + "name": { + "type": "object", + "description": "An object representation of the individual components of name.", + "properties": { + "familyName": { + "type": "string", + "description": "The family name (\"last name\") of the actor." + }, + "givenName": { + "type": "string", + "description": "The given name (\"first name\") of the actor." + } + } + }, + "url": { + "type": "string", + "description": "The link to the actor's Google profile." + } + } + }, + "address": { + "type": "string", + "description": "Street address where this activity occurred." + }, + "annotation": { + "type": "string", + "description": "Additional content added by the person who shared this activity, applicable only when resharing an activity." + }, + "crosspostSource": { + "type": "string", + "description": "If this activity is a crosspost from another system, this property specifies the ID of the original activity." + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "geocode": { + "type": "string", + "description": "Latitude and longitude where this activity occurred. Format is latitude followed by longitude, space separated." + }, + "id": { + "type": "string", + "description": "The ID of this activity." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as an activity. Value: \"plus#activity\".", + "default": "plus#activity" + }, + "location": { + "$ref": "Place", + "description": "The location where this activity occurred." + }, + "object": { + "type": "object", + "description": "The object of this activity.", + "properties": { + "actor": { + "type": "object", + "description": "If this activity's object is itself another activity, such as when a person reshares an activity, this property specifies the original activity's actor.", + "properties": { + "displayName": { + "type": "string", + "description": "The original actor's name, which is suitable for display." + }, + "id": { + "type": "string", + "description": "ID of the original actor." + }, + "image": { + "type": "object", + "description": "The image representation of the original actor.", + "properties": { + "url": { + "type": "string", + "description": "A URL that points to a thumbnail photo of the original actor." + } + } + }, + "url": { + "type": "string", + "description": "A link to the original actor's Google profile." + } + } + }, + "attachments": { + "type": "array", + "description": "The media objects attached to this activity.", + "items": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "If the attachment is an article, this property contains a snippet of text from the article. It can also include descriptions for other types." + }, + "displayName": { + "type": "string", + "description": "The title of the attachment, such as a photo caption or an article title." + }, + "embed": { + "type": "object", + "description": "If the attachment is a video, the embeddable link.", + "properties": { + "type": { + "type": "string", + "description": "Media type of the link." + }, + "url": { + "type": "string", + "description": "URL of the link." + } + } + }, + "fullImage": { + "type": "object", + "description": "The full image URL for photo attachments.", + "properties": { + "height": { + "type": "integer", + "description": "The height, in pixels, of the linked resource.", + "format": "uint32" + }, + "type": { + "type": "string", + "description": "Media type of the link." + }, + "url": { + "type": "string", + "description": "URL of the image." + }, + "width": { + "type": "integer", + "description": "The width, in pixels, of the linked resource.", + "format": "uint32" + } + } + }, + "id": { + "type": "string", + "description": "The ID of the attachment." + }, + "image": { + "type": "object", + "description": "The preview image for photos or videos.", + "properties": { + "height": { + "type": "integer", + "description": "The height, in pixels, of the linked resource.", + "format": "uint32" + }, + "type": { + "type": "string", + "description": "Media type of the link." + }, + "url": { + "type": "string", + "description": "Image URL." + }, + "width": { + "type": "integer", + "description": "The width, in pixels, of the linked resource.", + "format": "uint32" + } + } + }, + "objectType": { + "type": "string", + "description": "The type of media object. Possible values include, but are not limited to, the following values: \n- \"photo\" - A photo. \n- \"album\" - A photo album. \n- \"video\" - A video. \n- \"article\" - An article, specified by a link." + }, + "previewThumbnails": { + "type": "array", + "description": "When previewing, these are the optional thumbnails for the post. When posting an article, choose one by setting the attachment.image.url property. If you don't choose one, one will be chosen for you.", + "items": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "URL of the thumbnail image." + } + } + } + }, + "thumbnails": { + "type": "array", + "description": "If the attachment is an album, this property is a list of potential additional thumbnails from the album.", + "items": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Potential name of the thumbnail." + }, + "image": { + "type": "object", + "description": "Image resource.", + "properties": { + "height": { + "type": "integer", + "description": "The height, in pixels, of the linked resource.", + "format": "uint32" + }, + "type": { + "type": "string", + "description": "Media type of the link." + }, + "url": { + "type": "string", + "description": "Image url." + }, + "width": { + "type": "integer", + "description": "The width, in pixels, of the linked resource.", + "format": "uint32" + } + } + }, + "url": { + "type": "string", + "description": "URL of the webpage containing the image." + } + } + } + }, + "url": { + "type": "string", + "description": "The link to the attachment, which should be of type text/html." + } + } + } + }, + "content": { + "type": "string", + "description": "The HTML-formatted content, which is suitable for display." + }, + "id": { + "type": "string", + "description": "The ID of the object. When resharing an activity, this is the ID of the activity that is being reshared." + }, + "objectType": { + "type": "string", + "description": "The type of the object. Possible values include, but are not limited to, the following values: \n- \"note\" - Textual content. \n- \"activity\" - A Google+ activity." + }, + "originalContent": { + "type": "string", + "description": "The content (text) as provided by the author, which is stored without any HTML formatting. When creating or updating an activity, this value must be supplied as plain text in the request." + }, + "plusoners": { + "type": "object", + "description": "People who +1'd this activity.", + "properties": { + "selfLink": { + "type": "string", + "description": "The URL for the collection of people who +1'd this activity." + }, + "totalItems": { + "type": "integer", + "description": "Total number of people who +1'd this activity.", + "format": "uint32" + } + } + }, + "replies": { + "type": "object", + "description": "Comments in reply to this activity.", + "properties": { + "selfLink": { + "type": "string", + "description": "The URL for the collection of comments in reply to this activity." + }, + "totalItems": { + "type": "integer", + "description": "Total number of comments on this activity.", + "format": "uint32" + } + } + }, + "resharers": { + "type": "object", + "description": "People who reshared this activity.", + "properties": { + "selfLink": { + "type": "string", + "description": "The URL for the collection of resharers." + }, + "totalItems": { + "type": "integer", + "description": "Total number of people who reshared this activity.", + "format": "uint32" + } + } + }, + "statusForViewer": { + "type": "object", + "description": "Status of the activity as seen by the viewer.", + "properties": { + "canComment": { + "type": "boolean", + "description": "Whether the viewer can comment on the activity." + }, + "canPlusone": { + "type": "boolean", + "description": "Whether the viewer can +1 the activity." + }, + "canUpdate": { + "type": "boolean", + "description": "Whether the viewer can edit or delete the activity." + }, + "isPlusOned": { + "type": "boolean", + "description": "Whether the viewer has +1'd the activity." + }, + "resharingDisabled": { + "type": "boolean", + "description": "Whether reshares are disabled for the activity." + } + } + }, + "url": { + "type": "string", + "description": "The URL that points to the linked resource." + } + } + }, + "placeId": { + "type": "string", + "description": "ID of the place where this activity occurred." + }, + "placeName": { + "type": "string", + "description": "Name of the place where this activity occurred." + }, + "provider": { + "type": "object", + "description": "The service provider that initially published this activity.", + "properties": { + "title": { + "type": "string", + "description": "Name of the service provider." + } + } + }, + "published": { + "type": "string", + "description": "The time at which this activity was initially published. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "radius": { + "type": "string", + "description": "Radius, in meters, of the region where this activity occurred, centered at the latitude and longitude identified in geocode." + }, + "title": { + "type": "string", + "description": "Title of this activity." + }, + "updated": { + "type": "string", + "description": "The time at which this activity was last updated. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "url": { + "type": "string", + "description": "The link to this activity." + }, + "verb": { + "type": "string", + "description": "This activity's verb, which indicates the action that was performed. Possible values include, but are not limited to, the following values: \n- \"post\" - Publish content to the stream. \n- \"share\" - Reshare an activity." + } + } + }, + "ActivityFeed": { + "id": "ActivityFeed", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID of this collection of activities. Deprecated." + }, + "items": { + "type": "array", + "description": "The activities in this page of results.", + "items": { + "$ref": "Activity" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of activities. Value: \"plus#activityFeed\".", + "default": "plus#activityFeed" + }, + "nextLink": { + "type": "string", + "description": "Link to the next page of activities." + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "selfLink": { + "type": "string", + "description": "Link to this activity resource." + }, + "title": { + "type": "string", + "description": "The title of this collection of activities, which is a truncated portion of the content." + }, + "updated": { + "type": "string", + "description": "The time at which this collection of activities was last updated. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + } + } + }, + "Audience": { + "id": "Audience", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "item": { + "$ref": "PlusDomainsAclentryResource", + "description": "The access control list entry." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as an audience. Value: \"plus#audience\".", + "default": "plus#audience" + }, + "memberCount": { + "type": "integer", + "description": "The number of people in this circle. This only applies if entity_type is CIRCLE.", + "format": "uint32" + }, + "visibility": { + "type": "string", + "description": "The circle members' visibility as chosen by the owner of the circle. This only applies for items with \"item.type\" equals \"circle\". Possible values are: \n- \"public\" - Members are visible to the public. \n- \"limited\" - Members are visible to a limited audience. \n- \"private\" - Members are visible to the owner only." + } + } + }, + "AudiencesFeed": { + "id": "AudiencesFeed", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The audiences in this result.", + "items": { + "$ref": "Audience" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of audiences. Value: \"plus#audienceFeed\".", + "default": "plus#audiencesFeed" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "totalItems": { + "type": "integer", + "description": "The total number of ACL entries. The number of entries in this response may be smaller due to paging.", + "format": "int32" + } + } + }, + "Circle": { + "id": "Circle", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "The description of this circle." + }, + "displayName": { + "type": "string", + "description": "The circle name." + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID of the circle." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a circle. Value: \"plus#circle\".", + "default": "plus#circle" + }, + "people": { + "type": "object", + "description": "The people in this circle.", + "properties": { + "totalItems": { + "type": "integer", + "description": "The total number of people in this circle.", + "format": "uint32" + } + } + }, + "selfLink": { + "type": "string", + "description": "Link to this circle resource" + } + } + }, + "CircleFeed": { + "id": "CircleFeed", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The circles in this page of results.", + "items": { + "$ref": "Circle" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of circles. Value: \"plus#circleFeed\".", + "default": "plus#circleFeed" + }, + "nextLink": { + "type": "string", + "description": "Link to the next page of circles." + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "selfLink": { + "type": "string", + "description": "Link to this page of circles." + }, + "title": { + "type": "string", + "description": "The title of this list of resources." + }, + "totalItems": { + "type": "integer", + "description": "The total number of circles. The number of circles in this response may be smaller due to paging.", + "format": "int32" + } + } + }, + "Comment": { + "id": "Comment", + "type": "object", + "properties": { + "actor": { + "type": "object", + "description": "The person who posted this comment.", + "properties": { + "displayName": { + "type": "string", + "description": "The name of this actor, suitable for display." + }, + "id": { + "type": "string", + "description": "The ID of the actor." + }, + "image": { + "type": "object", + "description": "The image representation of this actor.", + "properties": { + "url": { + "type": "string", + "description": "The URL of the actor's profile photo. To resize the image and crop it to a square, append the query string ?sz=x, where x is the dimension in pixels of each side." + } + } + }, + "url": { + "type": "string", + "description": "A link to the Person resource for this actor." + } + } + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID of this comment." + }, + "inReplyTo": { + "type": "array", + "description": "The activity this comment replied to.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the activity." + }, + "url": { + "type": "string", + "description": "The URL of the activity." + } + } + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a comment. Value: \"plus#comment\".", + "default": "plus#comment" + }, + "object": { + "type": "object", + "description": "The object of this comment.", + "properties": { + "content": { + "type": "string", + "description": "The HTML-formatted content, suitable for display." + }, + "objectType": { + "type": "string", + "description": "The object type of this comment. Possible values are: \n- \"comment\" - A comment in reply to an activity.", + "default": "comment" + }, + "originalContent": { + "type": "string", + "description": "The content (text) as provided by the author, stored without any HTML formatting. When creating or updating a comment, this value must be supplied as plain text in the request." + } + } + }, + "plusoners": { + "type": "object", + "description": "People who +1'd this comment.", + "properties": { + "totalItems": { + "type": "integer", + "description": "Total number of people who +1'd this comment.", + "format": "uint32" + } + } + }, + "published": { + "type": "string", + "description": "The time at which this comment was initially published. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "selfLink": { + "type": "string", + "description": "Link to this comment resource." + }, + "updated": { + "type": "string", + "description": "The time at which this comment was last updated. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "verb": { + "type": "string", + "description": "This comment's verb, indicating what action was performed. Possible values are: \n- \"post\" - Publish content to the stream.", + "default": "post" + } + } + }, + "CommentFeed": { + "id": "CommentFeed", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID of this collection of comments." + }, + "items": { + "type": "array", + "description": "The comments in this page of results.", + "items": { + "$ref": "Comment" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of comments. Value: \"plus#commentFeed\".", + "default": "plus#commentFeed" + }, + "nextLink": { + "type": "string", + "description": "Link to the next page of activities." + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "title": { + "type": "string", + "description": "The title of this collection of comments." + }, + "updated": { + "type": "string", + "description": "The time at which this collection of comments was last updated. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + } + } + }, + "Media": { + "id": "Media", + "type": "object", + "properties": { + "author": { + "type": "object", + "description": "The person who uploaded this media.", + "properties": { + "displayName": { + "type": "string", + "description": "The author's name." + }, + "id": { + "type": "string", + "description": "ID of the author." + }, + "image": { + "type": "object", + "description": "The author's Google profile image.", + "properties": { + "url": { + "type": "string", + "description": "The URL of the author's profile photo. To resize the image and crop it to a square, append the query string ?sz=x, where x is the dimension in pixels of each side." + } + } + }, + "url": { + "type": "string", + "description": "A link to the author's Google profile." + } + } + }, + "displayName": { + "type": "string", + "description": "The display name for this media." + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "exif": { + "type": "object", + "description": "Exif information of the media item.", + "properties": { + "time": { + "type": "string", + "description": "The time the media was captured. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + } + } + }, + "height": { + "type": "integer", + "description": "The height in pixels of the original image.", + "format": "uint32" + }, + "id": { + "type": "string", + "description": "ID of this media, which is generated by the API." + }, + "kind": { + "type": "string", + "description": "The type of resource.", + "default": "plus#media" + }, + "mediaCreatedTime": { + "type": "string", + "description": "The time at which this media was originally created in UTC. Formatted as an RFC 3339 timestamp that matches this example: 2010-11-25T14:30:27.655Z", + "format": "date-time" + }, + "mediaUrl": { + "type": "string", + "description": "The URL of this photo or video's still image." + }, + "published": { + "type": "string", + "description": "The time at which this media was uploaded. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "sizeBytes": { + "type": "string", + "description": "The size in bytes of this video.", + "format": "int64" + }, + "streams": { + "type": "array", + "description": "The list of video streams for this video. There might be several different streams available for a single video, either Flash or MPEG, of various sizes", + "items": { + "$ref": "Videostream" + } + }, + "summary": { + "type": "string", + "description": "A description, or caption, for this media." + }, + "updated": { + "type": "string", + "description": "The time at which this media was last updated. This includes changes to media metadata. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "url": { + "type": "string", + "description": "The URL for the page that hosts this media." + }, + "videoDuration": { + "type": "string", + "description": "The duration in milliseconds of this video.", + "format": "int64" + }, + "videoStatus": { + "type": "string", + "description": "The encoding status of this video. Possible values are: \n- \"UPLOADING\" - Not all the video bytes have been received. \n- \"PENDING\" - Video not yet processed. \n- \"FAILED\" - Video processing failed. \n- \"READY\" - A single video stream is playable. \n- \"FINAL\" - All video streams are playable." + }, + "width": { + "type": "integer", + "description": "The width in pixels of the original image.", + "format": "uint32" + } + } + }, + "PeopleFeed": { + "id": "PeopleFeed", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The people in this page of results. Each item includes the id, displayName, image, and url for the person. To retrieve additional profile data, see the people.get method.", + "items": { + "$ref": "Person" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of people. Value: \"plus#peopleFeed\".", + "default": "plus#peopleFeed" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "selfLink": { + "type": "string", + "description": "Link to this resource." + }, + "title": { + "type": "string", + "description": "The title of this collection of people." + }, + "totalItems": { + "type": "integer", + "description": "The total number of people available in this list. The number of people in a response might be smaller due to paging. This might not be set for all collections.", + "format": "int32" + } + } + }, + "Person": { + "id": "Person", + "type": "object", + "properties": { + "aboutMe": { + "type": "string", + "description": "A short biography for this person." + }, + "birthday": { + "type": "string", + "description": "The person's date of birth, represented as YYYY-MM-DD." + }, + "braggingRights": { + "type": "string", + "description": "The \"bragging rights\" line of this person." + }, + "circledByCount": { + "type": "integer", + "description": "For followers who are visible, the number of people who have added this person or page to a circle.", + "format": "int32" + }, + "cover": { + "type": "object", + "description": "The cover photo content.", + "properties": { + "coverInfo": { + "type": "object", + "description": "Extra information about the cover photo.", + "properties": { + "leftImageOffset": { + "type": "integer", + "description": "The difference between the left position of the cover image and the actual displayed cover image. Only valid for banner layout.", + "format": "int32" + }, + "topImageOffset": { + "type": "integer", + "description": "The difference between the top position of the cover image and the actual displayed cover image. Only valid for banner layout.", + "format": "int32" + } + } + }, + "coverPhoto": { + "type": "object", + "description": "The person's primary cover image.", + "properties": { + "height": { + "type": "integer", + "description": "The height of the image.", + "format": "int32" + }, + "url": { + "type": "string", + "description": "The URL of the image." + }, + "width": { + "type": "integer", + "description": "The width of the image.", + "format": "int32" + } + } + }, + "layout": { + "type": "string", + "description": "The layout of the cover art. Possible values include, but are not limited to, the following values: \n- \"banner\" - One large image banner." + } + } + }, + "currentLocation": { + "type": "string", + "description": "The current location for this person." + }, + "displayName": { + "type": "string", + "description": "The name of this person, which is suitable for display." + }, + "domain": { + "type": "string", + "description": "The hosted domain name for the user's Google Apps account. For instance, example.com. The plus.profile.emails.read or email scope is needed to get this domain name." + }, + "emails": { + "type": "array", + "description": "A list of email addresses that this person has, including their Google account email address, and the public verified email addresses on their Google+ profile. The plus.profile.emails.read scope is needed to retrieve these email addresses, or the email scope can be used to retrieve just the Google account email address.", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The type of address. Possible values include, but are not limited to, the following values: \n- \"account\" - Google account email address. \n- \"home\" - Home email address. \n- \"work\" - Work email address. \n- \"other\" - Other." + }, + "value": { + "type": "string", + "description": "The email address." + } + } + } + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "gender": { + "type": "string", + "description": "The person's gender. Possible values include, but are not limited to, the following values: \n- \"male\" - Male gender. \n- \"female\" - Female gender. \n- \"other\" - Other." + }, + "id": { + "type": "string", + "description": "The ID of this person." + }, + "image": { + "type": "object", + "description": "The representation of the person's profile photo.", + "properties": { + "url": { + "type": "string", + "description": "The URL of the person's profile photo. To resize the image and crop it to a square, append the query string ?sz=x, where x is the dimension in pixels of each side." + } + } + }, + "isPlusUser": { + "type": "boolean", + "description": "Whether this user has signed up for Google+." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a person. Value: \"plus#person\".", + "default": "plus#person" + }, + "name": { + "type": "object", + "description": "An object representation of the individual components of a person's name.", + "properties": { + "familyName": { + "type": "string", + "description": "The family name (last name) of this person." + }, + "formatted": { + "type": "string", + "description": "The full name of this person, including middle names, suffixes, etc." + }, + "givenName": { + "type": "string", + "description": "The given name (first name) of this person." + }, + "honorificPrefix": { + "type": "string", + "description": "The honorific prefixes (such as \"Dr.\" or \"Mrs.\") for this person." + }, + "honorificSuffix": { + "type": "string", + "description": "The honorific suffixes (such as \"Jr.\") for this person." + }, + "middleName": { + "type": "string", + "description": "The middle name of this person." + } + } + }, + "nickname": { + "type": "string", + "description": "The nickname of this person." + }, + "objectType": { + "type": "string", + "description": "Type of person within Google+. Possible values include, but are not limited to, the following values: \n- \"person\" - represents an actual person. \n- \"page\" - represents a page." + }, + "occupation": { + "type": "string", + "description": "The occupation of this person." + }, + "organizations": { + "type": "array", + "description": "A list of current or past organizations with which this person is associated.", + "items": { + "type": "object", + "properties": { + "department": { + "type": "string", + "description": "The department within the organization. Deprecated." + }, + "description": { + "type": "string", + "description": "A short description of the person's role in this organization. Deprecated." + }, + "endDate": { + "type": "string", + "description": "The date that the person left this organization." + }, + "location": { + "type": "string", + "description": "The location of this organization. Deprecated." + }, + "name": { + "type": "string", + "description": "The name of the organization." + }, + "primary": { + "type": "boolean", + "description": "If \"true\", indicates this organization is the person's primary one, which is typically interpreted as the current one." + }, + "startDate": { + "type": "string", + "description": "The date that the person joined this organization." + }, + "title": { + "type": "string", + "description": "The person's job title or role within the organization." + }, + "type": { + "type": "string", + "description": "The type of organization. Possible values include, but are not limited to, the following values: \n- \"work\" - Work. \n- \"school\" - School." + } + } + } + }, + "placesLived": { + "type": "array", + "description": "A list of places where this person has lived.", + "items": { + "type": "object", + "properties": { + "primary": { + "type": "boolean", + "description": "If \"true\", this place of residence is this person's primary residence." + }, + "value": { + "type": "string", + "description": "A place where this person has lived. For example: \"Seattle, WA\", \"Near Toronto\"." + } + } + } + }, + "plusOneCount": { + "type": "integer", + "description": "If a Google+ Page, the number of people who have +1'd this page.", + "format": "int32" + }, + "relationshipStatus": { + "type": "string", + "description": "The person's relationship status. Possible values include, but are not limited to, the following values: \n- \"single\" - Person is single. \n- \"in_a_relationship\" - Person is in a relationship. \n- \"engaged\" - Person is engaged. \n- \"married\" - Person is married. \n- \"its_complicated\" - The relationship is complicated. \n- \"open_relationship\" - Person is in an open relationship. \n- \"widowed\" - Person is widowed. \n- \"in_domestic_partnership\" - Person is in a domestic partnership. \n- \"in_civil_union\" - Person is in a civil union." + }, + "skills": { + "type": "string", + "description": "The person's skills." + }, + "tagline": { + "type": "string", + "description": "The brief description (tagline) of this person." + }, + "url": { + "type": "string", + "description": "The URL of this person's profile." + }, + "urls": { + "type": "array", + "description": "A list of URLs for this person.", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "The label of the URL." + }, + "type": { + "type": "string", + "description": "The type of URL. Possible values include, but are not limited to, the following values: \n- \"otherProfile\" - URL for another profile. \n- \"contributor\" - URL to a site for which this person is a contributor. \n- \"website\" - URL for this Google+ Page's primary website. \n- \"other\" - Other URL." + }, + "value": { + "type": "string", + "description": "The URL value." + } + } + } + }, + "verified": { + "type": "boolean", + "description": "Whether the person or Google+ Page has been verified." + } + } + }, + "Place": { + "id": "Place", + "type": "object", + "properties": { + "address": { + "type": "object", + "description": "The physical address of the place.", + "properties": { + "formatted": { + "type": "string", + "description": "The formatted address for display." + } + } + }, + "displayName": { + "type": "string", + "description": "The display name of the place." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a place. Value: \"plus#place\".", + "default": "plus#place" + }, + "position": { + "type": "object", + "description": "The position of the place.", + "properties": { + "latitude": { + "type": "number", + "description": "The latitude of this position.", + "format": "double" + }, + "longitude": { + "type": "number", + "description": "The longitude of this position.", + "format": "double" + } + } + } + } + }, + "PlusDomainsAclentryResource": { + "id": "PlusDomainsAclentryResource", + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "A descriptive name for this entry. Suitable for display." + }, + "id": { + "type": "string", + "description": "The ID of the entry. For entries of type \"person\" or \"circle\", this is the ID of the resource. For other types, this property is not set." + }, + "type": { + "type": "string", + "description": "The type of entry describing to whom access is granted. Possible values are: \n- \"person\" - Access to an individual. \n- \"circle\" - Access to members of a circle. \n- \"myCircles\" - Access to members of all the person's circles. \n- \"extendedCircles\" - Access to members of all the person's circles, plus all of the people in their circles. \n- \"domain\" - Access to members of the person's Google Apps domain. \n- \"public\" - Access to anyone on the web." + } + } + }, + "Videostream": { + "id": "Videostream", + "type": "object", + "properties": { + "height": { + "type": "integer", + "description": "The height, in pixels, of the video resource.", + "format": "int32" + }, + "type": { + "type": "string", + "description": "MIME type of the video stream." + }, + "url": { + "type": "string", + "description": "URL of the video stream." + }, + "width": { + "type": "integer", + "description": "The width, in pixels, of the video resource.", + "format": "int32" + } + } + } + }, + "resources": { + "activities": { + "methods": { + "get": { + "id": "plusDomains.activities.get", + "path": "activities/{activityId}", + "httpMethod": "GET", + "description": "Get an activity.", + "parameters": { + "activityId": { + "type": "string", + "description": "The ID of the activity to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "activityId" + ], + "response": { + "$ref": "Activity" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me", + "https://www.googleapis.com/auth/plus.stream.read" + ] + }, + "insert": { + "id": "plusDomains.activities.insert", + "path": "people/{userId}/activities", + "httpMethod": "POST", + "description": "Create a new activity for the authenticated user.", + "parameters": { + "preview": { + "type": "boolean", + "description": "If \"true\", extract the potential media attachments for a URL. The response will include all possible attachments for a URL, including video, photos, and articles based on the content of the page.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user to create the activity on behalf of. Its value should be \"me\", to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "request": { + "$ref": "Activity" + }, + "response": { + "$ref": "Activity" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me", + "https://www.googleapis.com/auth/plus.stream.write" + ] + }, + "list": { + "id": "plusDomains.activities.list", + "path": "people/{userId}/activities/{collection}", + "httpMethod": "GET", + "description": "List all of the activities in the specified collection for a particular user.", + "parameters": { + "collection": { + "type": "string", + "description": "The collection of activities to list.", + "required": true, + "enum": [ + "user" + ], + "enumDescriptions": [ + "All activities created by the specified user that the authenticated user is authorized to view." + ], + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user to get activities for. The special value \"me\" can be used to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "collection" + ], + "response": { + "$ref": "ActivityFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me", + "https://www.googleapis.com/auth/plus.stream.read" + ] + } + } + }, + "audiences": { + "methods": { + "list": { + "id": "plusDomains.audiences.list", + "path": "people/{userId}/audiences", + "httpMethod": "GET", + "description": "List all of the audiences to which a user can share.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of circles to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user to get audiences for. The special value \"me\" can be used to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "AudiencesFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.read", + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me" + ] + } + } + }, + "circles": { + "methods": { + "addPeople": { + "id": "plusDomains.circles.addPeople", + "path": "circles/{circleId}/people", + "httpMethod": "PUT", + "description": "Add a person to a circle. Google+ limits certain circle operations, including the number of circle adds. Learn More.", + "parameters": { + "circleId": { + "type": "string", + "description": "The ID of the circle to add the person to.", + "required": true, + "location": "path" + }, + "email": { + "type": "string", + "description": "Email of the people to add to the circle. Optional, can be repeated.", + "repeated": true, + "location": "query" + }, + "userId": { + "type": "string", + "description": "IDs of the people to add to the circle. Optional, can be repeated.", + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "circleId" + ], + "response": { + "$ref": "Circle" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.write", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "get": { + "id": "plusDomains.circles.get", + "path": "circles/{circleId}", + "httpMethod": "GET", + "description": "Get a circle.", + "parameters": { + "circleId": { + "type": "string", + "description": "The ID of the circle to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "circleId" + ], + "response": { + "$ref": "Circle" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.read", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "insert": { + "id": "plusDomains.circles.insert", + "path": "people/{userId}/circles", + "httpMethod": "POST", + "description": "Create a new circle for the authenticated user.", + "parameters": { + "userId": { + "type": "string", + "description": "The ID of the user to create the circle on behalf of. The value \"me\" can be used to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "request": { + "$ref": "Circle" + }, + "response": { + "$ref": "Circle" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.write", + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me" + ] + }, + "list": { + "id": "plusDomains.circles.list", + "path": "people/{userId}/circles", + "httpMethod": "GET", + "description": "List all of the circles for a user.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of circles to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user to get circles for. The special value \"me\" can be used to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "CircleFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.read", + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me" + ] + }, + "patch": { + "id": "plusDomains.circles.patch", + "path": "circles/{circleId}", + "httpMethod": "PATCH", + "description": "Update a circle's description. This method supports patch semantics.", + "parameters": { + "circleId": { + "type": "string", + "description": "The ID of the circle to update.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "circleId" + ], + "request": { + "$ref": "Circle" + }, + "response": { + "$ref": "Circle" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.write", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "remove": { + "id": "plusDomains.circles.remove", + "path": "circles/{circleId}", + "httpMethod": "DELETE", + "description": "Delete a circle.", + "parameters": { + "circleId": { + "type": "string", + "description": "The ID of the circle to delete.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "circleId" + ], + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.write", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "removePeople": { + "id": "plusDomains.circles.removePeople", + "path": "circles/{circleId}/people", + "httpMethod": "DELETE", + "description": "Remove a person from a circle.", + "parameters": { + "circleId": { + "type": "string", + "description": "The ID of the circle to remove the person from.", + "required": true, + "location": "path" + }, + "email": { + "type": "string", + "description": "Email of the people to add to the circle. Optional, can be repeated.", + "repeated": true, + "location": "query" + }, + "userId": { + "type": "string", + "description": "IDs of the people to remove from the circle. Optional, can be repeated.", + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "circleId" + ], + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.write", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "update": { + "id": "plusDomains.circles.update", + "path": "circles/{circleId}", + "httpMethod": "PUT", + "description": "Update a circle's description.", + "parameters": { + "circleId": { + "type": "string", + "description": "The ID of the circle to update.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "circleId" + ], + "request": { + "$ref": "Circle" + }, + "response": { + "$ref": "Circle" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.write", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + }, + "comments": { + "methods": { + "get": { + "id": "plusDomains.comments.get", + "path": "comments/{commentId}", + "httpMethod": "GET", + "description": "Get a comment.", + "parameters": { + "commentId": { + "type": "string", + "description": "The ID of the comment to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "commentId" + ], + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.stream.read" + ] + }, + "insert": { + "id": "plusDomains.comments.insert", + "path": "activities/{activityId}/comments", + "httpMethod": "POST", + "description": "Create a new comment in reply to an activity.", + "parameters": { + "activityId": { + "type": "string", + "description": "The ID of the activity to reply to.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "activityId" + ], + "request": { + "$ref": "Comment" + }, + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.stream.write" + ] + }, + "list": { + "id": "plusDomains.comments.list", + "path": "activities/{activityId}/comments", + "httpMethod": "GET", + "description": "List all of the comments for an activity.", + "parameters": { + "activityId": { + "type": "string", + "description": "The ID of the activity to get comments for.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of comments to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "The order in which to sort the list of comments.", + "default": "ascending", + "enum": [ + "ascending", + "descending" + ], + "enumDescriptions": [ + "Sort oldest comments first.", + "Sort newest comments first." + ], + "location": "query" + } + }, + "parameterOrder": [ + "activityId" + ], + "response": { + "$ref": "CommentFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.stream.read" + ] + } + } + }, + "media": { + "methods": { + "insert": { + "id": "plusDomains.media.insert", + "path": "people/{userId}/media/{collection}", + "httpMethod": "POST", + "description": "Add a new media item to an album. The current upload size limitations are 36MB for a photo and 1GB for a video. Uploads do not count against quota if photos are less than 2048 pixels on their longest side or videos are less than 15 minutes in length.", + "parameters": { + "collection": { + "type": "string", + "required": true, + "enum": [ + "cloud" + ], + "enumDescriptions": [ + "Upload the media to share on Google+." + ], + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user to create the activity on behalf of.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "collection" + ], + "request": { + "$ref": "Media" + }, + "response": { + "$ref": "Media" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.media.upload" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "image/*", + "video/*" + ], + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/plusDomains/v1/people/{userId}/media/{collection}" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/plusDomains/v1/people/{userId}/media/{collection}" + } + } + } + } + } + }, + "people": { + "methods": { + "get": { + "id": "plusDomains.people.get", + "path": "people/{userId}", + "httpMethod": "GET", + "description": "Get a person's profile.", + "parameters": { + "userId": { + "type": "string", + "description": "The ID of the person to get the profile for. The special value \"me\" can be used to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "Person" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me", + "https://www.googleapis.com/auth/plus.profiles.read", + "https://www.googleapis.com/auth/userinfo.email", + "https://www.googleapis.com/auth/userinfo.profile" + ] + }, + "list": { + "id": "plusDomains.people.list", + "path": "people/{userId}/people/{collection}", + "httpMethod": "GET", + "description": "List all of the people in the specified collection.", + "parameters": { + "collection": { + "type": "string", + "description": "The collection of people to list.", + "required": true, + "enum": [ + "circled" + ], + "enumDescriptions": [ + "The list of people who this user has added to one or more circles." + ], + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "100", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "The order to return people in.", + "enum": [ + "alphabetical", + "best" + ], + "enumDescriptions": [ + "Order the people by their display name.", + "Order people based on the relevence to the viewer." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "Get the collection of people for the person identified. Use \"me\" to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "collection" + ], + "response": { + "$ref": "PeopleFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.read", + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.me" + ] + }, + "listByActivity": { + "id": "plusDomains.people.listByActivity", + "path": "activities/{activityId}/people/{collection}", + "httpMethod": "GET", + "description": "List all of the people in the specified collection for a particular activity.", + "parameters": { + "activityId": { + "type": "string", + "description": "The ID of the activity to get the list of people for.", + "required": true, + "location": "path" + }, + "collection": { + "type": "string", + "description": "The collection of people to list.", + "required": true, + "enum": [ + "plusoners", + "resharers", + "sharedto" + ], + "enumDescriptions": [ + "List all people who have +1'd this activity.", + "List all people who have reshared this activity.", + "List all people who this activity was shared to." + ], + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "activityId", + "collection" + ], + "response": { + "$ref": "PeopleFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/plus.stream.read" + ] + }, + "listByCircle": { + "id": "plusDomains.people.listByCircle", + "path": "circles/{circleId}/people", + "httpMethod": "GET", + "description": "List all of the people who are members of a circle.", + "parameters": { + "circleId": { + "type": "string", + "description": "The ID of the circle to get the members of.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "circleId" + ], + "response": { + "$ref": "PeopleFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.circles.read", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/plusdomains/v1/plusdomains-gen.go b/third_party/src/code.google.com/p/google-api-go-client/plusdomains/v1/plusdomains-gen.go new file mode 100644 index 0000000000000..c91327f615723 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/plusdomains/v1/plusdomains-gen.go @@ -0,0 +1,3085 @@ +// Package plusdomains provides access to the Google+ Domains API. +// +// See https://developers.google.com/+/domains/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/plusdomains/v1" +// ... +// plusdomainsService, err := plusdomains.New(oauthHttpClient) +package plusdomains + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "plusDomains:v1" +const apiName = "plusDomains" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/plusDomains/v1/" + +// OAuth2 scopes used by this API. +const ( + // View your circles and the people and pages in them + PlusCirclesReadScope = "https://www.googleapis.com/auth/plus.circles.read" + + // Manage your circles and add people and pages, who will be notified + // and may appear on your public Google+ profile + PlusCirclesWriteScope = "https://www.googleapis.com/auth/plus.circles.write" + + // Know your basic profile info and list of people in your circles. + PlusLoginScope = "https://www.googleapis.com/auth/plus.login" + + // Know who you are on Google + PlusMeScope = "https://www.googleapis.com/auth/plus.me" + + // Send your photos and videos to Google+ + PlusMediaUploadScope = "https://www.googleapis.com/auth/plus.media.upload" + + // View your own Google+ profile and profiles visible to you + PlusProfilesReadScope = "https://www.googleapis.com/auth/plus.profiles.read" + + // View your Google+ posts, comments, and stream + PlusStreamReadScope = "https://www.googleapis.com/auth/plus.stream.read" + + // Manage your Google+ posts, comments, and stream + PlusStreamWriteScope = "https://www.googleapis.com/auth/plus.stream.write" + + // View your email address + UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email" + + // View basic information about your account + UserinfoProfileScope = "https://www.googleapis.com/auth/userinfo.profile" +) + +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) + s.Audiences = NewAudiencesService(s) + s.Circles = NewCirclesService(s) + s.Comments = NewCommentsService(s) + s.Media = NewMediaService(s) + s.People = NewPeopleService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Activities *ActivitiesService + + Audiences *AudiencesService + + Circles *CirclesService + + Comments *CommentsService + + Media *MediaService + + People *PeopleService +} + +func NewActivitiesService(s *Service) *ActivitiesService { + rs := &ActivitiesService{s: s} + return rs +} + +type ActivitiesService struct { + s *Service +} + +func NewAudiencesService(s *Service) *AudiencesService { + rs := &AudiencesService{s: s} + return rs +} + +type AudiencesService struct { + s *Service +} + +func NewCirclesService(s *Service) *CirclesService { + rs := &CirclesService{s: s} + return rs +} + +type CirclesService struct { + s *Service +} + +func NewCommentsService(s *Service) *CommentsService { + rs := &CommentsService{s: s} + return rs +} + +type CommentsService struct { + s *Service +} + +func NewMediaService(s *Service) *MediaService { + rs := &MediaService{s: s} + return rs +} + +type MediaService struct { + s *Service +} + +func NewPeopleService(s *Service) *PeopleService { + rs := &PeopleService{s: s} + return rs +} + +type PeopleService struct { + s *Service +} + +type Acl struct { + // Description: Description of the access granted, suitable for display. + Description string `json:"description,omitempty"` + + // DomainRestricted: Whether access is restricted to the domain. + DomainRestricted bool `json:"domainRestricted,omitempty"` + + // Items: The list of access entries. + Items []*PlusDomainsAclentryResource `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of access controls. + // Value: "plus#acl". + Kind string `json:"kind,omitempty"` +} + +type Activity struct { + // Access: Identifies who has access to see this activity. + Access *Acl `json:"access,omitempty"` + + // Actor: The person who performed this activity. + Actor *ActivityActor `json:"actor,omitempty"` + + // Address: Street address where this activity occurred. + Address string `json:"address,omitempty"` + + // Annotation: Additional content added by the person who shared this + // activity, applicable only when resharing an activity. + Annotation string `json:"annotation,omitempty"` + + // CrosspostSource: If this activity is a crosspost from another system, + // this property specifies the ID of the original activity. + CrosspostSource string `json:"crosspostSource,omitempty"` + + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Geocode: Latitude and longitude where this activity occurred. Format + // is latitude followed by longitude, space separated. + Geocode string `json:"geocode,omitempty"` + + // Id: The ID of this activity. + Id string `json:"id,omitempty"` + + // Kind: Identifies this resource as an activity. Value: + // "plus#activity". + Kind string `json:"kind,omitempty"` + + // Location: The location where this activity occurred. + Location *Place `json:"location,omitempty"` + + // Object: The object of this activity. + Object *ActivityObject `json:"object,omitempty"` + + // PlaceId: ID of the place where this activity occurred. + PlaceId string `json:"placeId,omitempty"` + + // PlaceName: Name of the place where this activity occurred. + PlaceName string `json:"placeName,omitempty"` + + // Provider: The service provider that initially published this + // activity. + Provider *ActivityProvider `json:"provider,omitempty"` + + // Published: The time at which this activity was initially published. + // Formatted as an RFC 3339 timestamp. + Published string `json:"published,omitempty"` + + // Radius: Radius, in meters, of the region where this activity + // occurred, centered at the latitude and longitude identified in + // geocode. + Radius string `json:"radius,omitempty"` + + // Title: Title of this activity. + Title string `json:"title,omitempty"` + + // Updated: The time at which this activity was last updated. Formatted + // as an RFC 3339 timestamp. + Updated string `json:"updated,omitempty"` + + // Url: The link to this activity. + Url string `json:"url,omitempty"` + + // Verb: This activity's verb, which indicates the action that was + // performed. Possible values include, but are not limited to, the + // following values: + // - "post" - Publish content to the stream. + // - + // "share" - Reshare an activity. + Verb string `json:"verb,omitempty"` +} + +type ActivityActor struct { + // DisplayName: The name of the actor, suitable for display. + DisplayName string `json:"displayName,omitempty"` + + // Id: The ID of the actor's Person resource. + Id string `json:"id,omitempty"` + + // Image: The image representation of the actor. + Image *ActivityActorImage `json:"image,omitempty"` + + // Name: An object representation of the individual components of name. + Name *ActivityActorName `json:"name,omitempty"` + + // Url: The link to the actor's Google profile. + Url string `json:"url,omitempty"` +} + +type ActivityActorImage struct { + // Url: The URL of the actor's profile photo. To resize the image and + // crop it to a square, append the query string ?sz=x, where x is the + // dimension in pixels of each side. + Url string `json:"url,omitempty"` +} + +type ActivityActorName struct { + // FamilyName: The family name ("last name") of the actor. + FamilyName string `json:"familyName,omitempty"` + + // GivenName: The given name ("first name") of the actor. + GivenName string `json:"givenName,omitempty"` +} + +type ActivityObject struct { + // Actor: If this activity's object is itself another activity, such as + // when a person reshares an activity, this property specifies the + // original activity's actor. + Actor *ActivityObjectActor `json:"actor,omitempty"` + + // Attachments: The media objects attached to this activity. + Attachments []*ActivityObjectAttachments `json:"attachments,omitempty"` + + // Content: The HTML-formatted content, which is suitable for display. + Content string `json:"content,omitempty"` + + // Id: The ID of the object. When resharing an activity, this is the ID + // of the activity that is being reshared. + Id string `json:"id,omitempty"` + + // ObjectType: The type of the object. Possible values include, but are + // not limited to, the following values: + // - "note" - Textual content. + // + // - "activity" - A Google+ activity. + ObjectType string `json:"objectType,omitempty"` + + // OriginalContent: The content (text) as provided by the author, which + // is stored without any HTML formatting. When creating or updating an + // activity, this value must be supplied as plain text in the request. + OriginalContent string `json:"originalContent,omitempty"` + + // Plusoners: People who +1'd this activity. + Plusoners *ActivityObjectPlusoners `json:"plusoners,omitempty"` + + // Replies: Comments in reply to this activity. + Replies *ActivityObjectReplies `json:"replies,omitempty"` + + // Resharers: People who reshared this activity. + Resharers *ActivityObjectResharers `json:"resharers,omitempty"` + + // StatusForViewer: Status of the activity as seen by the viewer. + StatusForViewer *ActivityObjectStatusForViewer `json:"statusForViewer,omitempty"` + + // Url: The URL that points to the linked resource. + Url string `json:"url,omitempty"` +} + +type ActivityObjectActor struct { + // DisplayName: The original actor's name, which is suitable for + // display. + DisplayName string `json:"displayName,omitempty"` + + // Id: ID of the original actor. + Id string `json:"id,omitempty"` + + // Image: The image representation of the original actor. + Image *ActivityObjectActorImage `json:"image,omitempty"` + + // Url: A link to the original actor's Google profile. + Url string `json:"url,omitempty"` +} + +type ActivityObjectActorImage struct { + // Url: A URL that points to a thumbnail photo of the original actor. + Url string `json:"url,omitempty"` +} + +type ActivityObjectAttachments struct { + // Content: If the attachment is an article, this property contains a + // snippet of text from the article. It can also include descriptions + // for other types. + Content string `json:"content,omitempty"` + + // DisplayName: The title of the attachment, such as a photo caption or + // an article title. + DisplayName string `json:"displayName,omitempty"` + + // Embed: If the attachment is a video, the embeddable link. + Embed *ActivityObjectAttachmentsEmbed `json:"embed,omitempty"` + + // FullImage: The full image URL for photo attachments. + FullImage *ActivityObjectAttachmentsFullImage `json:"fullImage,omitempty"` + + // Id: The ID of the attachment. + Id string `json:"id,omitempty"` + + // Image: The preview image for photos or videos. + Image *ActivityObjectAttachmentsImage `json:"image,omitempty"` + + // ObjectType: The type of media object. Possible values include, but + // are not limited to, the following values: + // - "photo" - A photo. + // - + // "album" - A photo album. + // - "video" - A video. + // - "article" - An + // article, specified by a link. + ObjectType string `json:"objectType,omitempty"` + + // PreviewThumbnails: When previewing, these are the optional thumbnails + // for the post. When posting an article, choose one by setting the + // attachment.image.url property. If you don't choose one, one will be + // chosen for you. + PreviewThumbnails []*ActivityObjectAttachmentsPreviewThumbnails `json:"previewThumbnails,omitempty"` + + // Thumbnails: If the attachment is an album, this property is a list of + // potential additional thumbnails from the album. + Thumbnails []*ActivityObjectAttachmentsThumbnails `json:"thumbnails,omitempty"` + + // Url: The link to the attachment, which should be of type text/html. + Url string `json:"url,omitempty"` +} + +type ActivityObjectAttachmentsEmbed struct { + // Type: Media type of the link. + Type string `json:"type,omitempty"` + + // Url: URL of the link. + Url string `json:"url,omitempty"` +} + +type ActivityObjectAttachmentsFullImage struct { + // Height: The height, in pixels, of the linked resource. + Height int64 `json:"height,omitempty"` + + // Type: Media type of the link. + Type string `json:"type,omitempty"` + + // Url: URL of the image. + Url string `json:"url,omitempty"` + + // Width: The width, in pixels, of the linked resource. + Width int64 `json:"width,omitempty"` +} + +type ActivityObjectAttachmentsImage struct { + // Height: The height, in pixels, of the linked resource. + Height int64 `json:"height,omitempty"` + + // Type: Media type of the link. + Type string `json:"type,omitempty"` + + // Url: Image URL. + Url string `json:"url,omitempty"` + + // Width: The width, in pixels, of the linked resource. + Width int64 `json:"width,omitempty"` +} + +type ActivityObjectAttachmentsPreviewThumbnails struct { + // Url: URL of the thumbnail image. + Url string `json:"url,omitempty"` +} + +type ActivityObjectAttachmentsThumbnails struct { + // Description: Potential name of the thumbnail. + Description string `json:"description,omitempty"` + + // Image: Image resource. + Image *ActivityObjectAttachmentsThumbnailsImage `json:"image,omitempty"` + + // Url: URL of the webpage containing the image. + Url string `json:"url,omitempty"` +} + +type ActivityObjectAttachmentsThumbnailsImage struct { + // Height: The height, in pixels, of the linked resource. + Height int64 `json:"height,omitempty"` + + // Type: Media type of the link. + Type string `json:"type,omitempty"` + + // Url: Image url. + Url string `json:"url,omitempty"` + + // Width: The width, in pixels, of the linked resource. + Width int64 `json:"width,omitempty"` +} + +type ActivityObjectPlusoners struct { + // SelfLink: The URL for the collection of people who +1'd this + // activity. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: Total number of people who +1'd this activity. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type ActivityObjectReplies struct { + // SelfLink: The URL for the collection of comments in reply to this + // activity. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: Total number of comments on this activity. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type ActivityObjectResharers struct { + // SelfLink: The URL for the collection of resharers. + SelfLink string `json:"selfLink,omitempty"` + + // TotalItems: Total number of people who reshared this activity. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type ActivityObjectStatusForViewer struct { + // CanComment: Whether the viewer can comment on the activity. + CanComment bool `json:"canComment,omitempty"` + + // CanPlusone: Whether the viewer can +1 the activity. + CanPlusone bool `json:"canPlusone,omitempty"` + + // CanUpdate: Whether the viewer can edit or delete the activity. + CanUpdate bool `json:"canUpdate,omitempty"` + + // IsPlusOned: Whether the viewer has +1'd the activity. + IsPlusOned bool `json:"isPlusOned,omitempty"` + + // ResharingDisabled: Whether reshares are disabled for the activity. + ResharingDisabled bool `json:"resharingDisabled,omitempty"` +} + +type ActivityProvider struct { + // Title: Name of the service provider. + Title string `json:"title,omitempty"` +} + +type ActivityFeed struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Id: The ID of this collection of activities. Deprecated. + Id string `json:"id,omitempty"` + + // Items: The activities in this page of results. + Items []*Activity `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of activities. Value: + // "plus#activityFeed". + Kind string `json:"kind,omitempty"` + + // NextLink: Link to the next page of activities. + NextLink string `json:"nextLink,omitempty"` + + // NextPageToken: The continuation token, which is used to page through + // large result sets. Provide this value in a subsequent request to + // return the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Link to this activity resource. + SelfLink string `json:"selfLink,omitempty"` + + // Title: The title of this collection of activities, which is a + // truncated portion of the content. + Title string `json:"title,omitempty"` + + // Updated: The time at which this collection of activities was last + // updated. Formatted as an RFC 3339 timestamp. + Updated string `json:"updated,omitempty"` +} + +type Audience struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Item: The access control list entry. + Item *PlusDomainsAclentryResource `json:"item,omitempty"` + + // Kind: Identifies this resource as an audience. Value: + // "plus#audience". + Kind string `json:"kind,omitempty"` + + // MemberCount: The number of people in this circle. This only applies + // if entity_type is CIRCLE. + MemberCount int64 `json:"memberCount,omitempty"` + + // Visibility: The circle members' visibility as chosen by the owner of + // the circle. This only applies for items with "item.type" equals + // "circle". Possible values are: + // - "public" - Members are visible to + // the public. + // - "limited" - Members are visible to a limited audience. + // + // - "private" - Members are visible to the owner only. + Visibility string `json:"visibility,omitempty"` +} + +type AudiencesFeed struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The audiences in this result. + Items []*Audience `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of audiences. Value: + // "plus#audienceFeed". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The continuation token, which is used to page through + // large result sets. Provide this value in a subsequent request to + // return the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TotalItems: The total number of ACL entries. The number of entries in + // this response may be smaller due to paging. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type Circle struct { + // Description: The description of this circle. + Description string `json:"description,omitempty"` + + // DisplayName: The circle name. + DisplayName string `json:"displayName,omitempty"` + + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Id: The ID of the circle. + Id string `json:"id,omitempty"` + + // Kind: Identifies this resource as a circle. Value: "plus#circle". + Kind string `json:"kind,omitempty"` + + // People: The people in this circle. + People *CirclePeople `json:"people,omitempty"` + + // SelfLink: Link to this circle resource + SelfLink string `json:"selfLink,omitempty"` +} + +type CirclePeople struct { + // TotalItems: The total number of people in this circle. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type CircleFeed struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The circles in this page of results. + Items []*Circle `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of circles. Value: + // "plus#circleFeed". + Kind string `json:"kind,omitempty"` + + // NextLink: Link to the next page of circles. + NextLink string `json:"nextLink,omitempty"` + + // NextPageToken: The continuation token, which is used to page through + // large result sets. Provide this value in a subsequent request to + // return the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Link to this page of circles. + SelfLink string `json:"selfLink,omitempty"` + + // Title: The title of this list of resources. + Title string `json:"title,omitempty"` + + // TotalItems: The total number of circles. The number of circles in + // this response may be smaller due to paging. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type Comment struct { + // Actor: The person who posted this comment. + Actor *CommentActor `json:"actor,omitempty"` + + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Id: The ID of this comment. + Id string `json:"id,omitempty"` + + // InReplyTo: The activity this comment replied to. + InReplyTo []*CommentInReplyTo `json:"inReplyTo,omitempty"` + + // Kind: Identifies this resource as a comment. Value: "plus#comment". + Kind string `json:"kind,omitempty"` + + // Object: The object of this comment. + Object *CommentObject `json:"object,omitempty"` + + // Plusoners: People who +1'd this comment. + Plusoners *CommentPlusoners `json:"plusoners,omitempty"` + + // Published: The time at which this comment was initially published. + // Formatted as an RFC 3339 timestamp. + Published string `json:"published,omitempty"` + + // SelfLink: Link to this comment resource. + SelfLink string `json:"selfLink,omitempty"` + + // Updated: The time at which this comment was last updated. Formatted + // as an RFC 3339 timestamp. + Updated string `json:"updated,omitempty"` + + // Verb: This comment's verb, indicating what action was performed. + // Possible values are: + // - "post" - Publish content to the stream. + Verb string `json:"verb,omitempty"` +} + +type CommentActor struct { + // DisplayName: The name of this actor, suitable for display. + DisplayName string `json:"displayName,omitempty"` + + // Id: The ID of the actor. + Id string `json:"id,omitempty"` + + // Image: The image representation of this actor. + Image *CommentActorImage `json:"image,omitempty"` + + // Url: A link to the Person resource for this actor. + Url string `json:"url,omitempty"` +} + +type CommentActorImage struct { + // Url: The URL of the actor's profile photo. To resize the image and + // crop it to a square, append the query string ?sz=x, where x is the + // dimension in pixels of each side. + Url string `json:"url,omitempty"` +} + +type CommentInReplyTo struct { + // Id: The ID of the activity. + Id string `json:"id,omitempty"` + + // Url: The URL of the activity. + Url string `json:"url,omitempty"` +} + +type CommentObject struct { + // Content: The HTML-formatted content, suitable for display. + Content string `json:"content,omitempty"` + + // ObjectType: The object type of this comment. Possible values are: + // - + // "comment" - A comment in reply to an activity. + ObjectType string `json:"objectType,omitempty"` + + // OriginalContent: The content (text) as provided by the author, stored + // without any HTML formatting. When creating or updating a comment, + // this value must be supplied as plain text in the request. + OriginalContent string `json:"originalContent,omitempty"` +} + +type CommentPlusoners struct { + // TotalItems: Total number of people who +1'd this comment. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type CommentFeed struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Id: The ID of this collection of comments. + Id string `json:"id,omitempty"` + + // Items: The comments in this page of results. + Items []*Comment `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of comments. Value: + // "plus#commentFeed". + Kind string `json:"kind,omitempty"` + + // NextLink: Link to the next page of activities. + NextLink string `json:"nextLink,omitempty"` + + // NextPageToken: The continuation token, which is used to page through + // large result sets. Provide this value in a subsequent request to + // return the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Title: The title of this collection of comments. + Title string `json:"title,omitempty"` + + // Updated: The time at which this collection of comments was last + // updated. Formatted as an RFC 3339 timestamp. + Updated string `json:"updated,omitempty"` +} + +type Media struct { + // Author: The person who uploaded this media. + Author *MediaAuthor `json:"author,omitempty"` + + // DisplayName: The display name for this media. + DisplayName string `json:"displayName,omitempty"` + + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Exif: Exif information of the media item. + Exif *MediaExif `json:"exif,omitempty"` + + // Height: The height in pixels of the original image. + Height int64 `json:"height,omitempty"` + + // Id: ID of this media, which is generated by the API. + Id string `json:"id,omitempty"` + + // Kind: The type of resource. + Kind string `json:"kind,omitempty"` + + // MediaCreatedTime: The time at which this media was originally created + // in UTC. Formatted as an RFC 3339 timestamp that matches this example: + // 2010-11-25T14:30:27.655Z + MediaCreatedTime string `json:"mediaCreatedTime,omitempty"` + + // MediaUrl: The URL of this photo or video's still image. + MediaUrl string `json:"mediaUrl,omitempty"` + + // Published: The time at which this media was uploaded. Formatted as an + // RFC 3339 timestamp. + Published string `json:"published,omitempty"` + + // SizeBytes: The size in bytes of this video. + SizeBytes int64 `json:"sizeBytes,omitempty,string"` + + // Streams: The list of video streams for this video. There might be + // several different streams available for a single video, either Flash + // or MPEG, of various sizes + Streams []*Videostream `json:"streams,omitempty"` + + // Summary: A description, or caption, for this media. + Summary string `json:"summary,omitempty"` + + // Updated: The time at which this media was last updated. This includes + // changes to media metadata. Formatted as an RFC 3339 timestamp. + Updated string `json:"updated,omitempty"` + + // Url: The URL for the page that hosts this media. + Url string `json:"url,omitempty"` + + // VideoDuration: The duration in milliseconds of this video. + VideoDuration int64 `json:"videoDuration,omitempty,string"` + + // VideoStatus: The encoding status of this video. Possible values are: + // + // - "UPLOADING" - Not all the video bytes have been received. + // - + // "PENDING" - Video not yet processed. + // - "FAILED" - Video processing + // failed. + // - "READY" - A single video stream is playable. + // - "FINAL" - + // All video streams are playable. + VideoStatus string `json:"videoStatus,omitempty"` + + // Width: The width in pixels of the original image. + Width int64 `json:"width,omitempty"` +} + +type MediaAuthor struct { + // DisplayName: The author's name. + DisplayName string `json:"displayName,omitempty"` + + // Id: ID of the author. + Id string `json:"id,omitempty"` + + // Image: The author's Google profile image. + Image *MediaAuthorImage `json:"image,omitempty"` + + // Url: A link to the author's Google profile. + Url string `json:"url,omitempty"` +} + +type MediaAuthorImage struct { + // Url: The URL of the author's profile photo. To resize the image and + // crop it to a square, append the query string ?sz=x, where x is the + // dimension in pixels of each side. + Url string `json:"url,omitempty"` +} + +type MediaExif struct { + // Time: The time the media was captured. Formatted as an RFC 3339 + // timestamp. + Time string `json:"time,omitempty"` +} + +type PeopleFeed struct { + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Items: The people in this page of results. Each item includes the id, + // displayName, image, and url for the person. To retrieve additional + // profile data, see the people.get method. + Items []*Person `json:"items,omitempty"` + + // Kind: Identifies this resource as a collection of people. Value: + // "plus#peopleFeed". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The continuation token, which is used to page through + // large result sets. Provide this value in a subsequent request to + // return the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Link to this resource. + SelfLink string `json:"selfLink,omitempty"` + + // Title: The title of this collection of people. + Title string `json:"title,omitempty"` + + // TotalItems: The total number of people available in this list. The + // number of people in a response might be smaller due to paging. This + // might not be set for all collections. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type Person struct { + // AboutMe: A short biography for this person. + AboutMe string `json:"aboutMe,omitempty"` + + // Birthday: The person's date of birth, represented as YYYY-MM-DD. + Birthday string `json:"birthday,omitempty"` + + // BraggingRights: The "bragging rights" line of this person. + BraggingRights string `json:"braggingRights,omitempty"` + + // CircledByCount: For followers who are visible, the number of people + // who have added this person or page to a circle. + CircledByCount int64 `json:"circledByCount,omitempty"` + + // Cover: The cover photo content. + Cover *PersonCover `json:"cover,omitempty"` + + // CurrentLocation: The current location for this person. + CurrentLocation string `json:"currentLocation,omitempty"` + + // DisplayName: The name of this person, which is suitable for display. + DisplayName string `json:"displayName,omitempty"` + + // Domain: The hosted domain name for the user's Google Apps account. + // For instance, example.com. The plus.profile.emails.read or email + // scope is needed to get this domain name. + Domain string `json:"domain,omitempty"` + + // Emails: A list of email addresses that this person has, including + // their Google account email address, and the public verified email + // addresses on their Google+ profile. The plus.profile.emails.read + // scope is needed to retrieve these email addresses, or the email scope + // can be used to retrieve just the Google account email address. + Emails []*PersonEmails `json:"emails,omitempty"` + + // Etag: ETag of this response for caching purposes. + Etag string `json:"etag,omitempty"` + + // Gender: The person's gender. Possible values include, but are not + // limited to, the following values: + // - "male" - Male gender. + // - + // "female" - Female gender. + // - "other" - Other. + Gender string `json:"gender,omitempty"` + + // Id: The ID of this person. + Id string `json:"id,omitempty"` + + // Image: The representation of the person's profile photo. + Image *PersonImage `json:"image,omitempty"` + + // IsPlusUser: Whether this user has signed up for Google+. + IsPlusUser bool `json:"isPlusUser,omitempty"` + + // Kind: Identifies this resource as a person. Value: "plus#person". + Kind string `json:"kind,omitempty"` + + // Name: An object representation of the individual components of a + // person's name. + Name *PersonName `json:"name,omitempty"` + + // Nickname: The nickname of this person. + Nickname string `json:"nickname,omitempty"` + + // ObjectType: Type of person within Google+. Possible values include, + // but are not limited to, the following values: + // - "person" - + // represents an actual person. + // - "page" - represents a page. + ObjectType string `json:"objectType,omitempty"` + + // Occupation: The occupation of this person. + Occupation string `json:"occupation,omitempty"` + + // Organizations: A list of current or past organizations with which + // this person is associated. + Organizations []*PersonOrganizations `json:"organizations,omitempty"` + + // PlacesLived: A list of places where this person has lived. + PlacesLived []*PersonPlacesLived `json:"placesLived,omitempty"` + + // PlusOneCount: If a Google+ Page, the number of people who have +1'd + // this page. + PlusOneCount int64 `json:"plusOneCount,omitempty"` + + // RelationshipStatus: The person's relationship status. Possible values + // include, but are not limited to, the following values: + // - "single" - + // Person is single. + // - "in_a_relationship" - Person is in a + // relationship. + // - "engaged" - Person is engaged. + // - "married" - Person + // is married. + // - "its_complicated" - The relationship is complicated. + // + // - "open_relationship" - Person is in an open relationship. + // - + // "widowed" - Person is widowed. + // - "in_domestic_partnership" - Person + // is in a domestic partnership. + // - "in_civil_union" - Person is in a + // civil union. + RelationshipStatus string `json:"relationshipStatus,omitempty"` + + // Skills: The person's skills. + Skills string `json:"skills,omitempty"` + + // Tagline: The brief description (tagline) of this person. + Tagline string `json:"tagline,omitempty"` + + // Url: The URL of this person's profile. + Url string `json:"url,omitempty"` + + // Urls: A list of URLs for this person. + Urls []*PersonUrls `json:"urls,omitempty"` + + // Verified: Whether the person or Google+ Page has been verified. + Verified bool `json:"verified,omitempty"` +} + +type PersonCover struct { + // CoverInfo: Extra information about the cover photo. + CoverInfo *PersonCoverCoverInfo `json:"coverInfo,omitempty"` + + // CoverPhoto: The person's primary cover image. + CoverPhoto *PersonCoverCoverPhoto `json:"coverPhoto,omitempty"` + + // Layout: The layout of the cover art. Possible values include, but are + // not limited to, the following values: + // - "banner" - One large image + // banner. + Layout string `json:"layout,omitempty"` +} + +type PersonCoverCoverInfo struct { + // LeftImageOffset: The difference between the left position of the + // cover image and the actual displayed cover image. Only valid for + // banner layout. + LeftImageOffset int64 `json:"leftImageOffset,omitempty"` + + // TopImageOffset: The difference between the top position of the cover + // image and the actual displayed cover image. Only valid for banner + // layout. + TopImageOffset int64 `json:"topImageOffset,omitempty"` +} + +type PersonCoverCoverPhoto struct { + // Height: The height of the image. + Height int64 `json:"height,omitempty"` + + // Url: The URL of the image. + Url string `json:"url,omitempty"` + + // Width: The width of the image. + Width int64 `json:"width,omitempty"` +} + +type PersonEmails struct { + // Type: The type of address. Possible values include, but are not + // limited to, the following values: + // - "account" - Google account + // email address. + // - "home" - Home email address. + // - "work" - Work email + // address. + // - "other" - Other. + Type string `json:"type,omitempty"` + + // Value: The email address. + Value string `json:"value,omitempty"` +} + +type PersonImage struct { + // Url: The URL of the person's profile photo. To resize the image and + // crop it to a square, append the query string ?sz=x, where x is the + // dimension in pixels of each side. + Url string `json:"url,omitempty"` +} + +type PersonName struct { + // FamilyName: The family name (last name) of this person. + FamilyName string `json:"familyName,omitempty"` + + // Formatted: The full name of this person, including middle names, + // suffixes, etc. + Formatted string `json:"formatted,omitempty"` + + // GivenName: The given name (first name) of this person. + GivenName string `json:"givenName,omitempty"` + + // HonorificPrefix: The honorific prefixes (such as "Dr." or "Mrs.") for + // this person. + HonorificPrefix string `json:"honorificPrefix,omitempty"` + + // HonorificSuffix: The honorific suffixes (such as "Jr.") for this + // person. + HonorificSuffix string `json:"honorificSuffix,omitempty"` + + // MiddleName: The middle name of this person. + MiddleName string `json:"middleName,omitempty"` +} + +type PersonOrganizations struct { + // Department: The department within the organization. Deprecated. + Department string `json:"department,omitempty"` + + // Description: A short description of the person's role in this + // organization. Deprecated. + Description string `json:"description,omitempty"` + + // EndDate: The date that the person left this organization. + EndDate string `json:"endDate,omitempty"` + + // Location: The location of this organization. Deprecated. + Location string `json:"location,omitempty"` + + // Name: The name of the organization. + Name string `json:"name,omitempty"` + + // Primary: If "true", indicates this organization is the person's + // primary one, which is typically interpreted as the current one. + Primary bool `json:"primary,omitempty"` + + // StartDate: The date that the person joined this organization. + StartDate string `json:"startDate,omitempty"` + + // Title: The person's job title or role within the organization. + Title string `json:"title,omitempty"` + + // Type: The type of organization. Possible values include, but are not + // limited to, the following values: + // - "work" - Work. + // - "school" - + // School. + Type string `json:"type,omitempty"` +} + +type PersonPlacesLived struct { + // Primary: If "true", this place of residence is this person's primary + // residence. + Primary bool `json:"primary,omitempty"` + + // Value: A place where this person has lived. For example: "Seattle, + // WA", "Near Toronto". + Value string `json:"value,omitempty"` +} + +type PersonUrls struct { + // Label: The label of the URL. + Label string `json:"label,omitempty"` + + // Type: The type of URL. Possible values include, but are not limited + // to, the following values: + // - "otherProfile" - URL for another + // profile. + // - "contributor" - URL to a site for which this person is a + // contributor. + // - "website" - URL for this Google+ Page's primary + // website. + // - "other" - Other URL. + Type string `json:"type,omitempty"` + + // Value: The URL value. + Value string `json:"value,omitempty"` +} + +type Place struct { + // Address: The physical address of the place. + Address *PlaceAddress `json:"address,omitempty"` + + // DisplayName: The display name of the place. + DisplayName string `json:"displayName,omitempty"` + + // Kind: Identifies this resource as a place. Value: "plus#place". + Kind string `json:"kind,omitempty"` + + // Position: The position of the place. + Position *PlacePosition `json:"position,omitempty"` +} + +type PlaceAddress struct { + // Formatted: The formatted address for display. + Formatted string `json:"formatted,omitempty"` +} + +type PlacePosition struct { + // Latitude: The latitude of this position. + Latitude float64 `json:"latitude,omitempty"` + + // Longitude: The longitude of this position. + Longitude float64 `json:"longitude,omitempty"` +} + +type PlusDomainsAclentryResource struct { + // DisplayName: A descriptive name for this entry. Suitable for display. + DisplayName string `json:"displayName,omitempty"` + + // Id: The ID of the entry. For entries of type "person" or "circle", + // this is the ID of the resource. For other types, this property is not + // set. + Id string `json:"id,omitempty"` + + // Type: The type of entry describing to whom access is granted. + // Possible values are: + // - "person" - Access to an individual. + // - + // "circle" - Access to members of a circle. + // - "myCircles" - Access to + // members of all the person's circles. + // - "extendedCircles" - Access to + // members of all the person's circles, plus all of the people in their + // circles. + // - "domain" - Access to members of the person's Google Apps + // domain. + // - "public" - Access to anyone on the web. + Type string `json:"type,omitempty"` +} + +type Videostream struct { + // Height: The height, in pixels, of the video resource. + Height int64 `json:"height,omitempty"` + + // Type: MIME type of the video stream. + Type string `json:"type,omitempty"` + + // Url: URL of the video stream. + Url string `json:"url,omitempty"` + + // Width: The width, in pixels, of the video resource. + Width int64 `json:"width,omitempty"` +} + +// method id "plusDomains.activities.get": + +type ActivitiesGetCall struct { + s *Service + activityId string + opt_ map[string]interface{} +} + +// Get: Get an activity. +func (r *ActivitiesService) Get(activityId string) *ActivitiesGetCall { + c := &ActivitiesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.activityId = activityId + return c +} + +func (c *ActivitiesGetCall) Do() (*Activity, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{activityId}", url.QueryEscape(c.activityId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Activity) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get an activity.", + // "httpMethod": "GET", + // "id": "plusDomains.activities.get", + // "parameterOrder": [ + // "activityId" + // ], + // "parameters": { + // "activityId": { + // "description": "The ID of the activity to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "activities/{activityId}", + // "response": { + // "$ref": "Activity" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me", + // "https://www.googleapis.com/auth/plus.stream.read" + // ] + // } + +} + +// method id "plusDomains.activities.insert": + +type ActivitiesInsertCall struct { + s *Service + userId string + activity *Activity + opt_ map[string]interface{} +} + +// Insert: Create a new activity for the authenticated user. +func (r *ActivitiesService) Insert(userId string, activity *Activity) *ActivitiesInsertCall { + c := &ActivitiesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.activity = activity + return c +} + +// Preview sets the optional parameter "preview": If "true", extract the +// potential media attachments for a URL. The response will include all +// possible attachments for a URL, including video, photos, and articles +// based on the content of the page. +func (c *ActivitiesInsertCall) Preview(preview bool) *ActivitiesInsertCall { + c.opt_["preview"] = preview + return c +} + +func (c *ActivitiesInsertCall) Do() (*Activity, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.activity) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["preview"]; ok { + params.Set("preview", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/activities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Activity) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a new activity for the authenticated user.", + // "httpMethod": "POST", + // "id": "plusDomains.activities.insert", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "preview": { + // "description": "If \"true\", extract the potential media attachments for a URL. The response will include all possible attachments for a URL, including video, photos, and articles based on the content of the page.", + // "location": "query", + // "type": "boolean" + // }, + // "userId": { + // "description": "The ID of the user to create the activity on behalf of. Its value should be \"me\", to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/activities", + // "request": { + // "$ref": "Activity" + // }, + // "response": { + // "$ref": "Activity" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me", + // "https://www.googleapis.com/auth/plus.stream.write" + // ] + // } + +} + +// method id "plusDomains.activities.list": + +type ActivitiesListCall struct { + s *Service + userId string + collection string + opt_ map[string]interface{} +} + +// List: List all of the activities in the specified collection for a +// particular user. +func (r *ActivitiesService) List(userId string, collection string) *ActivitiesListCall { + c := &ActivitiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.collection = collection + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of activities to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *ActivitiesListCall) MaxResults(maxResults int64) *ActivitiesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *ActivitiesListCall) PageToken(pageToken string) *ActivitiesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *ActivitiesListCall) Do() (*ActivityFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/activities/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{collection}", url.QueryEscape(c.collection), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ActivityFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the activities in the specified collection for a particular user.", + // "httpMethod": "GET", + // "id": "plusDomains.activities.list", + // "parameterOrder": [ + // "userId", + // "collection" + // ], + // "parameters": { + // "collection": { + // "description": "The collection of activities to list.", + // "enum": [ + // "user" + // ], + // "enumDescriptions": [ + // "All activities created by the specified user that the authenticated user is authorized to view." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "20", + // "description": "The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user to get activities for. The special value \"me\" can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/activities/{collection}", + // "response": { + // "$ref": "ActivityFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me", + // "https://www.googleapis.com/auth/plus.stream.read" + // ] + // } + +} + +// method id "plusDomains.audiences.list": + +type AudiencesListCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// List: List all of the audiences to which a user can share. +func (r *AudiencesService) List(userId string) *AudiencesListCall { + c := &AudiencesListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of circles to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *AudiencesListCall) MaxResults(maxResults int64) *AudiencesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *AudiencesListCall) PageToken(pageToken string) *AudiencesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *AudiencesListCall) Do() (*AudiencesFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/audiences") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(AudiencesFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the audiences to which a user can share.", + // "httpMethod": "GET", + // "id": "plusDomains.audiences.list", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "maxResults": { + // "default": "20", + // "description": "The maximum number of circles to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user to get audiences for. The special value \"me\" can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/audiences", + // "response": { + // "$ref": "AudiencesFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.read", + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me" + // ] + // } + +} + +// method id "plusDomains.circles.addPeople": + +type CirclesAddPeopleCall struct { + s *Service + circleId string + opt_ map[string]interface{} +} + +// AddPeople: Add a person to a circle. Google+ limits certain circle +// operations, including the number of circle adds. Learn More. +func (r *CirclesService) AddPeople(circleId string) *CirclesAddPeopleCall { + c := &CirclesAddPeopleCall{s: r.s, opt_: make(map[string]interface{})} + c.circleId = circleId + return c +} + +// Email sets the optional parameter "email": Email of the people to add +// to the circle. Optional, can be repeated. +func (c *CirclesAddPeopleCall) Email(email string) *CirclesAddPeopleCall { + c.opt_["email"] = email + return c +} + +// UserId sets the optional parameter "userId": IDs of the people to add +// to the circle. Optional, can be repeated. +func (c *CirclesAddPeopleCall) UserId(userId string) *CirclesAddPeopleCall { + c.opt_["userId"] = userId + return c +} + +func (c *CirclesAddPeopleCall) Do() (*Circle, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["email"]; ok { + params.Set("email", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["userId"]; ok { + params.Set("userId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "circles/{circleId}/people") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{circleId}", url.QueryEscape(c.circleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Circle) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add a person to a circle. Google+ limits certain circle operations, including the number of circle adds. Learn More.", + // "httpMethod": "PUT", + // "id": "plusDomains.circles.addPeople", + // "parameterOrder": [ + // "circleId" + // ], + // "parameters": { + // "circleId": { + // "description": "The ID of the circle to add the person to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "email": { + // "description": "Email of the people to add to the circle. Optional, can be repeated.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "userId": { + // "description": "IDs of the people to add to the circle. Optional, can be repeated.", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "circles/{circleId}/people", + // "response": { + // "$ref": "Circle" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.write", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "plusDomains.circles.get": + +type CirclesGetCall struct { + s *Service + circleId string + opt_ map[string]interface{} +} + +// Get: Get a circle. +func (r *CirclesService) Get(circleId string) *CirclesGetCall { + c := &CirclesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.circleId = circleId + return c +} + +func (c *CirclesGetCall) Do() (*Circle, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "circles/{circleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{circleId}", url.QueryEscape(c.circleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Circle) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a circle.", + // "httpMethod": "GET", + // "id": "plusDomains.circles.get", + // "parameterOrder": [ + // "circleId" + // ], + // "parameters": { + // "circleId": { + // "description": "The ID of the circle to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "circles/{circleId}", + // "response": { + // "$ref": "Circle" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.read", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "plusDomains.circles.insert": + +type CirclesInsertCall struct { + s *Service + userId string + circle *Circle + opt_ map[string]interface{} +} + +// Insert: Create a new circle for the authenticated user. +func (r *CirclesService) Insert(userId string, circle *Circle) *CirclesInsertCall { + c := &CirclesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.circle = circle + return c +} + +func (c *CirclesInsertCall) Do() (*Circle, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.circle) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/circles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Circle) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a new circle for the authenticated user.", + // "httpMethod": "POST", + // "id": "plusDomains.circles.insert", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "description": "The ID of the user to create the circle on behalf of. The value \"me\" can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/circles", + // "request": { + // "$ref": "Circle" + // }, + // "response": { + // "$ref": "Circle" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.write", + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me" + // ] + // } + +} + +// method id "plusDomains.circles.list": + +type CirclesListCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// List: List all of the circles for a user. +func (r *CirclesService) List(userId string) *CirclesListCall { + c := &CirclesListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of circles to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *CirclesListCall) MaxResults(maxResults int64) *CirclesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *CirclesListCall) PageToken(pageToken string) *CirclesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *CirclesListCall) Do() (*CircleFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/circles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CircleFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the circles for a user.", + // "httpMethod": "GET", + // "id": "plusDomains.circles.list", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "maxResults": { + // "default": "20", + // "description": "The maximum number of circles to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user to get circles for. The special value \"me\" can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/circles", + // "response": { + // "$ref": "CircleFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.read", + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me" + // ] + // } + +} + +// method id "plusDomains.circles.patch": + +type CirclesPatchCall struct { + s *Service + circleId string + circle *Circle + opt_ map[string]interface{} +} + +// Patch: Update a circle's description. This method supports patch +// semantics. +func (r *CirclesService) Patch(circleId string, circle *Circle) *CirclesPatchCall { + c := &CirclesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.circleId = circleId + c.circle = circle + return c +} + +func (c *CirclesPatchCall) Do() (*Circle, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.circle) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "circles/{circleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{circleId}", url.QueryEscape(c.circleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Circle) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a circle's description. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "plusDomains.circles.patch", + // "parameterOrder": [ + // "circleId" + // ], + // "parameters": { + // "circleId": { + // "description": "The ID of the circle to update.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "circles/{circleId}", + // "request": { + // "$ref": "Circle" + // }, + // "response": { + // "$ref": "Circle" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.write", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "plusDomains.circles.remove": + +type CirclesRemoveCall struct { + s *Service + circleId string + opt_ map[string]interface{} +} + +// Remove: Delete a circle. +func (r *CirclesService) Remove(circleId string) *CirclesRemoveCall { + c := &CirclesRemoveCall{s: r.s, opt_: make(map[string]interface{})} + c.circleId = circleId + return c +} + +func (c *CirclesRemoveCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "circles/{circleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{circleId}", url.QueryEscape(c.circleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a circle.", + // "httpMethod": "DELETE", + // "id": "plusDomains.circles.remove", + // "parameterOrder": [ + // "circleId" + // ], + // "parameters": { + // "circleId": { + // "description": "The ID of the circle to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "circles/{circleId}", + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.write", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "plusDomains.circles.removePeople": + +type CirclesRemovePeopleCall struct { + s *Service + circleId string + opt_ map[string]interface{} +} + +// RemovePeople: Remove a person from a circle. +func (r *CirclesService) RemovePeople(circleId string) *CirclesRemovePeopleCall { + c := &CirclesRemovePeopleCall{s: r.s, opt_: make(map[string]interface{})} + c.circleId = circleId + return c +} + +// Email sets the optional parameter "email": Email of the people to add +// to the circle. Optional, can be repeated. +func (c *CirclesRemovePeopleCall) Email(email string) *CirclesRemovePeopleCall { + c.opt_["email"] = email + return c +} + +// UserId sets the optional parameter "userId": IDs of the people to +// remove from the circle. Optional, can be repeated. +func (c *CirclesRemovePeopleCall) UserId(userId string) *CirclesRemovePeopleCall { + c.opt_["userId"] = userId + return c +} + +func (c *CirclesRemovePeopleCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["email"]; ok { + params.Set("email", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["userId"]; ok { + params.Set("userId", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "circles/{circleId}/people") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{circleId}", url.QueryEscape(c.circleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Remove a person from a circle.", + // "httpMethod": "DELETE", + // "id": "plusDomains.circles.removePeople", + // "parameterOrder": [ + // "circleId" + // ], + // "parameters": { + // "circleId": { + // "description": "The ID of the circle to remove the person from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "email": { + // "description": "Email of the people to add to the circle. Optional, can be repeated.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "userId": { + // "description": "IDs of the people to remove from the circle. Optional, can be repeated.", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "circles/{circleId}/people", + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.write", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "plusDomains.circles.update": + +type CirclesUpdateCall struct { + s *Service + circleId string + circle *Circle + opt_ map[string]interface{} +} + +// Update: Update a circle's description. +func (r *CirclesService) Update(circleId string, circle *Circle) *CirclesUpdateCall { + c := &CirclesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.circleId = circleId + c.circle = circle + return c +} + +func (c *CirclesUpdateCall) Do() (*Circle, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.circle) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "circles/{circleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{circleId}", url.QueryEscape(c.circleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Circle) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a circle's description.", + // "httpMethod": "PUT", + // "id": "plusDomains.circles.update", + // "parameterOrder": [ + // "circleId" + // ], + // "parameters": { + // "circleId": { + // "description": "The ID of the circle to update.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "circles/{circleId}", + // "request": { + // "$ref": "Circle" + // }, + // "response": { + // "$ref": "Circle" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.write", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "plusDomains.comments.get": + +type CommentsGetCall struct { + s *Service + commentId string + opt_ map[string]interface{} +} + +// Get: Get a comment. +func (r *CommentsService) Get(commentId string) *CommentsGetCall { + c := &CommentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.commentId = commentId + return c +} + +func (c *CommentsGetCall) Do() (*Comment, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a comment.", + // "httpMethod": "GET", + // "id": "plusDomains.comments.get", + // "parameterOrder": [ + // "commentId" + // ], + // "parameters": { + // "commentId": { + // "description": "The ID of the comment to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "comments/{commentId}", + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.stream.read" + // ] + // } + +} + +// method id "plusDomains.comments.insert": + +type CommentsInsertCall struct { + s *Service + activityId string + comment *Comment + opt_ map[string]interface{} +} + +// Insert: Create a new comment in reply to an activity. +func (r *CommentsService) Insert(activityId string, comment *Comment) *CommentsInsertCall { + c := &CommentsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.activityId = activityId + c.comment = comment + return c +} + +func (c *CommentsInsertCall) Do() (*Comment, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{activityId}", url.QueryEscape(c.activityId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Comment) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a new comment in reply to an activity.", + // "httpMethod": "POST", + // "id": "plusDomains.comments.insert", + // "parameterOrder": [ + // "activityId" + // ], + // "parameters": { + // "activityId": { + // "description": "The ID of the activity to reply to.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "activities/{activityId}/comments", + // "request": { + // "$ref": "Comment" + // }, + // "response": { + // "$ref": "Comment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.stream.write" + // ] + // } + +} + +// method id "plusDomains.comments.list": + +type CommentsListCall struct { + s *Service + activityId string + opt_ map[string]interface{} +} + +// List: List all of the comments for an activity. +func (r *CommentsService) List(activityId string) *CommentsListCall { + c := &CommentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.activityId = activityId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of comments to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortOrder sets the optional parameter "sortOrder": The order in which +// to sort the list of comments. +func (c *CommentsListCall) SortOrder(sortOrder string) *CommentsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +func (c *CommentsListCall) Do() (*CommentFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{activityId}", url.QueryEscape(c.activityId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(CommentFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the comments for an activity.", + // "httpMethod": "GET", + // "id": "plusDomains.comments.list", + // "parameterOrder": [ + // "activityId" + // ], + // "parameters": { + // "activityId": { + // "description": "The ID of the activity to get comments for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "20", + // "description": "The maximum number of comments to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "default": "ascending", + // "description": "The order in which to sort the list of comments.", + // "enum": [ + // "ascending", + // "descending" + // ], + // "enumDescriptions": [ + // "Sort oldest comments first.", + // "Sort newest comments first." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "activities/{activityId}/comments", + // "response": { + // "$ref": "CommentFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.stream.read" + // ] + // } + +} + +// method id "plusDomains.media.insert": + +type MediaInsertCall struct { + s *Service + userId string + collection string + media *Media + opt_ map[string]interface{} + media_ io.Reader +} + +// Insert: Add a new media item to an album. The current upload size +// limitations are 36MB for a photo and 1GB for a video. Uploads do not +// count against quota if photos are less than 2048 pixels on their +// longest side or videos are less than 15 minutes in length. +func (r *MediaService) Insert(userId string, collection string, media *Media) *MediaInsertCall { + c := &MediaInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.collection = collection + c.media = media + return c +} +func (c *MediaInsertCall) Media(r io.Reader) *MediaInsertCall { + c.media_ = r + return c +} + +func (c *MediaInsertCall) Do() (*Media, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.media) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/media/{collection}") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{collection}", url.QueryEscape(c.collection), 1) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Media) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add a new media item to an album. The current upload size limitations are 36MB for a photo and 1GB for a video. Uploads do not count against quota if photos are less than 2048 pixels on their longest side or videos are less than 15 minutes in length.", + // "httpMethod": "POST", + // "id": "plusDomains.media.insert", + // "mediaUpload": { + // "accept": [ + // "image/*", + // "video/*" + // ], + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/plusDomains/v1/people/{userId}/media/{collection}" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/plusDomains/v1/people/{userId}/media/{collection}" + // } + // } + // }, + // "parameterOrder": [ + // "userId", + // "collection" + // ], + // "parameters": { + // "collection": { + // "enum": [ + // "cloud" + // ], + // "enumDescriptions": [ + // "Upload the media to share on Google+." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user to create the activity on behalf of.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/media/{collection}", + // "request": { + // "$ref": "Media" + // }, + // "response": { + // "$ref": "Media" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.media.upload" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "plusDomains.people.get": + +type PeopleGetCall struct { + s *Service + userId string + opt_ map[string]interface{} +} + +// Get: Get a person's profile. +func (r *PeopleService) Get(userId string) *PeopleGetCall { + c := &PeopleGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +func (c *PeopleGetCall) Do() (*Person, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Person) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a person's profile.", + // "httpMethod": "GET", + // "id": "plusDomains.people.get", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "description": "The ID of the person to get the profile for. The special value \"me\" can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}", + // "response": { + // "$ref": "Person" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me", + // "https://www.googleapis.com/auth/plus.profiles.read", + // "https://www.googleapis.com/auth/userinfo.email", + // "https://www.googleapis.com/auth/userinfo.profile" + // ] + // } + +} + +// method id "plusDomains.people.list": + +type PeopleListCall struct { + s *Service + userId string + collection string + opt_ map[string]interface{} +} + +// List: List all of the people in the specified collection. +func (r *PeopleService) List(userId string, collection string) *PeopleListCall { + c := &PeopleListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.collection = collection + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of people to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *PeopleListCall) MaxResults(maxResults int64) *PeopleListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": The order to return +// people in. +func (c *PeopleListCall) OrderBy(orderBy string) *PeopleListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *PeopleListCall) PageToken(pageToken string) *PeopleListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *PeopleListCall) Do() (*PeopleFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/people/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{userId}", url.QueryEscape(c.userId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{collection}", url.QueryEscape(c.collection), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PeopleFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the people in the specified collection.", + // "httpMethod": "GET", + // "id": "plusDomains.people.list", + // "parameterOrder": [ + // "userId", + // "collection" + // ], + // "parameters": { + // "collection": { + // "description": "The collection of people to list.", + // "enum": [ + // "circled" + // ], + // "enumDescriptions": [ + // "The list of people who this user has added to one or more circles." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "orderBy": { + // "description": "The order to return people in.", + // "enum": [ + // "alphabetical", + // "best" + // ], + // "enumDescriptions": [ + // "Order the people by their display name.", + // "Order people based on the relevence to the viewer." + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "Get the collection of people for the person identified. Use \"me\" to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "people/{userId}/people/{collection}", + // "response": { + // "$ref": "PeopleFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.read", + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.me" + // ] + // } + +} + +// method id "plusDomains.people.listByActivity": + +type PeopleListByActivityCall struct { + s *Service + activityId string + collection string + opt_ map[string]interface{} +} + +// ListByActivity: List all of the people in the specified collection +// for a particular activity. +func (r *PeopleService) ListByActivity(activityId string, collection string) *PeopleListByActivityCall { + c := &PeopleListByActivityCall{s: r.s, opt_: make(map[string]interface{})} + c.activityId = activityId + c.collection = collection + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of people to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *PeopleListByActivityCall) MaxResults(maxResults int64) *PeopleListByActivityCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *PeopleListByActivityCall) PageToken(pageToken string) *PeopleListByActivityCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *PeopleListByActivityCall) Do() (*PeopleFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}/people/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{activityId}", url.QueryEscape(c.activityId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{collection}", url.QueryEscape(c.collection), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PeopleFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the people in the specified collection for a particular activity.", + // "httpMethod": "GET", + // "id": "plusDomains.people.listByActivity", + // "parameterOrder": [ + // "activityId", + // "collection" + // ], + // "parameters": { + // "activityId": { + // "description": "The ID of the activity to get the list of people for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "collection": { + // "description": "The collection of people to list.", + // "enum": [ + // "plusoners", + // "resharers", + // "sharedto" + // ], + // "enumDescriptions": [ + // "List all people who have +1'd this activity.", + // "List all people who have reshared this activity.", + // "List all people who this activity was shared to." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "20", + // "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "activities/{activityId}/people/{collection}", + // "response": { + // "$ref": "PeopleFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.login", + // "https://www.googleapis.com/auth/plus.stream.read" + // ] + // } + +} + +// method id "plusDomains.people.listByCircle": + +type PeopleListByCircleCall struct { + s *Service + circleId string + opt_ map[string]interface{} +} + +// ListByCircle: List all of the people who are members of a circle. +func (r *PeopleService) ListByCircle(circleId string) *PeopleListByCircleCall { + c := &PeopleListByCircleCall{s: r.s, opt_: make(map[string]interface{})} + c.circleId = circleId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of people to include in the response, which is used for +// paging. For any response, the actual number returned might be less +// than the specified maxResults. +func (c *PeopleListByCircleCall) MaxResults(maxResults int64) *PeopleListByCircleCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large result sets. To get the +// next page of results, set this parameter to the value of +// "nextPageToken" from the previous response. +func (c *PeopleListByCircleCall) PageToken(pageToken string) *PeopleListByCircleCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *PeopleListByCircleCall) Do() (*PeopleFeed, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "circles/{circleId}/people") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{circleId}", url.QueryEscape(c.circleId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PeopleFeed) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all of the people who are members of a circle.", + // "httpMethod": "GET", + // "id": "plusDomains.people.listByCircle", + // "parameterOrder": [ + // "circleId" + // ], + // "parameters": { + // "circleId": { + // "description": "The ID of the circle to get the members of.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "20", + // "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "circles/{circleId}/people", + // "response": { + // "$ref": "PeopleFeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.circles.read", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.2/prediction-api.json b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.2/prediction-api.json new file mode 100644 index 0000000000000..2f587c579797c --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.2/prediction-api.json @@ -0,0 +1,353 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/09e1Ml5Gun7YuEJCdDnZKGXCSr8\"", + "discoveryVersion": "v1", + "id": "prediction:v1.2", + "name": "prediction", + "version": "v1.2", + "title": "Prediction API", + "description": "Lets you access a cloud hosted machine learning service that makes it easy to build smart apps", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/feature/predictionapi-16.png", + "x32": "http://www.google.com/images/icons/feature/predictionapi-32.png" + }, + "documentationLink": "https://developers.google.com/prediction/docs/developer-guide", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/prediction/v1.2/", + "basePath": "/prediction/v1.2/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "prediction/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/devstorage.full_control": { + "description": "Manage your data and permissions in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/prediction": { + "description": "Manage your data in the Google Prediction API" + } + } + } + }, + "schemas": { + "Input": { + "id": "Input", + "type": "object", + "properties": { + "input": { + "type": "object", + "properties": { + "csvInstance": { + "type": "array", + "items": { + "type": "any" + } + } + } + } + } + }, + "Output": { + "id": "Output", + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "kind": { + "type": "string", + "default": "prediction#output" + }, + "outputLabel": { + "type": "string" + }, + "outputMulti": { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "score": { + "type": "number", + "format": "double" + } + } + } + }, + "outputValue": { + "type": "number", + "format": "double" + }, + "selfLink": { + "type": "string" + } + } + }, + "Training": { + "id": "Training", + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "kind": { + "type": "string", + "default": "prediction#training" + }, + "modelInfo": { + "type": "object", + "properties": { + "classificationAccuracy": { + "type": "number", + "format": "double" + }, + "meanSquaredError": { + "type": "number", + "format": "double" + }, + "modelType": { + "type": "string" + } + } + }, + "selfLink": { + "type": "string" + }, + "trainingStatus": { + "type": "string" + } + } + }, + "Update": { + "id": "Update", + "type": "object", + "properties": { + "classLabel": { + "type": "string", + "description": "The true class label of this instance" + }, + "csvInstance": { + "type": "array", + "description": "The input features for this instance", + "items": { + "type": "any" + } + } + } + } + }, + "methods": { + "predict": { + "id": "prediction.predict", + "path": "training/{data}/predict", + "httpMethod": "POST", + "description": "Submit data and request a prediction", + "parameters": { + "data": { + "type": "string", + "description": "mybucket%2Fmydata resource in Google Storage", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "data" + ], + "request": { + "$ref": "Input" + }, + "response": { + "$ref": "Output" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + } + }, + "resources": { + "hostedmodels": { + "methods": { + "predict": { + "id": "prediction.hostedmodels.predict", + "path": "hostedmodels/{hostedModelName}/predict", + "httpMethod": "POST", + "description": "Submit input and request an output against a hosted model", + "parameters": { + "hostedModelName": { + "type": "string", + "description": "The name of a hosted model", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "hostedModelName" + ], + "request": { + "$ref": "Input" + }, + "response": { + "$ref": "Output" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + } + } + }, + "training": { + "methods": { + "delete": { + "id": "prediction.training.delete", + "path": "training/{data}", + "httpMethod": "DELETE", + "description": "Delete a trained model", + "parameters": { + "data": { + "type": "string", + "description": "mybucket/mydata resource in Google Storage", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "data" + ], + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "get": { + "id": "prediction.training.get", + "path": "training/{data}", + "httpMethod": "GET", + "description": "Check training status of your model", + "parameters": { + "data": { + "type": "string", + "description": "mybucket/mydata resource in Google Storage", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "data" + ], + "response": { + "$ref": "Training" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "insert": { + "id": "prediction.training.insert", + "path": "training", + "httpMethod": "POST", + "description": "Begin training your model", + "parameters": { + "data": { + "type": "string", + "description": "mybucket/mydata resource in Google Storage", + "location": "query" + } + }, + "request": { + "$ref": "Training" + }, + "response": { + "$ref": "Training" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/prediction" + ] + }, + "update": { + "id": "prediction.training.update", + "path": "training/{data}", + "httpMethod": "PUT", + "description": "Add new data to a trained model", + "parameters": { + "data": { + "type": "string", + "description": "mybucket/mydata resource in Google Storage", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "data" + ], + "request": { + "$ref": "Update" + }, + "response": { + "$ref": "Training" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.2/prediction-gen.go b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.2/prediction-gen.go new file mode 100644 index 0000000000000..79de40ad4791c --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.2/prediction-gen.go @@ -0,0 +1,575 @@ +// Package prediction provides access to the Prediction API. +// +// See https://developers.google.com/prediction/docs/developer-guide +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/prediction/v1.2" +// ... +// predictionService, err := prediction.New(oauthHttpClient) +package prediction + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "prediction:v1.2" +const apiName = "prediction" +const apiVersion = "v1.2" +const basePath = "https://www.googleapis.com/prediction/v1.2/" + +// OAuth2 scopes used by this API. +const ( + // Manage your data and permissions in Google Cloud Storage + DevstorageFull_controlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageRead_onlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageRead_writeScope = "https://www.googleapis.com/auth/devstorage.read_write" + + // Manage your data in the Google Prediction API + PredictionScope = "https://www.googleapis.com/auth/prediction" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Hostedmodels = NewHostedmodelsService(s) + s.Training = NewTrainingService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Hostedmodels *HostedmodelsService + + Training *TrainingService +} + +func NewHostedmodelsService(s *Service) *HostedmodelsService { + rs := &HostedmodelsService{s: s} + return rs +} + +type HostedmodelsService struct { + s *Service +} + +func NewTrainingService(s *Service) *TrainingService { + rs := &TrainingService{s: s} + return rs +} + +type TrainingService struct { + s *Service +} + +type Input struct { + Input *InputInput `json:"input,omitempty"` +} + +type InputInput struct { + CsvInstance []interface{} `json:"csvInstance,omitempty"` +} + +type Output struct { + Id string `json:"id,omitempty"` + + Kind string `json:"kind,omitempty"` + + OutputLabel string `json:"outputLabel,omitempty"` + + OutputMulti []*OutputOutputMulti `json:"outputMulti,omitempty"` + + OutputValue float64 `json:"outputValue,omitempty"` + + SelfLink string `json:"selfLink,omitempty"` +} + +type OutputOutputMulti struct { + Label string `json:"label,omitempty"` + + Score float64 `json:"score,omitempty"` +} + +type Training struct { + Id string `json:"id,omitempty"` + + Kind string `json:"kind,omitempty"` + + ModelInfo *TrainingModelInfo `json:"modelInfo,omitempty"` + + SelfLink string `json:"selfLink,omitempty"` + + TrainingStatus string `json:"trainingStatus,omitempty"` +} + +type TrainingModelInfo struct { + ClassificationAccuracy float64 `json:"classificationAccuracy,omitempty"` + + MeanSquaredError float64 `json:"meanSquaredError,omitempty"` + + ModelType string `json:"modelType,omitempty"` +} + +type Update struct { + // ClassLabel: The true class label of this instance + ClassLabel string `json:"classLabel,omitempty"` + + // CsvInstance: The input features for this instance + CsvInstance []interface{} `json:"csvInstance,omitempty"` +} + +// method id "prediction.predict": + +type PredictCall struct { + s *Service + data string + input *Input + opt_ map[string]interface{} +} + +// Predict: Submit data and request a prediction +func (s *Service) Predict(data string, input *Input) *PredictCall { + c := &PredictCall{s: s, opt_: make(map[string]interface{})} + c.data = data + c.input = input + return c +} + +func (c *PredictCall) Do() (*Output, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.input) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "training/{data}/predict") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{data}", url.QueryEscape(c.data), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Output) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Submit data and request a prediction", + // "httpMethod": "POST", + // "id": "prediction.predict", + // "parameterOrder": [ + // "data" + // ], + // "parameters": { + // "data": { + // "description": "mybucket%2Fmydata resource in Google Storage", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "training/{data}/predict", + // "request": { + // "$ref": "Input" + // }, + // "response": { + // "$ref": "Output" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.hostedmodels.predict": + +type HostedmodelsPredictCall struct { + s *Service + hostedModelName string + input *Input + opt_ map[string]interface{} +} + +// Predict: Submit input and request an output against a hosted model +func (r *HostedmodelsService) Predict(hostedModelName string, input *Input) *HostedmodelsPredictCall { + c := &HostedmodelsPredictCall{s: r.s, opt_: make(map[string]interface{})} + c.hostedModelName = hostedModelName + c.input = input + return c +} + +func (c *HostedmodelsPredictCall) Do() (*Output, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.input) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "hostedmodels/{hostedModelName}/predict") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{hostedModelName}", url.QueryEscape(c.hostedModelName), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Output) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Submit input and request an output against a hosted model", + // "httpMethod": "POST", + // "id": "prediction.hostedmodels.predict", + // "parameterOrder": [ + // "hostedModelName" + // ], + // "parameters": { + // "hostedModelName": { + // "description": "The name of a hosted model", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "hostedmodels/{hostedModelName}/predict", + // "request": { + // "$ref": "Input" + // }, + // "response": { + // "$ref": "Output" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.training.delete": + +type TrainingDeleteCall struct { + s *Service + data string + opt_ map[string]interface{} +} + +// Delete: Delete a trained model +func (r *TrainingService) Delete(data string) *TrainingDeleteCall { + c := &TrainingDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.data = data + return c +} + +func (c *TrainingDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "training/{data}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{data}", url.QueryEscape(c.data), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a trained model", + // "httpMethod": "DELETE", + // "id": "prediction.training.delete", + // "parameterOrder": [ + // "data" + // ], + // "parameters": { + // "data": { + // "description": "mybucket/mydata resource in Google Storage", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "training/{data}", + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.training.get": + +type TrainingGetCall struct { + s *Service + data string + opt_ map[string]interface{} +} + +// Get: Check training status of your model +func (r *TrainingService) Get(data string) *TrainingGetCall { + c := &TrainingGetCall{s: r.s, opt_: make(map[string]interface{})} + c.data = data + return c +} + +func (c *TrainingGetCall) Do() (*Training, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "training/{data}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{data}", url.QueryEscape(c.data), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Training) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Check training status of your model", + // "httpMethod": "GET", + // "id": "prediction.training.get", + // "parameterOrder": [ + // "data" + // ], + // "parameters": { + // "data": { + // "description": "mybucket/mydata resource in Google Storage", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "training/{data}", + // "response": { + // "$ref": "Training" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.training.insert": + +type TrainingInsertCall struct { + s *Service + training *Training + opt_ map[string]interface{} +} + +// Insert: Begin training your model +func (r *TrainingService) Insert(training *Training) *TrainingInsertCall { + c := &TrainingInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.training = training + return c +} + +// Data sets the optional parameter "data": mybucket/mydata resource in +// Google Storage +func (c *TrainingInsertCall) Data(data string) *TrainingInsertCall { + c.opt_["data"] = data + return c +} + +func (c *TrainingInsertCall) Do() (*Training, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.training) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["data"]; ok { + params.Set("data", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "training") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Training) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Begin training your model", + // "httpMethod": "POST", + // "id": "prediction.training.insert", + // "parameters": { + // "data": { + // "description": "mybucket/mydata resource in Google Storage", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "training", + // "request": { + // "$ref": "Training" + // }, + // "response": { + // "$ref": "Training" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write", + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.training.update": + +type TrainingUpdateCall struct { + s *Service + data string + update *Update + opt_ map[string]interface{} +} + +// Update: Add new data to a trained model +func (r *TrainingService) Update(data string, update *Update) *TrainingUpdateCall { + c := &TrainingUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.data = data + c.update = update + return c +} + +func (c *TrainingUpdateCall) Do() (*Training, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.update) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "training/{data}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{data}", url.QueryEscape(c.data), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Training) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add new data to a trained model", + // "httpMethod": "PUT", + // "id": "prediction.training.update", + // "parameterOrder": [ + // "data" + // ], + // "parameters": { + // "data": { + // "description": "mybucket/mydata resource in Google Storage", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "training/{data}", + // "request": { + // "$ref": "Update" + // }, + // "response": { + // "$ref": "Training" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.3/prediction-api.json b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.3/prediction-api.json new file mode 100644 index 0000000000000..cbcdd7338aa92 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.3/prediction-api.json @@ -0,0 +1,411 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/LnKBxoqCwKX9VdR55fP9N9U7tho\"", + "discoveryVersion": "v1", + "id": "prediction:v1.3", + "name": "prediction", + "version": "v1.3", + "title": "Prediction API", + "description": "Lets you access a cloud hosted machine learning service that makes it easy to build smart apps", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/feature/predictionapi-16.png", + "x32": "http://www.google.com/images/icons/feature/predictionapi-32.png" + }, + "documentationLink": "https://developers.google.com/prediction/docs/developer-guide", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/prediction/v1.3/", + "basePath": "/prediction/v1.3/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "prediction/v1.3/", + "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/devstorage.full_control": { + "description": "Manage your data and permissions in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/prediction": { + "description": "Manage your data in the Google Prediction API" + } + } + } + }, + "schemas": { + "Input": { + "id": "Input", + "type": "object", + "properties": { + "input": { + "type": "object", + "description": "Input to the model for a prediction", + "properties": { + "csvInstance": { + "type": "array", + "description": "A list of input features, these can be strings or doubles.", + "items": { + "type": "any" + } + } + } + } + } + }, + "Output": { + "id": "Output", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique name for the predictive model." + }, + "kind": { + "type": "string", + "description": "What kind of resource this is.", + "default": "prediction#output" + }, + "outputLabel": { + "type": "string", + "description": "The most likely class [Categorical models only]." + }, + "outputMulti": { + "type": "array", + "description": "A list of classes with their estimated probabilities [Categorical models only].", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "The class label." + }, + "score": { + "type": "number", + "description": "The probability of the class.", + "format": "double" + } + } + } + }, + "outputValue": { + "type": "number", + "description": "The estimated regression value [Regression models only].", + "format": "double" + }, + "selfLink": { + "type": "string", + "description": "A URL to re-request this resource." + } + } + }, + "Training": { + "id": "Training", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique name for the predictive model." + }, + "kind": { + "type": "string", + "description": "What kind of resource this is.", + "default": "prediction#training" + }, + "modelInfo": { + "type": "object", + "description": "Model metadata.", + "properties": { + "classWeightedAccuracy": { + "type": "number", + "description": "Estimated accuracy of model taking utility weights into account [Categorical models only].", + "format": "double" + }, + "classificationAccuracy": { + "type": "number", + "description": "A number between 0.0 and 1.0, where 1.0 is 100% accurate. This is an estimate, based on the amount and quality of the training data, of the estimated prediction accuracy. You can use this is a guide to decide whether the results are accurate enough for your needs. This estimate will be more reliable if your real input data is similar to your training data [Categorical models only].", + "format": "double" + }, + "confusionMatrix": { + "type": "object", + "description": "An output confusion matrix. This shows an estimate for how this model will do in predictions. This is first indexed by the true class label. For each true class label, this provides a pair {predicted_label, count}, where count is the estimated number of times the model will predict the predicted label given the true label. Will not output if more then 100 classes [Categorical models only].", + "additionalProperties": { + "type": "object", + "description": "The true class label.", + "additionalProperties": { + "type": "number", + "description": "The pair {predicted_label, count}.", + "format": "double" + } + } + }, + "confusionMatrixRowTotals": { + "type": "object", + "description": "A list of the confusion matrix row totals", + "additionalProperties": { + "type": "number", + "description": "The true class associated with how many instances it had", + "format": "double" + } + }, + "meanSquaredError": { + "type": "number", + "description": "An estimated mean squared error. The can be used to measure the quality of the predicted model [Regression models only].", + "format": "double" + }, + "modelType": { + "type": "string", + "description": "Type of predictive model (CLASSIFICATION or REGRESSION)" + }, + "numberClasses": { + "type": "string", + "description": "Number of classes in the trained model [Categorical models only].", + "format": "int64" + }, + "numberInstances": { + "type": "string", + "description": "Number of valid data instances used in the trained model.", + "format": "int64" + } + } + }, + "selfLink": { + "type": "string", + "description": "A URL to re-request this resource." + }, + "trainingStatus": { + "type": "string", + "description": "The current status of the training job. This can be one of following: RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND" + }, + "utility": { + "type": "array", + "description": "A class weighting function, which allows the importance weights for classes to be specified [Categorical models only].", + "items": { + "type": "object", + "description": "Class label (string).", + "additionalProperties": { + "type": "number", + "format": "double" + } + } + } + } + }, + "Update": { + "id": "Update", + "type": "object", + "properties": { + "classLabel": { + "type": "string", + "description": "The true class label of this instance" + }, + "csvInstance": { + "type": "array", + "description": "The input features for this instance", + "items": { + "type": "any" + } + } + } + } + }, + "resources": { + "hostedmodels": { + "methods": { + "predict": { + "id": "prediction.hostedmodels.predict", + "path": "hostedmodels/{hostedModelName}/predict", + "httpMethod": "POST", + "description": "Submit input and request an output against a hosted model", + "parameters": { + "hostedModelName": { + "type": "string", + "description": "The name of a hosted model", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "hostedModelName" + ], + "request": { + "$ref": "Input" + }, + "response": { + "$ref": "Output" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + } + } + }, + "training": { + "methods": { + "delete": { + "id": "prediction.training.delete", + "path": "training/{data}", + "httpMethod": "DELETE", + "description": "Delete a trained model", + "parameters": { + "data": { + "type": "string", + "description": "mybucket/mydata resource in Google Storage", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "data" + ], + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "get": { + "id": "prediction.training.get", + "path": "training/{data}", + "httpMethod": "GET", + "description": "Check training status of your model", + "parameters": { + "data": { + "type": "string", + "description": "mybucket/mydata resource in Google Storage", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "data" + ], + "response": { + "$ref": "Training" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "insert": { + "id": "prediction.training.insert", + "path": "training", + "httpMethod": "POST", + "description": "Begin training your model", + "request": { + "$ref": "Training" + }, + "response": { + "$ref": "Training" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/prediction" + ] + }, + "predict": { + "id": "prediction.training.predict", + "path": "training/{data}/predict", + "httpMethod": "POST", + "description": "Submit data and request a prediction", + "parameters": { + "data": { + "type": "string", + "description": "mybucket/mydata resource in Google Storage", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "data" + ], + "request": { + "$ref": "Input" + }, + "response": { + "$ref": "Output" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "update": { + "id": "prediction.training.update", + "path": "training/{data}", + "httpMethod": "PUT", + "description": "Add new data to a trained model", + "parameters": { + "data": { + "type": "string", + "description": "mybucket/mydata resource in Google Storage", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "data" + ], + "request": { + "$ref": "Update" + }, + "response": { + "$ref": "Training" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.3/prediction-gen.go b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.3/prediction-gen.go new file mode 100644 index 0000000000000..e359ef9cf403f --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.3/prediction-gen.go @@ -0,0 +1,623 @@ +// Package prediction provides access to the Prediction API. +// +// See https://developers.google.com/prediction/docs/developer-guide +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/prediction/v1.3" +// ... +// predictionService, err := prediction.New(oauthHttpClient) +package prediction + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "prediction:v1.3" +const apiName = "prediction" +const apiVersion = "v1.3" +const basePath = "https://www.googleapis.com/prediction/v1.3/" + +// OAuth2 scopes used by this API. +const ( + // Manage your data and permissions in Google Cloud Storage + DevstorageFull_controlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageRead_onlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageRead_writeScope = "https://www.googleapis.com/auth/devstorage.read_write" + + // Manage your data in the Google Prediction API + PredictionScope = "https://www.googleapis.com/auth/prediction" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Hostedmodels = NewHostedmodelsService(s) + s.Training = NewTrainingService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Hostedmodels *HostedmodelsService + + Training *TrainingService +} + +func NewHostedmodelsService(s *Service) *HostedmodelsService { + rs := &HostedmodelsService{s: s} + return rs +} + +type HostedmodelsService struct { + s *Service +} + +func NewTrainingService(s *Service) *TrainingService { + rs := &TrainingService{s: s} + return rs +} + +type TrainingService struct { + s *Service +} + +type Input struct { + // Input: Input to the model for a prediction + Input *InputInput `json:"input,omitempty"` +} + +type InputInput struct { + // CsvInstance: A list of input features, these can be strings or + // doubles. + CsvInstance []interface{} `json:"csvInstance,omitempty"` +} + +type Output struct { + // Id: The unique name for the predictive model. + Id string `json:"id,omitempty"` + + // Kind: What kind of resource this is. + Kind string `json:"kind,omitempty"` + + // OutputLabel: The most likely class [Categorical models only]. + OutputLabel string `json:"outputLabel,omitempty"` + + // OutputMulti: A list of classes with their estimated probabilities + // [Categorical models only]. + OutputMulti []*OutputOutputMulti `json:"outputMulti,omitempty"` + + // OutputValue: The estimated regression value [Regression models only]. + OutputValue float64 `json:"outputValue,omitempty"` + + // SelfLink: A URL to re-request this resource. + SelfLink string `json:"selfLink,omitempty"` +} + +type OutputOutputMulti struct { + // Label: The class label. + Label string `json:"label,omitempty"` + + // Score: The probability of the class. + Score float64 `json:"score,omitempty"` +} + +type Training struct { + // Id: The unique name for the predictive model. + Id string `json:"id,omitempty"` + + // Kind: What kind of resource this is. + Kind string `json:"kind,omitempty"` + + // ModelInfo: Model metadata. + ModelInfo *TrainingModelInfo `json:"modelInfo,omitempty"` + + // SelfLink: A URL to re-request this resource. + SelfLink string `json:"selfLink,omitempty"` + + // TrainingStatus: The current status of the training job. This can be + // one of following: RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND + TrainingStatus string `json:"trainingStatus,omitempty"` + + // Utility: A class weighting function, which allows the importance + // weights for classes to be specified [Categorical models only]. + Utility []*TrainingUtility `json:"utility,omitempty"` +} + +type TrainingModelInfo struct { + // ClassWeightedAccuracy: Estimated accuracy of model taking utility + // weights into account [Categorical models only]. + ClassWeightedAccuracy float64 `json:"classWeightedAccuracy,omitempty"` + + // ClassificationAccuracy: A number between 0.0 and 1.0, where 1.0 is + // 100% accurate. This is an estimate, based on the amount and quality + // of the training data, of the estimated prediction accuracy. You can + // use this is a guide to decide whether the results are accurate enough + // for your needs. This estimate will be more reliable if your real + // input data is similar to your training data [Categorical models + // only]. + ClassificationAccuracy float64 `json:"classificationAccuracy,omitempty"` + + // ConfusionMatrix: An output confusion matrix. This shows an estimate + // for how this model will do in predictions. This is first indexed by + // the true class label. For each true class label, this provides a pair + // {predicted_label, count}, where count is the estimated number of + // times the model will predict the predicted label given the true + // label. Will not output if more then 100 classes [Categorical models + // only]. + ConfusionMatrix *TrainingModelInfoConfusionMatrix `json:"confusionMatrix,omitempty"` + + // ConfusionMatrixRowTotals: A list of the confusion matrix row totals + ConfusionMatrixRowTotals *TrainingModelInfoConfusionMatrixRowTotals `json:"confusionMatrixRowTotals,omitempty"` + + // MeanSquaredError: An estimated mean squared error. The can be used to + // measure the quality of the predicted model [Regression models only]. + MeanSquaredError float64 `json:"meanSquaredError,omitempty"` + + // ModelType: Type of predictive model (CLASSIFICATION or REGRESSION) + ModelType string `json:"modelType,omitempty"` + + // NumberClasses: Number of classes in the trained model [Categorical + // models only]. + NumberClasses int64 `json:"numberClasses,omitempty,string"` + + // NumberInstances: Number of valid data instances used in the trained + // model. + NumberInstances int64 `json:"numberInstances,omitempty,string"` +} + +type TrainingModelInfoConfusionMatrix struct { +} + +type TrainingModelInfoConfusionMatrixRowTotals struct { +} + +type TrainingUtility struct { +} + +type Update struct { + // ClassLabel: The true class label of this instance + ClassLabel string `json:"classLabel,omitempty"` + + // CsvInstance: The input features for this instance + CsvInstance []interface{} `json:"csvInstance,omitempty"` +} + +// method id "prediction.hostedmodels.predict": + +type HostedmodelsPredictCall struct { + s *Service + hostedModelName string + input *Input + opt_ map[string]interface{} +} + +// Predict: Submit input and request an output against a hosted model +func (r *HostedmodelsService) Predict(hostedModelName string, input *Input) *HostedmodelsPredictCall { + c := &HostedmodelsPredictCall{s: r.s, opt_: make(map[string]interface{})} + c.hostedModelName = hostedModelName + c.input = input + return c +} + +func (c *HostedmodelsPredictCall) Do() (*Output, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.input) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "hostedmodels/{hostedModelName}/predict") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{hostedModelName}", url.QueryEscape(c.hostedModelName), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Output) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Submit input and request an output against a hosted model", + // "httpMethod": "POST", + // "id": "prediction.hostedmodels.predict", + // "parameterOrder": [ + // "hostedModelName" + // ], + // "parameters": { + // "hostedModelName": { + // "description": "The name of a hosted model", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "hostedmodels/{hostedModelName}/predict", + // "request": { + // "$ref": "Input" + // }, + // "response": { + // "$ref": "Output" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.training.delete": + +type TrainingDeleteCall struct { + s *Service + data string + opt_ map[string]interface{} +} + +// Delete: Delete a trained model +func (r *TrainingService) Delete(data string) *TrainingDeleteCall { + c := &TrainingDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.data = data + return c +} + +func (c *TrainingDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "training/{data}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{data}", url.QueryEscape(c.data), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a trained model", + // "httpMethod": "DELETE", + // "id": "prediction.training.delete", + // "parameterOrder": [ + // "data" + // ], + // "parameters": { + // "data": { + // "description": "mybucket/mydata resource in Google Storage", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "training/{data}", + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.training.get": + +type TrainingGetCall struct { + s *Service + data string + opt_ map[string]interface{} +} + +// Get: Check training status of your model +func (r *TrainingService) Get(data string) *TrainingGetCall { + c := &TrainingGetCall{s: r.s, opt_: make(map[string]interface{})} + c.data = data + return c +} + +func (c *TrainingGetCall) Do() (*Training, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "training/{data}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{data}", url.QueryEscape(c.data), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Training) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Check training status of your model", + // "httpMethod": "GET", + // "id": "prediction.training.get", + // "parameterOrder": [ + // "data" + // ], + // "parameters": { + // "data": { + // "description": "mybucket/mydata resource in Google Storage", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "training/{data}", + // "response": { + // "$ref": "Training" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.training.insert": + +type TrainingInsertCall struct { + s *Service + training *Training + opt_ map[string]interface{} +} + +// Insert: Begin training your model +func (r *TrainingService) Insert(training *Training) *TrainingInsertCall { + c := &TrainingInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.training = training + return c +} + +func (c *TrainingInsertCall) Do() (*Training, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.training) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "training") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Training) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Begin training your model", + // "httpMethod": "POST", + // "id": "prediction.training.insert", + // "path": "training", + // "request": { + // "$ref": "Training" + // }, + // "response": { + // "$ref": "Training" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write", + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.training.predict": + +type TrainingPredictCall struct { + s *Service + data string + input *Input + opt_ map[string]interface{} +} + +// Predict: Submit data and request a prediction +func (r *TrainingService) Predict(data string, input *Input) *TrainingPredictCall { + c := &TrainingPredictCall{s: r.s, opt_: make(map[string]interface{})} + c.data = data + c.input = input + return c +} + +func (c *TrainingPredictCall) Do() (*Output, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.input) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "training/{data}/predict") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{data}", url.QueryEscape(c.data), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Output) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Submit data and request a prediction", + // "httpMethod": "POST", + // "id": "prediction.training.predict", + // "parameterOrder": [ + // "data" + // ], + // "parameters": { + // "data": { + // "description": "mybucket/mydata resource in Google Storage", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "training/{data}/predict", + // "request": { + // "$ref": "Input" + // }, + // "response": { + // "$ref": "Output" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.training.update": + +type TrainingUpdateCall struct { + s *Service + data string + update *Update + opt_ map[string]interface{} +} + +// Update: Add new data to a trained model +func (r *TrainingService) Update(data string, update *Update) *TrainingUpdateCall { + c := &TrainingUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.data = data + c.update = update + return c +} + +func (c *TrainingUpdateCall) Do() (*Training, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.update) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "training/{data}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{data}", url.QueryEscape(c.data), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Training) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add new data to a trained model", + // "httpMethod": "PUT", + // "id": "prediction.training.update", + // "parameterOrder": [ + // "data" + // ], + // "parameters": { + // "data": { + // "description": "mybucket/mydata resource in Google Storage", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "training/{data}", + // "request": { + // "$ref": "Update" + // }, + // "response": { + // "$ref": "Training" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.4/prediction-api.json b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.4/prediction-api.json new file mode 100644 index 0000000000000..9796320eb8371 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.4/prediction-api.json @@ -0,0 +1,436 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/UHTvp9INyqQZLFiUGGWOxf3PFTA\"", + "discoveryVersion": "v1", + "id": "prediction:v1.4", + "name": "prediction", + "version": "v1.4", + "title": "Prediction API", + "description": "Lets you access a cloud hosted machine learning service that makes it easy to build smart apps", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/feature/predictionapi-16.png", + "x32": "http://www.google.com/images/icons/feature/predictionapi-32.png" + }, + "documentationLink": "https://developers.google.com/prediction/docs/developer-guide", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/prediction/v1.4/", + "basePath": "/prediction/v1.4/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "prediction/v1.4/", + "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/devstorage.full_control": { + "description": "Manage your data and permissions in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/prediction": { + "description": "Manage your data in the Google Prediction API" + } + } + } + }, + "schemas": { + "Input": { + "id": "Input", + "type": "object", + "properties": { + "input": { + "type": "object", + "description": "Input to the model for a prediction", + "properties": { + "csvInstance": { + "type": "array", + "description": "A list of input features, these can be strings or doubles.", + "items": { + "type": "any" + } + } + } + } + } + }, + "Output": { + "id": "Output", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique name for the predictive model." + }, + "kind": { + "type": "string", + "description": "What kind of resource this is.", + "default": "prediction#output" + }, + "outputLabel": { + "type": "string", + "description": "The most likely class label [Categorical models only]." + }, + "outputMulti": { + "type": "array", + "description": "A list of class labels with their estimated probabilities [Categorical models only].", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "The class label." + }, + "score": { + "type": "number", + "description": "The probability of the class label.", + "format": "double" + } + } + } + }, + "outputValue": { + "type": "number", + "description": "The estimated regression value [Regression models only].", + "format": "double" + }, + "selfLink": { + "type": "string", + "description": "A URL to re-request this resource." + } + } + }, + "Training": { + "id": "Training", + "type": "object", + "properties": { + "dataAnalysis": { + "type": "object", + "description": "Data Analysis.", + "properties": { + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "id": { + "type": "string", + "description": "The unique name for the predictive model." + }, + "kind": { + "type": "string", + "description": "What kind of resource this is.", + "default": "prediction#training" + }, + "modelInfo": { + "type": "object", + "description": "Model metadata.", + "properties": { + "classWeightedAccuracy": { + "type": "number", + "description": "Estimated accuracy of model taking utility weights into account [Categorical models only].", + "format": "double" + }, + "classificationAccuracy": { + "type": "number", + "description": "A number between 0.0 and 1.0, where 1.0 is 100% accurate. This is an estimate, based on the amount and quality of the training data, of the estimated prediction accuracy. You can use this is a guide to decide whether the results are accurate enough for your needs. This estimate will be more reliable if your real input data is similar to your training data [Categorical models only].", + "format": "double" + }, + "confusionMatrix": { + "type": "object", + "description": "An output confusion matrix. This shows an estimate for how this model will do in predictions. This is first indexed by the true class label. For each true class label, this provides a pair {predicted_label, count}, where count is the estimated number of times the model will predict the predicted label given the true label. Will not output if more then 100 classes [Categorical models only].", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "type": "number", + "format": "double" + } + } + }, + "confusionMatrixRowTotals": { + "type": "object", + "description": "A list of the confusion matrix row totals", + "additionalProperties": { + "type": "number", + "format": "double" + } + }, + "meanSquaredError": { + "type": "number", + "description": "An estimated mean squared error. The can be used to measure the quality of the predicted model [Regression models only].", + "format": "double" + }, + "modelType": { + "type": "string", + "description": "Type of predictive model (CLASSIFICATION or REGRESSION)" + }, + "numberInstances": { + "type": "string", + "description": "Number of valid data instances used in the trained model.", + "format": "int64" + }, + "numberLabels": { + "type": "string", + "description": "Number of class labels in the trained model [Categorical models only].", + "format": "int64" + } + } + }, + "selfLink": { + "type": "string", + "description": "A URL to re-request this resource." + }, + "storageDataLocation": { + "type": "string", + "description": "Google storage location of the training data file." + }, + "storagePMMLLocation": { + "type": "string", + "description": "Google storage location of the preprocessing pmml file." + }, + "storagePMMLModelLocation": { + "type": "string", + "description": "Google storage location of the pmml model file." + }, + "trainingStatus": { + "type": "string", + "description": "The current status of the training job. This can be one of following: RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND" + }, + "utility": { + "type": "array", + "description": "A class weighting function, which allows the importance weights for class labels to be specified [Categorical models only].", + "items": { + "type": "object", + "description": "Class label (string).", + "additionalProperties": { + "type": "number", + "format": "double" + } + } + } + } + }, + "Update": { + "id": "Update", + "type": "object", + "properties": { + "csvInstance": { + "type": "array", + "description": "The input features for this instance", + "items": { + "type": "any" + } + }, + "label": { + "type": "string", + "description": "The class label of this instance" + }, + "output": { + "type": "string", + "description": "The generic output value - could be regression value or class label" + } + } + } + }, + "resources": { + "hostedmodels": { + "methods": { + "predict": { + "id": "prediction.hostedmodels.predict", + "path": "hostedmodels/{hostedModelName}/predict", + "httpMethod": "POST", + "description": "Submit input and request an output against a hosted model.", + "parameters": { + "hostedModelName": { + "type": "string", + "description": "The name of a hosted model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "hostedModelName" + ], + "request": { + "$ref": "Input" + }, + "response": { + "$ref": "Output" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + } + } + }, + "trainedmodels": { + "methods": { + "delete": { + "id": "prediction.trainedmodels.delete", + "path": "trainedmodels/{id}", + "httpMethod": "DELETE", + "description": "Delete a trained model.", + "parameters": { + "id": { + "type": "string", + "description": "The unique name for the predictive model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "get": { + "id": "prediction.trainedmodels.get", + "path": "trainedmodels/{id}", + "httpMethod": "GET", + "description": "Check training status of your model.", + "parameters": { + "id": { + "type": "string", + "description": "The unique name for the predictive model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Training" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "insert": { + "id": "prediction.trainedmodels.insert", + "path": "trainedmodels", + "httpMethod": "POST", + "description": "Begin training your model.", + "request": { + "$ref": "Training" + }, + "response": { + "$ref": "Training" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/prediction" + ] + }, + "predict": { + "id": "prediction.trainedmodels.predict", + "path": "trainedmodels/{id}/predict", + "httpMethod": "POST", + "description": "Submit model id and request a prediction", + "parameters": { + "id": { + "type": "string", + "description": "The unique name for the predictive model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "Input" + }, + "response": { + "$ref": "Output" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "update": { + "id": "prediction.trainedmodels.update", + "path": "trainedmodels/{id}", + "httpMethod": "PUT", + "description": "Add new data to a trained model.", + "parameters": { + "id": { + "type": "string", + "description": "The unique name for the predictive model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "Update" + }, + "response": { + "$ref": "Training" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.4/prediction-gen.go b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.4/prediction-gen.go new file mode 100644 index 0000000000000..1081a0004f8a9 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.4/prediction-gen.go @@ -0,0 +1,646 @@ +// Package prediction provides access to the Prediction API. +// +// See https://developers.google.com/prediction/docs/developer-guide +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/prediction/v1.4" +// ... +// predictionService, err := prediction.New(oauthHttpClient) +package prediction + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "prediction:v1.4" +const apiName = "prediction" +const apiVersion = "v1.4" +const basePath = "https://www.googleapis.com/prediction/v1.4/" + +// OAuth2 scopes used by this API. +const ( + // Manage your data and permissions in Google Cloud Storage + DevstorageFull_controlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageRead_onlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageRead_writeScope = "https://www.googleapis.com/auth/devstorage.read_write" + + // Manage your data in the Google Prediction API + PredictionScope = "https://www.googleapis.com/auth/prediction" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Hostedmodels = NewHostedmodelsService(s) + s.Trainedmodels = NewTrainedmodelsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Hostedmodels *HostedmodelsService + + Trainedmodels *TrainedmodelsService +} + +func NewHostedmodelsService(s *Service) *HostedmodelsService { + rs := &HostedmodelsService{s: s} + return rs +} + +type HostedmodelsService struct { + s *Service +} + +func NewTrainedmodelsService(s *Service) *TrainedmodelsService { + rs := &TrainedmodelsService{s: s} + return rs +} + +type TrainedmodelsService struct { + s *Service +} + +type Input struct { + // Input: Input to the model for a prediction + Input *InputInput `json:"input,omitempty"` +} + +type InputInput struct { + // CsvInstance: A list of input features, these can be strings or + // doubles. + CsvInstance []interface{} `json:"csvInstance,omitempty"` +} + +type Output struct { + // Id: The unique name for the predictive model. + Id string `json:"id,omitempty"` + + // Kind: What kind of resource this is. + Kind string `json:"kind,omitempty"` + + // OutputLabel: The most likely class label [Categorical models only]. + OutputLabel string `json:"outputLabel,omitempty"` + + // OutputMulti: A list of class labels with their estimated + // probabilities [Categorical models only]. + OutputMulti []*OutputOutputMulti `json:"outputMulti,omitempty"` + + // OutputValue: The estimated regression value [Regression models only]. + OutputValue float64 `json:"outputValue,omitempty"` + + // SelfLink: A URL to re-request this resource. + SelfLink string `json:"selfLink,omitempty"` +} + +type OutputOutputMulti struct { + // Label: The class label. + Label string `json:"label,omitempty"` + + // Score: The probability of the class label. + Score float64 `json:"score,omitempty"` +} + +type Training struct { + // DataAnalysis: Data Analysis. + DataAnalysis *TrainingDataAnalysis `json:"dataAnalysis,omitempty"` + + // Id: The unique name for the predictive model. + Id string `json:"id,omitempty"` + + // Kind: What kind of resource this is. + Kind string `json:"kind,omitempty"` + + // ModelInfo: Model metadata. + ModelInfo *TrainingModelInfo `json:"modelInfo,omitempty"` + + // SelfLink: A URL to re-request this resource. + SelfLink string `json:"selfLink,omitempty"` + + // StorageDataLocation: Google storage location of the training data + // file. + StorageDataLocation string `json:"storageDataLocation,omitempty"` + + // StoragePMMLLocation: Google storage location of the preprocessing + // pmml file. + StoragePMMLLocation string `json:"storagePMMLLocation,omitempty"` + + // StoragePMMLModelLocation: Google storage location of the pmml model + // file. + StoragePMMLModelLocation string `json:"storagePMMLModelLocation,omitempty"` + + // TrainingStatus: The current status of the training job. This can be + // one of following: RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND + TrainingStatus string `json:"trainingStatus,omitempty"` + + // Utility: A class weighting function, which allows the importance + // weights for class labels to be specified [Categorical models only]. + Utility []*TrainingUtility `json:"utility,omitempty"` +} + +type TrainingDataAnalysis struct { + Warnings []string `json:"warnings,omitempty"` +} + +type TrainingModelInfo struct { + // ClassWeightedAccuracy: Estimated accuracy of model taking utility + // weights into account [Categorical models only]. + ClassWeightedAccuracy float64 `json:"classWeightedAccuracy,omitempty"` + + // ClassificationAccuracy: A number between 0.0 and 1.0, where 1.0 is + // 100% accurate. This is an estimate, based on the amount and quality + // of the training data, of the estimated prediction accuracy. You can + // use this is a guide to decide whether the results are accurate enough + // for your needs. This estimate will be more reliable if your real + // input data is similar to your training data [Categorical models + // only]. + ClassificationAccuracy float64 `json:"classificationAccuracy,omitempty"` + + // ConfusionMatrix: An output confusion matrix. This shows an estimate + // for how this model will do in predictions. This is first indexed by + // the true class label. For each true class label, this provides a pair + // {predicted_label, count}, where count is the estimated number of + // times the model will predict the predicted label given the true + // label. Will not output if more then 100 classes [Categorical models + // only]. + ConfusionMatrix *TrainingModelInfoConfusionMatrix `json:"confusionMatrix,omitempty"` + + // ConfusionMatrixRowTotals: A list of the confusion matrix row totals + ConfusionMatrixRowTotals *TrainingModelInfoConfusionMatrixRowTotals `json:"confusionMatrixRowTotals,omitempty"` + + // MeanSquaredError: An estimated mean squared error. The can be used to + // measure the quality of the predicted model [Regression models only]. + MeanSquaredError float64 `json:"meanSquaredError,omitempty"` + + // ModelType: Type of predictive model (CLASSIFICATION or REGRESSION) + ModelType string `json:"modelType,omitempty"` + + // NumberInstances: Number of valid data instances used in the trained + // model. + NumberInstances int64 `json:"numberInstances,omitempty,string"` + + // NumberLabels: Number of class labels in the trained model + // [Categorical models only]. + NumberLabels int64 `json:"numberLabels,omitempty,string"` +} + +type TrainingModelInfoConfusionMatrix struct { +} + +type TrainingModelInfoConfusionMatrixRowTotals struct { +} + +type TrainingUtility struct { +} + +type Update struct { + // CsvInstance: The input features for this instance + CsvInstance []interface{} `json:"csvInstance,omitempty"` + + // Label: The class label of this instance + Label string `json:"label,omitempty"` + + // Output: The generic output value - could be regression value or class + // label + Output string `json:"output,omitempty"` +} + +// method id "prediction.hostedmodels.predict": + +type HostedmodelsPredictCall struct { + s *Service + hostedModelName string + input *Input + opt_ map[string]interface{} +} + +// Predict: Submit input and request an output against a hosted model. +func (r *HostedmodelsService) Predict(hostedModelName string, input *Input) *HostedmodelsPredictCall { + c := &HostedmodelsPredictCall{s: r.s, opt_: make(map[string]interface{})} + c.hostedModelName = hostedModelName + c.input = input + return c +} + +func (c *HostedmodelsPredictCall) Do() (*Output, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.input) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "hostedmodels/{hostedModelName}/predict") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{hostedModelName}", url.QueryEscape(c.hostedModelName), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Output) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Submit input and request an output against a hosted model.", + // "httpMethod": "POST", + // "id": "prediction.hostedmodels.predict", + // "parameterOrder": [ + // "hostedModelName" + // ], + // "parameters": { + // "hostedModelName": { + // "description": "The name of a hosted model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "hostedmodels/{hostedModelName}/predict", + // "request": { + // "$ref": "Input" + // }, + // "response": { + // "$ref": "Output" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.delete": + +type TrainedmodelsDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Delete: Delete a trained model. +func (r *TrainedmodelsService) Delete(id string) *TrainedmodelsDeleteCall { + c := &TrainedmodelsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *TrainedmodelsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a trained model.", + // "httpMethod": "DELETE", + // "id": "prediction.trainedmodels.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "trainedmodels/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.get": + +type TrainedmodelsGetCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Get: Check training status of your model. +func (r *TrainedmodelsService) Get(id string) *TrainedmodelsGetCall { + c := &TrainedmodelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *TrainedmodelsGetCall) Do() (*Training, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Training) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Check training status of your model.", + // "httpMethod": "GET", + // "id": "prediction.trainedmodels.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "trainedmodels/{id}", + // "response": { + // "$ref": "Training" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.insert": + +type TrainedmodelsInsertCall struct { + s *Service + training *Training + opt_ map[string]interface{} +} + +// Insert: Begin training your model. +func (r *TrainedmodelsService) Insert(training *Training) *TrainedmodelsInsertCall { + c := &TrainedmodelsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.training = training + return c +} + +func (c *TrainedmodelsInsertCall) Do() (*Training, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.training) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Training) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Begin training your model.", + // "httpMethod": "POST", + // "id": "prediction.trainedmodels.insert", + // "path": "trainedmodels", + // "request": { + // "$ref": "Training" + // }, + // "response": { + // "$ref": "Training" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write", + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.predict": + +type TrainedmodelsPredictCall struct { + s *Service + id string + input *Input + opt_ map[string]interface{} +} + +// Predict: Submit model id and request a prediction +func (r *TrainedmodelsService) Predict(id string, input *Input) *TrainedmodelsPredictCall { + c := &TrainedmodelsPredictCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.input = input + return c +} + +func (c *TrainedmodelsPredictCall) Do() (*Output, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.input) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/{id}/predict") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Output) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Submit model id and request a prediction", + // "httpMethod": "POST", + // "id": "prediction.trainedmodels.predict", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "trainedmodels/{id}/predict", + // "request": { + // "$ref": "Input" + // }, + // "response": { + // "$ref": "Output" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.update": + +type TrainedmodelsUpdateCall struct { + s *Service + id string + update *Update + opt_ map[string]interface{} +} + +// Update: Add new data to a trained model. +func (r *TrainedmodelsService) Update(id string, update *Update) *TrainedmodelsUpdateCall { + c := &TrainedmodelsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.update = update + return c +} + +func (c *TrainedmodelsUpdateCall) Do() (*Training, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.update) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Training) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add new data to a trained model.", + // "httpMethod": "PUT", + // "id": "prediction.trainedmodels.update", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "trainedmodels/{id}", + // "request": { + // "$ref": "Update" + // }, + // "response": { + // "$ref": "Training" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.5/prediction-api.json b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.5/prediction-api.json new file mode 100644 index 0000000000000..630bc357e236e --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.5/prediction-api.json @@ -0,0 +1,699 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/ym-BJa5yGEZsHgX-PiovxSth2PY\"", + "discoveryVersion": "v1", + "id": "prediction:v1.5", + "name": "prediction", + "version": "v1.5", + "title": "Prediction API", + "description": "Lets you access a cloud hosted machine learning service that makes it easy to build smart apps", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/feature/predictionapi-16.png", + "x32": "http://www.google.com/images/icons/feature/predictionapi-32.png" + }, + "documentationLink": "https://developers.google.com/prediction/docs/developer-guide", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/prediction/v1.5/", + "basePath": "/prediction/v1.5/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "prediction/v1.5/", + "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/devstorage.full_control": { + "description": "Manage your data and permissions in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/prediction": { + "description": "Manage your data in the Google Prediction API" + } + } + } + }, + "schemas": { + "Analyze": { + "id": "Analyze", + "type": "object", + "properties": { + "dataDescription": { + "type": "object", + "description": "Description of the data the model was trained on.", + "properties": { + "features": { + "type": "array", + "description": "Description of the input features in the data set.", + "items": { + "type": "object", + "properties": { + "categorical": { + "type": "object", + "description": "Description of the categorical values of this feature.", + "properties": { + "count": { + "type": "string", + "description": "Number of categorical values for this feature in the data.", + "format": "int64" + }, + "values": { + "type": "array", + "description": "List of all the categories for this feature in the data set.", + "items": { + "type": "object", + "properties": { + "count": { + "type": "string", + "description": "Number of times this feature had this value.", + "format": "int64" + }, + "value": { + "type": "string", + "description": "The category name." + } + } + } + } + } + }, + "index": { + "type": "string", + "description": "The feature index.", + "format": "int64" + }, + "numeric": { + "type": "object", + "description": "Description of the numeric values of this feature.", + "properties": { + "count": { + "type": "string", + "description": "Number of numeric values for this feature in the data set.", + "format": "int64" + }, + "mean": { + "type": "number", + "description": "Mean of the numeric values of this feature in the data set.", + "format": "double" + }, + "variance": { + "type": "number", + "description": "Variance of the numeric values of this feature in the data set.", + "format": "double" + } + } + }, + "text": { + "type": "object", + "description": "Description of multiple-word text values of this feature.", + "properties": { + "count": { + "type": "string", + "description": "Number of multiple-word text values for this feature.", + "format": "int64" + } + } + } + } + } + }, + "outputFeature": { + "type": "object", + "description": "Description of the output value or label.", + "properties": { + "numeric": { + "type": "object", + "description": "Description of the output values in the data set.", + "properties": { + "count": { + "type": "string", + "description": "Number of numeric output values in the data set.", + "format": "int64" + }, + "mean": { + "type": "number", + "description": "Mean of the output values in the data set.", + "format": "double" + }, + "variance": { + "type": "number", + "description": "Variance of the output values in the data set.", + "format": "double" + } + } + }, + "text": { + "type": "array", + "description": "Description of the output labels in the data set.", + "items": { + "type": "object", + "properties": { + "count": { + "type": "string", + "description": "Number of times the output label occurred in the data set.", + "format": "int64" + }, + "value": { + "type": "string", + "description": "The output label." + } + } + } + } + } + } + } + }, + "errors": { + "type": "array", + "description": "List of errors with the data.", + "items": { + "type": "object", + "additionalProperties": { + "type": "string", + "description": "Error level followed by a detailed error message." + } + } + }, + "id": { + "type": "string", + "description": "The unique name for the predictive model." + }, + "kind": { + "type": "string", + "description": "What kind of resource this is.", + "default": "prediction#analyze" + }, + "modelDescription": { + "type": "object", + "description": "Description of the model.", + "properties": { + "confusionMatrix": { + "type": "object", + "description": "An output confusion matrix. This shows an estimate for how this model will do in predictions. This is first indexed by the true class label. For each true class label, this provides a pair {predicted_label, count}, where count is the estimated number of times the model will predict the predicted label given the true label. Will not output if more then 100 classes [Categorical models only].", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "type": "number", + "format": "double" + } + } + }, + "confusionMatrixRowTotals": { + "type": "object", + "description": "A list of the confusion matrix row totals", + "additionalProperties": { + "type": "number", + "format": "double" + } + }, + "modelinfo": { + "$ref": "Training", + "description": "Basic information about the model." + } + } + }, + "selfLink": { + "type": "string", + "description": "A URL to re-request this resource." + } + } + }, + "Input": { + "id": "Input", + "type": "object", + "properties": { + "input": { + "type": "object", + "description": "Input to the model for a prediction", + "properties": { + "csvInstance": { + "type": "array", + "description": "A list of input features, these can be strings or doubles.", + "items": { + "type": "any" + } + } + } + } + } + }, + "List": { + "id": "List", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "List of models.", + "items": { + "$ref": "Training" + } + }, + "kind": { + "type": "string", + "description": "What kind of resource this is.", + "default": "prediction#list" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to fetch the next page, if one exists." + }, + "selfLink": { + "type": "string", + "description": "A URL to re-request this resource." + } + } + }, + "Output": { + "id": "Output", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique name for the predictive model." + }, + "kind": { + "type": "string", + "description": "What kind of resource this is.", + "default": "prediction#output" + }, + "outputLabel": { + "type": "string", + "description": "The most likely class label [Categorical models only]." + }, + "outputMulti": { + "type": "array", + "description": "A list of class labels with their estimated probabilities [Categorical models only].", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "The class label." + }, + "score": { + "type": "number", + "description": "The probability of the class label.", + "format": "double" + } + } + } + }, + "outputValue": { + "type": "number", + "description": "The estimated regression value [Regression models only].", + "format": "double" + }, + "selfLink": { + "type": "string", + "description": "A URL to re-request this resource." + } + } + }, + "Training": { + "id": "Training", + "type": "object", + "properties": { + "created": { + "type": "string", + "description": "Insert time of the model (as a RFC 3339 timestamp).", + "format": "date-time" + }, + "id": { + "type": "string", + "description": "The unique name for the predictive model." + }, + "kind": { + "type": "string", + "description": "What kind of resource this is.", + "default": "prediction#training" + }, + "modelInfo": { + "type": "object", + "description": "Model metadata.", + "properties": { + "classWeightedAccuracy": { + "type": "number", + "description": "Estimated accuracy of model taking utility weights into account [Categorical models only].", + "format": "double" + }, + "classificationAccuracy": { + "type": "number", + "description": "A number between 0.0 and 1.0, where 1.0 is 100% accurate. This is an estimate, based on the amount and quality of the training data, of the estimated prediction accuracy. You can use this is a guide to decide whether the results are accurate enough for your needs. This estimate will be more reliable if your real input data is similar to your training data [Categorical models only].", + "format": "double" + }, + "meanSquaredError": { + "type": "number", + "description": "An estimated mean squared error. The can be used to measure the quality of the predicted model [Regression models only].", + "format": "double" + }, + "modelType": { + "type": "string", + "description": "Type of predictive model (CLASSIFICATION or REGRESSION)" + }, + "numberInstances": { + "type": "string", + "description": "Number of valid data instances used in the trained model.", + "format": "int64" + }, + "numberLabels": { + "type": "string", + "description": "Number of class labels in the trained model [Categorical models only].", + "format": "int64" + } + } + }, + "modelType": { + "type": "string", + "description": "Type of predictive model (classification or regression)" + }, + "selfLink": { + "type": "string", + "description": "A URL to re-request this resource." + }, + "storageDataLocation": { + "type": "string", + "description": "Google storage location of the training data file." + }, + "storagePMMLLocation": { + "type": "string", + "description": "Google storage location of the preprocessing pmml file." + }, + "storagePMMLModelLocation": { + "type": "string", + "description": "Google storage location of the pmml model file." + }, + "trainingComplete": { + "type": "string", + "description": "Training completion time (as a RFC 3339 timestamp).", + "format": "date-time" + }, + "trainingInstances": { + "type": "array", + "description": "Instances to train model on.", + "items": { + "type": "object", + "properties": { + "csvInstance": { + "type": "array", + "description": "The input features for this instance", + "items": { + "type": "any" + } + }, + "output": { + "type": "string", + "description": "The generic output value - could be regression or class label" + } + } + } + }, + "trainingStatus": { + "type": "string", + "description": "The current status of the training job. This can be one of following: RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND" + }, + "utility": { + "type": "array", + "description": "A class weighting function, which allows the importance weights for class labels to be specified [Categorical models only].", + "items": { + "type": "object", + "description": "Class label (string).", + "additionalProperties": { + "type": "number", + "format": "double" + } + } + } + } + }, + "Update": { + "id": "Update", + "type": "object", + "properties": { + "csvInstance": { + "type": "array", + "description": "The input features for this instance", + "items": { + "type": "any" + } + }, + "label": { + "type": "string", + "description": "The class label of this instance" + }, + "output": { + "type": "string", + "description": "The generic output value - could be regression value or class label" + } + } + } + }, + "resources": { + "hostedmodels": { + "methods": { + "predict": { + "id": "prediction.hostedmodels.predict", + "path": "hostedmodels/{hostedModelName}/predict", + "httpMethod": "POST", + "description": "Submit input and request an output against a hosted model.", + "parameters": { + "hostedModelName": { + "type": "string", + "description": "The name of a hosted model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "hostedModelName" + ], + "request": { + "$ref": "Input" + }, + "response": { + "$ref": "Output" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + } + } + }, + "trainedmodels": { + "methods": { + "analyze": { + "id": "prediction.trainedmodels.analyze", + "path": "trainedmodels/{id}/analyze", + "httpMethod": "GET", + "description": "Get analysis of the model and the data the model was trained on.", + "parameters": { + "id": { + "type": "string", + "description": "The unique name for the predictive model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Analyze" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "delete": { + "id": "prediction.trainedmodels.delete", + "path": "trainedmodels/{id}", + "httpMethod": "DELETE", + "description": "Delete a trained model.", + "parameters": { + "id": { + "type": "string", + "description": "The unique name for the predictive model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "get": { + "id": "prediction.trainedmodels.get", + "path": "trainedmodels/{id}", + "httpMethod": "GET", + "description": "Check training status of your model.", + "parameters": { + "id": { + "type": "string", + "description": "The unique name for the predictive model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Training" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "insert": { + "id": "prediction.trainedmodels.insert", + "path": "trainedmodels", + "httpMethod": "POST", + "description": "Begin training your model.", + "request": { + "$ref": "Training" + }, + "response": { + "$ref": "Training" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/prediction" + ] + }, + "list": { + "id": "prediction.trainedmodels.list", + "path": "trainedmodels/list", + "httpMethod": "GET", + "description": "List available models.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Pagination token", + "location": "query" + } + }, + "response": { + "$ref": "List" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "predict": { + "id": "prediction.trainedmodels.predict", + "path": "trainedmodels/{id}/predict", + "httpMethod": "POST", + "description": "Submit model id and request a prediction.", + "parameters": { + "id": { + "type": "string", + "description": "The unique name for the predictive model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "Input" + }, + "response": { + "$ref": "Output" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "update": { + "id": "prediction.trainedmodels.update", + "path": "trainedmodels/{id}", + "httpMethod": "PUT", + "description": "Add new data to a trained model.", + "parameters": { + "id": { + "type": "string", + "description": "The unique name for the predictive model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "Update" + }, + "response": { + "$ref": "Training" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.5/prediction-gen.go b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.5/prediction-gen.go new file mode 100644 index 0000000000000..09ac794abc2c5 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.5/prediction-gen.go @@ -0,0 +1,929 @@ +// Package prediction provides access to the Prediction API. +// +// See https://developers.google.com/prediction/docs/developer-guide +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/prediction/v1.5" +// ... +// predictionService, err := prediction.New(oauthHttpClient) +package prediction + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "prediction:v1.5" +const apiName = "prediction" +const apiVersion = "v1.5" +const basePath = "https://www.googleapis.com/prediction/v1.5/" + +// OAuth2 scopes used by this API. +const ( + // Manage your data and permissions in Google Cloud Storage + DevstorageFull_controlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageRead_onlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageRead_writeScope = "https://www.googleapis.com/auth/devstorage.read_write" + + // Manage your data in the Google Prediction API + PredictionScope = "https://www.googleapis.com/auth/prediction" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Hostedmodels = NewHostedmodelsService(s) + s.Trainedmodels = NewTrainedmodelsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Hostedmodels *HostedmodelsService + + Trainedmodels *TrainedmodelsService +} + +func NewHostedmodelsService(s *Service) *HostedmodelsService { + rs := &HostedmodelsService{s: s} + return rs +} + +type HostedmodelsService struct { + s *Service +} + +func NewTrainedmodelsService(s *Service) *TrainedmodelsService { + rs := &TrainedmodelsService{s: s} + return rs +} + +type TrainedmodelsService struct { + s *Service +} + +type Analyze struct { + // DataDescription: Description of the data the model was trained on. + DataDescription *AnalyzeDataDescription `json:"dataDescription,omitempty"` + + // Errors: List of errors with the data. + Errors []map[string]string `json:"errors,omitempty"` + + // Id: The unique name for the predictive model. + Id string `json:"id,omitempty"` + + // Kind: What kind of resource this is. + Kind string `json:"kind,omitempty"` + + // ModelDescription: Description of the model. + ModelDescription *AnalyzeModelDescription `json:"modelDescription,omitempty"` + + // SelfLink: A URL to re-request this resource. + SelfLink string `json:"selfLink,omitempty"` +} + +type AnalyzeDataDescription struct { + // Features: Description of the input features in the data set. + Features []*AnalyzeDataDescriptionFeatures `json:"features,omitempty"` + + // OutputFeature: Description of the output value or label. + OutputFeature *AnalyzeDataDescriptionOutputFeature `json:"outputFeature,omitempty"` +} + +type AnalyzeDataDescriptionFeatures struct { + // Categorical: Description of the categorical values of this feature. + Categorical *AnalyzeDataDescriptionFeaturesCategorical `json:"categorical,omitempty"` + + // Index: The feature index. + Index int64 `json:"index,omitempty,string"` + + // Numeric: Description of the numeric values of this feature. + Numeric *AnalyzeDataDescriptionFeaturesNumeric `json:"numeric,omitempty"` + + // Text: Description of multiple-word text values of this feature. + Text *AnalyzeDataDescriptionFeaturesText `json:"text,omitempty"` +} + +type AnalyzeDataDescriptionFeaturesCategorical struct { + // Count: Number of categorical values for this feature in the data. + Count int64 `json:"count,omitempty,string"` + + // Values: List of all the categories for this feature in the data set. + Values []*AnalyzeDataDescriptionFeaturesCategoricalValues `json:"values,omitempty"` +} + +type AnalyzeDataDescriptionFeaturesCategoricalValues struct { + // Count: Number of times this feature had this value. + Count int64 `json:"count,omitempty,string"` + + // Value: The category name. + Value string `json:"value,omitempty"` +} + +type AnalyzeDataDescriptionFeaturesNumeric struct { + // Count: Number of numeric values for this feature in the data set. + Count int64 `json:"count,omitempty,string"` + + // Mean: Mean of the numeric values of this feature in the data set. + Mean float64 `json:"mean,omitempty"` + + // Variance: Variance of the numeric values of this feature in the data + // set. + Variance float64 `json:"variance,omitempty"` +} + +type AnalyzeDataDescriptionFeaturesText struct { + // Count: Number of multiple-word text values for this feature. + Count int64 `json:"count,omitempty,string"` +} + +type AnalyzeDataDescriptionOutputFeature struct { + // Numeric: Description of the output values in the data set. + Numeric *AnalyzeDataDescriptionOutputFeatureNumeric `json:"numeric,omitempty"` + + // Text: Description of the output labels in the data set. + Text []*AnalyzeDataDescriptionOutputFeatureText `json:"text,omitempty"` +} + +type AnalyzeDataDescriptionOutputFeatureNumeric struct { + // Count: Number of numeric output values in the data set. + Count int64 `json:"count,omitempty,string"` + + // Mean: Mean of the output values in the data set. + Mean float64 `json:"mean,omitempty"` + + // Variance: Variance of the output values in the data set. + Variance float64 `json:"variance,omitempty"` +} + +type AnalyzeDataDescriptionOutputFeatureText struct { + // Count: Number of times the output label occurred in the data set. + Count int64 `json:"count,omitempty,string"` + + // Value: The output label. + Value string `json:"value,omitempty"` +} + +type AnalyzeModelDescription struct { + // ConfusionMatrix: An output confusion matrix. This shows an estimate + // for how this model will do in predictions. This is first indexed by + // the true class label. For each true class label, this provides a pair + // {predicted_label, count}, where count is the estimated number of + // times the model will predict the predicted label given the true + // label. Will not output if more then 100 classes [Categorical models + // only]. + ConfusionMatrix *AnalyzeModelDescriptionConfusionMatrix `json:"confusionMatrix,omitempty"` + + // ConfusionMatrixRowTotals: A list of the confusion matrix row totals + ConfusionMatrixRowTotals *AnalyzeModelDescriptionConfusionMatrixRowTotals `json:"confusionMatrixRowTotals,omitempty"` + + // Modelinfo: Basic information about the model. + Modelinfo *Training `json:"modelinfo,omitempty"` +} + +type AnalyzeModelDescriptionConfusionMatrix struct { +} + +type AnalyzeModelDescriptionConfusionMatrixRowTotals struct { +} + +type Input struct { + // Input: Input to the model for a prediction + Input *InputInput `json:"input,omitempty"` +} + +type InputInput struct { + // CsvInstance: A list of input features, these can be strings or + // doubles. + CsvInstance []interface{} `json:"csvInstance,omitempty"` +} + +type List struct { + // Items: List of models. + Items []*Training `json:"items,omitempty"` + + // Kind: What kind of resource this is. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to fetch the next page, if one + // exists. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: A URL to re-request this resource. + SelfLink string `json:"selfLink,omitempty"` +} + +type Output struct { + // Id: The unique name for the predictive model. + Id string `json:"id,omitempty"` + + // Kind: What kind of resource this is. + Kind string `json:"kind,omitempty"` + + // OutputLabel: The most likely class label [Categorical models only]. + OutputLabel string `json:"outputLabel,omitempty"` + + // OutputMulti: A list of class labels with their estimated + // probabilities [Categorical models only]. + OutputMulti []*OutputOutputMulti `json:"outputMulti,omitempty"` + + // OutputValue: The estimated regression value [Regression models only]. + OutputValue float64 `json:"outputValue,omitempty"` + + // SelfLink: A URL to re-request this resource. + SelfLink string `json:"selfLink,omitempty"` +} + +type OutputOutputMulti struct { + // Label: The class label. + Label string `json:"label,omitempty"` + + // Score: The probability of the class label. + Score float64 `json:"score,omitempty"` +} + +type Training struct { + // Created: Insert time of the model (as a RFC 3339 timestamp). + Created string `json:"created,omitempty"` + + // Id: The unique name for the predictive model. + Id string `json:"id,omitempty"` + + // Kind: What kind of resource this is. + Kind string `json:"kind,omitempty"` + + // ModelInfo: Model metadata. + ModelInfo *TrainingModelInfo `json:"modelInfo,omitempty"` + + // ModelType: Type of predictive model (classification or regression) + ModelType string `json:"modelType,omitempty"` + + // SelfLink: A URL to re-request this resource. + SelfLink string `json:"selfLink,omitempty"` + + // StorageDataLocation: Google storage location of the training data + // file. + StorageDataLocation string `json:"storageDataLocation,omitempty"` + + // StoragePMMLLocation: Google storage location of the preprocessing + // pmml file. + StoragePMMLLocation string `json:"storagePMMLLocation,omitempty"` + + // StoragePMMLModelLocation: Google storage location of the pmml model + // file. + StoragePMMLModelLocation string `json:"storagePMMLModelLocation,omitempty"` + + // TrainingComplete: Training completion time (as a RFC 3339 timestamp). + TrainingComplete string `json:"trainingComplete,omitempty"` + + // TrainingInstances: Instances to train model on. + TrainingInstances []*TrainingTrainingInstances `json:"trainingInstances,omitempty"` + + // TrainingStatus: The current status of the training job. This can be + // one of following: RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND + TrainingStatus string `json:"trainingStatus,omitempty"` + + // Utility: A class weighting function, which allows the importance + // weights for class labels to be specified [Categorical models only]. + Utility []*TrainingUtility `json:"utility,omitempty"` +} + +type TrainingModelInfo struct { + // ClassWeightedAccuracy: Estimated accuracy of model taking utility + // weights into account [Categorical models only]. + ClassWeightedAccuracy float64 `json:"classWeightedAccuracy,omitempty"` + + // ClassificationAccuracy: A number between 0.0 and 1.0, where 1.0 is + // 100% accurate. This is an estimate, based on the amount and quality + // of the training data, of the estimated prediction accuracy. You can + // use this is a guide to decide whether the results are accurate enough + // for your needs. This estimate will be more reliable if your real + // input data is similar to your training data [Categorical models + // only]. + ClassificationAccuracy float64 `json:"classificationAccuracy,omitempty"` + + // MeanSquaredError: An estimated mean squared error. The can be used to + // measure the quality of the predicted model [Regression models only]. + MeanSquaredError float64 `json:"meanSquaredError,omitempty"` + + // ModelType: Type of predictive model (CLASSIFICATION or REGRESSION) + ModelType string `json:"modelType,omitempty"` + + // NumberInstances: Number of valid data instances used in the trained + // model. + NumberInstances int64 `json:"numberInstances,omitempty,string"` + + // NumberLabels: Number of class labels in the trained model + // [Categorical models only]. + NumberLabels int64 `json:"numberLabels,omitempty,string"` +} + +type TrainingTrainingInstances struct { + // CsvInstance: The input features for this instance + CsvInstance []interface{} `json:"csvInstance,omitempty"` + + // Output: The generic output value - could be regression or class label + Output string `json:"output,omitempty"` +} + +type TrainingUtility struct { +} + +type Update struct { + // CsvInstance: The input features for this instance + CsvInstance []interface{} `json:"csvInstance,omitempty"` + + // Label: The class label of this instance + Label string `json:"label,omitempty"` + + // Output: The generic output value - could be regression value or class + // label + Output string `json:"output,omitempty"` +} + +// method id "prediction.hostedmodels.predict": + +type HostedmodelsPredictCall struct { + s *Service + hostedModelName string + input *Input + opt_ map[string]interface{} +} + +// Predict: Submit input and request an output against a hosted model. +func (r *HostedmodelsService) Predict(hostedModelName string, input *Input) *HostedmodelsPredictCall { + c := &HostedmodelsPredictCall{s: r.s, opt_: make(map[string]interface{})} + c.hostedModelName = hostedModelName + c.input = input + return c +} + +func (c *HostedmodelsPredictCall) Do() (*Output, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.input) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "hostedmodels/{hostedModelName}/predict") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{hostedModelName}", url.QueryEscape(c.hostedModelName), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Output) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Submit input and request an output against a hosted model.", + // "httpMethod": "POST", + // "id": "prediction.hostedmodels.predict", + // "parameterOrder": [ + // "hostedModelName" + // ], + // "parameters": { + // "hostedModelName": { + // "description": "The name of a hosted model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "hostedmodels/{hostedModelName}/predict", + // "request": { + // "$ref": "Input" + // }, + // "response": { + // "$ref": "Output" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.analyze": + +type TrainedmodelsAnalyzeCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Analyze: Get analysis of the model and the data the model was trained +// on. +func (r *TrainedmodelsService) Analyze(id string) *TrainedmodelsAnalyzeCall { + c := &TrainedmodelsAnalyzeCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *TrainedmodelsAnalyzeCall) Do() (*Analyze, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/{id}/analyze") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Analyze) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get analysis of the model and the data the model was trained on.", + // "httpMethod": "GET", + // "id": "prediction.trainedmodels.analyze", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "trainedmodels/{id}/analyze", + // "response": { + // "$ref": "Analyze" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.delete": + +type TrainedmodelsDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Delete: Delete a trained model. +func (r *TrainedmodelsService) Delete(id string) *TrainedmodelsDeleteCall { + c := &TrainedmodelsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *TrainedmodelsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a trained model.", + // "httpMethod": "DELETE", + // "id": "prediction.trainedmodels.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "trainedmodels/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.get": + +type TrainedmodelsGetCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Get: Check training status of your model. +func (r *TrainedmodelsService) Get(id string) *TrainedmodelsGetCall { + c := &TrainedmodelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *TrainedmodelsGetCall) Do() (*Training, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Training) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Check training status of your model.", + // "httpMethod": "GET", + // "id": "prediction.trainedmodels.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "trainedmodels/{id}", + // "response": { + // "$ref": "Training" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.insert": + +type TrainedmodelsInsertCall struct { + s *Service + training *Training + opt_ map[string]interface{} +} + +// Insert: Begin training your model. +func (r *TrainedmodelsService) Insert(training *Training) *TrainedmodelsInsertCall { + c := &TrainedmodelsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.training = training + return c +} + +func (c *TrainedmodelsInsertCall) Do() (*Training, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.training) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Training) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Begin training your model.", + // "httpMethod": "POST", + // "id": "prediction.trainedmodels.insert", + // "path": "trainedmodels", + // "request": { + // "$ref": "Training" + // }, + // "response": { + // "$ref": "Training" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write", + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.list": + +type TrainedmodelsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List available models. +func (r *TrainedmodelsService) List() *TrainedmodelsListCall { + c := &TrainedmodelsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return +func (c *TrainedmodelsListCall) MaxResults(maxResults int64) *TrainedmodelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Pagination token +func (c *TrainedmodelsListCall) PageToken(pageToken string) *TrainedmodelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *TrainedmodelsListCall) Do() (*List, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/list") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(List) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List available models.", + // "httpMethod": "GET", + // "id": "prediction.trainedmodels.list", + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Pagination token", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "trainedmodels/list", + // "response": { + // "$ref": "List" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.predict": + +type TrainedmodelsPredictCall struct { + s *Service + id string + input *Input + opt_ map[string]interface{} +} + +// Predict: Submit model id and request a prediction. +func (r *TrainedmodelsService) Predict(id string, input *Input) *TrainedmodelsPredictCall { + c := &TrainedmodelsPredictCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.input = input + return c +} + +func (c *TrainedmodelsPredictCall) Do() (*Output, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.input) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/{id}/predict") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Output) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Submit model id and request a prediction.", + // "httpMethod": "POST", + // "id": "prediction.trainedmodels.predict", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "trainedmodels/{id}/predict", + // "request": { + // "$ref": "Input" + // }, + // "response": { + // "$ref": "Output" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.update": + +type TrainedmodelsUpdateCall struct { + s *Service + id string + update *Update + opt_ map[string]interface{} +} + +// Update: Add new data to a trained model. +func (r *TrainedmodelsService) Update(id string, update *Update) *TrainedmodelsUpdateCall { + c := &TrainedmodelsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.update = update + return c +} + +func (c *TrainedmodelsUpdateCall) Do() (*Training, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.update) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Training) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add new data to a trained model.", + // "httpMethod": "PUT", + // "id": "prediction.trainedmodels.update", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "trainedmodels/{id}", + // "request": { + // "$ref": "Update" + // }, + // "response": { + // "$ref": "Training" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.6/prediction-api.json b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.6/prediction-api.json new file mode 100644 index 0000000000000..578ad345a297a --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.6/prediction-api.json @@ -0,0 +1,779 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"5M1WkxnZyJhziV-cW1kdtwscs8E/OO_GKMAGtBvU1jvBgZif5MTf2iA\"", + "discoveryVersion": "v1", + "id": "prediction:v1.6", + "name": "prediction", + "version": "v1.6", + "title": "Prediction API", + "description": "Lets you access a cloud hosted machine learning service that makes it easy to build smart apps", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/feature/predictionapi-16.png", + "x32": "http://www.google.com/images/icons/feature/predictionapi-32.png" + }, + "documentationLink": "https://developers.google.com/prediction/docs/developer-guide", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/prediction/v1.6/projects/", + "basePath": "/prediction/v1.6/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "prediction/v1.6/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/devstorage.full_control": { + "description": "Manage your data and permissions in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/prediction": { + "description": "Manage your data in the Google Prediction API" + } + } + } + }, + "schemas": { + "Analyze": { + "id": "Analyze", + "type": "object", + "properties": { + "dataDescription": { + "type": "object", + "description": "Description of the data the model was trained on.", + "properties": { + "features": { + "type": "array", + "description": "Description of the input features in the data set.", + "items": { + "type": "object", + "properties": { + "categorical": { + "type": "object", + "description": "Description of the categorical values of this feature.", + "properties": { + "count": { + "type": "string", + "description": "Number of categorical values for this feature in the data.", + "format": "int64" + }, + "values": { + "type": "array", + "description": "List of all the categories for this feature in the data set.", + "items": { + "type": "object", + "properties": { + "count": { + "type": "string", + "description": "Number of times this feature had this value.", + "format": "int64" + }, + "value": { + "type": "string", + "description": "The category name." + } + } + } + } + } + }, + "index": { + "type": "string", + "description": "The feature index.", + "format": "int64" + }, + "numeric": { + "type": "object", + "description": "Description of the numeric values of this feature.", + "properties": { + "count": { + "type": "string", + "description": "Number of numeric values for this feature in the data set.", + "format": "int64" + }, + "mean": { + "type": "string", + "description": "Mean of the numeric values of this feature in the data set." + }, + "variance": { + "type": "string", + "description": "Variance of the numeric values of this feature in the data set." + } + } + }, + "text": { + "type": "object", + "description": "Description of multiple-word text values of this feature.", + "properties": { + "count": { + "type": "string", + "description": "Number of multiple-word text values for this feature.", + "format": "int64" + } + } + } + } + } + }, + "outputFeature": { + "type": "object", + "description": "Description of the output value or label.", + "properties": { + "numeric": { + "type": "object", + "description": "Description of the output values in the data set.", + "properties": { + "count": { + "type": "string", + "description": "Number of numeric output values in the data set.", + "format": "int64" + }, + "mean": { + "type": "string", + "description": "Mean of the output values in the data set." + }, + "variance": { + "type": "string", + "description": "Variance of the output values in the data set." + } + } + }, + "text": { + "type": "array", + "description": "Description of the output labels in the data set.", + "items": { + "type": "object", + "properties": { + "count": { + "type": "string", + "description": "Number of times the output label occurred in the data set.", + "format": "int64" + }, + "value": { + "type": "string", + "description": "The output label." + } + } + } + } + } + } + } + }, + "errors": { + "type": "array", + "description": "List of errors with the data.", + "items": { + "type": "object", + "additionalProperties": { + "type": "string", + "description": "Error level followed by a detailed error message." + } + } + }, + "id": { + "type": "string", + "description": "The unique name for the predictive model." + }, + "kind": { + "type": "string", + "description": "What kind of resource this is.", + "default": "prediction#analyze" + }, + "modelDescription": { + "type": "object", + "description": "Description of the model.", + "properties": { + "confusionMatrix": { + "type": "object", + "description": "An output confusion matrix. This shows an estimate for how this model will do in predictions. This is first indexed by the true class label. For each true class label, this provides a pair {predicted_label, count}, where count is the estimated number of times the model will predict the predicted label given the true label. Will not output if more then 100 classes (Categorical models only).", + "additionalProperties": { + "type": "object", + "description": "Confusion matrix information for the true class label.", + "additionalProperties": { + "type": "string", + "description": "Average number of times an instance with correct class label modelDescription.confusionMatrix.(key) was wrongfully classified as this label." + } + } + }, + "confusionMatrixRowTotals": { + "type": "object", + "description": "A list of the confusion matrix row totals.", + "additionalProperties": { + "type": "string" + } + }, + "modelinfo": { + "$ref": "Insert2", + "description": "Basic information about the model." + } + } + }, + "selfLink": { + "type": "string", + "description": "A URL to re-request this resource." + } + } + }, + "Input": { + "id": "Input", + "type": "object", + "properties": { + "input": { + "type": "object", + "description": "Input to the model for a prediction.", + "properties": { + "csvInstance": { + "type": "array", + "description": "A list of input features, these can be strings or doubles.", + "items": { + "type": "any" + } + } + } + } + } + }, + "Insert": { + "id": "Insert", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique name for the predictive model." + }, + "modelType": { + "type": "string", + "description": "Type of predictive model (classification or regression)." + }, + "sourceModel": { + "type": "string", + "description": "The Id of the model to be copied over." + }, + "storageDataLocation": { + "type": "string", + "description": "Google storage location of the training data file." + }, + "storagePMMLLocation": { + "type": "string", + "description": "Google storage location of the preprocessing pmml file." + }, + "storagePMMLModelLocation": { + "type": "string", + "description": "Google storage location of the pmml model file." + }, + "trainingInstances": { + "type": "array", + "description": "Instances to train model on.", + "items": { + "type": "object", + "properties": { + "csvInstance": { + "type": "array", + "description": "The input features for this instance.", + "items": { + "type": "any" + } + }, + "output": { + "type": "string", + "description": "The generic output value - could be regression or class label." + } + } + } + }, + "utility": { + "type": "array", + "description": "A class weighting function, which allows the importance weights for class labels to be specified (Categorical models only).", + "items": { + "type": "object", + "description": "Class label (string).", + "additionalProperties": { + "type": "number", + "format": "double" + } + } + } + } + }, + "Insert2": { + "id": "Insert2", + "type": "object", + "properties": { + "created": { + "type": "string", + "description": "Insert time of the model (as a RFC 3339 timestamp).", + "format": "date-time" + }, + "id": { + "type": "string", + "description": "The unique name for the predictive model." + }, + "kind": { + "type": "string", + "description": "What kind of resource this is.", + "default": "prediction#training" + }, + "modelInfo": { + "type": "object", + "description": "Model metadata.", + "properties": { + "classWeightedAccuracy": { + "type": "string", + "description": "Estimated accuracy of model taking utility weights into account (Categorical models only)." + }, + "classificationAccuracy": { + "type": "string", + "description": "A number between 0.0 and 1.0, where 1.0 is 100% accurate. This is an estimate, based on the amount and quality of the training data, of the estimated prediction accuracy. You can use this is a guide to decide whether the results are accurate enough for your needs. This estimate will be more reliable if your real input data is similar to your training data (Categorical models only)." + }, + "meanSquaredError": { + "type": "string", + "description": "An estimated mean squared error. The can be used to measure the quality of the predicted model (Regression models only)." + }, + "modelType": { + "type": "string", + "description": "Type of predictive model (CLASSIFICATION or REGRESSION)." + }, + "numberInstances": { + "type": "string", + "description": "Number of valid data instances used in the trained model.", + "format": "int64" + }, + "numberLabels": { + "type": "string", + "description": "Number of class labels in the trained model (Categorical models only).", + "format": "int64" + } + } + }, + "modelType": { + "type": "string", + "description": "Type of predictive model (CLASSIFICATION or REGRESSION)." + }, + "selfLink": { + "type": "string", + "description": "A URL to re-request this resource." + }, + "storageDataLocation": { + "type": "string", + "description": "Google storage location of the training data file." + }, + "storagePMMLLocation": { + "type": "string", + "description": "Google storage location of the preprocessing pmml file." + }, + "storagePMMLModelLocation": { + "type": "string", + "description": "Google storage location of the pmml model file." + }, + "trainingComplete": { + "type": "string", + "description": "Training completion time (as a RFC 3339 timestamp).", + "format": "date-time" + }, + "trainingStatus": { + "type": "string", + "description": "The current status of the training job. This can be one of following: RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND" + } + } + }, + "List": { + "id": "List", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "List of models.", + "items": { + "$ref": "Insert2" + } + }, + "kind": { + "type": "string", + "description": "What kind of resource this is.", + "default": "prediction#list" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to fetch the next page, if one exists." + }, + "selfLink": { + "type": "string", + "description": "A URL to re-request this resource." + } + } + }, + "Output": { + "id": "Output", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique name for the predictive model." + }, + "kind": { + "type": "string", + "description": "What kind of resource this is.", + "default": "prediction#output" + }, + "outputLabel": { + "type": "string", + "description": "The most likely class label (Categorical models only)." + }, + "outputMulti": { + "type": "array", + "description": "A list of class labels with their estimated probabilities (Categorical models only).", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "The class label." + }, + "score": { + "type": "string", + "description": "The probability of the class label." + } + } + } + }, + "outputValue": { + "type": "number", + "description": "The estimated regression value (Regression models only).", + "format": "double" + }, + "selfLink": { + "type": "string", + "description": "A URL to re-request this resource." + } + } + }, + "Update": { + "id": "Update", + "type": "object", + "properties": { + "csvInstance": { + "type": "array", + "description": "The input features for this instance.", + "items": { + "type": "any" + } + }, + "output": { + "type": "string", + "description": "The generic output value - could be regression or class label." + } + } + } + }, + "resources": { + "hostedmodels": { + "methods": { + "predict": { + "id": "prediction.hostedmodels.predict", + "path": "{project}/hostedmodels/{hostedModelName}/predict", + "httpMethod": "POST", + "description": "Submit input and request an output against a hosted model.", + "parameters": { + "hostedModelName": { + "type": "string", + "description": "The name of a hosted model.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project associated with the model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "hostedModelName" + ], + "request": { + "$ref": "Input" + }, + "response": { + "$ref": "Output" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + } + } + }, + "trainedmodels": { + "methods": { + "analyze": { + "id": "prediction.trainedmodels.analyze", + "path": "{project}/trainedmodels/{id}/analyze", + "httpMethod": "GET", + "description": "Get analysis of the model and the data the model was trained on.", + "parameters": { + "id": { + "type": "string", + "description": "The unique name for the predictive model.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project associated with the model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "id" + ], + "response": { + "$ref": "Analyze" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "delete": { + "id": "prediction.trainedmodels.delete", + "path": "{project}/trainedmodels/{id}", + "httpMethod": "DELETE", + "description": "Delete a trained model.", + "parameters": { + "id": { + "type": "string", + "description": "The unique name for the predictive model.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project associated with the model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "get": { + "id": "prediction.trainedmodels.get", + "path": "{project}/trainedmodels/{id}", + "httpMethod": "GET", + "description": "Check training status of your model.", + "parameters": { + "id": { + "type": "string", + "description": "The unique name for the predictive model.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project associated with the model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "id" + ], + "response": { + "$ref": "Insert2" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "insert": { + "id": "prediction.trainedmodels.insert", + "path": "{project}/trainedmodels", + "httpMethod": "POST", + "description": "Train a Prediction API model.", + "parameters": { + "project": { + "type": "string", + "description": "The project associated with the model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "Insert" + }, + "response": { + "$ref": "Insert2" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/prediction" + ] + }, + "list": { + "id": "prediction.trainedmodels.list", + "path": "{project}/trainedmodels/list", + "httpMethod": "GET", + "description": "List available models.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Pagination token.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project associated with the model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "List" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "predict": { + "id": "prediction.trainedmodels.predict", + "path": "{project}/trainedmodels/{id}/predict", + "httpMethod": "POST", + "description": "Submit model id and request a prediction.", + "parameters": { + "id": { + "type": "string", + "description": "The unique name for the predictive model.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project associated with the model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "id" + ], + "request": { + "$ref": "Input" + }, + "response": { + "$ref": "Output" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "update": { + "id": "prediction.trainedmodels.update", + "path": "{project}/trainedmodels/{id}", + "httpMethod": "PUT", + "description": "Add new data to a trained model.", + "parameters": { + "id": { + "type": "string", + "description": "The unique name for the predictive model.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project associated with the model.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "id" + ], + "request": { + "$ref": "Update" + }, + "response": { + "$ref": "Insert2" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.6/prediction-gen.go b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.6/prediction-gen.go new file mode 100644 index 0000000000000..f11d3d5522df8 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/prediction/v1.6/prediction-gen.go @@ -0,0 +1,1033 @@ +// Package prediction provides access to the Prediction API. +// +// See https://developers.google.com/prediction/docs/developer-guide +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/prediction/v1.6" +// ... +// predictionService, err := prediction.New(oauthHttpClient) +package prediction + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "prediction:v1.6" +const apiName = "prediction" +const apiVersion = "v1.6" +const basePath = "https://www.googleapis.com/prediction/v1.6/projects/" + +// OAuth2 scopes used by this API. +const ( + // Manage your data and permissions in Google Cloud Storage + DevstorageFull_controlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageRead_onlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageRead_writeScope = "https://www.googleapis.com/auth/devstorage.read_write" + + // Manage your data in the Google Prediction API + PredictionScope = "https://www.googleapis.com/auth/prediction" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Hostedmodels = NewHostedmodelsService(s) + s.Trainedmodels = NewTrainedmodelsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Hostedmodels *HostedmodelsService + + Trainedmodels *TrainedmodelsService +} + +func NewHostedmodelsService(s *Service) *HostedmodelsService { + rs := &HostedmodelsService{s: s} + return rs +} + +type HostedmodelsService struct { + s *Service +} + +func NewTrainedmodelsService(s *Service) *TrainedmodelsService { + rs := &TrainedmodelsService{s: s} + return rs +} + +type TrainedmodelsService struct { + s *Service +} + +type Analyze struct { + // DataDescription: Description of the data the model was trained on. + DataDescription *AnalyzeDataDescription `json:"dataDescription,omitempty"` + + // Errors: List of errors with the data. + Errors []map[string]string `json:"errors,omitempty"` + + // Id: The unique name for the predictive model. + Id string `json:"id,omitempty"` + + // Kind: What kind of resource this is. + Kind string `json:"kind,omitempty"` + + // ModelDescription: Description of the model. + ModelDescription *AnalyzeModelDescription `json:"modelDescription,omitempty"` + + // SelfLink: A URL to re-request this resource. + SelfLink string `json:"selfLink,omitempty"` +} + +type AnalyzeDataDescription struct { + // Features: Description of the input features in the data set. + Features []*AnalyzeDataDescriptionFeatures `json:"features,omitempty"` + + // OutputFeature: Description of the output value or label. + OutputFeature *AnalyzeDataDescriptionOutputFeature `json:"outputFeature,omitempty"` +} + +type AnalyzeDataDescriptionFeatures struct { + // Categorical: Description of the categorical values of this feature. + Categorical *AnalyzeDataDescriptionFeaturesCategorical `json:"categorical,omitempty"` + + // Index: The feature index. + Index int64 `json:"index,omitempty,string"` + + // Numeric: Description of the numeric values of this feature. + Numeric *AnalyzeDataDescriptionFeaturesNumeric `json:"numeric,omitempty"` + + // Text: Description of multiple-word text values of this feature. + Text *AnalyzeDataDescriptionFeaturesText `json:"text,omitempty"` +} + +type AnalyzeDataDescriptionFeaturesCategorical struct { + // Count: Number of categorical values for this feature in the data. + Count int64 `json:"count,omitempty,string"` + + // Values: List of all the categories for this feature in the data set. + Values []*AnalyzeDataDescriptionFeaturesCategoricalValues `json:"values,omitempty"` +} + +type AnalyzeDataDescriptionFeaturesCategoricalValues struct { + // Count: Number of times this feature had this value. + Count int64 `json:"count,omitempty,string"` + + // Value: The category name. + Value string `json:"value,omitempty"` +} + +type AnalyzeDataDescriptionFeaturesNumeric struct { + // Count: Number of numeric values for this feature in the data set. + Count int64 `json:"count,omitempty,string"` + + // Mean: Mean of the numeric values of this feature in the data set. + Mean string `json:"mean,omitempty"` + + // Variance: Variance of the numeric values of this feature in the data + // set. + Variance string `json:"variance,omitempty"` +} + +type AnalyzeDataDescriptionFeaturesText struct { + // Count: Number of multiple-word text values for this feature. + Count int64 `json:"count,omitempty,string"` +} + +type AnalyzeDataDescriptionOutputFeature struct { + // Numeric: Description of the output values in the data set. + Numeric *AnalyzeDataDescriptionOutputFeatureNumeric `json:"numeric,omitempty"` + + // Text: Description of the output labels in the data set. + Text []*AnalyzeDataDescriptionOutputFeatureText `json:"text,omitempty"` +} + +type AnalyzeDataDescriptionOutputFeatureNumeric struct { + // Count: Number of numeric output values in the data set. + Count int64 `json:"count,omitempty,string"` + + // Mean: Mean of the output values in the data set. + Mean string `json:"mean,omitempty"` + + // Variance: Variance of the output values in the data set. + Variance string `json:"variance,omitempty"` +} + +type AnalyzeDataDescriptionOutputFeatureText struct { + // Count: Number of times the output label occurred in the data set. + Count int64 `json:"count,omitempty,string"` + + // Value: The output label. + Value string `json:"value,omitempty"` +} + +type AnalyzeModelDescription struct { + // ConfusionMatrix: An output confusion matrix. This shows an estimate + // for how this model will do in predictions. This is first indexed by + // the true class label. For each true class label, this provides a pair + // {predicted_label, count}, where count is the estimated number of + // times the model will predict the predicted label given the true + // label. Will not output if more then 100 classes (Categorical models + // only). + ConfusionMatrix *AnalyzeModelDescriptionConfusionMatrix `json:"confusionMatrix,omitempty"` + + // ConfusionMatrixRowTotals: A list of the confusion matrix row totals. + ConfusionMatrixRowTotals map[string]string `json:"confusionMatrixRowTotals,omitempty"` + + // Modelinfo: Basic information about the model. + Modelinfo *Insert2 `json:"modelinfo,omitempty"` +} + +type AnalyzeModelDescriptionConfusionMatrix struct { +} + +type Input struct { + // Input: Input to the model for a prediction. + Input *InputInput `json:"input,omitempty"` +} + +type InputInput struct { + // CsvInstance: A list of input features, these can be strings or + // doubles. + CsvInstance []interface{} `json:"csvInstance,omitempty"` +} + +type Insert struct { + // Id: The unique name for the predictive model. + Id string `json:"id,omitempty"` + + // ModelType: Type of predictive model (classification or regression). + ModelType string `json:"modelType,omitempty"` + + // SourceModel: The Id of the model to be copied over. + SourceModel string `json:"sourceModel,omitempty"` + + // StorageDataLocation: Google storage location of the training data + // file. + StorageDataLocation string `json:"storageDataLocation,omitempty"` + + // StoragePMMLLocation: Google storage location of the preprocessing + // pmml file. + StoragePMMLLocation string `json:"storagePMMLLocation,omitempty"` + + // StoragePMMLModelLocation: Google storage location of the pmml model + // file. + StoragePMMLModelLocation string `json:"storagePMMLModelLocation,omitempty"` + + // TrainingInstances: Instances to train model on. + TrainingInstances []*InsertTrainingInstances `json:"trainingInstances,omitempty"` + + // Utility: A class weighting function, which allows the importance + // weights for class labels to be specified (Categorical models only). + Utility []*InsertUtility `json:"utility,omitempty"` +} + +type InsertTrainingInstances struct { + // CsvInstance: The input features for this instance. + CsvInstance []interface{} `json:"csvInstance,omitempty"` + + // Output: The generic output value - could be regression or class + // label. + Output string `json:"output,omitempty"` +} + +type InsertUtility struct { +} + +type Insert2 struct { + // Created: Insert time of the model (as a RFC 3339 timestamp). + Created string `json:"created,omitempty"` + + // Id: The unique name for the predictive model. + Id string `json:"id,omitempty"` + + // Kind: What kind of resource this is. + Kind string `json:"kind,omitempty"` + + // ModelInfo: Model metadata. + ModelInfo *Insert2ModelInfo `json:"modelInfo,omitempty"` + + // ModelType: Type of predictive model (CLASSIFICATION or REGRESSION). + ModelType string `json:"modelType,omitempty"` + + // SelfLink: A URL to re-request this resource. + SelfLink string `json:"selfLink,omitempty"` + + // StorageDataLocation: Google storage location of the training data + // file. + StorageDataLocation string `json:"storageDataLocation,omitempty"` + + // StoragePMMLLocation: Google storage location of the preprocessing + // pmml file. + StoragePMMLLocation string `json:"storagePMMLLocation,omitempty"` + + // StoragePMMLModelLocation: Google storage location of the pmml model + // file. + StoragePMMLModelLocation string `json:"storagePMMLModelLocation,omitempty"` + + // TrainingComplete: Training completion time (as a RFC 3339 timestamp). + TrainingComplete string `json:"trainingComplete,omitempty"` + + // TrainingStatus: The current status of the training job. This can be + // one of following: RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND + TrainingStatus string `json:"trainingStatus,omitempty"` +} + +type Insert2ModelInfo struct { + // ClassWeightedAccuracy: Estimated accuracy of model taking utility + // weights into account (Categorical models only). + ClassWeightedAccuracy string `json:"classWeightedAccuracy,omitempty"` + + // ClassificationAccuracy: A number between 0.0 and 1.0, where 1.0 is + // 100% accurate. This is an estimate, based on the amount and quality + // of the training data, of the estimated prediction accuracy. You can + // use this is a guide to decide whether the results are accurate enough + // for your needs. This estimate will be more reliable if your real + // input data is similar to your training data (Categorical models + // only). + ClassificationAccuracy string `json:"classificationAccuracy,omitempty"` + + // MeanSquaredError: An estimated mean squared error. The can be used to + // measure the quality of the predicted model (Regression models only). + MeanSquaredError string `json:"meanSquaredError,omitempty"` + + // ModelType: Type of predictive model (CLASSIFICATION or REGRESSION). + ModelType string `json:"modelType,omitempty"` + + // NumberInstances: Number of valid data instances used in the trained + // model. + NumberInstances int64 `json:"numberInstances,omitempty,string"` + + // NumberLabels: Number of class labels in the trained model + // (Categorical models only). + NumberLabels int64 `json:"numberLabels,omitempty,string"` +} + +type List struct { + // Items: List of models. + Items []*Insert2 `json:"items,omitempty"` + + // Kind: What kind of resource this is. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to fetch the next page, if one + // exists. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: A URL to re-request this resource. + SelfLink string `json:"selfLink,omitempty"` +} + +type Output struct { + // Id: The unique name for the predictive model. + Id string `json:"id,omitempty"` + + // Kind: What kind of resource this is. + Kind string `json:"kind,omitempty"` + + // OutputLabel: The most likely class label (Categorical models only). + OutputLabel string `json:"outputLabel,omitempty"` + + // OutputMulti: A list of class labels with their estimated + // probabilities (Categorical models only). + OutputMulti []*OutputOutputMulti `json:"outputMulti,omitempty"` + + // OutputValue: The estimated regression value (Regression models only). + OutputValue float64 `json:"outputValue,omitempty"` + + // SelfLink: A URL to re-request this resource. + SelfLink string `json:"selfLink,omitempty"` +} + +type OutputOutputMulti struct { + // Label: The class label. + Label string `json:"label,omitempty"` + + // Score: The probability of the class label. + Score string `json:"score,omitempty"` +} + +type Update struct { + // CsvInstance: The input features for this instance. + CsvInstance []interface{} `json:"csvInstance,omitempty"` + + // Output: The generic output value - could be regression or class + // label. + Output string `json:"output,omitempty"` +} + +// method id "prediction.hostedmodels.predict": + +type HostedmodelsPredictCall struct { + s *Service + project string + hostedModelName string + input *Input + opt_ map[string]interface{} +} + +// Predict: Submit input and request an output against a hosted model. +func (r *HostedmodelsService) Predict(project string, hostedModelName string, input *Input) *HostedmodelsPredictCall { + c := &HostedmodelsPredictCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.hostedModelName = hostedModelName + c.input = input + return c +} + +func (c *HostedmodelsPredictCall) Do() (*Output, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.input) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/hostedmodels/{hostedModelName}/predict") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{hostedModelName}", url.QueryEscape(c.hostedModelName), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Output) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Submit input and request an output against a hosted model.", + // "httpMethod": "POST", + // "id": "prediction.hostedmodels.predict", + // "parameterOrder": [ + // "project", + // "hostedModelName" + // ], + // "parameters": { + // "hostedModelName": { + // "description": "The name of a hosted model.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project associated with the model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/hostedmodels/{hostedModelName}/predict", + // "request": { + // "$ref": "Input" + // }, + // "response": { + // "$ref": "Output" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.analyze": + +type TrainedmodelsAnalyzeCall struct { + s *Service + project string + id string + opt_ map[string]interface{} +} + +// Analyze: Get analysis of the model and the data the model was trained +// on. +func (r *TrainedmodelsService) Analyze(project string, id string) *TrainedmodelsAnalyzeCall { + c := &TrainedmodelsAnalyzeCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.id = id + return c +} + +func (c *TrainedmodelsAnalyzeCall) Do() (*Analyze, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/trainedmodels/{id}/analyze") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Analyze) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get analysis of the model and the data the model was trained on.", + // "httpMethod": "GET", + // "id": "prediction.trainedmodels.analyze", + // "parameterOrder": [ + // "project", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project associated with the model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/trainedmodels/{id}/analyze", + // "response": { + // "$ref": "Analyze" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.delete": + +type TrainedmodelsDeleteCall struct { + s *Service + project string + id string + opt_ map[string]interface{} +} + +// Delete: Delete a trained model. +func (r *TrainedmodelsService) Delete(project string, id string) *TrainedmodelsDeleteCall { + c := &TrainedmodelsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.id = id + return c +} + +func (c *TrainedmodelsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/trainedmodels/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a trained model.", + // "httpMethod": "DELETE", + // "id": "prediction.trainedmodels.delete", + // "parameterOrder": [ + // "project", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project associated with the model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/trainedmodels/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.get": + +type TrainedmodelsGetCall struct { + s *Service + project string + id string + opt_ map[string]interface{} +} + +// Get: Check training status of your model. +func (r *TrainedmodelsService) Get(project string, id string) *TrainedmodelsGetCall { + c := &TrainedmodelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.id = id + return c +} + +func (c *TrainedmodelsGetCall) Do() (*Insert2, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/trainedmodels/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Insert2) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Check training status of your model.", + // "httpMethod": "GET", + // "id": "prediction.trainedmodels.get", + // "parameterOrder": [ + // "project", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project associated with the model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/trainedmodels/{id}", + // "response": { + // "$ref": "Insert2" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.insert": + +type TrainedmodelsInsertCall struct { + s *Service + project string + insert *Insert + opt_ map[string]interface{} +} + +// Insert: Train a Prediction API model. +func (r *TrainedmodelsService) Insert(project string, insert *Insert) *TrainedmodelsInsertCall { + c := &TrainedmodelsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.insert = insert + return c +} + +func (c *TrainedmodelsInsertCall) Do() (*Insert2, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.insert) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/trainedmodels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Insert2) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Train a Prediction API model.", + // "httpMethod": "POST", + // "id": "prediction.trainedmodels.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "The project associated with the model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/trainedmodels", + // "request": { + // "$ref": "Insert" + // }, + // "response": { + // "$ref": "Insert2" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write", + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.list": + +type TrainedmodelsListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: List available models. +func (r *TrainedmodelsService) List(project string) *TrainedmodelsListCall { + c := &TrainedmodelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *TrainedmodelsListCall) MaxResults(maxResults int64) *TrainedmodelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Pagination token. +func (c *TrainedmodelsListCall) PageToken(pageToken string) *TrainedmodelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *TrainedmodelsListCall) Do() (*List, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/trainedmodels/list") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(List) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List available models.", + // "httpMethod": "GET", + // "id": "prediction.trainedmodels.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Pagination token.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project associated with the model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/trainedmodels/list", + // "response": { + // "$ref": "List" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.predict": + +type TrainedmodelsPredictCall struct { + s *Service + project string + id string + input *Input + opt_ map[string]interface{} +} + +// Predict: Submit model id and request a prediction. +func (r *TrainedmodelsService) Predict(project string, id string, input *Input) *TrainedmodelsPredictCall { + c := &TrainedmodelsPredictCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.id = id + c.input = input + return c +} + +func (c *TrainedmodelsPredictCall) Do() (*Output, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.input) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/trainedmodels/{id}/predict") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Output) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Submit model id and request a prediction.", + // "httpMethod": "POST", + // "id": "prediction.trainedmodels.predict", + // "parameterOrder": [ + // "project", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project associated with the model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/trainedmodels/{id}/predict", + // "request": { + // "$ref": "Input" + // }, + // "response": { + // "$ref": "Output" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.update": + +type TrainedmodelsUpdateCall struct { + s *Service + project string + id string + update *Update + opt_ map[string]interface{} +} + +// Update: Add new data to a trained model. +func (r *TrainedmodelsService) Update(project string, id string, update *Update) *TrainedmodelsUpdateCall { + c := &TrainedmodelsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.id = id + c.update = update + return c +} + +func (c *TrainedmodelsUpdateCall) Do() (*Insert2, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.update) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/trainedmodels/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Insert2) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add new data to a trained model.", + // "httpMethod": "PUT", + // "id": "prediction.trainedmodels.update", + // "parameterOrder": [ + // "project", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project associated with the model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/trainedmodels/{id}", + // "request": { + // "$ref": "Update" + // }, + // "response": { + // "$ref": "Insert2" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/qpxexpress/v1/qpxexpress-api.json b/third_party/src/code.google.com/p/google-api-go-client/qpxexpress/v1/qpxexpress-api.json new file mode 100644 index 0000000000000..47b5a774e639e --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/qpxexpress/v1/qpxexpress-api.json @@ -0,0 +1,894 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/Z2cCLQpb_4OOaORWyNRnzCLe6ag\"", + "discoveryVersion": "v1", + "id": "qpxExpress:v1", + "name": "qpxExpress", + "canonicalName": "QPX Express", + "version": "v1", + "title": "QPX Express API", + "description": "Lets you find the least expensive flights between an origin and a destination.", + "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/qpx-express", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/qpxExpress/v1/trips/", + "basePath": "/qpxExpress/v1/trips/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "qpxExpress/v1/trips/", + "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" + } + }, + "schemas": { + "AircraftData": { + "id": "AircraftData", + "type": "object", + "description": "The make, model, and type of an aircraft.", + "properties": { + "code": { + "type": "string", + "description": "The aircraft code. For example, for a Boeing 777 the code would be 777." + }, + "kind": { + "type": "string", + "description": "Identifies this as an aircraftData object. Value: the fixed string qpxexpress#aircraftData", + "default": "qpxexpress#aircraftData" + }, + "name": { + "type": "string", + "description": "The name of an aircraft, for example Boeing 777." + } + } + }, + "AirportData": { + "id": "AirportData", + "type": "object", + "description": "An airport.", + "properties": { + "city": { + "type": "string", + "description": "The city code an airport is located in. For example, for JFK airport, this is NYC." + }, + "code": { + "type": "string", + "description": "An airport's code. For example, for Boston Logan airport, this is BOS." + }, + "kind": { + "type": "string", + "description": "Identifies this as an airport object. Value: the fixed string qpxexpress#airportData.", + "default": "qpxexpress#airportData" + }, + "name": { + "type": "string", + "description": "The name of an airport. For example, for airport BOS the name is \"Boston Logan International\"." + } + } + }, + "BagDescriptor": { + "id": "BagDescriptor", + "type": "object", + "description": "Information about an item of baggage.", + "properties": { + "commercialName": { + "type": "string", + "description": "Provides the commercial name for an optional service." + }, + "count": { + "type": "integer", + "description": "How many of this type of bag will be checked on this flight.", + "format": "int32" + }, + "description": { + "type": "array", + "description": "A description of the baggage.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "Identifies this as a baggage object. Value: the fixed string qpxexpress#bagDescriptor.", + "default": "qpxexpress#bagDescriptor" + }, + "subcode": { + "type": "string", + "description": "The standard IATA subcode used to identify this optional service." + } + } + }, + "CarrierData": { + "id": "CarrierData", + "type": "object", + "description": "Information about a carrier (ie. an airline, bus line, railroad, etc) that might be useful to display to an end-user.", + "properties": { + "code": { + "type": "string", + "description": "The IATA designator of a carrier (airline, etc). For example, for American Airlines, the code is AA." + }, + "kind": { + "type": "string", + "description": "Identifies this as a kind of carrier (ie. an airline, bus line, railroad, etc). Value: the fixed string qpxexpress#carrierData.", + "default": "qpxexpress#carrierData" + }, + "name": { + "type": "string", + "description": "The long, full name of a carrier. For example: American Airlines." + } + } + }, + "CityData": { + "id": "CityData", + "type": "object", + "description": "Information about a city that might be useful to an end-user; typically the city of an airport.", + "properties": { + "code": { + "type": "string", + "description": "The IATA character ID of a city. For example, for Boston this is BOS." + }, + "country": { + "type": "string", + "description": "The two-character country code of the country the city is located in. For example, US for the United States of America." + }, + "kind": { + "type": "string", + "description": "Identifies this as a city, typically with one or more airports. Value: the fixed string qpxexpress#cityData.", + "default": "qpxexpress#cityData" + }, + "name": { + "type": "string", + "description": "The full name of a city. An example would be: New York." + } + } + }, + "Data": { + "id": "Data", + "type": "object", + "description": "Detailed information about components found in the solutions of this response, including a trip's airport, city, taxes, airline, and aircraft.", + "properties": { + "aircraft": { + "type": "array", + "description": "The aircraft that is flying between an origin and destination.", + "items": { + "$ref": "AircraftData" + } + }, + "airport": { + "type": "array", + "description": "The airport of an origin or destination.", + "items": { + "$ref": "AirportData" + } + }, + "carrier": { + "type": "array", + "description": "The airline carrier of the aircraft flying between an origin and destination. Allowed values are IATA carrier codes.", + "items": { + "$ref": "CarrierData" + } + }, + "city": { + "type": "array", + "description": "The city that is either the origin or destination of part of a trip.", + "items": { + "$ref": "CityData" + } + }, + "kind": { + "type": "string", + "description": "Identifies this as QPX Express response resource, including a trip's airport, city, taxes, airline, and aircraft. Value: the fixed string qpxexpress#data.", + "default": "qpxexpress#data" + }, + "tax": { + "type": "array", + "description": "The taxes due for flying between an origin and a destination.", + "items": { + "$ref": "TaxData" + } + } + } + }, + "FareInfo": { + "id": "FareInfo", + "type": "object", + "description": "Complete information about a fare used in the solution to a low-fare search query. In the airline industry a fare is a price an airline charges for one-way travel between two points. A fare typically contains a carrier code, two city codes, a price, and a fare basis. (A fare basis is a one-to-eight character alphanumeric code used to identify a fare.)", + "properties": { + "basisCode": { + "type": "string" + }, + "carrier": { + "type": "string", + "description": "The carrier of the aircraft or other vehicle commuting between two points." + }, + "destination": { + "type": "string", + "description": "The city code of the city the trip ends at." + }, + "id": { + "type": "string", + "description": "A unique identifier of the fare." + }, + "kind": { + "type": "string", + "description": "Identifies this as a fare object. Value: the fixed string qpxexpress#fareInfo.", + "default": "qpxexpress#fareInfo" + }, + "origin": { + "type": "string", + "description": "The city code of the city the trip begins at." + }, + "private": { + "type": "boolean", + "description": "Whether this is a private fare, for example one offered only to select customers rather than the general public." + } + } + }, + "FlightInfo": { + "id": "FlightInfo", + "type": "object", + "description": "A flight is a sequence of legs with the same airline carrier and flight number. (A leg is the smallest unit of travel, in the case of a flight a takeoff immediately followed by a landing at two set points on a particular carrier with a particular flight number.) The naive view is that a flight is scheduled travel of an aircraft between two points, with possibly intermediate stops, but carriers will frequently list flights that require a change of aircraft between legs.", + "properties": { + "carrier": { + "type": "string" + }, + "number": { + "type": "string", + "description": "The flight number." + } + } + }, + "FreeBaggageAllowance": { + "id": "FreeBaggageAllowance", + "type": "object", + "description": "Information about free baggage allowed on one segment of a trip.", + "properties": { + "bagDescriptor": { + "type": "array", + "description": "A representation of a type of bag, such as an ATPCo subcode, Commercial Name, or other description.", + "items": { + "$ref": "BagDescriptor" + } + }, + "kilos": { + "type": "integer", + "description": "The maximum number of kilos all the free baggage together may weigh.", + "format": "int32" + }, + "kilosPerPiece": { + "type": "integer", + "description": "The maximum number of kilos any one piece of baggage may weigh.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Identifies this as free baggage object, allowed on one segment of a trip. Value: the fixed string qpxexpress#freeBaggageAllowance.", + "default": "qpxexpress#freeBaggageAllowance" + }, + "pieces": { + "type": "integer", + "description": "The number of free pieces of baggage allowed.", + "format": "int32" + }, + "pounds": { + "type": "integer", + "description": "The number of pounds of free baggage allowed.", + "format": "int32" + } + } + }, + "LegInfo": { + "id": "LegInfo", + "type": "object", + "description": "Information about a leg. (A leg is the smallest unit of travel, in the case of a flight a takeoff immediately followed by a landing at two set points on a particular carrier with a particular flight number.)", + "properties": { + "aircraft": { + "type": "string", + "description": "The aircraft (or bus, ferry, railcar, etc) travelling between the two points of this leg." + }, + "arrivalTime": { + "type": "string", + "description": "The scheduled time of arrival at the destination of the leg, local to the point of arrival." + }, + "changePlane": { + "type": "boolean", + "description": "Whether you have to change planes following this leg. Only applies to the next leg." + }, + "connectionDuration": { + "type": "integer", + "description": "Duration of a connection following this leg, in minutes.", + "format": "int32" + }, + "departureTime": { + "type": "string", + "description": "The scheduled departure time of the leg, local to the point of departure." + }, + "destination": { + "type": "string", + "description": "The leg destination as a city and airport." + }, + "destinationTerminal": { + "type": "string", + "description": "The terminal the flight is scheduled to arrive at." + }, + "duration": { + "type": "integer", + "description": "The scheduled travelling time from the origin to the destination.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "An identifier that uniquely identifies this leg in the solution." + }, + "kind": { + "type": "string", + "description": "Identifies this as a leg object. A leg is the smallest unit of travel, in the case of a flight a takeoff immediately followed by a landing at two set points on a particular carrier with a particular flight number. Value: the fixed string qpxexpress#legInfo.", + "default": "qpxexpress#legInfo" + }, + "meal": { + "type": "string", + "description": "A simple, general description of the meal(s) served on the flight, for example: \"Hot meal\"." + }, + "mileage": { + "type": "integer", + "description": "The number of miles in this leg.", + "format": "int32" + }, + "onTimePerformance": { + "type": "integer", + "description": "In percent, the published on time performance on this leg.", + "format": "int32" + }, + "operatingDisclosure": { + "type": "string", + "description": "Department of Transportation disclosure information on the actual operator of a flight in a code share. (A code share refers to a marketing agreement between two carriers, where one carrier will list in its schedules (and take bookings for) flights that are actually operated by another carrier.)" + }, + "origin": { + "type": "string", + "description": "The leg origin as a city and airport." + }, + "originTerminal": { + "type": "string", + "description": "The terminal the flight is scheduled to depart from." + }, + "secure": { + "type": "boolean", + "description": "Whether passenger information must be furnished to the United States Transportation Security Administration (TSA) prior to departure." + } + } + }, + "PassengerCounts": { + "id": "PassengerCounts", + "type": "object", + "description": "The number and type of passengers. Unfortunately the definition of an infant, child, adult, and senior citizen varies across carriers and reservation systems.", + "properties": { + "adultCount": { + "type": "integer", + "description": "The number of passengers that are adults.", + "format": "int32" + }, + "childCount": { + "type": "integer", + "description": "The number of passengers that are children.", + "format": "int32" + }, + "infantInLapCount": { + "type": "integer", + "description": "The number of passengers that are infants travelling in the lap of an adult.", + "format": "int32" + }, + "infantInSeatCount": { + "type": "integer", + "description": "The number of passengers that are infants each assigned a seat.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Identifies this as a passenger count object, representing the number of passengers. Value: the fixed string qpxexpress#passengerCounts.", + "default": "qpxexpress#passengerCounts" + }, + "seniorCount": { + "type": "integer", + "description": "The number of passengers that are senior citizens.", + "format": "int32" + } + } + }, + "PricingInfo": { + "id": "PricingInfo", + "type": "object", + "description": "The price of one or more travel segments. The currency used to purchase tickets is usually determined by the sale/ticketing city or the sale/ticketing country, unless none are specified, in which case it defaults to that of the journey origin country.", + "properties": { + "baseFareTotal": { + "type": "string", + "description": "The total fare in the base fare currency (the currency of the country of origin). This element is only present when the sales currency and the currency of the country of commencement are different." + }, + "fare": { + "type": "array", + "description": "The fare used to price one or more segments.", + "items": { + "$ref": "FareInfo" + } + }, + "fareCalculation": { + "type": "string", + "description": "The horizontal fare calculation. This is a field on a ticket that displays all of the relevant items that go into the calculation of the fare." + }, + "kind": { + "type": "string", + "description": "Identifies this as a pricing object, representing the price of one or more travel segments. Value: the fixed string qpxexpress#pricingInfo.", + "default": "qpxexpress#pricingInfo" + }, + "latestTicketingTime": { + "type": "string", + "description": "The latest ticketing time for this pricing assuming the reservation occurs at ticketing time and there is no change in fares/rules. The time is local to the point of sale (POS)." + }, + "passengers": { + "$ref": "PassengerCounts", + "description": "The number of passengers to which this price applies." + }, + "ptc": { + "type": "string", + "description": "The passenger type code for this pricing. An alphanumeric code used by a carrier to restrict fares to certain categories of passenger. For instance, a fare might be valid only for senior citizens." + }, + "refundable": { + "type": "boolean", + "description": "Whether the fares on this pricing are refundable." + }, + "saleFareTotal": { + "type": "string", + "description": "The total fare in the sale or equivalent currency." + }, + "saleTaxTotal": { + "type": "string", + "description": "The taxes in the sale or equivalent currency." + }, + "saleTotal": { + "type": "string", + "description": "Total per-passenger price (fare and tax) in the sale or equivalent currency." + }, + "segmentPricing": { + "type": "array", + "description": "The per-segment price and baggage information.", + "items": { + "$ref": "SegmentPricing" + } + }, + "tax": { + "type": "array", + "description": "The taxes used to calculate the tax total per ticket.", + "items": { + "$ref": "TaxInfo" + } + } + } + }, + "SegmentInfo": { + "id": "SegmentInfo", + "type": "object", + "description": "Details of a segment of a flight; a segment is one or more consecutive legs on the same flight. For example a hypothetical flight ZZ001, from DFW to OGG, would have one segment with two legs: DFW to HNL (leg 1), HNL to OGG (leg 2), and DFW to OGG (legs 1 and 2).", + "properties": { + "bookingCode": { + "type": "string", + "description": "The booking code or class for this segment." + }, + "bookingCodeCount": { + "type": "integer", + "description": "The number of seats available in this booking code on this segment.", + "format": "int32" + }, + "cabin": { + "type": "string", + "description": "The cabin booked for this segment." + }, + "connectionDuration": { + "type": "integer", + "description": "In minutes, the duration of the connection following this segment.", + "format": "int32" + }, + "duration": { + "type": "integer", + "description": "The duration of the flight segment in minutes.", + "format": "int32" + }, + "flight": { + "$ref": "FlightInfo", + "description": "The flight this is a segment of." + }, + "id": { + "type": "string", + "description": "An id uniquely identifying the segment in the solution." + }, + "kind": { + "type": "string", + "description": "Identifies this as a segment object. A segment is one or more consecutive legs on the same flight. For example a hypothetical flight ZZ001, from DFW to OGG, could have one segment with two legs: DFW to HNL (leg 1), HNL to OGG (leg 2). Value: the fixed string qpxexpress#segmentInfo.", + "default": "qpxexpress#segmentInfo" + }, + "leg": { + "type": "array", + "description": "The legs composing this segment.", + "items": { + "$ref": "LegInfo" + } + }, + "marriedSegmentGroup": { + "type": "string", + "description": "The solution-based index of a segment in a married segment group. Married segments can only be booked together. For example, an airline might report a certain booking code as sold out from Boston to Pittsburgh, but as available as part of two married segments Boston to Chicago connecting through Pittsburgh. For example content of this field, consider the round-trip flight ZZ1 PHX-PHL ZZ2 PHL-CLT ZZ3 CLT-PHX. This has three segments, with the two outbound ones (ZZ1 ZZ2) married. In this case, the two outbound segments belong to married segment group 0, and the return segment belongs to married segment group 1." + }, + "subjectToGovernmentApproval": { + "type": "boolean", + "description": "Whether the operation of this segment remains subject to government approval." + } + } + }, + "SegmentPricing": { + "id": "SegmentPricing", + "type": "object", + "description": "The price of this segment.", + "properties": { + "fareId": { + "type": "string", + "description": "A segment identifier unique within a single solution. It is used to refer to different parts of the same solution." + }, + "freeBaggageOption": { + "type": "array", + "description": "Details of the free baggage allowance on this segment.", + "items": { + "$ref": "FreeBaggageAllowance" + } + }, + "kind": { + "type": "string", + "description": "Identifies this as a segment pricing object, representing the price of this segment. Value: the fixed string qpxexpress#segmentPricing.", + "default": "qpxexpress#segmentPricing" + }, + "segmentId": { + "type": "string", + "description": "Unique identifier in the response of this segment." + } + } + }, + "SliceInfo": { + "id": "SliceInfo", + "type": "object", + "description": "Information about a slice. A slice represents a traveller's intent, the portion of a low-fare search corresponding to a traveler's request to get between two points. One-way journeys are generally expressed using 1 slice, round-trips using 2. For example, if a traveler specifies the following trip in a user interface:\n| Origin | Destination | Departure Date | | BOS | LAX | March 10, 2007 | | LAX | SYD | March 17, 2007 | | SYD | BOS | March 22, 2007 |\nthen this is a three slice trip.", + "properties": { + "duration": { + "type": "integer", + "description": "The duration of the slice in minutes.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Identifies this as a slice object. A slice represents a traveller's intent, the portion of a low-fare search corresponding to a traveler's request to get between two points. One-way journeys are generally expressed using 1 slice, round-trips using 2. Value: the fixed string qpxexpress#sliceInfo.", + "default": "qpxexpress#sliceInfo" + }, + "segment": { + "type": "array", + "description": "The segment(s) constituting the slice.", + "items": { + "$ref": "SegmentInfo" + } + } + } + }, + "SliceInput": { + "id": "SliceInput", + "type": "object", + "description": "Criteria a desired slice must satisfy.", + "properties": { + "alliance": { + "type": "string", + "description": "Slices with only the carriers in this alliance should be returned; do not use this field with permittedCarrier. Allowed values are ONEWORLD, SKYTEAM, and STAR." + }, + "date": { + "type": "string", + "description": "Departure date in YYYY-MM-DD format." + }, + "destination": { + "type": "string", + "description": "Airport or city IATA designator of the destination." + }, + "kind": { + "type": "string", + "description": "Identifies this as a slice input object, representing the criteria a desired slice must satisfy. Value: the fixed string qpxexpress#sliceInput.", + "default": "qpxexpress#sliceInput" + }, + "maxConnectionDuration": { + "type": "integer", + "description": "The longest connection between two legs, in minutes, you are willing to accept.", + "format": "int32" + }, + "maxStops": { + "type": "integer", + "description": "The maximum number of stops you are willing to accept in this slice.", + "format": "int32" + }, + "origin": { + "type": "string", + "description": "Airport or city IATA designator of the origin." + }, + "permittedCarrier": { + "type": "array", + "description": "A list of 2-letter IATA airline designators. Slices with only these carriers should be returned.", + "items": { + "type": "string" + } + }, + "permittedDepartureTime": { + "$ref": "TimeOfDayRange", + "description": "Slices must depart in this time of day range, local to the point of departure." + }, + "preferredCabin": { + "type": "string", + "description": "Prefer solutions that book in this cabin for this slice. Allowed values are COACH, PREMIUM_COACH, BUSINESS, and FIRST." + }, + "prohibitedCarrier": { + "type": "array", + "description": "A list of 2-letter IATA airline designators. Exclude slices that use these carriers.", + "items": { + "type": "string" + } + } + } + }, + "TaxData": { + "id": "TaxData", + "type": "object", + "description": "Tax data.", + "properties": { + "id": { + "type": "string", + "description": "An identifier uniquely identifying a tax in a response." + }, + "kind": { + "type": "string", + "description": "Identifies this as a tax data object, representing some tax. Value: the fixed string qpxexpress#taxData.", + "default": "qpxexpress#taxData" + }, + "name": { + "type": "string", + "description": "The name of a tax." + } + } + }, + "TaxInfo": { + "id": "TaxInfo", + "type": "object", + "description": "Tax information.", + "properties": { + "chargeType": { + "type": "string", + "description": "Whether this is a government charge or a carrier surcharge." + }, + "code": { + "type": "string", + "description": "The code to enter in the ticket's tax box." + }, + "country": { + "type": "string", + "description": "For government charges, the country levying the charge." + }, + "id": { + "type": "string", + "description": "Identifier uniquely identifying this tax in a response. Not present for unnamed carrier surcharges." + }, + "kind": { + "type": "string", + "description": "Identifies this as a tax information object. Value: the fixed string qpxexpress#taxInfo.", + "default": "qpxexpress#taxInfo" + }, + "salePrice": { + "type": "string", + "description": "The price of the tax in the sales or equivalent currency." + } + } + }, + "TimeOfDayRange": { + "id": "TimeOfDayRange", + "type": "object", + "description": "Two times in a single day defining a time range.", + "properties": { + "earliestTime": { + "type": "string", + "description": "The earliest time of day in HH:MM format." + }, + "kind": { + "type": "string", + "description": "Identifies this as a time of day range object, representing two times in a single day defining a time range. Value: the fixed string qpxexpress#timeOfDayRange.", + "default": "qpxexpress#timeOfDayRange" + }, + "latestTime": { + "type": "string", + "description": "The latest time of day in HH:MM format." + } + } + }, + "TripOption": { + "id": "TripOption", + "type": "object", + "description": "Trip information.", + "properties": { + "id": { + "type": "string", + "description": "Identifier uniquely identifying this trip in a response." + }, + "kind": { + "type": "string", + "description": "Identifies this as a trip information object. Value: the fixed string qpxexpress#tripOption.", + "default": "qpxexpress#tripOption" + }, + "pricing": { + "type": "array", + "description": "Per passenger pricing information.", + "items": { + "$ref": "PricingInfo" + } + }, + "saleTotal": { + "type": "string", + "description": "The total price for all passengers on the trip, in the form of a currency followed by an amount, e.g. USD253.35." + }, + "slice": { + "type": "array", + "description": "The slices that make up this trip's itinerary.", + "items": { + "$ref": "SliceInfo" + } + } + } + }, + "TripOptionsRequest": { + "id": "TripOptionsRequest", + "type": "object", + "description": "A QPX Express search request, which will yield one or more solutions.", + "properties": { + "maxPrice": { + "type": "string", + "description": "Do not return solutions that cost more than this price. The alphabetical part of the price is in ISO 4217. The format, in regex, is [A-Z]{3}\\d+(\\.\\d+)? Example: $102.07" + }, + "passengers": { + "$ref": "PassengerCounts", + "description": "Counts for each passenger type in the request." + }, + "refundable": { + "type": "boolean", + "description": "Return only solutions with refundable fares." + }, + "saleCountry": { + "type": "string", + "description": "IATA country code representing the point of sale. This determines the \"equivalent amount paid\" currency for the ticket." + }, + "slice": { + "type": "array", + "description": "The slices that make up the itinerary of this trip. A slice represents a traveler's intent, the portion of a low-fare search corresponding to a traveler's request to get between two points. One-way journeys are generally expressed using one slice, round-trips using two. An example of a one slice trip with three segments might be BOS-SYD, SYD-LAX, LAX-BOS if the traveler only stopped in SYD and LAX just long enough to change planes.", + "items": { + "$ref": "SliceInput" + } + }, + "solutions": { + "type": "integer", + "description": "The number of solutions to return, maximum 500.", + "format": "int32" + } + } + }, + "TripOptionsResponse": { + "id": "TripOptionsResponse", + "type": "object", + "description": "A QPX Express search response.", + "properties": { + "data": { + "$ref": "Data", + "description": "Informational data global to list of solutions." + }, + "kind": { + "type": "string", + "description": "Identifies this as a QPX Express trip response object, which consists of zero or more solutions. Value: the fixed string qpxexpress#tripOptions.", + "default": "qpxexpress#tripOptions" + }, + "requestId": { + "type": "string", + "description": "An identifier uniquely identifying this response." + }, + "tripOption": { + "type": "array", + "description": "A list of priced itinerary solutions to the QPX Express query.", + "items": { + "$ref": "TripOption" + } + } + } + }, + "TripsSearchRequest": { + "id": "TripsSearchRequest", + "type": "object", + "description": "A QPX Express search request.", + "properties": { + "request": { + "$ref": "TripOptionsRequest", + "description": "A QPX Express search request. Required values are at least one adult or senior passenger, an origin, a destination, and a date." + } + } + }, + "TripsSearchResponse": { + "id": "TripsSearchResponse", + "type": "object", + "description": "A QPX Express search response.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies this as a QPX Express API search response resource. Value: the fixed string qpxExpress#tripsSearch.", + "default": "qpxExpress#tripsSearch" + }, + "trips": { + "$ref": "TripOptionsResponse", + "description": "All possible solutions to the QPX Express search request." + } + } + } + }, + "resources": { + "trips": { + "methods": { + "search": { + "id": "qpxExpress.trips.search", + "path": "search", + "httpMethod": "POST", + "description": "Returns a list of flights.", + "request": { + "$ref": "TripsSearchRequest" + }, + "response": { + "$ref": "TripsSearchResponse" + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/qpxexpress/v1/qpxexpress-gen.go b/third_party/src/code.google.com/p/google-api-go-client/qpxexpress/v1/qpxexpress-gen.go new file mode 100644 index 0000000000000..57bdfd8fcbeff --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/qpxexpress/v1/qpxexpress-gen.go @@ -0,0 +1,691 @@ +// Package qpxexpress provides access to the QPX Express API. +// +// See http://developers.google.com/qpx-express +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/qpxexpress/v1" +// ... +// qpxexpressService, err := qpxexpress.New(oauthHttpClient) +package qpxexpress + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "qpxExpress:v1" +const apiName = "qpxExpress" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/qpxExpress/v1/trips/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Trips = NewTripsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Trips *TripsService +} + +func NewTripsService(s *Service) *TripsService { + rs := &TripsService{s: s} + return rs +} + +type TripsService struct { + s *Service +} + +type AircraftData struct { + // Code: The aircraft code. For example, for a Boeing 777 the code would + // be 777. + Code string `json:"code,omitempty"` + + // Kind: Identifies this as an aircraftData object. Value: the fixed + // string qpxexpress#aircraftData + Kind string `json:"kind,omitempty"` + + // Name: The name of an aircraft, for example Boeing 777. + Name string `json:"name,omitempty"` +} + +type AirportData struct { + // City: The city code an airport is located in. For example, for JFK + // airport, this is NYC. + City string `json:"city,omitempty"` + + // Code: An airport's code. For example, for Boston Logan airport, this + // is BOS. + Code string `json:"code,omitempty"` + + // Kind: Identifies this as an airport object. Value: the fixed string + // qpxexpress#airportData. + Kind string `json:"kind,omitempty"` + + // Name: The name of an airport. For example, for airport BOS the name + // is "Boston Logan International". + Name string `json:"name,omitempty"` +} + +type BagDescriptor struct { + // CommercialName: Provides the commercial name for an optional service. + CommercialName string `json:"commercialName,omitempty"` + + // Count: How many of this type of bag will be checked on this flight. + Count int64 `json:"count,omitempty"` + + // Description: A description of the baggage. + Description []string `json:"description,omitempty"` + + // Kind: Identifies this as a baggage object. Value: the fixed string + // qpxexpress#bagDescriptor. + Kind string `json:"kind,omitempty"` + + // Subcode: The standard IATA subcode used to identify this optional + // service. + Subcode string `json:"subcode,omitempty"` +} + +type CarrierData struct { + // Code: The IATA designator of a carrier (airline, etc). For example, + // for American Airlines, the code is AA. + Code string `json:"code,omitempty"` + + // Kind: Identifies this as a kind of carrier (ie. an airline, bus line, + // railroad, etc). Value: the fixed string qpxexpress#carrierData. + Kind string `json:"kind,omitempty"` + + // Name: The long, full name of a carrier. For example: American + // Airlines. + Name string `json:"name,omitempty"` +} + +type CityData struct { + // Code: The IATA character ID of a city. For example, for Boston this + // is BOS. + Code string `json:"code,omitempty"` + + // Country: The two-character country code of the country the city is + // located in. For example, US for the United States of America. + Country string `json:"country,omitempty"` + + // Kind: Identifies this as a city, typically with one or more airports. + // Value: the fixed string qpxexpress#cityData. + Kind string `json:"kind,omitempty"` + + // Name: The full name of a city. An example would be: New York. + Name string `json:"name,omitempty"` +} + +type Data struct { + // Aircraft: The aircraft that is flying between an origin and + // destination. + Aircraft []*AircraftData `json:"aircraft,omitempty"` + + // Airport: The airport of an origin or destination. + Airport []*AirportData `json:"airport,omitempty"` + + // Carrier: The airline carrier of the aircraft flying between an origin + // and destination. Allowed values are IATA carrier codes. + Carrier []*CarrierData `json:"carrier,omitempty"` + + // City: The city that is either the origin or destination of part of a + // trip. + City []*CityData `json:"city,omitempty"` + + // Kind: Identifies this as QPX Express response resource, including a + // trip's airport, city, taxes, airline, and aircraft. Value: the fixed + // string qpxexpress#data. + Kind string `json:"kind,omitempty"` + + // Tax: The taxes due for flying between an origin and a destination. + Tax []*TaxData `json:"tax,omitempty"` +} + +type FareInfo struct { + BasisCode string `json:"basisCode,omitempty"` + + // Carrier: The carrier of the aircraft or other vehicle commuting + // between two points. + Carrier string `json:"carrier,omitempty"` + + // Destination: The city code of the city the trip ends at. + Destination string `json:"destination,omitempty"` + + // Id: A unique identifier of the fare. + Id string `json:"id,omitempty"` + + // Kind: Identifies this as a fare object. Value: the fixed string + // qpxexpress#fareInfo. + Kind string `json:"kind,omitempty"` + + // Origin: The city code of the city the trip begins at. + Origin string `json:"origin,omitempty"` + + // Private: Whether this is a private fare, for example one offered only + // to select customers rather than the general public. + Private bool `json:"private,omitempty"` +} + +type FlightInfo struct { + Carrier string `json:"carrier,omitempty"` + + // Number: The flight number. + Number string `json:"number,omitempty"` +} + +type FreeBaggageAllowance struct { + // BagDescriptor: A representation of a type of bag, such as an ATPCo + // subcode, Commercial Name, or other description. + BagDescriptor []*BagDescriptor `json:"bagDescriptor,omitempty"` + + // Kilos: The maximum number of kilos all the free baggage together may + // weigh. + Kilos int64 `json:"kilos,omitempty"` + + // KilosPerPiece: The maximum number of kilos any one piece of baggage + // may weigh. + KilosPerPiece int64 `json:"kilosPerPiece,omitempty"` + + // Kind: Identifies this as free baggage object, allowed on one segment + // of a trip. Value: the fixed string qpxexpress#freeBaggageAllowance. + Kind string `json:"kind,omitempty"` + + // Pieces: The number of free pieces of baggage allowed. + Pieces int64 `json:"pieces,omitempty"` + + // Pounds: The number of pounds of free baggage allowed. + Pounds int64 `json:"pounds,omitempty"` +} + +type LegInfo struct { + // Aircraft: The aircraft (or bus, ferry, railcar, etc) travelling + // between the two points of this leg. + Aircraft string `json:"aircraft,omitempty"` + + // ArrivalTime: The scheduled time of arrival at the destination of the + // leg, local to the point of arrival. + ArrivalTime string `json:"arrivalTime,omitempty"` + + // ChangePlane: Whether you have to change planes following this leg. + // Only applies to the next leg. + ChangePlane bool `json:"changePlane,omitempty"` + + // ConnectionDuration: Duration of a connection following this leg, in + // minutes. + ConnectionDuration int64 `json:"connectionDuration,omitempty"` + + // DepartureTime: The scheduled departure time of the leg, local to the + // point of departure. + DepartureTime string `json:"departureTime,omitempty"` + + // Destination: The leg destination as a city and airport. + Destination string `json:"destination,omitempty"` + + // DestinationTerminal: The terminal the flight is scheduled to arrive + // at. + DestinationTerminal string `json:"destinationTerminal,omitempty"` + + // Duration: The scheduled travelling time from the origin to the + // destination. + Duration int64 `json:"duration,omitempty"` + + // Id: An identifier that uniquely identifies this leg in the solution. + Id string `json:"id,omitempty"` + + // Kind: Identifies this as a leg object. A leg is the smallest unit of + // travel, in the case of a flight a takeoff immediately followed by a + // landing at two set points on a particular carrier with a particular + // flight number. Value: the fixed string qpxexpress#legInfo. + Kind string `json:"kind,omitempty"` + + // Meal: A simple, general description of the meal(s) served on the + // flight, for example: "Hot meal". + Meal string `json:"meal,omitempty"` + + // Mileage: The number of miles in this leg. + Mileage int64 `json:"mileage,omitempty"` + + // OnTimePerformance: In percent, the published on time performance on + // this leg. + OnTimePerformance int64 `json:"onTimePerformance,omitempty"` + + // OperatingDisclosure: Department of Transportation disclosure + // information on the actual operator of a flight in a code share. (A + // code share refers to a marketing agreement between two carriers, + // where one carrier will list in its schedules (and take bookings for) + // flights that are actually operated by another carrier.) + OperatingDisclosure string `json:"operatingDisclosure,omitempty"` + + // Origin: The leg origin as a city and airport. + Origin string `json:"origin,omitempty"` + + // OriginTerminal: The terminal the flight is scheduled to depart from. + OriginTerminal string `json:"originTerminal,omitempty"` + + // Secure: Whether passenger information must be furnished to the United + // States Transportation Security Administration (TSA) prior to + // departure. + Secure bool `json:"secure,omitempty"` +} + +type PassengerCounts struct { + // AdultCount: The number of passengers that are adults. + AdultCount int64 `json:"adultCount,omitempty"` + + // ChildCount: The number of passengers that are children. + ChildCount int64 `json:"childCount,omitempty"` + + // InfantInLapCount: The number of passengers that are infants + // travelling in the lap of an adult. + InfantInLapCount int64 `json:"infantInLapCount,omitempty"` + + // InfantInSeatCount: The number of passengers that are infants each + // assigned a seat. + InfantInSeatCount int64 `json:"infantInSeatCount,omitempty"` + + // Kind: Identifies this as a passenger count object, representing the + // number of passengers. Value: the fixed string + // qpxexpress#passengerCounts. + Kind string `json:"kind,omitempty"` + + // SeniorCount: The number of passengers that are senior citizens. + SeniorCount int64 `json:"seniorCount,omitempty"` +} + +type PricingInfo struct { + // BaseFareTotal: The total fare in the base fare currency (the currency + // of the country of origin). This element is only present when the + // sales currency and the currency of the country of commencement are + // different. + BaseFareTotal string `json:"baseFareTotal,omitempty"` + + // Fare: The fare used to price one or more segments. + Fare []*FareInfo `json:"fare,omitempty"` + + // FareCalculation: The horizontal fare calculation. This is a field on + // a ticket that displays all of the relevant items that go into the + // calculation of the fare. + FareCalculation string `json:"fareCalculation,omitempty"` + + // Kind: Identifies this as a pricing object, representing the price of + // one or more travel segments. Value: the fixed string + // qpxexpress#pricingInfo. + Kind string `json:"kind,omitempty"` + + // LatestTicketingTime: The latest ticketing time for this pricing + // assuming the reservation occurs at ticketing time and there is no + // change in fares/rules. The time is local to the point of sale (POS). + LatestTicketingTime string `json:"latestTicketingTime,omitempty"` + + // Passengers: The number of passengers to which this price applies. + Passengers *PassengerCounts `json:"passengers,omitempty"` + + // Ptc: The passenger type code for this pricing. An alphanumeric code + // used by a carrier to restrict fares to certain categories of + // passenger. For instance, a fare might be valid only for senior + // citizens. + Ptc string `json:"ptc,omitempty"` + + // Refundable: Whether the fares on this pricing are refundable. + Refundable bool `json:"refundable,omitempty"` + + // SaleFareTotal: The total fare in the sale or equivalent currency. + SaleFareTotal string `json:"saleFareTotal,omitempty"` + + // SaleTaxTotal: The taxes in the sale or equivalent currency. + SaleTaxTotal string `json:"saleTaxTotal,omitempty"` + + // SaleTotal: Total per-passenger price (fare and tax) in the sale or + // equivalent currency. + SaleTotal string `json:"saleTotal,omitempty"` + + // SegmentPricing: The per-segment price and baggage information. + SegmentPricing []*SegmentPricing `json:"segmentPricing,omitempty"` + + // Tax: The taxes used to calculate the tax total per ticket. + Tax []*TaxInfo `json:"tax,omitempty"` +} + +type SegmentInfo struct { + // BookingCode: The booking code or class for this segment. + BookingCode string `json:"bookingCode,omitempty"` + + // BookingCodeCount: The number of seats available in this booking code + // on this segment. + BookingCodeCount int64 `json:"bookingCodeCount,omitempty"` + + // Cabin: The cabin booked for this segment. + Cabin string `json:"cabin,omitempty"` + + // ConnectionDuration: In minutes, the duration of the connection + // following this segment. + ConnectionDuration int64 `json:"connectionDuration,omitempty"` + + // Duration: The duration of the flight segment in minutes. + Duration int64 `json:"duration,omitempty"` + + // Flight: The flight this is a segment of. + Flight *FlightInfo `json:"flight,omitempty"` + + // Id: An id uniquely identifying the segment in the solution. + Id string `json:"id,omitempty"` + + // Kind: Identifies this as a segment object. A segment is one or more + // consecutive legs on the same flight. For example a hypothetical + // flight ZZ001, from DFW to OGG, could have one segment with two legs: + // DFW to HNL (leg 1), HNL to OGG (leg 2). Value: the fixed string + // qpxexpress#segmentInfo. + Kind string `json:"kind,omitempty"` + + // Leg: The legs composing this segment. + Leg []*LegInfo `json:"leg,omitempty"` + + // MarriedSegmentGroup: The solution-based index of a segment in a + // married segment group. Married segments can only be booked together. + // For example, an airline might report a certain booking code as sold + // out from Boston to Pittsburgh, but as available as part of two + // married segments Boston to Chicago connecting through Pittsburgh. For + // example content of this field, consider the round-trip flight ZZ1 + // PHX-PHL ZZ2 PHL-CLT ZZ3 CLT-PHX. This has three segments, with the + // two outbound ones (ZZ1 ZZ2) married. In this case, the two outbound + // segments belong to married segment group 0, and the return segment + // belongs to married segment group 1. + MarriedSegmentGroup string `json:"marriedSegmentGroup,omitempty"` + + // SubjectToGovernmentApproval: Whether the operation of this segment + // remains subject to government approval. + SubjectToGovernmentApproval bool `json:"subjectToGovernmentApproval,omitempty"` +} + +type SegmentPricing struct { + // FareId: A segment identifier unique within a single solution. It is + // used to refer to different parts of the same solution. + FareId string `json:"fareId,omitempty"` + + // FreeBaggageOption: Details of the free baggage allowance on this + // segment. + FreeBaggageOption []*FreeBaggageAllowance `json:"freeBaggageOption,omitempty"` + + // Kind: Identifies this as a segment pricing object, representing the + // price of this segment. Value: the fixed string + // qpxexpress#segmentPricing. + Kind string `json:"kind,omitempty"` + + // SegmentId: Unique identifier in the response of this segment. + SegmentId string `json:"segmentId,omitempty"` +} + +type SliceInfo struct { + // Duration: The duration of the slice in minutes. + Duration int64 `json:"duration,omitempty"` + + // Kind: Identifies this as a slice object. A slice represents a + // traveller's intent, the portion of a low-fare search corresponding to + // a traveler's request to get between two points. One-way journeys are + // generally expressed using 1 slice, round-trips using 2. Value: the + // fixed string qpxexpress#sliceInfo. + Kind string `json:"kind,omitempty"` + + // Segment: The segment(s) constituting the slice. + Segment []*SegmentInfo `json:"segment,omitempty"` +} + +type SliceInput struct { + // Alliance: Slices with only the carriers in this alliance should be + // returned; do not use this field with permittedCarrier. Allowed values + // are ONEWORLD, SKYTEAM, and STAR. + Alliance string `json:"alliance,omitempty"` + + // Date: Departure date in YYYY-MM-DD format. + Date string `json:"date,omitempty"` + + // Destination: Airport or city IATA designator of the destination. + Destination string `json:"destination,omitempty"` + + // Kind: Identifies this as a slice input object, representing the + // criteria a desired slice must satisfy. Value: the fixed string + // qpxexpress#sliceInput. + Kind string `json:"kind,omitempty"` + + // MaxConnectionDuration: The longest connection between two legs, in + // minutes, you are willing to accept. + MaxConnectionDuration int64 `json:"maxConnectionDuration,omitempty"` + + // MaxStops: The maximum number of stops you are willing to accept in + // this slice. + MaxStops int64 `json:"maxStops,omitempty"` + + // Origin: Airport or city IATA designator of the origin. + Origin string `json:"origin,omitempty"` + + // PermittedCarrier: A list of 2-letter IATA airline designators. Slices + // with only these carriers should be returned. + PermittedCarrier []string `json:"permittedCarrier,omitempty"` + + // PermittedDepartureTime: Slices must depart in this time of day range, + // local to the point of departure. + PermittedDepartureTime *TimeOfDayRange `json:"permittedDepartureTime,omitempty"` + + // PreferredCabin: Prefer solutions that book in this cabin for this + // slice. Allowed values are COACH, PREMIUM_COACH, BUSINESS, and FIRST. + PreferredCabin string `json:"preferredCabin,omitempty"` + + // ProhibitedCarrier: A list of 2-letter IATA airline designators. + // Exclude slices that use these carriers. + ProhibitedCarrier []string `json:"prohibitedCarrier,omitempty"` +} + +type TaxData struct { + // Id: An identifier uniquely identifying a tax in a response. + Id string `json:"id,omitempty"` + + // Kind: Identifies this as a tax data object, representing some tax. + // Value: the fixed string qpxexpress#taxData. + Kind string `json:"kind,omitempty"` + + // Name: The name of a tax. + Name string `json:"name,omitempty"` +} + +type TaxInfo struct { + // ChargeType: Whether this is a government charge or a carrier + // surcharge. + ChargeType string `json:"chargeType,omitempty"` + + // Code: The code to enter in the ticket's tax box. + Code string `json:"code,omitempty"` + + // Country: For government charges, the country levying the charge. + Country string `json:"country,omitempty"` + + // Id: Identifier uniquely identifying this tax in a response. Not + // present for unnamed carrier surcharges. + Id string `json:"id,omitempty"` + + // Kind: Identifies this as a tax information object. Value: the fixed + // string qpxexpress#taxInfo. + Kind string `json:"kind,omitempty"` + + // SalePrice: The price of the tax in the sales or equivalent currency. + SalePrice string `json:"salePrice,omitempty"` +} + +type TimeOfDayRange struct { + // EarliestTime: The earliest time of day in HH:MM format. + EarliestTime string `json:"earliestTime,omitempty"` + + // Kind: Identifies this as a time of day range object, representing two + // times in a single day defining a time range. Value: the fixed string + // qpxexpress#timeOfDayRange. + Kind string `json:"kind,omitempty"` + + // LatestTime: The latest time of day in HH:MM format. + LatestTime string `json:"latestTime,omitempty"` +} + +type TripOption struct { + // Id: Identifier uniquely identifying this trip in a response. + Id string `json:"id,omitempty"` + + // Kind: Identifies this as a trip information object. Value: the fixed + // string qpxexpress#tripOption. + Kind string `json:"kind,omitempty"` + + // Pricing: Per passenger pricing information. + Pricing []*PricingInfo `json:"pricing,omitempty"` + + // SaleTotal: The total price for all passengers on the trip, in the + // form of a currency followed by an amount, e.g. USD253.35. + SaleTotal string `json:"saleTotal,omitempty"` + + // Slice: The slices that make up this trip's itinerary. + Slice []*SliceInfo `json:"slice,omitempty"` +} + +type TripOptionsRequest struct { + // MaxPrice: Do not return solutions that cost more than this price. The + // alphabetical part of the price is in ISO 4217. The format, in regex, + // is [A-Z]{3}\d+(\.\d+)? Example: $102.07 + MaxPrice string `json:"maxPrice,omitempty"` + + // Passengers: Counts for each passenger type in the request. + Passengers *PassengerCounts `json:"passengers,omitempty"` + + // Refundable: Return only solutions with refundable fares. + Refundable bool `json:"refundable,omitempty"` + + // SaleCountry: IATA country code representing the point of sale. This + // determines the "equivalent amount paid" currency for the ticket. + SaleCountry string `json:"saleCountry,omitempty"` + + // Slice: The slices that make up the itinerary of this trip. A slice + // represents a traveler's intent, the portion of a low-fare search + // corresponding to a traveler's request to get between two points. + // One-way journeys are generally expressed using one slice, round-trips + // using two. An example of a one slice trip with three segments might + // be BOS-SYD, SYD-LAX, LAX-BOS if the traveler only stopped in SYD and + // LAX just long enough to change planes. + Slice []*SliceInput `json:"slice,omitempty"` + + // Solutions: The number of solutions to return, maximum 500. + Solutions int64 `json:"solutions,omitempty"` +} + +type TripOptionsResponse struct { + // Data: Informational data global to list of solutions. + Data *Data `json:"data,omitempty"` + + // Kind: Identifies this as a QPX Express trip response object, which + // consists of zero or more solutions. Value: the fixed string + // qpxexpress#tripOptions. + Kind string `json:"kind,omitempty"` + + // RequestId: An identifier uniquely identifying this response. + RequestId string `json:"requestId,omitempty"` + + // TripOption: A list of priced itinerary solutions to the QPX Express + // query. + TripOption []*TripOption `json:"tripOption,omitempty"` +} + +type TripsSearchRequest struct { + // Request: A QPX Express search request. Required values are at least + // one adult or senior passenger, an origin, a destination, and a date. + Request *TripOptionsRequest `json:"request,omitempty"` +} + +type TripsSearchResponse struct { + // Kind: Identifies this as a QPX Express API search response resource. + // Value: the fixed string qpxExpress#tripsSearch. + Kind string `json:"kind,omitempty"` + + // Trips: All possible solutions to the QPX Express search request. + Trips *TripOptionsResponse `json:"trips,omitempty"` +} + +// method id "qpxExpress.trips.search": + +type TripsSearchCall struct { + s *Service + tripssearchrequest *TripsSearchRequest + opt_ map[string]interface{} +} + +// Search: Returns a list of flights. +func (r *TripsService) Search(tripssearchrequest *TripsSearchRequest) *TripsSearchCall { + c := &TripsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.tripssearchrequest = tripssearchrequest + return c +} + +func (c *TripsSearchCall) Do() (*TripsSearchResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.tripssearchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "search") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TripsSearchResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of flights.", + // "httpMethod": "POST", + // "id": "qpxExpress.trips.search", + // "path": "search", + // "request": { + // "$ref": "TripsSearchRequest" + // }, + // "response": { + // "$ref": "TripsSearchResponse" + // } + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/reseller/v1/reseller-api.json b/third_party/src/code.google.com/p/google-api-go-client/reseller/v1/reseller-api.json new file mode 100644 index 0000000000000..2607dc6c7c3a7 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/reseller/v1/reseller-api.json @@ -0,0 +1,749 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/Qaw4O4xIZ1X1A6NR-C3D43AiI0M\"", + "discoveryVersion": "v1", + "id": "reseller:v1", + "name": "reseller", + "version": "v1", + "title": "Enterprise Apps Reseller API", + "description": "Lets you create and manage your customers and their subscriptions.", + "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/reseller/", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/apps/reseller/v1/", + "basePath": "/apps/reseller/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "apps/reseller/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/apps.order": { + "description": "Manage users on your domain" + }, + "https://www.googleapis.com/auth/apps.order.readonly": { + "description": "Manage users on your domain" + } + } + } + }, + "schemas": { + "Address": { + "id": "Address", + "type": "object", + "description": "JSON template for address of a customer.", + "properties": { + "addressLine1": { + "type": "string", + "description": "Address line 1 of the address." + }, + "addressLine2": { + "type": "string", + "description": "Address line 2 of the address." + }, + "addressLine3": { + "type": "string", + "description": "Address line 3 of the address." + }, + "contactName": { + "type": "string", + "description": "Name of the contact person." + }, + "countryCode": { + "type": "string", + "description": "ISO 3166 country code." + }, + "kind": { + "type": "string", + "description": "Identifies the resource as a customer address.", + "default": "customers#address" + }, + "locality": { + "type": "string", + "description": "Name of the locality. This is in accordance with - http://portablecontacts.net/draft-spec.html#address_element." + }, + "organizationName": { + "type": "string", + "description": "Name of the organization." + }, + "postalCode": { + "type": "string", + "description": "The postal code. This is in accordance with - http://portablecontacts.net/draft-spec.html#address_element." + }, + "region": { + "type": "string", + "description": "Name of the region. This is in accordance with - http://portablecontacts.net/draft-spec.html#address_element." + } + } + }, + "ChangePlanRequest": { + "id": "ChangePlanRequest", + "type": "object", + "description": "JSON template for the ChangePlan rpc request.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies the resource as a subscription change plan request.", + "default": "subscriptions#changePlanRequest" + }, + "planName": { + "type": "string", + "description": "Name of the plan to change to." + }, + "purchaseOrderId": { + "type": "string", + "description": "Purchase order id for your order tracking purposes." + }, + "seats": { + "$ref": "Seats", + "description": "Number/Limit of seats in the new plan." + } + } + }, + "Customer": { + "id": "Customer", + "type": "object", + "description": "JSON template for a customer.", + "properties": { + "alternateEmail": { + "type": "string", + "description": "The alternate email of the customer." + }, + "customerDomain": { + "type": "string", + "description": "The domain name of the customer." + }, + "customerId": { + "type": "string", + "description": "The id of the customer." + }, + "kind": { + "type": "string", + "description": "Identifies the resource as a customer.", + "default": "reseller#customer" + }, + "phoneNumber": { + "type": "string", + "description": "The phone number of the customer." + }, + "postalAddress": { + "$ref": "Address", + "description": "The postal address of the customer." + }, + "resourceUiUrl": { + "type": "string", + "description": "Ui url for customer resource." + } + } + }, + "RenewalSettings": { + "id": "RenewalSettings", + "type": "object", + "description": "JSON template for a subscription renewal settings.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies the resource as a subscription renewal setting.", + "default": "subscriptions#renewalSettings" + }, + "renewalType": { + "type": "string", + "description": "Subscription renewal type." + } + } + }, + "Seats": { + "id": "Seats", + "type": "object", + "description": "JSON template for subscription seats.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies the resource as a subscription change plan request.", + "default": "subscriptions#seats" + }, + "maximumNumberOfSeats": { + "type": "integer", + "description": "Maximum number of seats that can be purchased. This needs to be provided only for a non-commitment plan. For a commitment plan it is decided by the contract.", + "format": "int32" + }, + "numberOfSeats": { + "type": "integer", + "description": "Number of seats to purchase. This is applicable only for a commitment plan.", + "format": "int32" + } + } + }, + "Subscription": { + "id": "Subscription", + "type": "object", + "description": "JSON template for a subscription.", + "properties": { + "creationTime": { + "type": "string", + "description": "Creation time of this subscription in milliseconds since Unix epoch.", + "format": "int64" + }, + "customerId": { + "type": "string", + "description": "The id of the customer to whom the subscription belongs." + }, + "kind": { + "type": "string", + "description": "Identifies the resource as a Subscription.", + "default": "reseller#subscription" + }, + "plan": { + "type": "object", + "description": "Plan details of the subscription", + "properties": { + "commitmentInterval": { + "type": "object", + "description": "Interval of the commitment if it is a commitment plan.", + "properties": { + "endTime": { + "type": "string", + "description": "End time of the commitment interval in milliseconds since Unix epoch.", + "format": "int64" + }, + "startTime": { + "type": "string", + "description": "Start time of the commitment interval in milliseconds since Unix epoch.", + "format": "int64" + } + } + }, + "isCommitmentPlan": { + "type": "boolean", + "description": "Whether the plan is a commitment plan or not." + }, + "planName": { + "type": "string", + "description": "The plan name of this subscription's plan." + } + } + }, + "purchaseOrderId": { + "type": "string", + "description": "Purchase order id for your order tracking purposes." + }, + "renewalSettings": { + "$ref": "RenewalSettings", + "description": "Renewal settings of the subscription." + }, + "resourceUiUrl": { + "type": "string", + "description": "Ui url for subscription resource." + }, + "seats": { + "$ref": "Seats", + "description": "Number/Limit of seats in the new plan." + }, + "skuId": { + "type": "string", + "description": "Name of the sku for which this subscription is purchased." + }, + "status": { + "type": "string", + "description": "Status of the subscription." + }, + "subscriptionId": { + "type": "string", + "description": "The id of the subscription." + }, + "transferInfo": { + "type": "object", + "description": "Transfer related information for the subscription.", + "properties": { + "minimumTransferableSeats": { + "type": "integer", + "format": "int32" + }, + "transferabilityExpirationTime": { + "type": "string", + "description": "Time when transfer token or intent to transfer will expire.", + "format": "int64" + } + } + }, + "trialSettings": { + "type": "object", + "description": "Trial Settings of the subscription.", + "properties": { + "isInTrial": { + "type": "boolean", + "description": "Whether the subscription is in trial." + }, + "trialEndTime": { + "type": "string", + "description": "End time of the trial in milliseconds since Unix epoch.", + "format": "int64" + } + } + } + } + }, + "Subscriptions": { + "id": "Subscriptions", + "type": "object", + "description": "JSON template for a subscription list.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies the resource as a collection of subscriptions.", + "default": "reseller#subscriptions" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "subscriptions": { + "type": "array", + "description": "The subscriptions in this page of results.", + "items": { + "$ref": "Subscription" + } + } + } + } + }, + "resources": { + "customers": { + "methods": { + "get": { + "id": "reseller.customers.get", + "path": "customers/{customerId}", + "httpMethod": "GET", + "description": "Gets a customer resource if one exists and is owned by the reseller.", + "parameters": { + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId" + ], + "response": { + "$ref": "Customer" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order", + "https://www.googleapis.com/auth/apps.order.readonly" + ] + }, + "insert": { + "id": "reseller.customers.insert", + "path": "customers", + "httpMethod": "POST", + "description": "Creates a customer resource if one does not already exist.", + "parameters": { + "customerAuthToken": { + "type": "string", + "description": "An auth token needed for inserting a customer for which domain already exists. Can be generated at https://www.google.com/a/cpanel//TransferToken. Optional.", + "location": "query" + } + }, + "request": { + "$ref": "Customer" + }, + "response": { + "$ref": "Customer" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order" + ] + }, + "patch": { + "id": "reseller.customers.patch", + "path": "customers/{customerId}", + "httpMethod": "PATCH", + "description": "Update a customer resource if one it exists and is owned by the reseller. This method supports patch semantics.", + "parameters": { + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId" + ], + "request": { + "$ref": "Customer" + }, + "response": { + "$ref": "Customer" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order" + ] + }, + "update": { + "id": "reseller.customers.update", + "path": "customers/{customerId}", + "httpMethod": "PUT", + "description": "Update a customer resource if one it exists and is owned by the reseller.", + "parameters": { + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId" + ], + "request": { + "$ref": "Customer" + }, + "response": { + "$ref": "Customer" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order" + ] + } + } + }, + "subscriptions": { + "methods": { + "changePlan": { + "id": "reseller.subscriptions.changePlan", + "path": "customers/{customerId}/subscriptions/{subscriptionId}/changePlan", + "httpMethod": "POST", + "description": "Changes the plan of a subscription", + "parameters": { + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + }, + "subscriptionId": { + "type": "string", + "description": "Id of the subscription, which is unique for a customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "subscriptionId" + ], + "request": { + "$ref": "ChangePlanRequest" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order" + ] + }, + "changeRenewalSettings": { + "id": "reseller.subscriptions.changeRenewalSettings", + "path": "customers/{customerId}/subscriptions/{subscriptionId}/changeRenewalSettings", + "httpMethod": "POST", + "description": "Changes the renewal settings of a subscription", + "parameters": { + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + }, + "subscriptionId": { + "type": "string", + "description": "Id of the subscription, which is unique for a customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "subscriptionId" + ], + "request": { + "$ref": "RenewalSettings" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order" + ] + }, + "changeSeats": { + "id": "reseller.subscriptions.changeSeats", + "path": "customers/{customerId}/subscriptions/{subscriptionId}/changeSeats", + "httpMethod": "POST", + "description": "Changes the seats configuration of a subscription", + "parameters": { + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + }, + "subscriptionId": { + "type": "string", + "description": "Id of the subscription, which is unique for a customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "subscriptionId" + ], + "request": { + "$ref": "Seats" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order" + ] + }, + "delete": { + "id": "reseller.subscriptions.delete", + "path": "customers/{customerId}/subscriptions/{subscriptionId}", + "httpMethod": "DELETE", + "description": "Cancels/Downgrades a subscription.", + "parameters": { + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + }, + "deletionType": { + "type": "string", + "description": "Whether the subscription is to be fully cancelled or downgraded", + "required": true, + "enum": [ + "cancel", + "downgrade", + "suspend" + ], + "enumDescriptions": [ + "Cancels the subscription immediately", + "Downgrades a Google Apps for Business subscription to Google Apps", + "Suspends the subscriptions for 4 days before cancelling it" + ], + "location": "query" + }, + "subscriptionId": { + "type": "string", + "description": "Id of the subscription, which is unique for a customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "subscriptionId", + "deletionType" + ], + "scopes": [ + "https://www.googleapis.com/auth/apps.order" + ] + }, + "get": { + "id": "reseller.subscriptions.get", + "path": "customers/{customerId}/subscriptions/{subscriptionId}", + "httpMethod": "GET", + "description": "Gets a subscription of the customer.", + "parameters": { + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + }, + "subscriptionId": { + "type": "string", + "description": "Id of the subscription, which is unique for a customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "subscriptionId" + ], + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order", + "https://www.googleapis.com/auth/apps.order.readonly" + ] + }, + "insert": { + "id": "reseller.subscriptions.insert", + "path": "customers/{customerId}/subscriptions", + "httpMethod": "POST", + "description": "Creates/Transfers a subscription for the customer.", + "parameters": { + "customerAuthToken": { + "type": "string", + "description": "An auth token needed for transferring a subscription. Can be generated at https://www.google.com/a/cpanel/customer-domain/TransferToken. Optional.", + "location": "query" + }, + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId" + ], + "request": { + "$ref": "Subscription" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order" + ] + }, + "list": { + "id": "reseller.subscriptions.list", + "path": "subscriptions", + "httpMethod": "GET", + "description": "Lists subscriptions of a reseller, optionally filtered by a customer name prefix.", + "parameters": { + "customerAuthToken": { + "type": "string", + "description": "An auth token needed if the customer is not a resold customer of this reseller. Can be generated at https://www.google.com/a/cpanel/customer-domain/TransferToken.Optional.", + "location": "query" + }, + "customerId": { + "type": "string", + "description": "Id of the Customer", + "location": "query" + }, + "customerNamePrefix": { + "type": "string", + "description": "Prefix of the customer's domain name by which the subscriptions should be filtered. Optional", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token to specify next page in the list", + "location": "query" + } + }, + "response": { + "$ref": "Subscriptions" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order", + "https://www.googleapis.com/auth/apps.order.readonly" + ] + }, + "startPaidService": { + "id": "reseller.subscriptions.startPaidService", + "path": "customers/{customerId}/subscriptions/{subscriptionId}/startPaidService", + "httpMethod": "POST", + "description": "Starts paid service of a trial subscription", + "parameters": { + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + }, + "subscriptionId": { + "type": "string", + "description": "Id of the subscription, which is unique for a customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "subscriptionId" + ], + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/reseller/v1/reseller-gen.go b/third_party/src/code.google.com/p/google-api-go-client/reseller/v1/reseller-gen.go new file mode 100644 index 0000000000000..8ce4fd1b7a564 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/reseller/v1/reseller-gen.go @@ -0,0 +1,1288 @@ +// Package reseller provides access to the Enterprise Apps Reseller API. +// +// See https://developers.google.com/google-apps/reseller/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/reseller/v1" +// ... +// resellerService, err := reseller.New(oauthHttpClient) +package reseller + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "reseller:v1" +const apiName = "reseller" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/apps/reseller/v1/" + +// OAuth2 scopes used by this API. +const ( + // Manage users on your domain + AppsOrderScope = "https://www.googleapis.com/auth/apps.order" + + // Manage users on your domain + AppsOrderReadonlyScope = "https://www.googleapis.com/auth/apps.order.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.Customers = NewCustomersService(s) + s.Subscriptions = NewSubscriptionsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Customers *CustomersService + + Subscriptions *SubscriptionsService +} + +func NewCustomersService(s *Service) *CustomersService { + rs := &CustomersService{s: s} + return rs +} + +type CustomersService struct { + s *Service +} + +func NewSubscriptionsService(s *Service) *SubscriptionsService { + rs := &SubscriptionsService{s: s} + return rs +} + +type SubscriptionsService struct { + s *Service +} + +type Address struct { + // AddressLine1: Address line 1 of the address. + AddressLine1 string `json:"addressLine1,omitempty"` + + // AddressLine2: Address line 2 of the address. + AddressLine2 string `json:"addressLine2,omitempty"` + + // AddressLine3: Address line 3 of the address. + AddressLine3 string `json:"addressLine3,omitempty"` + + // ContactName: Name of the contact person. + ContactName string `json:"contactName,omitempty"` + + // CountryCode: ISO 3166 country code. + CountryCode string `json:"countryCode,omitempty"` + + // Kind: Identifies the resource as a customer address. + Kind string `json:"kind,omitempty"` + + // Locality: Name of the locality. This is in accordance with - + // http://portablecontacts.net/draft-spec.html#address_element. + Locality string `json:"locality,omitempty"` + + // OrganizationName: Name of the organization. + OrganizationName string `json:"organizationName,omitempty"` + + // PostalCode: The postal code. This is in accordance with - + // http://portablecontacts.net/draft-spec.html#address_element. + PostalCode string `json:"postalCode,omitempty"` + + // Region: Name of the region. This is in accordance with - + // http://portablecontacts.net/draft-spec.html#address_element. + Region string `json:"region,omitempty"` +} + +type ChangePlanRequest struct { + // Kind: Identifies the resource as a subscription change plan request. + Kind string `json:"kind,omitempty"` + + // PlanName: Name of the plan to change to. + PlanName string `json:"planName,omitempty"` + + // PurchaseOrderId: Purchase order id for your order tracking purposes. + PurchaseOrderId string `json:"purchaseOrderId,omitempty"` + + // Seats: Number/Limit of seats in the new plan. + Seats *Seats `json:"seats,omitempty"` +} + +type Customer struct { + // AlternateEmail: The alternate email of the customer. + AlternateEmail string `json:"alternateEmail,omitempty"` + + // CustomerDomain: The domain name of the customer. + CustomerDomain string `json:"customerDomain,omitempty"` + + // CustomerId: The id of the customer. + CustomerId string `json:"customerId,omitempty"` + + // Kind: Identifies the resource as a customer. + Kind string `json:"kind,omitempty"` + + // PhoneNumber: The phone number of the customer. + PhoneNumber string `json:"phoneNumber,omitempty"` + + // PostalAddress: The postal address of the customer. + PostalAddress *Address `json:"postalAddress,omitempty"` + + // ResourceUiUrl: Ui url for customer resource. + ResourceUiUrl string `json:"resourceUiUrl,omitempty"` +} + +type RenewalSettings struct { + // Kind: Identifies the resource as a subscription renewal setting. + Kind string `json:"kind,omitempty"` + + // RenewalType: Subscription renewal type. + RenewalType string `json:"renewalType,omitempty"` +} + +type Seats struct { + // Kind: Identifies the resource as a subscription change plan request. + Kind string `json:"kind,omitempty"` + + // MaximumNumberOfSeats: Maximum number of seats that can be purchased. + // This needs to be provided only for a non-commitment plan. For a + // commitment plan it is decided by the contract. + MaximumNumberOfSeats int64 `json:"maximumNumberOfSeats,omitempty"` + + // NumberOfSeats: Number of seats to purchase. This is applicable only + // for a commitment plan. + NumberOfSeats int64 `json:"numberOfSeats,omitempty"` +} + +type Subscription struct { + // CreationTime: Creation time of this subscription in milliseconds + // since Unix epoch. + CreationTime int64 `json:"creationTime,omitempty,string"` + + // CustomerId: The id of the customer to whom the subscription belongs. + CustomerId string `json:"customerId,omitempty"` + + // Kind: Identifies the resource as a Subscription. + Kind string `json:"kind,omitempty"` + + // Plan: Plan details of the subscription + Plan *SubscriptionPlan `json:"plan,omitempty"` + + // PurchaseOrderId: Purchase order id for your order tracking purposes. + PurchaseOrderId string `json:"purchaseOrderId,omitempty"` + + // RenewalSettings: Renewal settings of the subscription. + RenewalSettings *RenewalSettings `json:"renewalSettings,omitempty"` + + // ResourceUiUrl: Ui url for subscription resource. + ResourceUiUrl string `json:"resourceUiUrl,omitempty"` + + // Seats: Number/Limit of seats in the new plan. + Seats *Seats `json:"seats,omitempty"` + + // SkuId: Name of the sku for which this subscription is purchased. + SkuId string `json:"skuId,omitempty"` + + // Status: Status of the subscription. + Status string `json:"status,omitempty"` + + // SubscriptionId: The id of the subscription. + SubscriptionId string `json:"subscriptionId,omitempty"` + + // TransferInfo: Transfer related information for the subscription. + TransferInfo *SubscriptionTransferInfo `json:"transferInfo,omitempty"` + + // TrialSettings: Trial Settings of the subscription. + TrialSettings *SubscriptionTrialSettings `json:"trialSettings,omitempty"` +} + +type SubscriptionPlan struct { + // CommitmentInterval: Interval of the commitment if it is a commitment + // plan. + CommitmentInterval *SubscriptionPlanCommitmentInterval `json:"commitmentInterval,omitempty"` + + // IsCommitmentPlan: Whether the plan is a commitment plan or not. + IsCommitmentPlan bool `json:"isCommitmentPlan,omitempty"` + + // PlanName: The plan name of this subscription's plan. + PlanName string `json:"planName,omitempty"` +} + +type SubscriptionPlanCommitmentInterval struct { + // EndTime: End time of the commitment interval in milliseconds since + // Unix epoch. + EndTime int64 `json:"endTime,omitempty,string"` + + // StartTime: Start time of the commitment interval in milliseconds + // since Unix epoch. + StartTime int64 `json:"startTime,omitempty,string"` +} + +type SubscriptionTransferInfo struct { + MinimumTransferableSeats int64 `json:"minimumTransferableSeats,omitempty"` + + // TransferabilityExpirationTime: Time when transfer token or intent to + // transfer will expire. + TransferabilityExpirationTime int64 `json:"transferabilityExpirationTime,omitempty,string"` +} + +type SubscriptionTrialSettings struct { + // IsInTrial: Whether the subscription is in trial. + IsInTrial bool `json:"isInTrial,omitempty"` + + // TrialEndTime: End time of the trial in milliseconds since Unix epoch. + TrialEndTime int64 `json:"trialEndTime,omitempty,string"` +} + +type Subscriptions struct { + // Kind: Identifies the resource as a collection of subscriptions. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The continuation token, used to page through large + // result sets. Provide this value in a subsequent request to return the + // next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Subscriptions: The subscriptions in this page of results. + Subscriptions []*Subscription `json:"subscriptions,omitempty"` +} + +// method id "reseller.customers.get": + +type CustomersGetCall struct { + s *Service + customerId string + opt_ map[string]interface{} +} + +// Get: Gets a customer resource if one exists and is owned by the +// reseller. +func (r *CustomersService) Get(customerId string) *CustomersGetCall { + c := &CustomersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + return c +} + +func (c *CustomersGetCall) Do() (*Customer, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Customer) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a customer resource if one exists and is owned by the reseller.", + // "httpMethod": "GET", + // "id": "reseller.customers.get", + // "parameterOrder": [ + // "customerId" + // ], + // "parameters": { + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}", + // "response": { + // "$ref": "Customer" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order", + // "https://www.googleapis.com/auth/apps.order.readonly" + // ] + // } + +} + +// method id "reseller.customers.insert": + +type CustomersInsertCall struct { + s *Service + customer *Customer + opt_ map[string]interface{} +} + +// Insert: Creates a customer resource if one does not already exist. +func (r *CustomersService) Insert(customer *Customer) *CustomersInsertCall { + c := &CustomersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + return c +} + +// CustomerAuthToken sets the optional parameter "customerAuthToken": An +// auth token needed for inserting a customer for which domain already +// exists. Can be generated at +// https://www.google.com/a/cpanel//TransferToken. +func (c *CustomersInsertCall) CustomerAuthToken(customerAuthToken string) *CustomersInsertCall { + c.opt_["customerAuthToken"] = customerAuthToken + return c +} + +func (c *CustomersInsertCall) Do() (*Customer, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["customerAuthToken"]; ok { + params.Set("customerAuthToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Customer) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a customer resource if one does not already exist.", + // "httpMethod": "POST", + // "id": "reseller.customers.insert", + // "parameters": { + // "customerAuthToken": { + // "description": "An auth token needed for inserting a customer for which domain already exists. Can be generated at https://www.google.com/a/cpanel//TransferToken. Optional.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "customers", + // "request": { + // "$ref": "Customer" + // }, + // "response": { + // "$ref": "Customer" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} + +// method id "reseller.customers.patch": + +type CustomersPatchCall struct { + s *Service + customerId string + customer *Customer + opt_ map[string]interface{} +} + +// Patch: Update a customer resource if one it exists and is owned by +// the reseller. This method supports patch semantics. +func (r *CustomersService) Patch(customerId string, customer *Customer) *CustomersPatchCall { + c := &CustomersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.customer = customer + return c +} + +func (c *CustomersPatchCall) Do() (*Customer, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Customer) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a customer resource if one it exists and is owned by the reseller. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "reseller.customers.patch", + // "parameterOrder": [ + // "customerId" + // ], + // "parameters": { + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}", + // "request": { + // "$ref": "Customer" + // }, + // "response": { + // "$ref": "Customer" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} + +// method id "reseller.customers.update": + +type CustomersUpdateCall struct { + s *Service + customerId string + customer *Customer + opt_ map[string]interface{} +} + +// Update: Update a customer resource if one it exists and is owned by +// the reseller. +func (r *CustomersService) Update(customerId string, customer *Customer) *CustomersUpdateCall { + c := &CustomersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.customer = customer + return c +} + +func (c *CustomersUpdateCall) Do() (*Customer, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Customer) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a customer resource if one it exists and is owned by the reseller.", + // "httpMethod": "PUT", + // "id": "reseller.customers.update", + // "parameterOrder": [ + // "customerId" + // ], + // "parameters": { + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}", + // "request": { + // "$ref": "Customer" + // }, + // "response": { + // "$ref": "Customer" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} + +// method id "reseller.subscriptions.changePlan": + +type SubscriptionsChangePlanCall struct { + s *Service + customerId string + subscriptionId string + changeplanrequest *ChangePlanRequest + opt_ map[string]interface{} +} + +// ChangePlan: Changes the plan of a subscription +func (r *SubscriptionsService) ChangePlan(customerId string, subscriptionId string, changeplanrequest *ChangePlanRequest) *SubscriptionsChangePlanCall { + c := &SubscriptionsChangePlanCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.subscriptionId = subscriptionId + c.changeplanrequest = changeplanrequest + return c +} + +func (c *SubscriptionsChangePlanCall) Do() (*Subscription, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.changeplanrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/changePlan") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{subscriptionId}", url.QueryEscape(c.subscriptionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Subscription) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Changes the plan of a subscription", + // "httpMethod": "POST", + // "id": "reseller.subscriptions.changePlan", + // "parameterOrder": [ + // "customerId", + // "subscriptionId" + // ], + // "parameters": { + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "subscriptionId": { + // "description": "Id of the subscription, which is unique for a customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}/subscriptions/{subscriptionId}/changePlan", + // "request": { + // "$ref": "ChangePlanRequest" + // }, + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} + +// method id "reseller.subscriptions.changeRenewalSettings": + +type SubscriptionsChangeRenewalSettingsCall struct { + s *Service + customerId string + subscriptionId string + renewalsettings *RenewalSettings + opt_ map[string]interface{} +} + +// ChangeRenewalSettings: Changes the renewal settings of a subscription +func (r *SubscriptionsService) ChangeRenewalSettings(customerId string, subscriptionId string, renewalsettings *RenewalSettings) *SubscriptionsChangeRenewalSettingsCall { + c := &SubscriptionsChangeRenewalSettingsCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.subscriptionId = subscriptionId + c.renewalsettings = renewalsettings + return c +} + +func (c *SubscriptionsChangeRenewalSettingsCall) Do() (*Subscription, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.renewalsettings) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/changeRenewalSettings") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{subscriptionId}", url.QueryEscape(c.subscriptionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Subscription) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Changes the renewal settings of a subscription", + // "httpMethod": "POST", + // "id": "reseller.subscriptions.changeRenewalSettings", + // "parameterOrder": [ + // "customerId", + // "subscriptionId" + // ], + // "parameters": { + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "subscriptionId": { + // "description": "Id of the subscription, which is unique for a customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}/subscriptions/{subscriptionId}/changeRenewalSettings", + // "request": { + // "$ref": "RenewalSettings" + // }, + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} + +// method id "reseller.subscriptions.changeSeats": + +type SubscriptionsChangeSeatsCall struct { + s *Service + customerId string + subscriptionId string + seats *Seats + opt_ map[string]interface{} +} + +// ChangeSeats: Changes the seats configuration of a subscription +func (r *SubscriptionsService) ChangeSeats(customerId string, subscriptionId string, seats *Seats) *SubscriptionsChangeSeatsCall { + c := &SubscriptionsChangeSeatsCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.subscriptionId = subscriptionId + c.seats = seats + return c +} + +func (c *SubscriptionsChangeSeatsCall) Do() (*Subscription, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.seats) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/changeSeats") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{subscriptionId}", url.QueryEscape(c.subscriptionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Subscription) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Changes the seats configuration of a subscription", + // "httpMethod": "POST", + // "id": "reseller.subscriptions.changeSeats", + // "parameterOrder": [ + // "customerId", + // "subscriptionId" + // ], + // "parameters": { + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "subscriptionId": { + // "description": "Id of the subscription, which is unique for a customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}/subscriptions/{subscriptionId}/changeSeats", + // "request": { + // "$ref": "Seats" + // }, + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} + +// method id "reseller.subscriptions.delete": + +type SubscriptionsDeleteCall struct { + s *Service + customerId string + subscriptionId string + deletionType string + opt_ map[string]interface{} +} + +// Delete: Cancels/Downgrades a subscription. +func (r *SubscriptionsService) Delete(customerId string, subscriptionId string, deletionType string) *SubscriptionsDeleteCall { + c := &SubscriptionsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.subscriptionId = subscriptionId + c.deletionType = deletionType + return c +} + +func (c *SubscriptionsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("deletionType", fmt.Sprintf("%v", c.deletionType)) + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{subscriptionId}", url.QueryEscape(c.subscriptionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Cancels/Downgrades a subscription.", + // "httpMethod": "DELETE", + // "id": "reseller.subscriptions.delete", + // "parameterOrder": [ + // "customerId", + // "subscriptionId", + // "deletionType" + // ], + // "parameters": { + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "deletionType": { + // "description": "Whether the subscription is to be fully cancelled or downgraded", + // "enum": [ + // "cancel", + // "downgrade", + // "suspend" + // ], + // "enumDescriptions": [ + // "Cancels the subscription immediately", + // "Downgrades a Google Apps for Business subscription to Google Apps", + // "Suspends the subscriptions for 4 days before cancelling it" + // ], + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "subscriptionId": { + // "description": "Id of the subscription, which is unique for a customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}/subscriptions/{subscriptionId}", + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} + +// method id "reseller.subscriptions.get": + +type SubscriptionsGetCall struct { + s *Service + customerId string + subscriptionId string + opt_ map[string]interface{} +} + +// Get: Gets a subscription of the customer. +func (r *SubscriptionsService) Get(customerId string, subscriptionId string) *SubscriptionsGetCall { + c := &SubscriptionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.subscriptionId = subscriptionId + return c +} + +func (c *SubscriptionsGetCall) Do() (*Subscription, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{subscriptionId}", url.QueryEscape(c.subscriptionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Subscription) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a subscription of the customer.", + // "httpMethod": "GET", + // "id": "reseller.subscriptions.get", + // "parameterOrder": [ + // "customerId", + // "subscriptionId" + // ], + // "parameters": { + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "subscriptionId": { + // "description": "Id of the subscription, which is unique for a customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}/subscriptions/{subscriptionId}", + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order", + // "https://www.googleapis.com/auth/apps.order.readonly" + // ] + // } + +} + +// method id "reseller.subscriptions.insert": + +type SubscriptionsInsertCall struct { + s *Service + customerId string + subscription *Subscription + opt_ map[string]interface{} +} + +// Insert: Creates/Transfers a subscription for the customer. +func (r *SubscriptionsService) Insert(customerId string, subscription *Subscription) *SubscriptionsInsertCall { + c := &SubscriptionsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.subscription = subscription + return c +} + +// CustomerAuthToken sets the optional parameter "customerAuthToken": An +// auth token needed for transferring a subscription. Can be generated +// at https://www.google.com/a/cpanel/customer-domain/TransferToken. +func (c *SubscriptionsInsertCall) CustomerAuthToken(customerAuthToken string) *SubscriptionsInsertCall { + c.opt_["customerAuthToken"] = customerAuthToken + return c +} + +func (c *SubscriptionsInsertCall) Do() (*Subscription, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["customerAuthToken"]; ok { + params.Set("customerAuthToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Subscription) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates/Transfers a subscription for the customer.", + // "httpMethod": "POST", + // "id": "reseller.subscriptions.insert", + // "parameterOrder": [ + // "customerId" + // ], + // "parameters": { + // "customerAuthToken": { + // "description": "An auth token needed for transferring a subscription. Can be generated at https://www.google.com/a/cpanel/customer-domain/TransferToken. Optional.", + // "location": "query", + // "type": "string" + // }, + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}/subscriptions", + // "request": { + // "$ref": "Subscription" + // }, + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} + +// method id "reseller.subscriptions.list": + +type SubscriptionsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Lists subscriptions of a reseller, optionally filtered by a +// customer name prefix. +func (r *SubscriptionsService) List() *SubscriptionsListCall { + c := &SubscriptionsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// CustomerAuthToken sets the optional parameter "customerAuthToken": An +// auth token needed if the customer is not a resold customer of this +// reseller. Can be generated at +// https://www.google.com/a/cpanel/customer-domain/TransferToken. +func (c *SubscriptionsListCall) CustomerAuthToken(customerAuthToken string) *SubscriptionsListCall { + c.opt_["customerAuthToken"] = customerAuthToken + return c +} + +// CustomerId sets the optional parameter "customerId": Id of the +// Customer +func (c *SubscriptionsListCall) CustomerId(customerId string) *SubscriptionsListCall { + c.opt_["customerId"] = customerId + return c +} + +// CustomerNamePrefix sets the optional parameter "customerNamePrefix": +// Prefix of the customer's domain name by which the subscriptions +// should be filtered. Optional +func (c *SubscriptionsListCall) CustomerNamePrefix(customerNamePrefix string) *SubscriptionsListCall { + c.opt_["customerNamePrefix"] = customerNamePrefix + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return +func (c *SubscriptionsListCall) MaxResults(maxResults int64) *SubscriptionsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Token to specify +// next page in the list +func (c *SubscriptionsListCall) PageToken(pageToken string) *SubscriptionsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *SubscriptionsListCall) Do() (*Subscriptions, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["customerAuthToken"]; ok { + params.Set("customerAuthToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["customerId"]; ok { + params.Set("customerId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["customerNamePrefix"]; ok { + params.Set("customerNamePrefix", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Subscriptions) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists subscriptions of a reseller, optionally filtered by a customer name prefix.", + // "httpMethod": "GET", + // "id": "reseller.subscriptions.list", + // "parameters": { + // "customerAuthToken": { + // "description": "An auth token needed if the customer is not a resold customer of this reseller. Can be generated at https://www.google.com/a/cpanel/customer-domain/TransferToken.Optional.", + // "location": "query", + // "type": "string" + // }, + // "customerId": { + // "description": "Id of the Customer", + // "location": "query", + // "type": "string" + // }, + // "customerNamePrefix": { + // "description": "Prefix of the customer's domain name by which the subscriptions should be filtered. Optional", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Token to specify next page in the list", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "subscriptions", + // "response": { + // "$ref": "Subscriptions" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order", + // "https://www.googleapis.com/auth/apps.order.readonly" + // ] + // } + +} + +// method id "reseller.subscriptions.startPaidService": + +type SubscriptionsStartPaidServiceCall struct { + s *Service + customerId string + subscriptionId string + opt_ map[string]interface{} +} + +// StartPaidService: Starts paid service of a trial subscription +func (r *SubscriptionsService) StartPaidService(customerId string, subscriptionId string) *SubscriptionsStartPaidServiceCall { + c := &SubscriptionsStartPaidServiceCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.subscriptionId = subscriptionId + return c +} + +func (c *SubscriptionsStartPaidServiceCall) Do() (*Subscription, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/startPaidService") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{subscriptionId}", url.QueryEscape(c.subscriptionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Subscription) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Starts paid service of a trial subscription", + // "httpMethod": "POST", + // "id": "reseller.subscriptions.startPaidService", + // "parameterOrder": [ + // "customerId", + // "subscriptionId" + // ], + // "parameters": { + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "subscriptionId": { + // "description": "Id of the subscription, which is unique for a customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}/subscriptions/{subscriptionId}/startPaidService", + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/reseller/v1sandbox/reseller-api.json b/third_party/src/code.google.com/p/google-api-go-client/reseller/v1sandbox/reseller-api.json new file mode 100644 index 0000000000000..29d71cbee5ca7 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/reseller/v1sandbox/reseller-api.json @@ -0,0 +1,749 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/lCOFlgVtGlgupSVNF85eEEfwphE\"", + "discoveryVersion": "v1", + "id": "reseller:v1sandbox", + "name": "reseller", + "version": "v1sandbox", + "title": "Enterprise Apps Reseller API", + "description": "Lets you create and manage your customers and their subscriptions.", + "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/reseller/", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/apps/reseller/v1sandbox/", + "basePath": "/apps/reseller/v1sandbox/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "apps/reseller/v1sandbox/", + "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/apps.order": { + "description": "Manage users on your domain" + }, + "https://www.googleapis.com/auth/apps.order.readonly": { + "description": "Manage users on your domain" + } + } + } + }, + "schemas": { + "Address": { + "id": "Address", + "type": "object", + "description": "JSON template for address of a customer.", + "properties": { + "addressLine1": { + "type": "string", + "description": "Address line 1 of the address." + }, + "addressLine2": { + "type": "string", + "description": "Address line 2 of the address." + }, + "addressLine3": { + "type": "string", + "description": "Address line 3 of the address." + }, + "contactName": { + "type": "string", + "description": "Name of the contact person." + }, + "countryCode": { + "type": "string", + "description": "ISO 3166 country code." + }, + "kind": { + "type": "string", + "description": "Identifies the resource as a customer address.", + "default": "customers#address" + }, + "locality": { + "type": "string", + "description": "Name of the locality. This is in accordance with - http://portablecontacts.net/draft-spec.html#address_element." + }, + "organizationName": { + "type": "string", + "description": "Name of the organization." + }, + "postalCode": { + "type": "string", + "description": "The postal code. This is in accordance with - http://portablecontacts.net/draft-spec.html#address_element." + }, + "region": { + "type": "string", + "description": "Name of the region. This is in accordance with - http://portablecontacts.net/draft-spec.html#address_element." + } + } + }, + "ChangePlanRequest": { + "id": "ChangePlanRequest", + "type": "object", + "description": "JSON template for the ChangePlan rpc request.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies the resource as a subscription change plan request.", + "default": "subscriptions#changePlanRequest" + }, + "planName": { + "type": "string", + "description": "Name of the plan to change to." + }, + "purchaseOrderId": { + "type": "string", + "description": "Purchase order id for your order tracking purposes." + }, + "seats": { + "$ref": "Seats", + "description": "Number/Limit of seats in the new plan." + } + } + }, + "Customer": { + "id": "Customer", + "type": "object", + "description": "JSON template for a customer.", + "properties": { + "alternateEmail": { + "type": "string", + "description": "The alternate email of the customer." + }, + "customerDomain": { + "type": "string", + "description": "The domain name of the customer." + }, + "customerId": { + "type": "string", + "description": "The id of the customer." + }, + "kind": { + "type": "string", + "description": "Identifies the resource as a customer.", + "default": "reseller#customer" + }, + "phoneNumber": { + "type": "string", + "description": "The phone number of the customer." + }, + "postalAddress": { + "$ref": "Address", + "description": "The postal address of the customer." + }, + "resourceUiUrl": { + "type": "string", + "description": "Ui url for customer resource." + } + } + }, + "RenewalSettings": { + "id": "RenewalSettings", + "type": "object", + "description": "JSON template for a subscription renewal settings.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies the resource as a subscription renewal setting.", + "default": "subscriptions#renewalSettings" + }, + "renewalType": { + "type": "string", + "description": "Subscription renewal type." + } + } + }, + "Seats": { + "id": "Seats", + "type": "object", + "description": "JSON template for subscription seats.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies the resource as a subscription change plan request.", + "default": "subscriptions#seats" + }, + "maximumNumberOfSeats": { + "type": "integer", + "description": "Maximum number of seats that can be purchased. This needs to be provided only for a non-commitment plan. For a commitment plan it is decided by the contract.", + "format": "int32" + }, + "numberOfSeats": { + "type": "integer", + "description": "Number of seats to purchase. This is applicable only for a commitment plan.", + "format": "int32" + } + } + }, + "Subscription": { + "id": "Subscription", + "type": "object", + "description": "JSON template for a subscription.", + "properties": { + "creationTime": { + "type": "string", + "description": "Creation time of this subscription in milliseconds since Unix epoch.", + "format": "int64" + }, + "customerId": { + "type": "string", + "description": "The id of the customer to whom the subscription belongs." + }, + "kind": { + "type": "string", + "description": "Identifies the resource as a Subscription.", + "default": "reseller#subscription" + }, + "plan": { + "type": "object", + "description": "Plan details of the subscription", + "properties": { + "commitmentInterval": { + "type": "object", + "description": "Interval of the commitment if it is a commitment plan.", + "properties": { + "endTime": { + "type": "string", + "description": "End time of the commitment interval in milliseconds since Unix epoch.", + "format": "int64" + }, + "startTime": { + "type": "string", + "description": "Start time of the commitment interval in milliseconds since Unix epoch.", + "format": "int64" + } + } + }, + "isCommitmentPlan": { + "type": "boolean", + "description": "Whether the plan is a commitment plan or not." + }, + "planName": { + "type": "string", + "description": "The plan name of this subscription's plan." + } + } + }, + "purchaseOrderId": { + "type": "string", + "description": "Purchase order id for your order tracking purposes." + }, + "renewalSettings": { + "$ref": "RenewalSettings", + "description": "Renewal settings of the subscription." + }, + "resourceUiUrl": { + "type": "string", + "description": "Ui url for subscription resource." + }, + "seats": { + "$ref": "Seats", + "description": "Number/Limit of seats in the new plan." + }, + "skuId": { + "type": "string", + "description": "Name of the sku for which this subscription is purchased." + }, + "status": { + "type": "string", + "description": "Status of the subscription." + }, + "subscriptionId": { + "type": "string", + "description": "The id of the subscription." + }, + "transferInfo": { + "type": "object", + "description": "Transfer related information for the subscription.", + "properties": { + "minimumTransferableSeats": { + "type": "integer", + "format": "int32" + }, + "transferabilityExpirationTime": { + "type": "string", + "description": "Time when transfer token or intent to transfer will expire.", + "format": "int64" + } + } + }, + "trialSettings": { + "type": "object", + "description": "Trial Settings of the subscription.", + "properties": { + "isInTrial": { + "type": "boolean", + "description": "Whether the subscription is in trial." + }, + "trialEndTime": { + "type": "string", + "description": "End time of the trial in milliseconds since Unix epoch.", + "format": "int64" + } + } + } + } + }, + "Subscriptions": { + "id": "Subscriptions", + "type": "object", + "description": "JSON template for a subscription list.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies the resource as a collection of subscriptions.", + "default": "reseller#subscriptions" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "subscriptions": { + "type": "array", + "description": "The subscriptions in this page of results.", + "items": { + "$ref": "Subscription" + } + } + } + } + }, + "resources": { + "customers": { + "methods": { + "get": { + "id": "reseller.customers.get", + "path": "customers/{customerId}", + "httpMethod": "GET", + "description": "Gets a customer resource if one exists and is owned by the reseller.", + "parameters": { + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId" + ], + "response": { + "$ref": "Customer" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order", + "https://www.googleapis.com/auth/apps.order.readonly" + ] + }, + "insert": { + "id": "reseller.customers.insert", + "path": "customers", + "httpMethod": "POST", + "description": "Creates a customer resource if one does not already exist.", + "parameters": { + "customerAuthToken": { + "type": "string", + "description": "An auth token needed for inserting a customer for which domain already exists. Can be generated at https://www.google.com/a/cpanel//TransferToken. Optional.", + "location": "query" + } + }, + "request": { + "$ref": "Customer" + }, + "response": { + "$ref": "Customer" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order" + ] + }, + "patch": { + "id": "reseller.customers.patch", + "path": "customers/{customerId}", + "httpMethod": "PATCH", + "description": "Update a customer resource if one it exists and is owned by the reseller. This method supports patch semantics.", + "parameters": { + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId" + ], + "request": { + "$ref": "Customer" + }, + "response": { + "$ref": "Customer" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order" + ] + }, + "update": { + "id": "reseller.customers.update", + "path": "customers/{customerId}", + "httpMethod": "PUT", + "description": "Update a customer resource if one it exists and is owned by the reseller.", + "parameters": { + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId" + ], + "request": { + "$ref": "Customer" + }, + "response": { + "$ref": "Customer" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order" + ] + } + } + }, + "subscriptions": { + "methods": { + "changePlan": { + "id": "reseller.subscriptions.changePlan", + "path": "customers/{customerId}/subscriptions/{subscriptionId}/changePlan", + "httpMethod": "POST", + "description": "Changes the plan of a subscription", + "parameters": { + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + }, + "subscriptionId": { + "type": "string", + "description": "Id of the subscription, which is unique for a customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "subscriptionId" + ], + "request": { + "$ref": "ChangePlanRequest" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order" + ] + }, + "changeRenewalSettings": { + "id": "reseller.subscriptions.changeRenewalSettings", + "path": "customers/{customerId}/subscriptions/{subscriptionId}/changeRenewalSettings", + "httpMethod": "POST", + "description": "Changes the renewal settings of a subscription", + "parameters": { + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + }, + "subscriptionId": { + "type": "string", + "description": "Id of the subscription, which is unique for a customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "subscriptionId" + ], + "request": { + "$ref": "RenewalSettings" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order" + ] + }, + "changeSeats": { + "id": "reseller.subscriptions.changeSeats", + "path": "customers/{customerId}/subscriptions/{subscriptionId}/changeSeats", + "httpMethod": "POST", + "description": "Changes the seats configuration of a subscription", + "parameters": { + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + }, + "subscriptionId": { + "type": "string", + "description": "Id of the subscription, which is unique for a customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "subscriptionId" + ], + "request": { + "$ref": "Seats" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order" + ] + }, + "delete": { + "id": "reseller.subscriptions.delete", + "path": "customers/{customerId}/subscriptions/{subscriptionId}", + "httpMethod": "DELETE", + "description": "Cancels/Downgrades a subscription.", + "parameters": { + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + }, + "deletionType": { + "type": "string", + "description": "Whether the subscription is to be fully cancelled or downgraded", + "required": true, + "enum": [ + "cancel", + "downgrade", + "suspend" + ], + "enumDescriptions": [ + "Cancels the subscription immediately", + "Downgrades a Google Apps for Business subscription to Google Apps", + "Suspends the subscriptions for 4 days before cancelling it" + ], + "location": "query" + }, + "subscriptionId": { + "type": "string", + "description": "Id of the subscription, which is unique for a customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "subscriptionId", + "deletionType" + ], + "scopes": [ + "https://www.googleapis.com/auth/apps.order" + ] + }, + "get": { + "id": "reseller.subscriptions.get", + "path": "customers/{customerId}/subscriptions/{subscriptionId}", + "httpMethod": "GET", + "description": "Gets a subscription of the customer.", + "parameters": { + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + }, + "subscriptionId": { + "type": "string", + "description": "Id of the subscription, which is unique for a customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "subscriptionId" + ], + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order", + "https://www.googleapis.com/auth/apps.order.readonly" + ] + }, + "insert": { + "id": "reseller.subscriptions.insert", + "path": "customers/{customerId}/subscriptions", + "httpMethod": "POST", + "description": "Creates/Transfers a subscription for the customer.", + "parameters": { + "customerAuthToken": { + "type": "string", + "description": "An auth token needed for transferring a subscription. Can be generated at https://www.google.com/a/cpanel/customer-domain/TransferToken. Optional.", + "location": "query" + }, + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId" + ], + "request": { + "$ref": "Subscription" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order" + ] + }, + "list": { + "id": "reseller.subscriptions.list", + "path": "subscriptions", + "httpMethod": "GET", + "description": "Lists subscriptions of a reseller, optionally filtered by a customer name prefix.", + "parameters": { + "customerAuthToken": { + "type": "string", + "description": "An auth token needed if the customer is not a resold customer of this reseller. Can be generated at https://www.google.com/a/cpanel/customer-domain/TransferToken.Optional.", + "location": "query" + }, + "customerId": { + "type": "string", + "description": "Id of the Customer", + "location": "query" + }, + "customerNamePrefix": { + "type": "string", + "description": "Prefix of the customer's domain name by which the subscriptions should be filtered. Optional", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token to specify next page in the list", + "location": "query" + } + }, + "response": { + "$ref": "Subscriptions" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order", + "https://www.googleapis.com/auth/apps.order.readonly" + ] + }, + "startPaidService": { + "id": "reseller.subscriptions.startPaidService", + "path": "customers/{customerId}/subscriptions/{subscriptionId}/startPaidService", + "httpMethod": "POST", + "description": "Starts paid service of a trial subscription", + "parameters": { + "customerId": { + "type": "string", + "description": "Id of the Customer", + "required": true, + "location": "path" + }, + "subscriptionId": { + "type": "string", + "description": "Id of the subscription, which is unique for a customer", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "subscriptionId" + ], + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.order" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/reseller/v1sandbox/reseller-gen.go b/third_party/src/code.google.com/p/google-api-go-client/reseller/v1sandbox/reseller-gen.go new file mode 100644 index 0000000000000..8f4d1ec9db04a --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/reseller/v1sandbox/reseller-gen.go @@ -0,0 +1,1288 @@ +// Package reseller provides access to the Enterprise Apps Reseller API. +// +// See https://developers.google.com/google-apps/reseller/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/reseller/v1sandbox" +// ... +// resellerService, err := reseller.New(oauthHttpClient) +package reseller + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "reseller:v1sandbox" +const apiName = "reseller" +const apiVersion = "v1sandbox" +const basePath = "https://www.googleapis.com/apps/reseller/v1sandbox/" + +// OAuth2 scopes used by this API. +const ( + // Manage users on your domain + AppsOrderScope = "https://www.googleapis.com/auth/apps.order" + + // Manage users on your domain + AppsOrderReadonlyScope = "https://www.googleapis.com/auth/apps.order.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.Customers = NewCustomersService(s) + s.Subscriptions = NewSubscriptionsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Customers *CustomersService + + Subscriptions *SubscriptionsService +} + +func NewCustomersService(s *Service) *CustomersService { + rs := &CustomersService{s: s} + return rs +} + +type CustomersService struct { + s *Service +} + +func NewSubscriptionsService(s *Service) *SubscriptionsService { + rs := &SubscriptionsService{s: s} + return rs +} + +type SubscriptionsService struct { + s *Service +} + +type Address struct { + // AddressLine1: Address line 1 of the address. + AddressLine1 string `json:"addressLine1,omitempty"` + + // AddressLine2: Address line 2 of the address. + AddressLine2 string `json:"addressLine2,omitempty"` + + // AddressLine3: Address line 3 of the address. + AddressLine3 string `json:"addressLine3,omitempty"` + + // ContactName: Name of the contact person. + ContactName string `json:"contactName,omitempty"` + + // CountryCode: ISO 3166 country code. + CountryCode string `json:"countryCode,omitempty"` + + // Kind: Identifies the resource as a customer address. + Kind string `json:"kind,omitempty"` + + // Locality: Name of the locality. This is in accordance with - + // http://portablecontacts.net/draft-spec.html#address_element. + Locality string `json:"locality,omitempty"` + + // OrganizationName: Name of the organization. + OrganizationName string `json:"organizationName,omitempty"` + + // PostalCode: The postal code. This is in accordance with - + // http://portablecontacts.net/draft-spec.html#address_element. + PostalCode string `json:"postalCode,omitempty"` + + // Region: Name of the region. This is in accordance with - + // http://portablecontacts.net/draft-spec.html#address_element. + Region string `json:"region,omitempty"` +} + +type ChangePlanRequest struct { + // Kind: Identifies the resource as a subscription change plan request. + Kind string `json:"kind,omitempty"` + + // PlanName: Name of the plan to change to. + PlanName string `json:"planName,omitempty"` + + // PurchaseOrderId: Purchase order id for your order tracking purposes. + PurchaseOrderId string `json:"purchaseOrderId,omitempty"` + + // Seats: Number/Limit of seats in the new plan. + Seats *Seats `json:"seats,omitempty"` +} + +type Customer struct { + // AlternateEmail: The alternate email of the customer. + AlternateEmail string `json:"alternateEmail,omitempty"` + + // CustomerDomain: The domain name of the customer. + CustomerDomain string `json:"customerDomain,omitempty"` + + // CustomerId: The id of the customer. + CustomerId string `json:"customerId,omitempty"` + + // Kind: Identifies the resource as a customer. + Kind string `json:"kind,omitempty"` + + // PhoneNumber: The phone number of the customer. + PhoneNumber string `json:"phoneNumber,omitempty"` + + // PostalAddress: The postal address of the customer. + PostalAddress *Address `json:"postalAddress,omitempty"` + + // ResourceUiUrl: Ui url for customer resource. + ResourceUiUrl string `json:"resourceUiUrl,omitempty"` +} + +type RenewalSettings struct { + // Kind: Identifies the resource as a subscription renewal setting. + Kind string `json:"kind,omitempty"` + + // RenewalType: Subscription renewal type. + RenewalType string `json:"renewalType,omitempty"` +} + +type Seats struct { + // Kind: Identifies the resource as a subscription change plan request. + Kind string `json:"kind,omitempty"` + + // MaximumNumberOfSeats: Maximum number of seats that can be purchased. + // This needs to be provided only for a non-commitment plan. For a + // commitment plan it is decided by the contract. + MaximumNumberOfSeats int64 `json:"maximumNumberOfSeats,omitempty"` + + // NumberOfSeats: Number of seats to purchase. This is applicable only + // for a commitment plan. + NumberOfSeats int64 `json:"numberOfSeats,omitempty"` +} + +type Subscription struct { + // CreationTime: Creation time of this subscription in milliseconds + // since Unix epoch. + CreationTime int64 `json:"creationTime,omitempty,string"` + + // CustomerId: The id of the customer to whom the subscription belongs. + CustomerId string `json:"customerId,omitempty"` + + // Kind: Identifies the resource as a Subscription. + Kind string `json:"kind,omitempty"` + + // Plan: Plan details of the subscription + Plan *SubscriptionPlan `json:"plan,omitempty"` + + // PurchaseOrderId: Purchase order id for your order tracking purposes. + PurchaseOrderId string `json:"purchaseOrderId,omitempty"` + + // RenewalSettings: Renewal settings of the subscription. + RenewalSettings *RenewalSettings `json:"renewalSettings,omitempty"` + + // ResourceUiUrl: Ui url for subscription resource. + ResourceUiUrl string `json:"resourceUiUrl,omitempty"` + + // Seats: Number/Limit of seats in the new plan. + Seats *Seats `json:"seats,omitempty"` + + // SkuId: Name of the sku for which this subscription is purchased. + SkuId string `json:"skuId,omitempty"` + + // Status: Status of the subscription. + Status string `json:"status,omitempty"` + + // SubscriptionId: The id of the subscription. + SubscriptionId string `json:"subscriptionId,omitempty"` + + // TransferInfo: Transfer related information for the subscription. + TransferInfo *SubscriptionTransferInfo `json:"transferInfo,omitempty"` + + // TrialSettings: Trial Settings of the subscription. + TrialSettings *SubscriptionTrialSettings `json:"trialSettings,omitempty"` +} + +type SubscriptionPlan struct { + // CommitmentInterval: Interval of the commitment if it is a commitment + // plan. + CommitmentInterval *SubscriptionPlanCommitmentInterval `json:"commitmentInterval,omitempty"` + + // IsCommitmentPlan: Whether the plan is a commitment plan or not. + IsCommitmentPlan bool `json:"isCommitmentPlan,omitempty"` + + // PlanName: The plan name of this subscription's plan. + PlanName string `json:"planName,omitempty"` +} + +type SubscriptionPlanCommitmentInterval struct { + // EndTime: End time of the commitment interval in milliseconds since + // Unix epoch. + EndTime int64 `json:"endTime,omitempty,string"` + + // StartTime: Start time of the commitment interval in milliseconds + // since Unix epoch. + StartTime int64 `json:"startTime,omitempty,string"` +} + +type SubscriptionTransferInfo struct { + MinimumTransferableSeats int64 `json:"minimumTransferableSeats,omitempty"` + + // TransferabilityExpirationTime: Time when transfer token or intent to + // transfer will expire. + TransferabilityExpirationTime int64 `json:"transferabilityExpirationTime,omitempty,string"` +} + +type SubscriptionTrialSettings struct { + // IsInTrial: Whether the subscription is in trial. + IsInTrial bool `json:"isInTrial,omitempty"` + + // TrialEndTime: End time of the trial in milliseconds since Unix epoch. + TrialEndTime int64 `json:"trialEndTime,omitempty,string"` +} + +type Subscriptions struct { + // Kind: Identifies the resource as a collection of subscriptions. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The continuation token, used to page through large + // result sets. Provide this value in a subsequent request to return the + // next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Subscriptions: The subscriptions in this page of results. + Subscriptions []*Subscription `json:"subscriptions,omitempty"` +} + +// method id "reseller.customers.get": + +type CustomersGetCall struct { + s *Service + customerId string + opt_ map[string]interface{} +} + +// Get: Gets a customer resource if one exists and is owned by the +// reseller. +func (r *CustomersService) Get(customerId string) *CustomersGetCall { + c := &CustomersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + return c +} + +func (c *CustomersGetCall) Do() (*Customer, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Customer) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a customer resource if one exists and is owned by the reseller.", + // "httpMethod": "GET", + // "id": "reseller.customers.get", + // "parameterOrder": [ + // "customerId" + // ], + // "parameters": { + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}", + // "response": { + // "$ref": "Customer" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order", + // "https://www.googleapis.com/auth/apps.order.readonly" + // ] + // } + +} + +// method id "reseller.customers.insert": + +type CustomersInsertCall struct { + s *Service + customer *Customer + opt_ map[string]interface{} +} + +// Insert: Creates a customer resource if one does not already exist. +func (r *CustomersService) Insert(customer *Customer) *CustomersInsertCall { + c := &CustomersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + return c +} + +// CustomerAuthToken sets the optional parameter "customerAuthToken": An +// auth token needed for inserting a customer for which domain already +// exists. Can be generated at +// https://www.google.com/a/cpanel//TransferToken. +func (c *CustomersInsertCall) CustomerAuthToken(customerAuthToken string) *CustomersInsertCall { + c.opt_["customerAuthToken"] = customerAuthToken + return c +} + +func (c *CustomersInsertCall) Do() (*Customer, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["customerAuthToken"]; ok { + params.Set("customerAuthToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Customer) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a customer resource if one does not already exist.", + // "httpMethod": "POST", + // "id": "reseller.customers.insert", + // "parameters": { + // "customerAuthToken": { + // "description": "An auth token needed for inserting a customer for which domain already exists. Can be generated at https://www.google.com/a/cpanel//TransferToken. Optional.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "customers", + // "request": { + // "$ref": "Customer" + // }, + // "response": { + // "$ref": "Customer" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} + +// method id "reseller.customers.patch": + +type CustomersPatchCall struct { + s *Service + customerId string + customer *Customer + opt_ map[string]interface{} +} + +// Patch: Update a customer resource if one it exists and is owned by +// the reseller. This method supports patch semantics. +func (r *CustomersService) Patch(customerId string, customer *Customer) *CustomersPatchCall { + c := &CustomersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.customer = customer + return c +} + +func (c *CustomersPatchCall) Do() (*Customer, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Customer) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a customer resource if one it exists and is owned by the reseller. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "reseller.customers.patch", + // "parameterOrder": [ + // "customerId" + // ], + // "parameters": { + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}", + // "request": { + // "$ref": "Customer" + // }, + // "response": { + // "$ref": "Customer" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} + +// method id "reseller.customers.update": + +type CustomersUpdateCall struct { + s *Service + customerId string + customer *Customer + opt_ map[string]interface{} +} + +// Update: Update a customer resource if one it exists and is owned by +// the reseller. +func (r *CustomersService) Update(customerId string, customer *Customer) *CustomersUpdateCall { + c := &CustomersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.customer = customer + return c +} + +func (c *CustomersUpdateCall) Do() (*Customer, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Customer) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update a customer resource if one it exists and is owned by the reseller.", + // "httpMethod": "PUT", + // "id": "reseller.customers.update", + // "parameterOrder": [ + // "customerId" + // ], + // "parameters": { + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}", + // "request": { + // "$ref": "Customer" + // }, + // "response": { + // "$ref": "Customer" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} + +// method id "reseller.subscriptions.changePlan": + +type SubscriptionsChangePlanCall struct { + s *Service + customerId string + subscriptionId string + changeplanrequest *ChangePlanRequest + opt_ map[string]interface{} +} + +// ChangePlan: Changes the plan of a subscription +func (r *SubscriptionsService) ChangePlan(customerId string, subscriptionId string, changeplanrequest *ChangePlanRequest) *SubscriptionsChangePlanCall { + c := &SubscriptionsChangePlanCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.subscriptionId = subscriptionId + c.changeplanrequest = changeplanrequest + return c +} + +func (c *SubscriptionsChangePlanCall) Do() (*Subscription, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.changeplanrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/changePlan") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{subscriptionId}", url.QueryEscape(c.subscriptionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Subscription) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Changes the plan of a subscription", + // "httpMethod": "POST", + // "id": "reseller.subscriptions.changePlan", + // "parameterOrder": [ + // "customerId", + // "subscriptionId" + // ], + // "parameters": { + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "subscriptionId": { + // "description": "Id of the subscription, which is unique for a customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}/subscriptions/{subscriptionId}/changePlan", + // "request": { + // "$ref": "ChangePlanRequest" + // }, + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} + +// method id "reseller.subscriptions.changeRenewalSettings": + +type SubscriptionsChangeRenewalSettingsCall struct { + s *Service + customerId string + subscriptionId string + renewalsettings *RenewalSettings + opt_ map[string]interface{} +} + +// ChangeRenewalSettings: Changes the renewal settings of a subscription +func (r *SubscriptionsService) ChangeRenewalSettings(customerId string, subscriptionId string, renewalsettings *RenewalSettings) *SubscriptionsChangeRenewalSettingsCall { + c := &SubscriptionsChangeRenewalSettingsCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.subscriptionId = subscriptionId + c.renewalsettings = renewalsettings + return c +} + +func (c *SubscriptionsChangeRenewalSettingsCall) Do() (*Subscription, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.renewalsettings) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/changeRenewalSettings") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{subscriptionId}", url.QueryEscape(c.subscriptionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Subscription) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Changes the renewal settings of a subscription", + // "httpMethod": "POST", + // "id": "reseller.subscriptions.changeRenewalSettings", + // "parameterOrder": [ + // "customerId", + // "subscriptionId" + // ], + // "parameters": { + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "subscriptionId": { + // "description": "Id of the subscription, which is unique for a customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}/subscriptions/{subscriptionId}/changeRenewalSettings", + // "request": { + // "$ref": "RenewalSettings" + // }, + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} + +// method id "reseller.subscriptions.changeSeats": + +type SubscriptionsChangeSeatsCall struct { + s *Service + customerId string + subscriptionId string + seats *Seats + opt_ map[string]interface{} +} + +// ChangeSeats: Changes the seats configuration of a subscription +func (r *SubscriptionsService) ChangeSeats(customerId string, subscriptionId string, seats *Seats) *SubscriptionsChangeSeatsCall { + c := &SubscriptionsChangeSeatsCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.subscriptionId = subscriptionId + c.seats = seats + return c +} + +func (c *SubscriptionsChangeSeatsCall) Do() (*Subscription, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.seats) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/changeSeats") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{subscriptionId}", url.QueryEscape(c.subscriptionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Subscription) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Changes the seats configuration of a subscription", + // "httpMethod": "POST", + // "id": "reseller.subscriptions.changeSeats", + // "parameterOrder": [ + // "customerId", + // "subscriptionId" + // ], + // "parameters": { + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "subscriptionId": { + // "description": "Id of the subscription, which is unique for a customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}/subscriptions/{subscriptionId}/changeSeats", + // "request": { + // "$ref": "Seats" + // }, + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} + +// method id "reseller.subscriptions.delete": + +type SubscriptionsDeleteCall struct { + s *Service + customerId string + subscriptionId string + deletionType string + opt_ map[string]interface{} +} + +// Delete: Cancels/Downgrades a subscription. +func (r *SubscriptionsService) Delete(customerId string, subscriptionId string, deletionType string) *SubscriptionsDeleteCall { + c := &SubscriptionsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.subscriptionId = subscriptionId + c.deletionType = deletionType + return c +} + +func (c *SubscriptionsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("deletionType", fmt.Sprintf("%v", c.deletionType)) + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{subscriptionId}", url.QueryEscape(c.subscriptionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Cancels/Downgrades a subscription.", + // "httpMethod": "DELETE", + // "id": "reseller.subscriptions.delete", + // "parameterOrder": [ + // "customerId", + // "subscriptionId", + // "deletionType" + // ], + // "parameters": { + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "deletionType": { + // "description": "Whether the subscription is to be fully cancelled or downgraded", + // "enum": [ + // "cancel", + // "downgrade", + // "suspend" + // ], + // "enumDescriptions": [ + // "Cancels the subscription immediately", + // "Downgrades a Google Apps for Business subscription to Google Apps", + // "Suspends the subscriptions for 4 days before cancelling it" + // ], + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "subscriptionId": { + // "description": "Id of the subscription, which is unique for a customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}/subscriptions/{subscriptionId}", + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} + +// method id "reseller.subscriptions.get": + +type SubscriptionsGetCall struct { + s *Service + customerId string + subscriptionId string + opt_ map[string]interface{} +} + +// Get: Gets a subscription of the customer. +func (r *SubscriptionsService) Get(customerId string, subscriptionId string) *SubscriptionsGetCall { + c := &SubscriptionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.subscriptionId = subscriptionId + return c +} + +func (c *SubscriptionsGetCall) Do() (*Subscription, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{subscriptionId}", url.QueryEscape(c.subscriptionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Subscription) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a subscription of the customer.", + // "httpMethod": "GET", + // "id": "reseller.subscriptions.get", + // "parameterOrder": [ + // "customerId", + // "subscriptionId" + // ], + // "parameters": { + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "subscriptionId": { + // "description": "Id of the subscription, which is unique for a customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}/subscriptions/{subscriptionId}", + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order", + // "https://www.googleapis.com/auth/apps.order.readonly" + // ] + // } + +} + +// method id "reseller.subscriptions.insert": + +type SubscriptionsInsertCall struct { + s *Service + customerId string + subscription *Subscription + opt_ map[string]interface{} +} + +// Insert: Creates/Transfers a subscription for the customer. +func (r *SubscriptionsService) Insert(customerId string, subscription *Subscription) *SubscriptionsInsertCall { + c := &SubscriptionsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.subscription = subscription + return c +} + +// CustomerAuthToken sets the optional parameter "customerAuthToken": An +// auth token needed for transferring a subscription. Can be generated +// at https://www.google.com/a/cpanel/customer-domain/TransferToken. +func (c *SubscriptionsInsertCall) CustomerAuthToken(customerAuthToken string) *SubscriptionsInsertCall { + c.opt_["customerAuthToken"] = customerAuthToken + return c +} + +func (c *SubscriptionsInsertCall) Do() (*Subscription, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["customerAuthToken"]; ok { + params.Set("customerAuthToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Subscription) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates/Transfers a subscription for the customer.", + // "httpMethod": "POST", + // "id": "reseller.subscriptions.insert", + // "parameterOrder": [ + // "customerId" + // ], + // "parameters": { + // "customerAuthToken": { + // "description": "An auth token needed for transferring a subscription. Can be generated at https://www.google.com/a/cpanel/customer-domain/TransferToken. Optional.", + // "location": "query", + // "type": "string" + // }, + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}/subscriptions", + // "request": { + // "$ref": "Subscription" + // }, + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} + +// method id "reseller.subscriptions.list": + +type SubscriptionsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Lists subscriptions of a reseller, optionally filtered by a +// customer name prefix. +func (r *SubscriptionsService) List() *SubscriptionsListCall { + c := &SubscriptionsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// CustomerAuthToken sets the optional parameter "customerAuthToken": An +// auth token needed if the customer is not a resold customer of this +// reseller. Can be generated at +// https://www.google.com/a/cpanel/customer-domain/TransferToken. +func (c *SubscriptionsListCall) CustomerAuthToken(customerAuthToken string) *SubscriptionsListCall { + c.opt_["customerAuthToken"] = customerAuthToken + return c +} + +// CustomerId sets the optional parameter "customerId": Id of the +// Customer +func (c *SubscriptionsListCall) CustomerId(customerId string) *SubscriptionsListCall { + c.opt_["customerId"] = customerId + return c +} + +// CustomerNamePrefix sets the optional parameter "customerNamePrefix": +// Prefix of the customer's domain name by which the subscriptions +// should be filtered. Optional +func (c *SubscriptionsListCall) CustomerNamePrefix(customerNamePrefix string) *SubscriptionsListCall { + c.opt_["customerNamePrefix"] = customerNamePrefix + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return +func (c *SubscriptionsListCall) MaxResults(maxResults int64) *SubscriptionsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Token to specify +// next page in the list +func (c *SubscriptionsListCall) PageToken(pageToken string) *SubscriptionsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *SubscriptionsListCall) Do() (*Subscriptions, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["customerAuthToken"]; ok { + params.Set("customerAuthToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["customerId"]; ok { + params.Set("customerId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["customerNamePrefix"]; ok { + params.Set("customerNamePrefix", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Subscriptions) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists subscriptions of a reseller, optionally filtered by a customer name prefix.", + // "httpMethod": "GET", + // "id": "reseller.subscriptions.list", + // "parameters": { + // "customerAuthToken": { + // "description": "An auth token needed if the customer is not a resold customer of this reseller. Can be generated at https://www.google.com/a/cpanel/customer-domain/TransferToken.Optional.", + // "location": "query", + // "type": "string" + // }, + // "customerId": { + // "description": "Id of the Customer", + // "location": "query", + // "type": "string" + // }, + // "customerNamePrefix": { + // "description": "Prefix of the customer's domain name by which the subscriptions should be filtered. Optional", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return", + // "format": "uint32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Token to specify next page in the list", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "subscriptions", + // "response": { + // "$ref": "Subscriptions" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order", + // "https://www.googleapis.com/auth/apps.order.readonly" + // ] + // } + +} + +// method id "reseller.subscriptions.startPaidService": + +type SubscriptionsStartPaidServiceCall struct { + s *Service + customerId string + subscriptionId string + opt_ map[string]interface{} +} + +// StartPaidService: Starts paid service of a trial subscription +func (r *SubscriptionsService) StartPaidService(customerId string, subscriptionId string) *SubscriptionsStartPaidServiceCall { + c := &SubscriptionsStartPaidServiceCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.subscriptionId = subscriptionId + return c +} + +func (c *SubscriptionsStartPaidServiceCall) Do() (*Subscription, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/startPaidService") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{customerId}", url.QueryEscape(c.customerId), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{subscriptionId}", url.QueryEscape(c.subscriptionId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Subscription) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Starts paid service of a trial subscription", + // "httpMethod": "POST", + // "id": "reseller.subscriptions.startPaidService", + // "parameterOrder": [ + // "customerId", + // "subscriptionId" + // ], + // "parameters": { + // "customerId": { + // "description": "Id of the Customer", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "subscriptionId": { + // "description": "Id of the subscription, which is unique for a customer", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerId}/subscriptions/{subscriptionId}/startPaidService", + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/shopping/v1/shopping-api.json b/third_party/src/code.google.com/p/google-api-go-client/shopping/v1/shopping-api.json new file mode 100644 index 0000000000000..96fd064caa270 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/shopping/v1/shopping-api.json @@ -0,0 +1,1141 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"R6H4aXXmd1SZaWpEcGSkC2StmNw/ALLsz63BjCgWbD_pUtK6JxVYi8Y\"", + "discoveryVersion": "v1", + "id": "shopping:v1", + "name": "shopping", + "version": "v1", + "title": "Search API For Shopping", + "description": "Lets you search over product 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://developers.google.com/shopping-search/v1/getting_started", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/shopping/search/v1/", + "basePath": "/shopping/search/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "shopping/search/v1/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "atom", + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/atom+xml", + "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/shoppingapi": { + "description": "View your product data" + } + } + } + }, + "schemas": { + "Product": { + "id": "Product", + "type": "object", + "properties": { + "categories": { + "type": "array", + "description": "List of categories for product.", + "items": { + "$ref": "ShoppingModelCategoryJsonV1" + } + }, + "debug": { + "$ref": "ShoppingModelDebugJsonV1", + "description": "Google internal." + }, + "id": { + "type": "string", + "description": "Id of product." + }, + "kind": { + "type": "string", + "description": "The kind of item, always shopping#product.", + "default": "shopping#product" + }, + "product": { + "$ref": "ShoppingModelProductJsonV1", + "description": "Product." + }, + "recommendations": { + "type": "array", + "description": "Recommendations for product.", + "items": { + "$ref": "ShoppingModelRecommendationsJsonV1" + } + }, + "requestId": { + "type": "string", + "description": "Unique identifier for this request." + }, + "selfLink": { + "type": "string", + "description": "Self link of product when generated for a lookup request. Self link of product when generated for a search request." + } + } + }, + "Products": { + "id": "Products", + "type": "object", + "properties": { + "categories": { + "type": "array", + "description": "List of categories.", + "items": { + "$ref": "ShoppingModelCategoryJsonV1" + } + }, + "categoryRecommendations": { + "type": "array", + "description": "Recommendations for category.", + "items": { + "$ref": "ShoppingModelRecommendationsJsonV1" + } + }, + "currentItemCount": { + "type": "integer", + "description": "Current item count.", + "format": "int32" + }, + "debug": { + "$ref": "ShoppingModelDebugJsonV1", + "description": "Google internal." + }, + "etag": { + "type": "string", + "description": "Etag of feed." + }, + "extras": { + "$ref": "ShoppingModelExtrasJsonV1", + "description": "List of extras." + }, + "facets": { + "type": "array", + "description": "List of facets.", + "items": { + "type": "object", + "properties": { + "buckets": { + "type": "array", + "description": "List of Buckets within facet.", + "items": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "Number of products matching the query that have a value for the facet's property or attribute that matches the bucket.", + "format": "int32" + }, + "max": { + "type": "any", + "description": "Upper bound of the bucket (omitted for value buckets or if the range has no upper bound)." + }, + "maxExclusive": { + "type": "boolean", + "description": "Whether the upper bound of the bucket is exclusive (omitted for value buckets or if the range has no upper bound)." + }, + "min": { + "type": "any", + "description": "Lower bound of the bucket (omitted for value buckets or if the range has no lower bound)." + }, + "minExclusive": { + "type": "boolean", + "description": "Whether the lower bound of the bucket is exclusive (omitted for value buckets or if the range has no lower bound)." + }, + "value": { + "type": "any", + "description": "Value of the bucket (omitted for range buckets)." + } + } + } + }, + "count": { + "type": "integer", + "description": "Number of products matching the query that have a value for the facet's property or attribute.", + "format": "int32" + }, + "displayName": { + "type": "string", + "description": "Display name of facet." + }, + "name": { + "type": "string", + "description": "Name of the facet's attribute (omitted for property facets)." + }, + "property": { + "type": "string", + "description": "Property of facet (omitted for attribute facets)." + }, + "type": { + "type": "string", + "description": "Type of facet's attribute (omitted for property facets, one of: text, bool, int, float)." + }, + "unit": { + "type": "string", + "description": "Unit of the facet's property or attribute (omitted if the facet's property or attribute has no unit)." + } + } + } + }, + "id": { + "type": "string", + "description": "Id of feed.", + "default": "tag:google.com,2010:shopping/products" + }, + "items": { + "type": "array", + "description": "List of returned products.", + "items": { + "$ref": "Product" + } + }, + "itemsPerPage": { + "type": "integer", + "description": "Number of items per page of results.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "The fixed string \"shopping#products\". The kind of feed returned.", + "default": "shopping#products" + }, + "nextLink": { + "type": "string", + "description": "Next link of feed." + }, + "previousLink": { + "type": "string", + "description": "Previous link of feed." + }, + "promotions": { + "type": "array", + "description": "List of promotions.", + "items": { + "type": "object", + "properties": { + "customFields": { + "type": "array", + "description": "List of custom fields of promotion.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of field." + }, + "value": { + "type": "string", + "description": "Value of field." + } + } + } + }, + "customHtml": { + "type": "string", + "description": "Custom HTML of promotion (omitted if type is not custom)." + }, + "description": { + "type": "string", + "description": "Description of promotion (omitted if type is not standard)." + }, + "destLink": { + "type": "string", + "description": "Link to promotion (omitted if type is not standard)." + }, + "imageLink": { + "type": "string", + "description": "Link to promotion image (omitted if type is not standard)." + }, + "name": { + "type": "string", + "description": "Name of promotion (omitted if type is not standard)." + }, + "product": { + "$ref": "ShoppingModelProductJsonV1", + "description": "Product of promotion (omitted if type is not product)." + }, + "type": { + "type": "string", + "description": "Type of promotion (one of: standard, product, custom)." + } + } + } + }, + "redirects": { + "type": "array", + "description": "Redirects.", + "items": { + "type": "string" + } + }, + "requestId": { + "type": "string", + "description": "Unique identifier for this request." + }, + "selfLink": { + "type": "string", + "description": "Self link of feed." + }, + "spelling": { + "type": "object", + "description": "Spelling.", + "properties": { + "suggestion": { + "type": "string", + "description": "Suggestion for spelling." + } + } + }, + "startIndex": { + "type": "integer", + "description": "1-based index of the first item in the search results.", + "format": "int32" + }, + "stores": { + "type": "array", + "description": "List of returned stores.", + "items": { + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "Address of store." + }, + "location": { + "type": "string", + "description": "Location of store." + }, + "name": { + "type": "string", + "description": "Name of merchant." + }, + "storeCode": { + "type": "string", + "description": "Merchant-supplied store code." + }, + "storeId": { + "type": "string", + "description": "Id of store." + }, + "storeName": { + "type": "string", + "description": "Name of store." + }, + "telephone": { + "type": "string", + "description": "Telephone number of store." + } + } + } + }, + "totalItems": { + "type": "integer", + "description": "Total number of search results.", + "format": "int32" + } + } + }, + "ShoppingModelCategoryJsonV1": { + "id": "ShoppingModelCategoryJsonV1", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Id of category." + }, + "parents": { + "type": "array", + "description": "Ids of the parents of the category.", + "items": { + "type": "string" + } + }, + "shortName": { + "type": "string", + "description": "Short name of category." + }, + "url": { + "type": "string", + "description": "URL of category." + } + } + }, + "ShoppingModelDebugJsonV1": { + "id": "ShoppingModelDebugJsonV1", + "type": "object", + "properties": { + "backendTimes": { + "type": "array", + "description": "Google internal", + "items": { + "type": "object", + "properties": { + "elapsedMillis": { + "type": "string", + "description": "Google internal", + "format": "int64" + }, + "hostName": { + "type": "string", + "description": "Google internal" + }, + "name": { + "type": "string", + "description": "Google internal" + }, + "serverMillis": { + "type": "string", + "description": "Google internal", + "format": "int64" + } + } + } + }, + "elapsedMillis": { + "type": "string", + "description": "Google internal.", + "format": "int64" + }, + "facetsRequest": { + "type": "string", + "description": "Google internal." + }, + "facetsResponse": { + "type": "string", + "description": "Google internal." + }, + "rdcResponse": { + "type": "string", + "description": "Google internal." + }, + "recommendedItemsRequest": { + "type": "string", + "description": "Google internal." + }, + "recommendedItemsResponse": { + "type": "string", + "description": "Google internal." + }, + "searchRequest": { + "type": "string", + "description": "Google internal." + }, + "searchResponse": { + "type": "string", + "description": "Google internal." + } + } + }, + "ShoppingModelExtrasJsonV1": { + "id": "ShoppingModelExtrasJsonV1", + "type": "object", + "properties": { + "facetRules": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } + }, + "rankingRules": { + "type": "array", + "description": "Names of boost (ranking) rules applicable to this search.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } + } + } + }, + "ShoppingModelProductJsonV1": { + "id": "ShoppingModelProductJsonV1", + "type": "object", + "properties": { + "attributes": { + "type": "array", + "description": "Attributes of product (available only with a cx source).", + "items": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Display Name of prodct attribute." + }, + "name": { + "type": "string", + "description": "Name of product attribute." + }, + "type": { + "type": "string", + "description": "Type of product attribute (one of: text, bool, int, float, dateRange, url)." + }, + "unit": { + "type": "string", + "description": "Unit of product attribute." + }, + "value": { + "type": "any", + "description": "Value of product attribute." + } + } + } + }, + "author": { + "type": "object", + "description": "Author of product.", + "properties": { + "accountId": { + "type": "string", + "description": "Account id of product author.", + "format": "uint64" + }, + "name": { + "type": "string", + "description": "Name of product author." + } + } + }, + "brand": { + "type": "string", + "description": "Brand of product." + }, + "categories": { + "type": "array", + "description": "Categories of product according to the selected taxonomy, omitted if no taxonomy is selected.", + "items": { + "type": "string" + } + }, + "condition": { + "type": "string", + "description": "Condition of product (one of: new, refurbished, used)." + }, + "country": { + "type": "string", + "description": "ISO 3166 code of target country of product." + }, + "creationTime": { + "type": "string", + "description": "RFC 3339 formatted creation time and date of product.", + "format": "date-time" + }, + "description": { + "type": "string", + "description": "Description of product." + }, + "googleId": { + "type": "string", + "description": "Google id of product.", + "format": "uint64" + }, + "gtin": { + "type": "string", + "description": "The first GTIN of the product. Deprecated in favor of \"gtins\"." + }, + "gtins": { + "type": "array", + "description": "List of all the product's GTINs (in GTIN-14 format).", + "items": { + "type": "string" + } + }, + "images": { + "type": "array", + "description": "Images of product.", + "items": { + "type": "object", + "properties": { + "link": { + "type": "string", + "description": "Link to product image." + }, + "status": { + "type": "string" + }, + "thumbnails": { + "type": "array", + "description": "Thumbnails of product image.", + "items": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "Content of thumbnail (only available for the first thumbnail of the top results if SAYT is enabled)." + }, + "height": { + "type": "integer", + "description": "Height of thumbnail (omitted if not specified in the request).", + "format": "int32" + }, + "link": { + "type": "string", + "description": "Link to thumbnail." + }, + "width": { + "type": "integer", + "description": "Width of thumbnail (omitted if not specified in the request).", + "format": "int32" + } + } + } + } + } + } + }, + "internal16": { + "type": "object", + "description": "Google Internal. Attribute names are deliberately vague.", + "properties": { + "length": { + "type": "integer", + "format": "int32" + }, + "number": { + "type": "integer", + "format": "int32" + }, + "size": { + "type": "string", + "format": "int64" + } + } + }, + "inventories": { + "type": "array", + "description": "Inventories of product.", + "items": { + "type": "object", + "properties": { + "availability": { + "type": "string", + "description": "Availability of product inventory." + }, + "channel": { + "type": "string", + "description": "Channel of product inventory (one of: online, local)." + }, + "currency": { + "type": "string", + "description": "Currency of product inventory (an ISO 4217 alphabetic code)." + }, + "distance": { + "type": "number", + "description": "Distance of product inventory.", + "format": "float" + }, + "distanceUnit": { + "type": "string", + "description": "Distance unit of product inventory." + }, + "installmentMonths": { + "type": "integer", + "description": "Number of months for installment price.", + "format": "int32" + }, + "installmentPrice": { + "type": "number", + "description": "Installment price of product inventory.", + "format": "float" + }, + "originalPrice": { + "type": "number", + "description": "Original price of product inventory. Only returned for products that are on sale.", + "format": "float" + }, + "price": { + "type": "number", + "description": "Price of product inventory.", + "format": "float" + }, + "saleEndDate": { + "type": "string", + "description": "Sale end date.", + "format": "date-time" + }, + "salePrice": { + "type": "number", + "description": "Sale price of product inventory.", + "format": "float" + }, + "saleStartDate": { + "type": "string", + "description": "Sale start date.", + "format": "date-time" + }, + "shipping": { + "type": "number", + "description": "Shipping cost of product inventory.", + "format": "float" + }, + "storeId": { + "type": "string", + "description": "Store ID of product inventory." + }, + "tax": { + "type": "number", + "description": "Tax of product inventory.", + "format": "float" + } + } + } + }, + "language": { + "type": "string", + "description": "BCP 47 language tag of language of product." + }, + "link": { + "type": "string", + "description": "Link to product." + }, + "modificationTime": { + "type": "string", + "description": "RFC 3339 formatted modification time and date of product.", + "format": "date-time" + }, + "mpns": { + "type": "array", + "description": "List of all the product's MPNs.", + "items": { + "type": "string" + } + }, + "providedId": { + "type": "string", + "description": "Merchant-provided id of product (available only with a cx source)." + }, + "queryMatched": { + "type": "boolean", + "description": "Whether this product matched the user query. Only set for the variant offers (if any) attached to a product offer." + }, + "score": { + "type": "number", + "description": "Google Internal", + "format": "float" + }, + "title": { + "type": "string", + "description": "Title of product." + }, + "totalMatchingVariants": { + "type": "integer", + "description": "The number of variant offers returned that matched the query.", + "format": "int32" + }, + "variants": { + "type": "array", + "description": "A list of variant offers associated with this product.", + "items": { + "type": "object", + "properties": { + "variant": { + "$ref": "ShoppingModelProductJsonV1", + "description": "The detailed offer data for a particular variant offer." + } + } + } + } + } + }, + "ShoppingModelRecommendationsJsonV1": { + "id": "ShoppingModelRecommendationsJsonV1", + "type": "object", + "properties": { + "recommendationList": { + "type": "array", + "description": "List of recommendations.", + "items": { + "type": "object", + "properties": { + "product": { + "$ref": "ShoppingModelProductJsonV1", + "description": "Recommended product." + } + } + } + }, + "type": { + "type": "string", + "description": "Type of recommendation list (for offer-based recommendations, one of: all, purchaseToPurchase, visitToVisit, visitToPurchase, relatedItems, visuallySimilarItems; for category-based recommendations, one of: all, categoryMostVisited, categoryBestSeller)." + } + } + } + }, + "resources": { + "products": { + "methods": { + "get": { + "id": "shopping.products.get", + "path": "{source}/products/{accountId}/{productIdType}/{productId}", + "httpMethod": "GET", + "description": "Returns a single product", + "parameters": { + "accountId": { + "type": "integer", + "description": "Merchant center account id", + "required": true, + "format": "uint32", + "location": "path" + }, + "attributeFilter": { + "type": "string", + "description": "Comma separated list of attributes to return", + "location": "query" + }, + "categories.enabled": { + "type": "boolean", + "description": "Whether to return category information", + "location": "query" + }, + "categories.include": { + "type": "string", + "description": "Category specification", + "location": "query" + }, + "categories.useGcsConfig": { + "type": "boolean", + "description": "This parameter is currently ignored", + "location": "query" + }, + "location": { + "type": "string", + "description": "Location used to determine tax and shipping", + "location": "query" + }, + "productId": { + "type": "string", + "description": "Id of product", + "required": true, + "location": "path" + }, + "productIdType": { + "type": "string", + "description": "Type of productId", + "required": true, + "location": "path" + }, + "recommendations.enabled": { + "type": "boolean", + "description": "Whether to return recommendation information", + "location": "query" + }, + "recommendations.include": { + "type": "string", + "description": "Recommendation specification", + "location": "query" + }, + "recommendations.useGcsConfig": { + "type": "boolean", + "description": "This parameter is currently ignored", + "location": "query" + }, + "source": { + "type": "string", + "description": "Query source", + "required": true, + "location": "path" + }, + "taxonomy": { + "type": "string", + "description": "Merchant taxonomy", + "location": "query" + }, + "thumbnails": { + "type": "string", + "description": "Thumbnail specification", + "location": "query" + } + }, + "parameterOrder": [ + "source", + "accountId", + "productIdType", + "productId" + ], + "response": { + "$ref": "Product" + }, + "scopes": [ + "https://www.googleapis.com/auth/shoppingapi" + ] + }, + "list": { + "id": "shopping.products.list", + "path": "{source}/products", + "httpMethod": "GET", + "description": "Returns a list of products and content modules", + "parameters": { + "attributeFilter": { + "type": "string", + "description": "Comma separated list of attributes to return", + "location": "query" + }, + "availability": { + "type": "string", + "description": "Comma separated list of availabilities (outOfStock, limited, inStock, backOrder, preOrder, onDisplayToOrder) to return", + "location": "query" + }, + "boostBy": { + "type": "string", + "description": "Boosting specification", + "location": "query" + }, + "categories.enabled": { + "type": "boolean", + "description": "Whether to return category information", + "location": "query" + }, + "categories.include": { + "type": "string", + "description": "Category specification", + "location": "query" + }, + "categories.useGcsConfig": { + "type": "boolean", + "description": "This parameter is currently ignored", + "location": "query" + }, + "categoryRecommendations.category": { + "type": "string", + "description": "Category for which to retrieve recommendations", + "location": "query" + }, + "categoryRecommendations.enabled": { + "type": "boolean", + "description": "Whether to return category recommendation information", + "location": "query" + }, + "categoryRecommendations.include": { + "type": "string", + "description": "Category recommendation specification", + "location": "query" + }, + "categoryRecommendations.useGcsConfig": { + "type": "boolean", + "description": "This parameter is currently ignored", + "location": "query" + }, + "channels": { + "type": "string", + "description": "Channels specification", + "location": "query" + }, + "clickTracking": { + "type": "boolean", + "description": "Whether to add a click tracking parameter to offer URLs", + "location": "query" + }, + "country": { + "type": "string", + "description": "Country restriction (ISO 3166)", + "location": "query" + }, + "crowdBy": { + "type": "string", + "description": "Crowding specification", + "location": "query" + }, + "currency": { + "type": "string", + "description": "Currency restriction (ISO 4217)", + "location": "query" + }, + "extras.enabled": { + "type": "boolean", + "description": "Whether to return extra information.", + "location": "query" + }, + "extras.info": { + "type": "string", + "description": "What extra information to return.", + "location": "query" + }, + "facets.discover": { + "type": "string", + "description": "Facets to discover", + "location": "query" + }, + "facets.enabled": { + "type": "boolean", + "description": "Whether to return facet information", + "location": "query" + }, + "facets.include": { + "type": "string", + "description": "Facets to include (applies when useGcsConfig == false)", + "location": "query" + }, + "facets.includeEmptyBuckets": { + "type": "boolean", + "description": "Return empty facet buckets.", + "location": "query" + }, + "facets.useGcsConfig": { + "type": "boolean", + "description": "Whether to return facet information as configured in the GCS account", + "location": "query" + }, + "language": { + "type": "string", + "description": "Language restriction (BCP 47)", + "location": "query" + }, + "location": { + "type": "string", + "description": "Location used to determine tax and shipping", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return", + "format": "uint32", + "location": "query" + }, + "maxVariants": { + "type": "integer", + "description": "Maximum number of variant results to return per result", + "format": "int32", + "location": "query" + }, + "promotions.enabled": { + "type": "boolean", + "description": "Whether to return promotion information", + "location": "query" + }, + "promotions.useGcsConfig": { + "type": "boolean", + "description": "Whether to return promotion information as configured in the GCS account", + "location": "query" + }, + "q": { + "type": "string", + "description": "Search query", + "location": "query" + }, + "rankBy": { + "type": "string", + "description": "Ranking specification", + "location": "query" + }, + "redirects.enabled": { + "type": "boolean", + "description": "Whether to return redirect information", + "location": "query" + }, + "redirects.useGcsConfig": { + "type": "boolean", + "description": "Whether to return redirect information as configured in the GCS account", + "location": "query" + }, + "restrictBy": { + "type": "string", + "description": "Restriction specification", + "location": "query" + }, + "source": { + "type": "string", + "description": "Query source", + "required": true, + "location": "path" + }, + "spelling.enabled": { + "type": "boolean", + "description": "Whether to return spelling suggestions", + "location": "query" + }, + "spelling.useGcsConfig": { + "type": "boolean", + "description": "This parameter is currently ignored", + "location": "query" + }, + "startIndex": { + "type": "integer", + "description": "Index (1-based) of first product to return", + "format": "uint32", + "location": "query" + }, + "taxonomy": { + "type": "string", + "description": "Taxonomy name", + "location": "query" + }, + "thumbnails": { + "type": "string", + "description": "Image thumbnails specification", + "location": "query" + }, + "useCase": { + "type": "string", + "description": "One of CommerceSearchUseCase, ShoppingApiUseCase", + "location": "query" + } + }, + "parameterOrder": [ + "source" + ], + "response": { + "$ref": "Products" + }, + "scopes": [ + "https://www.googleapis.com/auth/shoppingapi" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/shopping/v1/shopping-gen.go b/third_party/src/code.google.com/p/google-api-go-client/shopping/v1/shopping-gen.go new file mode 100644 index 0000000000000..7f806fe649b6a --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/shopping/v1/shopping-gen.go @@ -0,0 +1,1459 @@ +// Package shopping provides access to the Search API For Shopping. +// +// See https://developers.google.com/shopping-search/v1/getting_started +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/shopping/v1" +// ... +// shoppingService, err := shopping.New(oauthHttpClient) +package shopping + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "shopping:v1" +const apiName = "shopping" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/shopping/search/v1/" + +// OAuth2 scopes used by this API. +const ( + // View your product data + ShoppingapiScope = "https://www.googleapis.com/auth/shoppingapi" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client} + s.Products = NewProductsService(s) + return s, nil +} + +type Service struct { + client *http.Client + + Products *ProductsService +} + +func NewProductsService(s *Service) *ProductsService { + rs := &ProductsService{s: s} + return rs +} + +type ProductsService struct { + s *Service +} + +type Product struct { + // Categories: List of categories for product. + Categories []*ShoppingModelCategoryJsonV1 `json:"categories,omitempty"` + + // Debug: Google internal. + Debug *ShoppingModelDebugJsonV1 `json:"debug,omitempty"` + + // Id: Id of product. + Id string `json:"id,omitempty"` + + // Kind: The kind of item, always shopping#product. + Kind string `json:"kind,omitempty"` + + // Product: Product. + Product *ShoppingModelProductJsonV1 `json:"product,omitempty"` + + // Recommendations: Recommendations for product. + Recommendations []*ShoppingModelRecommendationsJsonV1 `json:"recommendations,omitempty"` + + // RequestId: Unique identifier for this request. + RequestId string `json:"requestId,omitempty"` + + // SelfLink: Self link of product when generated for a lookup request. + // Self link of product when generated for a search request. + SelfLink string `json:"selfLink,omitempty"` +} + +type Products struct { + // Categories: List of categories. + Categories []*ShoppingModelCategoryJsonV1 `json:"categories,omitempty"` + + // CategoryRecommendations: Recommendations for category. + CategoryRecommendations []*ShoppingModelRecommendationsJsonV1 `json:"categoryRecommendations,omitempty"` + + // CurrentItemCount: Current item count. + CurrentItemCount int64 `json:"currentItemCount,omitempty"` + + // Debug: Google internal. + Debug *ShoppingModelDebugJsonV1 `json:"debug,omitempty"` + + // Etag: Etag of feed. + Etag string `json:"etag,omitempty"` + + // Extras: List of extras. + Extras *ShoppingModelExtrasJsonV1 `json:"extras,omitempty"` + + // Facets: List of facets. + Facets []*ProductsFacets `json:"facets,omitempty"` + + // Id: Id of feed. + Id string `json:"id,omitempty"` + + // Items: List of returned products. + Items []*Product `json:"items,omitempty"` + + // ItemsPerPage: Number of items per page of results. + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + + // Kind: The fixed string "shopping#products". The kind of feed + // returned. + Kind string `json:"kind,omitempty"` + + // NextLink: Next link of feed. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Previous link of feed. + PreviousLink string `json:"previousLink,omitempty"` + + // Promotions: List of promotions. + Promotions []*ProductsPromotions `json:"promotions,omitempty"` + + // Redirects: Redirects. + Redirects []string `json:"redirects,omitempty"` + + // RequestId: Unique identifier for this request. + RequestId string `json:"requestId,omitempty"` + + // SelfLink: Self link of feed. + SelfLink string `json:"selfLink,omitempty"` + + // Spelling: Spelling. + Spelling *ProductsSpelling `json:"spelling,omitempty"` + + // StartIndex: 1-based index of the first item in the search results. + StartIndex int64 `json:"startIndex,omitempty"` + + // Stores: List of returned stores. + Stores []*ProductsStores `json:"stores,omitempty"` + + // TotalItems: Total number of search results. + TotalItems int64 `json:"totalItems,omitempty"` +} + +type ProductsFacets struct { + // Buckets: List of Buckets within facet. + Buckets []*ProductsFacetsBuckets `json:"buckets,omitempty"` + + // Count: Number of products matching the query that have a value for + // the facet's property or attribute. + Count int64 `json:"count,omitempty"` + + // DisplayName: Display name of facet. + DisplayName string `json:"displayName,omitempty"` + + // Name: Name of the facet's attribute (omitted for property facets). + Name string `json:"name,omitempty"` + + // Property: Property of facet (omitted for attribute facets). + Property string `json:"property,omitempty"` + + // Type: Type of facet's attribute (omitted for property facets, one of: + // text, bool, int, float). + Type string `json:"type,omitempty"` + + // Unit: Unit of the facet's property or attribute (omitted if the + // facet's property or attribute has no unit). + Unit string `json:"unit,omitempty"` +} + +type ProductsFacetsBuckets struct { + // Count: Number of products matching the query that have a value for + // the facet's property or attribute that matches the bucket. + Count int64 `json:"count,omitempty"` + + // Max: Upper bound of the bucket (omitted for value buckets or if the + // range has no upper bound). + Max interface{} `json:"max,omitempty"` + + // MaxExclusive: Whether the upper bound of the bucket is exclusive + // (omitted for value buckets or if the range has no upper bound). + MaxExclusive bool `json:"maxExclusive,omitempty"` + + // Min: Lower bound of the bucket (omitted for value buckets or if the + // range has no lower bound). + Min interface{} `json:"min,omitempty"` + + // MinExclusive: Whether the lower bound of the bucket is exclusive + // (omitted for value buckets or if the range has no lower bound). + MinExclusive bool `json:"minExclusive,omitempty"` + + // Value: Value of the bucket (omitted for range buckets). + Value interface{} `json:"value,omitempty"` +} + +type ProductsPromotions struct { + // CustomFields: List of custom fields of promotion. + CustomFields []*ProductsPromotionsCustomFields `json:"customFields,omitempty"` + + // CustomHtml: Custom HTML of promotion (omitted if type is not custom). + CustomHtml string `json:"customHtml,omitempty"` + + // Description: Description of promotion (omitted if type is not + // standard). + Description string `json:"description,omitempty"` + + // DestLink: Link to promotion (omitted if type is not standard). + DestLink string `json:"destLink,omitempty"` + + // ImageLink: Link to promotion image (omitted if type is not standard). + ImageLink string `json:"imageLink,omitempty"` + + // Name: Name of promotion (omitted if type is not standard). + Name string `json:"name,omitempty"` + + // Product: Product of promotion (omitted if type is not product). + Product *ShoppingModelProductJsonV1 `json:"product,omitempty"` + + // Type: Type of promotion (one of: standard, product, custom). + Type string `json:"type,omitempty"` +} + +type ProductsPromotionsCustomFields struct { + // Name: Name of field. + Name string `json:"name,omitempty"` + + // Value: Value of field. + Value string `json:"value,omitempty"` +} + +type ProductsSpelling struct { + // Suggestion: Suggestion for spelling. + Suggestion string `json:"suggestion,omitempty"` +} + +type ProductsStores struct { + // Address: Address of store. + Address string `json:"address,omitempty"` + + // Location: Location of store. + Location string `json:"location,omitempty"` + + // Name: Name of merchant. + Name string `json:"name,omitempty"` + + // StoreCode: Merchant-supplied store code. + StoreCode string `json:"storeCode,omitempty"` + + // StoreId: Id of store. + StoreId string `json:"storeId,omitempty"` + + // StoreName: Name of store. + StoreName string `json:"storeName,omitempty"` + + // Telephone: Telephone number of store. + Telephone string `json:"telephone,omitempty"` +} + +type ShoppingModelCategoryJsonV1 struct { + // Id: Id of category. + Id string `json:"id,omitempty"` + + // Parents: Ids of the parents of the category. + Parents []string `json:"parents,omitempty"` + + // ShortName: Short name of category. + ShortName string `json:"shortName,omitempty"` + + // Url: URL of category. + Url string `json:"url,omitempty"` +} + +type ShoppingModelDebugJsonV1 struct { + // BackendTimes: Google internal + BackendTimes []*ShoppingModelDebugJsonV1BackendTimes `json:"backendTimes,omitempty"` + + // ElapsedMillis: Google internal. + ElapsedMillis int64 `json:"elapsedMillis,omitempty,string"` + + // FacetsRequest: Google internal. + FacetsRequest string `json:"facetsRequest,omitempty"` + + // FacetsResponse: Google internal. + FacetsResponse string `json:"facetsResponse,omitempty"` + + // RdcResponse: Google internal. + RdcResponse string `json:"rdcResponse,omitempty"` + + // RecommendedItemsRequest: Google internal. + RecommendedItemsRequest string `json:"recommendedItemsRequest,omitempty"` + + // RecommendedItemsResponse: Google internal. + RecommendedItemsResponse string `json:"recommendedItemsResponse,omitempty"` + + // SearchRequest: Google internal. + SearchRequest string `json:"searchRequest,omitempty"` + + // SearchResponse: Google internal. + SearchResponse string `json:"searchResponse,omitempty"` +} + +type ShoppingModelDebugJsonV1BackendTimes struct { + // ElapsedMillis: Google internal + ElapsedMillis int64 `json:"elapsedMillis,omitempty,string"` + + // HostName: Google internal + HostName string `json:"hostName,omitempty"` + + // Name: Google internal + Name string `json:"name,omitempty"` + + // ServerMillis: Google internal + ServerMillis int64 `json:"serverMillis,omitempty,string"` +} + +type ShoppingModelExtrasJsonV1 struct { + FacetRules []*ShoppingModelExtrasJsonV1FacetRules `json:"facetRules,omitempty"` + + // RankingRules: Names of boost (ranking) rules applicable to this + // search. + RankingRules []*ShoppingModelExtrasJsonV1RankingRules `json:"rankingRules,omitempty"` +} + +type ShoppingModelExtrasJsonV1FacetRules struct { + Name string `json:"name,omitempty"` +} + +type ShoppingModelExtrasJsonV1RankingRules struct { + Name string `json:"name,omitempty"` +} + +type ShoppingModelProductJsonV1 struct { + // Attributes: Attributes of product (available only with a cx source). + Attributes []*ShoppingModelProductJsonV1Attributes `json:"attributes,omitempty"` + + // Author: Author of product. + Author *ShoppingModelProductJsonV1Author `json:"author,omitempty"` + + // Brand: Brand of product. + Brand string `json:"brand,omitempty"` + + // Categories: Categories of product according to the selected taxonomy, + // omitted if no taxonomy is selected. + Categories []string `json:"categories,omitempty"` + + // Condition: Condition of product (one of: new, refurbished, used). + Condition string `json:"condition,omitempty"` + + // Country: ISO 3166 code of target country of product. + Country string `json:"country,omitempty"` + + // CreationTime: RFC 3339 formatted creation time and date of product. + CreationTime string `json:"creationTime,omitempty"` + + // Description: Description of product. + Description string `json:"description,omitempty"` + + // GoogleId: Google id of product. + GoogleId uint64 `json:"googleId,omitempty,string"` + + // Gtin: The first GTIN of the product. Deprecated in favor of "gtins". + Gtin string `json:"gtin,omitempty"` + + // Gtins: List of all the product's GTINs (in GTIN-14 format). + Gtins []string `json:"gtins,omitempty"` + + // Images: Images of product. + Images []*ShoppingModelProductJsonV1Images `json:"images,omitempty"` + + // Internal16: Google Internal. Attribute names are deliberately vague. + Internal16 *ShoppingModelProductJsonV1Internal16 `json:"internal16,omitempty"` + + // Inventories: Inventories of product. + Inventories []*ShoppingModelProductJsonV1Inventories `json:"inventories,omitempty"` + + // Language: BCP 47 language tag of language of product. + Language string `json:"language,omitempty"` + + // Link: Link to product. + Link string `json:"link,omitempty"` + + // ModificationTime: RFC 3339 formatted modification time and date of + // product. + ModificationTime string `json:"modificationTime,omitempty"` + + // Mpns: List of all the product's MPNs. + Mpns []string `json:"mpns,omitempty"` + + // ProvidedId: Merchant-provided id of product (available only with a cx + // source). + ProvidedId string `json:"providedId,omitempty"` + + // QueryMatched: Whether this product matched the user query. Only set + // for the variant offers (if any) attached to a product offer. + QueryMatched bool `json:"queryMatched,omitempty"` + + // Score: Google Internal + Score float64 `json:"score,omitempty"` + + // Title: Title of product. + Title string `json:"title,omitempty"` + + // TotalMatchingVariants: The number of variant offers returned that + // matched the query. + TotalMatchingVariants int64 `json:"totalMatchingVariants,omitempty"` + + // Variants: A list of variant offers associated with this product. + Variants []*ShoppingModelProductJsonV1Variants `json:"variants,omitempty"` +} + +type ShoppingModelProductJsonV1Attributes struct { + // DisplayName: Display Name of prodct attribute. + DisplayName string `json:"displayName,omitempty"` + + // Name: Name of product attribute. + Name string `json:"name,omitempty"` + + // Type: Type of product attribute (one of: text, bool, int, float, + // dateRange, url). + Type string `json:"type,omitempty"` + + // Unit: Unit of product attribute. + Unit string `json:"unit,omitempty"` + + // Value: Value of product attribute. + Value interface{} `json:"value,omitempty"` +} + +type ShoppingModelProductJsonV1Author struct { + // AccountId: Account id of product author. + AccountId uint64 `json:"accountId,omitempty,string"` + + // Name: Name of product author. + Name string `json:"name,omitempty"` +} + +type ShoppingModelProductJsonV1Images struct { + // Link: Link to product image. + Link string `json:"link,omitempty"` + + Status string `json:"status,omitempty"` + + // Thumbnails: Thumbnails of product image. + Thumbnails []*ShoppingModelProductJsonV1ImagesThumbnails `json:"thumbnails,omitempty"` +} + +type ShoppingModelProductJsonV1ImagesThumbnails struct { + // Content: Content of thumbnail (only available for the first thumbnail + // of the top results if SAYT is enabled). + Content string `json:"content,omitempty"` + + // Height: Height of thumbnail (omitted if not specified in the + // request). + Height int64 `json:"height,omitempty"` + + // Link: Link to thumbnail. + Link string `json:"link,omitempty"` + + // Width: Width of thumbnail (omitted if not specified in the request). + Width int64 `json:"width,omitempty"` +} + +type ShoppingModelProductJsonV1Internal16 struct { + Length int64 `json:"length,omitempty"` + + Number int64 `json:"number,omitempty"` + + Size int64 `json:"size,omitempty,string"` +} + +type ShoppingModelProductJsonV1Inventories struct { + // Availability: Availability of product inventory. + Availability string `json:"availability,omitempty"` + + // Channel: Channel of product inventory (one of: online, local). + Channel string `json:"channel,omitempty"` + + // Currency: Currency of product inventory (an ISO 4217 alphabetic + // code). + Currency string `json:"currency,omitempty"` + + // Distance: Distance of product inventory. + Distance float64 `json:"distance,omitempty"` + + // DistanceUnit: Distance unit of product inventory. + DistanceUnit string `json:"distanceUnit,omitempty"` + + // InstallmentMonths: Number of months for installment price. + InstallmentMonths int64 `json:"installmentMonths,omitempty"` + + // InstallmentPrice: Installment price of product inventory. + InstallmentPrice float64 `json:"installmentPrice,omitempty"` + + // OriginalPrice: Original price of product inventory. Only returned for + // products that are on sale. + OriginalPrice float64 `json:"originalPrice,omitempty"` + + // Price: Price of product inventory. + Price float64 `json:"price,omitempty"` + + // SaleEndDate: Sale end date. + SaleEndDate string `json:"saleEndDate,omitempty"` + + // SalePrice: Sale price of product inventory. + SalePrice float64 `json:"salePrice,omitempty"` + + // SaleStartDate: Sale start date. + SaleStartDate string `json:"saleStartDate,omitempty"` + + // Shipping: Shipping cost of product inventory. + Shipping float64 `json:"shipping,omitempty"` + + // StoreId: Store ID of product inventory. + StoreId string `json:"storeId,omitempty"` + + // Tax: Tax of product inventory. + Tax float64 `json:"tax,omitempty"` +} + +type ShoppingModelProductJsonV1Variants struct { + // Variant: The detailed offer data for a particular variant offer. + Variant *ShoppingModelProductJsonV1 `json:"variant,omitempty"` +} + +type ShoppingModelRecommendationsJsonV1 struct { + // RecommendationList: List of recommendations. + RecommendationList []*ShoppingModelRecommendationsJsonV1RecommendationList `json:"recommendationList,omitempty"` + + // Type: Type of recommendation list (for offer-based recommendations, + // one of: all, purchaseToPurchase, visitToVisit, visitToPurchase, + // relatedItems, visuallySimilarItems; for category-based + // recommendations, one of: all, categoryMostVisited, + // categoryBestSeller). + Type string `json:"type,omitempty"` +} + +type ShoppingModelRecommendationsJsonV1RecommendationList struct { + // Product: Recommended product. + Product *ShoppingModelProductJsonV1 `json:"product,omitempty"` +} + +// method id "shopping.products.get": + +type ProductsGetCall struct { + s *Service + source string + accountId int64 + productIdType string + productId string + opt_ map[string]interface{} +} + +// Get: Returns a single product +func (r *ProductsService) Get(source string, accountId int64, productIdType string, productId string) *ProductsGetCall { + c := &ProductsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.source = source + c.accountId = accountId + c.productIdType = productIdType + c.productId = productId + return c +} + +// AttributeFilter sets the optional parameter "attributeFilter": Comma +// separated list of attributes to return +func (c *ProductsGetCall) AttributeFilter(attributeFilter string) *ProductsGetCall { + c.opt_["attributeFilter"] = attributeFilter + return c +} + +// CategoriesEnabled sets the optional parameter "categories.enabled": +// Whether to return category information +func (c *ProductsGetCall) CategoriesEnabled(categoriesEnabled bool) *ProductsGetCall { + c.opt_["categories.enabled"] = categoriesEnabled + return c +} + +// CategoriesInclude sets the optional parameter "categories.include": +// Category specification +func (c *ProductsGetCall) CategoriesInclude(categoriesInclude string) *ProductsGetCall { + c.opt_["categories.include"] = categoriesInclude + return c +} + +// CategoriesUseGcsConfig sets the optional parameter +// "categories.useGcsConfig": This parameter is currently ignored +func (c *ProductsGetCall) CategoriesUseGcsConfig(categoriesUseGcsConfig bool) *ProductsGetCall { + c.opt_["categories.useGcsConfig"] = categoriesUseGcsConfig + return c +} + +// Location sets the optional parameter "location": Location used to +// determine tax and shipping +func (c *ProductsGetCall) Location(location string) *ProductsGetCall { + c.opt_["location"] = location + return c +} + +// RecommendationsEnabled sets the optional parameter +// "recommendations.enabled": Whether to return recommendation +// information +func (c *ProductsGetCall) RecommendationsEnabled(recommendationsEnabled bool) *ProductsGetCall { + c.opt_["recommendations.enabled"] = recommendationsEnabled + return c +} + +// RecommendationsInclude sets the optional parameter +// "recommendations.include": Recommendation specification +func (c *ProductsGetCall) RecommendationsInclude(recommendationsInclude string) *ProductsGetCall { + c.opt_["recommendations.include"] = recommendationsInclude + return c +} + +// RecommendationsUseGcsConfig sets the optional parameter +// "recommendations.useGcsConfig": This parameter is currently ignored +func (c *ProductsGetCall) RecommendationsUseGcsConfig(recommendationsUseGcsConfig bool) *ProductsGetCall { + c.opt_["recommendations.useGcsConfig"] = recommendationsUseGcsConfig + return c +} + +// Taxonomy sets the optional parameter "taxonomy": Merchant taxonomy +func (c *ProductsGetCall) Taxonomy(taxonomy string) *ProductsGetCall { + c.opt_["taxonomy"] = taxonomy + return c +} + +// Thumbnails sets the optional parameter "thumbnails": Thumbnail +// specification +func (c *ProductsGetCall) Thumbnails(thumbnails string) *ProductsGetCall { + c.opt_["thumbnails"] = thumbnails + return c +} + +func (c *ProductsGetCall) Do() (*Product, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["attributeFilter"]; ok { + params.Set("attributeFilter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["categories.enabled"]; ok { + params.Set("categories.enabled", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["categories.include"]; ok { + params.Set("categories.include", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["categories.useGcsConfig"]; ok { + params.Set("categories.useGcsConfig", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["location"]; ok { + params.Set("location", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["recommendations.enabled"]; ok { + params.Set("recommendations.enabled", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["recommendations.include"]; ok { + params.Set("recommendations.include", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["recommendations.useGcsConfig"]; ok { + params.Set("recommendations.useGcsConfig", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["taxonomy"]; ok { + params.Set("taxonomy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["thumbnails"]; ok { + params.Set("thumbnails", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/shopping/search/v1/", "{source}/products/{accountId}/{productIdType}/{productId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{source}", url.QueryEscape(c.source), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{accountId}", strconv.FormatInt(c.accountId, 10), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{productIdType}", url.QueryEscape(c.productIdType), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{productId}", url.QueryEscape(c.productId), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Product) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a single product", + // "httpMethod": "GET", + // "id": "shopping.products.get", + // "parameterOrder": [ + // "source", + // "accountId", + // "productIdType", + // "productId" + // ], + // "parameters": { + // "accountId": { + // "description": "Merchant center account id", + // "format": "uint32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "attributeFilter": { + // "description": "Comma separated list of attributes to return", + // "location": "query", + // "type": "string" + // }, + // "categories.enabled": { + // "description": "Whether to return category information", + // "location": "query", + // "type": "boolean" + // }, + // "categories.include": { + // "description": "Category specification", + // "location": "query", + // "type": "string" + // }, + // "categories.useGcsConfig": { + // "description": "This parameter is currently ignored", + // "location": "query", + // "type": "boolean" + // }, + // "location": { + // "description": "Location used to determine tax and shipping", + // "location": "query", + // "type": "string" + // }, + // "productId": { + // "description": "Id of product", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "productIdType": { + // "description": "Type of productId", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "recommendations.enabled": { + // "description": "Whether to return recommendation information", + // "location": "query", + // "type": "boolean" + // }, + // "recommendations.include": { + // "description": "Recommendation specification", + // "location": "query", + // "type": "string" + // }, + // "recommendations.useGcsConfig": { + // "description": "This parameter is currently ignored", + // "location": "query", + // "type": "boolean" + // }, + // "source": { + // "description": "Query source", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "taxonomy": { + // "description": "Merchant taxonomy", + // "location": "query", + // "type": "string" + // }, + // "thumbnails": { + // "description": "Thumbnail specification", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{source}/products/{accountId}/{productIdType}/{productId}", + // "response": { + // "$ref": "Product" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/shoppingapi" + // ] + // } + +} + +// method id "shopping.products.list": + +type ProductsListCall struct { + s *Service + source string + opt_ map[string]interface{} +} + +// List: Returns a list of products and content modules +func (r *ProductsService) List(source string) *ProductsListCall { + c := &ProductsListCall{s: r.s, opt_: make(map[string]interface{})} + c.source = source + return c +} + +// AttributeFilter sets the optional parameter "attributeFilter": Comma +// separated list of attributes to return +func (c *ProductsListCall) AttributeFilter(attributeFilter string) *ProductsListCall { + c.opt_["attributeFilter"] = attributeFilter + return c +} + +// Availability sets the optional parameter "availability": Comma +// separated list of availabilities (outOfStock, limited, inStock, +// backOrder, preOrder, onDisplayToOrder) to return +func (c *ProductsListCall) Availability(availability string) *ProductsListCall { + c.opt_["availability"] = availability + return c +} + +// BoostBy sets the optional parameter "boostBy": Boosting specification +func (c *ProductsListCall) BoostBy(boostBy string) *ProductsListCall { + c.opt_["boostBy"] = boostBy + return c +} + +// CategoriesEnabled sets the optional parameter "categories.enabled": +// Whether to return category information +func (c *ProductsListCall) CategoriesEnabled(categoriesEnabled bool) *ProductsListCall { + c.opt_["categories.enabled"] = categoriesEnabled + return c +} + +// CategoriesInclude sets the optional parameter "categories.include": +// Category specification +func (c *ProductsListCall) CategoriesInclude(categoriesInclude string) *ProductsListCall { + c.opt_["categories.include"] = categoriesInclude + return c +} + +// CategoriesUseGcsConfig sets the optional parameter +// "categories.useGcsConfig": This parameter is currently ignored +func (c *ProductsListCall) CategoriesUseGcsConfig(categoriesUseGcsConfig bool) *ProductsListCall { + c.opt_["categories.useGcsConfig"] = categoriesUseGcsConfig + return c +} + +// CategoryRecommendationsCategory sets the optional parameter +// "categoryRecommendations.category": Category for which to retrieve +// recommendations +func (c *ProductsListCall) CategoryRecommendationsCategory(categoryRecommendationsCategory string) *ProductsListCall { + c.opt_["categoryRecommendations.category"] = categoryRecommendationsCategory + return c +} + +// CategoryRecommendationsEnabled sets the optional parameter +// "categoryRecommendations.enabled": Whether to return category +// recommendation information +func (c *ProductsListCall) CategoryRecommendationsEnabled(categoryRecommendationsEnabled bool) *ProductsListCall { + c.opt_["categoryRecommendations.enabled"] = categoryRecommendationsEnabled + return c +} + +// CategoryRecommendationsInclude sets the optional parameter +// "categoryRecommendations.include": Category recommendation +// specification +func (c *ProductsListCall) CategoryRecommendationsInclude(categoryRecommendationsInclude string) *ProductsListCall { + c.opt_["categoryRecommendations.include"] = categoryRecommendationsInclude + return c +} + +// CategoryRecommendationsUseGcsConfig sets the optional parameter +// "categoryRecommendations.useGcsConfig": This parameter is currently +// ignored +func (c *ProductsListCall) CategoryRecommendationsUseGcsConfig(categoryRecommendationsUseGcsConfig bool) *ProductsListCall { + c.opt_["categoryRecommendations.useGcsConfig"] = categoryRecommendationsUseGcsConfig + return c +} + +// Channels sets the optional parameter "channels": Channels +// specification +func (c *ProductsListCall) Channels(channels string) *ProductsListCall { + c.opt_["channels"] = channels + return c +} + +// ClickTracking sets the optional parameter "clickTracking": Whether to +// add a click tracking parameter to offer URLs +func (c *ProductsListCall) ClickTracking(clickTracking bool) *ProductsListCall { + c.opt_["clickTracking"] = clickTracking + return c +} + +// Country sets the optional parameter "country": Country restriction +// (ISO 3166) +func (c *ProductsListCall) Country(country string) *ProductsListCall { + c.opt_["country"] = country + return c +} + +// CrowdBy sets the optional parameter "crowdBy": Crowding specification +func (c *ProductsListCall) CrowdBy(crowdBy string) *ProductsListCall { + c.opt_["crowdBy"] = crowdBy + return c +} + +// Currency sets the optional parameter "currency": Currency restriction +// (ISO 4217) +func (c *ProductsListCall) Currency(currency string) *ProductsListCall { + c.opt_["currency"] = currency + return c +} + +// ExtrasEnabled sets the optional parameter "extras.enabled": Whether +// to return extra information. +func (c *ProductsListCall) ExtrasEnabled(extrasEnabled bool) *ProductsListCall { + c.opt_["extras.enabled"] = extrasEnabled + return c +} + +// ExtrasInfo sets the optional parameter "extras.info": What extra +// information to return. +func (c *ProductsListCall) ExtrasInfo(extrasInfo string) *ProductsListCall { + c.opt_["extras.info"] = extrasInfo + return c +} + +// FacetsDiscover sets the optional parameter "facets.discover": Facets +// to discover +func (c *ProductsListCall) FacetsDiscover(facetsDiscover string) *ProductsListCall { + c.opt_["facets.discover"] = facetsDiscover + return c +} + +// FacetsEnabled sets the optional parameter "facets.enabled": Whether +// to return facet information +func (c *ProductsListCall) FacetsEnabled(facetsEnabled bool) *ProductsListCall { + c.opt_["facets.enabled"] = facetsEnabled + return c +} + +// FacetsInclude sets the optional parameter "facets.include": Facets to +// include (applies when useGcsConfig == false) +func (c *ProductsListCall) FacetsInclude(facetsInclude string) *ProductsListCall { + c.opt_["facets.include"] = facetsInclude + return c +} + +// FacetsIncludeEmptyBuckets sets the optional parameter +// "facets.includeEmptyBuckets": Return empty facet buckets. +func (c *ProductsListCall) FacetsIncludeEmptyBuckets(facetsIncludeEmptyBuckets bool) *ProductsListCall { + c.opt_["facets.includeEmptyBuckets"] = facetsIncludeEmptyBuckets + return c +} + +// FacetsUseGcsConfig sets the optional parameter "facets.useGcsConfig": +// Whether to return facet information as configured in the GCS account +func (c *ProductsListCall) FacetsUseGcsConfig(facetsUseGcsConfig bool) *ProductsListCall { + c.opt_["facets.useGcsConfig"] = facetsUseGcsConfig + return c +} + +// Language sets the optional parameter "language": Language restriction +// (BCP 47) +func (c *ProductsListCall) Language(language string) *ProductsListCall { + c.opt_["language"] = language + return c +} + +// Location sets the optional parameter "location": Location used to +// determine tax and shipping +func (c *ProductsListCall) Location(location string) *ProductsListCall { + c.opt_["location"] = location + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return +func (c *ProductsListCall) MaxResults(maxResults int64) *ProductsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// MaxVariants sets the optional parameter "maxVariants": Maximum number +// of variant results to return per result +func (c *ProductsListCall) MaxVariants(maxVariants int64) *ProductsListCall { + c.opt_["maxVariants"] = maxVariants + return c +} + +// PromotionsEnabled sets the optional parameter "promotions.enabled": +// Whether to return promotion information +func (c *ProductsListCall) PromotionsEnabled(promotionsEnabled bool) *ProductsListCall { + c.opt_["promotions.enabled"] = promotionsEnabled + return c +} + +// PromotionsUseGcsConfig sets the optional parameter +// "promotions.useGcsConfig": Whether to return promotion information as +// configured in the GCS account +func (c *ProductsListCall) PromotionsUseGcsConfig(promotionsUseGcsConfig bool) *ProductsListCall { + c.opt_["promotions.useGcsConfig"] = promotionsUseGcsConfig + return c +} + +// Q sets the optional parameter "q": Search query +func (c *ProductsListCall) Q(q string) *ProductsListCall { + c.opt_["q"] = q + return c +} + +// RankBy sets the optional parameter "rankBy": Ranking specification +func (c *ProductsListCall) RankBy(rankBy string) *ProductsListCall { + c.opt_["rankBy"] = rankBy + return c +} + +// RedirectsEnabled sets the optional parameter "redirects.enabled": +// Whether to return redirect information +func (c *ProductsListCall) RedirectsEnabled(redirectsEnabled bool) *ProductsListCall { + c.opt_["redirects.enabled"] = redirectsEnabled + return c +} + +// RedirectsUseGcsConfig sets the optional parameter +// "redirects.useGcsConfig": Whether to return redirect information as +// configured in the GCS account +func (c *ProductsListCall) RedirectsUseGcsConfig(redirectsUseGcsConfig bool) *ProductsListCall { + c.opt_["redirects.useGcsConfig"] = redirectsUseGcsConfig + return c +} + +// RestrictBy sets the optional parameter "restrictBy": Restriction +// specification +func (c *ProductsListCall) RestrictBy(restrictBy string) *ProductsListCall { + c.opt_["restrictBy"] = restrictBy + return c +} + +// SpellingEnabled sets the optional parameter "spelling.enabled": +// Whether to return spelling suggestions +func (c *ProductsListCall) SpellingEnabled(spellingEnabled bool) *ProductsListCall { + c.opt_["spelling.enabled"] = spellingEnabled + return c +} + +// SpellingUseGcsConfig sets the optional parameter +// "spelling.useGcsConfig": This parameter is currently ignored +func (c *ProductsListCall) SpellingUseGcsConfig(spellingUseGcsConfig bool) *ProductsListCall { + c.opt_["spelling.useGcsConfig"] = spellingUseGcsConfig + return c +} + +// StartIndex sets the optional parameter "startIndex": Index (1-based) +// of first product to return +func (c *ProductsListCall) StartIndex(startIndex int64) *ProductsListCall { + c.opt_["startIndex"] = startIndex + return c +} + +// Taxonomy sets the optional parameter "taxonomy": Taxonomy name +func (c *ProductsListCall) Taxonomy(taxonomy string) *ProductsListCall { + c.opt_["taxonomy"] = taxonomy + return c +} + +// Thumbnails sets the optional parameter "thumbnails": Image thumbnails +// specification +func (c *ProductsListCall) Thumbnails(thumbnails string) *ProductsListCall { + c.opt_["thumbnails"] = thumbnails + return c +} + +// UseCase sets the optional parameter "useCase": One of +// CommerceSearchUseCase, ShoppingApiUseCase +func (c *ProductsListCall) UseCase(useCase string) *ProductsListCall { + c.opt_["useCase"] = useCase + return c +} + +func (c *ProductsListCall) Do() (*Products, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["attributeFilter"]; ok { + params.Set("attributeFilter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["availability"]; ok { + params.Set("availability", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["boostBy"]; ok { + params.Set("boostBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["categories.enabled"]; ok { + params.Set("categories.enabled", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["categories.include"]; ok { + params.Set("categories.include", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["categories.useGcsConfig"]; ok { + params.Set("categories.useGcsConfig", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["categoryRecommendations.category"]; ok { + params.Set("categoryRecommendations.category", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["categoryRecommendations.enabled"]; ok { + params.Set("categoryRecommendations.enabled", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["categoryRecommendations.include"]; ok { + params.Set("categoryRecommendations.include", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["categoryRecommendations.useGcsConfig"]; ok { + params.Set("categoryRecommendations.useGcsConfig", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["channels"]; ok { + params.Set("channels", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["clickTracking"]; ok { + params.Set("clickTracking", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["country"]; ok { + params.Set("country", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["crowdBy"]; ok { + params.Set("crowdBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["currency"]; ok { + params.Set("currency", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["extras.enabled"]; ok { + params.Set("extras.enabled", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["extras.info"]; ok { + params.Set("extras.info", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["facets.discover"]; ok { + params.Set("facets.discover", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["facets.enabled"]; ok { + params.Set("facets.enabled", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["facets.include"]; ok { + params.Set("facets.include", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["facets.includeEmptyBuckets"]; ok { + params.Set("facets.includeEmptyBuckets", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["facets.useGcsConfig"]; ok { + params.Set("facets.useGcsConfig", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["location"]; ok { + params.Set("location", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxVariants"]; ok { + params.Set("maxVariants", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["promotions.enabled"]; ok { + params.Set("promotions.enabled", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["promotions.useGcsConfig"]; ok { + params.Set("promotions.useGcsConfig", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["q"]; ok { + params.Set("q", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["rankBy"]; ok { + params.Set("rankBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["redirects.enabled"]; ok { + params.Set("redirects.enabled", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["redirects.useGcsConfig"]; ok { + params.Set("redirects.useGcsConfig", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["restrictBy"]; ok { + params.Set("restrictBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["spelling.enabled"]; ok { + params.Set("spelling.enabled", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["spelling.useGcsConfig"]; ok { + params.Set("spelling.useGcsConfig", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["taxonomy"]; ok { + params.Set("taxonomy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["thumbnails"]; ok { + params.Set("thumbnails", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["useCase"]; ok { + params.Set("useCase", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative("https://www.googleapis.com/shopping/search/v1/", "{source}/products") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{source}", url.QueryEscape(c.source), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Products) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of products and content modules", + // "httpMethod": "GET", + // "id": "shopping.products.list", + // "parameterOrder": [ + // "source" + // ], + // "parameters": { + // "attributeFilter": { + // "description": "Comma separated list of attributes to return", + // "location": "query", + // "type": "string" + // }, + // "availability": { + // "description": "Comma separated list of availabilities (outOfStock, limited, inStock, backOrder, preOrder, onDisplayToOrder) to return", + // "location": "query", + // "type": "string" + // }, + // "boostBy": { + // "description": "Boosting specification", + // "location": "query", + // "type": "string" + // }, + // "categories.enabled": { + // "description": "Whether to return category information", + // "location": "query", + // "type": "boolean" + // }, + // "categories.include": { + // "description": "Category specification", + // "location": "query", + // "type": "string" + // }, + // "categories.useGcsConfig": { + // "description": "This parameter is currently ignored", + // "location": "query", + // "type": "boolean" + // }, + // "categoryRecommendations.category": { + // "description": "Category for which to retrieve recommendations", + // "location": "query", + // "type": "string" + // }, + // "categoryRecommendations.enabled": { + // "description": "Whether to return category recommendation information", + // "location": "query", + // "type": "boolean" + // }, + // "categoryRecommendations.include": { + // "description": "Category recommendation specification", + // "location": "query", + // "type": "string" + // }, + // "categoryRecommendations.useGcsConfig": { + // "description": "This parameter is currently ignored", + // "location": "query", + // "type": "boolean" + // }, + // "channels": { + // "description": "Channels specification", + // "location": "query", + // "type": "string" + // }, + // "clickTracking": { + // "description": "Whether to add a click tracking parameter to offer URLs", + // "location": "query", + // "type": "boolean" + // }, + // "country": { + // "description": "Country restriction (ISO 3166)", + // "location": "query", + // "type": "string" + // }, + // "crowdBy": { + // "description": "Crowding specification", + // "location": "query", + // "type": "string" + // }, + // "currency": { + // "description": "Currency restriction (ISO 4217)", + // "location": "query", + // "type": "string" + // }, + // "extras.enabled": { + // "description": "Whether to return extra information.", + // "location": "query", + // "type": "boolean" + // }, + // "extras.info": { + // "description": "What extra information to return.", + // "location": "query", + // "type": "string" + // }, + // "facets.discover": { + // "description": "Facets to discover", + // "location": "query", + // "type": "string" + // }, + // "facets.enabled": { + // "description": "Whether to return facet information", + // "location": "query", + // "type": "boolean" + // }, + // "facets.include": { + // "description": "Facets to include (applies when useGcsConfig == false)", + // "location": "query", + // "type": "string" + // }, + // "facets.includeEmptyBuckets": { + // "description": "Return empty facet buckets.", + // "location": "query", + // "type": "boolean" + // }, + // "facets.useGcsConfig": { + // "description": "Whether to return facet information as configured in the GCS account", + // "location": "query", + // "type": "boolean" + // }, + // "language": { + // "description": "Language restriction (BCP 47)", + // "location": "query", + // "type": "string" + // }, + // "location": { + // "description": "Location used to determine tax and shipping", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "maxVariants": { + // "description": "Maximum number of variant results to return per result", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "promotions.enabled": { + // "description": "Whether to return promotion information", + // "location": "query", + // "type": "boolean" + // }, + // "promotions.useGcsConfig": { + // "description": "Whether to return promotion information as configured in the GCS account", + // "location": "query", + // "type": "boolean" + // }, + // "q": { + // "description": "Search query", + // "location": "query", + // "type": "string" + // }, + // "rankBy": { + // "description": "Ranking specification", + // "location": "query", + // "type": "string" + // }, + // "redirects.enabled": { + // "description": "Whether to return redirect information", + // "location": "query", + // "type": "boolean" + // }, + // "redirects.useGcsConfig": { + // "description": "Whether to return redirect information as configured in the GCS account", + // "location": "query", + // "type": "boolean" + // }, + // "restrictBy": { + // "description": "Restriction specification", + // "location": "query", + // "type": "string" + // }, + // "source": { + // "description": "Query source", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "spelling.enabled": { + // "description": "Whether to return spelling suggestions", + // "location": "query", + // "type": "boolean" + // }, + // "spelling.useGcsConfig": { + // "description": "This parameter is currently ignored", + // "location": "query", + // "type": "boolean" + // }, + // "startIndex": { + // "description": "Index (1-based) of first product to return", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "taxonomy": { + // "description": "Taxonomy name", + // "location": "query", + // "type": "string" + // }, + // "thumbnails": { + // "description": "Image thumbnails specification", + // "location": "query", + // "type": "string" + // }, + // "useCase": { + // "description": "One of CommerceSearchUseCase, ShoppingApiUseCase", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{source}/products", + // "response": { + // "$ref": "Products" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/shoppingapi" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/siteverification/v1/siteverification-api.json b/third_party/src/code.google.com/p/google-api-go-client/siteverification/v1/siteverification-api.json new file mode 100644 index 0000000000000..eff2196a2dff0 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/siteverification/v1/siteverification-api.json @@ -0,0 +1,320 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/T-KUOZ6MW3qGb2TywsMrS2SH2E4\"", + "discoveryVersion": "v1", + "id": "siteVerification:v1", + "name": "siteVerification", + "version": "v1", + "title": "Google Site Verification API", + "description": "Lets you programatically verify ownership of websites or domains with Google.", + "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/site-verification/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/siteVerification/v1/", + "basePath": "/siteVerification/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "siteVerification/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": "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/siteverification": { + "description": "Manage the list of sites and domains you control" + }, + "https://www.googleapis.com/auth/siteverification.verify_only": { + "description": "Manage your new site verifications with Google" + } + } + } + }, + "schemas": { + "SiteVerificationWebResourceGettokenRequest": { + "id": "SiteVerificationWebResourceGettokenRequest", + "type": "object", + "properties": { + "site": { + "type": "object", + "description": "The site for which a verification token will be generated.", + "properties": { + "identifier": { + "type": "string", + "description": "The site identifier. If the type is set to SITE, the identifier is a URL. If the type is set to INET_DOMAIN, the site identifier is a domain name." + }, + "type": { + "type": "string", + "description": "The type of resource to be verified. Can be SITE or INET_DOMAIN (domain name)." + } + } + }, + "verificationMethod": { + "type": "string", + "description": "The verification method that will be used to verify this site. For sites, 'FILE' or 'META' methods may be used. For domains, only 'DNS' may be used." + } + } + }, + "SiteVerificationWebResourceGettokenResponse": { + "id": "SiteVerificationWebResourceGettokenResponse", + "type": "object", + "properties": { + "method": { + "type": "string", + "description": "The verification method to use in conjunction with this token. For FILE, the token should be placed in the top-level directory of the site, stored inside a file of the same name. For META, the token should be placed in the HEAD tag of the default page that is loaded for the site. For DNS, the token should be placed in a TXT record of the domain." + }, + "token": { + "type": "string", + "description": "The verification token. The token must be placed appropriately in order for verification to succeed." + } + } + }, + "SiteVerificationWebResourceListResponse": { + "id": "SiteVerificationWebResourceListResponse", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The list of sites that are owned by the authenticated user.", + "items": { + "$ref": "SiteVerificationWebResourceResource" + } + } + } + }, + "SiteVerificationWebResourceResource": { + "id": "SiteVerificationWebResourceResource", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The string used to identify this site. This value should be used in the \"id\" portion of the REST URL for the Get, Update, and Delete operations." + }, + "owners": { + "type": "array", + "description": "The email addresses of all verified owners.", + "items": { + "type": "string" + } + }, + "site": { + "type": "object", + "description": "The address and type of a site that is verified or will be verified.", + "properties": { + "identifier": { + "type": "string", + "description": "The site identifier. If the type is set to SITE, the identifier is a URL. If the type is set to INET_DOMAIN, the site identifier is a domain name." + }, + "type": { + "type": "string", + "description": "The site type. Can be SITE or INET_DOMAIN (domain name)." + } + } + } + } + } + }, + "resources": { + "webResource": { + "methods": { + "delete": { + "id": "siteVerification.webResource.delete", + "path": "webResource/{id}", + "httpMethod": "DELETE", + "description": "Relinquish ownership of a website or domain.", + "parameters": { + "id": { + "type": "string", + "description": "The id of a verified site or domain.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/siteverification" + ] + }, + "get": { + "id": "siteVerification.webResource.get", + "path": "webResource/{id}", + "httpMethod": "GET", + "description": "Get the most current data for a website or domain.", + "parameters": { + "id": { + "type": "string", + "description": "The id of a verified site or domain.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "SiteVerificationWebResourceResource" + }, + "scopes": [ + "https://www.googleapis.com/auth/siteverification" + ] + }, + "getToken": { + "id": "siteVerification.webResource.getToken", + "path": "token", + "httpMethod": "POST", + "description": "Get a verification token for placing on a website or domain.", + "request": { + "$ref": "SiteVerificationWebResourceGettokenRequest" + }, + "response": { + "$ref": "SiteVerificationWebResourceGettokenResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/siteverification", + "https://www.googleapis.com/auth/siteverification.verify_only" + ] + }, + "insert": { + "id": "siteVerification.webResource.insert", + "path": "webResource", + "httpMethod": "POST", + "description": "Attempt verification of a website or domain.", + "parameters": { + "verificationMethod": { + "type": "string", + "description": "The method to use for verifying a site or domain.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "verificationMethod" + ], + "request": { + "$ref": "SiteVerificationWebResourceResource" + }, + "response": { + "$ref": "SiteVerificationWebResourceResource" + }, + "scopes": [ + "https://www.googleapis.com/auth/siteverification", + "https://www.googleapis.com/auth/siteverification.verify_only" + ] + }, + "list": { + "id": "siteVerification.webResource.list", + "path": "webResource", + "httpMethod": "GET", + "description": "Get the list of your verified websites and domains.", + "response": { + "$ref": "SiteVerificationWebResourceListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/siteverification" + ] + }, + "patch": { + "id": "siteVerification.webResource.patch", + "path": "webResource/{id}", + "httpMethod": "PATCH", + "description": "Modify the list of owners for your website or domain. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "The id of a verified site or domain.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "SiteVerificationWebResourceResource" + }, + "response": { + "$ref": "SiteVerificationWebResourceResource" + }, + "scopes": [ + "https://www.googleapis.com/auth/siteverification" + ] + }, + "update": { + "id": "siteVerification.webResource.update", + "path": "webResource/{id}", + "httpMethod": "PUT", + "description": "Modify the list of owners for your website or domain.", + "parameters": { + "id": { + "type": "string", + "description": "The id of a verified site or domain.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "SiteVerificationWebResourceResource" + }, + "response": { + "$ref": "SiteVerificationWebResourceResource" + }, + "scopes": [ + "https://www.googleapis.com/auth/siteverification" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/siteverification/v1/siteverification-gen.go b/third_party/src/code.google.com/p/google-api-go-client/siteverification/v1/siteverification-gen.go new file mode 100644 index 0000000000000..c3bc51df8633b --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/siteverification/v1/siteverification-gen.go @@ -0,0 +1,599 @@ +// Package siteverification provides access to the Google Site Verification API. +// +// See https://developers.google.com/site-verification/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/siteverification/v1" +// ... +// siteverificationService, err := siteverification.New(oauthHttpClient) +package siteverification + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "siteVerification:v1" +const apiName = "siteVerification" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/siteVerification/v1/" + +// OAuth2 scopes used by this API. +const ( + // Manage the list of sites and domains you control + SiteverificationScope = "https://www.googleapis.com/auth/siteverification" + + // Manage your new site verifications with Google + SiteverificationVerify_onlyScope = "https://www.googleapis.com/auth/siteverification.verify_only" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.WebResource = NewWebResourceService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + WebResource *WebResourceService +} + +func NewWebResourceService(s *Service) *WebResourceService { + rs := &WebResourceService{s: s} + return rs +} + +type WebResourceService struct { + s *Service +} + +type SiteVerificationWebResourceGettokenRequest struct { + // Site: The site for which a verification token will be generated. + Site *SiteVerificationWebResourceGettokenRequestSite `json:"site,omitempty"` + + // VerificationMethod: The verification method that will be used to + // verify this site. For sites, 'FILE' or 'META' methods may be used. + // For domains, only 'DNS' may be used. + VerificationMethod string `json:"verificationMethod,omitempty"` +} + +type SiteVerificationWebResourceGettokenRequestSite struct { + // Identifier: The site identifier. If the type is set to SITE, the + // identifier is a URL. If the type is set to INET_DOMAIN, the site + // identifier is a domain name. + Identifier string `json:"identifier,omitempty"` + + // Type: The type of resource to be verified. Can be SITE or INET_DOMAIN + // (domain name). + Type string `json:"type,omitempty"` +} + +type SiteVerificationWebResourceGettokenResponse struct { + // Method: The verification method to use in conjunction with this + // token. For FILE, the token should be placed in the top-level + // directory of the site, stored inside a file of the same name. For + // META, the token should be placed in the HEAD tag of the default page + // that is loaded for the site. For DNS, the token should be placed in a + // TXT record of the domain. + Method string `json:"method,omitempty"` + + // Token: The verification token. The token must be placed appropriately + // in order for verification to succeed. + Token string `json:"token,omitempty"` +} + +type SiteVerificationWebResourceListResponse struct { + // Items: The list of sites that are owned by the authenticated user. + Items []*SiteVerificationWebResourceResource `json:"items,omitempty"` +} + +type SiteVerificationWebResourceResource struct { + // Id: The string used to identify this site. This value should be used + // in the "id" portion of the REST URL for the Get, Update, and Delete + // operations. + Id string `json:"id,omitempty"` + + // Owners: The email addresses of all verified owners. + Owners []string `json:"owners,omitempty"` + + // Site: The address and type of a site that is verified or will be + // verified. + Site *SiteVerificationWebResourceResourceSite `json:"site,omitempty"` +} + +type SiteVerificationWebResourceResourceSite struct { + // Identifier: The site identifier. If the type is set to SITE, the + // identifier is a URL. If the type is set to INET_DOMAIN, the site + // identifier is a domain name. + Identifier string `json:"identifier,omitempty"` + + // Type: The site type. Can be SITE or INET_DOMAIN (domain name). + Type string `json:"type,omitempty"` +} + +// method id "siteVerification.webResource.delete": + +type WebResourceDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Delete: Relinquish ownership of a website or domain. +func (r *WebResourceService) Delete(id string) *WebResourceDeleteCall { + c := &WebResourceDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *WebResourceDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "webResource/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Relinquish ownership of a website or domain.", + // "httpMethod": "DELETE", + // "id": "siteVerification.webResource.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The id of a verified site or domain.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "webResource/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/siteverification" + // ] + // } + +} + +// method id "siteVerification.webResource.get": + +type WebResourceGetCall struct { + s *Service + id string + opt_ map[string]interface{} +} + +// Get: Get the most current data for a website or domain. +func (r *WebResourceService) Get(id string) *WebResourceGetCall { + c := &WebResourceGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +func (c *WebResourceGetCall) Do() (*SiteVerificationWebResourceResource, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "webResource/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SiteVerificationWebResourceResource) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the most current data for a website or domain.", + // "httpMethod": "GET", + // "id": "siteVerification.webResource.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The id of a verified site or domain.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "webResource/{id}", + // "response": { + // "$ref": "SiteVerificationWebResourceResource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/siteverification" + // ] + // } + +} + +// method id "siteVerification.webResource.getToken": + +type WebResourceGetTokenCall struct { + s *Service + siteverificationwebresourcegettokenrequest *SiteVerificationWebResourceGettokenRequest + opt_ map[string]interface{} +} + +// GetToken: Get a verification token for placing on a website or +// domain. +func (r *WebResourceService) GetToken(siteverificationwebresourcegettokenrequest *SiteVerificationWebResourceGettokenRequest) *WebResourceGetTokenCall { + c := &WebResourceGetTokenCall{s: r.s, opt_: make(map[string]interface{})} + c.siteverificationwebresourcegettokenrequest = siteverificationwebresourcegettokenrequest + return c +} + +func (c *WebResourceGetTokenCall) Do() (*SiteVerificationWebResourceGettokenResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourcegettokenrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "token") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SiteVerificationWebResourceGettokenResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a verification token for placing on a website or domain.", + // "httpMethod": "POST", + // "id": "siteVerification.webResource.getToken", + // "path": "token", + // "request": { + // "$ref": "SiteVerificationWebResourceGettokenRequest" + // }, + // "response": { + // "$ref": "SiteVerificationWebResourceGettokenResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/siteverification", + // "https://www.googleapis.com/auth/siteverification.verify_only" + // ] + // } + +} + +// method id "siteVerification.webResource.insert": + +type WebResourceInsertCall struct { + s *Service + verificationMethod string + siteverificationwebresourceresource *SiteVerificationWebResourceResource + opt_ map[string]interface{} +} + +// Insert: Attempt verification of a website or domain. +func (r *WebResourceService) Insert(verificationMethod string, siteverificationwebresourceresource *SiteVerificationWebResourceResource) *WebResourceInsertCall { + c := &WebResourceInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.verificationMethod = verificationMethod + c.siteverificationwebresourceresource = siteverificationwebresourceresource + return c +} + +func (c *WebResourceInsertCall) Do() (*SiteVerificationWebResourceResource, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourceresource) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + params.Set("verificationMethod", fmt.Sprintf("%v", c.verificationMethod)) + urls := googleapi.ResolveRelative(c.s.BasePath, "webResource") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SiteVerificationWebResourceResource) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Attempt verification of a website or domain.", + // "httpMethod": "POST", + // "id": "siteVerification.webResource.insert", + // "parameterOrder": [ + // "verificationMethod" + // ], + // "parameters": { + // "verificationMethod": { + // "description": "The method to use for verifying a site or domain.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "webResource", + // "request": { + // "$ref": "SiteVerificationWebResourceResource" + // }, + // "response": { + // "$ref": "SiteVerificationWebResourceResource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/siteverification", + // "https://www.googleapis.com/auth/siteverification.verify_only" + // ] + // } + +} + +// method id "siteVerification.webResource.list": + +type WebResourceListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Get the list of your verified websites and domains. +func (r *WebResourceService) List() *WebResourceListCall { + c := &WebResourceListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *WebResourceListCall) Do() (*SiteVerificationWebResourceListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "webResource") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SiteVerificationWebResourceListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the list of your verified websites and domains.", + // "httpMethod": "GET", + // "id": "siteVerification.webResource.list", + // "path": "webResource", + // "response": { + // "$ref": "SiteVerificationWebResourceListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/siteverification" + // ] + // } + +} + +// method id "siteVerification.webResource.patch": + +type WebResourcePatchCall struct { + s *Service + id string + siteverificationwebresourceresource *SiteVerificationWebResourceResource + opt_ map[string]interface{} +} + +// Patch: Modify the list of owners for your website or domain. This +// method supports patch semantics. +func (r *WebResourceService) Patch(id string, siteverificationwebresourceresource *SiteVerificationWebResourceResource) *WebResourcePatchCall { + c := &WebResourcePatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.siteverificationwebresourceresource = siteverificationwebresourceresource + return c +} + +func (c *WebResourcePatchCall) Do() (*SiteVerificationWebResourceResource, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourceresource) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "webResource/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SiteVerificationWebResourceResource) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Modify the list of owners for your website or domain. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "siteVerification.webResource.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The id of a verified site or domain.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "webResource/{id}", + // "request": { + // "$ref": "SiteVerificationWebResourceResource" + // }, + // "response": { + // "$ref": "SiteVerificationWebResourceResource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/siteverification" + // ] + // } + +} + +// method id "siteVerification.webResource.update": + +type WebResourceUpdateCall struct { + s *Service + id string + siteverificationwebresourceresource *SiteVerificationWebResourceResource + opt_ map[string]interface{} +} + +// Update: Modify the list of owners for your website or domain. +func (r *WebResourceService) Update(id string, siteverificationwebresourceresource *SiteVerificationWebResourceResource) *WebResourceUpdateCall { + c := &WebResourceUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.siteverificationwebresourceresource = siteverificationwebresourceresource + return c +} + +func (c *WebResourceUpdateCall) Do() (*SiteVerificationWebResourceResource, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourceresource) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "webResource/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{id}", url.QueryEscape(c.id), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SiteVerificationWebResourceResource) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Modify the list of owners for your website or domain.", + // "httpMethod": "PUT", + // "id": "siteVerification.webResource.update", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The id of a verified site or domain.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "webResource/{id}", + // "request": { + // "$ref": "SiteVerificationWebResourceResource" + // }, + // "response": { + // "$ref": "SiteVerificationWebResourceResource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/siteverification" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/spectrum/v1explorer/spectrum-api.json b/third_party/src/code.google.com/p/google-api-go-client/spectrum/v1explorer/spectrum-api.json new file mode 100644 index 0000000000000..e406367a8c1d0 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/spectrum/v1explorer/spectrum-api.json @@ -0,0 +1,991 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/W1KBbX-gDHMUVgPHQ9VDTGhsP9o\"", + "discoveryVersion": "v1", + "id": "spectrum:v1explorer", + "name": "spectrum", + "version": "v1explorer", + "title": "Google Spectrum Database API", + "description": "API for spectrum-management functions.", + "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/spectrum", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/spectrum/v1explorer/paws/", + "basePath": "/spectrum/v1explorer/paws/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "spectrum/v1explorer/paws/", + "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" + } + }, + "schemas": { + "AntennaCharacteristics": { + "id": "AntennaCharacteristics", + "type": "object", + "description": "Antenna characteristics provide additional information, such as the antenna height, antenna type, etc. Whether antenna characteristics must be provided in a request depends on the device type and regulatory domain.", + "properties": { + "height": { + "type": "number", + "description": "The antenna height in meters. Whether the antenna height is required depends on the device type and the regulatory domain. Note that the height may be negative.", + "format": "double" + }, + "heightType": { + "type": "string", + "description": "If the height is required, then the height type (AGL for above ground level or AMSL for above mean sea level) is also required. The default is AGL." + }, + "heightUncertainty": { + "type": "number", + "description": "The height uncertainty in meters. Whether this is required depends on the regulatory domain.", + "format": "double" + } + } + }, + "DatabaseSpec": { + "id": "DatabaseSpec", + "type": "object", + "description": "This message contains the name and URI of a database.", + "properties": { + "name": { + "type": "string", + "description": "The display name for a database." + }, + "uri": { + "type": "string", + "description": "The corresponding URI of the database." + } + } + }, + "DbUpdateSpec": { + "id": "DbUpdateSpec", + "type": "object", + "description": "This message is provided by the database to notify devices of an upcoming change to the database URI.", + "properties": { + "databases": { + "type": "array", + "description": "A required list of one or more databases. A device should update its preconfigured list of databases to replace (only) the database that provided the response with the specified entries.", + "items": { + "$ref": "DatabaseSpec" + } + } + } + }, + "DeviceCapabilities": { + "id": "DeviceCapabilities", + "type": "object", + "description": "Device capabilities provide additional information that may be used by a device to provide additional information to the database that may help it to determine available spectrum. If the database does not support device capabilities it will ignore the parameter altogether.", + "properties": { + "frequencyRanges": { + "type": "array", + "description": "An optional list of frequency ranges supported by the device. Each element must contain start and stop frequencies in which the device can operate. Channel identifiers are optional. When specified, the database should not return available spectrum that falls outside these ranges or channel IDs.", + "items": { + "$ref": "FrequencyRange" + } + } + } + }, + "DeviceDescriptor": { + "id": "DeviceDescriptor", + "type": "object", + "description": "The device descriptor contains parameters that identify the specific device, such as its manufacturer serial number, regulatory-specific identifier (e.g., FCC ID), and any other device characteristics required by regulatory domains.", + "properties": { + "etsiEnDeviceCategory": { + "type": "string", + "description": "Specifies the ETSI white space device category. Valid values are the strings master and slave. This field is case-insensitive. Consult the ETSI documentation for details about the device types." + }, + "etsiEnDeviceEmissionsClass": { + "type": "string", + "description": "Specifies the ETSI white space device emissions class. The values are represented by numeric strings, such as 1, 2, etc. Consult the ETSI documentation for details about the device types." + }, + "etsiEnDeviceType": { + "type": "string", + "description": "Specifies the ETSI white space device type. Valid values are single-letter strings, such as A, B, etc. Consult the ETSI documentation for details about the device types." + }, + "etsiEnTechnologyId": { + "type": "string", + "description": "Specifies the ETSI white space device technology identifier. The string value must not exceed 64 characters in length. Consult the ETSI documentation for details about the device types." + }, + "fccId": { + "type": "string", + "description": "Specifies the device's FCC certification identifier. The value is an identifier string whose length should not exceed 32 characters. Note that, in practice, a valid FCC ID may be limited to 19 characters." + }, + "fccTvbdDeviceType": { + "type": "string", + "description": "Specifies the TV Band White Space device type, as defined by the FCC. Valid values are FIXED, MODE_1, MODE_2." + }, + "manufacturerId": { + "type": "string", + "description": "The manufacturer's ID may be required by the regulatory domain. This should represent the name of the device manufacturer, should be consistent across all devices from the same manufacturer, and should be distinct from that of other manufacturers. The string value must not exceed 64 characters in length." + }, + "modelId": { + "type": "string", + "description": "The device's model ID may be required by the regulatory domain. The string value must not exceed 64 characters in length." + }, + "rulesetIds": { + "type": "array", + "description": "The list of identifiers for rulesets supported by the device. A database may require that the device provide this list before servicing the device requests. If the database does not support any of the rulesets specified in the list, the database may refuse to service the device requests. If present, the list must contain at least one entry.\n\nFor information about the valid requests, see section 9.2 of the PAWS specification. Currently, FccTvBandWhiteSpace-2010 is the only supported ruleset.", + "items": { + "type": "string" + } + }, + "serialNumber": { + "type": "string", + "description": "The manufacturer's device serial number; required by the applicable regulatory domain. The length of the value must not exceed 64 characters." + } + } + }, + "DeviceOwner": { + "id": "DeviceOwner", + "type": "object", + "description": "This parameter contains device-owner information required as part of device registration. The regulatory domains may require additional parameters.\n\nAll contact information must be expressed using the structure defined by the vCard format specification. Only the contact fields of vCard are supported: \n- fn: Full name of an individual \n- org: Name of the organization \n- adr: Address fields \n- tel: Telephone numbers \n- email: Email addresses \n\nNote that the vCard specification defines maximum lengths for each field.", + "properties": { + "operator": { + "$ref": "Vcard", + "description": "The vCard contact information for the device operator is optional, but may be required by specific regulatory domains." + }, + "owner": { + "$ref": "Vcard", + "description": "The vCard contact information for the individual or business that owns the device is required." + } + } + }, + "DeviceValidity": { + "id": "DeviceValidity", + "type": "object", + "description": "The device validity element describes whether a particular device is valid to operate in the regulatory domain.", + "properties": { + "deviceDesc": { + "$ref": "DeviceDescriptor", + "description": "The descriptor of the device for which the validity check was requested. It will always be present." + }, + "isValid": { + "type": "boolean", + "description": "The validity status: true if the device is valid for operation, false otherwise. It will always be present." + }, + "reason": { + "type": "string", + "description": "If the device identifier is not valid, the database may include a reason. The reason may be in any language. The length of the value should not exceed 128 characters." + } + } + }, + "EventTime": { + "id": "EventTime", + "type": "object", + "description": "The start and stop times of an event. This is used to indicate the time period for which a spectrum profile is valid.\n\nBoth times are expressed using the format, YYYY-MM-DDThh:mm:ssZ, as defined in RFC3339. The times must be expressed using UTC.", + "properties": { + "startTime": { + "type": "string", + "description": "The inclusive start of the event. It will be present." + }, + "stopTime": { + "type": "string", + "description": "The exclusive end of the event. It will be present." + } + } + }, + "FrequencyRange": { + "id": "FrequencyRange", + "type": "object", + "description": "A specific range of frequencies together with the associated maximum power level and channel identifier.", + "properties": { + "channelId": { + "type": "string", + "description": "The database may include a channel identifier, when applicable. When it is included, the device should treat it as informative. The length of the identifier should not exceed 16 characters." + }, + "maxPowerDBm": { + "type": "number", + "description": "The maximum total power level (EIRP)—computed over the corresponding operating bandwidth—that is permitted within the frequency range. Depending on the context in which the frequency-range element appears, this value may be required. For example, it is required in the available-spectrum response, available-spectrum-batch response, and spectrum-use notification message, but it should not be present (it is not applicable) when the frequency range appears inside a device-capabilities message.", + "format": "double" + }, + "startHz": { + "type": "number", + "description": "The required inclusive start of the frequency range (in Hertz).", + "format": "double" + }, + "stopHz": { + "type": "number", + "description": "The required exclusive end of the frequency range (in Hertz).", + "format": "double" + } + } + }, + "GeoLocation": { + "id": "GeoLocation", + "type": "object", + "description": "This parameter is used to specify the geolocation of the device.", + "properties": { + "confidence": { + "type": "integer", + "description": "The location confidence level, as an integer percentage, may be required, depending on the regulatory domain. When the parameter is optional and not provided, its value is assumed to be 95. Valid values range from 0 to 99, since, in practice, 100-percent confidence is not achievable. The confidence value is meaningful only when geolocation refers to a point with uncertainty.", + "format": "int32" + }, + "point": { + "$ref": "GeoLocationEllipse", + "description": "If present, indicates that the geolocation represents a point. Paradoxically, a point is parameterized using an ellipse, where the center represents the location of the point and the distances along the major and minor axes represent the uncertainty. The uncertainty values may be required, depending on the regulatory domain." + }, + "region": { + "$ref": "GeoLocationPolygon", + "description": "If present, indicates that the geolocation represents a region. Database support for regions is optional." + } + } + }, + "GeoLocationEllipse": { + "id": "GeoLocationEllipse", + "type": "object", + "description": "A \"point\" with uncertainty is represented using the Ellipse shape.", + "properties": { + "center": { + "$ref": "GeoLocationPoint", + "description": "A required geo-spatial point representing the center of the ellipse." + }, + "orientation": { + "type": "number", + "description": "A floating-point number that expresses the orientation of the ellipse, representing the rotation, in degrees, of the semi-major axis from North towards the East. For example, when the uncertainty is greatest along the North-South direction, orientation is 0 degrees; conversely, if the uncertainty is greatest along the East-West direction, orientation is 90 degrees. When orientation is not present, the orientation is assumed to be 0.", + "format": "double" + }, + "semiMajorAxis": { + "type": "number", + "description": "A floating-point number that expresses the location uncertainty along the major axis of the ellipse. May be required by the regulatory domain. When the uncertainty is optional, the default value is 0.", + "format": "double" + }, + "semiMinorAxis": { + "type": "number", + "description": "A floating-point number that expresses the location uncertainty along the minor axis of the ellipse. May be required by the regulatory domain. When the uncertainty is optional, the default value is 0.", + "format": "double" + } + } + }, + "GeoLocationPoint": { + "id": "GeoLocationPoint", + "type": "object", + "description": "A single geolocation on the globe.", + "properties": { + "latitude": { + "type": "number", + "description": "A required floating-point number that expresses the latitude in degrees using the WGS84 datum. For details on this encoding, see the National Imagery and Mapping Agency's Technical Report TR8350.2.", + "format": "double" + }, + "longitude": { + "type": "number", + "description": "A required floating-point number that expresses the longitude in degrees using the WGS84 datum. For details on this encoding, see the National Imagery and Mapping Agency's Technical Report TR8350.2.", + "format": "double" + } + } + }, + "GeoLocationPolygon": { + "id": "GeoLocationPolygon", + "type": "object", + "description": "A region is represented using the polygonal shape.", + "properties": { + "exterior": { + "type": "array", + "description": "When the geolocation describes a region, the exterior field refers to a list of latitude/longitude points that represent the vertices of a polygon. The first and last points must be the same. Thus, a minimum of four points is required. The following polygon restrictions from RFC5491 apply: \n- A connecting line shall not cross another connecting line of the same polygon. \n- The vertices must be defined in a counterclockwise order. \n- The edges of a polygon are defined by the shortest path between two points in space (not a geodesic curve). Consequently, the length between two adjacent vertices should be restricted to a maximum of 130 km. \n- All vertices are assumed to be at the same altitude. \n- Polygon shapes should be restricted to a maximum of 15 vertices (16 points that include the repeated vertex).", + "items": { + "$ref": "GeoLocationPoint" + } + } + } + }, + "GeoSpectrumSchedule": { + "id": "GeoSpectrumSchedule", + "type": "object", + "description": "The schedule of spectrum profiles available at a particular geolocation.", + "properties": { + "location": { + "$ref": "GeoLocation", + "description": "The geolocation identifies the location at which the spectrum schedule applies. It will always be present." + }, + "spectrumSchedules": { + "type": "array", + "description": "A list of available spectrum profiles and associated times. It will always be present, and at least one schedule must be included (though it may be empty if there is no available spectrum). More than one schedule may be included to represent future changes to the available spectrum.", + "items": { + "$ref": "SpectrumSchedule" + } + } + } + }, + "PawsGetSpectrumBatchRequest": { + "id": "PawsGetSpectrumBatchRequest", + "type": "object", + "description": "The request message for a batch available spectrum query protocol.", + "properties": { + "antenna": { + "$ref": "AntennaCharacteristics", + "description": "Depending on device type and regulatory domain, antenna characteristics may be required." + }, + "capabilities": { + "$ref": "DeviceCapabilities", + "description": "The master device may include its device capabilities to limit the available-spectrum batch response to the spectrum that is compatible with its capabilities. The database should not return spectrum that is incompatible with the specified capabilities." + }, + "deviceDesc": { + "$ref": "DeviceDescriptor", + "description": "When the available spectrum request is made on behalf of a specific device (a master or slave device), device descriptor information for the device on whose behalf the request is made is required (in such cases, the requestType parameter must be empty). When a requestType value is specified, device descriptor information may be optional or required according to the rules of the applicable regulatory domain." + }, + "locations": { + "type": "array", + "description": "A geolocation list is required. This allows a device to specify its current location plus additional anticipated locations when allowed by the regulatory domain. At least one location must be included. Geolocation must be given as the location of the radiation center of the device's antenna. If a location specifies a region, rather than a point, the database may return an UNIMPLEMENTED error if it does not support query by region.\n\nThere is no upper limit on the number of locations included in a available spectrum batch request, but the database may restrict the number of locations it supports by returning a response with fewer locations than specified in the batch request. Note that geolocations must be those of the master device (a device with geolocation capability that makes an available spectrum batch request), whether the master device is making the request on its own behalf or on behalf of a slave device (one without geolocation capability).", + "items": { + "$ref": "GeoLocation" + } + }, + "masterDeviceDesc": { + "$ref": "DeviceDescriptor", + "description": "When an available spectrum batch request is made by the master device (a device with geolocation capability) on behalf of a slave device (a device without geolocation capability), the rules of the applicable regulatory domain may require the master device to provide its own device descriptor information (in addition to device descriptor information for the slave device in a separate parameter)." + }, + "owner": { + "$ref": "DeviceOwner", + "description": "Depending on device type and regulatory domain, device owner information may be included in an available spectrum batch request. This allows the device to register and get spectrum-availability information in a single request." + }, + "requestType": { + "type": "string", + "description": "The request type parameter is an optional parameter that can be used to modify an available spectrum batch request, but its use depends on applicable regulatory rules. For example, It may be used to request generic slave device parameters without having to specify the device descriptor for a specific device. When the requestType parameter is missing, the request is for a specific device (master or slave), and the device descriptor parameter for the device on whose behalf the batch request is made is required." + }, + "type": { + "type": "string", + "description": "The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...).\n\nRequired field." + }, + "version": { + "type": "string", + "description": "The PAWS version. Must be exactly 1.0.\n\nRequired field." + } + } + }, + "PawsGetSpectrumBatchResponse": { + "id": "PawsGetSpectrumBatchResponse", + "type": "object", + "description": "The response message for the batch available spectrum query contains a schedule of available spectrum for the device at multiple locations.", + "properties": { + "databaseChange": { + "$ref": "DbUpdateSpec", + "description": "A database may include the databaseChange parameter to notify a device of a change to its database URI, providing one or more alternate database URIs. The device should use this information to update its list of pre-configured databases by (only) replacing its entry for the responding database with the list of alternate URIs." + }, + "deviceDesc": { + "$ref": "DeviceDescriptor", + "description": "The database must return in its available spectrum response the device descriptor information it received in the master device's available spectrum batch request." + }, + "geoSpectrumSchedules": { + "type": "array", + "description": "The available spectrum batch response must contain a geo-spectrum schedule list, The list may be empty if spectrum is not available. The database may return more than one geo-spectrum schedule to represent future changes to the available spectrum. How far in advance a schedule may be provided depends upon the applicable regulatory domain. The database may return available spectrum for fewer geolocations than requested. The device must not make assumptions about the order of the entries in the list, and must use the geolocation value in each geo-spectrum schedule entry to match available spectrum to a location.", + "items": { + "$ref": "GeoSpectrumSchedule" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"spectrum#pawsGetSpectrumBatchResponse\".", + "default": "spectrum#pawsGetSpectrumBatchResponse" + }, + "maxContiguousBwHz": { + "type": "number", + "description": "The database may return a constraint on the allowed maximum contiguous bandwidth (in Hertz). A regulatory domain may require the database to return this parameter. When this parameter is present in the response, the device must apply this constraint to its spectrum-selection logic to ensure that no single block of spectrum has bandwidth that exceeds this value.", + "format": "double" + }, + "maxTotalBwHz": { + "type": "number", + "description": "The database may return a constraint on the allowed maximum total bandwidth (in Hertz), which does not need to be contiguous. A regulatory domain may require the database to return this parameter. When this parameter is present in the available spectrum batch response, the device must apply this constraint to its spectrum-selection logic to ensure that total bandwidth does not exceed this value.", + "format": "double" + }, + "needsSpectrumReport": { + "type": "boolean", + "description": "For regulatory domains that require a spectrum-usage report from devices, the database must return true for this parameter if the geo-spectrum schedules list is not empty; otherwise, the database should either return false or omit this parameter. If this parameter is present and its value is true, the device must send a spectrum use notify message to the database; otherwise, the device should not send the notification." + }, + "rulesetInfo": { + "$ref": "RulesetInfo", + "description": "The database should return ruleset information, which identifies the applicable regulatory authority and ruleset for the available spectrum batch response. If included, the device must use the corresponding ruleset to interpret the response. Values provided in the returned ruleset information, such as maxLocationChange, take precedence over any conflicting values provided in the ruleset information returned in a prior initialization response sent by the database to the device." + }, + "timestamp": { + "type": "string", + "description": "The database includes a timestamp of the form, YYYY-MM-DDThh:mm:ssZ (Internet timestamp format per RFC3339), in its available spectrum batch response. The timestamp should be used by the device as a reference for the start and stop times specified in the response spectrum schedules." + }, + "type": { + "type": "string", + "description": "The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...).\n\nRequired field." + }, + "version": { + "type": "string", + "description": "The PAWS version. Must be exactly 1.0.\n\nRequired field." + } + } + }, + "PawsGetSpectrumRequest": { + "id": "PawsGetSpectrumRequest", + "type": "object", + "description": "The request message for the available spectrum query protocol which must include the device's geolocation.", + "properties": { + "antenna": { + "$ref": "AntennaCharacteristics", + "description": "Depending on device type and regulatory domain, the characteristics of the antenna may be required." + }, + "capabilities": { + "$ref": "DeviceCapabilities", + "description": "The master device may include its device capabilities to limit the available-spectrum response to the spectrum that is compatible with its capabilities. The database should not return spectrum that is incompatible with the specified capabilities." + }, + "deviceDesc": { + "$ref": "DeviceDescriptor", + "description": "When the available spectrum request is made on behalf of a specific device (a master or slave device), device descriptor information for that device is required (in such cases, the requestType parameter must be empty). When a requestType value is specified, device descriptor information may be optional or required according to the rules of the applicable regulatory domain." + }, + "location": { + "$ref": "GeoLocation", + "description": "The geolocation of the master device (a device with geolocation capability that makes an available spectrum request) is required whether the master device is making the request on its own behalf or on behalf of a slave device (one without geolocation capability). The location must be the location of the radiation center of the master device's antenna. To support mobile devices, a regulatory domain may allow the anticipated position of the master device to be given instead. If the location specifies a region, rather than a point, the database may return an UNIMPLEMENTED error code if it does not support query by region." + }, + "masterDeviceDesc": { + "$ref": "DeviceDescriptor", + "description": "When an available spectrum request is made by the master device (a device with geolocation capability) on behalf of a slave device (a device without geolocation capability), the rules of the applicable regulatory domain may require the master device to provide its own device descriptor information (in addition to device descriptor information for the slave device, which is provided in a separate parameter)." + }, + "owner": { + "$ref": "DeviceOwner", + "description": "Depending on device type and regulatory domain, device owner information may be included in an available spectrum request. This allows the device to register and get spectrum-availability information in a single request." + }, + "requestType": { + "type": "string", + "description": "The request type parameter is an optional parameter that can be used to modify an available spectrum request, but its use depends on applicable regulatory rules. It may be used, for example, to request generic slave device parameters without having to specify the device descriptor for a specific device. When the requestType parameter is missing, the request is for a specific device (master or slave), and the deviceDesc parameter for the device on whose behalf the request is made is required." + }, + "type": { + "type": "string", + "description": "The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...).\n\nRequired field." + }, + "version": { + "type": "string", + "description": "The PAWS version. Must be exactly 1.0.\n\nRequired field." + } + } + }, + "PawsGetSpectrumResponse": { + "id": "PawsGetSpectrumResponse", + "type": "object", + "description": "The response message for the available spectrum query which contains a schedule of available spectrum for the device.", + "properties": { + "databaseChange": { + "$ref": "DbUpdateSpec", + "description": "A database may include the databaseChange parameter to notify a device of a change to its database URI, providing one or more alternate database URIs. The device should use this information to update its list of pre-configured databases by (only) replacing its entry for the responding database with the list of alternate URIs." + }, + "deviceDesc": { + "$ref": "DeviceDescriptor", + "description": "The database must return, in its available spectrum response, the device descriptor information it received in the master device's available spectrum request." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"spectrum#pawsGetSpectrumResponse\".", + "default": "spectrum#pawsGetSpectrumResponse" + }, + "maxContiguousBwHz": { + "type": "number", + "description": "The database may return a constraint on the allowed maximum contiguous bandwidth (in Hertz). A regulatory domain may require the database to return this parameter. When this parameter is present in the response, the device must apply this constraint to its spectrum-selection logic to ensure that no single block of spectrum has bandwidth that exceeds this value.", + "format": "double" + }, + "maxTotalBwHz": { + "type": "number", + "description": "The database may return a constraint on the allowed maximum total bandwidth (in Hertz), which need not be contiguous. A regulatory domain may require the database to return this parameter. When this parameter is present in the available spectrum response, the device must apply this constraint to its spectrum-selection logic to ensure that total bandwidth does not exceed this value.", + "format": "double" + }, + "needsSpectrumReport": { + "type": "boolean", + "description": "For regulatory domains that require a spectrum-usage report from devices, the database must return true for this parameter if the spectrum schedule list is not empty; otherwise, the database will either return false or omit this parameter. If this parameter is present and its value is true, the device must send a spectrum use notify message to the database; otherwise, the device must not send the notification." + }, + "rulesetInfo": { + "$ref": "RulesetInfo", + "description": "The database should return ruleset information, which identifies the applicable regulatory authority and ruleset for the available spectrum response. If included, the device must use the corresponding ruleset to interpret the response. Values provided in the returned ruleset information, such as maxLocationChange, take precedence over any conflicting values provided in the ruleset information returned in a prior initialization response sent by the database to the device." + }, + "spectrumSchedules": { + "type": "array", + "description": "The available spectrum response must contain a spectrum schedule list. The list may be empty if spectrum is not available. The database may return more than one spectrum schedule to represent future changes to the available spectrum. How far in advance a schedule may be provided depends on the applicable regulatory domain.", + "items": { + "$ref": "SpectrumSchedule" + } + }, + "timestamp": { + "type": "string", + "description": "The database includes a timestamp of the form YYYY-MM-DDThh:mm:ssZ (Internet timestamp format per RFC3339) in its available spectrum response. The timestamp should be used by the device as a reference for the start and stop times specified in the response spectrum schedules." + }, + "type": { + "type": "string", + "description": "The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...).\n\nRequired field." + }, + "version": { + "type": "string", + "description": "The PAWS version. Must be exactly 1.0.\n\nRequired field." + } + } + }, + "PawsInitRequest": { + "id": "PawsInitRequest", + "type": "object", + "description": "The initialization request message allows the master device to initiate exchange of capabilities with the database.", + "properties": { + "deviceDesc": { + "$ref": "DeviceDescriptor", + "description": "The DeviceDescriptor parameter is required. If the database does not support the device or any of the rulesets specified in the device descriptor, it must return an UNSUPPORTED error code in the error response." + }, + "location": { + "$ref": "GeoLocation", + "description": "A device's geolocation is required." + }, + "type": { + "type": "string", + "description": "The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...).\n\nRequired field." + }, + "version": { + "type": "string", + "description": "The PAWS version. Must be exactly 1.0.\n\nRequired field." + } + } + }, + "PawsInitResponse": { + "id": "PawsInitResponse", + "type": "object", + "description": "The initialization response message communicates database parameters to the requesting device.", + "properties": { + "databaseChange": { + "$ref": "DbUpdateSpec", + "description": "A database may include the databaseChange parameter to notify a device of a change to its database URI, providing one or more alternate database URIs. The device should use this information to update its list of pre-configured databases by (only) replacing its entry for the responding database with the list of alternate URIs." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"spectrum#pawsInitResponse\".", + "default": "spectrum#pawsInitResponse" + }, + "rulesetInfo": { + "$ref": "RulesetInfo", + "description": "The rulesetInfo parameter must be included in the response. This parameter specifies the regulatory domain and parameters applicable to that domain. The database must include the authority field, which defines the regulatory domain for the location specified in the INIT_REQ message." + }, + "type": { + "type": "string", + "description": "The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...).\n\nRequired field." + }, + "version": { + "type": "string", + "description": "The PAWS version. Must be exactly 1.0.\n\nRequired field." + } + } + }, + "PawsNotifySpectrumUseRequest": { + "id": "PawsNotifySpectrumUseRequest", + "type": "object", + "description": "The spectrum-use notification message which must contain the geolocation of the Device and parameters required by the regulatory domain.", + "properties": { + "deviceDesc": { + "$ref": "DeviceDescriptor", + "description": "Device descriptor information is required in the spectrum-use notification message." + }, + "location": { + "$ref": "GeoLocation", + "description": "The geolocation of the master device (the device that is sending the spectrum-use notification) to the database is required in the spectrum-use notification message." + }, + "spectra": { + "type": "array", + "description": "A spectrum list is required in the spectrum-use notification. The list specifies the spectrum that the device expects to use, which includes frequency ranges and maximum power levels. The list may be empty if the device decides not to use any of spectrum. For consistency, the psdBandwidthHz value should match that from one of the spectrum elements in the corresponding available spectrum response previously sent to the device by the database. Note that maximum power levels in the spectrum element must be expressed as power spectral density over the specified psdBandwidthHz value. The actual bandwidth to be used (as computed from the start and stop frequencies) may be different from the psdBandwidthHz value. As an example, when regulatory rules express maximum power spectral density in terms of maximum power over any 100 kHz band, then the psdBandwidthHz value should be set to 100 kHz, even though the actual bandwidth used can be 20 kHz.", + "items": { + "$ref": "SpectrumMessage" + } + }, + "type": { + "type": "string", + "description": "The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...).\n\nRequired field." + }, + "version": { + "type": "string", + "description": "The PAWS version. Must be exactly 1.0.\n\nRequired field." + } + } + }, + "PawsNotifySpectrumUseResponse": { + "id": "PawsNotifySpectrumUseResponse", + "type": "object", + "description": "An empty response to the notification.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"spectrum#pawsNotifySpectrumUseResponse\".", + "default": "spectrum#pawsNotifySpectrumUseResponse" + }, + "type": { + "type": "string", + "description": "The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...).\n\nRequired field." + }, + "version": { + "type": "string", + "description": "The PAWS version. Must be exactly 1.0.\n\nRequired field." + } + } + }, + "PawsRegisterRequest": { + "id": "PawsRegisterRequest", + "type": "object", + "description": "The registration request message contains the required registration parameters.", + "properties": { + "antenna": { + "$ref": "AntennaCharacteristics", + "description": "Antenna characteristics, including its height and height type." + }, + "deviceDesc": { + "$ref": "DeviceDescriptor", + "description": "A DeviceDescriptor is required." + }, + "deviceOwner": { + "$ref": "DeviceOwner", + "description": "Device owner information is required." + }, + "location": { + "$ref": "GeoLocation", + "description": "A device's geolocation is required." + }, + "type": { + "type": "string", + "description": "The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...).\n\nRequired field." + }, + "version": { + "type": "string", + "description": "The PAWS version. Must be exactly 1.0.\n\nRequired field." + } + } + }, + "PawsRegisterResponse": { + "id": "PawsRegisterResponse", + "type": "object", + "description": "The registration response message simply acknowledges receipt of the request and is otherwise empty.", + "properties": { + "databaseChange": { + "$ref": "DbUpdateSpec", + "description": "A database may include the databaseChange parameter to notify a device of a change to its database URI, providing one or more alternate database URIs. The device should use this information to update its list of pre-configured databases by (only) replacing its entry for the responding database with the list of alternate URIs." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"spectrum#pawsRegisterResponse\".", + "default": "spectrum#pawsRegisterResponse" + }, + "type": { + "type": "string", + "description": "The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...).\n\nRequired field." + }, + "version": { + "type": "string", + "description": "The PAWS version. Must be exactly 1.0.\n\nRequired field." + } + } + }, + "PawsVerifyDeviceRequest": { + "id": "PawsVerifyDeviceRequest", + "type": "object", + "description": "The device validation request message.", + "properties": { + "deviceDescs": { + "type": "array", + "description": "A list of device descriptors, which specifies the slave devices to be validated, is required.", + "items": { + "$ref": "DeviceDescriptor" + } + }, + "type": { + "type": "string", + "description": "The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...).\n\nRequired field." + }, + "version": { + "type": "string", + "description": "The PAWS version. Must be exactly 1.0.\n\nRequired field." + } + } + }, + "PawsVerifyDeviceResponse": { + "id": "PawsVerifyDeviceResponse", + "type": "object", + "description": "The device validation response message.", + "properties": { + "databaseChange": { + "$ref": "DbUpdateSpec", + "description": "A database may include the databaseChange parameter to notify a device of a change to its database URI, providing one or more alternate database URIs. The device should use this information to update its list of pre-configured databases by (only) replacing its entry for the responding database with the list of alternate URIs." + }, + "deviceValidities": { + "type": "array", + "description": "A device validities list is required in the device validation response to report whether each slave device listed in a previous device validation request is valid. The number of entries must match the number of device descriptors listed in the previous device validation request.", + "items": { + "$ref": "DeviceValidity" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"spectrum#pawsVerifyDeviceResponse\".", + "default": "spectrum#pawsVerifyDeviceResponse" + }, + "type": { + "type": "string", + "description": "The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...).\n\nRequired field." + }, + "version": { + "type": "string", + "description": "The PAWS version. Must be exactly 1.0.\n\nRequired field." + } + } + }, + "RulesetInfo": { + "id": "RulesetInfo", + "type": "object", + "description": "This contains parameters for the ruleset of a regulatory domain that is communicated using the initialization and available-spectrum processes.", + "properties": { + "authority": { + "type": "string", + "description": "The regulatory domain to which the ruleset belongs is required. It must be a 2-letter country code. The device should use this to determine additional device behavior required by the associated regulatory domain." + }, + "maxLocationChange": { + "type": "number", + "description": "The maximum location change in meters is required in the initialization response, but optional otherwise. When the device changes location by more than this specified distance, it must contact the database to get the available spectrum for the new location. If the device is using spectrum that is no longer available, it must immediately cease use of the spectrum under rules for database-managed spectrum. If this value is provided within the context of an available-spectrum response, it takes precedence over the value within the initialization response.", + "format": "double" + }, + "maxPollingSecs": { + "type": "integer", + "description": "The maximum duration, in seconds, between requests for available spectrum. It is required in the initialization response, but optional otherwise. The device must contact the database to get available spectrum no less frequently than this duration. If the new spectrum information indicates that the device is using spectrum that is no longer available, it must immediately cease use of those frequencies under rules for database-managed spectrum. If this value is provided within the context of an available-spectrum response, it takes precedence over the value within the initialization response.", + "format": "int32" + }, + "rulesetIds": { + "type": "array", + "description": "The identifiers of the rulesets supported for the device's location. The database should include at least one applicable ruleset in the initialization response. The device may use the ruleset identifiers to determine parameters to include in subsequent requests. Within the context of the available-spectrum responses, the database should include the identifier of the ruleset that it used to determine the available-spectrum response. If included, the device must use the specified ruleset to interpret the response. If the device does not support the indicated ruleset, it must not operate in the spectrum governed by the ruleset.", + "items": { + "type": "string" + } + } + } + }, + "SpectrumMessage": { + "id": "SpectrumMessage", + "type": "object", + "description": "Available spectrum can be logically characterized by a list of frequency ranges and permissible power levels for each range.", + "properties": { + "bandwidth": { + "type": "number", + "description": "The bandwidth (in Hertz) for which permissible power levels are specified. For example, FCC regulation would require only one spectrum specification at 6MHz bandwidth, but Ofcom regulation would require two specifications, at 0.1MHz and 8MHz. This parameter may be empty if there is no available spectrum. It will be present otherwise.", + "format": "double" + }, + "frequencyRanges": { + "type": "array", + "description": "The list of frequency ranges and permissible power levels. The list may be empty if there is no available spectrum, otherwise it will be present.", + "items": { + "$ref": "FrequencyRange" + } + } + } + }, + "SpectrumSchedule": { + "id": "SpectrumSchedule", + "type": "object", + "description": "The spectrum schedule element combines an event time with spectrum profile to define a time period in which the profile is valid.", + "properties": { + "eventTime": { + "$ref": "EventTime", + "description": "The event time expresses when the spectrum profile is valid. It will always be present." + }, + "spectra": { + "type": "array", + "description": "A list of spectrum messages representing the usable profile. It will always be present, but may be empty when there is no available spectrum.", + "items": { + "$ref": "SpectrumMessage" + } + } + } + }, + "Vcard": { + "id": "Vcard", + "type": "object", + "description": "A vCard-in-JSON message that contains only the fields needed for PAWS: \n- fn: Full name of an individual \n- org: Name of the organization \n- adr: Address fields \n- tel: Telephone numbers \n- email: Email addresses", + "properties": { + "adr": { + "$ref": "VcardAddress", + "description": "The street address of the entity." + }, + "email": { + "$ref": "VcardTypedText", + "description": "An email address that can be used to reach the contact." + }, + "fn": { + "type": "string", + "description": "The full name of the contact person. For example: John A. Smith." + }, + "org": { + "$ref": "VcardTypedText", + "description": "The organization associated with the registering entity." + }, + "tel": { + "$ref": "VcardTelephone", + "description": "A telephone number that can be used to call the contact." + } + } + }, + "VcardAddress": { + "id": "VcardAddress", + "type": "object", + "description": "The structure used to represent a street address.", + "properties": { + "code": { + "type": "string", + "description": "The postal code associated with the address. For example: 94423." + }, + "country": { + "type": "string", + "description": "The country name. For example: US." + }, + "locality": { + "type": "string", + "description": "The city or local equivalent portion of the address. For example: San Jose." + }, + "pobox": { + "type": "string", + "description": "An optional post office box number." + }, + "region": { + "type": "string", + "description": "The state or local equivalent portion of the address. For example: CA." + }, + "street": { + "type": "string", + "description": "The street number and name. For example: 123 Any St." + } + } + }, + "VcardTelephone": { + "id": "VcardTelephone", + "type": "object", + "description": "The structure used to represent a telephone number.", + "properties": { + "uri": { + "type": "string", + "description": "A nested telephone URI of the form: tel:+1-123-456-7890." + } + } + }, + "VcardTypedText": { + "id": "VcardTypedText", + "type": "object", + "description": "The structure used to represent an organization and an email address.", + "properties": { + "text": { + "type": "string", + "description": "The text string associated with this item. For example, for an org field: ACME, inc. For an email field: smith@example.com." + } + } + } + }, + "resources": { + "paws": { + "methods": { + "getSpectrum": { + "id": "spectrum.paws.getSpectrum", + "path": "getSpectrum", + "httpMethod": "POST", + "description": "Requests information about the available spectrum for a device at a location. Requests from a fixed-mode device must include owner information so the device can be registered with the database.", + "request": { + "$ref": "PawsGetSpectrumRequest" + }, + "response": { + "$ref": "PawsGetSpectrumResponse" + } + }, + "getSpectrumBatch": { + "id": "spectrum.paws.getSpectrumBatch", + "path": "getSpectrumBatch", + "httpMethod": "POST", + "description": "The Google Spectrum Database does not support batch requests, so this method always yields an UNIMPLEMENTED error.", + "request": { + "$ref": "PawsGetSpectrumBatchRequest" + }, + "response": { + "$ref": "PawsGetSpectrumBatchResponse" + } + }, + "init": { + "id": "spectrum.paws.init", + "path": "init", + "httpMethod": "POST", + "description": "Initializes the connection between a white space device and the database.", + "request": { + "$ref": "PawsInitRequest" + }, + "response": { + "$ref": "PawsInitResponse" + } + }, + "notifySpectrumUse": { + "id": "spectrum.paws.notifySpectrumUse", + "path": "notifySpectrumUse", + "httpMethod": "POST", + "description": "Notifies the database that the device has selected certain frequency ranges for transmission. Only to be invoked when required by the regulator. The Google Spectrum Database does not operate in domains that require notification, so this always yields an UNIMPLEMENTED error.", + "request": { + "$ref": "PawsNotifySpectrumUseRequest" + }, + "response": { + "$ref": "PawsNotifySpectrumUseResponse" + } + }, + "register": { + "id": "spectrum.paws.register", + "path": "register", + "httpMethod": "POST", + "description": "The Google Spectrum Database implements registration in the getSpectrum method. As such this always returns an UNIMPLEMENTED error.", + "request": { + "$ref": "PawsRegisterRequest" + }, + "response": { + "$ref": "PawsRegisterResponse" + } + }, + "verifyDevice": { + "id": "spectrum.paws.verifyDevice", + "path": "verifyDevice", + "httpMethod": "POST", + "description": "Validates a device for white space use in accordance with regulatory rules. The Google Spectrum Database does not support master/slave configurations, so this always yields an UNIMPLEMENTED error.", + "request": { + "$ref": "PawsVerifyDeviceRequest" + }, + "response": { + "$ref": "PawsVerifyDeviceResponse" + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/spectrum/v1explorer/spectrum-gen.go b/third_party/src/code.google.com/p/google-api-go-client/spectrum/v1explorer/spectrum-gen.go new file mode 100644 index 0000000000000..98626a13934af --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/spectrum/v1explorer/spectrum-gen.go @@ -0,0 +1,1322 @@ +// Package spectrum provides access to the Google Spectrum Database API. +// +// See http://developers.google.com/spectrum +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/spectrum/v1explorer" +// ... +// spectrumService, err := spectrum.New(oauthHttpClient) +package spectrum + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "spectrum:v1explorer" +const apiName = "spectrum" +const apiVersion = "v1explorer" +const basePath = "https://www.googleapis.com/spectrum/v1explorer/paws/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Paws = NewPawsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Paws *PawsService +} + +func NewPawsService(s *Service) *PawsService { + rs := &PawsService{s: s} + return rs +} + +type PawsService struct { + s *Service +} + +type AntennaCharacteristics struct { + // Height: The antenna height in meters. Whether the antenna height is + // required depends on the device type and the regulatory domain. Note + // that the height may be negative. + Height float64 `json:"height,omitempty"` + + // HeightType: If the height is required, then the height type (AGL for + // above ground level or AMSL for above mean sea level) is also + // required. The default is AGL. + HeightType string `json:"heightType,omitempty"` + + // HeightUncertainty: The height uncertainty in meters. Whether this is + // required depends on the regulatory domain. + HeightUncertainty float64 `json:"heightUncertainty,omitempty"` +} + +type DatabaseSpec struct { + // Name: The display name for a database. + Name string `json:"name,omitempty"` + + // Uri: The corresponding URI of the database. + Uri string `json:"uri,omitempty"` +} + +type DbUpdateSpec struct { + // Databases: A required list of one or more databases. A device should + // update its preconfigured list of databases to replace (only) the + // database that provided the response with the specified entries. + Databases []*DatabaseSpec `json:"databases,omitempty"` +} + +type DeviceCapabilities struct { + // FrequencyRanges: An optional list of frequency ranges supported by + // the device. Each element must contain start and stop frequencies in + // which the device can operate. Channel identifiers are optional. When + // specified, the database should not return available spectrum that + // falls outside these ranges or channel IDs. + FrequencyRanges []*FrequencyRange `json:"frequencyRanges,omitempty"` +} + +type DeviceDescriptor struct { + // EtsiEnDeviceCategory: Specifies the ETSI white space device category. + // Valid values are the strings master and slave. This field is + // case-insensitive. Consult the ETSI documentation for details about + // the device types. + EtsiEnDeviceCategory string `json:"etsiEnDeviceCategory,omitempty"` + + // EtsiEnDeviceEmissionsClass: Specifies the ETSI white space device + // emissions class. The values are represented by numeric strings, such + // as 1, 2, etc. Consult the ETSI documentation for details about the + // device types. + EtsiEnDeviceEmissionsClass string `json:"etsiEnDeviceEmissionsClass,omitempty"` + + // EtsiEnDeviceType: Specifies the ETSI white space device type. Valid + // values are single-letter strings, such as A, B, etc. Consult the ETSI + // documentation for details about the device types. + EtsiEnDeviceType string `json:"etsiEnDeviceType,omitempty"` + + // EtsiEnTechnologyId: Specifies the ETSI white space device technology + // identifier. The string value must not exceed 64 characters in length. + // Consult the ETSI documentation for details about the device types. + EtsiEnTechnologyId string `json:"etsiEnTechnologyId,omitempty"` + + // FccId: Specifies the device's FCC certification identifier. The value + // is an identifier string whose length should not exceed 32 characters. + // Note that, in practice, a valid FCC ID may be limited to 19 + // characters. + FccId string `json:"fccId,omitempty"` + + // FccTvbdDeviceType: Specifies the TV Band White Space device type, as + // defined by the FCC. Valid values are FIXED, MODE_1, MODE_2. + FccTvbdDeviceType string `json:"fccTvbdDeviceType,omitempty"` + + // ManufacturerId: The manufacturer's ID may be required by the + // regulatory domain. This should represent the name of the device + // manufacturer, should be consistent across all devices from the same + // manufacturer, and should be distinct from that of other + // manufacturers. The string value must not exceed 64 characters in + // length. + ManufacturerId string `json:"manufacturerId,omitempty"` + + // ModelId: The device's model ID may be required by the regulatory + // domain. The string value must not exceed 64 characters in length. + ModelId string `json:"modelId,omitempty"` + + // RulesetIds: The list of identifiers for rulesets supported by the + // device. A database may require that the device provide this list + // before servicing the device requests. If the database does not + // support any of the rulesets specified in the list, the database may + // refuse to service the device requests. If present, the list must + // contain at least one entry. + // + // For information about the valid + // requests, see section 9.2 of the PAWS specification. Currently, + // FccTvBandWhiteSpace-2010 is the only supported ruleset. + RulesetIds []string `json:"rulesetIds,omitempty"` + + // SerialNumber: The manufacturer's device serial number; required by + // the applicable regulatory domain. The length of the value must not + // exceed 64 characters. + SerialNumber string `json:"serialNumber,omitempty"` +} + +type DeviceOwner struct { + // Operator: The vCard contact information for the device operator is + // optional, but may be required by specific regulatory domains. + Operator *Vcard `json:"operator,omitempty"` + + // Owner: The vCard contact information for the individual or business + // that owns the device is required. + Owner *Vcard `json:"owner,omitempty"` +} + +type DeviceValidity struct { + // DeviceDesc: The descriptor of the device for which the validity check + // was requested. It will always be present. + DeviceDesc *DeviceDescriptor `json:"deviceDesc,omitempty"` + + // IsValid: The validity status: true if the device is valid for + // operation, false otherwise. It will always be present. + IsValid bool `json:"isValid,omitempty"` + + // Reason: If the device identifier is not valid, the database may + // include a reason. The reason may be in any language. The length of + // the value should not exceed 128 characters. + Reason string `json:"reason,omitempty"` +} + +type EventTime struct { + // StartTime: The inclusive start of the event. It will be present. + StartTime string `json:"startTime,omitempty"` + + // StopTime: The exclusive end of the event. It will be present. + StopTime string `json:"stopTime,omitempty"` +} + +type FrequencyRange struct { + // ChannelId: The database may include a channel identifier, when + // applicable. When it is included, the device should treat it as + // informative. The length of the identifier should not exceed 16 + // characters. + ChannelId string `json:"channelId,omitempty"` + + // MaxPowerDBm: The maximum total power level (EIRP)—computed over the + // corresponding operating bandwidth—that is permitted within the + // frequency range. Depending on the context in which the + // frequency-range element appears, this value may be required. For + // example, it is required in the available-spectrum response, + // available-spectrum-batch response, and spectrum-use notification + // message, but it should not be present (it is not applicable) when the + // frequency range appears inside a device-capabilities message. + MaxPowerDBm float64 `json:"maxPowerDBm,omitempty"` + + // StartHz: The required inclusive start of the frequency range (in + // Hertz). + StartHz float64 `json:"startHz,omitempty"` + + // StopHz: The required exclusive end of the frequency range (in Hertz). + StopHz float64 `json:"stopHz,omitempty"` +} + +type GeoLocation struct { + // Confidence: The location confidence level, as an integer percentage, + // may be required, depending on the regulatory domain. When the + // parameter is optional and not provided, its value is assumed to be + // 95. Valid values range from 0 to 99, since, in practice, 100-percent + // confidence is not achievable. The confidence value is meaningful only + // when geolocation refers to a point with uncertainty. + Confidence int64 `json:"confidence,omitempty"` + + // Point: If present, indicates that the geolocation represents a point. + // Paradoxically, a point is parameterized using an ellipse, where the + // center represents the location of the point and the distances along + // the major and minor axes represent the uncertainty. The uncertainty + // values may be required, depending on the regulatory domain. + Point *GeoLocationEllipse `json:"point,omitempty"` + + // Region: If present, indicates that the geolocation represents a + // region. Database support for regions is optional. + Region *GeoLocationPolygon `json:"region,omitempty"` +} + +type GeoLocationEllipse struct { + // Center: A required geo-spatial point representing the center of the + // ellipse. + Center *GeoLocationPoint `json:"center,omitempty"` + + // Orientation: A floating-point number that expresses the orientation + // of the ellipse, representing the rotation, in degrees, of the + // semi-major axis from North towards the East. For example, when the + // uncertainty is greatest along the North-South direction, orientation + // is 0 degrees; conversely, if the uncertainty is greatest along the + // East-West direction, orientation is 90 degrees. When orientation is + // not present, the orientation is assumed to be 0. + Orientation float64 `json:"orientation,omitempty"` + + // SemiMajorAxis: A floating-point number that expresses the location + // uncertainty along the major axis of the ellipse. May be required by + // the regulatory domain. When the uncertainty is optional, the default + // value is 0. + SemiMajorAxis float64 `json:"semiMajorAxis,omitempty"` + + // SemiMinorAxis: A floating-point number that expresses the location + // uncertainty along the minor axis of the ellipse. May be required by + // the regulatory domain. When the uncertainty is optional, the default + // value is 0. + SemiMinorAxis float64 `json:"semiMinorAxis,omitempty"` +} + +type GeoLocationPoint struct { + // Latitude: A required floating-point number that expresses the + // latitude in degrees using the WGS84 datum. For details on this + // encoding, see the National Imagery and Mapping Agency's Technical + // Report TR8350.2. + Latitude float64 `json:"latitude,omitempty"` + + // Longitude: A required floating-point number that expresses the + // longitude in degrees using the WGS84 datum. For details on this + // encoding, see the National Imagery and Mapping Agency's Technical + // Report TR8350.2. + Longitude float64 `json:"longitude,omitempty"` +} + +type GeoLocationPolygon struct { + // Exterior: When the geolocation describes a region, the exterior field + // refers to a list of latitude/longitude points that represent the + // vertices of a polygon. The first and last points must be the same. + // Thus, a minimum of four points is required. The following polygon + // restrictions from RFC5491 apply: + // - A connecting line shall not + // cross another connecting line of the same polygon. + // - The vertices + // must be defined in a counterclockwise order. + // - The edges of a + // polygon are defined by the shortest path between two points in space + // (not a geodesic curve). Consequently, the length between two adjacent + // vertices should be restricted to a maximum of 130 km. + // - All vertices + // are assumed to be at the same altitude. + // - Polygon shapes should be + // restricted to a maximum of 15 vertices (16 points that include the + // repeated vertex). + Exterior []*GeoLocationPoint `json:"exterior,omitempty"` +} + +type GeoSpectrumSchedule struct { + // Location: The geolocation identifies the location at which the + // spectrum schedule applies. It will always be present. + Location *GeoLocation `json:"location,omitempty"` + + // SpectrumSchedules: A list of available spectrum profiles and + // associated times. It will always be present, and at least one + // schedule must be included (though it may be empty if there is no + // available spectrum). More than one schedule may be included to + // represent future changes to the available spectrum. + SpectrumSchedules []*SpectrumSchedule `json:"spectrumSchedules,omitempty"` +} + +type PawsGetSpectrumBatchRequest struct { + // Antenna: Depending on device type and regulatory domain, antenna + // characteristics may be required. + Antenna *AntennaCharacteristics `json:"antenna,omitempty"` + + // Capabilities: The master device may include its device capabilities + // to limit the available-spectrum batch response to the spectrum that + // is compatible with its capabilities. The database should not return + // spectrum that is incompatible with the specified capabilities. + Capabilities *DeviceCapabilities `json:"capabilities,omitempty"` + + // DeviceDesc: When the available spectrum request is made on behalf of + // a specific device (a master or slave device), device descriptor + // information for the device on whose behalf the request is made is + // required (in such cases, the requestType parameter must be empty). + // When a requestType value is specified, device descriptor information + // may be optional or required according to the rules of the applicable + // regulatory domain. + DeviceDesc *DeviceDescriptor `json:"deviceDesc,omitempty"` + + // Locations: A geolocation list is required. This allows a device to + // specify its current location plus additional anticipated locations + // when allowed by the regulatory domain. At least one location must be + // included. Geolocation must be given as the location of the radiation + // center of the device's antenna. If a location specifies a region, + // rather than a point, the database may return an UNIMPLEMENTED error + // if it does not support query by region. + // + // There is no upper limit on + // the number of locations included in a available spectrum batch + // request, but the database may restrict the number of locations it + // supports by returning a response with fewer locations than specified + // in the batch request. Note that geolocations must be those of the + // master device (a device with geolocation capability that makes an + // available spectrum batch request), whether the master device is + // making the request on its own behalf or on behalf of a slave device + // (one without geolocation capability). + Locations []*GeoLocation `json:"locations,omitempty"` + + // MasterDeviceDesc: When an available spectrum batch request is made by + // the master device (a device with geolocation capability) on behalf of + // a slave device (a device without geolocation capability), the rules + // of the applicable regulatory domain may require the master device to + // provide its own device descriptor information (in addition to device + // descriptor information for the slave device in a separate parameter). + MasterDeviceDesc *DeviceDescriptor `json:"masterDeviceDesc,omitempty"` + + // Owner: Depending on device type and regulatory domain, device owner + // information may be included in an available spectrum batch request. + // This allows the device to register and get spectrum-availability + // information in a single request. + Owner *DeviceOwner `json:"owner,omitempty"` + + // RequestType: The request type parameter is an optional parameter that + // can be used to modify an available spectrum batch request, but its + // use depends on applicable regulatory rules. For example, It may be + // used to request generic slave device parameters without having to + // specify the device descriptor for a specific device. When the + // requestType parameter is missing, the request is for a specific + // device (master or slave), and the device descriptor parameter for the + // device on whose behalf the batch request is made is required. + RequestType string `json:"requestType,omitempty"` + + // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, + // ...). + // + // Required field. + Type string `json:"type,omitempty"` + + // Version: The PAWS version. Must be exactly 1.0. + // + // Required field. + Version string `json:"version,omitempty"` +} + +type PawsGetSpectrumBatchResponse struct { + // DatabaseChange: A database may include the databaseChange parameter + // to notify a device of a change to its database URI, providing one or + // more alternate database URIs. The device should use this information + // to update its list of pre-configured databases by (only) replacing + // its entry for the responding database with the list of alternate + // URIs. + DatabaseChange *DbUpdateSpec `json:"databaseChange,omitempty"` + + // DeviceDesc: The database must return in its available spectrum + // response the device descriptor information it received in the master + // device's available spectrum batch request. + DeviceDesc *DeviceDescriptor `json:"deviceDesc,omitempty"` + + // GeoSpectrumSchedules: The available spectrum batch response must + // contain a geo-spectrum schedule list, The list may be empty if + // spectrum is not available. The database may return more than one + // geo-spectrum schedule to represent future changes to the available + // spectrum. How far in advance a schedule may be provided depends upon + // the applicable regulatory domain. The database may return available + // spectrum for fewer geolocations than requested. The device must not + // make assumptions about the order of the entries in the list, and must + // use the geolocation value in each geo-spectrum schedule entry to + // match available spectrum to a location. + GeoSpectrumSchedules []*GeoSpectrumSchedule `json:"geoSpectrumSchedules,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "spectrum#pawsGetSpectrumBatchResponse". + Kind string `json:"kind,omitempty"` + + // MaxContiguousBwHz: The database may return a constraint on the + // allowed maximum contiguous bandwidth (in Hertz). A regulatory domain + // may require the database to return this parameter. When this + // parameter is present in the response, the device must apply this + // constraint to its spectrum-selection logic to ensure that no single + // block of spectrum has bandwidth that exceeds this value. + MaxContiguousBwHz float64 `json:"maxContiguousBwHz,omitempty"` + + // MaxTotalBwHz: The database may return a constraint on the allowed + // maximum total bandwidth (in Hertz), which does not need to be + // contiguous. A regulatory domain may require the database to return + // this parameter. When this parameter is present in the available + // spectrum batch response, the device must apply this constraint to its + // spectrum-selection logic to ensure that total bandwidth does not + // exceed this value. + MaxTotalBwHz float64 `json:"maxTotalBwHz,omitempty"` + + // NeedsSpectrumReport: For regulatory domains that require a + // spectrum-usage report from devices, the database must return true for + // this parameter if the geo-spectrum schedules list is not empty; + // otherwise, the database should either return false or omit this + // parameter. If this parameter is present and its value is true, the + // device must send a spectrum use notify message to the database; + // otherwise, the device should not send the notification. + NeedsSpectrumReport bool `json:"needsSpectrumReport,omitempty"` + + // RulesetInfo: The database should return ruleset information, which + // identifies the applicable regulatory authority and ruleset for the + // available spectrum batch response. If included, the device must use + // the corresponding ruleset to interpret the response. Values provided + // in the returned ruleset information, such as maxLocationChange, take + // precedence over any conflicting values provided in the ruleset + // information returned in a prior initialization response sent by the + // database to the device. + RulesetInfo *RulesetInfo `json:"rulesetInfo,omitempty"` + + // Timestamp: The database includes a timestamp of the form, + // YYYY-MM-DDThh:mm:ssZ (Internet timestamp format per RFC3339), in its + // available spectrum batch response. The timestamp should be used by + // the device as a reference for the start and stop times specified in + // the response spectrum schedules. + Timestamp string `json:"timestamp,omitempty"` + + // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, + // ...). + // + // Required field. + Type string `json:"type,omitempty"` + + // Version: The PAWS version. Must be exactly 1.0. + // + // Required field. + Version string `json:"version,omitempty"` +} + +type PawsGetSpectrumRequest struct { + // Antenna: Depending on device type and regulatory domain, the + // characteristics of the antenna may be required. + Antenna *AntennaCharacteristics `json:"antenna,omitempty"` + + // Capabilities: The master device may include its device capabilities + // to limit the available-spectrum response to the spectrum that is + // compatible with its capabilities. The database should not return + // spectrum that is incompatible with the specified capabilities. + Capabilities *DeviceCapabilities `json:"capabilities,omitempty"` + + // DeviceDesc: When the available spectrum request is made on behalf of + // a specific device (a master or slave device), device descriptor + // information for that device is required (in such cases, the + // requestType parameter must be empty). When a requestType value is + // specified, device descriptor information may be optional or required + // according to the rules of the applicable regulatory domain. + DeviceDesc *DeviceDescriptor `json:"deviceDesc,omitempty"` + + // Location: The geolocation of the master device (a device with + // geolocation capability that makes an available spectrum request) is + // required whether the master device is making the request on its own + // behalf or on behalf of a slave device (one without geolocation + // capability). The location must be the location of the radiation + // center of the master device's antenna. To support mobile devices, a + // regulatory domain may allow the anticipated position of the master + // device to be given instead. If the location specifies a region, + // rather than a point, the database may return an UNIMPLEMENTED error + // code if it does not support query by region. + Location *GeoLocation `json:"location,omitempty"` + + // MasterDeviceDesc: When an available spectrum request is made by the + // master device (a device with geolocation capability) on behalf of a + // slave device (a device without geolocation capability), the rules of + // the applicable regulatory domain may require the master device to + // provide its own device descriptor information (in addition to device + // descriptor information for the slave device, which is provided in a + // separate parameter). + MasterDeviceDesc *DeviceDescriptor `json:"masterDeviceDesc,omitempty"` + + // Owner: Depending on device type and regulatory domain, device owner + // information may be included in an available spectrum request. This + // allows the device to register and get spectrum-availability + // information in a single request. + Owner *DeviceOwner `json:"owner,omitempty"` + + // RequestType: The request type parameter is an optional parameter that + // can be used to modify an available spectrum request, but its use + // depends on applicable regulatory rules. It may be used, for example, + // to request generic slave device parameters without having to specify + // the device descriptor for a specific device. When the requestType + // parameter is missing, the request is for a specific device (master or + // slave), and the deviceDesc parameter for the device on whose behalf + // the request is made is required. + RequestType string `json:"requestType,omitempty"` + + // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, + // ...). + // + // Required field. + Type string `json:"type,omitempty"` + + // Version: The PAWS version. Must be exactly 1.0. + // + // Required field. + Version string `json:"version,omitempty"` +} + +type PawsGetSpectrumResponse struct { + // DatabaseChange: A database may include the databaseChange parameter + // to notify a device of a change to its database URI, providing one or + // more alternate database URIs. The device should use this information + // to update its list of pre-configured databases by (only) replacing + // its entry for the responding database with the list of alternate + // URIs. + DatabaseChange *DbUpdateSpec `json:"databaseChange,omitempty"` + + // DeviceDesc: The database must return, in its available spectrum + // response, the device descriptor information it received in the master + // device's available spectrum request. + DeviceDesc *DeviceDescriptor `json:"deviceDesc,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "spectrum#pawsGetSpectrumResponse". + Kind string `json:"kind,omitempty"` + + // MaxContiguousBwHz: The database may return a constraint on the + // allowed maximum contiguous bandwidth (in Hertz). A regulatory domain + // may require the database to return this parameter. When this + // parameter is present in the response, the device must apply this + // constraint to its spectrum-selection logic to ensure that no single + // block of spectrum has bandwidth that exceeds this value. + MaxContiguousBwHz float64 `json:"maxContiguousBwHz,omitempty"` + + // MaxTotalBwHz: The database may return a constraint on the allowed + // maximum total bandwidth (in Hertz), which need not be contiguous. A + // regulatory domain may require the database to return this parameter. + // When this parameter is present in the available spectrum response, + // the device must apply this constraint to its spectrum-selection logic + // to ensure that total bandwidth does not exceed this value. + MaxTotalBwHz float64 `json:"maxTotalBwHz,omitempty"` + + // NeedsSpectrumReport: For regulatory domains that require a + // spectrum-usage report from devices, the database must return true for + // this parameter if the spectrum schedule list is not empty; otherwise, + // the database will either return false or omit this parameter. If this + // parameter is present and its value is true, the device must send a + // spectrum use notify message to the database; otherwise, the device + // must not send the notification. + NeedsSpectrumReport bool `json:"needsSpectrumReport,omitempty"` + + // RulesetInfo: The database should return ruleset information, which + // identifies the applicable regulatory authority and ruleset for the + // available spectrum response. If included, the device must use the + // corresponding ruleset to interpret the response. Values provided in + // the returned ruleset information, such as maxLocationChange, take + // precedence over any conflicting values provided in the ruleset + // information returned in a prior initialization response sent by the + // database to the device. + RulesetInfo *RulesetInfo `json:"rulesetInfo,omitempty"` + + // SpectrumSchedules: The available spectrum response must contain a + // spectrum schedule list. The list may be empty if spectrum is not + // available. The database may return more than one spectrum schedule to + // represent future changes to the available spectrum. How far in + // advance a schedule may be provided depends on the applicable + // regulatory domain. + SpectrumSchedules []*SpectrumSchedule `json:"spectrumSchedules,omitempty"` + + // Timestamp: The database includes a timestamp of the form + // YYYY-MM-DDThh:mm:ssZ (Internet timestamp format per RFC3339) in its + // available spectrum response. The timestamp should be used by the + // device as a reference for the start and stop times specified in the + // response spectrum schedules. + Timestamp string `json:"timestamp,omitempty"` + + // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, + // ...). + // + // Required field. + Type string `json:"type,omitempty"` + + // Version: The PAWS version. Must be exactly 1.0. + // + // Required field. + Version string `json:"version,omitempty"` +} + +type PawsInitRequest struct { + // DeviceDesc: The DeviceDescriptor parameter is required. If the + // database does not support the device or any of the rulesets specified + // in the device descriptor, it must return an UNSUPPORTED error code in + // the error response. + DeviceDesc *DeviceDescriptor `json:"deviceDesc,omitempty"` + + // Location: A device's geolocation is required. + Location *GeoLocation `json:"location,omitempty"` + + // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, + // ...). + // + // Required field. + Type string `json:"type,omitempty"` + + // Version: The PAWS version. Must be exactly 1.0. + // + // Required field. + Version string `json:"version,omitempty"` +} + +type PawsInitResponse struct { + // DatabaseChange: A database may include the databaseChange parameter + // to notify a device of a change to its database URI, providing one or + // more alternate database URIs. The device should use this information + // to update its list of pre-configured databases by (only) replacing + // its entry for the responding database with the list of alternate + // URIs. + DatabaseChange *DbUpdateSpec `json:"databaseChange,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "spectrum#pawsInitResponse". + Kind string `json:"kind,omitempty"` + + // RulesetInfo: The rulesetInfo parameter must be included in the + // response. This parameter specifies the regulatory domain and + // parameters applicable to that domain. The database must include the + // authority field, which defines the regulatory domain for the location + // specified in the INIT_REQ message. + RulesetInfo *RulesetInfo `json:"rulesetInfo,omitempty"` + + // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, + // ...). + // + // Required field. + Type string `json:"type,omitempty"` + + // Version: The PAWS version. Must be exactly 1.0. + // + // Required field. + Version string `json:"version,omitempty"` +} + +type PawsNotifySpectrumUseRequest struct { + // DeviceDesc: Device descriptor information is required in the + // spectrum-use notification message. + DeviceDesc *DeviceDescriptor `json:"deviceDesc,omitempty"` + + // Location: The geolocation of the master device (the device that is + // sending the spectrum-use notification) to the database is required in + // the spectrum-use notification message. + Location *GeoLocation `json:"location,omitempty"` + + // Spectra: A spectrum list is required in the spectrum-use + // notification. The list specifies the spectrum that the device expects + // to use, which includes frequency ranges and maximum power levels. The + // list may be empty if the device decides not to use any of spectrum. + // For consistency, the psdBandwidthHz value should match that from one + // of the spectrum elements in the corresponding available spectrum + // response previously sent to the device by the database. Note that + // maximum power levels in the spectrum element must be expressed as + // power spectral density over the specified psdBandwidthHz value. The + // actual bandwidth to be used (as computed from the start and stop + // frequencies) may be different from the psdBandwidthHz value. As an + // example, when regulatory rules express maximum power spectral density + // in terms of maximum power over any 100 kHz band, then the + // psdBandwidthHz value should be set to 100 kHz, even though the actual + // bandwidth used can be 20 kHz. + Spectra []*SpectrumMessage `json:"spectra,omitempty"` + + // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, + // ...). + // + // Required field. + Type string `json:"type,omitempty"` + + // Version: The PAWS version. Must be exactly 1.0. + // + // Required field. + Version string `json:"version,omitempty"` +} + +type PawsNotifySpectrumUseResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "spectrum#pawsNotifySpectrumUseResponse". + Kind string `json:"kind,omitempty"` + + // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, + // ...). + // + // Required field. + Type string `json:"type,omitempty"` + + // Version: The PAWS version. Must be exactly 1.0. + // + // Required field. + Version string `json:"version,omitempty"` +} + +type PawsRegisterRequest struct { + // Antenna: Antenna characteristics, including its height and height + // type. + Antenna *AntennaCharacteristics `json:"antenna,omitempty"` + + // DeviceDesc: A DeviceDescriptor is required. + DeviceDesc *DeviceDescriptor `json:"deviceDesc,omitempty"` + + // DeviceOwner: Device owner information is required. + DeviceOwner *DeviceOwner `json:"deviceOwner,omitempty"` + + // Location: A device's geolocation is required. + Location *GeoLocation `json:"location,omitempty"` + + // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, + // ...). + // + // Required field. + Type string `json:"type,omitempty"` + + // Version: The PAWS version. Must be exactly 1.0. + // + // Required field. + Version string `json:"version,omitempty"` +} + +type PawsRegisterResponse struct { + // DatabaseChange: A database may include the databaseChange parameter + // to notify a device of a change to its database URI, providing one or + // more alternate database URIs. The device should use this information + // to update its list of pre-configured databases by (only) replacing + // its entry for the responding database with the list of alternate + // URIs. + DatabaseChange *DbUpdateSpec `json:"databaseChange,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "spectrum#pawsRegisterResponse". + Kind string `json:"kind,omitempty"` + + // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, + // ...). + // + // Required field. + Type string `json:"type,omitempty"` + + // Version: The PAWS version. Must be exactly 1.0. + // + // Required field. + Version string `json:"version,omitempty"` +} + +type PawsVerifyDeviceRequest struct { + // DeviceDescs: A list of device descriptors, which specifies the slave + // devices to be validated, is required. + DeviceDescs []*DeviceDescriptor `json:"deviceDescs,omitempty"` + + // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, + // ...). + // + // Required field. + Type string `json:"type,omitempty"` + + // Version: The PAWS version. Must be exactly 1.0. + // + // Required field. + Version string `json:"version,omitempty"` +} + +type PawsVerifyDeviceResponse struct { + // DatabaseChange: A database may include the databaseChange parameter + // to notify a device of a change to its database URI, providing one or + // more alternate database URIs. The device should use this information + // to update its list of pre-configured databases by (only) replacing + // its entry for the responding database with the list of alternate + // URIs. + DatabaseChange *DbUpdateSpec `json:"databaseChange,omitempty"` + + // DeviceValidities: A device validities list is required in the device + // validation response to report whether each slave device listed in a + // previous device validation request is valid. The number of entries + // must match the number of device descriptors listed in the previous + // device validation request. + DeviceValidities []*DeviceValidity `json:"deviceValidities,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "spectrum#pawsVerifyDeviceResponse". + Kind string `json:"kind,omitempty"` + + // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, + // ...). + // + // Required field. + Type string `json:"type,omitempty"` + + // Version: The PAWS version. Must be exactly 1.0. + // + // Required field. + Version string `json:"version,omitempty"` +} + +type RulesetInfo struct { + // Authority: The regulatory domain to which the ruleset belongs is + // required. It must be a 2-letter country code. The device should use + // this to determine additional device behavior required by the + // associated regulatory domain. + Authority string `json:"authority,omitempty"` + + // MaxLocationChange: The maximum location change in meters is required + // in the initialization response, but optional otherwise. When the + // device changes location by more than this specified distance, it must + // contact the database to get the available spectrum for the new + // location. If the device is using spectrum that is no longer + // available, it must immediately cease use of the spectrum under rules + // for database-managed spectrum. If this value is provided within the + // context of an available-spectrum response, it takes precedence over + // the value within the initialization response. + MaxLocationChange float64 `json:"maxLocationChange,omitempty"` + + // MaxPollingSecs: The maximum duration, in seconds, between requests + // for available spectrum. It is required in the initialization + // response, but optional otherwise. The device must contact the + // database to get available spectrum no less frequently than this + // duration. If the new spectrum information indicates that the device + // is using spectrum that is no longer available, it must immediately + // cease use of those frequencies under rules for database-managed + // spectrum. If this value is provided within the context of an + // available-spectrum response, it takes precedence over the value + // within the initialization response. + MaxPollingSecs int64 `json:"maxPollingSecs,omitempty"` + + // RulesetIds: The identifiers of the rulesets supported for the + // device's location. The database should include at least one + // applicable ruleset in the initialization response. The device may use + // the ruleset identifiers to determine parameters to include in + // subsequent requests. Within the context of the available-spectrum + // responses, the database should include the identifier of the ruleset + // that it used to determine the available-spectrum response. If + // included, the device must use the specified ruleset to interpret the + // response. If the device does not support the indicated ruleset, it + // must not operate in the spectrum governed by the ruleset. + RulesetIds []string `json:"rulesetIds,omitempty"` +} + +type SpectrumMessage struct { + // Bandwidth: The bandwidth (in Hertz) for which permissible power + // levels are specified. For example, FCC regulation would require only + // one spectrum specification at 6MHz bandwidth, but Ofcom regulation + // would require two specifications, at 0.1MHz and 8MHz. This parameter + // may be empty if there is no available spectrum. It will be present + // otherwise. + Bandwidth float64 `json:"bandwidth,omitempty"` + + // FrequencyRanges: The list of frequency ranges and permissible power + // levels. The list may be empty if there is no available spectrum, + // otherwise it will be present. + FrequencyRanges []*FrequencyRange `json:"frequencyRanges,omitempty"` +} + +type SpectrumSchedule struct { + // EventTime: The event time expresses when the spectrum profile is + // valid. It will always be present. + EventTime *EventTime `json:"eventTime,omitempty"` + + // Spectra: A list of spectrum messages representing the usable profile. + // It will always be present, but may be empty when there is no + // available spectrum. + Spectra []*SpectrumMessage `json:"spectra,omitempty"` +} + +type Vcard struct { + // Adr: The street address of the entity. + Adr *VcardAddress `json:"adr,omitempty"` + + // Email: An email address that can be used to reach the contact. + Email *VcardTypedText `json:"email,omitempty"` + + // Fn: The full name of the contact person. For example: John A. Smith. + Fn string `json:"fn,omitempty"` + + // Org: The organization associated with the registering entity. + Org *VcardTypedText `json:"org,omitempty"` + + // Tel: A telephone number that can be used to call the contact. + Tel *VcardTelephone `json:"tel,omitempty"` +} + +type VcardAddress struct { + // Code: The postal code associated with the address. For example: + // 94423. + Code string `json:"code,omitempty"` + + // Country: The country name. For example: US. + Country string `json:"country,omitempty"` + + // Locality: The city or local equivalent portion of the address. For + // example: San Jose. + Locality string `json:"locality,omitempty"` + + // Pobox: An optional post office box number. + Pobox string `json:"pobox,omitempty"` + + // Region: The state or local equivalent portion of the address. For + // example: CA. + Region string `json:"region,omitempty"` + + // Street: The street number and name. For example: 123 Any St. + Street string `json:"street,omitempty"` +} + +type VcardTelephone struct { + // Uri: A nested telephone URI of the form: tel:+1-123-456-7890. + Uri string `json:"uri,omitempty"` +} + +type VcardTypedText struct { + // Text: The text string associated with this item. For example, for an + // org field: ACME, inc. For an email field: smith@example.com. + Text string `json:"text,omitempty"` +} + +// method id "spectrum.paws.getSpectrum": + +type PawsGetSpectrumCall struct { + s *Service + pawsgetspectrumrequest *PawsGetSpectrumRequest + opt_ map[string]interface{} +} + +// GetSpectrum: Requests information about the available spectrum for a +// device at a location. Requests from a fixed-mode device must include +// owner information so the device can be registered with the database. +func (r *PawsService) GetSpectrum(pawsgetspectrumrequest *PawsGetSpectrumRequest) *PawsGetSpectrumCall { + c := &PawsGetSpectrumCall{s: r.s, opt_: make(map[string]interface{})} + c.pawsgetspectrumrequest = pawsgetspectrumrequest + return c +} + +func (c *PawsGetSpectrumCall) Do() (*PawsGetSpectrumResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pawsgetspectrumrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "getSpectrum") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PawsGetSpectrumResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Requests information about the available spectrum for a device at a location. Requests from a fixed-mode device must include owner information so the device can be registered with the database.", + // "httpMethod": "POST", + // "id": "spectrum.paws.getSpectrum", + // "path": "getSpectrum", + // "request": { + // "$ref": "PawsGetSpectrumRequest" + // }, + // "response": { + // "$ref": "PawsGetSpectrumResponse" + // } + // } + +} + +// method id "spectrum.paws.getSpectrumBatch": + +type PawsGetSpectrumBatchCall struct { + s *Service + pawsgetspectrumbatchrequest *PawsGetSpectrumBatchRequest + opt_ map[string]interface{} +} + +// GetSpectrumBatch: The Google Spectrum Database does not support batch +// requests, so this method always yields an UNIMPLEMENTED error. +func (r *PawsService) GetSpectrumBatch(pawsgetspectrumbatchrequest *PawsGetSpectrumBatchRequest) *PawsGetSpectrumBatchCall { + c := &PawsGetSpectrumBatchCall{s: r.s, opt_: make(map[string]interface{})} + c.pawsgetspectrumbatchrequest = pawsgetspectrumbatchrequest + return c +} + +func (c *PawsGetSpectrumBatchCall) Do() (*PawsGetSpectrumBatchResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pawsgetspectrumbatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "getSpectrumBatch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PawsGetSpectrumBatchResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "The Google Spectrum Database does not support batch requests, so this method always yields an UNIMPLEMENTED error.", + // "httpMethod": "POST", + // "id": "spectrum.paws.getSpectrumBatch", + // "path": "getSpectrumBatch", + // "request": { + // "$ref": "PawsGetSpectrumBatchRequest" + // }, + // "response": { + // "$ref": "PawsGetSpectrumBatchResponse" + // } + // } + +} + +// method id "spectrum.paws.init": + +type PawsInitCall struct { + s *Service + pawsinitrequest *PawsInitRequest + opt_ map[string]interface{} +} + +// Init: Initializes the connection between a white space device and the +// database. +func (r *PawsService) Init(pawsinitrequest *PawsInitRequest) *PawsInitCall { + c := &PawsInitCall{s: r.s, opt_: make(map[string]interface{})} + c.pawsinitrequest = pawsinitrequest + return c +} + +func (c *PawsInitCall) Do() (*PawsInitResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pawsinitrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "init") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PawsInitResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Initializes the connection between a white space device and the database.", + // "httpMethod": "POST", + // "id": "spectrum.paws.init", + // "path": "init", + // "request": { + // "$ref": "PawsInitRequest" + // }, + // "response": { + // "$ref": "PawsInitResponse" + // } + // } + +} + +// method id "spectrum.paws.notifySpectrumUse": + +type PawsNotifySpectrumUseCall struct { + s *Service + pawsnotifyspectrumuserequest *PawsNotifySpectrumUseRequest + opt_ map[string]interface{} +} + +// NotifySpectrumUse: Notifies the database that the device has selected +// certain frequency ranges for transmission. Only to be invoked when +// required by the regulator. The Google Spectrum Database does not +// operate in domains that require notification, so this always yields +// an UNIMPLEMENTED error. +func (r *PawsService) NotifySpectrumUse(pawsnotifyspectrumuserequest *PawsNotifySpectrumUseRequest) *PawsNotifySpectrumUseCall { + c := &PawsNotifySpectrumUseCall{s: r.s, opt_: make(map[string]interface{})} + c.pawsnotifyspectrumuserequest = pawsnotifyspectrumuserequest + return c +} + +func (c *PawsNotifySpectrumUseCall) Do() (*PawsNotifySpectrumUseResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pawsnotifyspectrumuserequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "notifySpectrumUse") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PawsNotifySpectrumUseResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Notifies the database that the device has selected certain frequency ranges for transmission. Only to be invoked when required by the regulator. The Google Spectrum Database does not operate in domains that require notification, so this always yields an UNIMPLEMENTED error.", + // "httpMethod": "POST", + // "id": "spectrum.paws.notifySpectrumUse", + // "path": "notifySpectrumUse", + // "request": { + // "$ref": "PawsNotifySpectrumUseRequest" + // }, + // "response": { + // "$ref": "PawsNotifySpectrumUseResponse" + // } + // } + +} + +// method id "spectrum.paws.register": + +type PawsRegisterCall struct { + s *Service + pawsregisterrequest *PawsRegisterRequest + opt_ map[string]interface{} +} + +// Register: The Google Spectrum Database implements registration in the +// getSpectrum method. As such this always returns an UNIMPLEMENTED +// error. +func (r *PawsService) Register(pawsregisterrequest *PawsRegisterRequest) *PawsRegisterCall { + c := &PawsRegisterCall{s: r.s, opt_: make(map[string]interface{})} + c.pawsregisterrequest = pawsregisterrequest + return c +} + +func (c *PawsRegisterCall) Do() (*PawsRegisterResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pawsregisterrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "register") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PawsRegisterResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "The Google Spectrum Database implements registration in the getSpectrum method. As such this always returns an UNIMPLEMENTED error.", + // "httpMethod": "POST", + // "id": "spectrum.paws.register", + // "path": "register", + // "request": { + // "$ref": "PawsRegisterRequest" + // }, + // "response": { + // "$ref": "PawsRegisterResponse" + // } + // } + +} + +// method id "spectrum.paws.verifyDevice": + +type PawsVerifyDeviceCall struct { + s *Service + pawsverifydevicerequest *PawsVerifyDeviceRequest + opt_ map[string]interface{} +} + +// VerifyDevice: Validates a device for white space use in accordance +// with regulatory rules. The Google Spectrum Database does not support +// master/slave configurations, so this always yields an UNIMPLEMENTED +// error. +func (r *PawsService) VerifyDevice(pawsverifydevicerequest *PawsVerifyDeviceRequest) *PawsVerifyDeviceCall { + c := &PawsVerifyDeviceCall{s: r.s, opt_: make(map[string]interface{})} + c.pawsverifydevicerequest = pawsverifydevicerequest + return c +} + +func (c *PawsVerifyDeviceCall) Do() (*PawsVerifyDeviceResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pawsverifydevicerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "verifyDevice") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(PawsVerifyDeviceResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Validates a device for white space use in accordance with regulatory rules. The Google Spectrum Database does not support master/slave configurations, so this always yields an UNIMPLEMENTED error.", + // "httpMethod": "POST", + // "id": "spectrum.paws.verifyDevice", + // "path": "verifyDevice", + // "request": { + // "$ref": "PawsVerifyDeviceRequest" + // }, + // "response": { + // "$ref": "PawsVerifyDeviceResponse" + // } + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/sqladmin/v1beta1/sqladmin-api.json b/third_party/src/code.google.com/p/google-api-go-client/sqladmin/v1beta1/sqladmin-api.json new file mode 100644 index 0000000000000..0749584ab1ae8 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/sqladmin/v1beta1/sqladmin-api.json @@ -0,0 +1,1183 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/rzbC1mbXRnaKYIRTl-o1XFsAXnM\"", + "discoveryVersion": "v1", + "id": "sqladmin:v1beta1", + "name": "sqladmin", + "canonicalName": "SQL Admin", + "version": "v1beta1", + "title": "Cloud SQL Administration API", + "description": "API for Cloud SQL database instance management.", + "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/cloud-sql/docs/admin-api/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/sql/v1beta1/", + "basePath": "/sql/v1beta1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "sql/v1beta1/", + "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/sqlservice.admin": { + "description": "Manage your Google SQL Service instances" + } + } + } + }, + "schemas": { + "BackupConfiguration": { + "id": "BackupConfiguration", + "type": "object", + "description": "Database instance backup configuration.", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether this configuration is enabled." + }, + "id": { + "type": "string", + "description": "Identifier for this configuration. This gets generated automatically when a backup configuration is created." + }, + "kind": { + "type": "string", + "description": "This is always sql#backupConfiguration.", + "default": "sql#backupConfiguration" + }, + "startTime": { + "type": "string", + "description": "Start time for the daily backup configuration in UTC timezone in the 24 hour format - HH:MM." + } + } + }, + "BackupRun": { + "id": "BackupRun", + "type": "object", + "description": "A database instance backup run resource.", + "properties": { + "backupConfiguration": { + "type": "string", + "description": "Backup Configuration identifier." + }, + "dueTime": { + "type": "string", + "description": "The due time of this run in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "format": "date-time" + }, + "endTime": { + "type": "string", + "description": "The time the backup operation completed in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "format": "date-time" + }, + "enqueuedTime": { + "type": "string", + "description": "The time the run was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "format": "date-time" + }, + "error": { + "$ref": "OperationError", + "description": "Information about why the backup operation failed. This is only present if the run has the FAILED status." + }, + "instance": { + "type": "string", + "description": "Name of the database instance." + }, + "kind": { + "type": "string", + "description": "This is always sql#backupRun.", + "default": "sql#backupRun" + }, + "startTime": { + "type": "string", + "description": "The time the backup operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "format": "date-time" + }, + "status": { + "type": "string", + "description": "The status of this run." + } + } + }, + "BackupRunsListResponse": { + "id": "BackupRunsListResponse", + "type": "object", + "description": "Backup run list results.", + "properties": { + "items": { + "type": "array", + "description": "A list of backup runs in reverse chronological order of the enqueued time.", + "items": { + "$ref": "BackupRun" + } + }, + "kind": { + "type": "string", + "description": "This is always sql#backupRunsList.", + "default": "sql#backupRunsList" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + } + } + }, + "DatabaseInstance": { + "id": "DatabaseInstance", + "type": "object", + "description": "A Cloud SQL instance resource.", + "properties": { + "currentDiskSize": { + "type": "string", + "description": "The current disk usage of the instance in bytes.", + "format": "int64" + }, + "databaseVersion": { + "type": "string", + "description": "The database engine type and version, for example MYSQL_5_5 for MySQL 5.5." + }, + "etag": { + "type": "string", + "description": "Etag for this resource - a version number for the settings object in this resource. This field has no effect when passed as a request parameter. Instead, the contents of this field should be passed in an 'If-Match' http header for use in optimistic locking.", + "annotations": { + "required": [ + "sql.instances.update" + ] + } + }, + "instance": { + "type": "string", + "description": "Name of the Cloud SQL instance. This does not include the project ID.", + "annotations": { + "required": [ + "sql.instances.insert", + "sql.instances.update" + ] + } + }, + "kind": { + "type": "string", + "description": "This is always sql#instance.", + "default": "sql#instance" + }, + "maxDiskSize": { + "type": "string", + "description": "The maximum disk size of the instance in bytes.", + "format": "int64" + }, + "project": { + "type": "string", + "description": "The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable.", + "annotations": { + "required": [ + "sql.instances.insert", + "sql.instances.update" + ] + } + }, + "region": { + "type": "string", + "description": "The geographical region. Can be us-east1, us-central or europe-west1. Defaults to us-central. The region can not be changed after instance creation." + }, + "settings": { + "$ref": "Settings", + "description": "The user settings." + }, + "state": { + "type": "string", + "description": "The current serving state of the Cloud SQL instance. This can be one of the following.\nRUNNABLE: The instance is running, or is ready to run when accessed.\nSUSPENDED: The instance is not available, for example due to problems with billing.\nPENDING_CREATE: The instance is being created.\nMAINTENANCE: The instance is down for maintenance.\nUNKNOWN_STATE: The state of the instance is unknown." + } + } + }, + "ExportContext": { + "id": "ExportContext", + "type": "object", + "description": "Database instance export context.", + "properties": { + "database": { + "type": "array", + "description": "Databases (for example, guestbook) from which the export is made. If unspecified, all databases are exported.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "This is always sql#exportContext.", + "default": "sql#exportContext" + }, + "table": { + "type": "array", + "description": "Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database.", + "items": { + "type": "string" + } + }, + "uri": { + "type": "string", + "description": "The path to the file in Google Cloud Storage where the export will be stored, or where it was already stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the operation fails. If the filename ends with .gz, the contents are compressed." + } + } + }, + "ImportContext": { + "id": "ImportContext", + "type": "object", + "description": "Database instance import context.", + "properties": { + "database": { + "type": "string", + "description": "The database (for example, guestbook) to which the import is made. If not set, it is assumed that the database is specified in the file to be imported." + }, + "kind": { + "type": "string", + "description": "This is always sql#importContext.", + "default": "sql#importContext" + }, + "uri": { + "type": "array", + "description": "A path to the MySQL dump file in Google Cloud Storage from which the import is made. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are also supported.", + "items": { + "type": "string" + } + } + } + }, + "InstanceOperation": { + "id": "InstanceOperation", + "type": "object", + "description": "An Operations resource contains information about database instance operations such as create, delete, and restart. Operations resources are created in response to operations that were initiated; you never create them directly.", + "properties": { + "endTime": { + "type": "string", + "description": "The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "format": "date-time" + }, + "enqueuedTime": { + "type": "string", + "description": "The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "format": "date-time" + }, + "error": { + "type": "array", + "description": "The error(s) encountered by this operation. Only set if the operation results in an error.", + "items": { + "$ref": "OperationError" + } + }, + "exportContext": { + "$ref": "ExportContext", + "description": "The context for export operation, if applicable." + }, + "importContext": { + "$ref": "ImportContext", + "description": "The context for import operation, if applicable." + }, + "instance": { + "type": "string", + "description": "Name of the database instance." + }, + "kind": { + "type": "string", + "description": "This is always sql#instanceOperation.", + "default": "sql#instanceOperation" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation." + }, + "operationType": { + "type": "string", + "description": "The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME." + }, + "startTime": { + "type": "string", + "description": "The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "format": "date-time" + }, + "state": { + "type": "string", + "description": "The state of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN." + }, + "userEmailAddress": { + "type": "string", + "description": "The email address of the user who initiated this operation." + } + } + }, + "InstancesDeleteResponse": { + "id": "InstancesDeleteResponse", + "type": "object", + "description": "Database instance delete response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#instancesDelete.", + "default": "sql#instancesDelete" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation." + } + } + }, + "InstancesExportRequest": { + "id": "InstancesExportRequest", + "type": "object", + "description": "Database instance export request.", + "properties": { + "exportContext": { + "$ref": "ExportContext", + "description": "Contains details about the export operation." + } + } + }, + "InstancesExportResponse": { + "id": "InstancesExportResponse", + "type": "object", + "description": "Database instance export response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#instancesExport.", + "default": "sql#instancesExport" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation." + } + } + }, + "InstancesImportRequest": { + "id": "InstancesImportRequest", + "type": "object", + "description": "Database instance import request.", + "properties": { + "importContext": { + "$ref": "ImportContext", + "description": "Contains details about the import operation." + } + } + }, + "InstancesImportResponse": { + "id": "InstancesImportResponse", + "type": "object", + "description": "Database instance import response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#instancesImport.", + "default": "sql#instancesImport" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation." + } + } + }, + "InstancesInsertResponse": { + "id": "InstancesInsertResponse", + "type": "object", + "description": "Database instance insert response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#instancesInsert.", + "default": "sql#instancesInsert" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation." + } + } + }, + "InstancesListResponse": { + "id": "InstancesListResponse", + "type": "object", + "description": "Database instances list response.", + "properties": { + "items": { + "type": "array", + "description": "List of database instance resources.", + "items": { + "$ref": "DatabaseInstance" + } + }, + "kind": { + "type": "string", + "description": "This is always sql#instancesList.", + "default": "sql#instancesList" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + } + } + }, + "InstancesRestartResponse": { + "id": "InstancesRestartResponse", + "type": "object", + "description": "Database instance restart response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#instancesRestart.", + "default": "sql#instancesRestart" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation." + } + } + }, + "InstancesRestoreBackupResponse": { + "id": "InstancesRestoreBackupResponse", + "type": "object", + "description": "Database instance restore backup response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#instancesRestoreBackup.", + "default": "sql#instancesRestoreBackup" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation." + } + } + }, + "InstancesUpdateResponse": { + "id": "InstancesUpdateResponse", + "type": "object", + "description": "Database instance update response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#instancesUpdate.", + "default": "sql#instancesUpdate" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve information about the operation." + } + } + }, + "OperationError": { + "id": "OperationError", + "type": "object", + "description": "Database instance operation error.", + "properties": { + "code": { + "type": "string", + "description": "Identifies the specific error that occurred." + }, + "kind": { + "type": "string", + "description": "This is always sql#operationError.", + "default": "sql#operationError" + } + } + }, + "OperationsListResponse": { + "id": "OperationsListResponse", + "type": "object", + "description": "Database instance list operations response.", + "properties": { + "items": { + "type": "array", + "description": "List of operation resources.", + "items": { + "$ref": "InstanceOperation" + } + }, + "kind": { + "type": "string", + "description": "This is always sql#operationsList.", + "default": "sql#operationsList" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + } + } + }, + "Settings": { + "id": "Settings", + "type": "object", + "description": "Database instance settings.", + "properties": { + "activationPolicy": { + "type": "string", + "description": "The activation policy for this instance. This specifies when the instance should be activated and is applicable only when the instance state is RUNNABLE. This can be one of the following.\nALWAYS: The instance should always be active.\nNEVER: The instance should never be activated.\nON_DEMAND: The instance is activated upon receiving requests." + }, + "authorizedGaeApplications": { + "type": "array", + "description": "The AppEngine app ids that can access this instance.", + "items": { + "type": "string" + } + }, + "backupConfiguration": { + "type": "array", + "description": "The daily backup configuration for the instance.", + "items": { + "$ref": "BackupConfiguration" + } + }, + "kind": { + "type": "string", + "description": "This is always sql#settings.", + "default": "sql#settings" + }, + "pricingPlan": { + "type": "string", + "description": "The pricing plan for this instance. This can be either PER_USE or PACKAGE." + }, + "replicationType": { + "type": "string", + "description": "The type of replication this instance uses. This can be either ASYNCHRONOUS or SYNCHRONOUS." + }, + "tier": { + "type": "string", + "description": "The tier of service for this instance, for example D1, D2. For more information, see pricing.", + "annotations": { + "required": [ + "sql.instances.insert", + "sql.instances.update" + ] + } + } + } + }, + "Tier": { + "id": "Tier", + "type": "object", + "description": "A Google Cloud SQL service tier resource.", + "properties": { + "DiskQuota": { + "type": "string", + "description": "The maximum disk size of this tier in bytes.", + "format": "int64" + }, + "RAM": { + "type": "string", + "description": "The maximum RAM usage of this tier in bytes.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "This is always sql#tier.", + "default": "sql#tier" + }, + "region": { + "type": "array", + "description": "The applicable regions for this tier. Can be us-east1 and europe-west1.", + "items": { + "type": "string" + } + }, + "tier": { + "type": "string", + "description": "An identifier for the service tier, for example D1, D2 etc. For related information, see Pricing." + } + } + }, + "TiersListResponse": { + "id": "TiersListResponse", + "type": "object", + "description": "Tiers list response.", + "properties": { + "items": { + "type": "array", + "description": "List of tiers.", + "items": { + "$ref": "Tier" + } + }, + "kind": { + "type": "string", + "description": "This is always sql#tiersList.", + "default": "sql#tiersList" + } + } + } + }, + "resources": { + "backupRuns": { + "methods": { + "get": { + "id": "sql.backupRuns.get", + "path": "projects/{project}/instances/{instance}/backupRuns/{backupConfiguration}", + "httpMethod": "GET", + "description": "Retrieves a resource containing information about a backup run.", + "parameters": { + "backupConfiguration": { + "type": "string", + "description": "Identifier for the backup configuration. This gets generated automatically when a backup configuration is created.", + "required": true, + "location": "path" + }, + "dueTime": { + "type": "string", + "description": "The time when this run is due to start in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "required": true, + "location": "query" + }, + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance", + "backupConfiguration", + "dueTime" + ], + "response": { + "$ref": "BackupRun" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "list": { + "id": "sql.backupRuns.list", + "path": "projects/{project}/instances/{instance}/backupRuns", + "httpMethod": "GET", + "description": "Lists all backup runs associated with a given instance and configuration in the reverse chronological order of the enqueued time.", + "parameters": { + "backupConfiguration": { + "type": "string", + "description": "Identifier for the backup configuration. This gets generated automatically when a backup configuration is created.", + "required": true, + "location": "query" + }, + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of backup runs per response.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance", + "backupConfiguration" + ], + "response": { + "$ref": "BackupRunsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + }, + "instances": { + "methods": { + "delete": { + "id": "sql.instances.delete", + "path": "projects/{project}/instances/{instance}", + "httpMethod": "DELETE", + "description": "Deletes a Cloud SQL instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "response": { + "$ref": "InstancesDeleteResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "export": { + "id": "sql.instances.export", + "path": "projects/{project}/instances/{instance}/export", + "httpMethod": "POST", + "description": "Exports data from a Cloud SQL instance to a Google Cloud Storage bucket as a MySQL dump file.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance to be exported.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "request": { + "$ref": "InstancesExportRequest" + }, + "response": { + "$ref": "InstancesExportResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "id": "sql.instances.get", + "path": "projects/{project}/instances/{instance}", + "httpMethod": "GET", + "description": "Retrieves a resource containing information about a Cloud SQL instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "response": { + "$ref": "DatabaseInstance" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "import": { + "id": "sql.instances.import", + "path": "projects/{project}/instances/{instance}/import", + "httpMethod": "POST", + "description": "Imports data into a Cloud SQL instance from a MySQL dump file in Google Cloud Storage.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "request": { + "$ref": "InstancesImportRequest" + }, + "response": { + "$ref": "InstancesImportResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "insert": { + "id": "sql.instances.insert", + "path": "projects/{project}/instances", + "httpMethod": "POST", + "description": "Creates a new Cloud SQL instance.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "DatabaseInstance" + }, + "response": { + "$ref": "InstancesInsertResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "list": { + "id": "sql.instances.list", + "path": "projects/{project}/instances", + "httpMethod": "GET", + "description": "Lists instances under a given project in the alphabetical order of the instance name.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of results to return per response.", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID of the project for which to list Cloud SQL instances.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "InstancesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "patch": { + "id": "sql.instances.patch", + "path": "projects/{project}/instances/{instance}", + "httpMethod": "PATCH", + "description": "Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.. This method supports patch semantics.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "request": { + "$ref": "DatabaseInstance" + }, + "response": { + "$ref": "InstancesUpdateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "restart": { + "id": "sql.instances.restart", + "path": "projects/{project}/instances/{instance}/restart", + "httpMethod": "POST", + "description": "Restarts a Cloud SQL instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance to be restarted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "response": { + "$ref": "InstancesRestartResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "restoreBackup": { + "id": "sql.instances.restoreBackup", + "path": "projects/{project}/instances/{instance}/restoreBackup", + "httpMethod": "POST", + "description": "Restores a backup of a Cloud SQL instance.", + "parameters": { + "backupConfiguration": { + "type": "string", + "description": "The identifier of the backup configuration. This gets generated automatically when a backup configuration is created.", + "required": true, + "location": "query" + }, + "dueTime": { + "type": "string", + "description": "The time when this run is due to start in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "required": true, + "location": "query" + }, + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance", + "backupConfiguration", + "dueTime" + ], + "response": { + "$ref": "InstancesRestoreBackupResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "update": { + "id": "sql.instances.update", + "path": "projects/{project}/instances/{instance}", + "httpMethod": "PUT", + "description": "Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "etagRequired": true, + "request": { + "$ref": "DatabaseInstance" + }, + "response": { + "$ref": "InstancesUpdateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + }, + "operations": { + "methods": { + "get": { + "id": "sql.operations.get", + "path": "projects/{project}/instances/{instance}/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves an instance operation that has been performed on an instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "operation": { + "type": "string", + "description": "Instance operation ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance", + "operation" + ], + "response": { + "$ref": "InstanceOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "list": { + "id": "sql.operations.list", + "path": "projects/{project}/instances/{instance}/operations", + "httpMethod": "GET", + "description": "Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of operations per response.", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "response": { + "$ref": "OperationsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + }, + "tiers": { + "methods": { + "list": { + "id": "sql.tiers.list", + "path": "tiers", + "httpMethod": "GET", + "description": "Lists all available service tiers for Google Cloud SQL, for example D1, D2. For related information, see Pricing.", + "response": { + "$ref": "TiersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/sqladmin/v1beta1/sqladmin-gen.go b/third_party/src/code.google.com/p/google-api-go-client/sqladmin/v1beta1/sqladmin-gen.go new file mode 100644 index 0000000000000..a6c8714d3b499 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/sqladmin/v1beta1/sqladmin-gen.go @@ -0,0 +1,1775 @@ +// Package sqladmin provides access to the Cloud SQL Administration API. +// +// See https://developers.google.com/cloud-sql/docs/admin-api/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/sqladmin/v1beta1" +// ... +// sqladminService, err := sqladmin.New(oauthHttpClient) +package sqladmin + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "sqladmin:v1beta1" +const apiName = "sqladmin" +const apiVersion = "v1beta1" +const basePath = "https://www.googleapis.com/sql/v1beta1/" + +// 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" + + // Manage your Google SQL Service instances + SqlserviceAdminScope = "https://www.googleapis.com/auth/sqlservice.admin" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.BackupRuns = NewBackupRunsService(s) + s.Instances = NewInstancesService(s) + s.Operations = NewOperationsService(s) + s.Tiers = NewTiersService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + BackupRuns *BackupRunsService + + Instances *InstancesService + + Operations *OperationsService + + Tiers *TiersService +} + +func NewBackupRunsService(s *Service) *BackupRunsService { + rs := &BackupRunsService{s: s} + return rs +} + +type BackupRunsService struct { + s *Service +} + +func NewInstancesService(s *Service) *InstancesService { + rs := &InstancesService{s: s} + return rs +} + +type InstancesService struct { + s *Service +} + +func NewOperationsService(s *Service) *OperationsService { + rs := &OperationsService{s: s} + return rs +} + +type OperationsService struct { + s *Service +} + +func NewTiersService(s *Service) *TiersService { + rs := &TiersService{s: s} + return rs +} + +type TiersService struct { + s *Service +} + +type BackupConfiguration struct { + // Enabled: Whether this configuration is enabled. + Enabled bool `json:"enabled,omitempty"` + + // Id: Identifier for this configuration. This gets generated + // automatically when a backup configuration is created. + Id string `json:"id,omitempty"` + + // Kind: This is always sql#backupConfiguration. + Kind string `json:"kind,omitempty"` + + // StartTime: Start time for the daily backup configuration in UTC + // timezone in the 24 hour format - HH:MM. + StartTime string `json:"startTime,omitempty"` +} + +type BackupRun struct { + // BackupConfiguration: Backup Configuration identifier. + BackupConfiguration string `json:"backupConfiguration,omitempty"` + + // DueTime: The due time of this run in UTC timezone in RFC 3339 format, + // for example 2012-11-15T16:19:00.094Z. + DueTime string `json:"dueTime,omitempty"` + + // EndTime: The time the backup operation completed in UTC timezone in + // RFC 3339 format, for example 2012-11-15T16:19:00.094Z. + EndTime string `json:"endTime,omitempty"` + + // EnqueuedTime: The time the run was enqueued in UTC timezone in RFC + // 3339 format, for example 2012-11-15T16:19:00.094Z. + EnqueuedTime string `json:"enqueuedTime,omitempty"` + + // Error: Information about why the backup operation failed. This is + // only present if the run has the FAILED status. + Error *OperationError `json:"error,omitempty"` + + // Instance: Name of the database instance. + Instance string `json:"instance,omitempty"` + + // Kind: This is always sql#backupRun. + Kind string `json:"kind,omitempty"` + + // StartTime: The time the backup operation actually started in UTC + // timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. + StartTime string `json:"startTime,omitempty"` + + // Status: The status of this run. + Status string `json:"status,omitempty"` +} + +type BackupRunsListResponse struct { + // Items: A list of backup runs in reverse chronological order of the + // enqueued time. + Items []*BackupRun `json:"items,omitempty"` + + // Kind: This is always sql#backupRunsList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The continuation token, used to page through large + // result sets. Provide this value in a subsequent request to return the + // next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type DatabaseInstance struct { + // CurrentDiskSize: The current disk usage of the instance in bytes. + CurrentDiskSize int64 `json:"currentDiskSize,omitempty,string"` + + // DatabaseVersion: The database engine type and version, for example + // MYSQL_5_5 for MySQL 5.5. + DatabaseVersion string `json:"databaseVersion,omitempty"` + + // Etag: Etag for this resource - a version number for the settings + // object in this resource. This field has no effect when passed as a + // request parameter. Instead, the contents of this field should be + // passed in an 'If-Match' http header for use in optimistic locking. + Etag string `json:"etag,omitempty"` + + // Instance: Name of the Cloud SQL instance. This does not include the + // project ID. + Instance string `json:"instance,omitempty"` + + // Kind: This is always sql#instance. + Kind string `json:"kind,omitempty"` + + // MaxDiskSize: The maximum disk size of the instance in bytes. + MaxDiskSize int64 `json:"maxDiskSize,omitempty,string"` + + // Project: The project ID of the project containing the Cloud SQL + // instance. The Google apps domain is prefixed if applicable. + Project string `json:"project,omitempty"` + + // Region: The geographical region. Can be us-east1, us-central or + // europe-west1. Defaults to us-central. The region can not be changed + // after instance creation. + Region string `json:"region,omitempty"` + + // Settings: The user settings. + Settings *Settings `json:"settings,omitempty"` + + // State: The current serving state of the Cloud SQL instance. This can + // be one of the following. + // RUNNABLE: The instance is running, or is + // ready to run when accessed. + // SUSPENDED: The instance is not available, + // for example due to problems with billing. + // PENDING_CREATE: The + // instance is being created. + // MAINTENANCE: The instance is down for + // maintenance. + // UNKNOWN_STATE: The state of the instance is unknown. + State string `json:"state,omitempty"` +} + +type ExportContext struct { + // Database: Databases (for example, guestbook) from which the export is + // made. If unspecified, all databases are exported. + Database []string `json:"database,omitempty"` + + // Kind: This is always sql#exportContext. + Kind string `json:"kind,omitempty"` + + // Table: Tables to export, or that were exported, from the specified + // database. If you specify tables, specify one and only one database. + Table []string `json:"table,omitempty"` + + // Uri: The path to the file in Google Cloud Storage where the export + // will be stored, or where it was already stored. The URI is in the + // form gs://bucketName/fileName. If the file already exists, the + // operation fails. If the filename ends with .gz, the contents are + // compressed. + Uri string `json:"uri,omitempty"` +} + +type ImportContext struct { + // Database: The database (for example, guestbook) to which the import + // is made. If not set, it is assumed that the database is specified in + // the file to be imported. + Database string `json:"database,omitempty"` + + // Kind: This is always sql#importContext. + Kind string `json:"kind,omitempty"` + + // Uri: A path to the MySQL dump file in Google Cloud Storage from which + // the import is made. The URI is in the form gs://bucketName/fileName. + // Compressed gzip files (.gz) are also supported. + Uri []string `json:"uri,omitempty"` +} + +type InstanceOperation struct { + // EndTime: The time this operation finished in UTC timezone in RFC 3339 + // format, for example 2012-11-15T16:19:00.094Z. + EndTime string `json:"endTime,omitempty"` + + // EnqueuedTime: The time this operation was enqueued in UTC timezone in + // RFC 3339 format, for example 2012-11-15T16:19:00.094Z. + EnqueuedTime string `json:"enqueuedTime,omitempty"` + + // Error: The error(s) encountered by this operation. Only set if the + // operation results in an error. + Error []*OperationError `json:"error,omitempty"` + + // ExportContext: The context for export operation, if applicable. + ExportContext *ExportContext `json:"exportContext,omitempty"` + + // ImportContext: The context for import operation, if applicable. + ImportContext *ImportContext `json:"importContext,omitempty"` + + // Instance: Name of the database instance. + Instance string `json:"instance,omitempty"` + + // Kind: This is always sql#instanceOperation. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve the Operations resource that has + // information about the operation. + Operation string `json:"operation,omitempty"` + + // OperationType: The type of the operation. Valid values are CREATE, + // DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, + // RESTORE_VOLUME. + OperationType string `json:"operationType,omitempty"` + + // StartTime: The time this operation actually started in UTC timezone + // in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. + StartTime string `json:"startTime,omitempty"` + + // State: The state of an operation. Valid values are PENDING, RUNNING, + // DONE, UNKNOWN. + State string `json:"state,omitempty"` + + // UserEmailAddress: The email address of the user who initiated this + // operation. + UserEmailAddress string `json:"userEmailAddress,omitempty"` +} + +type InstancesDeleteResponse struct { + // Kind: This is always sql#instancesDelete. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve the Operations resource that has + // information about the operation. + Operation string `json:"operation,omitempty"` +} + +type InstancesExportRequest struct { + // ExportContext: Contains details about the export operation. + ExportContext *ExportContext `json:"exportContext,omitempty"` +} + +type InstancesExportResponse struct { + // Kind: This is always sql#instancesExport. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve the Operations resource that has + // information about the operation. + Operation string `json:"operation,omitempty"` +} + +type InstancesImportRequest struct { + // ImportContext: Contains details about the import operation. + ImportContext *ImportContext `json:"importContext,omitempty"` +} + +type InstancesImportResponse struct { + // Kind: This is always sql#instancesImport. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve the Operations resource that has + // information about the operation. + Operation string `json:"operation,omitempty"` +} + +type InstancesInsertResponse struct { + // Kind: This is always sql#instancesInsert. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve the Operations resource that has + // information about the operation. + Operation string `json:"operation,omitempty"` +} + +type InstancesListResponse struct { + // Items: List of database instance resources. + Items []*DatabaseInstance `json:"items,omitempty"` + + // Kind: This is always sql#instancesList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The continuation token, used to page through large + // result sets. Provide this value in a subsequent request to return the + // next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type InstancesRestartResponse struct { + // Kind: This is always sql#instancesRestart. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve the Operations resource that has + // information about the operation. + Operation string `json:"operation,omitempty"` +} + +type InstancesRestoreBackupResponse struct { + // Kind: This is always sql#instancesRestoreBackup. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve the Operations resource that has + // information about the operation. + Operation string `json:"operation,omitempty"` +} + +type InstancesUpdateResponse struct { + // Kind: This is always sql#instancesUpdate. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve information about the operation. + Operation string `json:"operation,omitempty"` +} + +type OperationError struct { + // Code: Identifies the specific error that occurred. + Code string `json:"code,omitempty"` + + // Kind: This is always sql#operationError. + Kind string `json:"kind,omitempty"` +} + +type OperationsListResponse struct { + // Items: List of operation resources. + Items []*InstanceOperation `json:"items,omitempty"` + + // Kind: This is always sql#operationsList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The continuation token, used to page through large + // result sets. Provide this value in a subsequent request to return the + // next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Settings struct { + // ActivationPolicy: The activation policy for this instance. This + // specifies when the instance should be activated and is applicable + // only when the instance state is RUNNABLE. This can be one of the + // following. + // ALWAYS: The instance should always be active. + // NEVER: The + // instance should never be activated. + // ON_DEMAND: The instance is + // activated upon receiving requests. + ActivationPolicy string `json:"activationPolicy,omitempty"` + + // AuthorizedGaeApplications: The AppEngine app ids that can access this + // instance. + AuthorizedGaeApplications []string `json:"authorizedGaeApplications,omitempty"` + + // BackupConfiguration: The daily backup configuration for the instance. + BackupConfiguration []*BackupConfiguration `json:"backupConfiguration,omitempty"` + + // Kind: This is always sql#settings. + Kind string `json:"kind,omitempty"` + + // PricingPlan: The pricing plan for this instance. This can be either + // PER_USE or PACKAGE. + PricingPlan string `json:"pricingPlan,omitempty"` + + // ReplicationType: The type of replication this instance uses. This can + // be either ASYNCHRONOUS or SYNCHRONOUS. + ReplicationType string `json:"replicationType,omitempty"` + + // Tier: The tier of service for this instance, for example D1, D2. For + // more information, see pricing. + Tier string `json:"tier,omitempty"` +} + +type Tier struct { + // DiskQuota: The maximum disk size of this tier in bytes. + DiskQuota int64 `json:"DiskQuota,omitempty,string"` + + // RAM: The maximum RAM usage of this tier in bytes. + RAM int64 `json:"RAM,omitempty,string"` + + // Kind: This is always sql#tier. + Kind string `json:"kind,omitempty"` + + // Region: The applicable regions for this tier. Can be us-east1 and + // europe-west1. + Region []string `json:"region,omitempty"` + + // Tier: An identifier for the service tier, for example D1, D2 etc. For + // related information, see Pricing. + Tier string `json:"tier,omitempty"` +} + +type TiersListResponse struct { + // Items: List of tiers. + Items []*Tier `json:"items,omitempty"` + + // Kind: This is always sql#tiersList. + Kind string `json:"kind,omitempty"` +} + +// method id "sql.backupRuns.get": + +type BackupRunsGetCall struct { + s *Service + project string + instance string + backupConfiguration string + dueTime string + opt_ map[string]interface{} +} + +// Get: Retrieves a resource containing information about a backup run. +func (r *BackupRunsService) Get(project string, instance string, backupConfiguration string, dueTime string) *BackupRunsGetCall { + c := &BackupRunsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.backupConfiguration = backupConfiguration + c.dueTime = dueTime + return c +} + +func (c *BackupRunsGetCall) Do() (*BackupRun, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("dueTime", fmt.Sprintf("%v", c.dueTime)) + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns/{backupConfiguration}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{backupConfiguration}", url.QueryEscape(c.backupConfiguration), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BackupRun) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a resource containing information about a backup run.", + // "httpMethod": "GET", + // "id": "sql.backupRuns.get", + // "parameterOrder": [ + // "project", + // "instance", + // "backupConfiguration", + // "dueTime" + // ], + // "parameters": { + // "backupConfiguration": { + // "description": "Identifier for the backup configuration. This gets generated automatically when a backup configuration is created.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "dueTime": { + // "description": "The time when this run is due to start in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/backupRuns/{backupConfiguration}", + // "response": { + // "$ref": "BackupRun" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.backupRuns.list": + +type BackupRunsListCall struct { + s *Service + project string + instance string + backupConfiguration string + opt_ map[string]interface{} +} + +// List: Lists all backup runs associated with a given instance and +// configuration in the reverse chronological order of the enqueued +// time. +func (r *BackupRunsService) List(project string, instance string, backupConfiguration string) *BackupRunsListCall { + c := &BackupRunsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.backupConfiguration = backupConfiguration + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of backup runs per response. +func (c *BackupRunsListCall) MaxResults(maxResults int64) *BackupRunsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A +// previously-returned page token representing part of the larger set of +// results to view. +func (c *BackupRunsListCall) PageToken(pageToken string) *BackupRunsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *BackupRunsListCall) Do() (*BackupRunsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("backupConfiguration", fmt.Sprintf("%v", c.backupConfiguration)) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BackupRunsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all backup runs associated with a given instance and configuration in the reverse chronological order of the enqueued time.", + // "httpMethod": "GET", + // "id": "sql.backupRuns.list", + // "parameterOrder": [ + // "project", + // "instance", + // "backupConfiguration" + // ], + // "parameters": { + // "backupConfiguration": { + // "description": "Identifier for the backup configuration. This gets generated automatically when a backup configuration is created.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of backup runs per response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A previously-returned page token representing part of the larger set of results to view.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/backupRuns", + // "response": { + // "$ref": "BackupRunsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.delete": + +type InstancesDeleteCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} +} + +// Delete: Deletes a Cloud SQL instance. +func (r *InstancesService) Delete(project string, instance string) *InstancesDeleteCall { + c := &InstancesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +func (c *InstancesDeleteCall) Do() (*InstancesDeleteResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesDeleteResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a Cloud SQL instance.", + // "httpMethod": "DELETE", + // "id": "sql.instances.delete", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}", + // "response": { + // "$ref": "InstancesDeleteResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.export": + +type InstancesExportCall struct { + s *Service + project string + instance string + instancesexportrequest *InstancesExportRequest + opt_ map[string]interface{} +} + +// Export: Exports data from a Cloud SQL instance to a Google Cloud +// Storage bucket as a MySQL dump file. +func (r *InstancesService) Export(project string, instance string, instancesexportrequest *InstancesExportRequest) *InstancesExportCall { + c := &InstancesExportCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.instancesexportrequest = instancesexportrequest + return c +} + +func (c *InstancesExportCall) Do() (*InstancesExportResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesexportrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/export") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesExportResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Exports data from a Cloud SQL instance to a Google Cloud Storage bucket as a MySQL dump file.", + // "httpMethod": "POST", + // "id": "sql.instances.export", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance to be exported.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/export", + // "request": { + // "$ref": "InstancesExportRequest" + // }, + // "response": { + // "$ref": "InstancesExportResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "sql.instances.get": + +type InstancesGetCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} +} + +// Get: Retrieves a resource containing information about a Cloud SQL +// instance. +func (r *InstancesService) Get(project string, instance string) *InstancesGetCall { + c := &InstancesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +func (c *InstancesGetCall) Do() (*DatabaseInstance, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DatabaseInstance) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a resource containing information about a Cloud SQL instance.", + // "httpMethod": "GET", + // "id": "sql.instances.get", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}", + // "response": { + // "$ref": "DatabaseInstance" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.import": + +type InstancesImportCall struct { + s *Service + project string + instance string + instancesimportrequest *InstancesImportRequest + opt_ map[string]interface{} +} + +// Import: Imports data into a Cloud SQL instance from a MySQL dump file +// in Google Cloud Storage. +func (r *InstancesService) Import(project string, instance string, instancesimportrequest *InstancesImportRequest) *InstancesImportCall { + c := &InstancesImportCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.instancesimportrequest = instancesimportrequest + return c +} + +func (c *InstancesImportCall) Do() (*InstancesImportResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesimportrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/import") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesImportResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Imports data into a Cloud SQL instance from a MySQL dump file in Google Cloud Storage.", + // "httpMethod": "POST", + // "id": "sql.instances.import", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/import", + // "request": { + // "$ref": "InstancesImportRequest" + // }, + // "response": { + // "$ref": "InstancesImportResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "sql.instances.insert": + +type InstancesInsertCall struct { + s *Service + project string + databaseinstance *DatabaseInstance + opt_ map[string]interface{} +} + +// Insert: Creates a new Cloud SQL instance. +func (r *InstancesService) Insert(project string, databaseinstance *DatabaseInstance) *InstancesInsertCall { + c := &InstancesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.databaseinstance = databaseinstance + return c +} + +func (c *InstancesInsertCall) Do() (*InstancesInsertResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesInsertResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new Cloud SQL instance.", + // "httpMethod": "POST", + // "id": "sql.instances.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances", + // "request": { + // "$ref": "DatabaseInstance" + // }, + // "response": { + // "$ref": "InstancesInsertResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.list": + +type InstancesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Lists instances under a given project in the alphabetical order +// of the instance name. +func (r *InstancesService) List(project string) *InstancesListCall { + c := &InstancesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of results to return per response. +func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A +// previously-returned page token representing part of the larger set of +// results to view. +func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *InstancesListCall) Do() (*InstancesListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists instances under a given project in the alphabetical order of the instance name.", + // "httpMethod": "GET", + // "id": "sql.instances.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "maxResults": { + // "description": "The maximum number of results to return per response.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A previously-returned page token representing part of the larger set of results to view.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project for which to list Cloud SQL instances.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances", + // "response": { + // "$ref": "InstancesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.patch": + +type InstancesPatchCall struct { + s *Service + project string + instance string + databaseinstance *DatabaseInstance + opt_ map[string]interface{} +} + +// Patch: Updates settings of a Cloud SQL instance. Caution: This is not +// a partial update, so you must include values for all the settings +// that you want to retain. For partial updates, use patch.. This method +// supports patch semantics. +func (r *InstancesService) Patch(project string, instance string, databaseinstance *DatabaseInstance) *InstancesPatchCall { + c := &InstancesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.databaseinstance = databaseinstance + return c +} + +func (c *InstancesPatchCall) Do() (*InstancesUpdateResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesUpdateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "sql.instances.patch", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}", + // "request": { + // "$ref": "DatabaseInstance" + // }, + // "response": { + // "$ref": "InstancesUpdateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.restart": + +type InstancesRestartCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} +} + +// Restart: Restarts a Cloud SQL instance. +func (r *InstancesService) Restart(project string, instance string) *InstancesRestartCall { + c := &InstancesRestartCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +func (c *InstancesRestartCall) Do() (*InstancesRestartResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/restart") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesRestartResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Restarts a Cloud SQL instance.", + // "httpMethod": "POST", + // "id": "sql.instances.restart", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance to be restarted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/restart", + // "response": { + // "$ref": "InstancesRestartResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.restoreBackup": + +type InstancesRestoreBackupCall struct { + s *Service + project string + instance string + backupConfigurationid string + dueTime string + opt_ map[string]interface{} +} + +// RestoreBackup: Restores a backup of a Cloud SQL instance. +func (r *InstancesService) RestoreBackup(project string, instance string, backupConfigurationid string, dueTime string) *InstancesRestoreBackupCall { + c := &InstancesRestoreBackupCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.backupConfigurationid = backupConfigurationid + c.dueTime = dueTime + return c +} + +func (c *InstancesRestoreBackupCall) Do() (*InstancesRestoreBackupResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("backupConfiguration", fmt.Sprintf("%v", c.backupConfigurationid)) + params.Set("dueTime", fmt.Sprintf("%v", c.dueTime)) + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/restoreBackup") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesRestoreBackupResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Restores a backup of a Cloud SQL instance.", + // "httpMethod": "POST", + // "id": "sql.instances.restoreBackup", + // "parameterOrder": [ + // "project", + // "instance", + // "backupConfiguration", + // "dueTime" + // ], + // "parameters": { + // "backupConfiguration": { + // "description": "The identifier of the backup configuration. This gets generated automatically when a backup configuration is created.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "dueTime": { + // "description": "The time when this run is due to start in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/restoreBackup", + // "response": { + // "$ref": "InstancesRestoreBackupResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.update": + +type InstancesUpdateCall struct { + s *Service + project string + instance string + databaseinstance *DatabaseInstance + opt_ map[string]interface{} +} + +// Update: Updates settings of a Cloud SQL instance. Caution: This is +// not a partial update, so you must include values for all the settings +// that you want to retain. For partial updates, use patch. +func (r *InstancesService) Update(project string, instance string, databaseinstance *DatabaseInstance) *InstancesUpdateCall { + c := &InstancesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.databaseinstance = databaseinstance + return c +} + +func (c *InstancesUpdateCall) Do() (*InstancesUpdateResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesUpdateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.", + // "etagRequired": true, + // "httpMethod": "PUT", + // "id": "sql.instances.update", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}", + // "request": { + // "$ref": "DatabaseInstance" + // }, + // "response": { + // "$ref": "InstancesUpdateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.operations.get": + +type OperationsGetCall struct { + s *Service + project string + instance string + operation string + opt_ map[string]interface{} +} + +// Get: Retrieves an instance operation that has been performed on an +// instance. +func (r *OperationsService) Get(project string, instance string, operation string) *OperationsGetCall { + c := &OperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.operation = operation + return c +} + +func (c *OperationsGetCall) Do() (*InstanceOperation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstanceOperation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves an instance operation that has been performed on an instance.", + // "httpMethod": "GET", + // "id": "sql.operations.get", + // "parameterOrder": [ + // "project", + // "instance", + // "operation" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "operation": { + // "description": "Instance operation ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/operations/{operation}", + // "response": { + // "$ref": "InstanceOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.operations.list": + +type OperationsListCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} +} + +// List: Lists all instance operations that have been performed on the +// given Cloud SQL instance in the reverse chronological order of the +// start time. +func (r *OperationsService) List(project string, instance string) *OperationsListCall { + c := &OperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of operations per response. +func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A +// previously-returned page token representing part of the larger set of +// results to view. +func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *OperationsListCall) Do() (*OperationsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OperationsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.", + // "httpMethod": "GET", + // "id": "sql.operations.list", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of operations per response.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A previously-returned page token representing part of the larger set of results to view.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/operations", + // "response": { + // "$ref": "OperationsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.tiers.list": + +type TiersListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Lists all available service tiers for Google Cloud SQL, for +// example D1, D2. For related information, see Pricing. +func (r *TiersService) List() *TiersListCall { + c := &TiersListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *TiersListCall) Do() (*TiersListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "tiers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TiersListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all available service tiers for Google Cloud SQL, for example D1, D2. For related information, see Pricing.", + // "httpMethod": "GET", + // "id": "sql.tiers.list", + // "path": "tiers", + // "response": { + // "$ref": "TiersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/sqladmin/v1beta3/sqladmin-api.json b/third_party/src/code.google.com/p/google-api-go-client/sqladmin/v1beta3/sqladmin-api.json new file mode 100644 index 0000000000000..216f1de2e373a --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/sqladmin/v1beta3/sqladmin-api.json @@ -0,0 +1,1865 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/CD7bDR9g9q-XnWpJ4P4rUZfTgmg\"", + "discoveryVersion": "v1", + "id": "sqladmin:v1beta3", + "name": "sqladmin", + "canonicalName": "SQL Admin", + "version": "v1beta3", + "title": "Cloud SQL Administration API", + "description": "API for Cloud SQL database instance management.", + "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/cloud-sql/docs/admin-api/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/sql/v1beta3/", + "basePath": "/sql/v1beta3/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "sql/v1beta3/", + "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/sqlservice.admin": { + "description": "Manage your Google SQL Service instances" + } + } + } + }, + "schemas": { + "BackupConfiguration": { + "id": "BackupConfiguration", + "type": "object", + "description": "Database instance backup configuration.", + "properties": { + "binaryLogEnabled": { + "type": "boolean", + "description": "Whether binary log is enabled. If backup configuration is disabled, binary log must be disabled as well." + }, + "enabled": { + "type": "boolean", + "description": "Whether this configuration is enabled." + }, + "id": { + "type": "string", + "description": "Identifier for this configuration. This gets generated automatically when a backup configuration is created." + }, + "kind": { + "type": "string", + "description": "This is always sql#backupConfiguration.", + "default": "sql#backupConfiguration" + }, + "startTime": { + "type": "string", + "description": "Start time for the daily backup configuration in UTC timezone in the 24 hour format - HH:MM." + } + } + }, + "BackupRun": { + "id": "BackupRun", + "type": "object", + "description": "A database instance backup run resource.", + "properties": { + "backupConfiguration": { + "type": "string", + "description": "Backup Configuration identifier." + }, + "dueTime": { + "type": "string", + "description": "The due time of this run in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "format": "date-time" + }, + "endTime": { + "type": "string", + "description": "The time the backup operation completed in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "format": "date-time" + }, + "enqueuedTime": { + "type": "string", + "description": "The time the run was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "format": "date-time" + }, + "error": { + "$ref": "OperationError", + "description": "Information about why the backup operation failed. This is only present if the run has the FAILED status." + }, + "instance": { + "type": "string", + "description": "Name of the database instance." + }, + "kind": { + "type": "string", + "description": "This is always sql#backupRun.", + "default": "sql#backupRun" + }, + "startTime": { + "type": "string", + "description": "The time the backup operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "format": "date-time" + }, + "status": { + "type": "string", + "description": "The status of this run." + } + } + }, + "BackupRunsListResponse": { + "id": "BackupRunsListResponse", + "type": "object", + "description": "Backup run list results.", + "properties": { + "items": { + "type": "array", + "description": "A list of backup runs in reverse chronological order of the enqueued time.", + "items": { + "$ref": "BackupRun" + } + }, + "kind": { + "type": "string", + "description": "This is always sql#backupRunsList.", + "default": "sql#backupRunsList" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + } + } + }, + "BinLogCoordinates": { + "id": "BinLogCoordinates", + "type": "object", + "description": "Binary log coordinates.", + "properties": { + "binLogFileName": { + "type": "string", + "description": "Name of the binary log file for a Cloud SQL instance." + }, + "binLogPosition": { + "type": "string", + "description": "Position (offset) within the binary log file.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "This is always sql#binLogCoordinates.", + "default": "sql#binLogCoordinates" + } + } + }, + "CloneContext": { + "id": "CloneContext", + "type": "object", + "description": "Database instance clone context.", + "properties": { + "binLogCoordinates": { + "$ref": "BinLogCoordinates", + "description": "Binary log coordinates, if specified, indentify the the position up to which the source instance should be cloned. If not specified, the source instance is cloned up to the most recent binary log coordintes." + }, + "destinationInstanceName": { + "type": "string", + "description": "Name of the Cloud SQL instance to be created as a clone." + }, + "kind": { + "type": "string", + "description": "This is always sql#cloneContext.", + "default": "sql#cloneContext" + }, + "sourceInstanceName": { + "type": "string", + "description": "Name of the Cloud SQL instance to be cloned." + } + } + }, + "DatabaseFlags": { + "id": "DatabaseFlags", + "type": "object", + "description": "MySQL flags for Cloud SQL instances.", + "properties": { + "name": { + "type": "string", + "description": "The name of the flag. These flags are passed at instance startup, so include both MySQL server options and MySQL system variables. Flags should be specified with underscores, not hyphens. Refer to the official MySQL documentation on server options and system variables for descriptions of what these flags do. Acceptable values are: event_scheduler on or off (Note: The event scheduler will only work reliably if the instance activationPolicy is set to ALWAYS.) general_log on or off group_concat_max_len 4..17179869184 innodb_flush_log_at_trx_commit 0..2 innodb_lock_wait_timeout 1..1073741824 log_bin_trust_function_creators on or off log_output Can be either TABLE or NONE, FILE is not supported. log_queries_not_using_indexes on or off long_query_time 0..30000000 lower_case_table_names 0..2 max_allowed_packet 16384..1073741824 read_only on or off skip_show_database on or off slow_query_log on or off wait_timeout 1..31536000" + }, + "value": { + "type": "string", + "description": "The value of the flag. Booleans should be set using 1 for true, and 0 for false. This field must be omitted if the flag doesn't take a value." + } + } + }, + "DatabaseInstance": { + "id": "DatabaseInstance", + "type": "object", + "description": "A Cloud SQL instance resource.", + "properties": { + "currentDiskSize": { + "type": "string", + "description": "The current disk usage of the instance in bytes.", + "format": "int64" + }, + "databaseVersion": { + "type": "string", + "description": "The database engine type and version, for example MYSQL_5_5 for MySQL 5.5." + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the resource." + }, + "instance": { + "type": "string", + "description": "Name of the Cloud SQL instance. This does not include the project ID.", + "annotations": { + "required": [ + "sql.instances.insert", + "sql.instances.update" + ] + } + }, + "ipAddresses": { + "type": "array", + "description": "The assigned IP addresses for the instance.", + "items": { + "$ref": "IpMapping" + } + }, + "kind": { + "type": "string", + "description": "This is always sql#instance.", + "default": "sql#instance" + }, + "maxDiskSize": { + "type": "string", + "description": "The maximum disk size of the instance in bytes.", + "format": "int64" + }, + "project": { + "type": "string", + "description": "The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable.", + "annotations": { + "required": [ + "sql.instances.insert", + "sql.instances.update" + ] + } + }, + "region": { + "type": "string", + "description": "The geographical region. Can be us-east1, us-central, asia-east1 or europe-west1. Defaults to us-central. The region can not be changed after instance creation." + }, + "serverCaCert": { + "$ref": "SslCert", + "description": "SSL configuration." + }, + "settings": { + "$ref": "Settings", + "description": "The user settings." + }, + "state": { + "type": "string", + "description": "The current serving state of the Cloud SQL instance. This can be one of the following.\nRUNNABLE: The instance is running, or is ready to run when accessed.\nSUSPENDED: The instance is not available, for example due to problems with billing.\nPENDING_CREATE: The instance is being created.\nMAINTENANCE: The instance is down for maintenance.\nUNKNOWN_STATE: The state of the instance is unknown." + } + } + }, + "ExportContext": { + "id": "ExportContext", + "type": "object", + "description": "Database instance export context.", + "properties": { + "database": { + "type": "array", + "description": "Databases (for example, guestbook) from which the export is made. If unspecified, all databases are exported.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "This is always sql#exportContext.", + "default": "sql#exportContext" + }, + "table": { + "type": "array", + "description": "Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database.", + "items": { + "type": "string" + } + }, + "uri": { + "type": "string", + "description": "The path to the file in Google Cloud Storage where the export will be stored, or where it was already stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the operation fails. If the filename ends with .gz, the contents are compressed." + } + } + }, + "Flag": { + "id": "Flag", + "type": "object", + "description": "A Google Cloud SQL service flag resource.", + "properties": { + "allowedStringValues": { + "type": "array", + "description": "For STRING flags, a list of strings that the value can be set to.", + "items": { + "type": "string" + } + }, + "appliesTo": { + "type": "array", + "description": "The database version this flag applies to. Currently this can only be [MYSQL_5_5].", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "This is always sql#flag.", + "default": "sql#flag" + }, + "maxValue": { + "type": "string", + "description": "For INTEGER flags, the maximum allowed value.", + "format": "int64" + }, + "minValue": { + "type": "string", + "description": "For INTEGER flags, the minimum allowed value.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "This is the name of the flag. Flag names always use underscores, not hyphens, e.g. max_allowed_packet" + }, + "type": { + "type": "string", + "description": "The type of the flag. Flags are typed to being BOOLEAN, STRING, INTEGER or NONE. NONE is used for flags which do not take a value, such as skip_grant_tables." + } + } + }, + "FlagsListResponse": { + "id": "FlagsListResponse", + "type": "object", + "description": "Flags list response.", + "properties": { + "items": { + "type": "array", + "description": "List of flags.", + "items": { + "$ref": "Flag" + } + }, + "kind": { + "type": "string", + "description": "This is always sql#flagsList.", + "default": "sql#flagsList" + } + } + }, + "ImportContext": { + "id": "ImportContext", + "type": "object", + "description": "Database instance import context.", + "properties": { + "database": { + "type": "string", + "description": "The database (for example, guestbook) to which the import is made. If not set, it is assumed that the database is specified in the file to be imported." + }, + "kind": { + "type": "string", + "description": "This is always sql#importContext.", + "default": "sql#importContext" + }, + "uri": { + "type": "array", + "description": "A path to the MySQL dump file in Google Cloud Storage from which the import is made. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are also supported.", + "items": { + "type": "string" + } + } + } + }, + "InstanceOperation": { + "id": "InstanceOperation", + "type": "object", + "description": "An Operations resource contains information about database instance operations such as create, delete, and restart. Operations resources are created in response to operations that were initiated; you never create them directly.", + "properties": { + "endTime": { + "type": "string", + "description": "The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "format": "date-time" + }, + "enqueuedTime": { + "type": "string", + "description": "The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "format": "date-time" + }, + "error": { + "type": "array", + "description": "The error(s) encountered by this operation. Only set if the operation results in an error.", + "items": { + "$ref": "OperationError" + } + }, + "exportContext": { + "$ref": "ExportContext", + "description": "The context for export operation, if applicable." + }, + "importContext": { + "$ref": "ImportContext", + "description": "The context for import operation, if applicable." + }, + "instance": { + "type": "string", + "description": "Name of the database instance." + }, + "kind": { + "type": "string", + "description": "This is always sql#instanceOperation.", + "default": "sql#instanceOperation" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation." + }, + "operationType": { + "type": "string", + "description": "The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME." + }, + "startTime": { + "type": "string", + "description": "The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "format": "date-time" + }, + "state": { + "type": "string", + "description": "The state of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN." + }, + "userEmailAddress": { + "type": "string", + "description": "The email address of the user who initiated this operation." + } + } + }, + "InstanceSetRootPasswordRequest": { + "id": "InstanceSetRootPasswordRequest", + "type": "object", + "description": "Database instance set root password request.", + "properties": { + "setRootPasswordContext": { + "$ref": "SetRootPasswordContext", + "description": "Set Root Password Context." + } + } + }, + "InstancesCloneRequest": { + "id": "InstancesCloneRequest", + "type": "object", + "description": "Database instance clone request.", + "properties": { + "cloneContext": { + "$ref": "CloneContext", + "description": "Contains details about the clone operation." + } + } + }, + "InstancesCloneResponse": { + "id": "InstancesCloneResponse", + "type": "object", + "description": "Database instance clone response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#instancesClone.", + "default": "sql#instancesClone" + }, + "operation": { + "type": "string", + "description": "An unique identifier for the operation associated with the cloned instance. You can use this identifier to retrieve the Operations resource, which has information about the operation." + } + } + }, + "InstancesDeleteResponse": { + "id": "InstancesDeleteResponse", + "type": "object", + "description": "Database instance delete response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#instancesDelete.", + "default": "sql#instancesDelete" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation." + } + } + }, + "InstancesExportRequest": { + "id": "InstancesExportRequest", + "type": "object", + "description": "Database instance export request.", + "properties": { + "exportContext": { + "$ref": "ExportContext", + "description": "Contains details about the export operation." + } + } + }, + "InstancesExportResponse": { + "id": "InstancesExportResponse", + "type": "object", + "description": "Database instance export response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#instancesExport.", + "default": "sql#instancesExport" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation." + } + } + }, + "InstancesImportRequest": { + "id": "InstancesImportRequest", + "type": "object", + "description": "Database instance import request.", + "properties": { + "importContext": { + "$ref": "ImportContext", + "description": "Contains details about the import operation." + } + } + }, + "InstancesImportResponse": { + "id": "InstancesImportResponse", + "type": "object", + "description": "Database instance import response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#instancesImport.", + "default": "sql#instancesImport" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation." + } + } + }, + "InstancesInsertResponse": { + "id": "InstancesInsertResponse", + "type": "object", + "description": "Database instance insert response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#instancesInsert.", + "default": "sql#instancesInsert" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation." + } + } + }, + "InstancesListResponse": { + "id": "InstancesListResponse", + "type": "object", + "description": "Database instances list response.", + "properties": { + "items": { + "type": "array", + "description": "List of database instance resources.", + "items": { + "$ref": "DatabaseInstance" + } + }, + "kind": { + "type": "string", + "description": "This is always sql#instancesList.", + "default": "sql#instancesList" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + } + } + }, + "InstancesResetSslConfigResponse": { + "id": "InstancesResetSslConfigResponse", + "type": "object", + "description": "Database instance resetSslConfig response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#instancesResetSslConfig.", + "default": "sql#instancesResetSslConfig" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. All ssl client certificates will be deleted and a new server certificate will be created. Does not take effect until the next instance restart." + } + } + }, + "InstancesRestartResponse": { + "id": "InstancesRestartResponse", + "type": "object", + "description": "Database instance restart response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#instancesRestart.", + "default": "sql#instancesRestart" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation." + } + } + }, + "InstancesRestoreBackupResponse": { + "id": "InstancesRestoreBackupResponse", + "type": "object", + "description": "Database instance restore backup response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#instancesRestoreBackup.", + "default": "sql#instancesRestoreBackup" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation." + } + } + }, + "InstancesSetRootPasswordResponse": { + "id": "InstancesSetRootPasswordResponse", + "type": "object", + "description": "Database instance set root password response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#instancesSetRootPassword.", + "default": "sql#instancesSetRootPassword" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation." + } + } + }, + "InstancesUpdateResponse": { + "id": "InstancesUpdateResponse", + "type": "object", + "description": "Database instance update response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#instancesUpdate.", + "default": "sql#instancesUpdate" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve information about the operation." + } + } + }, + "IpConfiguration": { + "id": "IpConfiguration", + "type": "object", + "description": "IP Management configuration.", + "properties": { + "authorizedNetworks": { + "type": "array", + "description": "The list of external networks that are allowed to connect to the instance using the IP. In CIDR notation, also known as 'slash' notation (e.g. 192.168.100.0/24).", + "items": { + "type": "string" + } + }, + "enabled": { + "type": "boolean", + "description": "Whether the instance should be assigned an IP address or not." + }, + "requireSsl": { + "type": "boolean", + "description": "Whether the mysqld should default to 'REQUIRE X509' for users connecting over IP." + } + } + }, + "IpMapping": { + "id": "IpMapping", + "type": "object", + "description": "Database instance IP Mapping.", + "properties": { + "ipAddress": { + "type": "string", + "description": "The IP address assigned." + }, + "timeToRetire": { + "type": "string", + "description": "The due time for this IP to be retired in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. This field is only available when the IP is scheduled to be retired.", + "format": "date-time" + } + } + }, + "LocationPreference": { + "id": "LocationPreference", + "type": "object", + "description": "Preferred location. This specifies where a Cloud SQL instance should preferably be located, either in a specific Compute Engine zone, or co-located with an App Engine application. Note that if the preferred location is not available, the instance will be located as close as possible within the region. Only one location may be specified.", + "properties": { + "followGaeApplication": { + "type": "string", + "description": "The AppEngine application to follow, it must be in the same region as the Cloud SQL instance." + }, + "kind": { + "type": "string", + "description": "This is always sql#locationPreference.", + "default": "sql#locationPreference" + }, + "zone": { + "type": "string", + "description": "The preferred Compute Engine zone (e.g. us-centra1-a, us-central1-b, etc.)." + } + } + }, + "OperationError": { + "id": "OperationError", + "type": "object", + "description": "Database instance operation error.", + "properties": { + "code": { + "type": "string", + "description": "Identifies the specific error that occurred." + }, + "kind": { + "type": "string", + "description": "This is always sql#operationError.", + "default": "sql#operationError" + } + } + }, + "OperationsListResponse": { + "id": "OperationsListResponse", + "type": "object", + "description": "Database instance list operations response.", + "properties": { + "items": { + "type": "array", + "description": "List of operation resources.", + "items": { + "$ref": "InstanceOperation" + } + }, + "kind": { + "type": "string", + "description": "This is always sql#operationsList.", + "default": "sql#operationsList" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + } + } + }, + "SetRootPasswordContext": { + "id": "SetRootPasswordContext", + "type": "object", + "description": "Database instance set root password context.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#setRootUserContext.", + "default": "sql#setRootUserContext" + }, + "password": { + "type": "string", + "description": "The password for the root user." + } + } + }, + "Settings": { + "id": "Settings", + "type": "object", + "description": "Database instance settings.", + "properties": { + "activationPolicy": { + "type": "string", + "description": "The activation policy for this instance. This specifies when the instance should be activated and is applicable only when the instance state is RUNNABLE. This can be one of the following.\nALWAYS: The instance should always be active.\nNEVER: The instance should never be activated.\nON_DEMAND: The instance is activated upon receiving requests." + }, + "authorizedGaeApplications": { + "type": "array", + "description": "The AppEngine app ids that can access this instance.", + "items": { + "type": "string" + } + }, + "backupConfiguration": { + "type": "array", + "description": "The daily backup configuration for the instance.", + "items": { + "$ref": "BackupConfiguration" + } + }, + "databaseFlags": { + "type": "array", + "description": "The database flags passed to the instance at startup.", + "items": { + "$ref": "DatabaseFlags" + } + }, + "ipConfiguration": { + "$ref": "IpConfiguration", + "description": "The settings for IP Management. This allows to enable or disable the instance IP and manage which external networks can connect to the instance." + }, + "kind": { + "type": "string", + "description": "This is always sql#settings.", + "default": "sql#settings" + }, + "locationPreference": { + "$ref": "LocationPreference", + "description": "The location preference settings. This allows the instance to be located as near as possible to either an AppEngine app or GCE zone for better perfomance." + }, + "pricingPlan": { + "type": "string", + "description": "The pricing plan for this instance. This can be either PER_USE or PACKAGE." + }, + "replicationType": { + "type": "string", + "description": "The type of replication this instance uses. This can be either ASYNCHRONOUS or SYNCHRONOUS." + }, + "settingsVersion": { + "type": "string", + "description": "The version of instance settings. This is a required field for update method to make sure concurrent updates are handled properly. During update, use the most recent settingsVersion value for this instance and do not try to update this value.", + "format": "int64", + "annotations": { + "required": [ + "sql.instances.update" + ] + } + }, + "tier": { + "type": "string", + "description": "The tier of service for this instance, for example D1, D2. For more information, see pricing.", + "annotations": { + "required": [ + "sql.instances.insert", + "sql.instances.update" + ] + } + } + } + }, + "SslCert": { + "id": "SslCert", + "type": "object", + "description": "SslCerts Resource", + "properties": { + "cert": { + "type": "string", + "description": "PEM representation." + }, + "certSerialNumber": { + "type": "string", + "description": "Serial number, as extracted from the certificate." + }, + "commonName": { + "type": "string", + "description": "User supplied name. Constrained to [a-zA-Z.-_ ]+." + }, + "createTime": { + "type": "string", + "description": "Time when the certificate was created.", + "format": "date-time" + }, + "expirationTime": { + "type": "string", + "description": "Time when the certificate expires.", + "format": "date-time" + }, + "instance": { + "type": "string", + "description": "Name of the database instance." + }, + "kind": { + "type": "string", + "description": "This is always sql#sslCert.", + "default": "sql#sslCert" + }, + "sha1Fingerprint": { + "type": "string", + "description": "Sha1 Fingerprint." + } + } + }, + "SslCertDetail": { + "id": "SslCertDetail", + "type": "object", + "description": "SslCertDetail.", + "properties": { + "certInfo": { + "$ref": "SslCert", + "description": "The public information about the cert." + }, + "certPrivateKey": { + "type": "string", + "description": "The private key for the client cert, in pem format. Keep private in order to protect your security." + } + } + }, + "SslCertsDeleteResponse": { + "id": "SslCertsDeleteResponse", + "type": "object", + "description": "SslCert delete response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#sslCertsDelete.", + "default": "sql#sslCertsDelete" + }, + "operation": { + "type": "string", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation." + } + } + }, + "SslCertsInsertRequest": { + "id": "SslCertsInsertRequest", + "type": "object", + "description": "SslCerts insert request.", + "properties": { + "commonName": { + "type": "string", + "description": "User supplied name. Must be a distinct name from the other certificates for this instance. New certificates will not be usable until the instance is restarted." + } + } + }, + "SslCertsInsertResponse": { + "id": "SslCertsInsertResponse", + "type": "object", + "description": "SslCert insert response.", + "properties": { + "clientCert": { + "$ref": "SslCertDetail", + "description": "The new client certificate and private key. The new certificate will not work until the instance is restarted." + }, + "kind": { + "type": "string", + "description": "This is always sql#sslCertsInsert.", + "default": "sql#sslCertsInsert" + }, + "serverCaCert": { + "$ref": "SslCert", + "description": "The server Certificate Authority's certificate. If this is missing you can force a new one to be generated by calling resetSslConfig method on instances resource.." + } + } + }, + "SslCertsListResponse": { + "id": "SslCertsListResponse", + "type": "object", + "description": "SslCerts list response.", + "properties": { + "items": { + "type": "array", + "description": "List of client certificates for the instance.", + "items": { + "$ref": "SslCert" + } + }, + "kind": { + "type": "string", + "description": "This is always sql#sslCertsList.", + "default": "sql#sslCertsList" + } + } + }, + "Tier": { + "id": "Tier", + "type": "object", + "description": "A Google Cloud SQL service tier resource.", + "properties": { + "DiskQuota": { + "type": "string", + "description": "The maximum disk size of this tier in bytes.", + "format": "int64" + }, + "RAM": { + "type": "string", + "description": "The maximum RAM usage of this tier in bytes.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "This is always sql#tier.", + "default": "sql#tier" + }, + "region": { + "type": "array", + "description": "The applicable regions for this tier. Can be us-east1, europe-west1, or asia-east1.", + "items": { + "type": "string" + } + }, + "tier": { + "type": "string", + "description": "An identifier for the service tier, for example D1, D2 etc. For related information, see Pricing." + } + } + }, + "TiersListResponse": { + "id": "TiersListResponse", + "type": "object", + "description": "Tiers list response.", + "properties": { + "items": { + "type": "array", + "description": "List of tiers.", + "items": { + "$ref": "Tier" + } + }, + "kind": { + "type": "string", + "description": "This is always sql#tiersList.", + "default": "sql#tiersList" + } + } + } + }, + "resources": { + "backupRuns": { + "methods": { + "get": { + "id": "sql.backupRuns.get", + "path": "projects/{project}/instances/{instance}/backupRuns/{backupConfiguration}", + "httpMethod": "GET", + "description": "Retrieves a resource containing information about a backup run.", + "parameters": { + "backupConfiguration": { + "type": "string", + "description": "Identifier for the backup configuration. This gets generated automatically when a backup configuration is created.", + "required": true, + "location": "path" + }, + "dueTime": { + "type": "string", + "description": "The time when this run is due to start in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "required": true, + "location": "query" + }, + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance", + "backupConfiguration", + "dueTime" + ], + "response": { + "$ref": "BackupRun" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "list": { + "id": "sql.backupRuns.list", + "path": "projects/{project}/instances/{instance}/backupRuns", + "httpMethod": "GET", + "description": "Lists all backup runs associated with a given instance and configuration in the reverse chronological order of the enqueued time.", + "parameters": { + "backupConfiguration": { + "type": "string", + "description": "Identifier for the backup configuration. This gets generated automatically when a backup configuration is created.", + "required": true, + "location": "query" + }, + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of backup runs per response.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance", + "backupConfiguration" + ], + "response": { + "$ref": "BackupRunsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + }, + "flags": { + "methods": { + "list": { + "id": "sql.flags.list", + "path": "flags", + "httpMethod": "GET", + "description": "List all available database flags for Google Cloud SQL instances.", + "response": { + "$ref": "FlagsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + }, + "instances": { + "methods": { + "clone": { + "id": "sql.instances.clone", + "path": "projects/{project}/instances/clone", + "httpMethod": "POST", + "description": "Creates a Cloud SQL instance as a clone of the source instance.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID of the source as well as the clone Cloud SQL instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "InstancesCloneRequest" + }, + "response": { + "$ref": "InstancesCloneResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "delete": { + "id": "sql.instances.delete", + "path": "projects/{project}/instances/{instance}", + "httpMethod": "DELETE", + "description": "Deletes a Cloud SQL instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "response": { + "$ref": "InstancesDeleteResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "export": { + "id": "sql.instances.export", + "path": "projects/{project}/instances/{instance}/export", + "httpMethod": "POST", + "description": "Exports data from a Cloud SQL instance to a Google Cloud Storage bucket as a MySQL dump file.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance to be exported.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "request": { + "$ref": "InstancesExportRequest" + }, + "response": { + "$ref": "InstancesExportResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "id": "sql.instances.get", + "path": "projects/{project}/instances/{instance}", + "httpMethod": "GET", + "description": "Retrieves a resource containing information about a Cloud SQL instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Database instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "response": { + "$ref": "DatabaseInstance" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "import": { + "id": "sql.instances.import", + "path": "projects/{project}/instances/{instance}/import", + "httpMethod": "POST", + "description": "Imports data into a Cloud SQL instance from a MySQL dump file in Google Cloud Storage.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "request": { + "$ref": "InstancesImportRequest" + }, + "response": { + "$ref": "InstancesImportResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "insert": { + "id": "sql.instances.insert", + "path": "projects/{project}/instances", + "httpMethod": "POST", + "description": "Creates a new Cloud SQL instance.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "DatabaseInstance" + }, + "response": { + "$ref": "InstancesInsertResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "list": { + "id": "sql.instances.list", + "path": "projects/{project}/instances", + "httpMethod": "GET", + "description": "Lists instances under a given project in the alphabetical order of the instance name.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of results to return per response.", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID of the project for which to list Cloud SQL instances.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "InstancesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "patch": { + "id": "sql.instances.patch", + "path": "projects/{project}/instances/{instance}", + "httpMethod": "PATCH", + "description": "Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.. This method supports patch semantics.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "request": { + "$ref": "DatabaseInstance" + }, + "response": { + "$ref": "InstancesUpdateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "resetSslConfig": { + "id": "sql.instances.resetSslConfig", + "path": "projects/{project}/instances/{instance}/resetSslConfig", + "httpMethod": "POST", + "description": "Deletes all client certificates and generates a new server SSL certificate for the instance. The changes will not take effect until the instance is restarted. Existing instances without a server certificate will need to call this once to set a server certificate.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "response": { + "$ref": "InstancesResetSslConfigResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "restart": { + "id": "sql.instances.restart", + "path": "projects/{project}/instances/{instance}/restart", + "httpMethod": "POST", + "description": "Restarts a Cloud SQL instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance to be restarted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "response": { + "$ref": "InstancesRestartResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "restoreBackup": { + "id": "sql.instances.restoreBackup", + "path": "projects/{project}/instances/{instance}/restoreBackup", + "httpMethod": "POST", + "description": "Restores a backup of a Cloud SQL instance.", + "parameters": { + "backupConfiguration": { + "type": "string", + "description": "The identifier of the backup configuration. This gets generated automatically when a backup configuration is created.", + "required": true, + "location": "query" + }, + "dueTime": { + "type": "string", + "description": "The time when this run is due to start in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "required": true, + "location": "query" + }, + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance", + "backupConfiguration", + "dueTime" + ], + "response": { + "$ref": "InstancesRestoreBackupResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "setRootPassword": { + "id": "sql.instances.setRootPassword", + "path": "projects/{project}/instances/{instance}/setRootPassword", + "httpMethod": "POST", + "description": "Sets the password for the root user.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "request": { + "$ref": "InstanceSetRootPasswordRequest" + }, + "response": { + "$ref": "InstancesSetRootPasswordResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "update": { + "id": "sql.instances.update", + "path": "projects/{project}/instances/{instance}", + "httpMethod": "PUT", + "description": "Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "etagRequired": true, + "request": { + "$ref": "DatabaseInstance" + }, + "response": { + "$ref": "InstancesUpdateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + }, + "operations": { + "methods": { + "get": { + "id": "sql.operations.get", + "path": "projects/{project}/instances/{instance}/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves an instance operation that has been performed on an instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "operation": { + "type": "string", + "description": "Instance operation ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance", + "operation" + ], + "response": { + "$ref": "InstanceOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "list": { + "id": "sql.operations.list", + "path": "projects/{project}/instances/{instance}/operations", + "httpMethod": "GET", + "description": "Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of operations per response.", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "response": { + "$ref": "OperationsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + }, + "sslCerts": { + "methods": { + "delete": { + "id": "sql.sslCerts.delete", + "path": "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", + "httpMethod": "DELETE", + "description": "Deletes the SSL certificate. The change will not take effect until the instance is restarted.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance to be deleted.", + "required": true, + "location": "path" + }, + "sha1Fingerprint": { + "type": "string", + "description": "Sha1 FingerPrint.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance", + "sha1Fingerprint" + ], + "response": { + "$ref": "SslCertsDeleteResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "get": { + "id": "sql.sslCerts.get", + "path": "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", + "httpMethod": "GET", + "description": "Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creation.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + }, + "sha1Fingerprint": { + "type": "string", + "description": "Sha1 FingerPrint.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance", + "sha1Fingerprint" + ], + "response": { + "$ref": "SslCert" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "insert": { + "id": "sql.sslCerts.insert", + "path": "projects/{project}/instances/{instance}/sslCerts", + "httpMethod": "POST", + "description": "Creates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "request": { + "$ref": "SslCertsInsertRequest" + }, + "response": { + "$ref": "SslCertsInsertResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "list": { + "id": "sql.sslCerts.list", + "path": "projects/{project}/instances/{instance}/sslCerts", + "httpMethod": "GET", + "description": "Lists all of the current SSL certificates for the instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the project for which to list Cloud SQL instances.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "response": { + "$ref": "SslCertsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + }, + "tiers": { + "methods": { + "list": { + "id": "sql.tiers.list", + "path": "projects/{project}/tiers", + "httpMethod": "GET", + "description": "Lists all available service tiers for Google Cloud SQL, for example D1, D2. For related information, see Pricing.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID of the project for which to list tiers.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "TiersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/sqladmin/v1beta3/sqladmin-gen.go b/third_party/src/code.google.com/p/google-api-go-client/sqladmin/v1beta3/sqladmin-gen.go new file mode 100644 index 0000000000000..69f34d3f00704 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/sqladmin/v1beta3/sqladmin-gen.go @@ -0,0 +1,2712 @@ +// Package sqladmin provides access to the Cloud SQL Administration API. +// +// See https://developers.google.com/cloud-sql/docs/admin-api/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/sqladmin/v1beta3" +// ... +// sqladminService, err := sqladmin.New(oauthHttpClient) +package sqladmin + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "sqladmin:v1beta3" +const apiName = "sqladmin" +const apiVersion = "v1beta3" +const basePath = "https://www.googleapis.com/sql/v1beta3/" + +// 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" + + // Manage your Google SQL Service instances + SqlserviceAdminScope = "https://www.googleapis.com/auth/sqlservice.admin" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.BackupRuns = NewBackupRunsService(s) + s.Flags = NewFlagsService(s) + s.Instances = NewInstancesService(s) + s.Operations = NewOperationsService(s) + s.SslCerts = NewSslCertsService(s) + s.Tiers = NewTiersService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + BackupRuns *BackupRunsService + + Flags *FlagsService + + Instances *InstancesService + + Operations *OperationsService + + SslCerts *SslCertsService + + Tiers *TiersService +} + +func NewBackupRunsService(s *Service) *BackupRunsService { + rs := &BackupRunsService{s: s} + return rs +} + +type BackupRunsService struct { + s *Service +} + +func NewFlagsService(s *Service) *FlagsService { + rs := &FlagsService{s: s} + return rs +} + +type FlagsService struct { + s *Service +} + +func NewInstancesService(s *Service) *InstancesService { + rs := &InstancesService{s: s} + return rs +} + +type InstancesService struct { + s *Service +} + +func NewOperationsService(s *Service) *OperationsService { + rs := &OperationsService{s: s} + return rs +} + +type OperationsService struct { + s *Service +} + +func NewSslCertsService(s *Service) *SslCertsService { + rs := &SslCertsService{s: s} + return rs +} + +type SslCertsService struct { + s *Service +} + +func NewTiersService(s *Service) *TiersService { + rs := &TiersService{s: s} + return rs +} + +type TiersService struct { + s *Service +} + +type BackupConfiguration struct { + // BinaryLogEnabled: Whether binary log is enabled. If backup + // configuration is disabled, binary log must be disabled as well. + BinaryLogEnabled bool `json:"binaryLogEnabled,omitempty"` + + // Enabled: Whether this configuration is enabled. + Enabled bool `json:"enabled,omitempty"` + + // Id: Identifier for this configuration. This gets generated + // automatically when a backup configuration is created. + Id string `json:"id,omitempty"` + + // Kind: This is always sql#backupConfiguration. + Kind string `json:"kind,omitempty"` + + // StartTime: Start time for the daily backup configuration in UTC + // timezone in the 24 hour format - HH:MM. + StartTime string `json:"startTime,omitempty"` +} + +type BackupRun struct { + // BackupConfiguration: Backup Configuration identifier. + BackupConfiguration string `json:"backupConfiguration,omitempty"` + + // DueTime: The due time of this run in UTC timezone in RFC 3339 format, + // for example 2012-11-15T16:19:00.094Z. + DueTime string `json:"dueTime,omitempty"` + + // EndTime: The time the backup operation completed in UTC timezone in + // RFC 3339 format, for example 2012-11-15T16:19:00.094Z. + EndTime string `json:"endTime,omitempty"` + + // EnqueuedTime: The time the run was enqueued in UTC timezone in RFC + // 3339 format, for example 2012-11-15T16:19:00.094Z. + EnqueuedTime string `json:"enqueuedTime,omitempty"` + + // Error: Information about why the backup operation failed. This is + // only present if the run has the FAILED status. + Error *OperationError `json:"error,omitempty"` + + // Instance: Name of the database instance. + Instance string `json:"instance,omitempty"` + + // Kind: This is always sql#backupRun. + Kind string `json:"kind,omitempty"` + + // StartTime: The time the backup operation actually started in UTC + // timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. + StartTime string `json:"startTime,omitempty"` + + // Status: The status of this run. + Status string `json:"status,omitempty"` +} + +type BackupRunsListResponse struct { + // Items: A list of backup runs in reverse chronological order of the + // enqueued time. + Items []*BackupRun `json:"items,omitempty"` + + // Kind: This is always sql#backupRunsList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The continuation token, used to page through large + // result sets. Provide this value in a subsequent request to return the + // next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type BinLogCoordinates struct { + // BinLogFileName: Name of the binary log file for a Cloud SQL instance. + BinLogFileName string `json:"binLogFileName,omitempty"` + + // BinLogPosition: Position (offset) within the binary log file. + BinLogPosition int64 `json:"binLogPosition,omitempty,string"` + + // Kind: This is always sql#binLogCoordinates. + Kind string `json:"kind,omitempty"` +} + +type CloneContext struct { + // BinLogCoordinates: Binary log coordinates, if specified, indentify + // the the position up to which the source instance should be cloned. If + // not specified, the source instance is cloned up to the most recent + // binary log coordintes. + BinLogCoordinates *BinLogCoordinates `json:"binLogCoordinates,omitempty"` + + // DestinationInstanceName: Name of the Cloud SQL instance to be created + // as a clone. + DestinationInstanceName string `json:"destinationInstanceName,omitempty"` + + // Kind: This is always sql#cloneContext. + Kind string `json:"kind,omitempty"` + + // SourceInstanceName: Name of the Cloud SQL instance to be cloned. + SourceInstanceName string `json:"sourceInstanceName,omitempty"` +} + +type DatabaseFlags struct { + // Name: The name of the flag. These flags are passed at instance + // startup, so include both MySQL server options and MySQL system + // variables. Flags should be specified with underscores, not hyphens. + // Refer to the official MySQL documentation on server options and + // system variables for descriptions of what these flags do. Acceptable + // values are: event_scheduler on or off (Note: The event scheduler + // will only work reliably if the instance activationPolicy is set to + // ALWAYS.) general_log on or off group_concat_max_len 4..17179869184 + // innodb_flush_log_at_trx_commit 0..2 innodb_lock_wait_timeout + // 1..1073741824 log_bin_trust_function_creators on or off log_output + // Can be either TABLE or NONE, FILE is not supported. + // log_queries_not_using_indexes on or off long_query_time 0..30000000 + // lower_case_table_names 0..2 max_allowed_packet 16384..1073741824 + // read_only on or off skip_show_database on or off slow_query_log on or + // off wait_timeout 1..31536000 + Name string `json:"name,omitempty"` + + // Value: The value of the flag. Booleans should be set using 1 for + // true, and 0 for false. This field must be omitted if the flag doesn't + // take a value. + Value string `json:"value,omitempty"` +} + +type DatabaseInstance struct { + // CurrentDiskSize: The current disk usage of the instance in bytes. + CurrentDiskSize int64 `json:"currentDiskSize,omitempty,string"` + + // DatabaseVersion: The database engine type and version, for example + // MYSQL_5_5 for MySQL 5.5. + DatabaseVersion string `json:"databaseVersion,omitempty"` + + // Etag: HTTP 1.1 Entity tag for the resource. + Etag string `json:"etag,omitempty"` + + // Instance: Name of the Cloud SQL instance. This does not include the + // project ID. + Instance string `json:"instance,omitempty"` + + // IpAddresses: The assigned IP addresses for the instance. + IpAddresses []*IpMapping `json:"ipAddresses,omitempty"` + + // Kind: This is always sql#instance. + Kind string `json:"kind,omitempty"` + + // MaxDiskSize: The maximum disk size of the instance in bytes. + MaxDiskSize int64 `json:"maxDiskSize,omitempty,string"` + + // Project: The project ID of the project containing the Cloud SQL + // instance. The Google apps domain is prefixed if applicable. + Project string `json:"project,omitempty"` + + // Region: The geographical region. Can be us-east1, us-central, + // asia-east1 or europe-west1. Defaults to us-central. The region can + // not be changed after instance creation. + Region string `json:"region,omitempty"` + + // ServerCaCert: SSL configuration. + ServerCaCert *SslCert `json:"serverCaCert,omitempty"` + + // Settings: The user settings. + Settings *Settings `json:"settings,omitempty"` + + // State: The current serving state of the Cloud SQL instance. This can + // be one of the following. + // RUNNABLE: The instance is running, or is + // ready to run when accessed. + // SUSPENDED: The instance is not available, + // for example due to problems with billing. + // PENDING_CREATE: The + // instance is being created. + // MAINTENANCE: The instance is down for + // maintenance. + // UNKNOWN_STATE: The state of the instance is unknown. + State string `json:"state,omitempty"` +} + +type ExportContext struct { + // Database: Databases (for example, guestbook) from which the export is + // made. If unspecified, all databases are exported. + Database []string `json:"database,omitempty"` + + // Kind: This is always sql#exportContext. + Kind string `json:"kind,omitempty"` + + // Table: Tables to export, or that were exported, from the specified + // database. If you specify tables, specify one and only one database. + Table []string `json:"table,omitempty"` + + // Uri: The path to the file in Google Cloud Storage where the export + // will be stored, or where it was already stored. The URI is in the + // form gs://bucketName/fileName. If the file already exists, the + // operation fails. If the filename ends with .gz, the contents are + // compressed. + Uri string `json:"uri,omitempty"` +} + +type Flag struct { + // AllowedStringValues: For STRING flags, a list of strings that the + // value can be set to. + AllowedStringValues []string `json:"allowedStringValues,omitempty"` + + // AppliesTo: The database version this flag applies to. Currently this + // can only be [MYSQL_5_5]. + AppliesTo []string `json:"appliesTo,omitempty"` + + // Kind: This is always sql#flag. + Kind string `json:"kind,omitempty"` + + // MaxValue: For INTEGER flags, the maximum allowed value. + MaxValue int64 `json:"maxValue,omitempty,string"` + + // MinValue: For INTEGER flags, the minimum allowed value. + MinValue int64 `json:"minValue,omitempty,string"` + + // Name: This is the name of the flag. Flag names always use + // underscores, not hyphens, e.g. max_allowed_packet + Name string `json:"name,omitempty"` + + // Type: The type of the flag. Flags are typed to being BOOLEAN, STRING, + // INTEGER or NONE. NONE is used for flags which do not take a value, + // such as skip_grant_tables. + Type string `json:"type,omitempty"` +} + +type FlagsListResponse struct { + // Items: List of flags. + Items []*Flag `json:"items,omitempty"` + + // Kind: This is always sql#flagsList. + Kind string `json:"kind,omitempty"` +} + +type ImportContext struct { + // Database: The database (for example, guestbook) to which the import + // is made. If not set, it is assumed that the database is specified in + // the file to be imported. + Database string `json:"database,omitempty"` + + // Kind: This is always sql#importContext. + Kind string `json:"kind,omitempty"` + + // Uri: A path to the MySQL dump file in Google Cloud Storage from which + // the import is made. The URI is in the form gs://bucketName/fileName. + // Compressed gzip files (.gz) are also supported. + Uri []string `json:"uri,omitempty"` +} + +type InstanceOperation struct { + // EndTime: The time this operation finished in UTC timezone in RFC 3339 + // format, for example 2012-11-15T16:19:00.094Z. + EndTime string `json:"endTime,omitempty"` + + // EnqueuedTime: The time this operation was enqueued in UTC timezone in + // RFC 3339 format, for example 2012-11-15T16:19:00.094Z. + EnqueuedTime string `json:"enqueuedTime,omitempty"` + + // Error: The error(s) encountered by this operation. Only set if the + // operation results in an error. + Error []*OperationError `json:"error,omitempty"` + + // ExportContext: The context for export operation, if applicable. + ExportContext *ExportContext `json:"exportContext,omitempty"` + + // ImportContext: The context for import operation, if applicable. + ImportContext *ImportContext `json:"importContext,omitempty"` + + // Instance: Name of the database instance. + Instance string `json:"instance,omitempty"` + + // Kind: This is always sql#instanceOperation. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve the Operations resource that has + // information about the operation. + Operation string `json:"operation,omitempty"` + + // OperationType: The type of the operation. Valid values are CREATE, + // DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, + // RESTORE_VOLUME. + OperationType string `json:"operationType,omitempty"` + + // StartTime: The time this operation actually started in UTC timezone + // in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. + StartTime string `json:"startTime,omitempty"` + + // State: The state of an operation. Valid values are PENDING, RUNNING, + // DONE, UNKNOWN. + State string `json:"state,omitempty"` + + // UserEmailAddress: The email address of the user who initiated this + // operation. + UserEmailAddress string `json:"userEmailAddress,omitempty"` +} + +type InstanceSetRootPasswordRequest struct { + // SetRootPasswordContext: Set Root Password Context. + SetRootPasswordContext *SetRootPasswordContext `json:"setRootPasswordContext,omitempty"` +} + +type InstancesCloneRequest struct { + // CloneContext: Contains details about the clone operation. + CloneContext *CloneContext `json:"cloneContext,omitempty"` +} + +type InstancesCloneResponse struct { + // Kind: This is always sql#instancesClone. + Kind string `json:"kind,omitempty"` + + // Operation: An unique identifier for the operation associated with the + // cloned instance. You can use this identifier to retrieve the + // Operations resource, which has information about the operation. + Operation string `json:"operation,omitempty"` +} + +type InstancesDeleteResponse struct { + // Kind: This is always sql#instancesDelete. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve the Operations resource that has + // information about the operation. + Operation string `json:"operation,omitempty"` +} + +type InstancesExportRequest struct { + // ExportContext: Contains details about the export operation. + ExportContext *ExportContext `json:"exportContext,omitempty"` +} + +type InstancesExportResponse struct { + // Kind: This is always sql#instancesExport. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve the Operations resource that has + // information about the operation. + Operation string `json:"operation,omitempty"` +} + +type InstancesImportRequest struct { + // ImportContext: Contains details about the import operation. + ImportContext *ImportContext `json:"importContext,omitempty"` +} + +type InstancesImportResponse struct { + // Kind: This is always sql#instancesImport. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve the Operations resource that has + // information about the operation. + Operation string `json:"operation,omitempty"` +} + +type InstancesInsertResponse struct { + // Kind: This is always sql#instancesInsert. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve the Operations resource that has + // information about the operation. + Operation string `json:"operation,omitempty"` +} + +type InstancesListResponse struct { + // Items: List of database instance resources. + Items []*DatabaseInstance `json:"items,omitempty"` + + // Kind: This is always sql#instancesList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The continuation token, used to page through large + // result sets. Provide this value in a subsequent request to return the + // next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type InstancesResetSslConfigResponse struct { + // Kind: This is always sql#instancesResetSslConfig. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve the Operations resource that has + // information about the operation. All ssl client certificates will be + // deleted and a new server certificate will be created. Does not take + // effect until the next instance restart. + Operation string `json:"operation,omitempty"` +} + +type InstancesRestartResponse struct { + // Kind: This is always sql#instancesRestart. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve the Operations resource that has + // information about the operation. + Operation string `json:"operation,omitempty"` +} + +type InstancesRestoreBackupResponse struct { + // Kind: This is always sql#instancesRestoreBackup. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve the Operations resource that has + // information about the operation. + Operation string `json:"operation,omitempty"` +} + +type InstancesSetRootPasswordResponse struct { + // Kind: This is always sql#instancesSetRootPassword. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve the Operations resource that has + // information about the operation. + Operation string `json:"operation,omitempty"` +} + +type InstancesUpdateResponse struct { + // Kind: This is always sql#instancesUpdate. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve information about the operation. + Operation string `json:"operation,omitempty"` +} + +type IpConfiguration struct { + // AuthorizedNetworks: The list of external networks that are allowed to + // connect to the instance using the IP. In CIDR notation, also known as + // 'slash' notation (e.g. 192.168.100.0/24). + AuthorizedNetworks []string `json:"authorizedNetworks,omitempty"` + + // Enabled: Whether the instance should be assigned an IP address or + // not. + Enabled bool `json:"enabled,omitempty"` + + // RequireSsl: Whether the mysqld should default to 'REQUIRE X509' for + // users connecting over IP. + RequireSsl bool `json:"requireSsl,omitempty"` +} + +type IpMapping struct { + // IpAddress: The IP address assigned. + IpAddress string `json:"ipAddress,omitempty"` + + // TimeToRetire: The due time for this IP to be retired in RFC 3339 + // format, for example 2012-11-15T16:19:00.094Z. This field is only + // available when the IP is scheduled to be retired. + TimeToRetire string `json:"timeToRetire,omitempty"` +} + +type LocationPreference struct { + // FollowGaeApplication: The AppEngine application to follow, it must be + // in the same region as the Cloud SQL instance. + FollowGaeApplication string `json:"followGaeApplication,omitempty"` + + // Kind: This is always sql#locationPreference. + Kind string `json:"kind,omitempty"` + + // Zone: The preferred Compute Engine zone (e.g. us-centra1-a, + // us-central1-b, etc.). + Zone string `json:"zone,omitempty"` +} + +type OperationError struct { + // Code: Identifies the specific error that occurred. + Code string `json:"code,omitempty"` + + // Kind: This is always sql#operationError. + Kind string `json:"kind,omitempty"` +} + +type OperationsListResponse struct { + // Items: List of operation resources. + Items []*InstanceOperation `json:"items,omitempty"` + + // Kind: This is always sql#operationsList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The continuation token, used to page through large + // result sets. Provide this value in a subsequent request to return the + // next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type SetRootPasswordContext struct { + // Kind: This is always sql#setRootUserContext. + Kind string `json:"kind,omitempty"` + + // Password: The password for the root user. + Password string `json:"password,omitempty"` +} + +type Settings struct { + // ActivationPolicy: The activation policy for this instance. This + // specifies when the instance should be activated and is applicable + // only when the instance state is RUNNABLE. This can be one of the + // following. + // ALWAYS: The instance should always be active. + // NEVER: The + // instance should never be activated. + // ON_DEMAND: The instance is + // activated upon receiving requests. + ActivationPolicy string `json:"activationPolicy,omitempty"` + + // AuthorizedGaeApplications: The AppEngine app ids that can access this + // instance. + AuthorizedGaeApplications []string `json:"authorizedGaeApplications,omitempty"` + + // BackupConfiguration: The daily backup configuration for the instance. + BackupConfiguration []*BackupConfiguration `json:"backupConfiguration,omitempty"` + + // DatabaseFlags: The database flags passed to the instance at startup. + DatabaseFlags []*DatabaseFlags `json:"databaseFlags,omitempty"` + + // IpConfiguration: The settings for IP Management. This allows to + // enable or disable the instance IP and manage which external networks + // can connect to the instance. + IpConfiguration *IpConfiguration `json:"ipConfiguration,omitempty"` + + // Kind: This is always sql#settings. + Kind string `json:"kind,omitempty"` + + // LocationPreference: The location preference settings. This allows the + // instance to be located as near as possible to either an AppEngine app + // or GCE zone for better perfomance. + LocationPreference *LocationPreference `json:"locationPreference,omitempty"` + + // PricingPlan: The pricing plan for this instance. This can be either + // PER_USE or PACKAGE. + PricingPlan string `json:"pricingPlan,omitempty"` + + // ReplicationType: The type of replication this instance uses. This can + // be either ASYNCHRONOUS or SYNCHRONOUS. + ReplicationType string `json:"replicationType,omitempty"` + + // SettingsVersion: The version of instance settings. This is a required + // field for update method to make sure concurrent updates are handled + // properly. During update, use the most recent settingsVersion value + // for this instance and do not try to update this value. + SettingsVersion int64 `json:"settingsVersion,omitempty,string"` + + // Tier: The tier of service for this instance, for example D1, D2. For + // more information, see pricing. + Tier string `json:"tier,omitempty"` +} + +type SslCert struct { + // Cert: PEM representation. + Cert string `json:"cert,omitempty"` + + // CertSerialNumber: Serial number, as extracted from the certificate. + CertSerialNumber string `json:"certSerialNumber,omitempty"` + + // CommonName: User supplied name. Constrained to [a-zA-Z.-_ ]+. + CommonName string `json:"commonName,omitempty"` + + // CreateTime: Time when the certificate was created. + CreateTime string `json:"createTime,omitempty"` + + // ExpirationTime: Time when the certificate expires. + ExpirationTime string `json:"expirationTime,omitempty"` + + // Instance: Name of the database instance. + Instance string `json:"instance,omitempty"` + + // Kind: This is always sql#sslCert. + Kind string `json:"kind,omitempty"` + + // Sha1Fingerprint: Sha1 Fingerprint. + Sha1Fingerprint string `json:"sha1Fingerprint,omitempty"` +} + +type SslCertDetail struct { + // CertInfo: The public information about the cert. + CertInfo *SslCert `json:"certInfo,omitempty"` + + // CertPrivateKey: The private key for the client cert, in pem format. + // Keep private in order to protect your security. + CertPrivateKey string `json:"certPrivateKey,omitempty"` +} + +type SslCertsDeleteResponse struct { + // Kind: This is always sql#sslCertsDelete. + Kind string `json:"kind,omitempty"` + + // Operation: An identifier that uniquely identifies the operation. You + // can use this identifier to retrieve the Operations resource that has + // information about the operation. + Operation string `json:"operation,omitempty"` +} + +type SslCertsInsertRequest struct { + // CommonName: User supplied name. Must be a distinct name from the + // other certificates for this instance. New certificates will not be + // usable until the instance is restarted. + CommonName string `json:"commonName,omitempty"` +} + +type SslCertsInsertResponse struct { + // ClientCert: The new client certificate and private key. The new + // certificate will not work until the instance is restarted. + ClientCert *SslCertDetail `json:"clientCert,omitempty"` + + // Kind: This is always sql#sslCertsInsert. + Kind string `json:"kind,omitempty"` + + // ServerCaCert: The server Certificate Authority's certificate. If this + // is missing you can force a new one to be generated by calling + // resetSslConfig method on instances resource.. + ServerCaCert *SslCert `json:"serverCaCert,omitempty"` +} + +type SslCertsListResponse struct { + // Items: List of client certificates for the instance. + Items []*SslCert `json:"items,omitempty"` + + // Kind: This is always sql#sslCertsList. + Kind string `json:"kind,omitempty"` +} + +type Tier struct { + // DiskQuota: The maximum disk size of this tier in bytes. + DiskQuota int64 `json:"DiskQuota,omitempty,string"` + + // RAM: The maximum RAM usage of this tier in bytes. + RAM int64 `json:"RAM,omitempty,string"` + + // Kind: This is always sql#tier. + Kind string `json:"kind,omitempty"` + + // Region: The applicable regions for this tier. Can be us-east1, + // europe-west1, or asia-east1. + Region []string `json:"region,omitempty"` + + // Tier: An identifier for the service tier, for example D1, D2 etc. For + // related information, see Pricing. + Tier string `json:"tier,omitempty"` +} + +type TiersListResponse struct { + // Items: List of tiers. + Items []*Tier `json:"items,omitempty"` + + // Kind: This is always sql#tiersList. + Kind string `json:"kind,omitempty"` +} + +// method id "sql.backupRuns.get": + +type BackupRunsGetCall struct { + s *Service + project string + instance string + backupConfiguration string + dueTime string + opt_ map[string]interface{} +} + +// Get: Retrieves a resource containing information about a backup run. +func (r *BackupRunsService) Get(project string, instance string, backupConfiguration string, dueTime string) *BackupRunsGetCall { + c := &BackupRunsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.backupConfiguration = backupConfiguration + c.dueTime = dueTime + return c +} + +func (c *BackupRunsGetCall) Do() (*BackupRun, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("dueTime", fmt.Sprintf("%v", c.dueTime)) + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns/{backupConfiguration}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{backupConfiguration}", url.QueryEscape(c.backupConfiguration), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BackupRun) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a resource containing information about a backup run.", + // "httpMethod": "GET", + // "id": "sql.backupRuns.get", + // "parameterOrder": [ + // "project", + // "instance", + // "backupConfiguration", + // "dueTime" + // ], + // "parameters": { + // "backupConfiguration": { + // "description": "Identifier for the backup configuration. This gets generated automatically when a backup configuration is created.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "dueTime": { + // "description": "The time when this run is due to start in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/backupRuns/{backupConfiguration}", + // "response": { + // "$ref": "BackupRun" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.backupRuns.list": + +type BackupRunsListCall struct { + s *Service + project string + instance string + backupConfiguration string + opt_ map[string]interface{} +} + +// List: Lists all backup runs associated with a given instance and +// configuration in the reverse chronological order of the enqueued +// time. +func (r *BackupRunsService) List(project string, instance string, backupConfiguration string) *BackupRunsListCall { + c := &BackupRunsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.backupConfiguration = backupConfiguration + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of backup runs per response. +func (c *BackupRunsListCall) MaxResults(maxResults int64) *BackupRunsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A +// previously-returned page token representing part of the larger set of +// results to view. +func (c *BackupRunsListCall) PageToken(pageToken string) *BackupRunsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *BackupRunsListCall) Do() (*BackupRunsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("backupConfiguration", fmt.Sprintf("%v", c.backupConfiguration)) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BackupRunsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all backup runs associated with a given instance and configuration in the reverse chronological order of the enqueued time.", + // "httpMethod": "GET", + // "id": "sql.backupRuns.list", + // "parameterOrder": [ + // "project", + // "instance", + // "backupConfiguration" + // ], + // "parameters": { + // "backupConfiguration": { + // "description": "Identifier for the backup configuration. This gets generated automatically when a backup configuration is created.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of backup runs per response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A previously-returned page token representing part of the larger set of results to view.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/backupRuns", + // "response": { + // "$ref": "BackupRunsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.flags.list": + +type FlagsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List all available database flags for Google Cloud SQL +// instances. +func (r *FlagsService) List() *FlagsListCall { + c := &FlagsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +func (c *FlagsListCall) Do() (*FlagsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "flags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(FlagsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all available database flags for Google Cloud SQL instances.", + // "httpMethod": "GET", + // "id": "sql.flags.list", + // "path": "flags", + // "response": { + // "$ref": "FlagsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.clone": + +type InstancesCloneCall struct { + s *Service + project string + instancesclonerequest *InstancesCloneRequest + opt_ map[string]interface{} +} + +// Clone: Creates a Cloud SQL instance as a clone of the source +// instance. +func (r *InstancesService) Clone(project string, instancesclonerequest *InstancesCloneRequest) *InstancesCloneCall { + c := &InstancesCloneCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instancesclonerequest = instancesclonerequest + return c +} + +func (c *InstancesCloneCall) Do() (*InstancesCloneResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesclonerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/clone") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesCloneResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a Cloud SQL instance as a clone of the source instance.", + // "httpMethod": "POST", + // "id": "sql.instances.clone", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID of the source as well as the clone Cloud SQL instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/clone", + // "request": { + // "$ref": "InstancesCloneRequest" + // }, + // "response": { + // "$ref": "InstancesCloneResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.delete": + +type InstancesDeleteCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} +} + +// Delete: Deletes a Cloud SQL instance. +func (r *InstancesService) Delete(project string, instance string) *InstancesDeleteCall { + c := &InstancesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +func (c *InstancesDeleteCall) Do() (*InstancesDeleteResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesDeleteResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a Cloud SQL instance.", + // "httpMethod": "DELETE", + // "id": "sql.instances.delete", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}", + // "response": { + // "$ref": "InstancesDeleteResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.export": + +type InstancesExportCall struct { + s *Service + project string + instance string + instancesexportrequest *InstancesExportRequest + opt_ map[string]interface{} +} + +// Export: Exports data from a Cloud SQL instance to a Google Cloud +// Storage bucket as a MySQL dump file. +func (r *InstancesService) Export(project string, instance string, instancesexportrequest *InstancesExportRequest) *InstancesExportCall { + c := &InstancesExportCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.instancesexportrequest = instancesexportrequest + return c +} + +func (c *InstancesExportCall) Do() (*InstancesExportResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesexportrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/export") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesExportResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Exports data from a Cloud SQL instance to a Google Cloud Storage bucket as a MySQL dump file.", + // "httpMethod": "POST", + // "id": "sql.instances.export", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance to be exported.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/export", + // "request": { + // "$ref": "InstancesExportRequest" + // }, + // "response": { + // "$ref": "InstancesExportResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "sql.instances.get": + +type InstancesGetCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} +} + +// Get: Retrieves a resource containing information about a Cloud SQL +// instance. +func (r *InstancesService) Get(project string, instance string) *InstancesGetCall { + c := &InstancesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +func (c *InstancesGetCall) Do() (*DatabaseInstance, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DatabaseInstance) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a resource containing information about a Cloud SQL instance.", + // "httpMethod": "GET", + // "id": "sql.instances.get", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Database instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}", + // "response": { + // "$ref": "DatabaseInstance" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.import": + +type InstancesImportCall struct { + s *Service + project string + instance string + instancesimportrequest *InstancesImportRequest + opt_ map[string]interface{} +} + +// Import: Imports data into a Cloud SQL instance from a MySQL dump file +// in Google Cloud Storage. +func (r *InstancesService) Import(project string, instance string, instancesimportrequest *InstancesImportRequest) *InstancesImportCall { + c := &InstancesImportCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.instancesimportrequest = instancesimportrequest + return c +} + +func (c *InstancesImportCall) Do() (*InstancesImportResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesimportrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/import") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesImportResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Imports data into a Cloud SQL instance from a MySQL dump file in Google Cloud Storage.", + // "httpMethod": "POST", + // "id": "sql.instances.import", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/import", + // "request": { + // "$ref": "InstancesImportRequest" + // }, + // "response": { + // "$ref": "InstancesImportResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "sql.instances.insert": + +type InstancesInsertCall struct { + s *Service + project string + databaseinstance *DatabaseInstance + opt_ map[string]interface{} +} + +// Insert: Creates a new Cloud SQL instance. +func (r *InstancesService) Insert(project string, databaseinstance *DatabaseInstance) *InstancesInsertCall { + c := &InstancesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.databaseinstance = databaseinstance + return c +} + +func (c *InstancesInsertCall) Do() (*InstancesInsertResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesInsertResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new Cloud SQL instance.", + // "httpMethod": "POST", + // "id": "sql.instances.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances", + // "request": { + // "$ref": "DatabaseInstance" + // }, + // "response": { + // "$ref": "InstancesInsertResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.list": + +type InstancesListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Lists instances under a given project in the alphabetical order +// of the instance name. +func (r *InstancesService) List(project string) *InstancesListCall { + c := &InstancesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of results to return per response. +func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A +// previously-returned page token representing part of the larger set of +// results to view. +func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *InstancesListCall) Do() (*InstancesListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists instances under a given project in the alphabetical order of the instance name.", + // "httpMethod": "GET", + // "id": "sql.instances.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "maxResults": { + // "description": "The maximum number of results to return per response.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A previously-returned page token representing part of the larger set of results to view.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project for which to list Cloud SQL instances.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances", + // "response": { + // "$ref": "InstancesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.patch": + +type InstancesPatchCall struct { + s *Service + project string + instance string + databaseinstance *DatabaseInstance + opt_ map[string]interface{} +} + +// Patch: Updates settings of a Cloud SQL instance. Caution: This is not +// a partial update, so you must include values for all the settings +// that you want to retain. For partial updates, use patch.. This method +// supports patch semantics. +func (r *InstancesService) Patch(project string, instance string, databaseinstance *DatabaseInstance) *InstancesPatchCall { + c := &InstancesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.databaseinstance = databaseinstance + return c +} + +func (c *InstancesPatchCall) Do() (*InstancesUpdateResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesUpdateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "sql.instances.patch", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}", + // "request": { + // "$ref": "DatabaseInstance" + // }, + // "response": { + // "$ref": "InstancesUpdateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.resetSslConfig": + +type InstancesResetSslConfigCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} +} + +// ResetSslConfig: Deletes all client certificates and generates a new +// server SSL certificate for the instance. The changes will not take +// effect until the instance is restarted. Existing instances without a +// server certificate will need to call this once to set a server +// certificate. +func (r *InstancesService) ResetSslConfig(project string, instance string) *InstancesResetSslConfigCall { + c := &InstancesResetSslConfigCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +func (c *InstancesResetSslConfigCall) Do() (*InstancesResetSslConfigResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/resetSslConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesResetSslConfigResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes all client certificates and generates a new server SSL certificate for the instance. The changes will not take effect until the instance is restarted. Existing instances without a server certificate will need to call this once to set a server certificate.", + // "httpMethod": "POST", + // "id": "sql.instances.resetSslConfig", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/resetSslConfig", + // "response": { + // "$ref": "InstancesResetSslConfigResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.restart": + +type InstancesRestartCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} +} + +// Restart: Restarts a Cloud SQL instance. +func (r *InstancesService) Restart(project string, instance string) *InstancesRestartCall { + c := &InstancesRestartCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +func (c *InstancesRestartCall) Do() (*InstancesRestartResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/restart") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesRestartResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Restarts a Cloud SQL instance.", + // "httpMethod": "POST", + // "id": "sql.instances.restart", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance to be restarted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/restart", + // "response": { + // "$ref": "InstancesRestartResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.restoreBackup": + +type InstancesRestoreBackupCall struct { + s *Service + project string + instance string + backupConfigurationid string + dueTime string + opt_ map[string]interface{} +} + +// RestoreBackup: Restores a backup of a Cloud SQL instance. +func (r *InstancesService) RestoreBackup(project string, instance string, backupConfigurationid string, dueTime string) *InstancesRestoreBackupCall { + c := &InstancesRestoreBackupCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.backupConfigurationid = backupConfigurationid + c.dueTime = dueTime + return c +} + +func (c *InstancesRestoreBackupCall) Do() (*InstancesRestoreBackupResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("backupConfiguration", fmt.Sprintf("%v", c.backupConfigurationid)) + params.Set("dueTime", fmt.Sprintf("%v", c.dueTime)) + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/restoreBackup") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesRestoreBackupResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Restores a backup of a Cloud SQL instance.", + // "httpMethod": "POST", + // "id": "sql.instances.restoreBackup", + // "parameterOrder": [ + // "project", + // "instance", + // "backupConfiguration", + // "dueTime" + // ], + // "parameters": { + // "backupConfiguration": { + // "description": "The identifier of the backup configuration. This gets generated automatically when a backup configuration is created.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "dueTime": { + // "description": "The time when this run is due to start in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/restoreBackup", + // "response": { + // "$ref": "InstancesRestoreBackupResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.setRootPassword": + +type InstancesSetRootPasswordCall struct { + s *Service + project string + instance string + instancesetrootpasswordrequest *InstanceSetRootPasswordRequest + opt_ map[string]interface{} +} + +// SetRootPassword: Sets the password for the root user. +func (r *InstancesService) SetRootPassword(project string, instance string, instancesetrootpasswordrequest *InstanceSetRootPasswordRequest) *InstancesSetRootPasswordCall { + c := &InstancesSetRootPasswordCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.instancesetrootpasswordrequest = instancesetrootpasswordrequest + return c +} + +func (c *InstancesSetRootPasswordCall) Do() (*InstancesSetRootPasswordResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesetrootpasswordrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/setRootPassword") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesSetRootPasswordResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the password for the root user.", + // "httpMethod": "POST", + // "id": "sql.instances.setRootPassword", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/setRootPassword", + // "request": { + // "$ref": "InstanceSetRootPasswordRequest" + // }, + // "response": { + // "$ref": "InstancesSetRootPasswordResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.update": + +type InstancesUpdateCall struct { + s *Service + project string + instance string + databaseinstance *DatabaseInstance + opt_ map[string]interface{} +} + +// Update: Updates settings of a Cloud SQL instance. Caution: This is +// not a partial update, so you must include values for all the settings +// that you want to retain. For partial updates, use patch. +func (r *InstancesService) Update(project string, instance string, databaseinstance *DatabaseInstance) *InstancesUpdateCall { + c := &InstancesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.databaseinstance = databaseinstance + return c +} + +func (c *InstancesUpdateCall) Do() (*InstancesUpdateResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstancesUpdateResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.", + // "etagRequired": true, + // "httpMethod": "PUT", + // "id": "sql.instances.update", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}", + // "request": { + // "$ref": "DatabaseInstance" + // }, + // "response": { + // "$ref": "InstancesUpdateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.operations.get": + +type OperationsGetCall struct { + s *Service + project string + instance string + operation string + opt_ map[string]interface{} +} + +// Get: Retrieves an instance operation that has been performed on an +// instance. +func (r *OperationsService) Get(project string, instance string, operation string) *OperationsGetCall { + c := &OperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.operation = operation + return c +} + +func (c *OperationsGetCall) Do() (*InstanceOperation, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{operation}", url.QueryEscape(c.operation), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(InstanceOperation) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves an instance operation that has been performed on an instance.", + // "httpMethod": "GET", + // "id": "sql.operations.get", + // "parameterOrder": [ + // "project", + // "instance", + // "operation" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "operation": { + // "description": "Instance operation ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/operations/{operation}", + // "response": { + // "$ref": "InstanceOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.operations.list": + +type OperationsListCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} +} + +// List: Lists all instance operations that have been performed on the +// given Cloud SQL instance in the reverse chronological order of the +// start time. +func (r *OperationsService) List(project string, instance string) *OperationsListCall { + c := &OperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of operations per response. +func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A +// previously-returned page token representing part of the larger set of +// results to view. +func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *OperationsListCall) Do() (*OperationsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(OperationsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.", + // "httpMethod": "GET", + // "id": "sql.operations.list", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of operations per response.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A previously-returned page token representing part of the larger set of results to view.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/operations", + // "response": { + // "$ref": "OperationsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.sslCerts.delete": + +type SslCertsDeleteCall struct { + s *Service + project string + instance string + sha1Fingerprint string + opt_ map[string]interface{} +} + +// Delete: Deletes the SSL certificate. The change will not take effect +// until the instance is restarted. +func (r *SslCertsService) Delete(project string, instance string, sha1Fingerprint string) *SslCertsDeleteCall { + c := &SslCertsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.sha1Fingerprint = sha1Fingerprint + return c +} + +func (c *SslCertsDeleteCall) Do() (*SslCertsDeleteResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{sha1Fingerprint}", url.QueryEscape(c.sha1Fingerprint), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SslCertsDeleteResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the SSL certificate. The change will not take effect until the instance is restarted.", + // "httpMethod": "DELETE", + // "id": "sql.sslCerts.delete", + // "parameterOrder": [ + // "project", + // "instance", + // "sha1Fingerprint" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sha1Fingerprint": { + // "description": "Sha1 FingerPrint.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", + // "response": { + // "$ref": "SslCertsDeleteResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.sslCerts.get": + +type SslCertsGetCall struct { + s *Service + project string + instance string + sha1Fingerprint string + opt_ map[string]interface{} +} + +// Get: Retrieves a particular SSL certificate. Does not include the +// private key (required for usage). The private key must be saved from +// the response to initial creation. +func (r *SslCertsService) Get(project string, instance string, sha1Fingerprint string) *SslCertsGetCall { + c := &SslCertsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.sha1Fingerprint = sha1Fingerprint + return c +} + +func (c *SslCertsGetCall) Do() (*SslCert, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{sha1Fingerprint}", url.QueryEscape(c.sha1Fingerprint), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SslCert) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creation.", + // "httpMethod": "GET", + // "id": "sql.sslCerts.get", + // "parameterOrder": [ + // "project", + // "instance", + // "sha1Fingerprint" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project that contains the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sha1Fingerprint": { + // "description": "Sha1 FingerPrint.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", + // "response": { + // "$ref": "SslCert" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.sslCerts.insert": + +type SslCertsInsertCall struct { + s *Service + project string + instance string + sslcertsinsertrequest *SslCertsInsertRequest + opt_ map[string]interface{} +} + +// Insert: Creates an SSL certificate and returns it along with the +// private key and server certificate authority. The new certificate +// will not be usable until the instance is restarted. +func (r *SslCertsService) Insert(project string, instance string, sslcertsinsertrequest *SslCertsInsertRequest) *SslCertsInsertCall { + c := &SslCertsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.sslcertsinsertrequest = sslcertsinsertrequest + return c +} + +func (c *SslCertsInsertCall) Do() (*SslCertsInsertResponse, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertsinsertrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SslCertsInsertResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted.", + // "httpMethod": "POST", + // "id": "sql.sslCerts.insert", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/sslCerts", + // "request": { + // "$ref": "SslCertsInsertRequest" + // }, + // "response": { + // "$ref": "SslCertsInsertResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.sslCerts.list": + +type SslCertsListCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} +} + +// List: Lists all of the current SSL certificates for the instance. +func (r *SslCertsService) List(project string, instance string) *SslCertsListCall { + c := &SslCertsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +func (c *SslCertsListCall) Do() (*SslCertsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{instance}", url.QueryEscape(c.instance), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(SslCertsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all of the current SSL certificates for the instance.", + // "httpMethod": "GET", + // "id": "sql.sslCerts.list", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of the project for which to list Cloud SQL instances.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/sslCerts", + // "response": { + // "$ref": "SslCertsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.tiers.list": + +type TiersListCall struct { + s *Service + project string + opt_ map[string]interface{} +} + +// List: Lists all available service tiers for Google Cloud SQL, for +// example D1, D2. For related information, see Pricing. +func (r *TiersService) List(project string) *TiersListCall { + c := &TiersListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +func (c *TiersListCall) Do() (*TiersListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/tiers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TiersListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all available service tiers for Google Cloud SQL, for example D1, D2. For related information, see Pricing.", + // "httpMethod": "GET", + // "id": "sql.tiers.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID of the project for which to list tiers.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/tiers", + // "response": { + // "$ref": "TiersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/storage/v1beta1/storage-api.json b/third_party/src/code.google.com/p/google-api-go-client/storage/v1beta1/storage-api.json new file mode 100644 index 0000000000000..e365387d50f43 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/storage/v1beta1/storage-api.json @@ -0,0 +1,1426 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/IpR4V709mf4kvv_yPnB7Gmo_IHU\"", + "discoveryVersion": "v1", + "id": "storage:v1beta1", + "name": "storage", + "version": "v1beta1", + "title": "Cloud Storage API", + "description": "Lets you store and retrieve potentially-large, immutable data objects.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/cloud_storage-16.png", + "x32": "https://www.google.com/images/icons/product/cloud_storage-32.png" + }, + "documentationLink": "https://developers.google.com/storage/docs/json_api/", + "labels": [ + "labs" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/storage/v1beta1/", + "basePath": "/storage/v1beta1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "storage/v1beta1/", + "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/devstorage.full_control": { + "description": "Manage your data and permissions in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" + } + } + } + }, + "schemas": { + "Bucket": { + "id": "Bucket", + "type": "object", + "description": "A bucket.", + "properties": { + "acl": { + "type": "array", + "description": "Access controls on the bucket.", + "items": { + "$ref": "BucketAccessControl" + }, + "annotations": { + "required": [ + "storage.buckets.update" + ] + } + }, + "defaultObjectAcl": { + "type": "array", + "description": "Default access controls to apply to new objects when no ACL is provided.", + "items": { + "$ref": "ObjectAccessControl" + } + }, + "id": { + "type": "string", + "description": "The name of the bucket.", + "annotations": { + "required": [ + "storage.buckets.insert" + ] + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For buckets, this is always storage#bucket.", + "default": "storage#bucket" + }, + "location": { + "type": "string", + "description": "The location of the bucket. Object data for objects in the bucket resides in physical storage in this location. Can be US or EU. Defaults to US." + }, + "owner": { + "type": "object", + "description": "The owner of the bucket. This will always be the project team's owner group.", + "properties": { + "entity": { + "type": "string", + "description": "The entity, in the form group-groupId." + }, + "entityId": { + "type": "string", + "description": "The ID for the entity." + } + } + }, + "projectId": { + "type": "string", + "description": "The project the bucket belongs to.", + "format": "uint64", + "annotations": { + "required": [ + "storage.buckets.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "The URI of this bucket." + }, + "timeCreated": { + "type": "string", + "description": "Creation time of the bucket in RFC 3339 format.", + "format": "date-time" + }, + "website": { + "type": "object", + "description": "The bucket's website configuration.", + "properties": { + "mainPageSuffix": { + "type": "string", + "description": "Behaves as the bucket's directory index where missing objects are treated as potential directories." + }, + "notFoundPage": { + "type": "string", + "description": "The custom object to return when a requested resource is not found." + } + } + } + } + }, + "BucketAccessControl": { + "id": "BucketAccessControl", + "type": "object", + "description": "An access-control entry.", + "properties": { + "bucket": { + "type": "string", + "description": "The name of the bucket." + }, + "domain": { + "type": "string", + "description": "The domain associated with the entity, if any." + }, + "email": { + "type": "string", + "description": "The email address associated with the entity, if any." + }, + "entity": { + "type": "string", + "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.", + "annotations": { + "required": [ + "storage.bucketAccessControls.insert" + ] + } + }, + "entityId": { + "type": "string", + "description": "The ID for the entity, if any." + }, + "id": { + "type": "string", + "description": "The ID of the access-control entry." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For bucket access control entries, this is always storage#bucketAccessControl.", + "default": "storage#bucketAccessControl" + }, + "role": { + "type": "string", + "description": "The access permission for the entity. Can be READER, WRITER, or OWNER.", + "annotations": { + "required": [ + "storage.bucketAccessControls.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "The link to this access-control entry." + } + } + }, + "BucketAccessControls": { + "id": "BucketAccessControls", + "type": "object", + "description": "An access-control list.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "BucketAccessControl" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of bucket access control entries, this is always storage#bucketAccessControls.", + "default": "storage#bucketAccessControls" + } + } + }, + "Buckets": { + "id": "Buckets", + "type": "object", + "description": "A list of buckets.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "Bucket" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of buckets, this is always storage#buckets.", + "default": "storage#buckets" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + } + } + }, + "Object": { + "id": "Object", + "type": "object", + "description": "An object.", + "properties": { + "acl": { + "type": "array", + "description": "Access controls on the object.", + "items": { + "$ref": "ObjectAccessControl" + }, + "annotations": { + "required": [ + "storage.objects.update" + ] + } + }, + "bucket": { + "type": "string", + "description": "The bucket containing this object." + }, + "cacheControl": { + "type": "string", + "description": "Cache-Control directive for the object data." + }, + "contentDisposition": { + "type": "string", + "description": "Content-Disposition of the object data." + }, + "contentEncoding": { + "type": "string", + "description": "Content-Encoding of the object data." + }, + "contentLanguage": { + "type": "string", + "description": "Content-Language of the object data." + }, + "id": { + "type": "string", + "description": "The ID of the object." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For objects, this is always storage#object.", + "default": "storage#object" + }, + "media": { + "type": "object", + "description": "Object media data. Provided on your behalf when uploading raw media or multipart/related with an auxiliary media part.", + "properties": { + "algorithm": { + "type": "string", + "description": "Hash algorithm used. Currently only MD5 is supported. Required if a hash is provided.", + "default": "MD5" + }, + "contentType": { + "type": "string", + "description": "Content-Type of the object data.", + "annotations": { + "required": [ + "storage.objects.insert", + "storage.objects.update" + ] + } + }, + "data": { + "type": "string", + "description": "URL-safe Base64-encoded data. This property can be used to insert objects under 64KB in size, and will only be returned in response to the get method for objects so created. When this resource is returned in response to the list method, this property is omitted.", + "format": "byte", + "annotations": { + "required": [ + "storage.objects.insert" + ] + } + }, + "hash": { + "type": "string", + "description": "Hash of the data. Required if a hash algorithm is provided." + }, + "length": { + "type": "string", + "description": "Content-Length of the data in bytes.", + "format": "uint64" + }, + "link": { + "type": "string", + "description": "Media download link." + }, + "timeCreated": { + "type": "string", + "description": "Creation time of the data in RFC 3339 format.", + "format": "date-time" + } + } + }, + "metadata": { + "type": "object", + "description": "User-provided metadata, in key/value pairs.", + "additionalProperties": { + "type": "string", + "description": "An individual metadata entry." + } + }, + "name": { + "type": "string", + "description": "The name of this object. Required if not specified by URL parameter." + }, + "owner": { + "type": "object", + "description": "The owner of the object. This will always be the uploader of the object.", + "properties": { + "entity": { + "type": "string", + "description": "The entity, in the form user-userId." + }, + "entityId": { + "type": "string", + "description": "The ID for the entity." + } + } + }, + "selfLink": { + "type": "string", + "description": "The link to this object." + } + } + }, + "ObjectAccessControl": { + "id": "ObjectAccessControl", + "type": "object", + "description": "An access-control entry.", + "properties": { + "bucket": { + "type": "string", + "description": "The name of the bucket." + }, + "domain": { + "type": "string", + "description": "The domain associated with the entity, if any." + }, + "email": { + "type": "string", + "description": "The email address associated with the entity, if any." + }, + "entity": { + "type": "string", + "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.", + "annotations": { + "required": [ + "storage.objectAccessControls.insert" + ] + } + }, + "entityId": { + "type": "string", + "description": "The ID for the entity, if any." + }, + "id": { + "type": "string", + "description": "The ID of the access-control entry." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For object access control entries, this is always storage#objectAccessControl.", + "default": "storage#objectAccessControl" + }, + "object": { + "type": "string", + "description": "The name of the object." + }, + "role": { + "type": "string", + "description": "The access permission for the entity. Can be READER or OWNER.", + "annotations": { + "required": [ + "storage.objectAccessControls.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "The link to this access-control entry." + } + } + }, + "ObjectAccessControls": { + "id": "ObjectAccessControls", + "type": "object", + "description": "An access-control list.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "ObjectAccessControl" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of object access control entries, this is always storage#objectAccessControls.", + "default": "storage#objectAccessControls" + } + } + }, + "Objects": { + "id": "Objects", + "type": "object", + "description": "A list of objects.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "Object" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of objects, this is always storage#objects.", + "default": "storage#objects" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "prefixes": { + "type": "array", + "description": "The list of prefixes of objects matching-but-not-listed up to and including the requested delimiter.", + "items": { + "type": "string" + } + } + } + } + }, + "resources": { + "bucketAccessControls": { + "methods": { + "delete": { + "id": "storage.bucketAccessControls.delete", + "path": "b/{bucket}/acl/{entity}", + "httpMethod": "DELETE", + "description": "Deletes the ACL entry for the specified entity on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "entity" + ], + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "get": { + "id": "storage.bucketAccessControls.get", + "path": "b/{bucket}/acl/{entity}", + "httpMethod": "GET", + "description": "Returns the ACL entry for the specified entity on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "entity" + ], + "response": { + "$ref": "BucketAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "insert": { + "id": "storage.bucketAccessControls.insert", + "path": "b/{bucket}/acl", + "httpMethod": "POST", + "description": "Creates a new ACL entry on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "BucketAccessControl" + }, + "response": { + "$ref": "BucketAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "list": { + "id": "storage.bucketAccessControls.list", + "path": "b/{bucket}/acl", + "httpMethod": "GET", + "description": "Retrieves ACL entries on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket" + ], + "response": { + "$ref": "BucketAccessControls" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "patch": { + "id": "storage.bucketAccessControls.patch", + "path": "b/{bucket}/acl/{entity}", + "httpMethod": "PATCH", + "description": "Updates an ACL entry on the specified bucket. This method supports patch semantics.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "entity" + ], + "request": { + "$ref": "BucketAccessControl" + }, + "response": { + "$ref": "BucketAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "update": { + "id": "storage.bucketAccessControls.update", + "path": "b/{bucket}/acl/{entity}", + "httpMethod": "PUT", + "description": "Updates an ACL entry on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "entity" + ], + "request": { + "$ref": "BucketAccessControl" + }, + "response": { + "$ref": "BucketAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + } + } + }, + "buckets": { + "methods": { + "delete": { + "id": "storage.buckets.delete", + "path": "b/{bucket}", + "httpMethod": "DELETE", + "description": "Deletes an empty bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket" + ], + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "get": { + "id": "storage.buckets.get", + "path": "b/{bucket}", + "httpMethod": "GET", + "description": "Returns metadata for the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to no_acl.", + "enum": [ + "full", + "no_acl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit acl and defaultObjectAcl properties." + ], + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "response": { + "$ref": "Bucket" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "insert": { + "id": "storage.buckets.insert", + "path": "b", + "httpMethod": "POST", + "description": "Creates a new bucket.", + "parameters": { + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to no_acl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.", + "enum": [ + "full", + "no_acl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit acl and defaultObjectAcl properties." + ], + "location": "query" + } + }, + "request": { + "$ref": "Bucket" + }, + "response": { + "$ref": "Bucket" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "list": { + "id": "storage.buckets.list", + "path": "b", + "httpMethod": "GET", + "description": "Retrieves a list of buckets for a given project.", + "parameters": { + "max-results": { + "type": "integer", + "description": "Maximum number of buckets to return.", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" + }, + "projectId": { + "type": "string", + "description": "A valid API project identifier.", + "required": true, + "format": "uint64", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to no_acl.", + "enum": [ + "full", + "no_acl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit acl and defaultObjectAcl properties." + ], + "location": "query" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "Buckets" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "patch": { + "id": "storage.buckets.patch", + "path": "b/{bucket}", + "httpMethod": "PATCH", + "description": "Updates a bucket. This method supports patch semantics.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "no_acl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit acl and defaultObjectAcl properties." + ], + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "Bucket" + }, + "response": { + "$ref": "Bucket" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "update": { + "id": "storage.buckets.update", + "path": "b/{bucket}", + "httpMethod": "PUT", + "description": "Updates a bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "no_acl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit acl and defaultObjectAcl properties." + ], + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "Bucket" + }, + "response": { + "$ref": "Bucket" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + } + } + }, + "objectAccessControls": { + "methods": { + "delete": { + "id": "storage.objectAccessControls.delete", + "path": "b/{bucket}/o/{object}/acl/{entity}", + "httpMethod": "DELETE", + "description": "Deletes the ACL entry for the specified entity on the specified object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "object", + "entity" + ], + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "get": { + "id": "storage.objectAccessControls.get", + "path": "b/{bucket}/o/{object}/acl/{entity}", + "httpMethod": "GET", + "description": "Returns the ACL entry for the specified entity on the specified object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "object", + "entity" + ], + "response": { + "$ref": "ObjectAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "insert": { + "id": "storage.objectAccessControls.insert", + "path": "b/{bucket}/o/{object}/acl", + "httpMethod": "POST", + "description": "Creates a new ACL entry on the specified object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "object" + ], + "request": { + "$ref": "ObjectAccessControl" + }, + "response": { + "$ref": "ObjectAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "list": { + "id": "storage.objectAccessControls.list", + "path": "b/{bucket}/o/{object}/acl", + "httpMethod": "GET", + "description": "Retrieves ACL entries on the specified object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "object" + ], + "response": { + "$ref": "ObjectAccessControls" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "patch": { + "id": "storage.objectAccessControls.patch", + "path": "b/{bucket}/o/{object}/acl/{entity}", + "httpMethod": "PATCH", + "description": "Updates an ACL entry on the specified object. This method supports patch semantics.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "object", + "entity" + ], + "request": { + "$ref": "ObjectAccessControl" + }, + "response": { + "$ref": "ObjectAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "update": { + "id": "storage.objectAccessControls.update", + "path": "b/{bucket}/o/{object}/acl/{entity}", + "httpMethod": "PUT", + "description": "Updates an ACL entry on the specified object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "object", + "entity" + ], + "request": { + "$ref": "ObjectAccessControl" + }, + "response": { + "$ref": "ObjectAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + } + } + }, + "objects": { + "methods": { + "delete": { + "id": "storage.objects.delete", + "path": "b/{bucket}/o/{object}", + "httpMethod": "DELETE", + "description": "Deletes data blobs and associated metadata.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "object" + ], + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "get": { + "id": "storage.objects.get", + "path": "b/{bucket}/o/{object}", + "httpMethod": "GET", + "description": "Retrieves objects or their associated metadata.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to no_acl.", + "enum": [ + "full", + "no_acl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the acl property." + ], + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "object" + ], + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ], + "supportsMediaDownload": true + }, + "insert": { + "id": "storage.objects.insert", + "path": "b/{bucket}/o", + "httpMethod": "POST", + "description": "Stores new data blobs and associated metadata.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", + "required": true, + "location": "path" + }, + "name": { + "type": "string", + "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to no_acl, unless the object resource specifies the acl property, when it defaults to full.", + "enum": [ + "full", + "no_acl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the acl property." + ], + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "Object" + }, + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ], + "supportsMediaDownload": true, + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/storage/v1beta1/b/{bucket}/o" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/storage/v1beta1/b/{bucket}/o" + } + } + } + }, + "list": { + "id": "storage.objects.list", + "path": "b/{bucket}/o", + "httpMethod": "GET", + "description": "Retrieves a list of objects matching the criteria.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which to look for objects.", + "required": true, + "location": "path" + }, + "delimiter": { + "type": "string", + "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", + "location": "query" + }, + "max-results": { + "type": "integer", + "description": "Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested.", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" + }, + "prefix": { + "type": "string", + "description": "Filter results to objects whose names begin with this prefix.", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to no_acl.", + "enum": [ + "full", + "no_acl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the acl property." + ], + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "response": { + "$ref": "Objects" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ], + "supportsSubscription": true + }, + "patch": { + "id": "storage.objects.patch", + "path": "b/{bucket}/o/{object}", + "httpMethod": "PATCH", + "description": "Updates a data blob's associated metadata. This method supports patch semantics.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "no_acl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the acl property." + ], + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "object" + ], + "request": { + "$ref": "Object" + }, + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "update": { + "id": "storage.objects.update", + "path": "b/{bucket}/o/{object}", + "httpMethod": "PUT", + "description": "Updates a data blob's associated metadata.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "no_acl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the acl property." + ], + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "object" + ], + "request": { + "$ref": "Object" + }, + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ], + "supportsMediaDownload": true + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/storage/v1beta1/storage-gen.go b/third_party/src/code.google.com/p/google-api-go-client/storage/v1beta1/storage-gen.go new file mode 100644 index 0000000000000..c72ebca5c15fa --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/storage/v1beta1/storage-gen.go @@ -0,0 +1,2609 @@ +// Package storage provides access to the Cloud Storage API. +// +// See https://developers.google.com/storage/docs/json_api/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/storage/v1beta1" +// ... +// storageService, err := storage.New(oauthHttpClient) +package storage + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "storage:v1beta1" +const apiName = "storage" +const apiVersion = "v1beta1" +const basePath = "https://www.googleapis.com/storage/v1beta1/" + +// OAuth2 scopes used by this API. +const ( + // Manage your data and permissions in Google Cloud Storage + DevstorageFull_controlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageRead_onlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageRead_writeScope = "https://www.googleapis.com/auth/devstorage.read_write" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.BucketAccessControls = NewBucketAccessControlsService(s) + s.Buckets = NewBucketsService(s) + s.ObjectAccessControls = NewObjectAccessControlsService(s) + s.Objects = NewObjectsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + BucketAccessControls *BucketAccessControlsService + + Buckets *BucketsService + + ObjectAccessControls *ObjectAccessControlsService + + Objects *ObjectsService +} + +func NewBucketAccessControlsService(s *Service) *BucketAccessControlsService { + rs := &BucketAccessControlsService{s: s} + return rs +} + +type BucketAccessControlsService struct { + s *Service +} + +func NewBucketsService(s *Service) *BucketsService { + rs := &BucketsService{s: s} + return rs +} + +type BucketsService struct { + s *Service +} + +func NewObjectAccessControlsService(s *Service) *ObjectAccessControlsService { + rs := &ObjectAccessControlsService{s: s} + return rs +} + +type ObjectAccessControlsService struct { + s *Service +} + +func NewObjectsService(s *Service) *ObjectsService { + rs := &ObjectsService{s: s} + return rs +} + +type ObjectsService struct { + s *Service +} + +type Bucket struct { + // Acl: Access controls on the bucket. + Acl []*BucketAccessControl `json:"acl,omitempty"` + + // DefaultObjectAcl: Default access controls to apply to new objects + // when no ACL is provided. + DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"` + + // Id: The name of the bucket. + Id string `json:"id,omitempty"` + + // Kind: The kind of item this is. For buckets, this is always + // storage#bucket. + Kind string `json:"kind,omitempty"` + + // Location: The location of the bucket. Object data for objects in the + // bucket resides in physical storage in this location. Can be US or EU. + // Defaults to US. + Location string `json:"location,omitempty"` + + // Owner: The owner of the bucket. This will always be the project + // team's owner group. + Owner *BucketOwner `json:"owner,omitempty"` + + // ProjectId: The project the bucket belongs to. + ProjectId uint64 `json:"projectId,omitempty,string"` + + // SelfLink: The URI of this bucket. + SelfLink string `json:"selfLink,omitempty"` + + // TimeCreated: Creation time of the bucket in RFC 3339 format. + TimeCreated string `json:"timeCreated,omitempty"` + + // Website: The bucket's website configuration. + Website *BucketWebsite `json:"website,omitempty"` +} + +type BucketOwner struct { + // Entity: The entity, in the form group-groupId. + Entity string `json:"entity,omitempty"` + + // EntityId: The ID for the entity. + EntityId string `json:"entityId,omitempty"` +} + +type BucketWebsite struct { + // MainPageSuffix: Behaves as the bucket's directory index where missing + // objects are treated as potential directories. + MainPageSuffix string `json:"mainPageSuffix,omitempty"` + + // NotFoundPage: The custom object to return when a requested resource + // is not found. + NotFoundPage string `json:"notFoundPage,omitempty"` +} + +type BucketAccessControl struct { + // Bucket: The name of the bucket. + Bucket string `json:"bucket,omitempty"` + + // Domain: The domain associated with the entity, if any. + Domain string `json:"domain,omitempty"` + + // Email: The email address associated with the entity, if any. + Email string `json:"email,omitempty"` + + // Entity: The entity holding the permission, in one of the following + // forms: + // - user-userId + // - user-email + // - group-groupId + // - group-email + // + // - domain-domain + // - allUsers + // - allAuthenticatedUsers Examples: + // - + // The user liz@example.com would be user-liz@example.com. + // - The group + // example@googlegroups.com would be group-example@googlegroups.com. + // - + // To refer to all members of the Google Apps for Business domain + // example.com, the entity would be domain-example.com. + Entity string `json:"entity,omitempty"` + + // EntityId: The ID for the entity, if any. + EntityId string `json:"entityId,omitempty"` + + // Id: The ID of the access-control entry. + Id string `json:"id,omitempty"` + + // Kind: The kind of item this is. For bucket access control entries, + // this is always storage#bucketAccessControl. + Kind string `json:"kind,omitempty"` + + // Role: The access permission for the entity. Can be READER, WRITER, or + // OWNER. + Role string `json:"role,omitempty"` + + // SelfLink: The link to this access-control entry. + SelfLink string `json:"selfLink,omitempty"` +} + +type BucketAccessControls struct { + // Items: The list of items. + Items []*BucketAccessControl `json:"items,omitempty"` + + // Kind: The kind of item this is. For lists of bucket access control + // entries, this is always storage#bucketAccessControls. + Kind string `json:"kind,omitempty"` +} + +type Buckets struct { + // Items: The list of items. + Items []*Bucket `json:"items,omitempty"` + + // Kind: The kind of item this is. For lists of buckets, this is always + // storage#buckets. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The continuation token, used to page through large + // result sets. Provide this value in a subsequent request to return the + // next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Object struct { + // Acl: Access controls on the object. + Acl []*ObjectAccessControl `json:"acl,omitempty"` + + // Bucket: The bucket containing this object. + Bucket string `json:"bucket,omitempty"` + + // CacheControl: Cache-Control directive for the object data. + CacheControl string `json:"cacheControl,omitempty"` + + // ContentDisposition: Content-Disposition of the object data. + ContentDisposition string `json:"contentDisposition,omitempty"` + + // ContentEncoding: Content-Encoding of the object data. + ContentEncoding string `json:"contentEncoding,omitempty"` + + // ContentLanguage: Content-Language of the object data. + ContentLanguage string `json:"contentLanguage,omitempty"` + + // Id: The ID of the object. + Id string `json:"id,omitempty"` + + // Kind: The kind of item this is. For objects, this is always + // storage#object. + Kind string `json:"kind,omitempty"` + + // Media: Object media data. Provided on your behalf when uploading raw + // media or multipart/related with an auxiliary media part. + Media *ObjectMedia `json:"media,omitempty"` + + // Metadata: User-provided metadata, in key/value pairs. + Metadata map[string]string `json:"metadata,omitempty"` + + // Name: The name of this object. Required if not specified by URL + // parameter. + Name string `json:"name,omitempty"` + + // Owner: The owner of the object. This will always be the uploader of + // the object. + Owner *ObjectOwner `json:"owner,omitempty"` + + // SelfLink: The link to this object. + SelfLink string `json:"selfLink,omitempty"` +} + +type ObjectMedia struct { + // Algorithm: Hash algorithm used. Currently only MD5 is supported. + // Required if a hash is provided. + Algorithm string `json:"algorithm,omitempty"` + + // ContentType: Content-Type of the object data. + ContentType string `json:"contentType,omitempty"` + + // Data: URL-safe Base64-encoded data. This property can be used to + // insert objects under 64KB in size, and will only be returned in + // response to the get method for objects so created. When this resource + // is returned in response to the list method, this property is omitted. + Data string `json:"data,omitempty"` + + // Hash: Hash of the data. Required if a hash algorithm is provided. + Hash string `json:"hash,omitempty"` + + // Length: Content-Length of the data in bytes. + Length uint64 `json:"length,omitempty,string"` + + // Link: Media download link. + Link string `json:"link,omitempty"` + + // TimeCreated: Creation time of the data in RFC 3339 format. + TimeCreated string `json:"timeCreated,omitempty"` +} + +type ObjectOwner struct { + // Entity: The entity, in the form user-userId. + Entity string `json:"entity,omitempty"` + + // EntityId: The ID for the entity. + EntityId string `json:"entityId,omitempty"` +} + +type ObjectAccessControl struct { + // Bucket: The name of the bucket. + Bucket string `json:"bucket,omitempty"` + + // Domain: The domain associated with the entity, if any. + Domain string `json:"domain,omitempty"` + + // Email: The email address associated with the entity, if any. + Email string `json:"email,omitempty"` + + // Entity: The entity holding the permission, in one of the following + // forms: + // - user-userId + // - user-email + // - group-groupId + // - group-email + // + // - domain-domain + // - allUsers + // - allAuthenticatedUsers Examples: + // - + // The user liz@example.com would be user-liz@example.com. + // - The group + // example@googlegroups.com would be group-example@googlegroups.com. + // - + // To refer to all members of the Google Apps for Business domain + // example.com, the entity would be domain-example.com. + Entity string `json:"entity,omitempty"` + + // EntityId: The ID for the entity, if any. + EntityId string `json:"entityId,omitempty"` + + // Id: The ID of the access-control entry. + Id string `json:"id,omitempty"` + + // Kind: The kind of item this is. For object access control entries, + // this is always storage#objectAccessControl. + Kind string `json:"kind,omitempty"` + + // Object: The name of the object. + Object string `json:"object,omitempty"` + + // Role: The access permission for the entity. Can be READER or OWNER. + Role string `json:"role,omitempty"` + + // SelfLink: The link to this access-control entry. + SelfLink string `json:"selfLink,omitempty"` +} + +type ObjectAccessControls struct { + // Items: The list of items. + Items []*ObjectAccessControl `json:"items,omitempty"` + + // Kind: The kind of item this is. For lists of object access control + // entries, this is always storage#objectAccessControls. + Kind string `json:"kind,omitempty"` +} + +type Objects struct { + // Items: The list of items. + Items []*Object `json:"items,omitempty"` + + // Kind: The kind of item this is. For lists of objects, this is always + // storage#objects. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The continuation token, used to page through large + // result sets. Provide this value in a subsequent request to return the + // next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Prefixes: The list of prefixes of objects matching-but-not-listed up + // to and including the requested delimiter. + Prefixes []string `json:"prefixes,omitempty"` +} + +// method id "storage.bucketAccessControls.delete": + +type BucketAccessControlsDeleteCall struct { + s *Service + bucket string + entity string + opt_ map[string]interface{} +} + +// Delete: Deletes the ACL entry for the specified entity on the +// specified bucket. +func (r *BucketAccessControlsService) Delete(bucket string, entity string) *BucketAccessControlsDeleteCall { + c := &BucketAccessControlsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.entity = entity + return c +} + +func (c *BucketAccessControlsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the ACL entry for the specified entity on the specified bucket.", + // "httpMethod": "DELETE", + // "id": "storage.bucketAccessControls.delete", + // "parameterOrder": [ + // "bucket", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/acl/{entity}", + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.bucketAccessControls.get": + +type BucketAccessControlsGetCall struct { + s *Service + bucket string + entity string + opt_ map[string]interface{} +} + +// Get: Returns the ACL entry for the specified entity on the specified +// bucket. +func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketAccessControlsGetCall { + c := &BucketAccessControlsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.entity = entity + return c +} + +func (c *BucketAccessControlsGetCall) Do() (*BucketAccessControl, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BucketAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the ACL entry for the specified entity on the specified bucket.", + // "httpMethod": "GET", + // "id": "storage.bucketAccessControls.get", + // "parameterOrder": [ + // "bucket", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/acl/{entity}", + // "response": { + // "$ref": "BucketAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.bucketAccessControls.insert": + +type BucketAccessControlsInsertCall struct { + s *Service + bucket string + bucketaccesscontrol *BucketAccessControl + opt_ map[string]interface{} +} + +// Insert: Creates a new ACL entry on the specified bucket. +func (r *BucketAccessControlsService) Insert(bucket string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsInsertCall { + c := &BucketAccessControlsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.bucketaccesscontrol = bucketaccesscontrol + return c +} + +func (c *BucketAccessControlsInsertCall) Do() (*BucketAccessControl, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BucketAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new ACL entry on the specified bucket.", + // "httpMethod": "POST", + // "id": "storage.bucketAccessControls.insert", + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/acl", + // "request": { + // "$ref": "BucketAccessControl" + // }, + // "response": { + // "$ref": "BucketAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.bucketAccessControls.list": + +type BucketAccessControlsListCall struct { + s *Service + bucket string + opt_ map[string]interface{} +} + +// List: Retrieves ACL entries on the specified bucket. +func (r *BucketAccessControlsService) List(bucket string) *BucketAccessControlsListCall { + c := &BucketAccessControlsListCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + return c +} + +func (c *BucketAccessControlsListCall) Do() (*BucketAccessControls, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BucketAccessControls) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves ACL entries on the specified bucket.", + // "httpMethod": "GET", + // "id": "storage.bucketAccessControls.list", + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/acl", + // "response": { + // "$ref": "BucketAccessControls" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.bucketAccessControls.patch": + +type BucketAccessControlsPatchCall struct { + s *Service + bucket string + entity string + bucketaccesscontrol *BucketAccessControl + opt_ map[string]interface{} +} + +// Patch: Updates an ACL entry on the specified bucket. This method +// supports patch semantics. +func (r *BucketAccessControlsService) Patch(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsPatchCall { + c := &BucketAccessControlsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.entity = entity + c.bucketaccesscontrol = bucketaccesscontrol + return c +} + +func (c *BucketAccessControlsPatchCall) Do() (*BucketAccessControl, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BucketAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an ACL entry on the specified bucket. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "storage.bucketAccessControls.patch", + // "parameterOrder": [ + // "bucket", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/acl/{entity}", + // "request": { + // "$ref": "BucketAccessControl" + // }, + // "response": { + // "$ref": "BucketAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.bucketAccessControls.update": + +type BucketAccessControlsUpdateCall struct { + s *Service + bucket string + entity string + bucketaccesscontrol *BucketAccessControl + opt_ map[string]interface{} +} + +// Update: Updates an ACL entry on the specified bucket. +func (r *BucketAccessControlsService) Update(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsUpdateCall { + c := &BucketAccessControlsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.entity = entity + c.bucketaccesscontrol = bucketaccesscontrol + return c +} + +func (c *BucketAccessControlsUpdateCall) Do() (*BucketAccessControl, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BucketAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an ACL entry on the specified bucket.", + // "httpMethod": "PUT", + // "id": "storage.bucketAccessControls.update", + // "parameterOrder": [ + // "bucket", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/acl/{entity}", + // "request": { + // "$ref": "BucketAccessControl" + // }, + // "response": { + // "$ref": "BucketAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.buckets.delete": + +type BucketsDeleteCall struct { + s *Service + bucket string + opt_ map[string]interface{} +} + +// Delete: Deletes an empty bucket. +func (r *BucketsService) Delete(bucket string) *BucketsDeleteCall { + c := &BucketsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + return c +} + +func (c *BucketsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an empty bucket.", + // "httpMethod": "DELETE", + // "id": "storage.buckets.delete", + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}", + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "storage.buckets.get": + +type BucketsGetCall struct { + s *Service + bucket string + opt_ map[string]interface{} +} + +// Get: Returns metadata for the specified bucket. +func (r *BucketsService) Get(bucket string) *BucketsGetCall { + c := &BucketsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to no_acl. +func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall { + c.opt_["projection"] = projection + return c +} + +func (c *BucketsGetCall) Do() (*Bucket, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Bucket) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns metadata for the specified bucket.", + // "httpMethod": "GET", + // "id": "storage.buckets.get", + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to no_acl.", + // "enum": [ + // "full", + // "no_acl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit acl and defaultObjectAcl properties." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{bucket}", + // "response": { + // "$ref": "Bucket" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "storage.buckets.insert": + +type BucketsInsertCall struct { + s *Service + bucket *Bucket + opt_ map[string]interface{} +} + +// Insert: Creates a new bucket. +func (r *BucketsService) Insert(bucket *Bucket) *BucketsInsertCall { + c := &BucketsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to no_acl, unless the bucket resource +// specifies acl or defaultObjectAcl properties, when it defaults to +// full. +func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall { + c.opt_["projection"] = projection + return c +} + +func (c *BucketsInsertCall) Do() (*Bucket, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Bucket) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new bucket.", + // "httpMethod": "POST", + // "id": "storage.buckets.insert", + // "parameters": { + // "projection": { + // "description": "Set of properties to return. Defaults to no_acl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.", + // "enum": [ + // "full", + // "no_acl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit acl and defaultObjectAcl properties." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b", + // "request": { + // "$ref": "Bucket" + // }, + // "response": { + // "$ref": "Bucket" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "storage.buckets.list": + +type BucketsListCall struct { + s *Service + projectId uint64 + opt_ map[string]interface{} +} + +// List: Retrieves a list of buckets for a given project. +func (r *BucketsService) List(projectId uint64) *BucketsListCall { + c := &BucketsListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + return c +} + +// MaxResults sets the optional parameter "max-results": Maximum number +// of buckets to return. +func (c *BucketsListCall) MaxResults(maxResults int64) *BucketsListCall { + c.opt_["max-results"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A +// previously-returned page token representing part of the larger set of +// results to view. +func (c *BucketsListCall) PageToken(pageToken string) *BucketsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to no_acl. +func (c *BucketsListCall) Projection(projection string) *BucketsListCall { + c.opt_["projection"] = projection + return c +} + +func (c *BucketsListCall) Do() (*Buckets, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("projectId", fmt.Sprintf("%v", c.projectId)) + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Buckets) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of buckets for a given project.", + // "httpMethod": "GET", + // "id": "storage.buckets.list", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "max-results": { + // "description": "Maximum number of buckets to return.", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A previously-returned page token representing part of the larger set of results to view.", + // "location": "query", + // "type": "string" + // }, + // "projectId": { + // "description": "A valid API project identifier.", + // "format": "uint64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to no_acl.", + // "enum": [ + // "full", + // "no_acl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit acl and defaultObjectAcl properties." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b", + // "response": { + // "$ref": "Buckets" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "storage.buckets.patch": + +type BucketsPatchCall struct { + s *Service + bucket string + bucket2 *Bucket + opt_ map[string]interface{} +} + +// Patch: Updates a bucket. This method supports patch semantics. +func (r *BucketsService) Patch(bucket string, bucket2 *Bucket) *BucketsPatchCall { + c := &BucketsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.bucket2 = bucket2 + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to full. +func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall { + c.opt_["projection"] = projection + return c +} + +func (c *BucketsPatchCall) Do() (*Bucket, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Bucket) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a bucket. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "storage.buckets.patch", + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to full.", + // "enum": [ + // "full", + // "no_acl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit acl and defaultObjectAcl properties." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{bucket}", + // "request": { + // "$ref": "Bucket" + // }, + // "response": { + // "$ref": "Bucket" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "storage.buckets.update": + +type BucketsUpdateCall struct { + s *Service + bucket string + bucket2 *Bucket + opt_ map[string]interface{} +} + +// Update: Updates a bucket. +func (r *BucketsService) Update(bucket string, bucket2 *Bucket) *BucketsUpdateCall { + c := &BucketsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.bucket2 = bucket2 + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to full. +func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall { + c.opt_["projection"] = projection + return c +} + +func (c *BucketsUpdateCall) Do() (*Bucket, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Bucket) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a bucket.", + // "httpMethod": "PUT", + // "id": "storage.buckets.update", + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to full.", + // "enum": [ + // "full", + // "no_acl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit acl and defaultObjectAcl properties." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{bucket}", + // "request": { + // "$ref": "Bucket" + // }, + // "response": { + // "$ref": "Bucket" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "storage.objectAccessControls.delete": + +type ObjectAccessControlsDeleteCall struct { + s *Service + bucket string + object string + entity string + opt_ map[string]interface{} +} + +// Delete: Deletes the ACL entry for the specified entity on the +// specified object. +func (r *ObjectAccessControlsService) Delete(bucket string, object string, entity string) *ObjectAccessControlsDeleteCall { + c := &ObjectAccessControlsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + c.entity = entity + return c +} + +func (c *ObjectAccessControlsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the ACL entry for the specified entity on the specified object.", + // "httpMethod": "DELETE", + // "id": "storage.objectAccessControls.delete", + // "parameterOrder": [ + // "bucket", + // "object", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}/acl/{entity}", + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.objectAccessControls.get": + +type ObjectAccessControlsGetCall struct { + s *Service + bucket string + object string + entity string + opt_ map[string]interface{} +} + +// Get: Returns the ACL entry for the specified entity on the specified +// object. +func (r *ObjectAccessControlsService) Get(bucket string, object string, entity string) *ObjectAccessControlsGetCall { + c := &ObjectAccessControlsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + c.entity = entity + return c +} + +func (c *ObjectAccessControlsGetCall) Do() (*ObjectAccessControl, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ObjectAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the ACL entry for the specified entity on the specified object.", + // "httpMethod": "GET", + // "id": "storage.objectAccessControls.get", + // "parameterOrder": [ + // "bucket", + // "object", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}/acl/{entity}", + // "response": { + // "$ref": "ObjectAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.objectAccessControls.insert": + +type ObjectAccessControlsInsertCall struct { + s *Service + bucket string + object string + objectaccesscontrol *ObjectAccessControl + opt_ map[string]interface{} +} + +// Insert: Creates a new ACL entry on the specified object. +func (r *ObjectAccessControlsService) Insert(bucket string, object string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsInsertCall { + c := &ObjectAccessControlsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + c.objectaccesscontrol = objectaccesscontrol + return c +} + +func (c *ObjectAccessControlsInsertCall) Do() (*ObjectAccessControl, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ObjectAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new ACL entry on the specified object.", + // "httpMethod": "POST", + // "id": "storage.objectAccessControls.insert", + // "parameterOrder": [ + // "bucket", + // "object" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}/acl", + // "request": { + // "$ref": "ObjectAccessControl" + // }, + // "response": { + // "$ref": "ObjectAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.objectAccessControls.list": + +type ObjectAccessControlsListCall struct { + s *Service + bucket string + object string + opt_ map[string]interface{} +} + +// List: Retrieves ACL entries on the specified object. +func (r *ObjectAccessControlsService) List(bucket string, object string) *ObjectAccessControlsListCall { + c := &ObjectAccessControlsListCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + return c +} + +func (c *ObjectAccessControlsListCall) Do() (*ObjectAccessControls, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ObjectAccessControls) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves ACL entries on the specified object.", + // "httpMethod": "GET", + // "id": "storage.objectAccessControls.list", + // "parameterOrder": [ + // "bucket", + // "object" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}/acl", + // "response": { + // "$ref": "ObjectAccessControls" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.objectAccessControls.patch": + +type ObjectAccessControlsPatchCall struct { + s *Service + bucket string + object string + entity string + objectaccesscontrol *ObjectAccessControl + opt_ map[string]interface{} +} + +// Patch: Updates an ACL entry on the specified object. This method +// supports patch semantics. +func (r *ObjectAccessControlsService) Patch(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsPatchCall { + c := &ObjectAccessControlsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + c.entity = entity + c.objectaccesscontrol = objectaccesscontrol + return c +} + +func (c *ObjectAccessControlsPatchCall) Do() (*ObjectAccessControl, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ObjectAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an ACL entry on the specified object. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "storage.objectAccessControls.patch", + // "parameterOrder": [ + // "bucket", + // "object", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}/acl/{entity}", + // "request": { + // "$ref": "ObjectAccessControl" + // }, + // "response": { + // "$ref": "ObjectAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.objectAccessControls.update": + +type ObjectAccessControlsUpdateCall struct { + s *Service + bucket string + object string + entity string + objectaccesscontrol *ObjectAccessControl + opt_ map[string]interface{} +} + +// Update: Updates an ACL entry on the specified object. +func (r *ObjectAccessControlsService) Update(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsUpdateCall { + c := &ObjectAccessControlsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + c.entity = entity + c.objectaccesscontrol = objectaccesscontrol + return c +} + +func (c *ObjectAccessControlsUpdateCall) Do() (*ObjectAccessControl, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ObjectAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an ACL entry on the specified object.", + // "httpMethod": "PUT", + // "id": "storage.objectAccessControls.update", + // "parameterOrder": [ + // "bucket", + // "object", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}/acl/{entity}", + // "request": { + // "$ref": "ObjectAccessControl" + // }, + // "response": { + // "$ref": "ObjectAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.objects.delete": + +type ObjectsDeleteCall struct { + s *Service + bucket string + object string + opt_ map[string]interface{} +} + +// Delete: Deletes data blobs and associated metadata. +func (r *ObjectsService) Delete(bucket string, object string) *ObjectsDeleteCall { + c := &ObjectsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + return c +} + +func (c *ObjectsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes data blobs and associated metadata.", + // "httpMethod": "DELETE", + // "id": "storage.objects.delete", + // "parameterOrder": [ + // "bucket", + // "object" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of the bucket in which the object resides.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}", + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "storage.objects.get": + +type ObjectsGetCall struct { + s *Service + bucket string + object string + opt_ map[string]interface{} +} + +// Get: Retrieves objects or their associated metadata. +func (r *ObjectsService) Get(bucket string, object string) *ObjectsGetCall { + c := &ObjectsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to no_acl. +func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall { + c.opt_["projection"] = projection + return c +} + +func (c *ObjectsGetCall) Do() (*Object, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Object) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves objects or their associated metadata.", + // "httpMethod": "GET", + // "id": "storage.objects.get", + // "parameterOrder": [ + // "bucket", + // "object" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of the bucket in which the object resides.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to no_acl.", + // "enum": [ + // "full", + // "no_acl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit the acl property." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}", + // "response": { + // "$ref": "Object" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "storage.objects.insert": + +type ObjectsInsertCall struct { + s *Service + bucket string + object *Object + opt_ map[string]interface{} + media_ io.Reader +} + +// Insert: Stores new data blobs and associated metadata. +func (r *ObjectsService) Insert(bucket string, object *Object) *ObjectsInsertCall { + c := &ObjectsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + return c +} + +// Name sets the optional parameter "name": Name of the object. Required +// when the object metadata is not otherwise provided. Overrides the +// object metadata's name value, if any. +func (c *ObjectsInsertCall) Name(name string) *ObjectsInsertCall { + c.opt_["name"] = name + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to no_acl, unless the object resource +// specifies the acl property, when it defaults to full. +func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall { + c.opt_["projection"] = projection + return c +} +func (c *ObjectsInsertCall) Media(r io.Reader) *ObjectsInsertCall { + c.media_ = r + return c +} + +func (c *ObjectsInsertCall) Do() (*Object, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.object) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["name"]; ok { + params.Set("name", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Object) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Stores new data blobs and associated metadata.", + // "httpMethod": "POST", + // "id": "storage.objects.insert", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/storage/v1beta1/b/{bucket}/o" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/storage/v1beta1/b/{bucket}/o" + // } + // } + // }, + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "name": { + // "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.", + // "location": "query", + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to no_acl, unless the object resource specifies the acl property, when it defaults to full.", + // "enum": [ + // "full", + // "no_acl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit the acl property." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o", + // "request": { + // "$ref": "Object" + // }, + // "response": { + // "$ref": "Object" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ], + // "supportsMediaDownload": true, + // "supportsMediaUpload": true + // } + +} + +// method id "storage.objects.list": + +type ObjectsListCall struct { + s *Service + bucket string + opt_ map[string]interface{} +} + +// List: Retrieves a list of objects matching the criteria. +func (r *ObjectsService) List(bucket string) *ObjectsListCall { + c := &ObjectsListCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + return c +} + +// Delimiter sets the optional parameter "delimiter": Returns results in +// a directory-like mode. items will contain only objects whose names, +// aside from the prefix, do not contain delimiter. Objects whose names, +// aside from the prefix, contain delimiter will have their name, +// truncated after the delimiter, returned in prefixes. Duplicate +// prefixes are omitted. +func (c *ObjectsListCall) Delimiter(delimiter string) *ObjectsListCall { + c.opt_["delimiter"] = delimiter + return c +} + +// MaxResults sets the optional parameter "max-results": Maximum number +// of items plus prefixes to return. As duplicate prefixes are omitted, +// fewer total results may be returned than requested. +func (c *ObjectsListCall) MaxResults(maxResults int64) *ObjectsListCall { + c.opt_["max-results"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A +// previously-returned page token representing part of the larger set of +// results to view. +func (c *ObjectsListCall) PageToken(pageToken string) *ObjectsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Prefix sets the optional parameter "prefix": Filter results to +// objects whose names begin with this prefix. +func (c *ObjectsListCall) Prefix(prefix string) *ObjectsListCall { + c.opt_["prefix"] = prefix + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to no_acl. +func (c *ObjectsListCall) Projection(projection string) *ObjectsListCall { + c.opt_["projection"] = projection + return c +} + +func (c *ObjectsListCall) Do() (*Objects, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["delimiter"]; ok { + params.Set("delimiter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["max-results"]; ok { + params.Set("max-results", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["prefix"]; ok { + params.Set("prefix", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Objects) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of objects matching the criteria.", + // "httpMethod": "GET", + // "id": "storage.objects.list", + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of the bucket in which to look for objects.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "delimiter": { + // "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", + // "location": "query", + // "type": "string" + // }, + // "max-results": { + // "description": "Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested.", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A previously-returned page token representing part of the larger set of results to view.", + // "location": "query", + // "type": "string" + // }, + // "prefix": { + // "description": "Filter results to objects whose names begin with this prefix.", + // "location": "query", + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to no_acl.", + // "enum": [ + // "full", + // "no_acl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit the acl property." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o", + // "response": { + // "$ref": "Objects" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ], + // "supportsSubscription": true + // } + +} + +// method id "storage.objects.patch": + +type ObjectsPatchCall struct { + s *Service + bucket string + object string + object2 *Object + opt_ map[string]interface{} +} + +// Patch: Updates a data blob's associated metadata. This method +// supports patch semantics. +func (r *ObjectsService) Patch(bucket string, object string, object2 *Object) *ObjectsPatchCall { + c := &ObjectsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + c.object2 = object2 + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to full. +func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall { + c.opt_["projection"] = projection + return c +} + +func (c *ObjectsPatchCall) Do() (*Object, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Object) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a data blob's associated metadata. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "storage.objects.patch", + // "parameterOrder": [ + // "bucket", + // "object" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of the bucket in which the object resides.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to full.", + // "enum": [ + // "full", + // "no_acl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit the acl property." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}", + // "request": { + // "$ref": "Object" + // }, + // "response": { + // "$ref": "Object" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "storage.objects.update": + +type ObjectsUpdateCall struct { + s *Service + bucket string + object string + object2 *Object + opt_ map[string]interface{} +} + +// Update: Updates a data blob's associated metadata. +func (r *ObjectsService) Update(bucket string, object string, object2 *Object) *ObjectsUpdateCall { + c := &ObjectsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + c.object2 = object2 + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to full. +func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall { + c.opt_["projection"] = projection + return c +} + +func (c *ObjectsUpdateCall) Do() (*Object, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Object) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a data blob's associated metadata.", + // "httpMethod": "PUT", + // "id": "storage.objects.update", + // "parameterOrder": [ + // "bucket", + // "object" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of the bucket in which the object resides.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to full.", + // "enum": [ + // "full", + // "no_acl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit the acl property." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}", + // "request": { + // "$ref": "Object" + // }, + // "response": { + // "$ref": "Object" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ], + // "supportsMediaDownload": true + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/storage/v1beta2/storage-api.json b/third_party/src/code.google.com/p/google-api-go-client/storage/v1beta2/storage-api.json new file mode 100644 index 0000000000000..8915cf4a24e2a --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/storage/v1beta2/storage-api.json @@ -0,0 +1,2344 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/1kn7iGSorTXBeUYcJymRrnSmuvg\"", + "discoveryVersion": "v1", + "id": "storage:v1beta2", + "name": "storage", + "version": "v1beta2", + "title": "Cloud Storage API", + "description": "Lets you store and retrieve potentially-large, immutable data objects.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/cloud_storage-16.png", + "x32": "https://www.google.com/images/icons/product/cloud_storage-32.png" + }, + "documentationLink": "https://developers.google.com/storage/docs/json_api/", + "labels": [ + "labs" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/storage/v1beta2/", + "basePath": "/storage/v1beta2/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "storage/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/devstorage.full_control": { + "description": "Manage your data and permissions in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" + } + } + } + }, + "schemas": { + "Bucket": { + "id": "Bucket", + "type": "object", + "description": "A bucket.", + "properties": { + "acl": { + "type": "array", + "description": "Access controls on the bucket.", + "items": { + "$ref": "BucketAccessControl" + }, + "annotations": { + "required": [ + "storage.buckets.update" + ] + } + }, + "cors": { + "type": "array", + "description": "The bucket's Cross-Origin Resource Sharing (CORS) configuration.", + "items": { + "type": "object", + "properties": { + "maxAgeSeconds": { + "type": "integer", + "description": "The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.", + "format": "int32" + }, + "method": { + "type": "array", + "description": "The list of HTTP methods on which to include CORS response headers, e.g. GET, OPTIONS, POST. Note, \"*\" is permitted in the list of methods, and means \"any method\".", + "items": { + "type": "string" + } + }, + "origin": { + "type": "array", + "description": "The list of Origins eligible to receive CORS response headers. Note: \"*\" is permitted in the list of origins, and means \"any Origin\".", + "items": { + "type": "string" + } + }, + "responseHeader": { + "type": "array", + "description": "The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.", + "items": { + "type": "string" + } + } + } + } + }, + "defaultObjectAcl": { + "type": "array", + "description": "Default access controls to apply to new objects when no ACL is provided.", + "items": { + "$ref": "ObjectAccessControl" + } + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the bucket." + }, + "id": { + "type": "string", + "description": "The ID of the bucket." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For buckets, this is always storage#bucket.", + "default": "storage#bucket" + }, + "lifecycle": { + "type": "object", + "description": "The bucket's lifecycle configuration. See object lifecycle management for more information.", + "properties": { + "rule": { + "type": "array", + "description": "A lifecycle management rule, which is made of an action to take and the condition(s) under which the action will be taken.", + "items": { + "type": "object", + "properties": { + "action": { + "type": "object", + "description": "The action to take.", + "properties": { + "type": { + "type": "string", + "description": "Type of the action, e.g. Delete." + } + } + }, + "condition": { + "type": "object", + "description": "The condition(s) under which the action will be taken.", + "properties": { + "age": { + "type": "integer", + "description": "Age of an object (in days). This condition is satisfied when an object reaches the specified age.", + "format": "int32" + }, + "createdBefore": { + "type": "string", + "description": "A date in RFC 3339 format with only the date part, e.g. \"2013-01-15\". This condition is satisfied when an object is created before midnight of the specified date in UTC.", + "format": "date" + }, + "isLive": { + "type": "boolean", + "description": "Relevant only for versioned objects. If the value is true, this condition matches live objects; if the value is false, it matches archived objects." + }, + "numNewerVersions": { + "type": "integer", + "description": "Relevant only for versioned objects. If the value is N, this condition is satisfied when there are at least N versions (including the live version) newer than this version of the object.", + "format": "int32" + } + } + } + } + } + } + } + }, + "location": { + "type": "string", + "description": "The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Typical values are US and EU. Defaults to US. See the developer's guide for the authoritative list." + }, + "logging": { + "type": "object", + "description": "The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs.", + "properties": { + "logBucket": { + "type": "string", + "description": "The destination bucket where the current bucket's logs should be placed." + }, + "logObjectPrefix": { + "type": "string", + "description": "A prefix for log object names." + } + } + }, + "metageneration": { + "type": "string", + "description": "The metadata generation of this bucket.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "The name of the bucket.", + "annotations": { + "required": [ + "storage.buckets.insert" + ] + } + }, + "owner": { + "type": "object", + "description": "The owner of the bucket. This will always be the project team's owner group.", + "properties": { + "entity": { + "type": "string", + "description": "The entity, in the form group-groupId." + }, + "entityId": { + "type": "string", + "description": "The ID for the entity." + } + } + }, + "selfLink": { + "type": "string", + "description": "The URI of this bucket." + }, + "storageClass": { + "type": "string", + "description": "The bucket's storage class. This defines how objects in the bucket will be stored and determines the SLA and the cost of storage. Typical values are STANDARD and DURABLE_REDUCED_AVAILABILITY. Defaults to STANDARD. See the developer's guide for the authoritative list." + }, + "timeCreated": { + "type": "string", + "description": "Creation time of the bucket in RFC 3339 format.", + "format": "date-time" + }, + "versioning": { + "type": "object", + "description": "The bucket's versioning configuration.", + "properties": { + "enabled": { + "type": "boolean", + "description": "While set to true, versioning is fully enabled for this bucket." + } + } + }, + "website": { + "type": "object", + "description": "The bucket's website configuration.", + "properties": { + "mainPageSuffix": { + "type": "string", + "description": "Behaves as the bucket's directory index where missing objects are treated as potential directories." + }, + "notFoundPage": { + "type": "string", + "description": "The custom object to return when a requested resource is not found." + } + } + } + } + }, + "BucketAccessControl": { + "id": "BucketAccessControl", + "type": "object", + "description": "An access-control entry.", + "properties": { + "bucket": { + "type": "string", + "description": "The name of the bucket." + }, + "domain": { + "type": "string", + "description": "The domain associated with the entity, if any." + }, + "email": { + "type": "string", + "description": "The email address associated with the entity, if any." + }, + "entity": { + "type": "string", + "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.", + "annotations": { + "required": [ + "storage.bucketAccessControls.insert" + ] + } + }, + "entityId": { + "type": "string", + "description": "The ID for the entity, if any." + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the access-control entry." + }, + "id": { + "type": "string", + "description": "The ID of the access-control entry." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For bucket access control entries, this is always storage#bucketAccessControl.", + "default": "storage#bucketAccessControl" + }, + "role": { + "type": "string", + "description": "The access permission for the entity. Can be READER, WRITER, or OWNER.", + "annotations": { + "required": [ + "storage.bucketAccessControls.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "The link to this access-control entry." + } + } + }, + "BucketAccessControls": { + "id": "BucketAccessControls", + "type": "object", + "description": "An access-control list.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "BucketAccessControl" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of bucket access control entries, this is always storage#bucketAccessControls.", + "default": "storage#bucketAccessControls" + } + } + }, + "Buckets": { + "id": "Buckets", + "type": "object", + "description": "A list of buckets.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "Bucket" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of buckets, this is always storage#buckets.", + "default": "storage#buckets" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + } + } + }, + "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." + } + } + }, + "ComposeRequest": { + "id": "ComposeRequest", + "type": "object", + "description": "A Compose request.", + "properties": { + "destination": { + "$ref": "Object", + "description": "Properties of the resulting object" + }, + "kind": { + "type": "string", + "description": "The kind of item this is.", + "default": "storage#composeRequest" + }, + "sourceObjects": { + "type": "array", + "description": "The list of source objects that will be concatenated into a single object.", + "items": { + "type": "object", + "properties": { + "generation": { + "type": "string", + "description": "The generation of this object to use as the source.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "The source object's name. The source object's bucket is implicitly the destination bucket.", + "annotations": { + "required": [ + "storage.objects.compose" + ] + } + }, + "objectPreconditions": { + "type": "object", + "description": "Conditions that must be met for this operation to execute.", + "properties": { + "ifGenerationMatch": { + "type": "string", + "description": "Only perform the composition if the generation of the source object that would be used matches this value. If this value and a generation are both specified, they must be the same value or the call will fail.", + "format": "int64" + } + } + } + } + }, + "annotations": { + "required": [ + "storage.objects.compose" + ] + } + } + } + }, + "Object": { + "id": "Object", + "type": "object", + "description": "An object.", + "properties": { + "acl": { + "type": "array", + "description": "Access controls on the object.", + "items": { + "$ref": "ObjectAccessControl" + }, + "annotations": { + "required": [ + "storage.objects.update" + ] + } + }, + "bucket": { + "type": "string", + "description": "The bucket containing this object." + }, + "cacheControl": { + "type": "string", + "description": "Cache-Control directive for the object data." + }, + "componentCount": { + "type": "integer", + "description": "Number of underlying components that make up this object. Components are accumulated by compose operations and are limited to a count of 32.", + "format": "int32" + }, + "contentDisposition": { + "type": "string", + "description": "Content-Disposition of the object data." + }, + "contentEncoding": { + "type": "string", + "description": "Content-Encoding of the object data." + }, + "contentLanguage": { + "type": "string", + "description": "Content-Language of the object data." + }, + "contentType": { + "type": "string", + "description": "Content-Type of the object data.", + "annotations": { + "required": [ + "storage.objects.update" + ] + } + }, + "crc32c": { + "type": "string", + "description": "CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64." + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the object." + }, + "generation": { + "type": "string", + "description": "The content generation of this object. Used for object versioning.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "The ID of the object." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For objects, this is always storage#object.", + "default": "storage#object" + }, + "md5Hash": { + "type": "string", + "description": "MD5 hash of the data; encoded using base64." + }, + "mediaLink": { + "type": "string", + "description": "Media download link." + }, + "metadata": { + "type": "object", + "description": "User-provided metadata, in key/value pairs.", + "additionalProperties": { + "type": "string", + "description": "An individual metadata entry." + } + }, + "metageneration": { + "type": "string", + "description": "The generation of the metadata for this object at this generation. Used for metadata versioning. Has no meaning outside of the context of this generation.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "The name of this object. Required if not specified by URL parameter." + }, + "owner": { + "type": "object", + "description": "The owner of the object. This will always be the uploader of the object.", + "properties": { + "entity": { + "type": "string", + "description": "The entity, in the form user-userId." + }, + "entityId": { + "type": "string", + "description": "The ID for the entity." + } + } + }, + "selfLink": { + "type": "string", + "description": "The link to this object." + }, + "size": { + "type": "string", + "description": "Content-Length of the data in bytes.", + "format": "uint64" + }, + "storageClass": { + "type": "string", + "description": "Storage class of the object." + }, + "timeDeleted": { + "type": "string", + "description": "Deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.", + "format": "date-time" + }, + "updated": { + "type": "string", + "description": "Modification time of the object metadata in RFC 3339 format.", + "format": "date-time" + } + } + }, + "ObjectAccessControl": { + "id": "ObjectAccessControl", + "type": "object", + "description": "An access-control entry.", + "properties": { + "bucket": { + "type": "string", + "description": "The name of the bucket." + }, + "domain": { + "type": "string", + "description": "The domain associated with the entity, if any." + }, + "email": { + "type": "string", + "description": "The email address associated with the entity, if any." + }, + "entity": { + "type": "string", + "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com." + }, + "entityId": { + "type": "string", + "description": "The ID for the entity, if any." + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the access-control entry." + }, + "generation": { + "type": "string", + "description": "The content generation of the object.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "The ID of the access-control entry." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For object access control entries, this is always storage#objectAccessControl.", + "default": "storage#objectAccessControl" + }, + "object": { + "type": "string", + "description": "The name of the object." + }, + "role": { + "type": "string", + "description": "The access permission for the entity. Can be READER or OWNER." + }, + "selfLink": { + "type": "string", + "description": "The link to this access-control entry." + } + } + }, + "ObjectAccessControls": { + "id": "ObjectAccessControls", + "type": "object", + "description": "An access-control list.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", + "items": { + "type": "any" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of object access control entries, this is always storage#objectAccessControls.", + "default": "storage#objectAccessControls" + } + } + }, + "Objects": { + "id": "Objects", + "type": "object", + "description": "A list of objects.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "Object" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of objects, this is always storage#objects.", + "default": "storage#objects" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "prefixes": { + "type": "array", + "description": "The list of prefixes of objects matching-but-not-listed up to and including the requested delimiter.", + "items": { + "type": "string" + } + } + } + } + }, + "resources": { + "bucketAccessControls": { + "methods": { + "delete": { + "id": "storage.bucketAccessControls.delete", + "path": "b/{bucket}/acl/{entity}", + "httpMethod": "DELETE", + "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "entity" + ], + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "get": { + "id": "storage.bucketAccessControls.get", + "path": "b/{bucket}/acl/{entity}", + "httpMethod": "GET", + "description": "Returns the ACL entry for the specified entity on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "entity" + ], + "response": { + "$ref": "BucketAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "insert": { + "id": "storage.bucketAccessControls.insert", + "path": "b/{bucket}/acl", + "httpMethod": "POST", + "description": "Creates a new ACL entry on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "BucketAccessControl" + }, + "response": { + "$ref": "BucketAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "list": { + "id": "storage.bucketAccessControls.list", + "path": "b/{bucket}/acl", + "httpMethod": "GET", + "description": "Retrieves ACL entries on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket" + ], + "response": { + "$ref": "BucketAccessControls" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "patch": { + "id": "storage.bucketAccessControls.patch", + "path": "b/{bucket}/acl/{entity}", + "httpMethod": "PATCH", + "description": "Updates an ACL entry on the specified bucket. This method supports patch semantics.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "entity" + ], + "request": { + "$ref": "BucketAccessControl" + }, + "response": { + "$ref": "BucketAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "update": { + "id": "storage.bucketAccessControls.update", + "path": "b/{bucket}/acl/{entity}", + "httpMethod": "PUT", + "description": "Updates an ACL entry on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "entity" + ], + "request": { + "$ref": "BucketAccessControl" + }, + "response": { + "$ref": "BucketAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + } + } + }, + "buckets": { + "methods": { + "delete": { + "id": "storage.buckets.delete", + "path": "b/{bucket}", + "httpMethod": "DELETE", + "description": "Permanently deletes an empty bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", + "format": "uint64", + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "get": { + "id": "storage.buckets.get", + "path": "b/{bucket}", + "httpMethod": "GET", + "description": "Returns metadata for the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", + "format": "uint64", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit acl and defaultObjectAcl properties." + ], + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "response": { + "$ref": "Bucket" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "insert": { + "id": "storage.buckets.insert", + "path": "b", + "httpMethod": "POST", + "description": "Creates a new bucket.", + "parameters": { + "project": { + "type": "string", + "description": "A valid API project identifier.", + "required": true, + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit acl and defaultObjectAcl properties." + ], + "location": "query" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "Bucket" + }, + "response": { + "$ref": "Bucket" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "list": { + "id": "storage.buckets.list", + "path": "b", + "httpMethod": "GET", + "description": "Retrieves a list of buckets for a given project.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of buckets to return.", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" + }, + "project": { + "type": "string", + "description": "A valid API project identifier.", + "required": true, + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit acl and defaultObjectAcl properties." + ], + "location": "query" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "Buckets" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "patch": { + "id": "storage.buckets.patch", + "path": "b/{bucket}", + "httpMethod": "PATCH", + "description": "Updates a bucket. This method supports patch semantics.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", + "format": "uint64", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit acl and defaultObjectAcl properties." + ], + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "Bucket" + }, + "response": { + "$ref": "Bucket" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "update": { + "id": "storage.buckets.update", + "path": "b/{bucket}", + "httpMethod": "PUT", + "description": "Updates a bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", + "format": "uint64", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit acl and defaultObjectAcl properties." + ], + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "Bucket" + }, + "response": { + "$ref": "Bucket" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + } + } + }, + "channels": { + "methods": { + "stop": { + "id": "storage.channels.stop", + "path": "channels/stop", + "httpMethod": "POST", + "description": "Stop watching resources through this channel", + "request": { + "$ref": "Channel", + "parameterName": "resource" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + } + } + }, + "defaultObjectAccessControls": { + "methods": { + "delete": { + "id": "storage.defaultObjectAccessControls.delete", + "path": "b/{bucket}/defaultObjectAcl/{entity}", + "httpMethod": "DELETE", + "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "entity" + ], + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "get": { + "id": "storage.defaultObjectAccessControls.get", + "path": "b/{bucket}/defaultObjectAcl/{entity}", + "httpMethod": "GET", + "description": "Returns the default object ACL entry for the specified entity on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "entity" + ], + "response": { + "$ref": "ObjectAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "insert": { + "id": "storage.defaultObjectAccessControls.insert", + "path": "b/{bucket}/defaultObjectAcl", + "httpMethod": "POST", + "description": "Creates a new default object ACL entry on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "ObjectAccessControl" + }, + "response": { + "$ref": "ObjectAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "list": { + "id": "storage.defaultObjectAccessControls.list", + "path": "b/{bucket}/defaultObjectAcl", + "httpMethod": "GET", + "description": "Retrieves default object ACL entries on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", + "format": "uint64", + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "response": { + "$ref": "ObjectAccessControls" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "patch": { + "id": "storage.defaultObjectAccessControls.patch", + "path": "b/{bucket}/defaultObjectAcl/{entity}", + "httpMethod": "PATCH", + "description": "Updates a default object ACL entry on the specified bucket. This method supports patch semantics.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "entity" + ], + "request": { + "$ref": "ObjectAccessControl" + }, + "response": { + "$ref": "ObjectAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "update": { + "id": "storage.defaultObjectAccessControls.update", + "path": "b/{bucket}/defaultObjectAcl/{entity}", + "httpMethod": "PUT", + "description": "Updates a default object ACL entry on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "entity" + ], + "request": { + "$ref": "ObjectAccessControl" + }, + "response": { + "$ref": "ObjectAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + } + } + }, + "objectAccessControls": { + "methods": { + "delete": { + "id": "storage.objectAccessControls.delete", + "path": "b/{bucket}/o/{object}/acl/{entity}", + "httpMethod": "DELETE", + "description": "Permanently deletes the ACL entry for the specified entity on the specified object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "uint64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "object", + "entity" + ], + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "get": { + "id": "storage.objectAccessControls.get", + "path": "b/{bucket}/o/{object}/acl/{entity}", + "httpMethod": "GET", + "description": "Returns the ACL entry for the specified entity on the specified object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "uint64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "object", + "entity" + ], + "response": { + "$ref": "ObjectAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "insert": { + "id": "storage.objectAccessControls.insert", + "path": "b/{bucket}/o/{object}/acl", + "httpMethod": "POST", + "description": "Creates a new ACL entry on the specified object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "uint64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "object" + ], + "request": { + "$ref": "ObjectAccessControl" + }, + "response": { + "$ref": "ObjectAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "list": { + "id": "storage.objectAccessControls.list", + "path": "b/{bucket}/o/{object}/acl", + "httpMethod": "GET", + "description": "Retrieves ACL entries on the specified object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "uint64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "object" + ], + "response": { + "$ref": "ObjectAccessControls" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "patch": { + "id": "storage.objectAccessControls.patch", + "path": "b/{bucket}/o/{object}/acl/{entity}", + "httpMethod": "PATCH", + "description": "Updates an ACL entry on the specified object. This method supports patch semantics.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "uint64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "object", + "entity" + ], + "request": { + "$ref": "ObjectAccessControl" + }, + "response": { + "$ref": "ObjectAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "update": { + "id": "storage.objectAccessControls.update", + "path": "b/{bucket}/o/{object}/acl/{entity}", + "httpMethod": "PUT", + "description": "Updates an ACL entry on the specified object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "uint64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "object", + "entity" + ], + "request": { + "$ref": "ObjectAccessControl" + }, + "response": { + "$ref": "ObjectAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control" + ] + } + } + }, + "objects": { + "methods": { + "compose": { + "id": "storage.objects.compose", + "path": "b/{destinationBucket}/o/{destinationObject}/compose", + "httpMethod": "POST", + "description": "Concatenates a list of existing objects into a new object in the same bucket.", + "parameters": { + "destinationBucket": { + "type": "string", + "description": "Name of the bucket in which to store the new object.", + "required": true, + "location": "path" + }, + "destinationObject": { + "type": "string", + "description": "Name of the new object.", + "required": true, + "location": "path" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "uint64", + "location": "query" + } + }, + "parameterOrder": [ + "destinationBucket", + "destinationObject" + ], + "request": { + "$ref": "ComposeRequest" + }, + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ], + "supportsMediaDownload": true + }, + "copy": { + "id": "storage.objects.copy", + "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}", + "httpMethod": "POST", + "description": "Copies an object to a destination in the same location. Optionally overrides metadata.", + "parameters": { + "destinationBucket": { + "type": "string", + "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", + "required": true, + "location": "path" + }, + "destinationObject": { + "type": "string", + "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.", + "required": true, + "location": "path" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current generation matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value.", + "format": "uint64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", + "format": "uint64", + "location": "query" + }, + "ifSourceGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's generation matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifSourceGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's generation does not match the given value.", + "format": "uint64", + "location": "query" + }, + "ifSourceMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifSourceMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", + "format": "uint64", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the acl property." + ], + "location": "query" + }, + "sourceBucket": { + "type": "string", + "description": "Name of the bucket in which to find the source object.", + "required": true, + "location": "path" + }, + "sourceGeneration": { + "type": "string", + "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).", + "format": "uint64", + "location": "query" + }, + "sourceObject": { + "type": "string", + "description": "Name of the source object.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "sourceBucket", + "sourceObject", + "destinationBucket", + "destinationObject" + ], + "request": { + "$ref": "Object" + }, + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ], + "supportsMediaDownload": true + }, + "delete": { + "id": "storage.objects.delete", + "path": "b/{bucket}/o/{object}", + "httpMethod": "DELETE", + "description": "Deletes data blobs and associated metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).", + "format": "uint64", + "location": "query" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + "format": "uint64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "uint64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "object" + ], + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "get": { + "id": "storage.objects.get", + "path": "b/{bucket}/o/{object}", + "httpMethod": "GET", + "description": "Retrieves objects or their associated metadata.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "uint64", + "location": "query" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's generation matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's generation does not match the given value.", + "format": "uint64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "uint64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the acl property." + ], + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "object" + ], + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ], + "supportsMediaDownload": true + }, + "insert": { + "id": "storage.objects.insert", + "path": "b/{bucket}/o", + "httpMethod": "POST", + "description": "Stores new data blobs and associated metadata.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", + "required": true, + "location": "path" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + "format": "uint64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "uint64", + "location": "query" + }, + "name": { + "type": "string", + "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the acl property." + ], + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "Object" + }, + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ], + "supportsMediaDownload": true, + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/storage/v1beta2/b/{bucket}/o" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/storage/v1beta2/b/{bucket}/o" + } + } + } + }, + "list": { + "id": "storage.objects.list", + "path": "b/{bucket}/o", + "httpMethod": "GET", + "description": "Retrieves a list of objects matching the criteria.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which to look for objects.", + "required": true, + "location": "path" + }, + "delimiter": { + "type": "string", + "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested.", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" + }, + "prefix": { + "type": "string", + "description": "Filter results to objects whose names begin with this prefix.", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the acl property." + ], + "location": "query" + }, + "versions": { + "type": "boolean", + "description": "If true, lists all versions of a file as distinct results.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "response": { + "$ref": "Objects" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ], + "supportsSubscription": true + }, + "patch": { + "id": "storage.objects.patch", + "path": "b/{bucket}/o/{object}", + "httpMethod": "PATCH", + "description": "Updates a data blob's associated metadata. This method supports patch semantics.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "uint64", + "location": "query" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + "format": "uint64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "uint64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the acl property." + ], + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "object" + ], + "request": { + "$ref": "Object" + }, + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "update": { + "id": "storage.objects.update", + "path": "b/{bucket}/o/{object}", + "httpMethod": "PUT", + "description": "Updates a data blob's associated metadata.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "uint64", + "location": "query" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + "format": "uint64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "uint64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "uint64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object.", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the acl property." + ], + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "object" + ], + "request": { + "$ref": "Object" + }, + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ], + "supportsMediaDownload": true + }, + "watchAll": { + "id": "storage.objects.watchAll", + "path": "b/{bucket}/o/watch", + "httpMethod": "POST", + "description": "Watch for changes on all objects in a bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which to look for objects.", + "required": true, + "location": "path" + }, + "delimiter": { + "type": "string", + "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested.", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" + }, + "prefix": { + "type": "string", + "description": "Filter results to objects whose names begin with this prefix.", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the acl property." + ], + "location": "query" + }, + "versions": { + "type": "boolean", + "description": "If true, lists all versions of a file as distinct results.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "Channel", + "parameterName": "resource" + }, + "response": { + "$ref": "Channel" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ], + "supportsSubscription": true + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/storage/v1beta2/storage-gen.go b/third_party/src/code.google.com/p/google-api-go-client/storage/v1beta2/storage-gen.go new file mode 100644 index 0000000000000..4a2ee427f952e --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/storage/v1beta2/storage-gen.go @@ -0,0 +1,4664 @@ +// Package storage provides access to the Cloud Storage API. +// +// See https://developers.google.com/storage/docs/json_api/ +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/storage/v1beta2" +// ... +// storageService, err := storage.New(oauthHttpClient) +package storage + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "storage:v1beta2" +const apiName = "storage" +const apiVersion = "v1beta2" +const basePath = "https://www.googleapis.com/storage/v1beta2/" + +// OAuth2 scopes used by this API. +const ( + // Manage your data and permissions in Google Cloud Storage + DevstorageFull_controlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageRead_onlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageRead_writeScope = "https://www.googleapis.com/auth/devstorage.read_write" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.BucketAccessControls = NewBucketAccessControlsService(s) + s.Buckets = NewBucketsService(s) + s.Channels = NewChannelsService(s) + s.DefaultObjectAccessControls = NewDefaultObjectAccessControlsService(s) + s.ObjectAccessControls = NewObjectAccessControlsService(s) + s.Objects = NewObjectsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + BucketAccessControls *BucketAccessControlsService + + Buckets *BucketsService + + Channels *ChannelsService + + DefaultObjectAccessControls *DefaultObjectAccessControlsService + + ObjectAccessControls *ObjectAccessControlsService + + Objects *ObjectsService +} + +func NewBucketAccessControlsService(s *Service) *BucketAccessControlsService { + rs := &BucketAccessControlsService{s: s} + return rs +} + +type BucketAccessControlsService struct { + s *Service +} + +func NewBucketsService(s *Service) *BucketsService { + rs := &BucketsService{s: s} + return rs +} + +type BucketsService struct { + s *Service +} + +func NewChannelsService(s *Service) *ChannelsService { + rs := &ChannelsService{s: s} + return rs +} + +type ChannelsService struct { + s *Service +} + +func NewDefaultObjectAccessControlsService(s *Service) *DefaultObjectAccessControlsService { + rs := &DefaultObjectAccessControlsService{s: s} + return rs +} + +type DefaultObjectAccessControlsService struct { + s *Service +} + +func NewObjectAccessControlsService(s *Service) *ObjectAccessControlsService { + rs := &ObjectAccessControlsService{s: s} + return rs +} + +type ObjectAccessControlsService struct { + s *Service +} + +func NewObjectsService(s *Service) *ObjectsService { + rs := &ObjectsService{s: s} + return rs +} + +type ObjectsService struct { + s *Service +} + +type Bucket struct { + // Acl: Access controls on the bucket. + Acl []*BucketAccessControl `json:"acl,omitempty"` + + // Cors: The bucket's Cross-Origin Resource Sharing (CORS) + // configuration. + Cors []*BucketCors `json:"cors,omitempty"` + + // DefaultObjectAcl: Default access controls to apply to new objects + // when no ACL is provided. + DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"` + + // Etag: HTTP 1.1 Entity tag for the bucket. + Etag string `json:"etag,omitempty"` + + // Id: The ID of the bucket. + Id string `json:"id,omitempty"` + + // Kind: The kind of item this is. For buckets, this is always + // storage#bucket. + Kind string `json:"kind,omitempty"` + + // Lifecycle: The bucket's lifecycle configuration. See object lifecycle + // management for more information. + Lifecycle *BucketLifecycle `json:"lifecycle,omitempty"` + + // Location: The location of the bucket. Object data for objects in the + // bucket resides in physical storage within this region. Typical values + // are US and EU. Defaults to US. See the developer's guide for the + // authoritative list. + Location string `json:"location,omitempty"` + + // Logging: The bucket's logging configuration, which defines the + // destination bucket and optional name prefix for the current bucket's + // logs. + Logging *BucketLogging `json:"logging,omitempty"` + + // Metageneration: The metadata generation of this bucket. + Metageneration int64 `json:"metageneration,omitempty,string"` + + // Name: The name of the bucket. + Name string `json:"name,omitempty"` + + // Owner: The owner of the bucket. This will always be the project + // team's owner group. + Owner *BucketOwner `json:"owner,omitempty"` + + // SelfLink: The URI of this bucket. + SelfLink string `json:"selfLink,omitempty"` + + // StorageClass: The bucket's storage class. This defines how objects in + // the bucket will be stored and determines the SLA and the cost of + // storage. Typical values are STANDARD and + // DURABLE_REDUCED_AVAILABILITY. Defaults to STANDARD. See the + // developer's guide for the authoritative list. + StorageClass string `json:"storageClass,omitempty"` + + // TimeCreated: Creation time of the bucket in RFC 3339 format. + TimeCreated string `json:"timeCreated,omitempty"` + + // Versioning: The bucket's versioning configuration. + Versioning *BucketVersioning `json:"versioning,omitempty"` + + // Website: The bucket's website configuration. + Website *BucketWebsite `json:"website,omitempty"` +} + +type BucketCors struct { + // MaxAgeSeconds: The value, in seconds, to return in the + // Access-Control-Max-Age header used in preflight responses. + MaxAgeSeconds int64 `json:"maxAgeSeconds,omitempty"` + + // Method: The list of HTTP methods on which to include CORS response + // headers, e.g. GET, OPTIONS, POST. Note, "*" is permitted in the list + // of methods, and means "any method". + Method []string `json:"method,omitempty"` + + // Origin: The list of Origins eligible to receive CORS response + // headers. Note: "*" is permitted in the list of origins, and means + // "any Origin". + Origin []string `json:"origin,omitempty"` + + // ResponseHeader: The list of HTTP headers other than the simple + // response headers to give permission for the user-agent to share + // across domains. + ResponseHeader []string `json:"responseHeader,omitempty"` +} + +type BucketLifecycle struct { + // Rule: A lifecycle management rule, which is made of an action to take + // and the condition(s) under which the action will be taken. + Rule []*BucketLifecycleRule `json:"rule,omitempty"` +} + +type BucketLifecycleRule struct { + // Action: The action to take. + Action *BucketLifecycleRuleAction `json:"action,omitempty"` + + // Condition: The condition(s) under which the action will be taken. + Condition *BucketLifecycleRuleCondition `json:"condition,omitempty"` +} + +type BucketLifecycleRuleAction struct { + // Type: Type of the action, e.g. Delete. + Type string `json:"type,omitempty"` +} + +type BucketLifecycleRuleCondition struct { + // Age: Age of an object (in days). This condition is satisfied when an + // object reaches the specified age. + Age int64 `json:"age,omitempty"` + + // CreatedBefore: A date in RFC 3339 format with only the date part, + // e.g. "2013-01-15". This condition is satisfied when an object is + // created before midnight of the specified date in UTC. + CreatedBefore string `json:"createdBefore,omitempty"` + + // IsLive: Relevant only for versioned objects. If the value is true, + // this condition matches live objects; if the value is false, it + // matches archived objects. + IsLive bool `json:"isLive,omitempty"` + + // NumNewerVersions: Relevant only for versioned objects. If the value + // is N, this condition is satisfied when there are at least N versions + // (including the live version) newer than this version of the object. + NumNewerVersions int64 `json:"numNewerVersions,omitempty"` +} + +type BucketLogging struct { + // LogBucket: The destination bucket where the current bucket's logs + // should be placed. + LogBucket string `json:"logBucket,omitempty"` + + // LogObjectPrefix: A prefix for log object names. + LogObjectPrefix string `json:"logObjectPrefix,omitempty"` +} + +type BucketOwner struct { + // Entity: The entity, in the form group-groupId. + Entity string `json:"entity,omitempty"` + + // EntityId: The ID for the entity. + EntityId string `json:"entityId,omitempty"` +} + +type BucketVersioning struct { + // Enabled: While set to true, versioning is fully enabled for this + // bucket. + Enabled bool `json:"enabled,omitempty"` +} + +type BucketWebsite struct { + // MainPageSuffix: Behaves as the bucket's directory index where missing + // objects are treated as potential directories. + MainPageSuffix string `json:"mainPageSuffix,omitempty"` + + // NotFoundPage: The custom object to return when a requested resource + // is not found. + NotFoundPage string `json:"notFoundPage,omitempty"` +} + +type BucketAccessControl struct { + // Bucket: The name of the bucket. + Bucket string `json:"bucket,omitempty"` + + // Domain: The domain associated with the entity, if any. + Domain string `json:"domain,omitempty"` + + // Email: The email address associated with the entity, if any. + Email string `json:"email,omitempty"` + + // Entity: The entity holding the permission, in one of the following + // forms: + // - user-userId + // - user-email + // - group-groupId + // - group-email + // + // - domain-domain + // - allUsers + // - allAuthenticatedUsers Examples: + // - + // The user liz@example.com would be user-liz@example.com. + // - The group + // example@googlegroups.com would be group-example@googlegroups.com. + // - + // To refer to all members of the Google Apps for Business domain + // example.com, the entity would be domain-example.com. + Entity string `json:"entity,omitempty"` + + // EntityId: The ID for the entity, if any. + EntityId string `json:"entityId,omitempty"` + + // Etag: HTTP 1.1 Entity tag for the access-control entry. + Etag string `json:"etag,omitempty"` + + // Id: The ID of the access-control entry. + Id string `json:"id,omitempty"` + + // Kind: The kind of item this is. For bucket access control entries, + // this is always storage#bucketAccessControl. + Kind string `json:"kind,omitempty"` + + // Role: The access permission for the entity. Can be READER, WRITER, or + // OWNER. + Role string `json:"role,omitempty"` + + // SelfLink: The link to this access-control entry. + SelfLink string `json:"selfLink,omitempty"` +} + +type BucketAccessControls struct { + // Items: The list of items. + Items []*BucketAccessControl `json:"items,omitempty"` + + // Kind: The kind of item this is. For lists of bucket access control + // entries, this is always storage#bucketAccessControls. + Kind string `json:"kind,omitempty"` +} + +type Buckets struct { + // Items: The list of items. + Items []*Bucket `json:"items,omitempty"` + + // Kind: The kind of item this is. For lists of buckets, this is always + // storage#buckets. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The continuation token, used to page through large + // result sets. Provide this value in a subsequent request to return the + // next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Channel struct { + // Address: The address where notifications are delivered for this + // channel. + Address string `json:"address,omitempty"` + + // Expiration: Date and time of notification channel expiration, + // expressed as a Unix timestamp, in milliseconds. Optional. + Expiration int64 `json:"expiration,omitempty,string"` + + // Id: A UUID or similar unique string that identifies this channel. + Id string `json:"id,omitempty"` + + // Kind: Identifies this as a notification channel used to watch for + // changes to a resource. Value: the fixed string "api#channel". + Kind string `json:"kind,omitempty"` + + // Params: Additional parameters controlling delivery channel behavior. + // Optional. + Params map[string]string `json:"params,omitempty"` + + // Payload: A Boolean value to indicate whether payload is wanted. + // Optional. + Payload bool `json:"payload,omitempty"` + + // ResourceId: An opaque ID that identifies the resource being watched + // on this channel. Stable across different API versions. + ResourceId string `json:"resourceId,omitempty"` + + // ResourceUri: A version-specific identifier for the watched resource. + ResourceUri string `json:"resourceUri,omitempty"` + + // Token: An arbitrary string delivered to the target address with each + // notification delivered over this channel. Optional. + Token string `json:"token,omitempty"` + + // Type: The type of delivery mechanism used for this channel. + Type string `json:"type,omitempty"` +} + +type ComposeRequest struct { + // Destination: Properties of the resulting object + Destination *Object `json:"destination,omitempty"` + + // Kind: The kind of item this is. + Kind string `json:"kind,omitempty"` + + // SourceObjects: The list of source objects that will be concatenated + // into a single object. + SourceObjects []*ComposeRequestSourceObjects `json:"sourceObjects,omitempty"` +} + +type ComposeRequestSourceObjects struct { + // Generation: The generation of this object to use as the source. + Generation int64 `json:"generation,omitempty,string"` + + // Name: The source object's name. The source object's bucket is + // implicitly the destination bucket. + Name string `json:"name,omitempty"` + + // ObjectPreconditions: Conditions that must be met for this operation + // to execute. + ObjectPreconditions *ComposeRequestSourceObjectsObjectPreconditions `json:"objectPreconditions,omitempty"` +} + +type ComposeRequestSourceObjectsObjectPreconditions struct { + // IfGenerationMatch: Only perform the composition if the generation of + // the source object that would be used matches this value. If this + // value and a generation are both specified, they must be the same + // value or the call will fail. + IfGenerationMatch int64 `json:"ifGenerationMatch,omitempty,string"` +} + +type Object struct { + // Acl: Access controls on the object. + Acl []*ObjectAccessControl `json:"acl,omitempty"` + + // Bucket: The bucket containing this object. + Bucket string `json:"bucket,omitempty"` + + // CacheControl: Cache-Control directive for the object data. + CacheControl string `json:"cacheControl,omitempty"` + + // ComponentCount: Number of underlying components that make up this + // object. Components are accumulated by compose operations and are + // limited to a count of 32. + ComponentCount int64 `json:"componentCount,omitempty"` + + // ContentDisposition: Content-Disposition of the object data. + ContentDisposition string `json:"contentDisposition,omitempty"` + + // ContentEncoding: Content-Encoding of the object data. + ContentEncoding string `json:"contentEncoding,omitempty"` + + // ContentLanguage: Content-Language of the object data. + ContentLanguage string `json:"contentLanguage,omitempty"` + + // ContentType: Content-Type of the object data. + ContentType string `json:"contentType,omitempty"` + + // Crc32c: CRC32c checksum, as described in RFC 4960, Appendix B; + // encoded using base64. + Crc32c string `json:"crc32c,omitempty"` + + // Etag: HTTP 1.1 Entity tag for the object. + Etag string `json:"etag,omitempty"` + + // Generation: The content generation of this object. Used for object + // versioning. + Generation int64 `json:"generation,omitempty,string"` + + // Id: The ID of the object. + Id string `json:"id,omitempty"` + + // Kind: The kind of item this is. For objects, this is always + // storage#object. + Kind string `json:"kind,omitempty"` + + // Md5Hash: MD5 hash of the data; encoded using base64. + Md5Hash string `json:"md5Hash,omitempty"` + + // MediaLink: Media download link. + MediaLink string `json:"mediaLink,omitempty"` + + // Metadata: User-provided metadata, in key/value pairs. + Metadata map[string]string `json:"metadata,omitempty"` + + // Metageneration: The generation of the metadata for this object at + // this generation. Used for metadata versioning. Has no meaning outside + // of the context of this generation. + Metageneration int64 `json:"metageneration,omitempty,string"` + + // Name: The name of this object. Required if not specified by URL + // parameter. + Name string `json:"name,omitempty"` + + // Owner: The owner of the object. This will always be the uploader of + // the object. + Owner *ObjectOwner `json:"owner,omitempty"` + + // SelfLink: The link to this object. + SelfLink string `json:"selfLink,omitempty"` + + // Size: Content-Length of the data in bytes. + Size uint64 `json:"size,omitempty,string"` + + // StorageClass: Storage class of the object. + StorageClass string `json:"storageClass,omitempty"` + + // TimeDeleted: Deletion time of the object in RFC 3339 format. Will be + // returned if and only if this version of the object has been deleted. + TimeDeleted string `json:"timeDeleted,omitempty"` + + // Updated: Modification time of the object metadata in RFC 3339 format. + Updated string `json:"updated,omitempty"` +} + +type ObjectOwner struct { + // Entity: The entity, in the form user-userId. + Entity string `json:"entity,omitempty"` + + // EntityId: The ID for the entity. + EntityId string `json:"entityId,omitempty"` +} + +type ObjectAccessControl struct { + // Bucket: The name of the bucket. + Bucket string `json:"bucket,omitempty"` + + // Domain: The domain associated with the entity, if any. + Domain string `json:"domain,omitempty"` + + // Email: The email address associated with the entity, if any. + Email string `json:"email,omitempty"` + + // Entity: The entity holding the permission, in one of the following + // forms: + // - user-userId + // - user-email + // - group-groupId + // - group-email + // + // - domain-domain + // - allUsers + // - allAuthenticatedUsers Examples: + // - + // The user liz@example.com would be user-liz@example.com. + // - The group + // example@googlegroups.com would be group-example@googlegroups.com. + // - + // To refer to all members of the Google Apps for Business domain + // example.com, the entity would be domain-example.com. + Entity string `json:"entity,omitempty"` + + // EntityId: The ID for the entity, if any. + EntityId string `json:"entityId,omitempty"` + + // Etag: HTTP 1.1 Entity tag for the access-control entry. + Etag string `json:"etag,omitempty"` + + // Generation: The content generation of the object. + Generation int64 `json:"generation,omitempty,string"` + + // Id: The ID of the access-control entry. + Id string `json:"id,omitempty"` + + // Kind: The kind of item this is. For object access control entries, + // this is always storage#objectAccessControl. + Kind string `json:"kind,omitempty"` + + // Object: The name of the object. + Object string `json:"object,omitempty"` + + // Role: The access permission for the entity. Can be READER or OWNER. + Role string `json:"role,omitempty"` + + // SelfLink: The link to this access-control entry. + SelfLink string `json:"selfLink,omitempty"` +} + +type ObjectAccessControls struct { + // Items: The list of items. + Items []interface{} `json:"items,omitempty"` + + // Kind: The kind of item this is. For lists of object access control + // entries, this is always storage#objectAccessControls. + Kind string `json:"kind,omitempty"` +} + +type Objects struct { + // Items: The list of items. + Items []*Object `json:"items,omitempty"` + + // Kind: The kind of item this is. For lists of objects, this is always + // storage#objects. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The continuation token, used to page through large + // result sets. Provide this value in a subsequent request to return the + // next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Prefixes: The list of prefixes of objects matching-but-not-listed up + // to and including the requested delimiter. + Prefixes []string `json:"prefixes,omitempty"` +} + +// method id "storage.bucketAccessControls.delete": + +type BucketAccessControlsDeleteCall struct { + s *Service + bucket string + entity string + opt_ map[string]interface{} +} + +// Delete: Permanently deletes the ACL entry for the specified entity on +// the specified bucket. +func (r *BucketAccessControlsService) Delete(bucket string, entity string) *BucketAccessControlsDeleteCall { + c := &BucketAccessControlsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.entity = entity + return c +} + +func (c *BucketAccessControlsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.", + // "httpMethod": "DELETE", + // "id": "storage.bucketAccessControls.delete", + // "parameterOrder": [ + // "bucket", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/acl/{entity}", + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.bucketAccessControls.get": + +type BucketAccessControlsGetCall struct { + s *Service + bucket string + entity string + opt_ map[string]interface{} +} + +// Get: Returns the ACL entry for the specified entity on the specified +// bucket. +func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketAccessControlsGetCall { + c := &BucketAccessControlsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.entity = entity + return c +} + +func (c *BucketAccessControlsGetCall) Do() (*BucketAccessControl, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BucketAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the ACL entry for the specified entity on the specified bucket.", + // "httpMethod": "GET", + // "id": "storage.bucketAccessControls.get", + // "parameterOrder": [ + // "bucket", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/acl/{entity}", + // "response": { + // "$ref": "BucketAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.bucketAccessControls.insert": + +type BucketAccessControlsInsertCall struct { + s *Service + bucket string + bucketaccesscontrol *BucketAccessControl + opt_ map[string]interface{} +} + +// Insert: Creates a new ACL entry on the specified bucket. +func (r *BucketAccessControlsService) Insert(bucket string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsInsertCall { + c := &BucketAccessControlsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.bucketaccesscontrol = bucketaccesscontrol + return c +} + +func (c *BucketAccessControlsInsertCall) Do() (*BucketAccessControl, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BucketAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new ACL entry on the specified bucket.", + // "httpMethod": "POST", + // "id": "storage.bucketAccessControls.insert", + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/acl", + // "request": { + // "$ref": "BucketAccessControl" + // }, + // "response": { + // "$ref": "BucketAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.bucketAccessControls.list": + +type BucketAccessControlsListCall struct { + s *Service + bucket string + opt_ map[string]interface{} +} + +// List: Retrieves ACL entries on the specified bucket. +func (r *BucketAccessControlsService) List(bucket string) *BucketAccessControlsListCall { + c := &BucketAccessControlsListCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + return c +} + +func (c *BucketAccessControlsListCall) Do() (*BucketAccessControls, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BucketAccessControls) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves ACL entries on the specified bucket.", + // "httpMethod": "GET", + // "id": "storage.bucketAccessControls.list", + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/acl", + // "response": { + // "$ref": "BucketAccessControls" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.bucketAccessControls.patch": + +type BucketAccessControlsPatchCall struct { + s *Service + bucket string + entity string + bucketaccesscontrol *BucketAccessControl + opt_ map[string]interface{} +} + +// Patch: Updates an ACL entry on the specified bucket. This method +// supports patch semantics. +func (r *BucketAccessControlsService) Patch(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsPatchCall { + c := &BucketAccessControlsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.entity = entity + c.bucketaccesscontrol = bucketaccesscontrol + return c +} + +func (c *BucketAccessControlsPatchCall) Do() (*BucketAccessControl, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BucketAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an ACL entry on the specified bucket. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "storage.bucketAccessControls.patch", + // "parameterOrder": [ + // "bucket", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/acl/{entity}", + // "request": { + // "$ref": "BucketAccessControl" + // }, + // "response": { + // "$ref": "BucketAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.bucketAccessControls.update": + +type BucketAccessControlsUpdateCall struct { + s *Service + bucket string + entity string + bucketaccesscontrol *BucketAccessControl + opt_ map[string]interface{} +} + +// Update: Updates an ACL entry on the specified bucket. +func (r *BucketAccessControlsService) Update(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsUpdateCall { + c := &BucketAccessControlsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.entity = entity + c.bucketaccesscontrol = bucketaccesscontrol + return c +} + +func (c *BucketAccessControlsUpdateCall) Do() (*BucketAccessControl, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(BucketAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an ACL entry on the specified bucket.", + // "httpMethod": "PUT", + // "id": "storage.bucketAccessControls.update", + // "parameterOrder": [ + // "bucket", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/acl/{entity}", + // "request": { + // "$ref": "BucketAccessControl" + // }, + // "response": { + // "$ref": "BucketAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.buckets.delete": + +type BucketsDeleteCall struct { + s *Service + bucket string + opt_ map[string]interface{} +} + +// Delete: Permanently deletes an empty bucket. +func (r *BucketsService) Delete(bucket string) *BucketsDeleteCall { + c := &BucketsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + return c +} + +// IfMetagenerationMatch sets the optional parameter +// "ifMetagenerationMatch": Makes the return of the bucket metadata +// conditional on whether the bucket's current metageneration matches +// the given value. +func (c *BucketsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsDeleteCall { + c.opt_["ifMetagenerationMatch"] = ifMetagenerationMatch + return c +} + +// IfMetagenerationNotMatch sets the optional parameter +// "ifMetagenerationNotMatch": Makes the return of the bucket metadata +// conditional on whether the bucket's current metageneration does not +// match the given value. +func (c *BucketsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsDeleteCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +func (c *BucketsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["ifMetagenerationMatch"]; ok { + params.Set("ifMetagenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifMetagenerationNotMatch"]; ok { + params.Set("ifMetagenerationNotMatch", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Permanently deletes an empty bucket.", + // "httpMethod": "DELETE", + // "id": "storage.buckets.delete", + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{bucket}", + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "storage.buckets.get": + +type BucketsGetCall struct { + s *Service + bucket string + opt_ map[string]interface{} +} + +// Get: Returns metadata for the specified bucket. +func (r *BucketsService) Get(bucket string) *BucketsGetCall { + c := &BucketsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + return c +} + +// IfMetagenerationMatch sets the optional parameter +// "ifMetagenerationMatch": Makes the return of the bucket metadata +// conditional on whether the bucket's current metageneration matches +// the given value. +func (c *BucketsGetCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsGetCall { + c.opt_["ifMetagenerationMatch"] = ifMetagenerationMatch + return c +} + +// IfMetagenerationNotMatch sets the optional parameter +// "ifMetagenerationNotMatch": Makes the return of the bucket metadata +// conditional on whether the bucket's current metageneration does not +// match the given value. +func (c *BucketsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsGetCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to noAcl. +func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall { + c.opt_["projection"] = projection + return c +} + +func (c *BucketsGetCall) Do() (*Bucket, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["ifMetagenerationMatch"]; ok { + params.Set("ifMetagenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifMetagenerationNotMatch"]; ok { + params.Set("ifMetagenerationNotMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Bucket) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns metadata for the specified bucket.", + // "httpMethod": "GET", + // "id": "storage.buckets.get", + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to noAcl.", + // "enum": [ + // "full", + // "noAcl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit acl and defaultObjectAcl properties." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{bucket}", + // "response": { + // "$ref": "Bucket" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "storage.buckets.insert": + +type BucketsInsertCall struct { + s *Service + projectid string + bucket *Bucket + opt_ map[string]interface{} +} + +// Insert: Creates a new bucket. +func (r *BucketsService) Insert(projectid string, bucket *Bucket) *BucketsInsertCall { + c := &BucketsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.projectid = projectid + c.bucket = bucket + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to noAcl, unless the bucket resource +// specifies acl or defaultObjectAcl properties, when it defaults to +// full. +func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall { + c.opt_["projection"] = projection + return c +} + +func (c *BucketsInsertCall) Do() (*Bucket, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + params.Set("project", fmt.Sprintf("%v", c.projectid)) + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Bucket) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new bucket.", + // "httpMethod": "POST", + // "id": "storage.buckets.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "A valid API project identifier.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.", + // "enum": [ + // "full", + // "noAcl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit acl and defaultObjectAcl properties." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b", + // "request": { + // "$ref": "Bucket" + // }, + // "response": { + // "$ref": "Bucket" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "storage.buckets.list": + +type BucketsListCall struct { + s *Service + projectid string + opt_ map[string]interface{} +} + +// List: Retrieves a list of buckets for a given project. +func (r *BucketsService) List(projectid string) *BucketsListCall { + c := &BucketsListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectid = projectid + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of buckets to return. +func (c *BucketsListCall) MaxResults(maxResults int64) *BucketsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A +// previously-returned page token representing part of the larger set of +// results to view. +func (c *BucketsListCall) PageToken(pageToken string) *BucketsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to noAcl. +func (c *BucketsListCall) Projection(projection string) *BucketsListCall { + c.opt_["projection"] = projection + return c +} + +func (c *BucketsListCall) Do() (*Buckets, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("project", fmt.Sprintf("%v", c.projectid)) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Buckets) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of buckets for a given project.", + // "httpMethod": "GET", + // "id": "storage.buckets.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of buckets to return.", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A previously-returned page token representing part of the larger set of results to view.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "A valid API project identifier.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to noAcl.", + // "enum": [ + // "full", + // "noAcl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit acl and defaultObjectAcl properties." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b", + // "response": { + // "$ref": "Buckets" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "storage.buckets.patch": + +type BucketsPatchCall struct { + s *Service + bucket string + bucket2 *Bucket + opt_ map[string]interface{} +} + +// Patch: Updates a bucket. This method supports patch semantics. +func (r *BucketsService) Patch(bucket string, bucket2 *Bucket) *BucketsPatchCall { + c := &BucketsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.bucket2 = bucket2 + return c +} + +// IfMetagenerationMatch sets the optional parameter +// "ifMetagenerationMatch": Makes the return of the bucket metadata +// conditional on whether the bucket's current metageneration matches +// the given value. +func (c *BucketsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsPatchCall { + c.opt_["ifMetagenerationMatch"] = ifMetagenerationMatch + return c +} + +// IfMetagenerationNotMatch sets the optional parameter +// "ifMetagenerationNotMatch": Makes the return of the bucket metadata +// conditional on whether the bucket's current metageneration does not +// match the given value. +func (c *BucketsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsPatchCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to full. +func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall { + c.opt_["projection"] = projection + return c +} + +func (c *BucketsPatchCall) Do() (*Bucket, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["ifMetagenerationMatch"]; ok { + params.Set("ifMetagenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifMetagenerationNotMatch"]; ok { + params.Set("ifMetagenerationNotMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Bucket) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a bucket. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "storage.buckets.patch", + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to full.", + // "enum": [ + // "full", + // "noAcl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit acl and defaultObjectAcl properties." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{bucket}", + // "request": { + // "$ref": "Bucket" + // }, + // "response": { + // "$ref": "Bucket" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "storage.buckets.update": + +type BucketsUpdateCall struct { + s *Service + bucket string + bucket2 *Bucket + opt_ map[string]interface{} +} + +// Update: Updates a bucket. +func (r *BucketsService) Update(bucket string, bucket2 *Bucket) *BucketsUpdateCall { + c := &BucketsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.bucket2 = bucket2 + return c +} + +// IfMetagenerationMatch sets the optional parameter +// "ifMetagenerationMatch": Makes the return of the bucket metadata +// conditional on whether the bucket's current metageneration matches +// the given value. +func (c *BucketsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsUpdateCall { + c.opt_["ifMetagenerationMatch"] = ifMetagenerationMatch + return c +} + +// IfMetagenerationNotMatch sets the optional parameter +// "ifMetagenerationNotMatch": Makes the return of the bucket metadata +// conditional on whether the bucket's current metageneration does not +// match the given value. +func (c *BucketsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsUpdateCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to full. +func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall { + c.opt_["projection"] = projection + return c +} + +func (c *BucketsUpdateCall) Do() (*Bucket, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["ifMetagenerationMatch"]; ok { + params.Set("ifMetagenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifMetagenerationNotMatch"]; ok { + params.Set("ifMetagenerationNotMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Bucket) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a bucket.", + // "httpMethod": "PUT", + // "id": "storage.buckets.update", + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to full.", + // "enum": [ + // "full", + // "noAcl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit acl and defaultObjectAcl properties." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{bucket}", + // "request": { + // "$ref": "Bucket" + // }, + // "response": { + // "$ref": "Bucket" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "storage.channels.stop": + +type ChannelsStopCall struct { + s *Service + channel *Channel + opt_ map[string]interface{} +} + +// Stop: Stop watching resources through this channel +func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall { + c := &ChannelsStopCall{s: r.s, opt_: make(map[string]interface{})} + c.channel = channel + return c +} + +func (c *ChannelsStopCall) Do() error { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + if err != nil { + return err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Stop watching resources through this channel", + // "httpMethod": "POST", + // "id": "storage.channels.stop", + // "path": "channels/stop", + // "request": { + // "$ref": "Channel", + // "parameterName": "resource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "storage.defaultObjectAccessControls.delete": + +type DefaultObjectAccessControlsDeleteCall struct { + s *Service + bucket string + entity string + opt_ map[string]interface{} +} + +// Delete: Permanently deletes the default object ACL entry for the +// specified entity on the specified bucket. +func (r *DefaultObjectAccessControlsService) Delete(bucket string, entity string) *DefaultObjectAccessControlsDeleteCall { + c := &DefaultObjectAccessControlsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.entity = entity + return c +} + +func (c *DefaultObjectAccessControlsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.", + // "httpMethod": "DELETE", + // "id": "storage.defaultObjectAccessControls.delete", + // "parameterOrder": [ + // "bucket", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/defaultObjectAcl/{entity}", + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.defaultObjectAccessControls.get": + +type DefaultObjectAccessControlsGetCall struct { + s *Service + bucket string + entity string + opt_ map[string]interface{} +} + +// Get: Returns the default object ACL entry for the specified entity on +// the specified bucket. +func (r *DefaultObjectAccessControlsService) Get(bucket string, entity string) *DefaultObjectAccessControlsGetCall { + c := &DefaultObjectAccessControlsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.entity = entity + return c +} + +func (c *DefaultObjectAccessControlsGetCall) Do() (*ObjectAccessControl, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ObjectAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the default object ACL entry for the specified entity on the specified bucket.", + // "httpMethod": "GET", + // "id": "storage.defaultObjectAccessControls.get", + // "parameterOrder": [ + // "bucket", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/defaultObjectAcl/{entity}", + // "response": { + // "$ref": "ObjectAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.defaultObjectAccessControls.insert": + +type DefaultObjectAccessControlsInsertCall struct { + s *Service + bucket string + objectaccesscontrol *ObjectAccessControl + opt_ map[string]interface{} +} + +// Insert: Creates a new default object ACL entry on the specified +// bucket. +func (r *DefaultObjectAccessControlsService) Insert(bucket string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsInsertCall { + c := &DefaultObjectAccessControlsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.objectaccesscontrol = objectaccesscontrol + return c +} + +func (c *DefaultObjectAccessControlsInsertCall) Do() (*ObjectAccessControl, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ObjectAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new default object ACL entry on the specified bucket.", + // "httpMethod": "POST", + // "id": "storage.defaultObjectAccessControls.insert", + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/defaultObjectAcl", + // "request": { + // "$ref": "ObjectAccessControl" + // }, + // "response": { + // "$ref": "ObjectAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.defaultObjectAccessControls.list": + +type DefaultObjectAccessControlsListCall struct { + s *Service + bucket string + opt_ map[string]interface{} +} + +// List: Retrieves default object ACL entries on the specified bucket. +func (r *DefaultObjectAccessControlsService) List(bucket string) *DefaultObjectAccessControlsListCall { + c := &DefaultObjectAccessControlsListCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + return c +} + +// IfMetagenerationMatch sets the optional parameter +// "ifMetagenerationMatch": Makes the operation conditional on whether +// the destination object's current metageneration matches the given +// value. +func (c *DefaultObjectAccessControlsListCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *DefaultObjectAccessControlsListCall { + c.opt_["ifMetagenerationMatch"] = ifMetagenerationMatch + return c +} + +// IfMetagenerationNotMatch sets the optional parameter +// "ifMetagenerationNotMatch": Makes the operation conditional on +// whether the destination object's current metageneration does not +// match the given value. +func (c *DefaultObjectAccessControlsListCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *DefaultObjectAccessControlsListCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +func (c *DefaultObjectAccessControlsListCall) Do() (*ObjectAccessControls, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["ifMetagenerationMatch"]; ok { + params.Set("ifMetagenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifMetagenerationNotMatch"]; ok { + params.Set("ifMetagenerationNotMatch", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ObjectAccessControls) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves default object ACL entries on the specified bucket.", + // "httpMethod": "GET", + // "id": "storage.defaultObjectAccessControls.list", + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{bucket}/defaultObjectAcl", + // "response": { + // "$ref": "ObjectAccessControls" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.defaultObjectAccessControls.patch": + +type DefaultObjectAccessControlsPatchCall struct { + s *Service + bucket string + entity string + objectaccesscontrol *ObjectAccessControl + opt_ map[string]interface{} +} + +// Patch: Updates a default object ACL entry on the specified bucket. +// This method supports patch semantics. +func (r *DefaultObjectAccessControlsService) Patch(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsPatchCall { + c := &DefaultObjectAccessControlsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.entity = entity + c.objectaccesscontrol = objectaccesscontrol + return c +} + +func (c *DefaultObjectAccessControlsPatchCall) Do() (*ObjectAccessControl, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ObjectAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a default object ACL entry on the specified bucket. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "storage.defaultObjectAccessControls.patch", + // "parameterOrder": [ + // "bucket", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/defaultObjectAcl/{entity}", + // "request": { + // "$ref": "ObjectAccessControl" + // }, + // "response": { + // "$ref": "ObjectAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.defaultObjectAccessControls.update": + +type DefaultObjectAccessControlsUpdateCall struct { + s *Service + bucket string + entity string + objectaccesscontrol *ObjectAccessControl + opt_ map[string]interface{} +} + +// Update: Updates a default object ACL entry on the specified bucket. +func (r *DefaultObjectAccessControlsService) Update(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsUpdateCall { + c := &DefaultObjectAccessControlsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.entity = entity + c.objectaccesscontrol = objectaccesscontrol + return c +} + +func (c *DefaultObjectAccessControlsUpdateCall) Do() (*ObjectAccessControl, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ObjectAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a default object ACL entry on the specified bucket.", + // "httpMethod": "PUT", + // "id": "storage.defaultObjectAccessControls.update", + // "parameterOrder": [ + // "bucket", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/defaultObjectAcl/{entity}", + // "request": { + // "$ref": "ObjectAccessControl" + // }, + // "response": { + // "$ref": "ObjectAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.objectAccessControls.delete": + +type ObjectAccessControlsDeleteCall struct { + s *Service + bucket string + object string + entity string + opt_ map[string]interface{} +} + +// Delete: Permanently deletes the ACL entry for the specified entity on +// the specified object. +func (r *ObjectAccessControlsService) Delete(bucket string, object string, entity string) *ObjectAccessControlsDeleteCall { + c := &ObjectAccessControlsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + c.entity = entity + return c +} + +// Generation sets the optional parameter "generation": If present, +// selects a specific revision of this object (as opposed to the latest +// version, the default). +func (c *ObjectAccessControlsDeleteCall) Generation(generation uint64) *ObjectAccessControlsDeleteCall { + c.opt_["generation"] = generation + return c +} + +func (c *ObjectAccessControlsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Permanently deletes the ACL entry for the specified entity on the specified object.", + // "httpMethod": "DELETE", + // "id": "storage.objectAccessControls.delete", + // "parameterOrder": [ + // "bucket", + // "object", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "generation": { + // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}/acl/{entity}", + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.objectAccessControls.get": + +type ObjectAccessControlsGetCall struct { + s *Service + bucket string + object string + entity string + opt_ map[string]interface{} +} + +// Get: Returns the ACL entry for the specified entity on the specified +// object. +func (r *ObjectAccessControlsService) Get(bucket string, object string, entity string) *ObjectAccessControlsGetCall { + c := &ObjectAccessControlsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + c.entity = entity + return c +} + +// Generation sets the optional parameter "generation": If present, +// selects a specific revision of this object (as opposed to the latest +// version, the default). +func (c *ObjectAccessControlsGetCall) Generation(generation uint64) *ObjectAccessControlsGetCall { + c.opt_["generation"] = generation + return c +} + +func (c *ObjectAccessControlsGetCall) Do() (*ObjectAccessControl, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ObjectAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the ACL entry for the specified entity on the specified object.", + // "httpMethod": "GET", + // "id": "storage.objectAccessControls.get", + // "parameterOrder": [ + // "bucket", + // "object", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "generation": { + // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}/acl/{entity}", + // "response": { + // "$ref": "ObjectAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.objectAccessControls.insert": + +type ObjectAccessControlsInsertCall struct { + s *Service + bucket string + object string + objectaccesscontrol *ObjectAccessControl + opt_ map[string]interface{} +} + +// Insert: Creates a new ACL entry on the specified object. +func (r *ObjectAccessControlsService) Insert(bucket string, object string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsInsertCall { + c := &ObjectAccessControlsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + c.objectaccesscontrol = objectaccesscontrol + return c +} + +// Generation sets the optional parameter "generation": If present, +// selects a specific revision of this object (as opposed to the latest +// version, the default). +func (c *ObjectAccessControlsInsertCall) Generation(generation uint64) *ObjectAccessControlsInsertCall { + c.opt_["generation"] = generation + return c +} + +func (c *ObjectAccessControlsInsertCall) Do() (*ObjectAccessControl, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ObjectAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new ACL entry on the specified object.", + // "httpMethod": "POST", + // "id": "storage.objectAccessControls.insert", + // "parameterOrder": [ + // "bucket", + // "object" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "generation": { + // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}/acl", + // "request": { + // "$ref": "ObjectAccessControl" + // }, + // "response": { + // "$ref": "ObjectAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.objectAccessControls.list": + +type ObjectAccessControlsListCall struct { + s *Service + bucket string + object string + opt_ map[string]interface{} +} + +// List: Retrieves ACL entries on the specified object. +func (r *ObjectAccessControlsService) List(bucket string, object string) *ObjectAccessControlsListCall { + c := &ObjectAccessControlsListCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + return c +} + +// Generation sets the optional parameter "generation": If present, +// selects a specific revision of this object (as opposed to the latest +// version, the default). +func (c *ObjectAccessControlsListCall) Generation(generation uint64) *ObjectAccessControlsListCall { + c.opt_["generation"] = generation + return c +} + +func (c *ObjectAccessControlsListCall) Do() (*ObjectAccessControls, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ObjectAccessControls) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves ACL entries on the specified object.", + // "httpMethod": "GET", + // "id": "storage.objectAccessControls.list", + // "parameterOrder": [ + // "bucket", + // "object" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "generation": { + // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}/acl", + // "response": { + // "$ref": "ObjectAccessControls" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.objectAccessControls.patch": + +type ObjectAccessControlsPatchCall struct { + s *Service + bucket string + object string + entity string + objectaccesscontrol *ObjectAccessControl + opt_ map[string]interface{} +} + +// Patch: Updates an ACL entry on the specified object. This method +// supports patch semantics. +func (r *ObjectAccessControlsService) Patch(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsPatchCall { + c := &ObjectAccessControlsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + c.entity = entity + c.objectaccesscontrol = objectaccesscontrol + return c +} + +// Generation sets the optional parameter "generation": If present, +// selects a specific revision of this object (as opposed to the latest +// version, the default). +func (c *ObjectAccessControlsPatchCall) Generation(generation uint64) *ObjectAccessControlsPatchCall { + c.opt_["generation"] = generation + return c +} + +func (c *ObjectAccessControlsPatchCall) Do() (*ObjectAccessControl, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ObjectAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an ACL entry on the specified object. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "storage.objectAccessControls.patch", + // "parameterOrder": [ + // "bucket", + // "object", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "generation": { + // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}/acl/{entity}", + // "request": { + // "$ref": "ObjectAccessControl" + // }, + // "response": { + // "$ref": "ObjectAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.objectAccessControls.update": + +type ObjectAccessControlsUpdateCall struct { + s *Service + bucket string + object string + entity string + objectaccesscontrol *ObjectAccessControl + opt_ map[string]interface{} +} + +// Update: Updates an ACL entry on the specified object. +func (r *ObjectAccessControlsService) Update(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsUpdateCall { + c := &ObjectAccessControlsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + c.entity = entity + c.objectaccesscontrol = objectaccesscontrol + return c +} + +// Generation sets the optional parameter "generation": If present, +// selects a specific revision of this object (as opposed to the latest +// version, the default). +func (c *ObjectAccessControlsUpdateCall) Generation(generation uint64) *ObjectAccessControlsUpdateCall { + c.opt_["generation"] = generation + return c +} + +func (c *ObjectAccessControlsUpdateCall) Do() (*ObjectAccessControl, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{entity}", url.QueryEscape(c.entity), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(ObjectAccessControl) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an ACL entry on the specified object.", + // "httpMethod": "PUT", + // "id": "storage.objectAccessControls.update", + // "parameterOrder": [ + // "bucket", + // "object", + // "entity" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of a bucket.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entity": { + // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "generation": { + // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}/acl/{entity}", + // "request": { + // "$ref": "ObjectAccessControl" + // }, + // "response": { + // "$ref": "ObjectAccessControl" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control" + // ] + // } + +} + +// method id "storage.objects.compose": + +type ObjectsComposeCall struct { + s *Service + destinationBucket string + destinationObject string + composerequest *ComposeRequest + opt_ map[string]interface{} +} + +// Compose: Concatenates a list of existing objects into a new object in +// the same bucket. +func (r *ObjectsService) Compose(destinationBucket string, destinationObject string, composerequest *ComposeRequest) *ObjectsComposeCall { + c := &ObjectsComposeCall{s: r.s, opt_: make(map[string]interface{})} + c.destinationBucket = destinationBucket + c.destinationObject = destinationObject + c.composerequest = composerequest + return c +} + +// IfGenerationMatch sets the optional parameter "ifGenerationMatch": +// Makes the operation conditional on whether the object's current +// generation matches the given value. +func (c *ObjectsComposeCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsComposeCall { + c.opt_["ifGenerationMatch"] = ifGenerationMatch + return c +} + +// IfMetagenerationMatch sets the optional parameter +// "ifMetagenerationMatch": Makes the operation conditional on whether +// the object's current metageneration matches the given value. +func (c *ObjectsComposeCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsComposeCall { + c.opt_["ifMetagenerationMatch"] = ifMetagenerationMatch + return c +} + +func (c *ObjectsComposeCall) Do() (*Object, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.composerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["ifGenerationMatch"]; ok { + params.Set("ifGenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifMetagenerationMatch"]; ok { + params.Set("ifMetagenerationMatch", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{destinationBucket}/o/{destinationObject}/compose") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{destinationBucket}", url.QueryEscape(c.destinationBucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{destinationObject}", url.QueryEscape(c.destinationObject), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Object) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Concatenates a list of existing objects into a new object in the same bucket.", + // "httpMethod": "POST", + // "id": "storage.objects.compose", + // "parameterOrder": [ + // "destinationBucket", + // "destinationObject" + // ], + // "parameters": { + // "destinationBucket": { + // "description": "Name of the bucket in which to store the new object.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "destinationObject": { + // "description": "Name of the new object.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ifGenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{destinationBucket}/o/{destinationObject}/compose", + // "request": { + // "$ref": "ComposeRequest" + // }, + // "response": { + // "$ref": "Object" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "storage.objects.copy": + +type ObjectsCopyCall struct { + s *Service + sourceBucket string + sourceObject string + destinationBucket string + destinationObject string + object *Object + opt_ map[string]interface{} +} + +// Copy: Copies an object to a destination in the same location. +// Optionally overrides metadata. +func (r *ObjectsService) Copy(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsCopyCall { + c := &ObjectsCopyCall{s: r.s, opt_: make(map[string]interface{})} + c.sourceBucket = sourceBucket + c.sourceObject = sourceObject + c.destinationBucket = destinationBucket + c.destinationObject = destinationObject + c.object = object + return c +} + +// IfGenerationMatch sets the optional parameter "ifGenerationMatch": +// Makes the operation conditional on whether the destination object's +// current generation matches the given value. +func (c *ObjectsCopyCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsCopyCall { + c.opt_["ifGenerationMatch"] = ifGenerationMatch + return c +} + +// IfGenerationNotMatch sets the optional parameter +// "ifGenerationNotMatch": Makes the operation conditional on whether +// the destination object's current generation does not match the given +// value. +func (c *ObjectsCopyCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsCopyCall { + c.opt_["ifGenerationNotMatch"] = ifGenerationNotMatch + return c +} + +// IfMetagenerationMatch sets the optional parameter +// "ifMetagenerationMatch": Makes the operation conditional on whether +// the destination object's current metageneration matches the given +// value. +func (c *ObjectsCopyCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsCopyCall { + c.opt_["ifMetagenerationMatch"] = ifMetagenerationMatch + return c +} + +// IfMetagenerationNotMatch sets the optional parameter +// "ifMetagenerationNotMatch": Makes the operation conditional on +// whether the destination object's current metageneration does not +// match the given value. +func (c *ObjectsCopyCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsCopyCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +// IfSourceGenerationMatch sets the optional parameter +// "ifSourceGenerationMatch": Makes the operation conditional on whether +// the source object's generation matches the given value. +func (c *ObjectsCopyCall) IfSourceGenerationMatch(ifSourceGenerationMatch uint64) *ObjectsCopyCall { + c.opt_["ifSourceGenerationMatch"] = ifSourceGenerationMatch + return c +} + +// IfSourceGenerationNotMatch sets the optional parameter +// "ifSourceGenerationNotMatch": Makes the operation conditional on +// whether the source object's generation does not match the given +// value. +func (c *ObjectsCopyCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch uint64) *ObjectsCopyCall { + c.opt_["ifSourceGenerationNotMatch"] = ifSourceGenerationNotMatch + return c +} + +// IfSourceMetagenerationMatch sets the optional parameter +// "ifSourceMetagenerationMatch": Makes the operation conditional on +// whether the source object's current metageneration matches the given +// value. +func (c *ObjectsCopyCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch uint64) *ObjectsCopyCall { + c.opt_["ifSourceMetagenerationMatch"] = ifSourceMetagenerationMatch + return c +} + +// IfSourceMetagenerationNotMatch sets the optional parameter +// "ifSourceMetagenerationNotMatch": Makes the operation conditional on +// whether the source object's current metageneration does not match the +// given value. +func (c *ObjectsCopyCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch uint64) *ObjectsCopyCall { + c.opt_["ifSourceMetagenerationNotMatch"] = ifSourceMetagenerationNotMatch + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to noAcl, unless the object resource +// specifies the acl property, when it defaults to full. +func (c *ObjectsCopyCall) Projection(projection string) *ObjectsCopyCall { + c.opt_["projection"] = projection + return c +} + +// SourceGeneration sets the optional parameter "sourceGeneration": If +// present, selects a specific revision of the source object (as opposed +// to the latest version, the default). +func (c *ObjectsCopyCall) SourceGeneration(sourceGeneration uint64) *ObjectsCopyCall { + c.opt_["sourceGeneration"] = sourceGeneration + return c +} + +func (c *ObjectsCopyCall) Do() (*Object, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.object) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["ifGenerationMatch"]; ok { + params.Set("ifGenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifGenerationNotMatch"]; ok { + params.Set("ifGenerationNotMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifMetagenerationMatch"]; ok { + params.Set("ifMetagenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifMetagenerationNotMatch"]; ok { + params.Set("ifMetagenerationNotMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifSourceGenerationMatch"]; ok { + params.Set("ifSourceGenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifSourceGenerationNotMatch"]; ok { + params.Set("ifSourceGenerationNotMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifSourceMetagenerationMatch"]; ok { + params.Set("ifSourceMetagenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifSourceMetagenerationNotMatch"]; ok { + params.Set("ifSourceMetagenerationNotMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sourceGeneration"]; ok { + params.Set("sourceGeneration", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{sourceBucket}", url.QueryEscape(c.sourceBucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{sourceObject}", url.QueryEscape(c.sourceObject), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{destinationBucket}", url.QueryEscape(c.destinationBucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{destinationObject}", url.QueryEscape(c.destinationObject), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Object) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Copies an object to a destination in the same location. Optionally overrides metadata.", + // "httpMethod": "POST", + // "id": "storage.objects.copy", + // "parameterOrder": [ + // "sourceBucket", + // "sourceObject", + // "destinationBucket", + // "destinationObject" + // ], + // "parameters": { + // "destinationBucket": { + // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "destinationObject": { + // "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ifGenerationMatch": { + // "description": "Makes the operation conditional on whether the destination object's current generation matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationNotMatch": { + // "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifSourceGenerationMatch": { + // "description": "Makes the operation conditional on whether the source object's generation matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifSourceGenerationNotMatch": { + // "description": "Makes the operation conditional on whether the source object's generation does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifSourceMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifSourceMetagenerationNotMatch": { + // "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", + // "enum": [ + // "full", + // "noAcl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit the acl property." + // ], + // "location": "query", + // "type": "string" + // }, + // "sourceBucket": { + // "description": "Name of the bucket in which to find the source object.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sourceGeneration": { + // "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "sourceObject": { + // "description": "Name of the source object.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}", + // "request": { + // "$ref": "Object" + // }, + // "response": { + // "$ref": "Object" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "storage.objects.delete": + +type ObjectsDeleteCall struct { + s *Service + bucket string + object string + opt_ map[string]interface{} +} + +// Delete: Deletes data blobs and associated metadata. Deletions are +// permanent if versioning is not enabled for the bucket, or if the +// generation parameter is used. +func (r *ObjectsService) Delete(bucket string, object string) *ObjectsDeleteCall { + c := &ObjectsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + return c +} + +// Generation sets the optional parameter "generation": If present, +// permanently deletes a specific revision of this object (as opposed to +// the latest version, the default). +func (c *ObjectsDeleteCall) Generation(generation uint64) *ObjectsDeleteCall { + c.opt_["generation"] = generation + return c +} + +// IfGenerationMatch sets the optional parameter "ifGenerationMatch": +// Makes the operation conditional on whether the object's current +// generation matches the given value. +func (c *ObjectsDeleteCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsDeleteCall { + c.opt_["ifGenerationMatch"] = ifGenerationMatch + return c +} + +// IfGenerationNotMatch sets the optional parameter +// "ifGenerationNotMatch": Makes the operation conditional on whether +// the object's current generation does not match the given value. +func (c *ObjectsDeleteCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsDeleteCall { + c.opt_["ifGenerationNotMatch"] = ifGenerationNotMatch + return c +} + +// IfMetagenerationMatch sets the optional parameter +// "ifMetagenerationMatch": Makes the operation conditional on whether +// the object's current metageneration matches the given value. +func (c *ObjectsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsDeleteCall { + c.opt_["ifMetagenerationMatch"] = ifMetagenerationMatch + return c +} + +// IfMetagenerationNotMatch sets the optional parameter +// "ifMetagenerationNotMatch": Makes the operation conditional on +// whether the object's current metageneration does not match the given +// value. +func (c *ObjectsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsDeleteCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +func (c *ObjectsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifGenerationMatch"]; ok { + params.Set("ifGenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifGenerationNotMatch"]; ok { + params.Set("ifGenerationNotMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifMetagenerationMatch"]; ok { + params.Set("ifMetagenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifMetagenerationNotMatch"]; ok { + params.Set("ifMetagenerationNotMatch", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes data blobs and associated metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.", + // "httpMethod": "DELETE", + // "id": "storage.objects.delete", + // "parameterOrder": [ + // "bucket", + // "object" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of the bucket in which the object resides.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "generation": { + // "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}", + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "storage.objects.get": + +type ObjectsGetCall struct { + s *Service + bucket string + object string + opt_ map[string]interface{} +} + +// Get: Retrieves objects or their associated metadata. +func (r *ObjectsService) Get(bucket string, object string) *ObjectsGetCall { + c := &ObjectsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + return c +} + +// Generation sets the optional parameter "generation": If present, +// selects a specific revision of this object (as opposed to the latest +// version, the default). +func (c *ObjectsGetCall) Generation(generation uint64) *ObjectsGetCall { + c.opt_["generation"] = generation + return c +} + +// IfGenerationMatch sets the optional parameter "ifGenerationMatch": +// Makes the operation conditional on whether the object's generation +// matches the given value. +func (c *ObjectsGetCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsGetCall { + c.opt_["ifGenerationMatch"] = ifGenerationMatch + return c +} + +// IfGenerationNotMatch sets the optional parameter +// "ifGenerationNotMatch": Makes the operation conditional on whether +// the object's generation does not match the given value. +func (c *ObjectsGetCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsGetCall { + c.opt_["ifGenerationNotMatch"] = ifGenerationNotMatch + return c +} + +// IfMetagenerationMatch sets the optional parameter +// "ifMetagenerationMatch": Makes the operation conditional on whether +// the object's current metageneration matches the given value. +func (c *ObjectsGetCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsGetCall { + c.opt_["ifMetagenerationMatch"] = ifMetagenerationMatch + return c +} + +// IfMetagenerationNotMatch sets the optional parameter +// "ifMetagenerationNotMatch": Makes the operation conditional on +// whether the object's current metageneration does not match the given +// value. +func (c *ObjectsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsGetCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to noAcl. +func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall { + c.opt_["projection"] = projection + return c +} + +func (c *ObjectsGetCall) Do() (*Object, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifGenerationMatch"]; ok { + params.Set("ifGenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifGenerationNotMatch"]; ok { + params.Set("ifGenerationNotMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifMetagenerationMatch"]; ok { + params.Set("ifMetagenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifMetagenerationNotMatch"]; ok { + params.Set("ifMetagenerationNotMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Object) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves objects or their associated metadata.", + // "httpMethod": "GET", + // "id": "storage.objects.get", + // "parameterOrder": [ + // "bucket", + // "object" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of the bucket in which the object resides.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "generation": { + // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationMatch": { + // "description": "Makes the operation conditional on whether the object's generation matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's generation does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to noAcl.", + // "enum": [ + // "full", + // "noAcl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit the acl property." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}", + // "response": { + // "$ref": "Object" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "storage.objects.insert": + +type ObjectsInsertCall struct { + s *Service + bucket string + object *Object + opt_ map[string]interface{} + media_ io.Reader +} + +// Insert: Stores new data blobs and associated metadata. +func (r *ObjectsService) Insert(bucket string, object *Object) *ObjectsInsertCall { + c := &ObjectsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + return c +} + +// IfGenerationMatch sets the optional parameter "ifGenerationMatch": +// Makes the operation conditional on whether the object's current +// generation matches the given value. +func (c *ObjectsInsertCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsInsertCall { + c.opt_["ifGenerationMatch"] = ifGenerationMatch + return c +} + +// IfGenerationNotMatch sets the optional parameter +// "ifGenerationNotMatch": Makes the operation conditional on whether +// the object's current generation does not match the given value. +func (c *ObjectsInsertCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsInsertCall { + c.opt_["ifGenerationNotMatch"] = ifGenerationNotMatch + return c +} + +// IfMetagenerationMatch sets the optional parameter +// "ifMetagenerationMatch": Makes the operation conditional on whether +// the object's current metageneration matches the given value. +func (c *ObjectsInsertCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsInsertCall { + c.opt_["ifMetagenerationMatch"] = ifMetagenerationMatch + return c +} + +// IfMetagenerationNotMatch sets the optional parameter +// "ifMetagenerationNotMatch": Makes the operation conditional on +// whether the object's current metageneration does not match the given +// value. +func (c *ObjectsInsertCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsInsertCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +// Name sets the optional parameter "name": Name of the object. Required +// when the object metadata is not otherwise provided. Overrides the +// object metadata's name value, if any. +func (c *ObjectsInsertCall) Name(name string) *ObjectsInsertCall { + c.opt_["name"] = name + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to noAcl, unless the object resource +// specifies the acl property, when it defaults to full. +func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall { + c.opt_["projection"] = projection + return c +} +func (c *ObjectsInsertCall) Media(r io.Reader) *ObjectsInsertCall { + c.media_ = r + return c +} + +func (c *ObjectsInsertCall) Do() (*Object, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.object) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["ifGenerationMatch"]; ok { + params.Set("ifGenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifGenerationNotMatch"]; ok { + params.Set("ifGenerationNotMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifMetagenerationMatch"]; ok { + params.Set("ifMetagenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifMetagenerationNotMatch"]; ok { + params.Set("ifMetagenerationNotMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["name"]; ok { + params.Set("name", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o") + if c.media_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", "multipart") + } + urls += "?" + params.Encode() + contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + if hasMedia_ { + req.ContentLength = contentLength_ + } + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Object) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Stores new data blobs and associated metadata.", + // "httpMethod": "POST", + // "id": "storage.objects.insert", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/storage/v1beta2/b/{bucket}/o" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/storage/v1beta2/b/{bucket}/o" + // } + // } + // }, + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ifGenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.", + // "location": "query", + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", + // "enum": [ + // "full", + // "noAcl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit the acl property." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o", + // "request": { + // "$ref": "Object" + // }, + // "response": { + // "$ref": "Object" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ], + // "supportsMediaDownload": true, + // "supportsMediaUpload": true + // } + +} + +// method id "storage.objects.list": + +type ObjectsListCall struct { + s *Service + bucket string + opt_ map[string]interface{} +} + +// List: Retrieves a list of objects matching the criteria. +func (r *ObjectsService) List(bucket string) *ObjectsListCall { + c := &ObjectsListCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + return c +} + +// Delimiter sets the optional parameter "delimiter": Returns results in +// a directory-like mode. items will contain only objects whose names, +// aside from the prefix, do not contain delimiter. Objects whose names, +// aside from the prefix, contain delimiter will have their name, +// truncated after the delimiter, returned in prefixes. Duplicate +// prefixes are omitted. +func (c *ObjectsListCall) Delimiter(delimiter string) *ObjectsListCall { + c.opt_["delimiter"] = delimiter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of items plus prefixes to return. As duplicate prefixes are omitted, +// fewer total results may be returned than requested. +func (c *ObjectsListCall) MaxResults(maxResults int64) *ObjectsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A +// previously-returned page token representing part of the larger set of +// results to view. +func (c *ObjectsListCall) PageToken(pageToken string) *ObjectsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Prefix sets the optional parameter "prefix": Filter results to +// objects whose names begin with this prefix. +func (c *ObjectsListCall) Prefix(prefix string) *ObjectsListCall { + c.opt_["prefix"] = prefix + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to noAcl. +func (c *ObjectsListCall) Projection(projection string) *ObjectsListCall { + c.opt_["projection"] = projection + return c +} + +// Versions sets the optional parameter "versions": If true, lists all +// versions of a file as distinct results. +func (c *ObjectsListCall) Versions(versions bool) *ObjectsListCall { + c.opt_["versions"] = versions + return c +} + +func (c *ObjectsListCall) Do() (*Objects, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["delimiter"]; ok { + params.Set("delimiter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["prefix"]; ok { + params.Set("prefix", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["versions"]; ok { + params.Set("versions", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Objects) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of objects matching the criteria.", + // "httpMethod": "GET", + // "id": "storage.objects.list", + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of the bucket in which to look for objects.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "delimiter": { + // "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested.", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A previously-returned page token representing part of the larger set of results to view.", + // "location": "query", + // "type": "string" + // }, + // "prefix": { + // "description": "Filter results to objects whose names begin with this prefix.", + // "location": "query", + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to noAcl.", + // "enum": [ + // "full", + // "noAcl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit the acl property." + // ], + // "location": "query", + // "type": "string" + // }, + // "versions": { + // "description": "If true, lists all versions of a file as distinct results.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "b/{bucket}/o", + // "response": { + // "$ref": "Objects" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ], + // "supportsSubscription": true + // } + +} + +// method id "storage.objects.patch": + +type ObjectsPatchCall struct { + s *Service + bucket string + object string + object2 *Object + opt_ map[string]interface{} +} + +// Patch: Updates a data blob's associated metadata. This method +// supports patch semantics. +func (r *ObjectsService) Patch(bucket string, object string, object2 *Object) *ObjectsPatchCall { + c := &ObjectsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + c.object2 = object2 + return c +} + +// Generation sets the optional parameter "generation": If present, +// selects a specific revision of this object (as opposed to the latest +// version, the default). +func (c *ObjectsPatchCall) Generation(generation uint64) *ObjectsPatchCall { + c.opt_["generation"] = generation + return c +} + +// IfGenerationMatch sets the optional parameter "ifGenerationMatch": +// Makes the operation conditional on whether the object's current +// generation matches the given value. +func (c *ObjectsPatchCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsPatchCall { + c.opt_["ifGenerationMatch"] = ifGenerationMatch + return c +} + +// IfGenerationNotMatch sets the optional parameter +// "ifGenerationNotMatch": Makes the operation conditional on whether +// the object's current generation does not match the given value. +func (c *ObjectsPatchCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsPatchCall { + c.opt_["ifGenerationNotMatch"] = ifGenerationNotMatch + return c +} + +// IfMetagenerationMatch sets the optional parameter +// "ifMetagenerationMatch": Makes the operation conditional on whether +// the object's current metageneration matches the given value. +func (c *ObjectsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsPatchCall { + c.opt_["ifMetagenerationMatch"] = ifMetagenerationMatch + return c +} + +// IfMetagenerationNotMatch sets the optional parameter +// "ifMetagenerationNotMatch": Makes the operation conditional on +// whether the object's current metageneration does not match the given +// value. +func (c *ObjectsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsPatchCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to full. +func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall { + c.opt_["projection"] = projection + return c +} + +func (c *ObjectsPatchCall) Do() (*Object, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifGenerationMatch"]; ok { + params.Set("ifGenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifGenerationNotMatch"]; ok { + params.Set("ifGenerationNotMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifMetagenerationMatch"]; ok { + params.Set("ifMetagenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifMetagenerationNotMatch"]; ok { + params.Set("ifMetagenerationNotMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Object) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a data blob's associated metadata. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "storage.objects.patch", + // "parameterOrder": [ + // "bucket", + // "object" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of the bucket in which the object resides.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "generation": { + // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to full.", + // "enum": [ + // "full", + // "noAcl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit the acl property." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}", + // "request": { + // "$ref": "Object" + // }, + // "response": { + // "$ref": "Object" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "storage.objects.update": + +type ObjectsUpdateCall struct { + s *Service + bucket string + object string + object2 *Object + opt_ map[string]interface{} +} + +// Update: Updates a data blob's associated metadata. +func (r *ObjectsService) Update(bucket string, object string, object2 *Object) *ObjectsUpdateCall { + c := &ObjectsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.object = object + c.object2 = object2 + return c +} + +// Generation sets the optional parameter "generation": If present, +// selects a specific revision of this object (as opposed to the latest +// version, the default). +func (c *ObjectsUpdateCall) Generation(generation uint64) *ObjectsUpdateCall { + c.opt_["generation"] = generation + return c +} + +// IfGenerationMatch sets the optional parameter "ifGenerationMatch": +// Makes the operation conditional on whether the object's current +// generation matches the given value. +func (c *ObjectsUpdateCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsUpdateCall { + c.opt_["ifGenerationMatch"] = ifGenerationMatch + return c +} + +// IfGenerationNotMatch sets the optional parameter +// "ifGenerationNotMatch": Makes the operation conditional on whether +// the object's current generation does not match the given value. +func (c *ObjectsUpdateCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsUpdateCall { + c.opt_["ifGenerationNotMatch"] = ifGenerationNotMatch + return c +} + +// IfMetagenerationMatch sets the optional parameter +// "ifMetagenerationMatch": Makes the operation conditional on whether +// the object's current metageneration matches the given value. +func (c *ObjectsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsUpdateCall { + c.opt_["ifMetagenerationMatch"] = ifMetagenerationMatch + return c +} + +// IfMetagenerationNotMatch sets the optional parameter +// "ifMetagenerationNotMatch": Makes the operation conditional on +// whether the object's current metageneration does not match the given +// value. +func (c *ObjectsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsUpdateCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to full. +func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall { + c.opt_["projection"] = projection + return c +} + +func (c *ObjectsUpdateCall) Do() (*Object, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifGenerationMatch"]; ok { + params.Set("ifGenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifGenerationNotMatch"]; ok { + params.Set("ifGenerationNotMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifMetagenerationMatch"]; ok { + params.Set("ifMetagenerationMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ifMetagenerationNotMatch"]; ok { + params.Set("ifMetagenerationNotMatch", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{object}", url.QueryEscape(c.object), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Object) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a data blob's associated metadata.", + // "httpMethod": "PUT", + // "id": "storage.objects.update", + // "parameterOrder": [ + // "bucket", + // "object" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of the bucket in which the object resides.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "generation": { + // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to full.", + // "enum": [ + // "full", + // "noAcl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit the acl property." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}", + // "request": { + // "$ref": "Object" + // }, + // "response": { + // "$ref": "Object" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "storage.objects.watchAll": + +type ObjectsWatchAllCall struct { + s *Service + bucket string + channel *Channel + opt_ map[string]interface{} +} + +// WatchAll: Watch for changes on all objects in a bucket. +func (r *ObjectsService) WatchAll(bucket string, channel *Channel) *ObjectsWatchAllCall { + c := &ObjectsWatchAllCall{s: r.s, opt_: make(map[string]interface{})} + c.bucket = bucket + c.channel = channel + return c +} + +// Delimiter sets the optional parameter "delimiter": Returns results in +// a directory-like mode. items will contain only objects whose names, +// aside from the prefix, do not contain delimiter. Objects whose names, +// aside from the prefix, contain delimiter will have their name, +// truncated after the delimiter, returned in prefixes. Duplicate +// prefixes are omitted. +func (c *ObjectsWatchAllCall) Delimiter(delimiter string) *ObjectsWatchAllCall { + c.opt_["delimiter"] = delimiter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of items plus prefixes to return. As duplicate prefixes are omitted, +// fewer total results may be returned than requested. +func (c *ObjectsWatchAllCall) MaxResults(maxResults int64) *ObjectsWatchAllCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": A +// previously-returned page token representing part of the larger set of +// results to view. +func (c *ObjectsWatchAllCall) PageToken(pageToken string) *ObjectsWatchAllCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Prefix sets the optional parameter "prefix": Filter results to +// objects whose names begin with this prefix. +func (c *ObjectsWatchAllCall) Prefix(prefix string) *ObjectsWatchAllCall { + c.opt_["prefix"] = prefix + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to noAcl. +func (c *ObjectsWatchAllCall) Projection(projection string) *ObjectsWatchAllCall { + c.opt_["projection"] = projection + return c +} + +// Versions sets the optional parameter "versions": If true, lists all +// versions of a file as distinct results. +func (c *ObjectsWatchAllCall) Versions(versions bool) *ObjectsWatchAllCall { + c.opt_["versions"] = versions + return c +} + +func (c *ObjectsWatchAllCall) Do() (*Channel, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["delimiter"]; ok { + params.Set("delimiter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["prefix"]; ok { + params.Set("prefix", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["versions"]; ok { + params.Set("versions", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/watch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{bucket}", url.QueryEscape(c.bucket), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Channel) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Watch for changes on all objects in a bucket.", + // "httpMethod": "POST", + // "id": "storage.objects.watchAll", + // "parameterOrder": [ + // "bucket" + // ], + // "parameters": { + // "bucket": { + // "description": "Name of the bucket in which to look for objects.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "delimiter": { + // "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested.", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A previously-returned page token representing part of the larger set of results to view.", + // "location": "query", + // "type": "string" + // }, + // "prefix": { + // "description": "Filter results to objects whose names begin with this prefix.", + // "location": "query", + // "type": "string" + // }, + // "projection": { + // "description": "Set of properties to return. Defaults to noAcl.", + // "enum": [ + // "full", + // "noAcl" + // ], + // "enumDescriptions": [ + // "Include all properties.", + // "Omit the acl property." + // ], + // "location": "query", + // "type": "string" + // }, + // "versions": { + // "description": "If true, lists all versions of a file as distinct results.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "b/{bucket}/o/watch", + // "request": { + // "$ref": "Channel", + // "parameterName": "resource" + // }, + // "response": { + // "$ref": "Channel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ], + // "supportsSubscription": true + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/taskqueue/v1beta1/taskqueue-api.json b/third_party/src/code.google.com/p/google-api-go-client/taskqueue/v1beta1/taskqueue-api.json new file mode 100644 index 0000000000000..417944b388e09 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/taskqueue/v1beta1/taskqueue-api.json @@ -0,0 +1,421 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/fu8k3FukjBIEHIV-twy8lOq39to\"", + "discoveryVersion": "v1", + "id": "taskqueue:v1beta1", + "name": "taskqueue", + "version": "v1beta1", + "title": "TaskQueue API", + "description": "Lets you access a Google App Engine Pull Task Queue over REST.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/app_engine-16.png", + "x32": "http://www.google.com/images/icons/product/app_engine-32.png" + }, + "documentationLink": "https://developers.google.com/appengine/docs/python/taskqueue/rest", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/taskqueue/v1beta1/projects/", + "basePath": "/taskqueue/v1beta1/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "taskqueue/v1beta1/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/taskqueue": { + "description": "Manage your Tasks and Taskqueues" + }, + "https://www.googleapis.com/auth/taskqueue.consumer": { + "description": "Consume Tasks from your Taskqueues" + } + } + } + }, + "schemas": { + "Task": { + "id": "Task", + "type": "object", + "properties": { + "enqueueTimestamp": { + "type": "string", + "description": "Time (in seconds since the epoch) at which the task was enqueued.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "Name of the task." + }, + "kind": { + "type": "string", + "description": "The kind of object returned, in this case set to task.", + "default": "taskqueues#task" + }, + "leaseTimestamp": { + "type": "string", + "description": "Time (in seconds since the epoch) at which the task lease will expire. This value is 0 if the task isnt currently leased out to a worker.", + "format": "int64" + }, + "payloadBase64": { + "type": "string", + "description": "A bag of bytes which is the task payload. The payload on the JSON side is always Base64 encoded." + }, + "queueName": { + "type": "string", + "description": "Name of the queue that the task is in." + } + } + }, + "TaskQueue": { + "id": "TaskQueue", + "type": "object", + "properties": { + "acl": { + "type": "object", + "description": "ACLs that are applicable to this TaskQueue object.", + "properties": { + "adminEmails": { + "type": "array", + "description": "Email addresses of users who are \"admins\" of the TaskQueue. This means they can control the queue, eg set ACLs for the queue.", + "items": { + "type": "string" + } + }, + "consumerEmails": { + "type": "array", + "description": "Email addresses of users who can \"consume\" tasks from the TaskQueue. This means they can Dequeue and Delete tasks from the queue.", + "items": { + "type": "string" + } + }, + "producerEmails": { + "type": "array", + "description": "Email addresses of users who can \"produce\" tasks into the TaskQueue. This means they can Insert tasks into the queue.", + "items": { + "type": "string" + } + } + } + }, + "id": { + "type": "string", + "description": "Name of the taskqueue." + }, + "kind": { + "type": "string", + "description": "The kind of REST object returned, in this case taskqueue.", + "default": "taskqueues#taskqueue" + }, + "maxLeases": { + "type": "integer", + "description": "The number of times we should lease out tasks before giving up on them. If unset we lease them out forever until a worker deletes the task.", + "format": "int32" + }, + "stats": { + "type": "object", + "description": "Statistics for the TaskQueue object in question.", + "properties": { + "leasedLastHour": { + "type": "string", + "description": "Number of tasks leased in the last hour.", + "format": "int64" + }, + "leasedLastMinute": { + "type": "string", + "description": "Number of tasks leased in the last minute.", + "format": "int64" + }, + "oldestTask": { + "type": "string", + "description": "The timestamp (in seconds since the epoch) of the oldest unfinished task.", + "format": "int64" + }, + "totalTasks": { + "type": "integer", + "description": "Number of tasks in the queue.", + "format": "int32" + } + } + } + } + }, + "Tasks": { + "id": "Tasks", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The actual list of tasks returned as a result of the lease operation.", + "items": { + "$ref": "Task" + } + }, + "kind": { + "type": "string", + "description": "The kind of object returned, a list of tasks.", + "default": "taskqueue#tasks" + } + } + }, + "Tasks2": { + "id": "Tasks2", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The actual list of tasks currently active in the TaskQueue.", + "items": { + "$ref": "Task" + } + }, + "kind": { + "type": "string", + "description": "The kind of object returned, a list of tasks.", + "default": "taskqueues#tasks" + } + } + } + }, + "resources": { + "taskqueues": { + "methods": { + "get": { + "id": "taskqueue.taskqueues.get", + "path": "{project}/taskqueues/{taskqueue}", + "httpMethod": "GET", + "description": "Get detailed information about a TaskQueue.", + "parameters": { + "getStats": { + "type": "boolean", + "description": "Whether to get stats. Optional.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project under which the queue lies.", + "required": true, + "location": "path" + }, + "taskqueue": { + "type": "string", + "description": "The id of the taskqueue to get the properties of.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "taskqueue" + ], + "response": { + "$ref": "TaskQueue" + }, + "scopes": [ + "https://www.googleapis.com/auth/taskqueue", + "https://www.googleapis.com/auth/taskqueue.consumer" + ] + } + } + }, + "tasks": { + "methods": { + "delete": { + "id": "taskqueue.tasks.delete", + "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", + "httpMethod": "DELETE", + "description": "Delete a task from a TaskQueue.", + "parameters": { + "project": { + "type": "string", + "description": "The project under which the queue lies.", + "required": true, + "location": "path" + }, + "task": { + "type": "string", + "description": "The id of the task to delete.", + "required": true, + "location": "path" + }, + "taskqueue": { + "type": "string", + "description": "The taskqueue to delete a task from.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "taskqueue", + "task" + ], + "scopes": [ + "https://www.googleapis.com/auth/taskqueue", + "https://www.googleapis.com/auth/taskqueue.consumer" + ] + }, + "get": { + "id": "taskqueue.tasks.get", + "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", + "httpMethod": "GET", + "description": "Get a particular task from a TaskQueue.", + "parameters": { + "project": { + "type": "string", + "description": "The project under which the queue lies.", + "required": true, + "location": "path" + }, + "task": { + "type": "string", + "description": "The task to get properties of.", + "required": true, + "location": "path" + }, + "taskqueue": { + "type": "string", + "description": "The taskqueue in which the task belongs.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "taskqueue", + "task" + ], + "response": { + "$ref": "Task" + }, + "scopes": [ + "https://www.googleapis.com/auth/taskqueue", + "https://www.googleapis.com/auth/taskqueue.consumer" + ] + }, + "lease": { + "id": "taskqueue.tasks.lease", + "path": "{project}/taskqueues/{taskqueue}/tasks/lease", + "httpMethod": "POST", + "description": "Lease 1 or more tasks from a TaskQueue.", + "parameters": { + "leaseSecs": { + "type": "integer", + "description": "The lease in seconds.", + "required": true, + "format": "int32", + "location": "query" + }, + "numTasks": { + "type": "integer", + "description": "The number of tasks to lease.", + "required": true, + "format": "int32", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project under which the queue lies.", + "required": true, + "location": "path" + }, + "taskqueue": { + "type": "string", + "description": "The taskqueue to lease a task from.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "taskqueue", + "numTasks", + "leaseSecs" + ], + "response": { + "$ref": "Tasks" + }, + "scopes": [ + "https://www.googleapis.com/auth/taskqueue", + "https://www.googleapis.com/auth/taskqueue.consumer" + ] + }, + "list": { + "id": "taskqueue.tasks.list", + "path": "{project}/taskqueues/{taskqueue}/tasks", + "httpMethod": "GET", + "description": "List Tasks in a TaskQueue", + "parameters": { + "project": { + "type": "string", + "description": "The project under which the queue lies.", + "required": true, + "location": "path" + }, + "taskqueue": { + "type": "string", + "description": "The id of the taskqueue to list tasks from.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "taskqueue" + ], + "response": { + "$ref": "Tasks2" + }, + "scopes": [ + "https://www.googleapis.com/auth/taskqueue", + "https://www.googleapis.com/auth/taskqueue.consumer" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/taskqueue/v1beta1/taskqueue-gen.go b/third_party/src/code.google.com/p/google-api-go-client/taskqueue/v1beta1/taskqueue-gen.go new file mode 100644 index 0000000000000..4f80f79562c6a --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/taskqueue/v1beta1/taskqueue-gen.go @@ -0,0 +1,602 @@ +// Package taskqueue provides access to the TaskQueue API. +// +// See https://developers.google.com/appengine/docs/python/taskqueue/rest +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/taskqueue/v1beta1" +// ... +// taskqueueService, err := taskqueue.New(oauthHttpClient) +package taskqueue + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "taskqueue:v1beta1" +const apiName = "taskqueue" +const apiVersion = "v1beta1" +const basePath = "https://www.googleapis.com/taskqueue/v1beta1/projects/" + +// OAuth2 scopes used by this API. +const ( + // Manage your Tasks and Taskqueues + TaskqueueScope = "https://www.googleapis.com/auth/taskqueue" + + // Consume Tasks from your Taskqueues + TaskqueueConsumerScope = "https://www.googleapis.com/auth/taskqueue.consumer" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Taskqueues = NewTaskqueuesService(s) + s.Tasks = NewTasksService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Taskqueues *TaskqueuesService + + Tasks *TasksService +} + +func NewTaskqueuesService(s *Service) *TaskqueuesService { + rs := &TaskqueuesService{s: s} + return rs +} + +type TaskqueuesService struct { + s *Service +} + +func NewTasksService(s *Service) *TasksService { + rs := &TasksService{s: s} + return rs +} + +type TasksService struct { + s *Service +} + +type Task struct { + // EnqueueTimestamp: Time (in seconds since the epoch) at which the task + // was enqueued. + EnqueueTimestamp int64 `json:"enqueueTimestamp,omitempty,string"` + + // Id: Name of the task. + Id string `json:"id,omitempty"` + + // Kind: The kind of object returned, in this case set to task. + Kind string `json:"kind,omitempty"` + + // LeaseTimestamp: Time (in seconds since the epoch) at which the task + // lease will expire. This value is 0 if the task isnt currently leased + // out to a worker. + LeaseTimestamp int64 `json:"leaseTimestamp,omitempty,string"` + + // PayloadBase64: A bag of bytes which is the task payload. The payload + // on the JSON side is always Base64 encoded. + PayloadBase64 string `json:"payloadBase64,omitempty"` + + // QueueName: Name of the queue that the task is in. + QueueName string `json:"queueName,omitempty"` +} + +type TaskQueue struct { + // Acl: ACLs that are applicable to this TaskQueue object. + Acl *TaskQueueAcl `json:"acl,omitempty"` + + // Id: Name of the taskqueue. + Id string `json:"id,omitempty"` + + // Kind: The kind of REST object returned, in this case taskqueue. + Kind string `json:"kind,omitempty"` + + // MaxLeases: The number of times we should lease out tasks before + // giving up on them. If unset we lease them out forever until a worker + // deletes the task. + MaxLeases int64 `json:"maxLeases,omitempty"` + + // Stats: Statistics for the TaskQueue object in question. + Stats *TaskQueueStats `json:"stats,omitempty"` +} + +type TaskQueueAcl struct { + // AdminEmails: Email addresses of users who are "admins" of the + // TaskQueue. This means they can control the queue, eg set ACLs for the + // queue. + AdminEmails []string `json:"adminEmails,omitempty"` + + // ConsumerEmails: Email addresses of users who can "consume" tasks from + // the TaskQueue. This means they can Dequeue and Delete tasks from the + // queue. + ConsumerEmails []string `json:"consumerEmails,omitempty"` + + // ProducerEmails: Email addresses of users who can "produce" tasks into + // the TaskQueue. This means they can Insert tasks into the queue. + ProducerEmails []string `json:"producerEmails,omitempty"` +} + +type TaskQueueStats struct { + // LeasedLastHour: Number of tasks leased in the last hour. + LeasedLastHour int64 `json:"leasedLastHour,omitempty,string"` + + // LeasedLastMinute: Number of tasks leased in the last minute. + LeasedLastMinute int64 `json:"leasedLastMinute,omitempty,string"` + + // OldestTask: The timestamp (in seconds since the epoch) of the oldest + // unfinished task. + OldestTask int64 `json:"oldestTask,omitempty,string"` + + // TotalTasks: Number of tasks in the queue. + TotalTasks int64 `json:"totalTasks,omitempty"` +} + +type Tasks struct { + // Items: The actual list of tasks returned as a result of the lease + // operation. + Items []*Task `json:"items,omitempty"` + + // Kind: The kind of object returned, a list of tasks. + Kind string `json:"kind,omitempty"` +} + +type Tasks2 struct { + // Items: The actual list of tasks currently active in the TaskQueue. + Items []*Task `json:"items,omitempty"` + + // Kind: The kind of object returned, a list of tasks. + Kind string `json:"kind,omitempty"` +} + +// method id "taskqueue.taskqueues.get": + +type TaskqueuesGetCall struct { + s *Service + project string + taskqueue string + opt_ map[string]interface{} +} + +// Get: Get detailed information about a TaskQueue. +func (r *TaskqueuesService) Get(project string, taskqueue string) *TaskqueuesGetCall { + c := &TaskqueuesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.taskqueue = taskqueue + return c +} + +// GetStats sets the optional parameter "getStats": Whether to get +// stats. +func (c *TaskqueuesGetCall) GetStats(getStats bool) *TaskqueuesGetCall { + c.opt_["getStats"] = getStats + return c +} + +func (c *TaskqueuesGetCall) Do() (*TaskQueue, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["getStats"]; ok { + params.Set("getStats", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{taskqueue}", url.QueryEscape(c.taskqueue), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TaskQueue) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get detailed information about a TaskQueue.", + // "httpMethod": "GET", + // "id": "taskqueue.taskqueues.get", + // "parameterOrder": [ + // "project", + // "taskqueue" + // ], + // "parameters": { + // "getStats": { + // "description": "Whether to get stats. Optional.", + // "location": "query", + // "type": "boolean" + // }, + // "project": { + // "description": "The project under which the queue lies.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "taskqueue": { + // "description": "The id of the taskqueue to get the properties of.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/taskqueues/{taskqueue}", + // "response": { + // "$ref": "TaskQueue" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/taskqueue", + // "https://www.googleapis.com/auth/taskqueue.consumer" + // ] + // } + +} + +// method id "taskqueue.tasks.delete": + +type TasksDeleteCall struct { + s *Service + project string + taskqueue string + task string + opt_ map[string]interface{} +} + +// Delete: Delete a task from a TaskQueue. +func (r *TasksService) Delete(project string, taskqueue string, task string) *TasksDeleteCall { + c := &TasksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.taskqueue = taskqueue + c.task = task + return c +} + +func (c *TasksDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{taskqueue}", url.QueryEscape(c.taskqueue), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{task}", url.QueryEscape(c.task), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a task from a TaskQueue.", + // "httpMethod": "DELETE", + // "id": "taskqueue.tasks.delete", + // "parameterOrder": [ + // "project", + // "taskqueue", + // "task" + // ], + // "parameters": { + // "project": { + // "description": "The project under which the queue lies.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "task": { + // "description": "The id of the task to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "taskqueue": { + // "description": "The taskqueue to delete a task from.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", + // "scopes": [ + // "https://www.googleapis.com/auth/taskqueue", + // "https://www.googleapis.com/auth/taskqueue.consumer" + // ] + // } + +} + +// method id "taskqueue.tasks.get": + +type TasksGetCall struct { + s *Service + project string + taskqueue string + task string + opt_ map[string]interface{} +} + +// Get: Get a particular task from a TaskQueue. +func (r *TasksService) Get(project string, taskqueue string, task string) *TasksGetCall { + c := &TasksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.taskqueue = taskqueue + c.task = task + return c +} + +func (c *TasksGetCall) Do() (*Task, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{taskqueue}", url.QueryEscape(c.taskqueue), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{task}", url.QueryEscape(c.task), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Task) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a particular task from a TaskQueue.", + // "httpMethod": "GET", + // "id": "taskqueue.tasks.get", + // "parameterOrder": [ + // "project", + // "taskqueue", + // "task" + // ], + // "parameters": { + // "project": { + // "description": "The project under which the queue lies.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "task": { + // "description": "The task to get properties of.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "taskqueue": { + // "description": "The taskqueue in which the task belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", + // "response": { + // "$ref": "Task" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/taskqueue", + // "https://www.googleapis.com/auth/taskqueue.consumer" + // ] + // } + +} + +// method id "taskqueue.tasks.lease": + +type TasksLeaseCall struct { + s *Service + project string + taskqueue string + numTasks int64 + leaseSecs int64 + opt_ map[string]interface{} +} + +// Lease: Lease 1 or more tasks from a TaskQueue. +func (r *TasksService) Lease(project string, taskqueue string, numTasks int64, leaseSecs int64) *TasksLeaseCall { + c := &TasksLeaseCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.taskqueue = taskqueue + c.numTasks = numTasks + c.leaseSecs = leaseSecs + return c +} + +func (c *TasksLeaseCall) Do() (*Tasks, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("leaseSecs", fmt.Sprintf("%v", c.leaseSecs)) + params.Set("numTasks", fmt.Sprintf("%v", c.numTasks)) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/lease") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{taskqueue}", url.QueryEscape(c.taskqueue), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Tasks) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lease 1 or more tasks from a TaskQueue.", + // "httpMethod": "POST", + // "id": "taskqueue.tasks.lease", + // "parameterOrder": [ + // "project", + // "taskqueue", + // "numTasks", + // "leaseSecs" + // ], + // "parameters": { + // "leaseSecs": { + // "description": "The lease in seconds.", + // "format": "int32", + // "location": "query", + // "required": true, + // "type": "integer" + // }, + // "numTasks": { + // "description": "The number of tasks to lease.", + // "format": "int32", + // "location": "query", + // "required": true, + // "type": "integer" + // }, + // "project": { + // "description": "The project under which the queue lies.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "taskqueue": { + // "description": "The taskqueue to lease a task from.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/taskqueues/{taskqueue}/tasks/lease", + // "response": { + // "$ref": "Tasks" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/taskqueue", + // "https://www.googleapis.com/auth/taskqueue.consumer" + // ] + // } + +} + +// method id "taskqueue.tasks.list": + +type TasksListCall struct { + s *Service + project string + taskqueue string + opt_ map[string]interface{} +} + +// List: List Tasks in a TaskQueue +func (r *TasksService) List(project string, taskqueue string) *TasksListCall { + c := &TasksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.taskqueue = taskqueue + return c +} + +func (c *TasksListCall) Do() (*Tasks2, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{taskqueue}", url.QueryEscape(c.taskqueue), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Tasks2) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List Tasks in a TaskQueue", + // "httpMethod": "GET", + // "id": "taskqueue.tasks.list", + // "parameterOrder": [ + // "project", + // "taskqueue" + // ], + // "parameters": { + // "project": { + // "description": "The project under which the queue lies.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "taskqueue": { + // "description": "The id of the taskqueue to list tasks from.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/taskqueues/{taskqueue}/tasks", + // "response": { + // "$ref": "Tasks2" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/taskqueue", + // "https://www.googleapis.com/auth/taskqueue.consumer" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/taskqueue/v1beta2/taskqueue-api.json b/third_party/src/code.google.com/p/google-api-go-client/taskqueue/v1beta2/taskqueue-api.json new file mode 100644 index 0000000000000..10ef90a163ccb --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/taskqueue/v1beta2/taskqueue-api.json @@ -0,0 +1,568 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/5Hs2SYZ6tc8V9isLu4EuE8s9_qg\"", + "discoveryVersion": "v1", + "id": "taskqueue:v1beta2", + "name": "taskqueue", + "version": "v1beta2", + "title": "TaskQueue API", + "description": "Lets you access a Google App Engine Pull Task Queue over REST.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/app_engine-16.png", + "x32": "http://www.google.com/images/icons/product/app_engine-32.png" + }, + "documentationLink": "https://developers.google.com/appengine/docs/python/taskqueue/rest", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/taskqueue/v1beta2/projects/", + "basePath": "/taskqueue/v1beta2/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "taskqueue/v1beta2/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/taskqueue": { + "description": "Manage your Tasks and Taskqueues" + }, + "https://www.googleapis.com/auth/taskqueue.consumer": { + "description": "Consume Tasks from your Taskqueues" + } + } + } + }, + "schemas": { + "Task": { + "id": "Task", + "type": "object", + "properties": { + "enqueueTimestamp": { + "type": "string", + "description": "Time (in seconds since the epoch) at which the task was enqueued.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "Name of the task." + }, + "kind": { + "type": "string", + "description": "The kind of object returned, in this case set to task.", + "default": "taskqueues#task" + }, + "leaseTimestamp": { + "type": "string", + "description": "Time (in seconds since the epoch) at which the task lease will expire. This value is 0 if the task isnt currently leased out to a worker.", + "format": "int64" + }, + "payloadBase64": { + "type": "string", + "description": "A bag of bytes which is the task payload. The payload on the JSON side is always Base64 encoded." + }, + "queueName": { + "type": "string", + "description": "Name of the queue that the task is in." + }, + "retry_count": { + "type": "integer", + "description": "The number of leases applied to this task.", + "format": "int32" + }, + "tag": { + "type": "string", + "description": "Tag for the task, could be used later to lease tasks grouped by a specific tag." + } + } + }, + "TaskQueue": { + "id": "TaskQueue", + "type": "object", + "properties": { + "acl": { + "type": "object", + "description": "ACLs that are applicable to this TaskQueue object.", + "properties": { + "adminEmails": { + "type": "array", + "description": "Email addresses of users who are \"admins\" of the TaskQueue. This means they can control the queue, eg set ACLs for the queue.", + "items": { + "type": "string" + } + }, + "consumerEmails": { + "type": "array", + "description": "Email addresses of users who can \"consume\" tasks from the TaskQueue. This means they can Dequeue and Delete tasks from the queue.", + "items": { + "type": "string" + } + }, + "producerEmails": { + "type": "array", + "description": "Email addresses of users who can \"produce\" tasks into the TaskQueue. This means they can Insert tasks into the queue.", + "items": { + "type": "string" + } + } + } + }, + "id": { + "type": "string", + "description": "Name of the taskqueue." + }, + "kind": { + "type": "string", + "description": "The kind of REST object returned, in this case taskqueue.", + "default": "taskqueues#taskqueue" + }, + "maxLeases": { + "type": "integer", + "description": "The number of times we should lease out tasks before giving up on them. If unset we lease them out forever until a worker deletes the task.", + "format": "int32" + }, + "stats": { + "type": "object", + "description": "Statistics for the TaskQueue object in question.", + "properties": { + "leasedLastHour": { + "type": "string", + "description": "Number of tasks leased in the last hour.", + "format": "int64" + }, + "leasedLastMinute": { + "type": "string", + "description": "Number of tasks leased in the last minute.", + "format": "int64" + }, + "oldestTask": { + "type": "string", + "description": "The timestamp (in seconds since the epoch) of the oldest unfinished task.", + "format": "int64" + }, + "totalTasks": { + "type": "integer", + "description": "Number of tasks in the queue.", + "format": "int32" + } + } + } + } + }, + "Tasks": { + "id": "Tasks", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The actual list of tasks returned as a result of the lease operation.", + "items": { + "$ref": "Task" + } + }, + "kind": { + "type": "string", + "description": "The kind of object returned, a list of tasks.", + "default": "taskqueue#tasks" + } + } + }, + "Tasks2": { + "id": "Tasks2", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The actual list of tasks currently active in the TaskQueue.", + "items": { + "$ref": "Task" + } + }, + "kind": { + "type": "string", + "description": "The kind of object returned, a list of tasks.", + "default": "taskqueues#tasks" + } + } + } + }, + "resources": { + "taskqueues": { + "methods": { + "get": { + "id": "taskqueue.taskqueues.get", + "path": "{project}/taskqueues/{taskqueue}", + "httpMethod": "GET", + "description": "Get detailed information about a TaskQueue.", + "parameters": { + "getStats": { + "type": "boolean", + "description": "Whether to get stats. Optional.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project under which the queue lies.", + "required": true, + "location": "path" + }, + "taskqueue": { + "type": "string", + "description": "The id of the taskqueue to get the properties of.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "taskqueue" + ], + "response": { + "$ref": "TaskQueue" + }, + "scopes": [ + "https://www.googleapis.com/auth/taskqueue", + "https://www.googleapis.com/auth/taskqueue.consumer" + ] + } + } + }, + "tasks": { + "methods": { + "delete": { + "id": "taskqueue.tasks.delete", + "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", + "httpMethod": "DELETE", + "description": "Delete a task from a TaskQueue.", + "parameters": { + "project": { + "type": "string", + "description": "The project under which the queue lies.", + "required": true, + "location": "path" + }, + "task": { + "type": "string", + "description": "The id of the task to delete.", + "required": true, + "location": "path" + }, + "taskqueue": { + "type": "string", + "description": "The taskqueue to delete a task from.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "taskqueue", + "task" + ], + "scopes": [ + "https://www.googleapis.com/auth/taskqueue", + "https://www.googleapis.com/auth/taskqueue.consumer" + ] + }, + "get": { + "id": "taskqueue.tasks.get", + "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", + "httpMethod": "GET", + "description": "Get a particular task from a TaskQueue.", + "parameters": { + "project": { + "type": "string", + "description": "The project under which the queue lies.", + "required": true, + "location": "path" + }, + "task": { + "type": "string", + "description": "The task to get properties of.", + "required": true, + "location": "path" + }, + "taskqueue": { + "type": "string", + "description": "The taskqueue in which the task belongs.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "taskqueue", + "task" + ], + "response": { + "$ref": "Task" + }, + "scopes": [ + "https://www.googleapis.com/auth/taskqueue", + "https://www.googleapis.com/auth/taskqueue.consumer" + ] + }, + "insert": { + "id": "taskqueue.tasks.insert", + "path": "{project}/taskqueues/{taskqueue}/tasks", + "httpMethod": "POST", + "description": "Insert a new task in a TaskQueue", + "parameters": { + "project": { + "type": "string", + "description": "The project under which the queue lies", + "required": true, + "location": "path" + }, + "taskqueue": { + "type": "string", + "description": "The taskqueue to insert the task into", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "taskqueue" + ], + "request": { + "$ref": "Task" + }, + "response": { + "$ref": "Task" + }, + "scopes": [ + "https://www.googleapis.com/auth/taskqueue", + "https://www.googleapis.com/auth/taskqueue.consumer" + ] + }, + "lease": { + "id": "taskqueue.tasks.lease", + "path": "{project}/taskqueues/{taskqueue}/tasks/lease", + "httpMethod": "POST", + "description": "Lease 1 or more tasks from a TaskQueue.", + "parameters": { + "groupByTag": { + "type": "boolean", + "description": "When true, all returned tasks will have the same tag", + "location": "query" + }, + "leaseSecs": { + "type": "integer", + "description": "The lease in seconds.", + "required": true, + "format": "int32", + "location": "query" + }, + "numTasks": { + "type": "integer", + "description": "The number of tasks to lease.", + "required": true, + "format": "int32", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project under which the queue lies.", + "required": true, + "location": "path" + }, + "tag": { + "type": "string", + "description": "The tag allowed for tasks in the response. Must only be specified if group_by_tag is true. If group_by_tag is true and tag is not specified the tag will be that of the oldest task by eta, i.e. the first available tag", + "location": "query" + }, + "taskqueue": { + "type": "string", + "description": "The taskqueue to lease a task from.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "taskqueue", + "numTasks", + "leaseSecs" + ], + "response": { + "$ref": "Tasks" + }, + "scopes": [ + "https://www.googleapis.com/auth/taskqueue", + "https://www.googleapis.com/auth/taskqueue.consumer" + ] + }, + "list": { + "id": "taskqueue.tasks.list", + "path": "{project}/taskqueues/{taskqueue}/tasks", + "httpMethod": "GET", + "description": "List Tasks in a TaskQueue", + "parameters": { + "project": { + "type": "string", + "description": "The project under which the queue lies.", + "required": true, + "location": "path" + }, + "taskqueue": { + "type": "string", + "description": "The id of the taskqueue to list tasks from.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "taskqueue" + ], + "response": { + "$ref": "Tasks2" + }, + "scopes": [ + "https://www.googleapis.com/auth/taskqueue", + "https://www.googleapis.com/auth/taskqueue.consumer" + ] + }, + "patch": { + "id": "taskqueue.tasks.patch", + "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", + "httpMethod": "PATCH", + "description": "Update tasks that are leased out of a TaskQueue. This method supports patch semantics.", + "parameters": { + "newLeaseSeconds": { + "type": "integer", + "description": "The new lease in seconds.", + "required": true, + "format": "int32", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project under which the queue lies.", + "required": true, + "location": "path" + }, + "task": { + "type": "string", + "required": true, + "location": "path" + }, + "taskqueue": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "taskqueue", + "task", + "newLeaseSeconds" + ], + "request": { + "$ref": "Task" + }, + "response": { + "$ref": "Task" + }, + "scopes": [ + "https://www.googleapis.com/auth/taskqueue", + "https://www.googleapis.com/auth/taskqueue.consumer" + ] + }, + "update": { + "id": "taskqueue.tasks.update", + "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", + "httpMethod": "POST", + "description": "Update tasks that are leased out of a TaskQueue.", + "parameters": { + "newLeaseSeconds": { + "type": "integer", + "description": "The new lease in seconds.", + "required": true, + "format": "int32", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project under which the queue lies.", + "required": true, + "location": "path" + }, + "task": { + "type": "string", + "required": true, + "location": "path" + }, + "taskqueue": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "taskqueue", + "task", + "newLeaseSeconds" + ], + "request": { + "$ref": "Task" + }, + "response": { + "$ref": "Task" + }, + "scopes": [ + "https://www.googleapis.com/auth/taskqueue", + "https://www.googleapis.com/auth/taskqueue.consumer" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/taskqueue/v1beta2/taskqueue-gen.go b/third_party/src/code.google.com/p/google-api-go-client/taskqueue/v1beta2/taskqueue-gen.go new file mode 100644 index 0000000000000..79604f3083bed --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/taskqueue/v1beta2/taskqueue-gen.go @@ -0,0 +1,938 @@ +// Package taskqueue provides access to the TaskQueue API. +// +// See https://developers.google.com/appengine/docs/python/taskqueue/rest +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/taskqueue/v1beta2" +// ... +// taskqueueService, err := taskqueue.New(oauthHttpClient) +package taskqueue + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "taskqueue:v1beta2" +const apiName = "taskqueue" +const apiVersion = "v1beta2" +const basePath = "https://www.googleapis.com/taskqueue/v1beta2/projects/" + +// OAuth2 scopes used by this API. +const ( + // Manage your Tasks and Taskqueues + TaskqueueScope = "https://www.googleapis.com/auth/taskqueue" + + // Consume Tasks from your Taskqueues + TaskqueueConsumerScope = "https://www.googleapis.com/auth/taskqueue.consumer" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Taskqueues = NewTaskqueuesService(s) + s.Tasks = NewTasksService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Taskqueues *TaskqueuesService + + Tasks *TasksService +} + +func NewTaskqueuesService(s *Service) *TaskqueuesService { + rs := &TaskqueuesService{s: s} + return rs +} + +type TaskqueuesService struct { + s *Service +} + +func NewTasksService(s *Service) *TasksService { + rs := &TasksService{s: s} + return rs +} + +type TasksService struct { + s *Service +} + +type Task struct { + // EnqueueTimestamp: Time (in seconds since the epoch) at which the task + // was enqueued. + EnqueueTimestamp int64 `json:"enqueueTimestamp,omitempty,string"` + + // Id: Name of the task. + Id string `json:"id,omitempty"` + + // Kind: The kind of object returned, in this case set to task. + Kind string `json:"kind,omitempty"` + + // LeaseTimestamp: Time (in seconds since the epoch) at which the task + // lease will expire. This value is 0 if the task isnt currently leased + // out to a worker. + LeaseTimestamp int64 `json:"leaseTimestamp,omitempty,string"` + + // PayloadBase64: A bag of bytes which is the task payload. The payload + // on the JSON side is always Base64 encoded. + PayloadBase64 string `json:"payloadBase64,omitempty"` + + // QueueName: Name of the queue that the task is in. + QueueName string `json:"queueName,omitempty"` + + // Retry_count: The number of leases applied to this task. + Retry_count int64 `json:"retry_count,omitempty"` + + // Tag: Tag for the task, could be used later to lease tasks grouped by + // a specific tag. + Tag string `json:"tag,omitempty"` +} + +type TaskQueue struct { + // Acl: ACLs that are applicable to this TaskQueue object. + Acl *TaskQueueAcl `json:"acl,omitempty"` + + // Id: Name of the taskqueue. + Id string `json:"id,omitempty"` + + // Kind: The kind of REST object returned, in this case taskqueue. + Kind string `json:"kind,omitempty"` + + // MaxLeases: The number of times we should lease out tasks before + // giving up on them. If unset we lease them out forever until a worker + // deletes the task. + MaxLeases int64 `json:"maxLeases,omitempty"` + + // Stats: Statistics for the TaskQueue object in question. + Stats *TaskQueueStats `json:"stats,omitempty"` +} + +type TaskQueueAcl struct { + // AdminEmails: Email addresses of users who are "admins" of the + // TaskQueue. This means they can control the queue, eg set ACLs for the + // queue. + AdminEmails []string `json:"adminEmails,omitempty"` + + // ConsumerEmails: Email addresses of users who can "consume" tasks from + // the TaskQueue. This means they can Dequeue and Delete tasks from the + // queue. + ConsumerEmails []string `json:"consumerEmails,omitempty"` + + // ProducerEmails: Email addresses of users who can "produce" tasks into + // the TaskQueue. This means they can Insert tasks into the queue. + ProducerEmails []string `json:"producerEmails,omitempty"` +} + +type TaskQueueStats struct { + // LeasedLastHour: Number of tasks leased in the last hour. + LeasedLastHour int64 `json:"leasedLastHour,omitempty,string"` + + // LeasedLastMinute: Number of tasks leased in the last minute. + LeasedLastMinute int64 `json:"leasedLastMinute,omitempty,string"` + + // OldestTask: The timestamp (in seconds since the epoch) of the oldest + // unfinished task. + OldestTask int64 `json:"oldestTask,omitempty,string"` + + // TotalTasks: Number of tasks in the queue. + TotalTasks int64 `json:"totalTasks,omitempty"` +} + +type Tasks struct { + // Items: The actual list of tasks returned as a result of the lease + // operation. + Items []*Task `json:"items,omitempty"` + + // Kind: The kind of object returned, a list of tasks. + Kind string `json:"kind,omitempty"` +} + +type Tasks2 struct { + // Items: The actual list of tasks currently active in the TaskQueue. + Items []*Task `json:"items,omitempty"` + + // Kind: The kind of object returned, a list of tasks. + Kind string `json:"kind,omitempty"` +} + +// method id "taskqueue.taskqueues.get": + +type TaskqueuesGetCall struct { + s *Service + project string + taskqueue string + opt_ map[string]interface{} +} + +// Get: Get detailed information about a TaskQueue. +func (r *TaskqueuesService) Get(project string, taskqueue string) *TaskqueuesGetCall { + c := &TaskqueuesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.taskqueue = taskqueue + return c +} + +// GetStats sets the optional parameter "getStats": Whether to get +// stats. +func (c *TaskqueuesGetCall) GetStats(getStats bool) *TaskqueuesGetCall { + c.opt_["getStats"] = getStats + return c +} + +func (c *TaskqueuesGetCall) Do() (*TaskQueue, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["getStats"]; ok { + params.Set("getStats", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{taskqueue}", url.QueryEscape(c.taskqueue), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TaskQueue) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get detailed information about a TaskQueue.", + // "httpMethod": "GET", + // "id": "taskqueue.taskqueues.get", + // "parameterOrder": [ + // "project", + // "taskqueue" + // ], + // "parameters": { + // "getStats": { + // "description": "Whether to get stats. Optional.", + // "location": "query", + // "type": "boolean" + // }, + // "project": { + // "description": "The project under which the queue lies.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "taskqueue": { + // "description": "The id of the taskqueue to get the properties of.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/taskqueues/{taskqueue}", + // "response": { + // "$ref": "TaskQueue" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/taskqueue", + // "https://www.googleapis.com/auth/taskqueue.consumer" + // ] + // } + +} + +// method id "taskqueue.tasks.delete": + +type TasksDeleteCall struct { + s *Service + project string + taskqueue string + task string + opt_ map[string]interface{} +} + +// Delete: Delete a task from a TaskQueue. +func (r *TasksService) Delete(project string, taskqueue string, task string) *TasksDeleteCall { + c := &TasksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.taskqueue = taskqueue + c.task = task + return c +} + +func (c *TasksDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{taskqueue}", url.QueryEscape(c.taskqueue), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{task}", url.QueryEscape(c.task), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a task from a TaskQueue.", + // "httpMethod": "DELETE", + // "id": "taskqueue.tasks.delete", + // "parameterOrder": [ + // "project", + // "taskqueue", + // "task" + // ], + // "parameters": { + // "project": { + // "description": "The project under which the queue lies.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "task": { + // "description": "The id of the task to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "taskqueue": { + // "description": "The taskqueue to delete a task from.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", + // "scopes": [ + // "https://www.googleapis.com/auth/taskqueue", + // "https://www.googleapis.com/auth/taskqueue.consumer" + // ] + // } + +} + +// method id "taskqueue.tasks.get": + +type TasksGetCall struct { + s *Service + project string + taskqueue string + task string + opt_ map[string]interface{} +} + +// Get: Get a particular task from a TaskQueue. +func (r *TasksService) Get(project string, taskqueue string, task string) *TasksGetCall { + c := &TasksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.taskqueue = taskqueue + c.task = task + return c +} + +func (c *TasksGetCall) Do() (*Task, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{taskqueue}", url.QueryEscape(c.taskqueue), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{task}", url.QueryEscape(c.task), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Task) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a particular task from a TaskQueue.", + // "httpMethod": "GET", + // "id": "taskqueue.tasks.get", + // "parameterOrder": [ + // "project", + // "taskqueue", + // "task" + // ], + // "parameters": { + // "project": { + // "description": "The project under which the queue lies.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "task": { + // "description": "The task to get properties of.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "taskqueue": { + // "description": "The taskqueue in which the task belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", + // "response": { + // "$ref": "Task" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/taskqueue", + // "https://www.googleapis.com/auth/taskqueue.consumer" + // ] + // } + +} + +// method id "taskqueue.tasks.insert": + +type TasksInsertCall struct { + s *Service + project string + taskqueue string + task *Task + opt_ map[string]interface{} +} + +// Insert: Insert a new task in a TaskQueue +func (r *TasksService) Insert(project string, taskqueue string, task *Task) *TasksInsertCall { + c := &TasksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.taskqueue = taskqueue + c.task = task + return c +} + +func (c *TasksInsertCall) Do() (*Task, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.task) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{taskqueue}", url.QueryEscape(c.taskqueue), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Task) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Insert a new task in a TaskQueue", + // "httpMethod": "POST", + // "id": "taskqueue.tasks.insert", + // "parameterOrder": [ + // "project", + // "taskqueue" + // ], + // "parameters": { + // "project": { + // "description": "The project under which the queue lies", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "taskqueue": { + // "description": "The taskqueue to insert the task into", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/taskqueues/{taskqueue}/tasks", + // "request": { + // "$ref": "Task" + // }, + // "response": { + // "$ref": "Task" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/taskqueue", + // "https://www.googleapis.com/auth/taskqueue.consumer" + // ] + // } + +} + +// method id "taskqueue.tasks.lease": + +type TasksLeaseCall struct { + s *Service + project string + taskqueue string + numTasks int64 + leaseSecs int64 + opt_ map[string]interface{} +} + +// Lease: Lease 1 or more tasks from a TaskQueue. +func (r *TasksService) Lease(project string, taskqueue string, numTasks int64, leaseSecs int64) *TasksLeaseCall { + c := &TasksLeaseCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.taskqueue = taskqueue + c.numTasks = numTasks + c.leaseSecs = leaseSecs + return c +} + +// GroupByTag sets the optional parameter "groupByTag": When true, all +// returned tasks will have the same tag +func (c *TasksLeaseCall) GroupByTag(groupByTag bool) *TasksLeaseCall { + c.opt_["groupByTag"] = groupByTag + return c +} + +// Tag sets the optional parameter "tag": The tag allowed for tasks in +// the response. Must only be specified if group_by_tag is true. If +// group_by_tag is true and tag is not specified the tag will be that of +// the oldest task by eta, i.e. the first available tag +func (c *TasksLeaseCall) Tag(tag string) *TasksLeaseCall { + c.opt_["tag"] = tag + return c +} + +func (c *TasksLeaseCall) Do() (*Tasks, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("leaseSecs", fmt.Sprintf("%v", c.leaseSecs)) + params.Set("numTasks", fmt.Sprintf("%v", c.numTasks)) + if v, ok := c.opt_["groupByTag"]; ok { + params.Set("groupByTag", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["tag"]; ok { + params.Set("tag", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/lease") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{taskqueue}", url.QueryEscape(c.taskqueue), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Tasks) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lease 1 or more tasks from a TaskQueue.", + // "httpMethod": "POST", + // "id": "taskqueue.tasks.lease", + // "parameterOrder": [ + // "project", + // "taskqueue", + // "numTasks", + // "leaseSecs" + // ], + // "parameters": { + // "groupByTag": { + // "description": "When true, all returned tasks will have the same tag", + // "location": "query", + // "type": "boolean" + // }, + // "leaseSecs": { + // "description": "The lease in seconds.", + // "format": "int32", + // "location": "query", + // "required": true, + // "type": "integer" + // }, + // "numTasks": { + // "description": "The number of tasks to lease.", + // "format": "int32", + // "location": "query", + // "required": true, + // "type": "integer" + // }, + // "project": { + // "description": "The project under which the queue lies.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tag": { + // "description": "The tag allowed for tasks in the response. Must only be specified if group_by_tag is true. If group_by_tag is true and tag is not specified the tag will be that of the oldest task by eta, i.e. the first available tag", + // "location": "query", + // "type": "string" + // }, + // "taskqueue": { + // "description": "The taskqueue to lease a task from.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/taskqueues/{taskqueue}/tasks/lease", + // "response": { + // "$ref": "Tasks" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/taskqueue", + // "https://www.googleapis.com/auth/taskqueue.consumer" + // ] + // } + +} + +// method id "taskqueue.tasks.list": + +type TasksListCall struct { + s *Service + project string + taskqueue string + opt_ map[string]interface{} +} + +// List: List Tasks in a TaskQueue +func (r *TasksService) List(project string, taskqueue string) *TasksListCall { + c := &TasksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.taskqueue = taskqueue + return c +} + +func (c *TasksListCall) Do() (*Tasks2, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{taskqueue}", url.QueryEscape(c.taskqueue), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Tasks2) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List Tasks in a TaskQueue", + // "httpMethod": "GET", + // "id": "taskqueue.tasks.list", + // "parameterOrder": [ + // "project", + // "taskqueue" + // ], + // "parameters": { + // "project": { + // "description": "The project under which the queue lies.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "taskqueue": { + // "description": "The id of the taskqueue to list tasks from.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/taskqueues/{taskqueue}/tasks", + // "response": { + // "$ref": "Tasks2" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/taskqueue", + // "https://www.googleapis.com/auth/taskqueue.consumer" + // ] + // } + +} + +// method id "taskqueue.tasks.patch": + +type TasksPatchCall struct { + s *Service + project string + taskqueue string + task string + newLeaseSeconds int64 + task2 *Task + opt_ map[string]interface{} +} + +// Patch: Update tasks that are leased out of a TaskQueue. This method +// supports patch semantics. +func (r *TasksService) Patch(project string, taskqueue string, task string, newLeaseSeconds int64, task2 *Task) *TasksPatchCall { + c := &TasksPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.taskqueue = taskqueue + c.task = task + c.newLeaseSeconds = newLeaseSeconds + c.task2 = task2 + return c +} + +func (c *TasksPatchCall) Do() (*Task, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.task2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + params.Set("newLeaseSeconds", fmt.Sprintf("%v", c.newLeaseSeconds)) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{taskqueue}", url.QueryEscape(c.taskqueue), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{task}", url.QueryEscape(c.task), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Task) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update tasks that are leased out of a TaskQueue. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "taskqueue.tasks.patch", + // "parameterOrder": [ + // "project", + // "taskqueue", + // "task", + // "newLeaseSeconds" + // ], + // "parameters": { + // "newLeaseSeconds": { + // "description": "The new lease in seconds.", + // "format": "int32", + // "location": "query", + // "required": true, + // "type": "integer" + // }, + // "project": { + // "description": "The project under which the queue lies.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "task": { + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "taskqueue": { + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", + // "request": { + // "$ref": "Task" + // }, + // "response": { + // "$ref": "Task" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/taskqueue", + // "https://www.googleapis.com/auth/taskqueue.consumer" + // ] + // } + +} + +// method id "taskqueue.tasks.update": + +type TasksUpdateCall struct { + s *Service + project string + taskqueue string + task string + newLeaseSeconds int64 + task2 *Task + opt_ map[string]interface{} +} + +// Update: Update tasks that are leased out of a TaskQueue. +func (r *TasksService) Update(project string, taskqueue string, task string, newLeaseSeconds int64, task2 *Task) *TasksUpdateCall { + c := &TasksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.taskqueue = taskqueue + c.task = task + c.newLeaseSeconds = newLeaseSeconds + c.task2 = task2 + return c +} + +func (c *TasksUpdateCall) Do() (*Task, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.task2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + params.Set("newLeaseSeconds", fmt.Sprintf("%v", c.newLeaseSeconds)) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{taskqueue}", url.QueryEscape(c.taskqueue), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{task}", url.QueryEscape(c.task), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Task) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update tasks that are leased out of a TaskQueue.", + // "httpMethod": "POST", + // "id": "taskqueue.tasks.update", + // "parameterOrder": [ + // "project", + // "taskqueue", + // "task", + // "newLeaseSeconds" + // ], + // "parameters": { + // "newLeaseSeconds": { + // "description": "The new lease in seconds.", + // "format": "int32", + // "location": "query", + // "required": true, + // "type": "integer" + // }, + // "project": { + // "description": "The project under which the queue lies.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "task": { + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "taskqueue": { + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", + // "request": { + // "$ref": "Task" + // }, + // "response": { + // "$ref": "Task" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/taskqueue", + // "https://www.googleapis.com/auth/taskqueue.consumer" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/tasks/v1/tasks-api.json b/third_party/src/code.google.com/p/google-api-go-client/tasks/v1/tasks-api.json new file mode 100644 index 0000000000000..54932b1c48ecf --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/tasks/v1/tasks-api.json @@ -0,0 +1,695 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/5PpVnub_x8uBzIigVf3YlGXAlmA\"", + "discoveryVersion": "v1", + "id": "tasks:v1", + "name": "tasks", + "version": "v1", + "title": "Tasks API", + "description": "Lets you manage your tasks and task lists.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/tasks-16.png", + "x32": "http://www.google.com/images/icons/product/tasks-32.png" + }, + "documentationLink": "https://developers.google.com/google-apps/tasks/firstapp", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/tasks/v1/", + "basePath": "/tasks/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "tasks/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/tasks": { + "description": "Manage your tasks" + }, + "https://www.googleapis.com/auth/tasks.readonly": { + "description": "View your tasks" + } + } + } + }, + "schemas": { + "Task": { + "id": "Task", + "type": "object", + "properties": { + "completed": { + "type": "string", + "description": "Completion date of the task (as a RFC 3339 timestamp). This field is omitted if the task has not been completed.", + "format": "date-time" + }, + "deleted": { + "type": "boolean", + "description": "Flag indicating whether the task has been deleted. The default if False." + }, + "due": { + "type": "string", + "description": "Due date of the task (as a RFC 3339 timestamp). Optional.", + "format": "date-time" + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "hidden": { + "type": "boolean", + "description": "Flag indicating whether the task is hidden. This is the case if the task had been marked completed when the task list was last cleared. The default is False. This field is read-only." + }, + "id": { + "type": "string", + "description": "Task identifier." + }, + "kind": { + "type": "string", + "description": "Type of the resource. This is always \"tasks#task\".", + "default": "tasks#task" + }, + "links": { + "type": "array", + "description": "Collection of links. This collection is read-only.", + "items": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "The description. In HTML speak: Everything between \u003ca\u003e and \u003c/a\u003e." + }, + "link": { + "type": "string", + "description": "The URL." + }, + "type": { + "type": "string", + "description": "Type of the link, e.g. \"email\"." + } + } + } + }, + "notes": { + "type": "string", + "description": "Notes describing the task. Optional." + }, + "parent": { + "type": "string", + "description": "Parent task identifier. This field is omitted if it is a top-level task. This field is read-only. Use the \"move\" method to move the task under a different parent or to the top level." + }, + "position": { + "type": "string", + "description": "String indicating the position of the task among its sibling tasks under the same parent task or at the top level. If this string is greater than another task's corresponding position string according to lexicographical ordering, the task is positioned after the other task under the same parent task (or at the top level). This field is read-only. Use the \"move\" method to move the task to another position." + }, + "selfLink": { + "type": "string", + "description": "URL pointing to this task. Used to retrieve, update, or delete this task." + }, + "status": { + "type": "string", + "description": "Status of the task. This is either \"needsAction\" or \"completed\"." + }, + "title": { + "type": "string", + "description": "Title of the task." + }, + "updated": { + "type": "string", + "description": "Last modification time of the task (as a RFC 3339 timestamp).", + "format": "date-time" + } + } + }, + "TaskList": { + "id": "TaskList", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "id": { + "type": "string", + "description": "Task list identifier." + }, + "kind": { + "type": "string", + "description": "Type of the resource. This is always \"tasks#taskList\".", + "default": "tasks#taskList" + }, + "selfLink": { + "type": "string", + "description": "URL pointing to this task list. Used to retrieve, update, or delete this task list." + }, + "title": { + "type": "string", + "description": "Title of the task list." + }, + "updated": { + "type": "string", + "description": "Last modification time of the task list (as a RFC 3339 timestamp).", + "format": "date-time" + } + } + }, + "TaskLists": { + "id": "TaskLists", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "items": { + "type": "array", + "description": "Collection of task lists.", + "items": { + "$ref": "TaskList" + } + }, + "kind": { + "type": "string", + "description": "Type of the resource. This is always \"tasks#taskLists\".", + "default": "tasks#taskLists" + }, + "nextPageToken": { + "type": "string", + "description": "Token that can be used to request the next page of this result." + } + } + }, + "Tasks": { + "id": "Tasks", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "items": { + "type": "array", + "description": "Collection of tasks.", + "items": { + "$ref": "Task" + } + }, + "kind": { + "type": "string", + "description": "Type of the resource. This is always \"tasks#tasks\".", + "default": "tasks#tasks" + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access the next page of this result." + } + } + } + }, + "resources": { + "tasklists": { + "methods": { + "delete": { + "id": "tasks.tasklists.delete", + "path": "users/@me/lists/{tasklist}", + "httpMethod": "DELETE", + "description": "Deletes the authenticated user's specified task list.", + "parameters": { + "tasklist": { + "type": "string", + "description": "Task list identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tasklist" + ], + "scopes": [ + "https://www.googleapis.com/auth/tasks" + ] + }, + "get": { + "id": "tasks.tasklists.get", + "path": "users/@me/lists/{tasklist}", + "httpMethod": "GET", + "description": "Returns the authenticated user's specified task list.", + "parameters": { + "tasklist": { + "type": "string", + "description": "Task list identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tasklist" + ], + "response": { + "$ref": "TaskList" + }, + "scopes": [ + "https://www.googleapis.com/auth/tasks", + "https://www.googleapis.com/auth/tasks.readonly" + ] + }, + "insert": { + "id": "tasks.tasklists.insert", + "path": "users/@me/lists", + "httpMethod": "POST", + "description": "Creates a new task list and adds it to the authenticated user's task lists.", + "request": { + "$ref": "TaskList" + }, + "response": { + "$ref": "TaskList" + }, + "scopes": [ + "https://www.googleapis.com/auth/tasks" + ] + }, + "list": { + "id": "tasks.tasklists.list", + "path": "users/@me/lists", + "httpMethod": "GET", + "description": "Returns all the authenticated user's task lists.", + "parameters": { + "maxResults": { + "type": "string", + "description": "Maximum number of task lists returned on one page. Optional. The default is 100.", + "format": "int64", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token specifying the result page to return. Optional.", + "location": "query" + } + }, + "response": { + "$ref": "TaskLists" + }, + "scopes": [ + "https://www.googleapis.com/auth/tasks", + "https://www.googleapis.com/auth/tasks.readonly" + ] + }, + "patch": { + "id": "tasks.tasklists.patch", + "path": "users/@me/lists/{tasklist}", + "httpMethod": "PATCH", + "description": "Updates the authenticated user's specified task list. This method supports patch semantics.", + "parameters": { + "tasklist": { + "type": "string", + "description": "Task list identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tasklist" + ], + "request": { + "$ref": "TaskList" + }, + "response": { + "$ref": "TaskList" + }, + "scopes": [ + "https://www.googleapis.com/auth/tasks" + ] + }, + "update": { + "id": "tasks.tasklists.update", + "path": "users/@me/lists/{tasklist}", + "httpMethod": "PUT", + "description": "Updates the authenticated user's specified task list.", + "parameters": { + "tasklist": { + "type": "string", + "description": "Task list identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tasklist" + ], + "request": { + "$ref": "TaskList" + }, + "response": { + "$ref": "TaskList" + }, + "scopes": [ + "https://www.googleapis.com/auth/tasks" + ] + } + } + }, + "tasks": { + "methods": { + "clear": { + "id": "tasks.tasks.clear", + "path": "lists/{tasklist}/clear", + "httpMethod": "POST", + "description": "Clears all completed tasks from the specified task list. The affected tasks will be marked as 'hidden' and no longer be returned by default when retrieving all tasks for a task list.", + "parameters": { + "tasklist": { + "type": "string", + "description": "Task list identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tasklist" + ], + "scopes": [ + "https://www.googleapis.com/auth/tasks" + ] + }, + "delete": { + "id": "tasks.tasks.delete", + "path": "lists/{tasklist}/tasks/{task}", + "httpMethod": "DELETE", + "description": "Deletes the specified task from the task list.", + "parameters": { + "task": { + "type": "string", + "description": "Task identifier.", + "required": true, + "location": "path" + }, + "tasklist": { + "type": "string", + "description": "Task list identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tasklist", + "task" + ], + "scopes": [ + "https://www.googleapis.com/auth/tasks" + ] + }, + "get": { + "id": "tasks.tasks.get", + "path": "lists/{tasklist}/tasks/{task}", + "httpMethod": "GET", + "description": "Returns the specified task.", + "parameters": { + "task": { + "type": "string", + "description": "Task identifier.", + "required": true, + "location": "path" + }, + "tasklist": { + "type": "string", + "description": "Task list identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tasklist", + "task" + ], + "response": { + "$ref": "Task" + }, + "scopes": [ + "https://www.googleapis.com/auth/tasks", + "https://www.googleapis.com/auth/tasks.readonly" + ] + }, + "insert": { + "id": "tasks.tasks.insert", + "path": "lists/{tasklist}/tasks", + "httpMethod": "POST", + "description": "Creates a new task on the specified task list.", + "parameters": { + "parent": { + "type": "string", + "description": "Parent task identifier. If the task is created at the top level, this parameter is omitted. Optional.", + "location": "query" + }, + "previous": { + "type": "string", + "description": "Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted. Optional.", + "location": "query" + }, + "tasklist": { + "type": "string", + "description": "Task list identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tasklist" + ], + "request": { + "$ref": "Task" + }, + "response": { + "$ref": "Task" + }, + "scopes": [ + "https://www.googleapis.com/auth/tasks" + ] + }, + "list": { + "id": "tasks.tasks.list", + "path": "lists/{tasklist}/tasks", + "httpMethod": "GET", + "description": "Returns all tasks in the specified task list.", + "parameters": { + "completedMax": { + "type": "string", + "description": "Upper bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date.", + "location": "query" + }, + "completedMin": { + "type": "string", + "description": "Lower bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date.", + "location": "query" + }, + "dueMax": { + "type": "string", + "description": "Upper bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date.", + "location": "query" + }, + "dueMin": { + "type": "string", + "description": "Lower bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date.", + "location": "query" + }, + "maxResults": { + "type": "string", + "description": "Maximum number of task lists returned on one page. Optional. The default is 100.", + "format": "int64", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token specifying the result page to return. Optional.", + "location": "query" + }, + "showCompleted": { + "type": "boolean", + "description": "Flag indicating whether completed tasks are returned in the result. Optional. The default is True.", + "location": "query" + }, + "showDeleted": { + "type": "boolean", + "description": "Flag indicating whether deleted tasks are returned in the result. Optional. The default is False.", + "location": "query" + }, + "showHidden": { + "type": "boolean", + "description": "Flag indicating whether hidden tasks are returned in the result. Optional. The default is False.", + "location": "query" + }, + "tasklist": { + "type": "string", + "description": "Task list identifier.", + "required": true, + "location": "path" + }, + "updatedMin": { + "type": "string", + "description": "Lower bound for a task's last modification time (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by last modification time.", + "location": "query" + } + }, + "parameterOrder": [ + "tasklist" + ], + "response": { + "$ref": "Tasks" + }, + "scopes": [ + "https://www.googleapis.com/auth/tasks", + "https://www.googleapis.com/auth/tasks.readonly" + ] + }, + "move": { + "id": "tasks.tasks.move", + "path": "lists/{tasklist}/tasks/{task}/move", + "httpMethod": "POST", + "description": "Moves the specified task to another position in the task list. This can include putting it as a child task under a new parent and/or move it to a different position among its sibling tasks.", + "parameters": { + "parent": { + "type": "string", + "description": "New parent task identifier. If the task is moved to the top level, this parameter is omitted. Optional.", + "location": "query" + }, + "previous": { + "type": "string", + "description": "New previous sibling task identifier. If the task is moved to the first position among its siblings, this parameter is omitted. Optional.", + "location": "query" + }, + "task": { + "type": "string", + "description": "Task identifier.", + "required": true, + "location": "path" + }, + "tasklist": { + "type": "string", + "description": "Task list identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tasklist", + "task" + ], + "response": { + "$ref": "Task" + }, + "scopes": [ + "https://www.googleapis.com/auth/tasks" + ] + }, + "patch": { + "id": "tasks.tasks.patch", + "path": "lists/{tasklist}/tasks/{task}", + "httpMethod": "PATCH", + "description": "Updates the specified task. This method supports patch semantics.", + "parameters": { + "task": { + "type": "string", + "description": "Task identifier.", + "required": true, + "location": "path" + }, + "tasklist": { + "type": "string", + "description": "Task list identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tasklist", + "task" + ], + "request": { + "$ref": "Task" + }, + "response": { + "$ref": "Task" + }, + "scopes": [ + "https://www.googleapis.com/auth/tasks" + ] + }, + "update": { + "id": "tasks.tasks.update", + "path": "lists/{tasklist}/tasks/{task}", + "httpMethod": "PUT", + "description": "Updates the specified task.", + "parameters": { + "task": { + "type": "string", + "description": "Task identifier.", + "required": true, + "location": "path" + }, + "tasklist": { + "type": "string", + "description": "Task list identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tasklist", + "task" + ], + "request": { + "$ref": "Task" + }, + "response": { + "$ref": "Task" + }, + "scopes": [ + "https://www.googleapis.com/auth/tasks" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/tasks/v1/tasks-gen.go b/third_party/src/code.google.com/p/google-api-go-client/tasks/v1/tasks-gen.go new file mode 100644 index 0000000000000..bcac0356e4a18 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/tasks/v1/tasks-gen.go @@ -0,0 +1,1440 @@ +// Package tasks provides access to the Tasks API. +// +// See https://developers.google.com/google-apps/tasks/firstapp +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/tasks/v1" +// ... +// tasksService, err := tasks.New(oauthHttpClient) +package tasks + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "tasks:v1" +const apiName = "tasks" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/tasks/v1/" + +// OAuth2 scopes used by this API. +const ( + // Manage your tasks + TasksScope = "https://www.googleapis.com/auth/tasks" + + // View your tasks + TasksReadonlyScope = "https://www.googleapis.com/auth/tasks.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.Tasklists = NewTasklistsService(s) + s.Tasks = NewTasksService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Tasklists *TasklistsService + + Tasks *TasksService +} + +func NewTasklistsService(s *Service) *TasklistsService { + rs := &TasklistsService{s: s} + return rs +} + +type TasklistsService struct { + s *Service +} + +func NewTasksService(s *Service) *TasksService { + rs := &TasksService{s: s} + return rs +} + +type TasksService struct { + s *Service +} + +type Task struct { + // Completed: Completion date of the task (as a RFC 3339 timestamp). + // This field is omitted if the task has not been completed. + Completed string `json:"completed,omitempty"` + + // Deleted: Flag indicating whether the task has been deleted. The + // default if False. + Deleted bool `json:"deleted,omitempty"` + + // Due: Due date of the task (as a RFC 3339 timestamp). Optional. + Due string `json:"due,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Hidden: Flag indicating whether the task is hidden. This is the case + // if the task had been marked completed when the task list was last + // cleared. The default is False. This field is read-only. + Hidden bool `json:"hidden,omitempty"` + + // Id: Task identifier. + Id string `json:"id,omitempty"` + + // Kind: Type of the resource. This is always "tasks#task". + Kind string `json:"kind,omitempty"` + + // Links: Collection of links. This collection is read-only. + Links []*TaskLinks `json:"links,omitempty"` + + // Notes: Notes describing the task. Optional. + Notes string `json:"notes,omitempty"` + + // Parent: Parent task identifier. This field is omitted if it is a + // top-level task. This field is read-only. Use the "move" method to + // move the task under a different parent or to the top level. + Parent string `json:"parent,omitempty"` + + // Position: String indicating the position of the task among its + // sibling tasks under the same parent task or at the top level. If this + // string is greater than another task's corresponding position string + // according to lexicographical ordering, the task is positioned after + // the other task under the same parent task (or at the top level). This + // field is read-only. Use the "move" method to move the task to another + // position. + Position string `json:"position,omitempty"` + + // SelfLink: URL pointing to this task. Used to retrieve, update, or + // delete this task. + SelfLink string `json:"selfLink,omitempty"` + + // Status: Status of the task. This is either "needsAction" or + // "completed". + Status string `json:"status,omitempty"` + + // Title: Title of the task. + Title string `json:"title,omitempty"` + + // Updated: Last modification time of the task (as a RFC 3339 + // timestamp). + Updated string `json:"updated,omitempty"` +} + +type TaskLinks struct { + // Description: The description. In HTML speak: Everything between + // and . + Description string `json:"description,omitempty"` + + // Link: The URL. + Link string `json:"link,omitempty"` + + // Type: Type of the link, e.g. "email". + Type string `json:"type,omitempty"` +} + +type TaskList struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Id: Task list identifier. + Id string `json:"id,omitempty"` + + // Kind: Type of the resource. This is always "tasks#taskList". + Kind string `json:"kind,omitempty"` + + // SelfLink: URL pointing to this task list. Used to retrieve, update, + // or delete this task list. + SelfLink string `json:"selfLink,omitempty"` + + // Title: Title of the task list. + Title string `json:"title,omitempty"` + + // Updated: Last modification time of the task list (as a RFC 3339 + // timestamp). + Updated string `json:"updated,omitempty"` +} + +type TaskLists struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Items: Collection of task lists. + Items []*TaskList `json:"items,omitempty"` + + // Kind: Type of the resource. This is always "tasks#taskLists". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token that can be used to request the next page of + // this result. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +type Tasks struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Items: Collection of tasks. + Items []*Task `json:"items,omitempty"` + + // Kind: Type of the resource. This is always "tasks#tasks". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token used to access the next page of this result. + NextPageToken string `json:"nextPageToken,omitempty"` +} + +// method id "tasks.tasklists.delete": + +type TasklistsDeleteCall struct { + s *Service + tasklistid string + opt_ map[string]interface{} +} + +// Delete: Deletes the authenticated user's specified task list. +func (r *TasklistsService) Delete(tasklistid string) *TasklistsDeleteCall { + c := &TasklistsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.tasklistid = tasklistid + return c +} + +func (c *TasklistsDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/@me/lists/{tasklist}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{tasklist}", url.QueryEscape(c.tasklistid), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the authenticated user's specified task list.", + // "httpMethod": "DELETE", + // "id": "tasks.tasklists.delete", + // "parameterOrder": [ + // "tasklist" + // ], + // "parameters": { + // "tasklist": { + // "description": "Task list identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/@me/lists/{tasklist}", + // "scopes": [ + // "https://www.googleapis.com/auth/tasks" + // ] + // } + +} + +// method id "tasks.tasklists.get": + +type TasklistsGetCall struct { + s *Service + tasklistid string + opt_ map[string]interface{} +} + +// Get: Returns the authenticated user's specified task list. +func (r *TasklistsService) Get(tasklistid string) *TasklistsGetCall { + c := &TasklistsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.tasklistid = tasklistid + return c +} + +func (c *TasklistsGetCall) Do() (*TaskList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/@me/lists/{tasklist}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{tasklist}", url.QueryEscape(c.tasklistid), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TaskList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the authenticated user's specified task list.", + // "httpMethod": "GET", + // "id": "tasks.tasklists.get", + // "parameterOrder": [ + // "tasklist" + // ], + // "parameters": { + // "tasklist": { + // "description": "Task list identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/@me/lists/{tasklist}", + // "response": { + // "$ref": "TaskList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tasks", + // "https://www.googleapis.com/auth/tasks.readonly" + // ] + // } + +} + +// method id "tasks.tasklists.insert": + +type TasklistsInsertCall struct { + s *Service + tasklist *TaskList + opt_ map[string]interface{} +} + +// Insert: Creates a new task list and adds it to the authenticated +// user's task lists. +func (r *TasklistsService) Insert(tasklist *TaskList) *TasklistsInsertCall { + c := &TasklistsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.tasklist = tasklist + return c +} + +func (c *TasklistsInsertCall) Do() (*TaskList, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.tasklist) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/@me/lists") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TaskList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new task list and adds it to the authenticated user's task lists.", + // "httpMethod": "POST", + // "id": "tasks.tasklists.insert", + // "path": "users/@me/lists", + // "request": { + // "$ref": "TaskList" + // }, + // "response": { + // "$ref": "TaskList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tasks" + // ] + // } + +} + +// method id "tasks.tasklists.list": + +type TasklistsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Returns all the authenticated user's task lists. +func (r *TasklistsService) List() *TasklistsListCall { + c := &TasklistsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of task lists returned on one page. The default is 100. +func (c *TasklistsListCall) MaxResults(maxResults int64) *TasklistsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Token specifying +// the result page to return. +func (c *TasklistsListCall) PageToken(pageToken string) *TasklistsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +func (c *TasklistsListCall) Do() (*TaskLists, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/@me/lists") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TaskLists) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns all the authenticated user's task lists.", + // "httpMethod": "GET", + // "id": "tasks.tasklists.list", + // "parameters": { + // "maxResults": { + // "description": "Maximum number of task lists returned on one page. Optional. The default is 100.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Token specifying the result page to return. Optional.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "users/@me/lists", + // "response": { + // "$ref": "TaskLists" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tasks", + // "https://www.googleapis.com/auth/tasks.readonly" + // ] + // } + +} + +// method id "tasks.tasklists.patch": + +type TasklistsPatchCall struct { + s *Service + tasklistid string + tasklist *TaskList + opt_ map[string]interface{} +} + +// Patch: Updates the authenticated user's specified task list. This +// method supports patch semantics. +func (r *TasklistsService) Patch(tasklistid string, tasklist *TaskList) *TasklistsPatchCall { + c := &TasklistsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.tasklistid = tasklistid + c.tasklist = tasklist + return c +} + +func (c *TasklistsPatchCall) Do() (*TaskList, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.tasklist) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/@me/lists/{tasklist}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{tasklist}", url.QueryEscape(c.tasklistid), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TaskList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the authenticated user's specified task list. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "tasks.tasklists.patch", + // "parameterOrder": [ + // "tasklist" + // ], + // "parameters": { + // "tasklist": { + // "description": "Task list identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/@me/lists/{tasklist}", + // "request": { + // "$ref": "TaskList" + // }, + // "response": { + // "$ref": "TaskList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tasks" + // ] + // } + +} + +// method id "tasks.tasklists.update": + +type TasklistsUpdateCall struct { + s *Service + tasklistid string + tasklist *TaskList + opt_ map[string]interface{} +} + +// Update: Updates the authenticated user's specified task list. +func (r *TasklistsService) Update(tasklistid string, tasklist *TaskList) *TasklistsUpdateCall { + c := &TasklistsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.tasklistid = tasklistid + c.tasklist = tasklist + return c +} + +func (c *TasklistsUpdateCall) Do() (*TaskList, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.tasklist) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "users/@me/lists/{tasklist}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{tasklist}", url.QueryEscape(c.tasklistid), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TaskList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the authenticated user's specified task list.", + // "httpMethod": "PUT", + // "id": "tasks.tasklists.update", + // "parameterOrder": [ + // "tasklist" + // ], + // "parameters": { + // "tasklist": { + // "description": "Task list identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "users/@me/lists/{tasklist}", + // "request": { + // "$ref": "TaskList" + // }, + // "response": { + // "$ref": "TaskList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tasks" + // ] + // } + +} + +// method id "tasks.tasks.clear": + +type TasksClearCall struct { + s *Service + tasklistid string + opt_ map[string]interface{} +} + +// Clear: Clears all completed tasks from the specified task list. The +// affected tasks will be marked as 'hidden' and no longer be returned +// by default when retrieving all tasks for a task list. +func (r *TasksService) Clear(tasklistid string) *TasksClearCall { + c := &TasksClearCall{s: r.s, opt_: make(map[string]interface{})} + c.tasklistid = tasklistid + return c +} + +func (c *TasksClearCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "lists/{tasklist}/clear") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{tasklist}", url.QueryEscape(c.tasklistid), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Clears all completed tasks from the specified task list. The affected tasks will be marked as 'hidden' and no longer be returned by default when retrieving all tasks for a task list.", + // "httpMethod": "POST", + // "id": "tasks.tasks.clear", + // "parameterOrder": [ + // "tasklist" + // ], + // "parameters": { + // "tasklist": { + // "description": "Task list identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "lists/{tasklist}/clear", + // "scopes": [ + // "https://www.googleapis.com/auth/tasks" + // ] + // } + +} + +// method id "tasks.tasks.delete": + +type TasksDeleteCall struct { + s *Service + tasklistid string + taskid string + opt_ map[string]interface{} +} + +// Delete: Deletes the specified task from the task list. +func (r *TasksService) Delete(tasklistid string, taskid string) *TasksDeleteCall { + c := &TasksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.tasklistid = tasklistid + c.taskid = taskid + return c +} + +func (c *TasksDeleteCall) Do() error { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "lists/{tasklist}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{tasklist}", url.QueryEscape(c.tasklistid), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{task}", url.QueryEscape(c.taskid), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified task from the task list.", + // "httpMethod": "DELETE", + // "id": "tasks.tasks.delete", + // "parameterOrder": [ + // "tasklist", + // "task" + // ], + // "parameters": { + // "task": { + // "description": "Task identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tasklist": { + // "description": "Task list identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "lists/{tasklist}/tasks/{task}", + // "scopes": [ + // "https://www.googleapis.com/auth/tasks" + // ] + // } + +} + +// method id "tasks.tasks.get": + +type TasksGetCall struct { + s *Service + tasklistid string + taskid string + opt_ map[string]interface{} +} + +// Get: Returns the specified task. +func (r *TasksService) Get(tasklistid string, taskid string) *TasksGetCall { + c := &TasksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.tasklistid = tasklistid + c.taskid = taskid + return c +} + +func (c *TasksGetCall) Do() (*Task, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "lists/{tasklist}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{tasklist}", url.QueryEscape(c.tasklistid), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{task}", url.QueryEscape(c.taskid), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Task) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified task.", + // "httpMethod": "GET", + // "id": "tasks.tasks.get", + // "parameterOrder": [ + // "tasklist", + // "task" + // ], + // "parameters": { + // "task": { + // "description": "Task identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tasklist": { + // "description": "Task list identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "lists/{tasklist}/tasks/{task}", + // "response": { + // "$ref": "Task" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tasks", + // "https://www.googleapis.com/auth/tasks.readonly" + // ] + // } + +} + +// method id "tasks.tasks.insert": + +type TasksInsertCall struct { + s *Service + tasklistid string + task *Task + opt_ map[string]interface{} +} + +// Insert: Creates a new task on the specified task list. +func (r *TasksService) Insert(tasklistid string, task *Task) *TasksInsertCall { + c := &TasksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.tasklistid = tasklistid + c.task = task + return c +} + +// Parent sets the optional parameter "parent": Parent task identifier. +// If the task is created at the top level, this parameter is omitted. +func (c *TasksInsertCall) Parent(parent string) *TasksInsertCall { + c.opt_["parent"] = parent + return c +} + +// Previous sets the optional parameter "previous": Previous sibling +// task identifier. If the task is created at the first position among +// its siblings, this parameter is omitted. +func (c *TasksInsertCall) Previous(previous string) *TasksInsertCall { + c.opt_["previous"] = previous + return c +} + +func (c *TasksInsertCall) Do() (*Task, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.task) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["parent"]; ok { + params.Set("parent", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["previous"]; ok { + params.Set("previous", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "lists/{tasklist}/tasks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{tasklist}", url.QueryEscape(c.tasklistid), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Task) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new task on the specified task list.", + // "httpMethod": "POST", + // "id": "tasks.tasks.insert", + // "parameterOrder": [ + // "tasklist" + // ], + // "parameters": { + // "parent": { + // "description": "Parent task identifier. If the task is created at the top level, this parameter is omitted. Optional.", + // "location": "query", + // "type": "string" + // }, + // "previous": { + // "description": "Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted. Optional.", + // "location": "query", + // "type": "string" + // }, + // "tasklist": { + // "description": "Task list identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "lists/{tasklist}/tasks", + // "request": { + // "$ref": "Task" + // }, + // "response": { + // "$ref": "Task" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tasks" + // ] + // } + +} + +// method id "tasks.tasks.list": + +type TasksListCall struct { + s *Service + tasklistid string + opt_ map[string]interface{} +} + +// List: Returns all tasks in the specified task list. +func (r *TasksService) List(tasklistid string) *TasksListCall { + c := &TasksListCall{s: r.s, opt_: make(map[string]interface{})} + c.tasklistid = tasklistid + return c +} + +// CompletedMax sets the optional parameter "completedMax": Upper bound +// for a task's completion date (as a RFC 3339 timestamp) to filter by. +// The default is not to filter by completion date. +func (c *TasksListCall) CompletedMax(completedMax string) *TasksListCall { + c.opt_["completedMax"] = completedMax + return c +} + +// CompletedMin sets the optional parameter "completedMin": Lower bound +// for a task's completion date (as a RFC 3339 timestamp) to filter by. +// The default is not to filter by completion date. +func (c *TasksListCall) CompletedMin(completedMin string) *TasksListCall { + c.opt_["completedMin"] = completedMin + return c +} + +// DueMax sets the optional parameter "dueMax": Upper bound for a task's +// due date (as a RFC 3339 timestamp) to filter by. The default is not +// to filter by due date. +func (c *TasksListCall) DueMax(dueMax string) *TasksListCall { + c.opt_["dueMax"] = dueMax + return c +} + +// DueMin sets the optional parameter "dueMin": Lower bound for a task's +// due date (as a RFC 3339 timestamp) to filter by. The default is not +// to filter by due date. +func (c *TasksListCall) DueMin(dueMin string) *TasksListCall { + c.opt_["dueMin"] = dueMin + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of task lists returned on one page. The default is 100. +func (c *TasksListCall) MaxResults(maxResults int64) *TasksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Token specifying +// the result page to return. +func (c *TasksListCall) PageToken(pageToken string) *TasksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ShowCompleted sets the optional parameter "showCompleted": Flag +// indicating whether completed tasks are returned in the result. The +// default is True. +func (c *TasksListCall) ShowCompleted(showCompleted bool) *TasksListCall { + c.opt_["showCompleted"] = showCompleted + return c +} + +// ShowDeleted sets the optional parameter "showDeleted": Flag +// indicating whether deleted tasks are returned in the result. The +// default is False. +func (c *TasksListCall) ShowDeleted(showDeleted bool) *TasksListCall { + c.opt_["showDeleted"] = showDeleted + return c +} + +// ShowHidden sets the optional parameter "showHidden": Flag indicating +// whether hidden tasks are returned in the result. The default is +// False. +func (c *TasksListCall) ShowHidden(showHidden bool) *TasksListCall { + c.opt_["showHidden"] = showHidden + return c +} + +// UpdatedMin sets the optional parameter "updatedMin": Lower bound for +// a task's last modification time (as a RFC 3339 timestamp) to filter +// by. The default is not to filter by last modification time. +func (c *TasksListCall) UpdatedMin(updatedMin string) *TasksListCall { + c.opt_["updatedMin"] = updatedMin + return c +} + +func (c *TasksListCall) Do() (*Tasks, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["completedMax"]; ok { + params.Set("completedMax", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["completedMin"]; ok { + params.Set("completedMin", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dueMax"]; ok { + params.Set("dueMax", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dueMin"]; ok { + params.Set("dueMin", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["showCompleted"]; ok { + params.Set("showCompleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["showDeleted"]; ok { + params.Set("showDeleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["showHidden"]; ok { + params.Set("showHidden", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updatedMin"]; ok { + params.Set("updatedMin", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "lists/{tasklist}/tasks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{tasklist}", url.QueryEscape(c.tasklistid), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Tasks) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns all tasks in the specified task list.", + // "httpMethod": "GET", + // "id": "tasks.tasks.list", + // "parameterOrder": [ + // "tasklist" + // ], + // "parameters": { + // "completedMax": { + // "description": "Upper bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date.", + // "location": "query", + // "type": "string" + // }, + // "completedMin": { + // "description": "Lower bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date.", + // "location": "query", + // "type": "string" + // }, + // "dueMax": { + // "description": "Upper bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date.", + // "location": "query", + // "type": "string" + // }, + // "dueMin": { + // "description": "Lower bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of task lists returned on one page. Optional. The default is 100.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Token specifying the result page to return. Optional.", + // "location": "query", + // "type": "string" + // }, + // "showCompleted": { + // "description": "Flag indicating whether completed tasks are returned in the result. Optional. The default is True.", + // "location": "query", + // "type": "boolean" + // }, + // "showDeleted": { + // "description": "Flag indicating whether deleted tasks are returned in the result. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "showHidden": { + // "description": "Flag indicating whether hidden tasks are returned in the result. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "tasklist": { + // "description": "Task list identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "updatedMin": { + // "description": "Lower bound for a task's last modification time (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by last modification time.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "lists/{tasklist}/tasks", + // "response": { + // "$ref": "Tasks" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tasks", + // "https://www.googleapis.com/auth/tasks.readonly" + // ] + // } + +} + +// method id "tasks.tasks.move": + +type TasksMoveCall struct { + s *Service + tasklistid string + taskid string + opt_ map[string]interface{} +} + +// Move: Moves the specified task to another position in the task list. +// This can include putting it as a child task under a new parent and/or +// move it to a different position among its sibling tasks. +func (r *TasksService) Move(tasklistid string, taskid string) *TasksMoveCall { + c := &TasksMoveCall{s: r.s, opt_: make(map[string]interface{})} + c.tasklistid = tasklistid + c.taskid = taskid + return c +} + +// Parent sets the optional parameter "parent": New parent task +// identifier. If the task is moved to the top level, this parameter is +// omitted. +func (c *TasksMoveCall) Parent(parent string) *TasksMoveCall { + c.opt_["parent"] = parent + return c +} + +// Previous sets the optional parameter "previous": New previous sibling +// task identifier. If the task is moved to the first position among its +// siblings, this parameter is omitted. +func (c *TasksMoveCall) Previous(previous string) *TasksMoveCall { + c.opt_["previous"] = previous + return c +} + +func (c *TasksMoveCall) Do() (*Task, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["parent"]; ok { + params.Set("parent", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["previous"]; ok { + params.Set("previous", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "lists/{tasklist}/tasks/{task}/move") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{tasklist}", url.QueryEscape(c.tasklistid), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{task}", url.QueryEscape(c.taskid), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Task) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Moves the specified task to another position in the task list. This can include putting it as a child task under a new parent and/or move it to a different position among its sibling tasks.", + // "httpMethod": "POST", + // "id": "tasks.tasks.move", + // "parameterOrder": [ + // "tasklist", + // "task" + // ], + // "parameters": { + // "parent": { + // "description": "New parent task identifier. If the task is moved to the top level, this parameter is omitted. Optional.", + // "location": "query", + // "type": "string" + // }, + // "previous": { + // "description": "New previous sibling task identifier. If the task is moved to the first position among its siblings, this parameter is omitted. Optional.", + // "location": "query", + // "type": "string" + // }, + // "task": { + // "description": "Task identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tasklist": { + // "description": "Task list identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "lists/{tasklist}/tasks/{task}/move", + // "response": { + // "$ref": "Task" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tasks" + // ] + // } + +} + +// method id "tasks.tasks.patch": + +type TasksPatchCall struct { + s *Service + tasklistid string + taskid string + task *Task + opt_ map[string]interface{} +} + +// Patch: Updates the specified task. This method supports patch +// semantics. +func (r *TasksService) Patch(tasklistid string, taskid string, task *Task) *TasksPatchCall { + c := &TasksPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.tasklistid = tasklistid + c.taskid = taskid + c.task = task + return c +} + +func (c *TasksPatchCall) Do() (*Task, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.task) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "lists/{tasklist}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{tasklist}", url.QueryEscape(c.tasklistid), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{task}", url.QueryEscape(c.taskid), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Task) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified task. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "tasks.tasks.patch", + // "parameterOrder": [ + // "tasklist", + // "task" + // ], + // "parameters": { + // "task": { + // "description": "Task identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tasklist": { + // "description": "Task list identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "lists/{tasklist}/tasks/{task}", + // "request": { + // "$ref": "Task" + // }, + // "response": { + // "$ref": "Task" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tasks" + // ] + // } + +} + +// method id "tasks.tasks.update": + +type TasksUpdateCall struct { + s *Service + tasklistid string + taskid string + task *Task + opt_ map[string]interface{} +} + +// Update: Updates the specified task. +func (r *TasksService) Update(tasklistid string, taskid string, task *Task) *TasksUpdateCall { + c := &TasksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.tasklistid = tasklistid + c.taskid = taskid + c.task = task + return c +} + +func (c *TasksUpdateCall) Do() (*Task, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.task) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "lists/{tasklist}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.URL.Path = strings.Replace(req.URL.Path, "{tasklist}", url.QueryEscape(c.tasklistid), 1) + req.URL.Path = strings.Replace(req.URL.Path, "{task}", url.QueryEscape(c.taskid), 1) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Task) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified task.", + // "httpMethod": "PUT", + // "id": "tasks.tasks.update", + // "parameterOrder": [ + // "tasklist", + // "task" + // ], + // "parameters": { + // "task": { + // "description": "Task identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tasklist": { + // "description": "Task list identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "lists/{tasklist}/tasks/{task}", + // "request": { + // "$ref": "Task" + // }, + // "response": { + // "$ref": "Task" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tasks" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/translate/v2/translate-api.json b/third_party/src/code.google.com/p/google-api-go-client/translate/v2/translate-api.json new file mode 100644 index 0000000000000..804f49543f640 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/translate/v2/translate-api.json @@ -0,0 +1,266 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/4Ip-FKZqF7Vovq8mU1yMUQ2gvUM\"", + "discoveryVersion": "v1", + "id": "translate:v2", + "name": "translate", + "version": "v2", + "title": "Translate API", + "description": "Lets you translate text from one language to another", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/translate-16.png", + "x32": "http://www.google.com/images/icons/product/translate-32.png" + }, + "documentationLink": "https://developers.google.com/translate/v2/using_rest", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/language/translate/", + "basePath": "/language/translate/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "language/translate/", + "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" + } + }, + "features": [ + "dataWrapper" + ], + "schemas": { + "DetectionsListResponse": { + "id": "DetectionsListResponse", + "type": "object", + "properties": { + "detections": { + "type": "array", + "description": "A detections contains detection results of several text", + "items": { + "$ref": "DetectionsResource" + } + } + } + }, + "DetectionsResource": { + "id": "DetectionsResource", + "type": "array", + "description": "An array of languages which we detect for the given text The most likely language list first.", + "items": { + "type": "object", + "properties": { + "confidence": { + "type": "number", + "description": "The confidence of the detection resul of this language.", + "format": "float" + }, + "isReliable": { + "type": "boolean", + "description": "A boolean to indicate is the language detection result reliable." + }, + "language": { + "type": "string", + "description": "The language we detect" + } + } + } + }, + "LanguagesListResponse": { + "id": "LanguagesListResponse", + "type": "object", + "properties": { + "languages": { + "type": "array", + "description": "List of source/target languages supported by the translation API. If target parameter is unspecified, the list is sorted by the ASCII code point order of the language code. If target parameter is specified, the list is sorted by the collation order of the language name in the target language.", + "items": { + "$ref": "LanguagesResource" + } + } + } + }, + "LanguagesResource": { + "id": "LanguagesResource", + "type": "object", + "properties": { + "language": { + "type": "string", + "description": "The language code." + }, + "name": { + "type": "string", + "description": "The localized name of the language if target parameter is given." + } + } + }, + "TranslationsListResponse": { + "id": "TranslationsListResponse", + "type": "object", + "properties": { + "translations": { + "type": "array", + "description": "Translations contains list of translation results of given text", + "items": { + "$ref": "TranslationsResource" + } + } + } + }, + "TranslationsResource": { + "id": "TranslationsResource", + "type": "object", + "properties": { + "detectedSourceLanguage": { + "type": "string", + "description": "Detected source language if source parameter is unspecified." + }, + "translatedText": { + "type": "string", + "description": "The translation." + } + } + } + }, + "resources": { + "detections": { + "methods": { + "list": { + "id": "language.detections.list", + "path": "v2/detect", + "httpMethod": "GET", + "description": "Detect the language of text.", + "parameters": { + "q": { + "type": "string", + "description": "The text to detect", + "required": true, + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "q" + ], + "response": { + "$ref": "DetectionsListResponse" + } + } + } + }, + "languages": { + "methods": { + "list": { + "id": "language.languages.list", + "path": "v2/languages", + "httpMethod": "GET", + "description": "List the source/target languages supported by the API", + "parameters": { + "target": { + "type": "string", + "description": "the language and collation in which the localized results should be returned", + "location": "query" + } + }, + "response": { + "$ref": "LanguagesListResponse" + } + } + } + }, + "translations": { + "methods": { + "list": { + "id": "language.translations.list", + "path": "v2", + "httpMethod": "GET", + "description": "Returns text translations from one language to another.", + "parameters": { + "cid": { + "type": "string", + "description": "The customization id for translate", + "repeated": true, + "location": "query" + }, + "format": { + "type": "string", + "description": "The format of the text", + "enum": [ + "html", + "text" + ], + "enumDescriptions": [ + "Specifies the input is in HTML", + "Specifies the input is in plain textual format" + ], + "location": "query" + }, + "q": { + "type": "string", + "description": "The text to translate", + "required": true, + "repeated": true, + "location": "query" + }, + "source": { + "type": "string", + "description": "The source language of the text", + "location": "query" + }, + "target": { + "type": "string", + "description": "The target language into which the text should be translated", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "q", + "target" + ], + "response": { + "$ref": "TranslationsListResponse" + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/translate/v2/translate-gen.go b/third_party/src/code.google.com/p/google-api-go-client/translate/v2/translate-gen.go new file mode 100644 index 0000000000000..5303094ff1c8a --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/translate/v2/translate-gen.go @@ -0,0 +1,394 @@ +// Package translate provides access to the Translate API. +// +// See https://developers.google.com/translate/v2/using_rest +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/translate/v2" +// ... +// translateService, err := translate.New(oauthHttpClient) +package translate + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "translate:v2" +const apiName = "translate" +const apiVersion = "v2" +const basePath = "https://www.googleapis.com/language/translate/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Detections = NewDetectionsService(s) + s.Languages = NewLanguagesService(s) + s.Translations = NewTranslationsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Detections *DetectionsService + + Languages *LanguagesService + + Translations *TranslationsService +} + +func NewDetectionsService(s *Service) *DetectionsService { + rs := &DetectionsService{s: s} + return rs +} + +type DetectionsService struct { + s *Service +} + +func NewLanguagesService(s *Service) *LanguagesService { + rs := &LanguagesService{s: s} + return rs +} + +type LanguagesService struct { + s *Service +} + +func NewTranslationsService(s *Service) *TranslationsService { + rs := &TranslationsService{s: s} + return rs +} + +type TranslationsService struct { + s *Service +} + +type DetectionsListResponse struct { + // Detections: A detections contains detection results of several text + Detections [][]*DetectionsResourceItem `json:"detections,omitempty"` +} + +type DetectionsResourceItem struct { + // Confidence: The confidence of the detection resul of this language. + Confidence float64 `json:"confidence,omitempty"` + + // IsReliable: A boolean to indicate is the language detection result + // reliable. + IsReliable bool `json:"isReliable,omitempty"` + + // Language: The language we detect + Language string `json:"language,omitempty"` +} + +type LanguagesListResponse struct { + // Languages: List of source/target languages supported by the + // translation API. If target parameter is unspecified, the list is + // sorted by the ASCII code point order of the language code. If target + // parameter is specified, the list is sorted by the collation order of + // the language name in the target language. + Languages []*LanguagesResource `json:"languages,omitempty"` +} + +type LanguagesResource struct { + // Language: The language code. + Language string `json:"language,omitempty"` + + // Name: The localized name of the language if target parameter is + // given. + Name string `json:"name,omitempty"` +} + +type TranslationsListResponse struct { + // Translations: Translations contains list of translation results of + // given text + Translations []*TranslationsResource `json:"translations,omitempty"` +} + +type TranslationsResource struct { + // DetectedSourceLanguage: Detected source language if source parameter + // is unspecified. + DetectedSourceLanguage string `json:"detectedSourceLanguage,omitempty"` + + // TranslatedText: The translation. + TranslatedText string `json:"translatedText,omitempty"` +} + +// method id "language.detections.list": + +type DetectionsListCall struct { + s *Service + q []string + opt_ map[string]interface{} +} + +// List: Detect the language of text. +func (r *DetectionsService) List(q []string) *DetectionsListCall { + c := &DetectionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.q = q + return c +} + +func (c *DetectionsListCall) Do() (*DetectionsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + for _, v := range c.q { + params.Add("q", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/detect") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(DetectionsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Detect the language of text.", + // "httpMethod": "GET", + // "id": "language.detections.list", + // "parameterOrder": [ + // "q" + // ], + // "parameters": { + // "q": { + // "description": "The text to detect", + // "location": "query", + // "repeated": true, + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/detect", + // "response": { + // "$ref": "DetectionsListResponse" + // } + // } + +} + +// method id "language.languages.list": + +type LanguagesListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: List the source/target languages supported by the API +func (r *LanguagesService) List() *LanguagesListCall { + c := &LanguagesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Target sets the optional parameter "target": the language and +// collation in which the localized results should be returned +func (c *LanguagesListCall) Target(target string) *LanguagesListCall { + c.opt_["target"] = target + return c +} + +func (c *LanguagesListCall) Do() (*LanguagesListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["target"]; ok { + params.Set("target", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/languages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(LanguagesListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the source/target languages supported by the API", + // "httpMethod": "GET", + // "id": "language.languages.list", + // "parameters": { + // "target": { + // "description": "the language and collation in which the localized results should be returned", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/languages", + // "response": { + // "$ref": "LanguagesListResponse" + // } + // } + +} + +// method id "language.translations.list": + +type TranslationsListCall struct { + s *Service + q []string + target string + opt_ map[string]interface{} +} + +// List: Returns text translations from one language to another. +func (r *TranslationsService) List(q []string, target string) *TranslationsListCall { + c := &TranslationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.q = q + c.target = target + return c +} + +// Cid sets the optional parameter "cid": The customization id for +// translate +func (c *TranslationsListCall) Cid(cid string) *TranslationsListCall { + c.opt_["cid"] = cid + return c +} + +// Format sets the optional parameter "format": The format of the text +func (c *TranslationsListCall) Format(format string) *TranslationsListCall { + c.opt_["format"] = format + return c +} + +// Source sets the optional parameter "source": The source language of +// the text +func (c *TranslationsListCall) Source(source string) *TranslationsListCall { + c.opt_["source"] = source + return c +} + +func (c *TranslationsListCall) Do() (*TranslationsListResponse, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("target", fmt.Sprintf("%v", c.target)) + for _, v := range c.q { + params.Add("q", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["cid"]; ok { + params.Set("cid", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["format"]; ok { + params.Set("format", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v2") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(TranslationsListResponse) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns text translations from one language to another.", + // "httpMethod": "GET", + // "id": "language.translations.list", + // "parameterOrder": [ + // "q", + // "target" + // ], + // "parameters": { + // "cid": { + // "description": "The customization id for translate", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "format": { + // "description": "The format of the text", + // "enum": [ + // "html", + // "text" + // ], + // "enumDescriptions": [ + // "Specifies the input is in HTML", + // "Specifies the input is in plain textual format" + // ], + // "location": "query", + // "type": "string" + // }, + // "q": { + // "description": "The text to translate", + // "location": "query", + // "repeated": true, + // "required": true, + // "type": "string" + // }, + // "source": { + // "description": "The source language of the text", + // "location": "query", + // "type": "string" + // }, + // "target": { + // "description": "The target language into which the text should be translated", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2", + // "response": { + // "$ref": "TranslationsListResponse" + // } + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/urlshortener/v1/urlshortener-api.json b/third_party/src/code.google.com/p/google-api-go-client/urlshortener/v1/urlshortener-api.json new file mode 100644 index 0000000000000..1032529eec538 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/urlshortener/v1/urlshortener-api.json @@ -0,0 +1,315 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/T4bB77XUfbpGWn7xKXxC7yFKgeE\"", + "discoveryVersion": "v1", + "id": "urlshortener:v1", + "name": "urlshortener", + "version": "v1", + "title": "URL Shortener API", + "description": "Lets you create, inspect, and manage goo.gl short URLs", + "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://code.google.com/apis/urlshortener/v1/getting_started.html", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/urlshortener/v1/", + "basePath": "/urlshortener/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "urlshortener/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/urlshortener": { + "description": "Manage your goo.gl short URLs" + } + } + } + }, + "schemas": { + "AnalyticsSnapshot": { + "id": "AnalyticsSnapshot", + "type": "object", + "properties": { + "browsers": { + "type": "array", + "description": "Top browsers, e.g. \"Chrome\"; sorted by (descending) click counts. Only present if this data is available.", + "items": { + "$ref": "StringCount" + } + }, + "countries": { + "type": "array", + "description": "Top countries (expressed as country codes), e.g. \"US\" or \"DE\"; sorted by (descending) click counts. Only present if this data is available.", + "items": { + "$ref": "StringCount" + } + }, + "longUrlClicks": { + "type": "string", + "description": "Number of clicks on all goo.gl short URLs pointing to this long URL.", + "format": "int64" + }, + "platforms": { + "type": "array", + "description": "Top platforms or OSes, e.g. \"Windows\"; sorted by (descending) click counts. Only present if this data is available.", + "items": { + "$ref": "StringCount" + } + }, + "referrers": { + "type": "array", + "description": "Top referring hosts, e.g. \"www.google.com\"; sorted by (descending) click counts. Only present if this data is available.", + "items": { + "$ref": "StringCount" + } + }, + "shortUrlClicks": { + "type": "string", + "description": "Number of clicks on this short URL.", + "format": "int64" + } + } + }, + "AnalyticsSummary": { + "id": "AnalyticsSummary", + "type": "object", + "properties": { + "allTime": { + "$ref": "AnalyticsSnapshot", + "description": "Click analytics over all time." + }, + "day": { + "$ref": "AnalyticsSnapshot", + "description": "Click analytics over the last day." + }, + "month": { + "$ref": "AnalyticsSnapshot", + "description": "Click analytics over the last month." + }, + "twoHours": { + "$ref": "AnalyticsSnapshot", + "description": "Click analytics over the last two hours." + }, + "week": { + "$ref": "AnalyticsSnapshot", + "description": "Click analytics over the last week." + } + } + }, + "StringCount": { + "id": "StringCount", + "type": "object", + "properties": { + "count": { + "type": "string", + "description": "Number of clicks for this top entry, e.g. for this particular country or browser.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "Label assigned to this top entry, e.g. \"US\" or \"Chrome\"." + } + } + }, + "Url": { + "id": "Url", + "type": "object", + "properties": { + "analytics": { + "$ref": "AnalyticsSummary", + "description": "A summary of the click analytics for the short and long URL. Might not be present if not requested or currently unavailable." + }, + "created": { + "type": "string", + "description": "Time the short URL was created; ISO 8601 representation using the yyyy-MM-dd'T'HH:mm:ss.SSSZZ format, e.g. \"2010-10-14T19:01:24.944+00:00\"." + }, + "id": { + "type": "string", + "description": "Short URL, e.g. \"http://goo.gl/l6MS\"." + }, + "kind": { + "type": "string", + "description": "The fixed string \"urlshortener#url\".", + "default": "urlshortener#url" + }, + "longUrl": { + "type": "string", + "description": "Long URL, e.g. \"http://www.google.com/\". Might not be present if the status is \"REMOVED\"." + }, + "status": { + "type": "string", + "description": "Status of the target URL. Possible values: \"OK\", \"MALWARE\", \"PHISHING\", or \"REMOVED\". A URL might be marked \"REMOVED\" if it was flagged as spam, for example." + } + } + }, + "UrlHistory": { + "id": "UrlHistory", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "A list of URL resources.", + "items": { + "$ref": "Url" + } + }, + "itemsPerPage": { + "type": "integer", + "description": "Number of items returned with each full \"page\" of results. Note that the last page could have fewer items than the \"itemsPerPage\" value.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "The fixed string \"urlshortener#urlHistory\".", + "default": "urlshortener#urlHistory" + }, + "nextPageToken": { + "type": "string", + "description": "A token to provide to get the next page of results." + }, + "totalItems": { + "type": "integer", + "description": "Total number of short URLs associated with this user (may be approximate).", + "format": "int32" + } + } + } + }, + "resources": { + "url": { + "methods": { + "get": { + "id": "urlshortener.url.get", + "path": "url", + "httpMethod": "GET", + "description": "Expands a short URL or gets creation time and analytics.", + "parameters": { + "projection": { + "type": "string", + "description": "Additional information to return.", + "enum": [ + "ANALYTICS_CLICKS", + "ANALYTICS_TOP_STRINGS", + "FULL" + ], + "enumDescriptions": [ + "Returns only click counts.", + "Returns only top string counts.", + "Returns the creation timestamp and all available analytics." + ], + "location": "query" + }, + "shortUrl": { + "type": "string", + "description": "The short URL, including the protocol.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "shortUrl" + ], + "response": { + "$ref": "Url" + } + }, + "insert": { + "id": "urlshortener.url.insert", + "path": "url", + "httpMethod": "POST", + "description": "Creates a new short URL.", + "request": { + "$ref": "Url" + }, + "response": { + "$ref": "Url" + }, + "scopes": [ + "https://www.googleapis.com/auth/urlshortener" + ] + }, + "list": { + "id": "urlshortener.url.list", + "path": "url/history", + "httpMethod": "GET", + "description": "Retrieves a list of URLs shortened by a user.", + "parameters": { + "projection": { + "type": "string", + "description": "Additional information to return.", + "enum": [ + "ANALYTICS_CLICKS", + "FULL" + ], + "enumDescriptions": [ + "Returns short URL click counts.", + "Returns short URL click counts." + ], + "location": "query" + }, + "start-token": { + "type": "string", + "description": "Token for requesting successive pages of results.", + "location": "query" + } + }, + "response": { + "$ref": "UrlHistory" + }, + "scopes": [ + "https://www.googleapis.com/auth/urlshortener" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/urlshortener/v1/urlshortener-gen.go b/third_party/src/code.google.com/p/google-api-go-client/urlshortener/v1/urlshortener-gen.go new file mode 100644 index 0000000000000..7dc58e0068e69 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/urlshortener/v1/urlshortener-gen.go @@ -0,0 +1,406 @@ +// Package urlshortener provides access to the URL Shortener API. +// +// See http://code.google.com/apis/urlshortener/v1/getting_started.html +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/urlshortener/v1" +// ... +// urlshortenerService, err := urlshortener.New(oauthHttpClient) +package urlshortener + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "urlshortener:v1" +const apiName = "urlshortener" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/urlshortener/v1/" + +// OAuth2 scopes used by this API. +const ( + // Manage your goo.gl short URLs + UrlshortenerScope = "https://www.googleapis.com/auth/urlshortener" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Url = NewUrlService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Url *UrlService +} + +func NewUrlService(s *Service) *UrlService { + rs := &UrlService{s: s} + return rs +} + +type UrlService struct { + s *Service +} + +type AnalyticsSnapshot struct { + // Browsers: Top browsers, e.g. "Chrome"; sorted by (descending) click + // counts. Only present if this data is available. + Browsers []*StringCount `json:"browsers,omitempty"` + + // Countries: Top countries (expressed as country codes), e.g. "US" or + // "DE"; sorted by (descending) click counts. Only present if this data + // is available. + Countries []*StringCount `json:"countries,omitempty"` + + // LongUrlClicks: Number of clicks on all goo.gl short URLs pointing to + // this long URL. + LongUrlClicks int64 `json:"longUrlClicks,omitempty,string"` + + // Platforms: Top platforms or OSes, e.g. "Windows"; sorted by + // (descending) click counts. Only present if this data is available. + Platforms []*StringCount `json:"platforms,omitempty"` + + // Referrers: Top referring hosts, e.g. "www.google.com"; sorted by + // (descending) click counts. Only present if this data is available. + Referrers []*StringCount `json:"referrers,omitempty"` + + // ShortUrlClicks: Number of clicks on this short URL. + ShortUrlClicks int64 `json:"shortUrlClicks,omitempty,string"` +} + +type AnalyticsSummary struct { + // AllTime: Click analytics over all time. + AllTime *AnalyticsSnapshot `json:"allTime,omitempty"` + + // Day: Click analytics over the last day. + Day *AnalyticsSnapshot `json:"day,omitempty"` + + // Month: Click analytics over the last month. + Month *AnalyticsSnapshot `json:"month,omitempty"` + + // TwoHours: Click analytics over the last two hours. + TwoHours *AnalyticsSnapshot `json:"twoHours,omitempty"` + + // Week: Click analytics over the last week. + Week *AnalyticsSnapshot `json:"week,omitempty"` +} + +type StringCount struct { + // Count: Number of clicks for this top entry, e.g. for this particular + // country or browser. + Count int64 `json:"count,omitempty,string"` + + // Id: Label assigned to this top entry, e.g. "US" or "Chrome". + Id string `json:"id,omitempty"` +} + +type Url struct { + // Analytics: A summary of the click analytics for the short and long + // URL. Might not be present if not requested or currently unavailable. + Analytics *AnalyticsSummary `json:"analytics,omitempty"` + + // Created: Time the short URL was created; ISO 8601 representation + // using the yyyy-MM-dd'T'HH:mm:ss.SSSZZ format, e.g. + // "2010-10-14T19:01:24.944+00:00". + Created string `json:"created,omitempty"` + + // Id: Short URL, e.g. "http://goo.gl/l6MS". + Id string `json:"id,omitempty"` + + // Kind: The fixed string "urlshortener#url". + Kind string `json:"kind,omitempty"` + + // LongUrl: Long URL, e.g. "http://www.google.com/". Might not be + // present if the status is "REMOVED". + LongUrl string `json:"longUrl,omitempty"` + + // Status: Status of the target URL. Possible values: "OK", "MALWARE", + // "PHISHING", or "REMOVED". A URL might be marked "REMOVED" if it was + // flagged as spam, for example. + Status string `json:"status,omitempty"` +} + +type UrlHistory struct { + // Items: A list of URL resources. + Items []*Url `json:"items,omitempty"` + + // ItemsPerPage: Number of items returned with each full "page" of + // results. Note that the last page could have fewer items than the + // "itemsPerPage" value. + ItemsPerPage int64 `json:"itemsPerPage,omitempty"` + + // Kind: The fixed string "urlshortener#urlHistory". + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token to provide to get the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TotalItems: Total number of short URLs associated with this user (may + // be approximate). + TotalItems int64 `json:"totalItems,omitempty"` +} + +// method id "urlshortener.url.get": + +type UrlGetCall struct { + s *Service + shortUrl string + opt_ map[string]interface{} +} + +// Get: Expands a short URL or gets creation time and analytics. +func (r *UrlService) Get(shortUrl string) *UrlGetCall { + c := &UrlGetCall{s: r.s, opt_: make(map[string]interface{})} + c.shortUrl = shortUrl + return c +} + +// Projection sets the optional parameter "projection": Additional +// information to return. +func (c *UrlGetCall) Projection(projection string) *UrlGetCall { + c.opt_["projection"] = projection + return c +} + +func (c *UrlGetCall) Do() (*Url, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + params.Set("shortUrl", fmt.Sprintf("%v", c.shortUrl)) + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "url") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Url) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Expands a short URL or gets creation time and analytics.", + // "httpMethod": "GET", + // "id": "urlshortener.url.get", + // "parameterOrder": [ + // "shortUrl" + // ], + // "parameters": { + // "projection": { + // "description": "Additional information to return.", + // "enum": [ + // "ANALYTICS_CLICKS", + // "ANALYTICS_TOP_STRINGS", + // "FULL" + // ], + // "enumDescriptions": [ + // "Returns only click counts.", + // "Returns only top string counts.", + // "Returns the creation timestamp and all available analytics." + // ], + // "location": "query", + // "type": "string" + // }, + // "shortUrl": { + // "description": "The short URL, including the protocol.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "url", + // "response": { + // "$ref": "Url" + // } + // } + +} + +// method id "urlshortener.url.insert": + +type UrlInsertCall struct { + s *Service + url *Url + opt_ map[string]interface{} +} + +// Insert: Creates a new short URL. +func (r *UrlService) Insert(url *Url) *UrlInsertCall { + c := &UrlInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.url = url + return c +} + +func (c *UrlInsertCall) Do() (*Url, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.url) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", "json") + urls := googleapi.ResolveRelative(c.s.BasePath, "url") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(Url) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new short URL.", + // "httpMethod": "POST", + // "id": "urlshortener.url.insert", + // "path": "url", + // "request": { + // "$ref": "Url" + // }, + // "response": { + // "$ref": "Url" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/urlshortener" + // ] + // } + +} + +// method id "urlshortener.url.list": + +type UrlListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves a list of URLs shortened by a user. +func (r *UrlService) List() *UrlListCall { + c := &UrlListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Projection sets the optional parameter "projection": Additional +// information to return. +func (c *UrlListCall) Projection(projection string) *UrlListCall { + c.opt_["projection"] = projection + return c +} + +// StartToken sets the optional parameter "start-token": Token for +// requesting successive pages of results. +func (c *UrlListCall) StartToken(startToken string) *UrlListCall { + c.opt_["start-token"] = startToken + return c +} + +func (c *UrlListCall) Do() (*UrlHistory, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start-token"]; ok { + params.Set("start-token", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "url/history") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(UrlHistory) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of URLs shortened by a user.", + // "httpMethod": "GET", + // "id": "urlshortener.url.list", + // "parameters": { + // "projection": { + // "description": "Additional information to return.", + // "enum": [ + // "ANALYTICS_CLICKS", + // "FULL" + // ], + // "enumDescriptions": [ + // "Returns short URL click counts.", + // "Returns short URL click counts." + // ], + // "location": "query", + // "type": "string" + // }, + // "start-token": { + // "description": "Token for requesting successive pages of results.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "url/history", + // "response": { + // "$ref": "UrlHistory" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/urlshortener" + // ] + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/webfonts/v1/webfonts-api.json b/third_party/src/code.google.com/p/google-api-go-client/webfonts/v1/webfonts-api.json new file mode 100644 index 0000000000000..e77f8d69ae654 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/webfonts/v1/webfonts-api.json @@ -0,0 +1,174 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/oPNy63UO0fYNZSm0s2bZIqE4DWs\"", + "discoveryVersion": "v1", + "id": "webfonts:v1", + "name": "webfonts", + "version": "v1", + "title": "Google Fonts Developer API", + "description": "The Google Fonts Developer API.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/feature/font_api-16.png", + "x32": "http://www.google.com/images/icons/feature/font_api-32.gif" + }, + "documentationLink": "https://developers.google.com/fonts/docs/developer_api", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/webfonts/v1/", + "basePath": "/webfonts/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "webfonts/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" + } + }, + "schemas": { + "Webfont": { + "id": "Webfont", + "type": "object", + "properties": { + "category": { + "type": "string", + "description": "The category of the font." + }, + "family": { + "type": "string", + "description": "The name of the font." + }, + "files": { + "type": "object", + "description": "The font files (with all supported scripts) for each one of the available variants, as a key : value map.", + "additionalProperties": { + "type": "string", + "description": "The font file URL (value) for an specific variant (key)." + } + }, + "kind": { + "type": "string", + "description": "This kind represents a webfont object in the webfonts service.", + "default": "webfonts#webfont" + }, + "lastModified": { + "type": "string", + "description": "The date (format \"yyyy-MM-dd\") the font was modified for the last time.", + "format": "date" + }, + "subsets": { + "type": "array", + "description": "The scripts supported by the font.", + "items": { + "type": "string" + } + }, + "variants": { + "type": "array", + "description": "The available variants for the font.", + "items": { + "type": "string" + } + }, + "version": { + "type": "string", + "description": "The font version." + } + } + }, + "WebfontList": { + "id": "WebfontList", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The list of fonts currently served by the Google Fonts API.", + "items": { + "$ref": "Webfont" + } + }, + "kind": { + "type": "string", + "description": "This kind represents a list of webfont objects in the webfonts service.", + "default": "webfonts#webfontList" + } + } + } + }, + "resources": { + "webfonts": { + "methods": { + "list": { + "id": "webfonts.webfonts.list", + "path": "webfonts", + "httpMethod": "GET", + "description": "Retrieves the list of fonts currently served by the Google Fonts Developer API", + "parameters": { + "sort": { + "type": "string", + "description": "Enables sorting of the list", + "enum": [ + "alpha", + "date", + "popularity", + "style", + "trending" + ], + "enumDescriptions": [ + "Sort alphabetically", + "Sort by date added", + "Sort by popularity", + "Sort by number of styles", + "Sort by trending" + ], + "location": "query" + } + }, + "response": { + "$ref": "WebfontList" + } + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/webfonts/v1/webfonts-gen.go b/third_party/src/code.google.com/p/google-api-go-client/webfonts/v1/webfonts-gen.go new file mode 100644 index 0000000000000..2b087bceea746 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/webfonts/v1/webfonts-gen.go @@ -0,0 +1,180 @@ +// Package webfonts provides access to the Google Fonts Developer API. +// +// See https://developers.google.com/fonts/docs/developer_api +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/webfonts/v1" +// ... +// webfontsService, err := webfonts.New(oauthHttpClient) +package webfonts + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "webfonts:v1" +const apiName = "webfonts" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/webfonts/v1/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Webfonts = NewWebfontsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Webfonts *WebfontsService +} + +func NewWebfontsService(s *Service) *WebfontsService { + rs := &WebfontsService{s: s} + return rs +} + +type WebfontsService struct { + s *Service +} + +type Webfont struct { + // Category: The category of the font. + Category string `json:"category,omitempty"` + + // Family: The name of the font. + Family string `json:"family,omitempty"` + + // Files: The font files (with all supported scripts) for each one of + // the available variants, as a key : value map. + Files map[string]string `json:"files,omitempty"` + + // Kind: This kind represents a webfont object in the webfonts service. + Kind string `json:"kind,omitempty"` + + // LastModified: The date (format "yyyy-MM-dd") the font was modified + // for the last time. + LastModified string `json:"lastModified,omitempty"` + + // Subsets: The scripts supported by the font. + Subsets []string `json:"subsets,omitempty"` + + // Variants: The available variants for the font. + Variants []string `json:"variants,omitempty"` + + // Version: The font version. + Version string `json:"version,omitempty"` +} + +type WebfontList struct { + // Items: The list of fonts currently served by the Google Fonts API. + Items []*Webfont `json:"items,omitempty"` + + // Kind: This kind represents a list of webfont objects in the webfonts + // service. + Kind string `json:"kind,omitempty"` +} + +// method id "webfonts.webfonts.list": + +type WebfontsListCall struct { + s *Service + opt_ map[string]interface{} +} + +// List: Retrieves the list of fonts currently served by the Google +// Fonts Developer API +func (r *WebfontsService) List() *WebfontsListCall { + c := &WebfontsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Sort sets the optional parameter "sort": Enables sorting of the list +func (c *WebfontsListCall) Sort(sort string) *WebfontsListCall { + c.opt_["sort"] = sort + return c +} + +func (c *WebfontsListCall) Do() (*WebfontList, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", "json") + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "webfonts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", "google-api-go-client/0.5") + res, err := c.s.client.Do(req) + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := new(WebfontList) + if err := json.NewDecoder(res.Body).Decode(ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of fonts currently served by the Google Fonts Developer API", + // "httpMethod": "GET", + // "id": "webfonts.webfonts.list", + // "parameters": { + // "sort": { + // "description": "Enables sorting of the list", + // "enum": [ + // "alpha", + // "date", + // "popularity", + // "style", + // "trending" + // ], + // "enumDescriptions": [ + // "Sort alphabetically", + // "Sort by date added", + // "Sort by popularity", + // "Sort by number of styles", + // "Sort by trending" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "webfonts", + // "response": { + // "$ref": "WebfontList" + // } + // } + +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/youtube/v3/youtube-api.json b/third_party/src/code.google.com/p/google-api-go-client/youtube/v3/youtube-api.json new file mode 100644 index 0000000000000..87ddad6362841 --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/youtube/v3/youtube-api.json @@ -0,0 +1,6619 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/zcpG0fjFy3jg5hXoSMJXXIEGriY\"", + "discoveryVersion": "v1", + "id": "youtube:v3", + "name": "youtube", + "canonicalName": "YouTube", + "version": "v3", + "title": "YouTube Data API", + "description": "Programmatic access to YouTube features.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/youtube-16.png", + "x32": "http://www.google.com/images/icons/product/youtube-32.png" + }, + "documentationLink": "https://developers.google.com/youtube/v3", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/youtube/v3/", + "basePath": "/youtube/v3/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "youtube/v3/", + "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/youtube": { + "description": "Manage your YouTube account" + }, + "https://www.googleapis.com/auth/youtube.readonly": { + "description": "View your YouTube account" + }, + "https://www.googleapis.com/auth/youtube.upload": { + "description": "Manage your YouTube videos" + }, + "https://www.googleapis.com/auth/youtubepartner": { + "description": "View and manage your assets and associated content on YouTube" + }, + "https://www.googleapis.com/auth/youtubepartner-channel-audit": { + "description": "View private information of your YouTube channel relevant during the audit process with a YouTube partner" + } + } + } + }, + "schemas": { + "AccessPolicy": { + "id": "AccessPolicy", + "type": "object", + "description": "Rights management policy for YouTube resources.", + "properties": { + "allowed": { + "type": "boolean", + "description": "The value of allowed indicates whether the access to the policy is allowed or denied by default." + }, + "exception": { + "type": "array", + "description": "A list of region codes that identify countries where the default policy do not apply.", + "items": { + "type": "string" + } + } + } + }, + "Activity": { + "id": "Activity", + "type": "object", + "description": "An activity resource contains information about an action that a particular channel, or user, has taken on YouTube.The actions reported in activity feeds include rating a video, sharing a video, marking a video as a favorite, commenting on a video, uploading a video, and so forth. Each activity resource identifies the type of action, the channel associated with the action, and the resource(s) associated with the action, such as the video that was rated or uploaded.", + "properties": { + "contentDetails": { + "$ref": "ActivityContentDetails", + "description": "The contentDetails object contains information about the content associated with the activity. For example, if the snippet.type value is videoRated, then the contentDetails object's content identifies the rated video." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the activity." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#activity\".", + "default": "youtube#activity" + }, + "snippet": { + "$ref": "ActivitySnippet", + "description": "The snippet object contains basic details about the activity, including the activity's type and group ID." + } + } + }, + "ActivityContentDetails": { + "id": "ActivityContentDetails", + "type": "object", + "description": "Details about the content of an activity: the video that was shared, the channel that was subscribed to, etc.", + "properties": { + "bulletin": { + "$ref": "ActivityContentDetailsBulletin", + "description": "The bulletin object contains details about a channel bulletin post. This object is only present if the snippet.type is bulletin." + }, + "channelItem": { + "$ref": "ActivityContentDetailsChannelItem", + "description": "The channelItem object contains details about a resource which was added to a channel. This property is only present if the snippet.type is channelItem." + }, + "comment": { + "$ref": "ActivityContentDetailsComment", + "description": "The comment object contains information about a resource that received a comment. This property is only present if the snippet.type is comment." + }, + "favorite": { + "$ref": "ActivityContentDetailsFavorite", + "description": "The favorite object contains information about a video that was marked as a favorite video. This property is only present if the snippet.type is favorite." + }, + "like": { + "$ref": "ActivityContentDetailsLike", + "description": "The like object contains information about a resource that received a positive (like) rating. This property is only present if the snippet.type is like." + }, + "playlistItem": { + "$ref": "ActivityContentDetailsPlaylistItem", + "description": "The playlistItem object contains information about a new playlist item. This property is only present if the snippet.type is playlistItem." + }, + "promotedItem": { + "$ref": "ActivityContentDetailsPromotedItem", + "description": "The promotedItem object contains details about a resource which is being promoted. This property is only present if the snippet.type is promotedItem." + }, + "recommendation": { + "$ref": "ActivityContentDetailsRecommendation", + "description": "The recommendation object contains information about a recommended resource. This property is only present if the snippet.type is recommendation." + }, + "social": { + "$ref": "ActivityContentDetailsSocial", + "description": "The social object contains details about a social network post. This property is only present if the snippet.type is social." + }, + "subscription": { + "$ref": "ActivityContentDetailsSubscription", + "description": "The subscription object contains information about a channel that a user subscribed to. This property is only present if the snippet.type is subscription." + }, + "upload": { + "$ref": "ActivityContentDetailsUpload", + "description": "The upload object contains information about the uploaded video. This property is only present if the snippet.type is upload." + } + } + }, + "ActivityContentDetailsBulletin": { + "id": "ActivityContentDetailsBulletin", + "type": "object", + "description": "Details about a channel bulletin post.", + "properties": { + "resourceId": { + "$ref": "ResourceId", + "description": "The resourceId object contains information that identifies the resource associated with a bulletin post." + } + } + }, + "ActivityContentDetailsChannelItem": { + "id": "ActivityContentDetailsChannelItem", + "type": "object", + "description": "Details about a resource which was added to a channel.", + "properties": { + "resourceId": { + "$ref": "ResourceId", + "description": "The resourceId object contains information that identifies the resource that was added to the channel." + } + } + }, + "ActivityContentDetailsComment": { + "id": "ActivityContentDetailsComment", + "type": "object", + "description": "Information about a resource that received a comment.", + "properties": { + "resourceId": { + "$ref": "ResourceId", + "description": "The resourceId object contains information that identifies the resource associated with the comment." + } + } + }, + "ActivityContentDetailsFavorite": { + "id": "ActivityContentDetailsFavorite", + "type": "object", + "description": "Information about a video that was marked as a favorite video.", + "properties": { + "resourceId": { + "$ref": "ResourceId", + "description": "The resourceId object contains information that identifies the resource that was marked as a favorite." + } + } + }, + "ActivityContentDetailsLike": { + "id": "ActivityContentDetailsLike", + "type": "object", + "description": "Information about a resource that received a positive (like) rating.", + "properties": { + "resourceId": { + "$ref": "ResourceId", + "description": "The resourceId object contains information that identifies the rated resource." + } + } + }, + "ActivityContentDetailsPlaylistItem": { + "id": "ActivityContentDetailsPlaylistItem", + "type": "object", + "description": "Information about a new playlist item.", + "properties": { + "playlistId": { + "type": "string", + "description": "The value that YouTube uses to uniquely identify the playlist." + }, + "playlistItemId": { + "type": "string", + "description": "ID of the item within the playlist." + }, + "resourceId": { + "$ref": "ResourceId", + "description": "The resourceId object contains information about the resource that was added to the playlist." + } + } + }, + "ActivityContentDetailsPromotedItem": { + "id": "ActivityContentDetailsPromotedItem", + "type": "object", + "description": "Details about a resource which is being promoted.", + "properties": { + "adTag": { + "type": "string", + "description": "The URL the client should fetch to request a promoted item." + }, + "clickTrackingUrl": { + "type": "string", + "description": "The URL the client should ping to indicate that the user clicked through on this promoted item." + }, + "creativeViewUrl": { + "type": "string", + "description": "The URL the client should ping to indicate that the user was shown this promoted item." + }, + "ctaType": { + "type": "string", + "description": "The type of call-to-action, a message to the user indicating action that can be taken.", + "enum": [ + "unspecified", + "visitAdvertiserSite" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "customCtaButtonText": { + "type": "string", + "description": "The custom call-to-action button text. If specified, it will override the default button text for the cta_type." + }, + "descriptionText": { + "type": "string", + "description": "The text description to accompany the promoted item." + }, + "destinationUrl": { + "type": "string", + "description": "The URL the client should direct the user to, if the user chooses to visit the advertiser's website." + }, + "forecastingUrl": { + "type": "array", + "description": "The list of forecasting URLs. The client should ping all of these URLs when a promoted item is not available, to indicate that a promoted item could have been shown.", + "items": { + "type": "string" + } + }, + "impressionUrl": { + "type": "array", + "description": "The list of impression URLs. The client should ping all of these URLs to indicate that the user was shown this promoted item.", + "items": { + "type": "string" + } + }, + "videoId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the promoted video." + } + } + }, + "ActivityContentDetailsRecommendation": { + "id": "ActivityContentDetailsRecommendation", + "type": "object", + "description": "Information that identifies the recommended resource.", + "properties": { + "reason": { + "type": "string", + "description": "The reason that the resource is recommended to the user.", + "enum": [ + "unspecified", + "videoFavorited", + "videoLiked", + "videoWatched" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "resourceId": { + "$ref": "ResourceId", + "description": "The resourceId object contains information that identifies the recommended resource." + }, + "seedResourceId": { + "$ref": "ResourceId", + "description": "The seedResourceId object contains information about the resource that caused the recommendation." + } + } + }, + "ActivityContentDetailsSocial": { + "id": "ActivityContentDetailsSocial", + "type": "object", + "description": "Details about a social network post.", + "properties": { + "author": { + "type": "string", + "description": "The author of the social network post." + }, + "imageUrl": { + "type": "string", + "description": "An image of the post's author." + }, + "referenceUrl": { + "type": "string", + "description": "The URL of the social network post." + }, + "resourceId": { + "$ref": "ResourceId", + "description": "The resourceId object encapsulates information that identifies the resource associated with a social network post." + }, + "type": { + "type": "string", + "description": "The name of the social network.", + "enum": [ + "facebook", + "googlePlus", + "twitter", + "unspecified" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "ActivityContentDetailsSubscription": { + "id": "ActivityContentDetailsSubscription", + "type": "object", + "description": "Information about a channel that a user subscribed to.", + "properties": { + "resourceId": { + "$ref": "ResourceId", + "description": "The resourceId object contains information that identifies the resource that the user subscribed to." + } + } + }, + "ActivityContentDetailsUpload": { + "id": "ActivityContentDetailsUpload", + "type": "object", + "description": "Information about the uploaded video.", + "properties": { + "videoId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the uploaded video." + } + } + }, + "ActivityListResponse": { + "id": "ActivityListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of activities, or events, that match the request criteria.", + "items": { + "$ref": "Activity" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#activityListResponse\".", + "default": "youtube#activityListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "ActivitySnippet": { + "id": "ActivitySnippet", + "type": "object", + "description": "Basic details about an activity, including title, description, thumbnails, activity type and group.", + "properties": { + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the channel associated with the activity." + }, + "channelTitle": { + "type": "string", + "description": "Channel title for the channel responsible for this activity" + }, + "description": { + "type": "string", + "description": "The description of the resource primarily associated with the activity.", + "annotations": { + "required": [ + "youtube.activities.insert" + ] + } + }, + "groupId": { + "type": "string", + "description": "The group ID associated with the activity. A group ID identifies user events that are associated with the same user and resource. For example, if a user rates a video and marks the same video as a favorite, the entries for those events would have the same group ID in the user's activity feed. In your user interface, you can avoid repetition by grouping events with the same groupId value." + }, + "publishedAt": { + "type": "string", + "description": "The date and time that the video was uploaded. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "thumbnails": { + "$ref": "ThumbnailDetails", + "description": "A map of thumbnail images associated with the resource that is primarily associated with the activity. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail." + }, + "title": { + "type": "string", + "description": "The title of the resource primarily associated with the activity." + }, + "type": { + "type": "string", + "description": "The type of activity that the resource describes.", + "enum": [ + "bulletin", + "channelItem", + "comment", + "favorite", + "like", + "playlistItem", + "promotedItem", + "recommendation", + "social", + "subscription", + "upload" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "CdnSettings": { + "id": "CdnSettings", + "type": "object", + "description": "Brief description of the live stream cdn settings.", + "properties": { + "format": { + "type": "string", + "description": "The format of the video stream that you are sending to Youtube.", + "annotations": { + "required": [ + "youtube.liveStreams.insert", + "youtube.liveStreams.update" + ] + } + }, + "ingestionInfo": { + "$ref": "IngestionInfo", + "description": "The ingestionInfo object contains information that YouTube provides that you need to transmit your RTMP or HTTP stream to YouTube." + }, + "ingestionType": { + "type": "string", + "description": "The method or protocol used to transmit the video stream.", + "enum": [ + "rtmp" + ], + "enumDescriptions": [ + "" + ], + "annotations": { + "required": [ + "youtube.liveStreams.insert", + "youtube.liveStreams.update" + ] + } + } + } + }, + "Channel": { + "id": "Channel", + "type": "object", + "description": "A channel resource contains information about a YouTube channel.", + "properties": { + "auditDetails": { + "$ref": "ChannelAuditDetails", + "description": "The auditionDetails object encapsulates channel data that is relevant for YouTube Partners during the audition process." + }, + "brandingSettings": { + "$ref": "ChannelBrandingSettings", + "description": "The brandingSettings object encapsulates information about the branding of the channel." + }, + "contentDetails": { + "$ref": "ChannelContentDetails", + "description": "The contentDetails object encapsulates information about the channel's content." + }, + "contentOwnerDetails": { + "$ref": "ChannelContentOwnerDetails", + "description": "The contentOwnerDetails object encapsulates channel data that is relevant for YouTube Partners linked with the channel." + }, + "conversionPings": { + "$ref": "ChannelConversionPings", + "description": "The conversionPings object encapsulates information about conversion pings that need to be respected by the channel." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the channel." + }, + "invideoPromotion": { + "$ref": "InvideoPromotion", + "description": "The invideoPromotion object encapsulates information about promotion campaign associated with the channel." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#channel\".", + "default": "youtube#channel" + }, + "snippet": { + "$ref": "ChannelSnippet", + "description": "The snippet object contains basic details about the channel, such as its title, description, and thumbnail images." + }, + "statistics": { + "$ref": "ChannelStatistics", + "description": "The statistics object encapsulates statistics for the channel." + }, + "status": { + "$ref": "ChannelStatus", + "description": "The status object encapsulates information about the privacy status of the channel." + }, + "topicDetails": { + "$ref": "ChannelTopicDetails", + "description": "The topicDetails object encapsulates information about Freebase topics associated with the channel." + } + } + }, + "ChannelAuditDetails": { + "id": "ChannelAuditDetails", + "type": "object", + "description": "The auditDetails object encapsulates channel data that is relevant for YouTube Partners during the audit process.", + "properties": { + "communityGuidelinesGoodStanding": { + "type": "boolean", + "description": "Whether or not the channel respects the community guidelines." + }, + "contentIdClaimsGoodStanding": { + "type": "boolean", + "description": "Whether or not the channel has any unresolved claims." + }, + "copyrightStrikesGoodStanding": { + "type": "boolean", + "description": "Whether or not the channel has any copyright strikes." + }, + "overallGoodStanding": { + "type": "boolean", + "description": "Describes the general state of the channel. This field will always show if there are any issues whatsoever with the channel. Currently this field represents the result of the logical and operation over the community guidelines good standing, the copyright strikes good standing and the content ID claims good standing, but this may change in the future." + } + } + }, + "ChannelBannerResource": { + "id": "ChannelBannerResource", + "type": "object", + "description": "A channel banner returned as the response to a channel_banner.insert call.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#channelBannerResource\".", + "default": "youtube#channelBannerResource" + }, + "url": { + "type": "string", + "description": "The URL of this banner image." + } + } + }, + "ChannelBrandingSettings": { + "id": "ChannelBrandingSettings", + "type": "object", + "description": "Branding properties of a YouTube channel.", + "properties": { + "channel": { + "$ref": "ChannelSettings", + "description": "Branding properties for the channel view." + }, + "hints": { + "type": "array", + "description": "Additional experimental branding properties.", + "items": { + "$ref": "PropertyValue" + } + }, + "image": { + "$ref": "ImageSettings", + "description": "Branding properties for branding images." + }, + "watch": { + "$ref": "WatchSettings", + "description": "Branding properties for the watch page." + } + } + }, + "ChannelContentDetails": { + "id": "ChannelContentDetails", + "type": "object", + "description": "Details about the content of a channel.", + "properties": { + "googlePlusUserId": { + "type": "string", + "description": "The googlePlusUserId object identifies the Google+ profile ID associated with this channel." + }, + "relatedPlaylists": { + "type": "object", + "properties": { + "favorites": { + "type": "string", + "description": "The ID of the playlist that contains the channel\"s favorite videos. Use the playlistItems.insert and playlistItems.delete to add or remove items from that list." + }, + "likes": { + "type": "string", + "description": "The ID of the playlist that contains the channel\"s liked videos. Use the playlistItems.insert and playlistItems.delete to add or remove items from that list." + }, + "uploads": { + "type": "string", + "description": "The ID of the playlist that contains the channel\"s uploaded videos. Use the videos.insert method to upload new videos and the videos.delete method to delete previously uploaded videos." + }, + "watchHistory": { + "type": "string", + "description": "The ID of the playlist that contains the channel\"s watch history. Use the playlistItems.insert and playlistItems.delete to add or remove items from that list." + }, + "watchLater": { + "type": "string", + "description": "The ID of the playlist that contains the channel\"s watch later playlist. Use the playlistItems.insert and playlistItems.delete to add or remove items from that list." + } + } + } + } + }, + "ChannelContentOwnerDetails": { + "id": "ChannelContentOwnerDetails", + "type": "object", + "description": "The contentOwnerDetails object encapsulates channel data that is relevant for YouTube Partners linked with the channel.", + "properties": { + "contentOwner": { + "type": "string", + "description": "The ID of the content owner linked to the channel." + }, + "timeLinked": { + "type": "string", + "description": "The date and time of when the channel was linked to the content owner. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + } + } + }, + "ChannelConversionPing": { + "id": "ChannelConversionPing", + "type": "object", + "description": "Pings that the app shall fire (authenticated by biscotti cookie). Each ping has a context, in which the app must fire the ping, and a url identifying the ping.", + "properties": { + "context": { + "type": "string", + "description": "Defines the context of the ping.", + "enum": [ + "cview", + "subscribe", + "unsubscribe" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "conversionUrl": { + "type": "string", + "description": "The url (without the schema) that the player shall send the ping to. It's at caller's descretion to decide which schema to use (http vs https) Example of a returned url: //googleads.g.doubleclick.net/pagead/ viewthroughconversion/962985656/?data=path%3DtHe_path%3Btype%3D cview%3Butuid%3DGISQtTNGYqaYl4sKxoVvKA&labe=default The caller must append biscotti authentication (ms param in case of mobile, for example) to this ping." + } + } + }, + "ChannelConversionPings": { + "id": "ChannelConversionPings", + "type": "object", + "description": "The conversionPings object encapsulates information about conversion pings that need to be respected by the channel.", + "properties": { + "pings": { + "type": "array", + "description": "Pings that the app shall fire (authenticated by biscotti cookie). Each ping has a context, in which the app must fire the ping, and a url identifying the ping.", + "items": { + "$ref": "ChannelConversionPing" + } + } + } + }, + "ChannelListResponse": { + "id": "ChannelListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of channels that match the request criteria.", + "items": { + "$ref": "Channel" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#channelListResponse\".", + "default": "youtube#channelListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "ChannelSection": { + "id": "ChannelSection", + "type": "object", + "description": "TODO(lxz) follow up with adiamondstein@ to fullfill the doc before deploying", + "properties": { + "contentDetails": { + "$ref": "ChannelSectionContentDetails", + "description": "The contentDetails object contains details about the ChannelSection content, such as playlists and channels." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the ChannelSection." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#channelSection\".", + "default": "youtube#channelSection" + }, + "snippet": { + "$ref": "ChannelSectionSnippet", + "description": "The snippet object contains basic details about the ChannelSection, such as its type, style and title." + } + } + }, + "ChannelSectionContentDetails": { + "id": "ChannelSectionContentDetails", + "type": "object", + "description": "Details about a channelsection, including playlists and channels.", + "properties": { + "channels": { + "type": "array", + "description": "The channel ids for type multiple_channels.", + "items": { + "type": "string" + } + }, + "playlists": { + "type": "array", + "description": "The playlist ids for type single_playlist and multiple_playlists. For singlePlaylist, only one playlistId is allowed.", + "items": { + "type": "string" + } + } + } + }, + "ChannelSectionListResponse": { + "id": "ChannelSectionListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of ChannelSections that match the request criteria.", + "items": { + "$ref": "ChannelSection" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#channelSectionListResponse\".", + "default": "youtube#channelSectionListResponse" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "ChannelSectionSnippet": { + "id": "ChannelSectionSnippet", + "type": "object", + "description": "Basic details about a channelsection, including title, style and position.", + "properties": { + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the channel that published the channelSection." + }, + "position": { + "type": "integer", + "description": "The position of the channelSection in the channel.", + "format": "uint32" + }, + "style": { + "type": "string", + "description": "The style of the channelSection.", + "enum": [ + "channelsectionStyleUndefined", + "horizontalRow", + "verticalList" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "title": { + "type": "string", + "description": "The channelSection's title for multiple_playlists and multiple_channels." + }, + "type": { + "type": "string", + "description": "The type of the channelSection.", + "enum": [ + "allPlaylists", + "channelsectionTypeUndefined", + "completedEvents", + "likedPlaylists", + "likes", + "liveEvents", + "multipleChannels", + "multiplePlaylists", + "popularUploads", + "recentActivity", + "recentPosts", + "recentUploads", + "singlePlaylist", + "upcomingEvents" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "ChannelSettings": { + "id": "ChannelSettings", + "type": "object", + "description": "Branding properties for the channel view.", + "properties": { + "defaultTab": { + "type": "string", + "description": "Which content tab users should see when viewing the channel." + }, + "description": { + "type": "string", + "description": "Specifies the channel description." + }, + "featuredChannelsTitle": { + "type": "string", + "description": "Title for the featured channels tab." + }, + "featuredChannelsUrls": { + "type": "array", + "description": "The list of featured channels.", + "items": { + "type": "string" + } + }, + "keywords": { + "type": "string", + "description": "Lists keywords associated with the channel, comma-separated." + }, + "moderateComments": { + "type": "boolean", + "description": "Whether user-submitted comments left on the channel page need to be approved by the channel owner to be publicly visible." + }, + "profileColor": { + "type": "string", + "description": "A prominent color that can be rendered on this channel page." + }, + "showBrowseView": { + "type": "boolean", + "description": "Whether the tab to browse the videos should be displayed." + }, + "showRelatedChannels": { + "type": "boolean", + "description": "Whether related channels should be proposed." + }, + "title": { + "type": "string", + "description": "Specifies the channel title." + }, + "trackingAnalyticsAccountId": { + "type": "string", + "description": "The ID for a Google Analytics account to track and measure traffic to the channels." + }, + "unsubscribedTrailer": { + "type": "string", + "description": "The trailer of the channel, for users that are not subscribers." + } + } + }, + "ChannelSnippet": { + "id": "ChannelSnippet", + "type": "object", + "description": "Basic details about a channel, including title, description and thumbnails.", + "properties": { + "description": { + "type": "string", + "description": "The description of the channel." + }, + "publishedAt": { + "type": "string", + "description": "The date and time that the channel was created. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "thumbnails": { + "$ref": "ThumbnailDetails", + "description": "A map of thumbnail images associated with the channel. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail." + }, + "title": { + "type": "string", + "description": "The channel's title." + } + } + }, + "ChannelStatistics": { + "id": "ChannelStatistics", + "type": "object", + "description": "Statistics about a channel: number of subscribers, number of videos in the channel, etc.", + "properties": { + "commentCount": { + "type": "string", + "description": "The number of comments for the channel.", + "format": "uint64" + }, + "hiddenSubscriberCount": { + "type": "boolean", + "description": "Whether or not the number of subscribers is shown for this user." + }, + "subscriberCount": { + "type": "string", + "description": "The number of subscribers that the channel has.", + "format": "uint64" + }, + "videoCount": { + "type": "string", + "description": "The number of videos uploaded to the channel.", + "format": "uint64" + }, + "viewCount": { + "type": "string", + "description": "The number of times the channel has been viewed.", + "format": "uint64" + } + } + }, + "ChannelStatus": { + "id": "ChannelStatus", + "type": "object", + "description": "JSON template for the status part of a channel.", + "properties": { + "isLinked": { + "type": "boolean", + "description": "If true, then the user is linked to either a YouTube username or G+ account. Otherwise, the user doesn't have a public YouTube identity." + }, + "privacyStatus": { + "type": "string", + "description": "Privacy status of the channel.", + "enum": [ + "private", + "public", + "unlisted" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "ChannelTopicDetails": { + "id": "ChannelTopicDetails", + "type": "object", + "description": "Freebase topic information related to the channel.", + "properties": { + "topicIds": { + "type": "array", + "description": "A list of Freebase topic IDs associated with the channel. You can retrieve information about each topic using the Freebase Topic API.", + "items": { + "type": "string" + } + } + } + }, + "ContentRating": { + "id": "ContentRating", + "type": "object", + "description": "Ratings schemes. The country-specific ratings are mostly for movies and shows.", + "properties": { + "acbRating": { + "type": "string", + "description": "Rating system in Australia - Australian Classification Board", + "enum": [ + "acbC", + "acbE", + "acbG", + "acbM", + "acbMa15plus", + "acbP", + "acbPg", + "acbR18plus", + "acbUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "bbfcRating": { + "type": "string", + "description": "British Board of Film Classification", + "enum": [ + "bbfc12", + "bbfc12a", + "bbfc15", + "bbfc18", + "bbfcPg", + "bbfcR18", + "bbfcU", + "bbfcUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "catvRating": { + "type": "string", + "description": "Rating system for Canadian TV - Canadian TV Classification System", + "enum": [ + "catv14plus", + "catv18plus", + "catvC", + "catvC8", + "catvG", + "catvPg", + "catvUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "catvfrRating": { + "type": "string", + "description": "Rating system for French Canadian TV - Regie du cinema", + "enum": [ + "catvfr13plus", + "catvfr16plus", + "catvfr18plus", + "catvfr8plus", + "catvfrG", + "catvfrUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "cbfcRating": { + "type": "string", + "description": "Rating system in India - Central Board of Film Certification", + "enum": [ + "cbfcA", + "cbfcS", + "cbfcU", + "cbfcUA", + "cbfcUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "chvrsRating": { + "type": "string", + "description": "Canadian Home Video Rating System", + "enum": [ + "chvrs14a", + "chvrs18a", + "chvrsE", + "chvrsG", + "chvrsPg", + "chvrsR", + "chvrsUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "djctqRating": { + "type": "string", + "description": "Rating system in Brazil - Department of Justice, Rating, Titles and Qualification", + "enum": [ + "djctq10", + "djctq12", + "djctq14", + "djctq16", + "djctq18", + "djctqL", + "djctqUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "eirinRating": { + "type": "string", + "description": "Rating system in Japan - Eiga Rinri Kanri Iinkai", + "enum": [ + "eirinG", + "eirinPg12", + "eirinR15plus", + "eirinR18plus", + "eirinUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "fmocRating": { + "type": "string", + "description": "Rating system in France - French Minister of Culture", + "enum": [ + "fmoc10", + "fmoc12", + "fmoc16", + "fmoc18", + "fmocE", + "fmocU", + "fmocUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "fskRating": { + "type": "string", + "description": "Rating system in Germany - Voluntary Self Regulation of the Movie Industry", + "enum": [ + "fsk0", + "fsk12", + "fsk16", + "fsk18", + "fsk6", + "fskUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "icaaRating": { + "type": "string", + "description": "Rating system in Spain - Instituto de Cinematografia y de las Artes Audiovisuales", + "enum": [ + "icaa12", + "icaa13", + "icaa16", + "icaa18", + "icaa7", + "icaaApta", + "icaaUnrated", + "icaaX" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "kmrbRating": { + "type": "string", + "description": "Rating system in South Korea - Korea Media Rating Board", + "enum": [ + "kmrb12plus", + "kmrb15plus", + "kmrbAll", + "kmrbR", + "kmrbTeenr", + "kmrbUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "mibacRating": { + "type": "string", + "description": "Rating system in Italy - Ministero dei Beni e delle Attivita Culturali e del Turismo", + "enum": [ + "mibacT", + "mibacUnrated", + "mibacVap", + "mibacVm12", + "mibacVm14", + "mibacVm18" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "mpaaRating": { + "type": "string", + "description": "Motion Picture Association of America rating for the content.", + "enum": [ + "mpaaG", + "mpaaNc17", + "mpaaPg", + "mpaaPg13", + "mpaaR", + "mpaaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "oflcRating": { + "type": "string", + "description": "Rating system in New Zealand - Office of Film and Literature Classification", + "enum": [ + "oflcG", + "oflcM", + "oflcPg", + "oflcR13", + "oflcR15", + "oflcR16", + "oflcR18", + "oflcUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "rtcRating": { + "type": "string", + "description": "Rating system in Mexico - General Directorate of Radio, Television and Cinematography", + "enum": [ + "rtcA", + "rtcAa", + "rtcB", + "rtcB15", + "rtcC", + "rtcD", + "rtcUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "russiaRating": { + "type": "string", + "description": "Rating system in Russia", + "enum": [ + "russia0", + "russia12", + "russia16", + "russia18", + "russia6", + "russiaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "tvpgRating": { + "type": "string", + "description": "TV Parental Guidelines rating of the content.", + "enum": [ + "pg14", + "tvpgG", + "tvpgMa", + "tvpgPg", + "tvpgUnrated", + "tvpgY", + "tvpgY7", + "tvpgY7Fv" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "ytRating": { + "type": "string", + "description": "Internal YouTube rating.", + "enum": [ + "ytAgeRestricted" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoPoint": { + "id": "GeoPoint", + "type": "object", + "description": "Geographical coordinates of a point, in WGS84.", + "properties": { + "altitude": { + "type": "number", + "description": "Altitude above the reference ellipsoid, in meters.", + "format": "double" + }, + "latitude": { + "type": "number", + "description": "Latitude in degrees.", + "format": "double" + }, + "longitude": { + "type": "number", + "description": "Longitude in degrees.", + "format": "double" + } + } + }, + "GuideCategory": { + "id": "GuideCategory", + "type": "object", + "description": "A guideCategory resource identifies a category that YouTube algorithmically assigns based on a channel's content or other indicators, such as the channel's popularity. The list is similar to video categories, with the difference being that a video's uploader can assign a video category but only YouTube can assign a channel category.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the guide category." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#guideCategory\".", + "default": "youtube#guideCategory" + }, + "snippet": { + "$ref": "GuideCategorySnippet", + "description": "The snippet object contains basic details about the category, such as its title." + } + } + }, + "GuideCategoryListResponse": { + "id": "GuideCategoryListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of categories that can be associated with YouTube channels. In this map, the category ID is the map key, and its value is the corresponding guideCategory resource.", + "items": { + "$ref": "GuideCategory" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#guideCategoryListResponse\".", + "default": "youtube#guideCategoryListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "GuideCategorySnippet": { + "id": "GuideCategorySnippet", + "type": "object", + "description": "Basic details about a guide category.", + "properties": { + "channelId": { + "type": "string", + "default": "UCBR8-60-B28hp2BmDPdntcQ" + }, + "title": { + "type": "string", + "description": "Description of the guide category." + } + } + }, + "I18nLanguage": { + "id": "I18nLanguage", + "type": "object", + "description": "An i18nLanguage resource identifies a UI language currently supported by YouTube.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the i18n language." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#i18nLanguage\".", + "default": "youtube#i18nLanguage" + }, + "snippet": { + "$ref": "I18nLanguageSnippet", + "description": "The snippet object contains basic details about the i18n language, such as language code and human-readable name." + } + } + }, + "I18nLanguageListResponse": { + "id": "I18nLanguageListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of supported i18n languages. In this map, the i18n language ID is the map key, and its value is the corresponding i18nLanguage resource.", + "items": { + "$ref": "I18nLanguage" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#i18nLanguageListResponse\".", + "default": "youtube#i18nLanguageListResponse" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "I18nLanguageSnippet": { + "id": "I18nLanguageSnippet", + "type": "object", + "description": "Basic details about an i18n language, such as language code and human-readable name.", + "properties": { + "hl": { + "type": "string", + "description": "A short BCP-47 code that uniquely identifies a language." + }, + "name": { + "type": "string", + "description": "The human-readable name of the language in the language itself." + } + } + }, + "I18nRegion": { + "id": "I18nRegion", + "type": "object", + "description": "A i18nRegion resource identifies a region where YouTube is available.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the i18n region." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#i18nRegion\".", + "default": "youtube#i18nRegion" + }, + "snippet": { + "$ref": "I18nRegionSnippet", + "description": "The snippet object contains basic details about the i18n region, such as region code and human-readable name." + } + } + }, + "I18nRegionListResponse": { + "id": "I18nRegionListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of regions where YouTube is available. In this map, the i18n region ID is the map key, and its value is the corresponding i18nRegion resource.", + "items": { + "$ref": "I18nRegion" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#i18nRegionListResponse\".", + "default": "youtube#i18nRegionListResponse" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "I18nRegionSnippet": { + "id": "I18nRegionSnippet", + "type": "object", + "description": "Basic details about an i18n region, such as region code and human-readable name.", + "properties": { + "gl": { + "type": "string", + "description": "The region code as a 2-letter ISO country code." + }, + "name": { + "type": "string", + "description": "The human-readable name of the region." + } + } + }, + "ImageSettings": { + "id": "ImageSettings", + "type": "object", + "description": "Branding properties for images associated with the channel.", + "properties": { + "backgroundImageUrl": { + "$ref": "LocalizedProperty", + "description": "The URL for the background image shown on the video watch page. The image should be 1200px by 615px, with a maximum file size of 128k." + }, + "bannerExternalUrl": { + "type": "string", + "description": "This is used only in update requests; if it's set, we use this URL to generate all of the above banner URLs." + }, + "bannerImageUrl": { + "type": "string", + "description": "Banner image. Desktop size (1060x175)." + }, + "bannerMobileExtraHdImageUrl": { + "type": "string", + "description": "Banner image. Mobile size high resolution (1440x395)." + }, + "bannerMobileHdImageUrl": { + "type": "string", + "description": "Banner image. Mobile size high resolution (1280x360)." + }, + "bannerMobileImageUrl": { + "type": "string", + "description": "Banner image. Mobile size (640x175)." + }, + "bannerMobileLowImageUrl": { + "type": "string", + "description": "Banner image. Mobile size low resolution (320x88)." + }, + "bannerMobileMediumHdImageUrl": { + "type": "string", + "description": "Banner image. Mobile size medium/high resolution (960x263)." + }, + "bannerTabletExtraHdImageUrl": { + "type": "string", + "description": "Banner image. Tablet size extra high resolution (2560x424)." + }, + "bannerTabletHdImageUrl": { + "type": "string", + "description": "Banner image. Tablet size high resolution (2276x377)." + }, + "bannerTabletImageUrl": { + "type": "string", + "description": "Banner image. Tablet size (1707x283)." + }, + "bannerTabletLowImageUrl": { + "type": "string", + "description": "Banner image. Tablet size low resolution (1138x188)." + }, + "bannerTvHighImageUrl": { + "type": "string", + "description": "Banner image. TV size high resolution (1920x1080)." + }, + "bannerTvImageUrl": { + "type": "string", + "description": "Banner image. TV size extra high resolution (2120x1192)." + }, + "bannerTvLowImageUrl": { + "type": "string", + "description": "Banner image. TV size low resolution (854x480)." + }, + "bannerTvMediumImageUrl": { + "type": "string", + "description": "Banner image. TV size medium resolution (1280x720)." + }, + "largeBrandedBannerImageImapScript": { + "$ref": "LocalizedProperty", + "description": "The image map script for the large banner image." + }, + "largeBrandedBannerImageUrl": { + "$ref": "LocalizedProperty", + "description": "The URL for the 854px by 70px image that appears below the video player in the expanded video view of the video watch page." + }, + "smallBrandedBannerImageImapScript": { + "$ref": "LocalizedProperty", + "description": "The image map script for the small banner image." + }, + "smallBrandedBannerImageUrl": { + "$ref": "LocalizedProperty", + "description": "The URL for the 640px by 70px banner image that appears below the video player in the default view of the video watch page." + }, + "trackingImageUrl": { + "type": "string", + "description": "The URL for a 1px by 1px tracking pixel that can be used to collect statistics for views of the channel or video pages." + }, + "watchIconImageUrl": { + "type": "string", + "description": "The URL for the image that appears above the top-left corner of the video player. This is a 25-pixel-high image with a flexible width that cannot exceed 170 pixels." + } + } + }, + "IngestionInfo": { + "id": "IngestionInfo", + "type": "object", + "description": "Describes information necessary for ingesting an RTMP or an HTTP stream.", + "properties": { + "backupIngestionAddress": { + "type": "string", + "description": "The backup ingestion URL that you should use to stream video to YouTube. You have the option of simultaneously streaming the content that you are sending to the ingestionAddress to this URL." + }, + "ingestionAddress": { + "type": "string", + "description": "The primary ingestion URL that you should use to stream video to YouTube. You must stream video to this URL.\n\nDepending on which application or tool you use to encode your video stream, you may need to enter the stream URL and stream name separately or you may need to concatenate them in the following format:\n\nSTREAM_URL/STREAM_NAME" + }, + "streamName": { + "type": "string", + "description": "The HTTP or RTMP stream name that YouTube assigns to the video stream." + } + } + }, + "InvideoBranding": { + "id": "InvideoBranding", + "type": "object", + "properties": { + "imageBytes": { + "type": "string", + "format": "byte" + }, + "imageUrl": { + "type": "string" + }, + "position": { + "$ref": "InvideoPosition" + }, + "targetChannelId": { + "type": "string" + }, + "timing": { + "$ref": "InvideoTiming" + } + } + }, + "InvideoPosition": { + "id": "InvideoPosition", + "type": "object", + "description": "Describes the spatial position of a visual widget inside a video. It is a union of various position types, out of which only will be set one.", + "properties": { + "cornerPosition": { + "type": "string", + "description": "Describes in which corner of the video the visual widget will appear.", + "enum": [ + "bottomLeft", + "bottomRight", + "topLeft", + "topRight" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "type": { + "type": "string", + "description": "Defines the position type.", + "enum": [ + "corner" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "InvideoPromotion": { + "id": "InvideoPromotion", + "type": "object", + "description": "Describes an invideo promotion campaign consisting of multiple promoted items. A campaign belongs to a single channel_id.", + "properties": { + "defaultTiming": { + "$ref": "InvideoTiming", + "description": "The default temporal position within the video where the promoted item will be displayed. Can be overriden by more specific timing in the item." + }, + "items": { + "type": "array", + "description": "List of promoted items in decreasing priority.", + "items": { + "$ref": "PromotedItem" + } + }, + "position": { + "$ref": "InvideoPosition", + "description": "The spatial position within the video where the promoted item will be displayed." + } + } + }, + "InvideoTiming": { + "id": "InvideoTiming", + "type": "object", + "description": "Describes a temporal position of a visual widget inside a video.", + "properties": { + "durationMs": { + "type": "string", + "description": "Defines the duration in milliseconds for which the promotion should be displayed. If missing, the client should use the default.", + "format": "uint64" + }, + "offsetMs": { + "type": "string", + "description": "Defines the time at which the promotion will appear. Depending on the value of type the value of the offsetMs field will represent a time offset from the start or from the end of the video, expressed in milliseconds.", + "format": "uint64" + }, + "type": { + "type": "string", + "description": "Describes a timing type. If the value is offsetFromStart, then the offsetMs field represents an offset from the start of the video. If the value is offsetFromEnd, then the offsetMs field represents an offset from the end of the video.", + "enum": [ + "offsetFromEnd", + "offsetFromStart" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "LiveBroadcast": { + "id": "LiveBroadcast", + "type": "object", + "description": "A liveBroadcast resource represents an event that will be streamed, via live video, on YouTube.", + "properties": { + "contentDetails": { + "$ref": "LiveBroadcastContentDetails", + "description": "The contentDetails object contains information about the event's video content, such as whether the content can be shown in an embedded video player or if it will be archived and therefore available for viewing after the event has concluded." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube assigns to uniquely identify the broadcast.", + "annotations": { + "required": [ + "youtube.liveBroadcasts.update" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#liveBroadcast\".", + "default": "youtube#liveBroadcast" + }, + "snippet": { + "$ref": "LiveBroadcastSnippet", + "description": "The snippet object contains basic details about the event, including its title, description, start time, and end time." + }, + "status": { + "$ref": "LiveBroadcastStatus", + "description": "The status object contains information about the event's status." + } + } + }, + "LiveBroadcastContentDetails": { + "id": "LiveBroadcastContentDetails", + "type": "object", + "description": "Detailed settings of a broadcast.", + "properties": { + "boundStreamId": { + "type": "string", + "description": "This value uniquely identifies the live stream bound to the broadcast." + }, + "enableClosedCaptions": { + "type": "boolean", + "description": "This setting indicates whether closed captioning is enabled for this broadcast. The ingestion URL of the closed captions is returned through the liveStreams API." + }, + "enableContentEncryption": { + "type": "boolean", + "description": "This setting indicates whether YouTube should enable content encryption for the broadcast.", + "annotations": { + "required": [ + "youtube.liveBroadcasts.update" + ] + } + }, + "enableDvr": { + "type": "boolean", + "description": "This setting determines whether viewers can access DVR controls while watching the video. DVR controls enable the viewer to control the video playback experience by pausing, rewinding, or fast forwarding content. The default value for this property is true.\n\n\n\nImportant: You must set the value to true and also set the enableArchive property's value to true if you want to make playback available immediately after the broadcast ends.", + "annotations": { + "required": [ + "youtube.liveBroadcasts.update" + ] + } + }, + "enableEmbed": { + "type": "boolean", + "description": "This setting indicates whether the broadcast video can be played in an embedded player. If you choose to archive the video (using the enableArchive property), this setting will also apply to the archived video.", + "annotations": { + "required": [ + "youtube.liveBroadcasts.update" + ] + } + }, + "monitorStream": { + "$ref": "MonitorStreamInfo", + "description": "The monitorStream object contains information about the monitor stream, which the broadcaster can use to review the event content before the broadcast stream is shown publicly." + }, + "recordFromStart": { + "type": "boolean", + "description": "Automatically start recording after the event goes live. The default value for this property is true.\n\n\n\nImportant: You must also set the enableDvr property's value to true if you want the playback to be available immediately after the broadcast ends. If you set this property's value to true but do not also set the enableDvr property to true, there may be a delay of around one day before the archived video will be available for playback.", + "annotations": { + "required": [ + "youtube.liveBroadcasts.update" + ] + } + }, + "startWithSlate": { + "type": "boolean", + "description": "This setting indicates whether the broadcast should automatically begin with an in-stream slate when you update the broadcast's status to live. After updating the status, you then need to send a liveCuepoints.insert request that sets the cuepoint's eventState to end to remove the in-stream slate and make your broadcast stream visible to viewers.", + "annotations": { + "required": [ + "youtube.liveBroadcasts.update" + ] + } + } + } + }, + "LiveBroadcastListResponse": { + "id": "LiveBroadcastListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of broadcasts that match the request criteria.", + "items": { + "$ref": "LiveBroadcast" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#liveBroadcastListResponse\".", + "default": "youtube#liveBroadcastListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "LiveBroadcastSnippet": { + "id": "LiveBroadcastSnippet", + "type": "object", + "properties": { + "actualEndTime": { + "type": "string", + "description": "The date and time that the broadcast actually ended. This information is only available once the broadcast's state is complete. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "actualStartTime": { + "type": "string", + "description": "The date and time that the broadcast actually started. This information is only available once the broadcast's state is live. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the channel that is publishing the broadcast." + }, + "description": { + "type": "string", + "description": "The broadcast's description. As with the title, you can set this field by modifying the broadcast resource or by setting the description field of the corresponding video resource." + }, + "publishedAt": { + "type": "string", + "description": "The date and time that the broadcast was added to YouTube's live broadcast schedule. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "scheduledEndTime": { + "type": "string", + "description": "The date and time that the broadcast is scheduled to end. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time", + "annotations": { + "required": [ + "youtube.liveBroadcasts.insert", + "youtube.liveBroadcasts.update" + ] + } + }, + "scheduledStartTime": { + "type": "string", + "description": "The date and time that the broadcast is scheduled to start. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time", + "annotations": { + "required": [ + "youtube.liveBroadcasts.insert", + "youtube.liveBroadcasts.update" + ] + } + }, + "thumbnails": { + "$ref": "ThumbnailDetails", + "description": "A map of thumbnail images associated with the broadcast. For each nested object in this object, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail." + }, + "title": { + "type": "string", + "description": "The broadcast's title. Note that the broadcast represents exactly one YouTube video. You can set this field by modifying the broadcast resource or by setting the title field of the corresponding video resource.", + "annotations": { + "required": [ + "youtube.liveBroadcasts.insert", + "youtube.liveBroadcasts.update" + ] + } + } + } + }, + "LiveBroadcastStatus": { + "id": "LiveBroadcastStatus", + "type": "object", + "properties": { + "lifeCycleStatus": { + "type": "string", + "description": "The broadcast's status. The status can be updated using the API's liveBroadcasts.transition method.", + "enum": [ + "abandoned", + "complete", + "completeStarting", + "created", + "live", + "liveStarting", + "ready", + "reclaimed", + "revoked", + "testStarting", + "testing" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "privacyStatus": { + "type": "string", + "description": "The broadcast's privacy status. Note that the broadcast represents exactly one YouTube video, so the privacy settings are identical to those supported for videos. In addition, you can set this field by modifying the broadcast resource or by setting the privacyStatus field of the corresponding video resource.", + "enum": [ + "private", + "public", + "unlisted" + ], + "enumDescriptions": [ + "", + "", + "" + ], + "annotations": { + "required": [ + "youtube.liveBroadcasts.insert", + "youtube.liveBroadcasts.update" + ] + } + }, + "recordingStatus": { + "type": "string", + "description": "The broadcast's recording status.", + "enum": [ + "notRecording", + "recorded", + "recording" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "LiveStream": { + "id": "LiveStream", + "type": "object", + "description": "A live stream describes a live ingestion point.", + "properties": { + "cdn": { + "$ref": "CdnSettings", + "description": "The cdn object defines the live stream's content delivery network (CDN) settings. These settings provide details about the manner in which you stream your content to YouTube." + }, + "contentDetails": { + "$ref": "LiveStreamContentDetails", + "description": "The content_details object contains information about the stream, including the closed captions ingestion URL." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube assigns to uniquely identify the stream.", + "annotations": { + "required": [ + "youtube.liveStreams.update" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#liveStream\".", + "default": "youtube#liveStream" + }, + "snippet": { + "$ref": "LiveStreamSnippet", + "description": "The snippet object contains basic details about the stream, including its channel, title, and description." + }, + "status": { + "$ref": "LiveStreamStatus", + "description": "The status object contains information about live stream's status." + } + } + }, + "LiveStreamContentDetails": { + "id": "LiveStreamContentDetails", + "type": "object", + "description": "Detailed settings of a stream.", + "properties": { + "closedCaptionsIngestionUrl": { + "type": "string", + "description": "The ingestion URL where the closed captions of this stream are sent." + } + } + }, + "LiveStreamListResponse": { + "id": "LiveStreamListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of live streams that match the request criteria.", + "items": { + "$ref": "LiveStream" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#liveStreamListResponse\".", + "default": "youtube#liveStreamListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "LiveStreamSnippet": { + "id": "LiveStreamSnippet", + "type": "object", + "properties": { + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the channel that is transmitting the stream." + }, + "description": { + "type": "string", + "description": "The stream's description. The value cannot be longer than 10000 characters." + }, + "publishedAt": { + "type": "string", + "description": "The date and time that the stream was created. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "title": { + "type": "string", + "description": "The stream's title. The value must be between 1 and 128 characters long.", + "annotations": { + "required": [ + "youtube.liveStreams.insert", + "youtube.liveStreams.update" + ] + } + } + } + }, + "LiveStreamStatus": { + "id": "LiveStreamStatus", + "type": "object", + "description": "Brief description of the live stream status.", + "properties": { + "streamStatus": { + "type": "string", + "enum": [ + "active", + "created", + "error", + "inactive", + "ready" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + }, + "LocalizedProperty": { + "id": "LocalizedProperty", + "type": "object", + "description": "Represent a property available in different languages.", + "properties": { + "default": { + "type": "string", + "description": "Default value for the localized property." + }, + "localized": { + "type": "array", + "description": "The localized values.", + "items": { + "$ref": "LocalizedString" + } + } + } + }, + "LocalizedString": { + "id": "LocalizedString", + "type": "object", + "description": "A localized string.", + "properties": { + "language": { + "type": "string", + "description": "Language associated to this value." + }, + "value": { + "type": "string", + "description": "Value of the property." + } + } + }, + "MonitorStreamInfo": { + "id": "MonitorStreamInfo", + "type": "object", + "description": "Settings and Info of the monitor stream", + "properties": { + "broadcastStreamDelayMs": { + "type": "integer", + "description": "If you have set the enableMonitorStream property to true, then this property determines the length of the live broadcast delay.", + "format": "uint32", + "annotations": { + "required": [ + "youtube.liveBroadcasts.update" + ] + } + }, + "embedHtml": { + "type": "string", + "description": "HTML code that embeds a player that plays the monitor stream." + }, + "enableMonitorStream": { + "type": "boolean", + "description": "This value determines whether the monitor stream is enabled for the broadcast. If the monitor stream is enabled, then YouTube will broadcast the event content on a special stream intended only for the broadcaster's consumption. The broadcaster can use the stream to review the event content and also to identify the optimal times to insert cuepoints.\n\nYou need to set this value to true if you intend to have a broadcast delay for your event.\n\nNote: This property cannot be updated once the broadcast is in the testing or live state.", + "annotations": { + "required": [ + "youtube.liveBroadcasts.update" + ] + } + } + } + }, + "PageInfo": { + "id": "PageInfo", + "type": "object", + "description": "Paging details for lists of resources, including total number of items available and number of resources returned in a single page.", + "properties": { + "resultsPerPage": { + "type": "integer", + "description": "The number of results included in the API response.", + "format": "int32" + }, + "totalResults": { + "type": "integer", + "description": "The total number of results in the result set.", + "format": "int32" + } + } + }, + "Playlist": { + "id": "Playlist", + "type": "object", + "description": "A playlist resource represents a YouTube playlist. A playlist is a collection of videos that can be viewed sequentially and shared with other users. A playlist can contain up to 200 videos, and YouTube does not limit the number of playlists that each user creates. By default, playlists are publicly visible to other users, but playlists can be public or private.\n\nYouTube also uses playlists to identify special collections of videos for a channel, such as: \n- uploaded videos \n- favorite videos \n- positively rated (liked) videos \n- watch history \n- watch later To be more specific, these lists are associated with a channel, which is a collection of a person, group, or company's videos, playlists, and other YouTube information. You can retrieve the playlist IDs for each of these lists from the channel resource for a given channel.\n\nYou can then use the playlistItems.list method to retrieve any of those lists. You can also add or remove items from those lists by calling the playlistItems.insert and playlistItems.delete methods.", + "properties": { + "contentDetails": { + "$ref": "PlaylistContentDetails", + "description": "The contentDetails object contains information like video count." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the playlist." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#playlist\".", + "default": "youtube#playlist" + }, + "player": { + "$ref": "PlaylistPlayer", + "description": "The player object contains information that you would use to play the playlist in an embedded player." + }, + "snippet": { + "$ref": "PlaylistSnippet", + "description": "The snippet object contains basic details about the playlist, such as its title and description." + }, + "status": { + "$ref": "PlaylistStatus", + "description": "The status object contains status information for the playlist." + } + } + }, + "PlaylistContentDetails": { + "id": "PlaylistContentDetails", + "type": "object", + "properties": { + "itemCount": { + "type": "integer", + "description": "The number of videos in the playlist.", + "format": "uint32" + } + } + }, + "PlaylistItem": { + "id": "PlaylistItem", + "type": "object", + "description": "A playlistItem resource identifies another resource, such as a video, that is included in a playlist. In addition, the playlistItem resource contains details about the included resource that pertain specifically to how that resource is used in that playlist.\n\nYouTube uses playlists to identify special collections of videos for a channel, such as: \n- uploaded videos \n- favorite videos \n- positively rated (liked) videos \n- watch history \n- watch later To be more specific, these lists are associated with a channel, which is a collection of a person, group, or company's videos, playlists, and other YouTube information.\n\nYou can retrieve the playlist IDs for each of these lists from the channel resource for a given channel. You can then use the playlistItems.list method to retrieve any of those lists. You can also add or remove items from those lists by calling the playlistItems.insert and playlistItems.delete methods. For example, if a user gives a positive rating to a video, you would insert that video into the liked videos playlist for that user's channel.", + "properties": { + "contentDetails": { + "$ref": "PlaylistItemContentDetails", + "description": "The contentDetails object is included in the resource if the included item is a YouTube video. The object contains additional information about the video." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the playlist item." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#playlistItem\".", + "default": "youtube#playlistItem" + }, + "snippet": { + "$ref": "PlaylistItemSnippet", + "description": "The snippet object contains basic details about the playlist item, such as its title and position in the playlist." + }, + "status": { + "$ref": "PlaylistItemStatus", + "description": "The status object contains information about the playlist item's privacy status." + } + } + }, + "PlaylistItemContentDetails": { + "id": "PlaylistItemContentDetails", + "type": "object", + "properties": { + "endAt": { + "type": "string", + "description": "The time, measured in seconds from the start of the video, when the video should stop playing. (The playlist owner can specify the times when the video should start and stop playing when the video is played in the context of the playlist.) By default, assume that the video.endTime is the end of the video." + }, + "note": { + "type": "string", + "description": "A user-generated note for this item." + }, + "startAt": { + "type": "string", + "description": "The time, measured in seconds from the start of the video, when the video should start playing. (The playlist owner can specify the times when the video should start and stop playing when the video is played in the context of the playlist.) The default value is 0." + }, + "videoId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify a video. To retrieve the video resource, set the id query parameter to this value in your API request." + } + } + }, + "PlaylistItemListResponse": { + "id": "PlaylistItemListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of playlist items that match the request criteria.", + "items": { + "$ref": "PlaylistItem" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#playlistItemListResponse\".", + "default": "youtube#playlistItemListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "PlaylistItemSnippet": { + "id": "PlaylistItemSnippet", + "type": "object", + "description": "Basic details about a playlist, including title, description and thumbnails.", + "properties": { + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the user that added the item to the playlist." + }, + "channelTitle": { + "type": "string", + "description": "Channel title for the channel that the playlist item belongs to." + }, + "description": { + "type": "string", + "description": "The item's description." + }, + "playlistId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the playlist that the playlist item is in.", + "annotations": { + "required": [ + "youtube.playlistItems.insert", + "youtube.playlistItems.update" + ] + } + }, + "position": { + "type": "integer", + "description": "The order in which the item appears in the playlist. The value uses a zero-based index, so the first item has a position of 0, the second item has a position of 1, and so forth.", + "format": "uint32" + }, + "publishedAt": { + "type": "string", + "description": "The date and time that the item was added to the playlist. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "resourceId": { + "$ref": "ResourceId", + "description": "The id object contains information that can be used to uniquely identify the resource that is included in the playlist as the playlist item.", + "annotations": { + "required": [ + "youtube.playlistItems.insert", + "youtube.playlistItems.update" + ] + } + }, + "thumbnails": { + "$ref": "ThumbnailDetails", + "description": "A map of thumbnail images associated with the playlist item. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail." + }, + "title": { + "type": "string", + "description": "The item's title." + } + } + }, + "PlaylistItemStatus": { + "id": "PlaylistItemStatus", + "type": "object", + "description": "Information about the playlist item's privacy status.", + "properties": { + "privacyStatus": { + "type": "string", + "description": "This resource's privacy status.", + "enum": [ + "private", + "public", + "unlisted" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "PlaylistListResponse": { + "id": "PlaylistListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of playlists that match the request criteria.", + "items": { + "$ref": "Playlist" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#playlistListResponse\".", + "default": "youtube#playlistListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "PlaylistPlayer": { + "id": "PlaylistPlayer", + "type": "object", + "properties": { + "embedHtml": { + "type": "string", + "description": "An \u003ciframe\u003e tag that embeds a player that will play the playlist." + } + } + }, + "PlaylistSnippet": { + "id": "PlaylistSnippet", + "type": "object", + "description": "Basic details about a playlist, including title, description and thumbnails.", + "properties": { + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the channel that published the playlist." + }, + "channelTitle": { + "type": "string", + "description": "The channel title of the channel that the video belongs to." + }, + "description": { + "type": "string", + "description": "The playlist's description." + }, + "publishedAt": { + "type": "string", + "description": "The date and time that the playlist was created. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "tags": { + "type": "array", + "description": "Keyword tags associated with the playlist.", + "items": { + "type": "string" + } + }, + "thumbnails": { + "$ref": "ThumbnailDetails", + "description": "A map of thumbnail images associated with the playlist. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail." + }, + "title": { + "type": "string", + "description": "The playlist's title.", + "annotations": { + "required": [ + "youtube.playlists.insert", + "youtube.playlists.update" + ] + } + } + } + }, + "PlaylistStatus": { + "id": "PlaylistStatus", + "type": "object", + "properties": { + "privacyStatus": { + "type": "string", + "description": "The playlist's privacy status.", + "enum": [ + "private", + "public", + "unlisted" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "PromotedItem": { + "id": "PromotedItem", + "type": "object", + "description": "Describes a single promoted item.", + "properties": { + "customMessage": { + "type": "string", + "description": "A custom message to display for this promotion. This field is currently ignored unless the promoted item is a website." + }, + "id": { + "$ref": "PromotedItemId", + "description": "Identifies the promoted item." + }, + "promotedByContentOwner": { + "type": "boolean", + "description": "If true, the content owner's name will be used when displaying the promotion. This field can only be set when the update is made on behalf of the content owner." + }, + "timing": { + "$ref": "InvideoTiming", + "description": "The temporal position within the video where the promoted item will be displayed. If present, it overrides the default timing." + } + } + }, + "PromotedItemId": { + "id": "PromotedItemId", + "type": "object", + "description": "Describes a single promoted item id. It is a union of various possible types.", + "properties": { + "recentlyUploadedBy": { + "type": "string", + "description": "If type is recentUpload, this field identifies the channel from which to take the recent upload. If missing, the channel is assumed to be the same channel for which the invideoPromotion is set." + }, + "type": { + "type": "string", + "description": "Describes the type of the promoted item.", + "enum": [ + "recentUpload", + "video", + "website" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "videoId": { + "type": "string", + "description": "If the promoted item represents a video, this field represents the unique YouTube ID identifying it. This field will be present only if type has the value video." + }, + "websiteUrl": { + "type": "string", + "description": "If the promoted item represents a website, this field represents the url pointing to the website. This field will be present only if type has the value website." + } + } + }, + "PropertyValue": { + "id": "PropertyValue", + "type": "object", + "description": "A pair Property / Value.", + "properties": { + "property": { + "type": "string", + "description": "A property." + }, + "value": { + "type": "string", + "description": "The property's value." + } + } + }, + "ResourceId": { + "id": "ResourceId", + "type": "object", + "description": "A resource id is a generic reference that points to another YouTube resource.", + "properties": { + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the referred resource, if that resource is a channel. This property is only present if the resourceId.kind value is youtube#channel." + }, + "kind": { + "type": "string", + "description": "The type of the API resource." + }, + "playlistId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the referred resource, if that resource is a playlist. This property is only present if the resourceId.kind value is youtube#playlist." + }, + "videoId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the referred resource, if that resource is a video. This property is only present if the resourceId.kind value is youtube#video." + } + } + }, + "SearchListResponse": { + "id": "SearchListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of results that match the search criteria.", + "items": { + "$ref": "SearchResult" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#searchListResponse\".", + "default": "youtube#searchListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "SearchResult": { + "id": "SearchResult", + "type": "object", + "description": "A search result contains information about a YouTube video, channel, or playlist that matches the search parameters specified in an API request. While a search result points to a uniquely identifiable resource, like a video, it does not have its own persistent data.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "$ref": "ResourceId", + "description": "The id object contains information that can be used to uniquely identify the resource that matches the search request." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#searchResult\".", + "default": "youtube#searchResult" + }, + "snippet": { + "$ref": "SearchResultSnippet", + "description": "The snippet object contains basic details about a search result, such as its title or description. For example, if the search result is a video, then the title will be the video's title and the description will be the video's description." + } + } + }, + "SearchResultSnippet": { + "id": "SearchResultSnippet", + "type": "object", + "description": "Basic details about a search result, including title, description and thumbnails of the item referenced by the search result.", + "properties": { + "channelId": { + "type": "string", + "description": "The value that YouTube uses to uniquely identify the channel that published the resource that the search result identifies." + }, + "channelTitle": { + "type": "string", + "description": "The title of the channel that published the resource that the search result identifies." + }, + "description": { + "type": "string", + "description": "A description of the search result." + }, + "liveBroadcastContent": { + "type": "string", + "description": "It indicates if the resource (video or channel) has upcoming/active live broadcast content. Or it's \"none\" if there is not any upcoming/active live broadcasts.", + "enum": [ + "live", + "none", + "upcoming" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "publishedAt": { + "type": "string", + "description": "The creation date and time of the resource that the search result identifies. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "thumbnails": { + "$ref": "ThumbnailDetails", + "description": "A map of thumbnail images associated with the search result. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail." + }, + "title": { + "type": "string", + "description": "The title of the search result." + } + } + }, + "Subscription": { + "id": "Subscription", + "type": "object", + "description": "A subscription resource contains information about a YouTube user subscription. A subscription notifies a user when new videos are added to a channel or when another user takes one of several actions on YouTube, such as uploading a video, rating a video, or commenting on a video.", + "properties": { + "contentDetails": { + "$ref": "SubscriptionContentDetails", + "description": "The contentDetails object contains basic statistics about the subscription." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the subscription." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#subscription\".", + "default": "youtube#subscription" + }, + "snippet": { + "$ref": "SubscriptionSnippet", + "description": "The snippet object contains basic details about the subscription, including its title and the channel that the user subscribed to." + }, + "subscriberSnippet": { + "$ref": "SubscriptionSubscriberSnippet", + "description": "The subscriberSnippet object contains basic details about the sbuscriber." + } + } + }, + "SubscriptionContentDetails": { + "id": "SubscriptionContentDetails", + "type": "object", + "description": "Details about the content to witch a subscription refers.", + "properties": { + "activityType": { + "type": "string", + "description": "The type of activity this subscription is for (only uploads, everything).", + "enum": [ + "all", + "uploads" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "newItemCount": { + "type": "integer", + "description": "The number of new items in the subscription since its content was last read.", + "format": "uint32" + }, + "totalItemCount": { + "type": "integer", + "description": "The approximate number of items that the subscription points to.", + "format": "uint32" + } + } + }, + "SubscriptionListResponse": { + "id": "SubscriptionListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of subscriptions that match the request criteria.", + "items": { + "$ref": "Subscription" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#subscriptionListResponse\".", + "default": "youtube#subscriptionListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "SubscriptionSnippet": { + "id": "SubscriptionSnippet", + "type": "object", + "description": "Basic details about a subscription, including title, description and thumbnails of the subscribed item.", + "properties": { + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the subscriber's channel." + }, + "channelTitle": { + "type": "string", + "description": "Channel title for the channel that the subscription belongs to." + }, + "description": { + "type": "string", + "description": "The subscription's details." + }, + "publishedAt": { + "type": "string", + "description": "The date and time that the subscription was created. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "resourceId": { + "$ref": "ResourceId", + "description": "The id object contains information about the channel that the user subscribed to.", + "annotations": { + "required": [ + "youtube.subscriptions.insert" + ] + } + }, + "thumbnails": { + "$ref": "ThumbnailDetails", + "description": "A map of thumbnail images associated with the video. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail." + }, + "title": { + "type": "string", + "description": "The subscription's title." + } + } + }, + "SubscriptionSubscriberSnippet": { + "id": "SubscriptionSubscriberSnippet", + "type": "object", + "description": "Basic details about a subscription's subscriber including title, description, channel ID and thumbnails.", + "properties": { + "channelId": { + "type": "string", + "description": "The channel ID of the subscriber." + }, + "description": { + "type": "string", + "description": "The description of the subscriber." + }, + "thumbnails": { + "$ref": "ThumbnailDetails", + "description": "Thumbnails for this subscriber." + }, + "title": { + "type": "string", + "description": "The title of the subscriber." + } + } + }, + "Thumbnail": { + "id": "Thumbnail", + "type": "object", + "description": "A thumbnail is an image representing a YouTube resource.", + "properties": { + "height": { + "type": "integer", + "description": "(Optional) Height of the thumbnail image.", + "format": "uint32" + }, + "url": { + "type": "string", + "description": "The thumbnail image's URL." + }, + "width": { + "type": "integer", + "description": "(Optional) Width of the thumbnail image.", + "format": "uint32" + } + } + }, + "ThumbnailDetails": { + "id": "ThumbnailDetails", + "type": "object", + "description": "Internal representation of thumbnails for a YouTube resource.", + "properties": { + "default": { + "$ref": "Thumbnail", + "description": "The default image for this resource." + }, + "high": { + "$ref": "Thumbnail", + "description": "The high quality image for this resource." + }, + "maxres": { + "$ref": "Thumbnail", + "description": "The maximum resolution quality image for this resource." + }, + "medium": { + "$ref": "Thumbnail", + "description": "The medium quality image for this resource." + }, + "standard": { + "$ref": "Thumbnail", + "description": "The standard quality image for this resource." + } + } + }, + "ThumbnailSetResponse": { + "id": "ThumbnailSetResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of thumbnails.", + "items": { + "$ref": "ThumbnailDetails" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#thumbnailSetResponse\".", + "default": "youtube#thumbnailSetResponse" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "TokenPagination": { + "id": "TokenPagination", + "type": "object", + "description": "Stub token pagination template to suppress results." + }, + "Video": { + "id": "Video", + "type": "object", + "description": "A video resource represents a YouTube video.", + "properties": { + "ageGating": { + "$ref": "VideoAgeGating", + "description": "Age restriction details related to a video." + }, + "contentDetails": { + "$ref": "VideoContentDetails", + "description": "The contentDetails object contains information about the video content, including the length of the video and its aspect ratio." + }, + "conversionPings": { + "$ref": "VideoConversionPings", + "description": "The conversionPings object encapsulates information about url pings that need to be respected by the App in different video contexts." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "fileDetails": { + "$ref": "VideoFileDetails", + "description": "The fileDetails object encapsulates information about the video file that was uploaded to YouTube, including the file's resolution, duration, audio and video codecs, stream bitrates, and more. This data can only be retrieved by the video owner." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the video.", + "annotations": { + "required": [ + "youtube.videos.update" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#video\".", + "default": "youtube#video" + }, + "liveStreamingDetails": { + "$ref": "VideoLiveStreamingDetails", + "description": "The liveStreamingDetails object contains metadata about a live video broadcast. The object will only be present in a video resource if the video is an upcoming, live, or completed live broadcast." + }, + "monetizationDetails": { + "$ref": "VideoMonetizationDetails", + "description": "The monetizationDetails object encapsulates information about the monetization status of the video." + }, + "player": { + "$ref": "VideoPlayer", + "description": "The player object contains information that you would use to play the video in an embedded player." + }, + "processingDetails": { + "$ref": "VideoProcessingDetails", + "description": "The processingProgress object encapsulates information about YouTube's progress in processing the uploaded video file. The properties in the object identify the current processing status and an estimate of the time remaining until YouTube finishes processing the video. This part also indicates whether different types of data or content, such as file details or thumbnail images, are available for the video.\n\nThe processingProgress object is designed to be polled so that the video uploaded can track the progress that YouTube has made in processing the uploaded video file. This data can only be retrieved by the video owner." + }, + "projectDetails": { + "$ref": "VideoProjectDetails", + "description": "The projectDetails object contains information about the project specific video metadata." + }, + "recordingDetails": { + "$ref": "VideoRecordingDetails", + "description": "The recordingDetails object encapsulates information about the location, date and address where the video was recorded." + }, + "snippet": { + "$ref": "VideoSnippet", + "description": "The snippet object contains basic details about the video, such as its title, description, and category." + }, + "statistics": { + "$ref": "VideoStatistics", + "description": "The statistics object contains statistics about the video." + }, + "status": { + "$ref": "VideoStatus", + "description": "The status object contains information about the video's uploading, processing, and privacy statuses." + }, + "suggestions": { + "$ref": "VideoSuggestions", + "description": "The suggestions object encapsulates suggestions that identify opportunities to improve the video quality or the metadata for the uploaded video. This data can only be retrieved by the video owner." + }, + "topicDetails": { + "$ref": "VideoTopicDetails", + "description": "The topicDetails object encapsulates information about Freebase topics associated with the video." + } + } + }, + "VideoAgeGating": { + "id": "VideoAgeGating", + "type": "object", + "properties": { + "alcoholContent": { + "type": "boolean", + "description": "Indicates whether or not the video has alcoholic beverage content. Only users of legal purchasing age in a particular country, as identified by ICAP, can view the content." + }, + "restricted": { + "type": "boolean", + "description": "Age-restricted trailers. For redband trailers and adult-rated video-games. Only users aged 18+ can view the content. The the field is true the content is restricted to viewers aged 18+. Otherwise The field won't be present." + }, + "videoGameRating": { + "type": "string", + "description": "Video game rating, if any.", + "enum": [ + "anyone", + "m15Plus", + "m16Plus", + "m17Plus" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "VideoCategory": { + "id": "VideoCategory", + "type": "object", + "description": "A videoCategory resource identifies a category that has been or could be associated with uploaded videos.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the video category." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#videoCategory\".", + "default": "youtube#videoCategory" + }, + "snippet": { + "$ref": "VideoCategorySnippet", + "description": "The snippet object contains basic details about the video category, including its title." + } + } + }, + "VideoCategoryListResponse": { + "id": "VideoCategoryListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of video categories that can be associated with YouTube videos. In this map, the video category ID is the map key, and its value is the corresponding videoCategory resource.", + "items": { + "$ref": "VideoCategory" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#videoCategoryListResponse\".", + "default": "youtube#videoCategoryListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "VideoCategorySnippet": { + "id": "VideoCategorySnippet", + "type": "object", + "description": "Basic details about a video category, such as its localized title.", + "properties": { + "assignable": { + "type": "boolean" + }, + "channelId": { + "type": "string", + "description": "The YouTube channel that created the video category.", + "default": "UCBR8-60-B28hp2BmDPdntcQ" + }, + "title": { + "type": "string", + "description": "The video category's title." + } + } + }, + "VideoContentDetails": { + "id": "VideoContentDetails", + "type": "object", + "description": "Details about the content of a YouTube Video.", + "properties": { + "caption": { + "type": "string", + "description": "The value of captions indicates whether the video has captions or not.", + "enum": [ + "false", + "true" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "contentRating": { + "$ref": "ContentRating", + "description": "Specifies the ratings that the video received under various rating schemes." + }, + "countryRestriction": { + "$ref": "AccessPolicy", + "description": "The countryRestriction object contains information about the countries where a video is (or is not) viewable." + }, + "definition": { + "type": "string", + "description": "The value of definition indicates whether the video is available in high definition or only in standard definition.", + "enum": [ + "hd", + "sd" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "dimension": { + "type": "string", + "description": "The value of dimension indicates whether the video is available in 3D or in 2D." + }, + "duration": { + "type": "string", + "description": "The length of the video. The tag value is an ISO 8601 duration in the format PT#M#S, in which the letters PT indicate that the value specifies a period of time, and the letters M and S refer to length in minutes and seconds, respectively. The # characters preceding the M and S letters are both integers that specify the number of minutes (or seconds) of the video. For example, a value of PT15M51S indicates that the video is 15 minutes and 51 seconds long." + }, + "licensedContent": { + "type": "boolean", + "description": "The value of is_license_content indicates whether the video is licensed content." + }, + "regionRestriction": { + "$ref": "VideoContentDetailsRegionRestriction", + "description": "The regionRestriction object contains information about the countries where a video is (or is not) viewable. The object will contain either the contentDetails.regionRestriction.allowed property or the contentDetails.regionRestriction.blocked property." + } + } + }, + "VideoContentDetailsRegionRestriction": { + "id": "VideoContentDetailsRegionRestriction", + "type": "object", + "description": "DEPRECATED Region restriction of the video.", + "properties": { + "allowed": { + "type": "array", + "description": "A list of region codes that identify countries where the video is viewable. If this property is present and a country is not listed in its value, then the video is blocked from appearing in that country. If this property is present and contains an empty list, the video is blocked in all countries.", + "items": { + "type": "string" + } + }, + "blocked": { + "type": "array", + "description": "A list of region codes that identify countries where the video is blocked. If this property is present and a country is not listed in its value, then the video is viewable in that country. If this property is present and contains an empty list, the video is viewable in all countries.", + "items": { + "type": "string" + } + } + } + }, + "VideoConversionPing": { + "id": "VideoConversionPing", + "type": "object", + "properties": { + "context": { + "type": "string", + "description": "Defines the context of the ping.", + "enum": [ + "comment", + "dislike", + "like", + "share" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "conversionUrl": { + "type": "string", + "description": "The url (without the schema) that the app shall send the ping to. It's at caller's descretion to decide which schema to use (http vs https) Example of a returned url: //googleads.g.doubleclick.net/pagead/ viewthroughconversion/962985656/?data=path%3DtHe_path%3Btype%3D like%3Butuid%3DGISQtTNGYqaYl4sKxoVvKA%3Bytvid%3DUrIaJUvIQDg&labe=default The caller must append biscotti authentication (ms param in case of mobile, for example) to this ping." + } + } + }, + "VideoConversionPings": { + "id": "VideoConversionPings", + "type": "object", + "properties": { + "pings": { + "type": "array", + "description": "Pings that the app shall fire for a video (authenticated by biscotti cookie). Each ping has a context, in which the app must fire the ping, and a url identifying the ping.", + "items": { + "$ref": "VideoConversionPing" + } + } + } + }, + "VideoFileDetails": { + "id": "VideoFileDetails", + "type": "object", + "description": "Describes original video file properties, including technical details about audio and video streams, but also metadata information like content length, digitization time, or geotagging information.", + "properties": { + "audioStreams": { + "type": "array", + "description": "A list of audio streams contained in the uploaded video file. Each item in the list contains detailed metadata about an audio stream.", + "items": { + "$ref": "VideoFileDetailsAudioStream" + } + }, + "bitrateBps": { + "type": "string", + "description": "The uploaded video file's combined (video and audio) bitrate in bits per second.", + "format": "uint64" + }, + "container": { + "type": "string", + "description": "The uploaded video file's container format." + }, + "creationTime": { + "type": "string", + "description": "The date and time when the uploaded video file was created. The value is specified in ISO 8601 format. Currently, the following ISO 8601 formats are supported: \n- Date only: YYYY-MM-DD \n- Naive time: YYYY-MM-DDTHH:MM:SS \n- Time with timezone: YYYY-MM-DDTHH:MM:SS+HH:MM" + }, + "durationMs": { + "type": "string", + "description": "The length of the uploaded video in milliseconds.", + "format": "uint64" + }, + "fileName": { + "type": "string", + "description": "The uploaded file's name. This field is present whether a video file or another type of file was uploaded." + }, + "fileSize": { + "type": "string", + "description": "The uploaded file's size in bytes. This field is present whether a video file or another type of file was uploaded.", + "format": "uint64" + }, + "fileType": { + "type": "string", + "description": "The uploaded file's type as detected by YouTube's video processing engine. Currently, YouTube only processes video files, but this field is present whether a video file or another type of file was uploaded.", + "enum": [ + "archive", + "audio", + "document", + "image", + "other", + "project", + "video" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "recordingLocation": { + "$ref": "GeoPoint", + "description": "Geographic coordinates that identify the place where the uploaded video was recorded. Coordinates are defined using WGS 84." + }, + "videoStreams": { + "type": "array", + "description": "A list of video streams contained in the uploaded video file. Each item in the list contains detailed metadata about a video stream.", + "items": { + "$ref": "VideoFileDetailsVideoStream" + } + } + } + }, + "VideoFileDetailsAudioStream": { + "id": "VideoFileDetailsAudioStream", + "type": "object", + "description": "Information about an audio stream.", + "properties": { + "bitrateBps": { + "type": "string", + "description": "The audio stream's bitrate, in bits per second.", + "format": "uint64" + }, + "channelCount": { + "type": "integer", + "description": "The number of audio channels that the stream contains.", + "format": "uint32" + }, + "codec": { + "type": "string", + "description": "The audio codec that the stream uses." + }, + "vendor": { + "type": "string", + "description": "A value that uniquely identifies a video vendor. Typically, the value is a four-letter vendor code." + } + } + }, + "VideoFileDetailsVideoStream": { + "id": "VideoFileDetailsVideoStream", + "type": "object", + "description": "Information about a video stream.", + "properties": { + "aspectRatio": { + "type": "number", + "description": "The video content's display aspect ratio, which specifies the aspect ratio in which the video should be displayed.", + "format": "double" + }, + "bitrateBps": { + "type": "string", + "description": "The video stream's bitrate, in bits per second.", + "format": "uint64" + }, + "codec": { + "type": "string", + "description": "The video codec that the stream uses." + }, + "frameRateFps": { + "type": "number", + "description": "The video stream's frame rate, in frames per second.", + "format": "double" + }, + "heightPixels": { + "type": "integer", + "description": "The encoded video content's height in pixels.", + "format": "uint32" + }, + "rotation": { + "type": "string", + "description": "The amount that YouTube needs to rotate the original source content to properly display the video.", + "enum": [ + "clockwise", + "counterClockwise", + "none", + "other", + "upsideDown" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "vendor": { + "type": "string", + "description": "A value that uniquely identifies a video vendor. Typically, the value is a four-letter vendor code." + }, + "widthPixels": { + "type": "integer", + "description": "The encoded video content's width in pixels. You can calculate the video's encoding aspect ratio as width_pixels / height_pixels.", + "format": "uint32" + } + } + }, + "VideoGetRatingResponse": { + "id": "VideoGetRatingResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "items": { + "type": "array", + "description": "A list of ratings that match the request criteria.", + "items": { + "$ref": "VideoRating" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#videoGetRatingResponse\".", + "default": "youtube#videoGetRatingResponse" + } + } + }, + "VideoListResponse": { + "id": "VideoListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of videos that match the request criteria.", + "items": { + "$ref": "Video" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#videoListResponse\".", + "default": "youtube#videoListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "VideoLiveStreamingDetails": { + "id": "VideoLiveStreamingDetails", + "type": "object", + "description": "Details about the live streaming metadata.", + "properties": { + "actualEndTime": { + "type": "string", + "description": "The time that the broadcast actually ended. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. This value will not be available until the broadcast is over.", + "format": "date-time" + }, + "actualStartTime": { + "type": "string", + "description": "The time that the broadcast actually started. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. This value will not be available until the broadcast begins.", + "format": "date-time" + }, + "concurrentViewers": { + "type": "string", + "description": "The number of viewers currently watching the broadcast. The property and its value will be present if the broadcast has current viewers and the broadcast owner has not hidden the viewcount for the video. Note that YouTube stops tracking the number of concurrent viewers for a broadcast when the broadcast ends. So, this property would not identify the number of viewers watching an archived video of a live broadcast that already ended.", + "format": "uint64" + }, + "scheduledEndTime": { + "type": "string", + "description": "The time that the broadcast is scheduled to end. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. If the value is empty or the property is not present, then the broadcast is scheduled to continue indefinitely.", + "format": "date-time" + }, + "scheduledStartTime": { + "type": "string", + "description": "The time that the broadcast is scheduled to begin. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + } + } + }, + "VideoMonetizationDetails": { + "id": "VideoMonetizationDetails", + "type": "object", + "description": "Details about monetization of a YouTube Video.", + "properties": { + "access": { + "$ref": "AccessPolicy", + "description": "The value of access indicates whether the video can be monetized or not." + } + } + }, + "VideoPlayer": { + "id": "VideoPlayer", + "type": "object", + "description": "Player to be used for a video playback.", + "properties": { + "embedHtml": { + "type": "string", + "description": "An \u003ciframe\u003e tag that embeds a player that will play the video." + } + } + }, + "VideoProcessingDetails": { + "id": "VideoProcessingDetails", + "type": "object", + "description": "Describes processing status and progress and availability of some other Video resource parts.", + "properties": { + "editorSuggestionsAvailability": { + "type": "string", + "description": "This value indicates whether video editing suggestions, which might improve video quality or the playback experience, are available for the video. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request." + }, + "fileDetailsAvailability": { + "type": "string", + "description": "This value indicates whether file details are available for the uploaded video. You can retrieve a video's file details by requesting the fileDetails part in your videos.list() request." + }, + "processingFailureReason": { + "type": "string", + "description": "The reason that YouTube failed to process the video. This property will only have a value if the processingStatus property's value is failed.", + "enum": [ + "other", + "streamingFailed", + "transcodeFailed", + "uploadFailed" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "processingIssuesAvailability": { + "type": "string", + "description": "This value indicates whether the video processing engine has generated suggestions that might improve YouTube's ability to process the the video, warnings that explain video processing problems, or errors that cause video processing problems. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request." + }, + "processingProgress": { + "$ref": "VideoProcessingDetailsProcessingProgress", + "description": "The processingProgress object contains information about the progress YouTube has made in processing the video. The values are really only relevant if the video's processing status is processing." + }, + "processingStatus": { + "type": "string", + "description": "The video's processing status. This value indicates whether YouTube was able to process the video or if the video is still being processed.", + "enum": [ + "failed", + "processing", + "succeeded", + "terminated" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "tagSuggestionsAvailability": { + "type": "string", + "description": "This value indicates whether keyword (tag) suggestions are available for the video. Tags can be added to a video's metadata to make it easier for other users to find the video. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request." + }, + "thumbnailsAvailability": { + "type": "string", + "description": "This value indicates whether thumbnail images have been generated for the video." + } + } + }, + "VideoProcessingDetailsProcessingProgress": { + "id": "VideoProcessingDetailsProcessingProgress", + "type": "object", + "description": "Video processing progress and completion time estimate.", + "properties": { + "partsProcessed": { + "type": "string", + "description": "The number of parts of the video that YouTube has already processed. You can estimate the percentage of the video that YouTube has already processed by calculating:\n100 * parts_processed / parts_total\n\nNote that since the estimated number of parts could increase without a corresponding increase in the number of parts that have already been processed, it is possible that the calculated progress could periodically decrease while YouTube processes a video.", + "format": "uint64" + }, + "partsTotal": { + "type": "string", + "description": "An estimate of the total number of parts that need to be processed for the video. The number may be updated with more precise estimates while YouTube processes the video.", + "format": "uint64" + }, + "timeLeftMs": { + "type": "string", + "description": "An estimate of the amount of time, in millseconds, that YouTube needs to finish processing the video.", + "format": "uint64" + } + } + }, + "VideoProjectDetails": { + "id": "VideoProjectDetails", + "type": "object", + "description": "Project specific details about the content of a YouTube Video.", + "properties": { + "tags": { + "type": "array", + "description": "A list of project tags associated with the video during the upload.", + "items": { + "type": "string" + } + } + } + }, + "VideoRating": { + "id": "VideoRating", + "type": "object", + "properties": { + "rating": { + "type": "string", + "enum": [ + "dislike", + "like", + "none", + "unspecified" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "videoId": { + "type": "string" + } + } + }, + "VideoRecordingDetails": { + "id": "VideoRecordingDetails", + "type": "object", + "description": "Recording information associated with the video.", + "properties": { + "location": { + "$ref": "GeoPoint", + "description": "The geolocation information associated with the video." + }, + "locationDescription": { + "type": "string", + "description": "The text description of the location where the video was recorded." + }, + "recordingDate": { + "type": "string", + "description": "The date and time when the video was recorded. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + } + } + }, + "VideoSnippet": { + "id": "VideoSnippet", + "type": "object", + "description": "Basic details about a video, including title, description, uploader, thumbnails and category.", + "properties": { + "categoryId": { + "type": "string", + "description": "The YouTube video category associated with the video." + }, + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the channel that the video was uploaded to." + }, + "channelTitle": { + "type": "string", + "description": "Channel title for the channel that the video belongs to." + }, + "description": { + "type": "string", + "description": "The video's description." + }, + "liveBroadcastContent": { + "type": "string", + "description": "Indicates if the video is an upcoming/active live broadcast. Or it's \"none\" if the video is not an upcoming/active live broadcast.", + "enum": [ + "live", + "none", + "upcoming" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "publishedAt": { + "type": "string", + "description": "The date and time that the video was uploaded. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "tags": { + "type": "array", + "description": "A list of keyword tags associated with the video. Tags may contain spaces. This field is only visible to the video's uploader.", + "items": { + "type": "string" + } + }, + "thumbnails": { + "$ref": "ThumbnailDetails", + "description": "A map of thumbnail images associated with the video. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail." + }, + "title": { + "type": "string", + "description": "The video's title." + } + } + }, + "VideoStatistics": { + "id": "VideoStatistics", + "type": "object", + "description": "Statistics about the video, such as the number of times the video was viewed or liked.", + "properties": { + "commentCount": { + "type": "string", + "description": "The number of comments for the video.", + "format": "uint64" + }, + "dislikeCount": { + "type": "string", + "description": "The number of users who have indicated that they disliked the video by giving it a negative rating.", + "format": "uint64" + }, + "favoriteCount": { + "type": "string", + "description": "The number of users who currently have the video marked as a favorite video.", + "format": "uint64" + }, + "likeCount": { + "type": "string", + "description": "The number of users who have indicated that they liked the video by giving it a positive rating.", + "format": "uint64" + }, + "viewCount": { + "type": "string", + "description": "The number of times the video has been viewed.", + "format": "uint64" + } + } + }, + "VideoStatus": { + "id": "VideoStatus", + "type": "object", + "description": "Basic details about a video category, such as its localized title.", + "properties": { + "embeddable": { + "type": "boolean", + "description": "This value indicates if the video can be embedded on another website." + }, + "failureReason": { + "type": "string", + "description": "This value explains why a video failed to upload. This property is only present if the uploadStatus property indicates that the upload failed.", + "enum": [ + "codec", + "conversion", + "emptyFile", + "invalidFile", + "tooSmall", + "uploadAborted" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "license": { + "type": "string", + "description": "The video's license.", + "enum": [ + "creativeCommon", + "youtube" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "privacyStatus": { + "type": "string", + "description": "The video's privacy status.", + "enum": [ + "private", + "public", + "unlisted" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "publicStatsViewable": { + "type": "boolean", + "description": "This value indicates if the extended video statistics on the watch page can be viewed by everyone. Note that the view count, likes, etc will still be visible if this is disabled." + }, + "publishAt": { + "type": "string", + "description": "The date and time when the video is scheduled to publish. It can be set only if the privacy status of the video is private. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "rejectionReason": { + "type": "string", + "description": "This value explains why YouTube rejected an uploaded video. This property is only present if the uploadStatus property indicates that the upload was rejected.", + "enum": [ + "claim", + "copyright", + "duplicate", + "inappropriate", + "length", + "termsOfUse", + "trademark", + "uploaderAccountClosed", + "uploaderAccountSuspended" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "uploadStatus": { + "type": "string", + "description": "The status of the uploaded video.", + "enum": [ + "deleted", + "failed", + "processed", + "rejected", + "uploaded" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + }, + "VideoSuggestions": { + "id": "VideoSuggestions", + "type": "object", + "description": "Specifies suggestions on how to improve video content, including encoding hints, tag suggestions, and editor suggestions.", + "properties": { + "editorSuggestions": { + "type": "array", + "description": "A list of video editing operations that might improve the video quality or playback experience of the uploaded video.", + "items": { + "type": "string", + "enum": [ + "audioQuietAudioSwap", + "videoAutoLevels", + "videoCrop", + "videoStabilize" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + }, + "processingErrors": { + "type": "array", + "description": "A list of errors that will prevent YouTube from successfully processing the uploaded video video. These errors indicate that, regardless of the video's current processing status, eventually, that status will almost certainly be failed.", + "items": { + "type": "string", + "enum": [ + "archiveFile", + "audioFile", + "docFile", + "imageFile", + "notAVideoFile", + "projectFile" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + } + }, + "processingHints": { + "type": "array", + "description": "A list of suggestions that may improve YouTube's ability to process the video.", + "items": { + "type": "string", + "enum": [ + "nonStreamableMov", + "sendBestQualityVideo" + ], + "enumDescriptions": [ + "", + "" + ] + } + }, + "processingWarnings": { + "type": "array", + "description": "A list of reasons why YouTube may have difficulty transcoding the uploaded video or that might result in an erroneous transcoding. These warnings are generated before YouTube actually processes the uploaded video file. In addition, they identify issues that are unlikely to cause the video processing to fail but that might cause problems such as sync issues, video artifacts, or a missing audio track.", + "items": { + "type": "string", + "enum": [ + "hasEditlist", + "inconsistentResolution", + "problematicAudioCodec", + "problematicVideoCodec", + "unknownAudioCodec", + "unknownContainer", + "unknownVideoCodec" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "tagSuggestions": { + "type": "array", + "description": "A list of keyword tags that could be added to the video's metadata to increase the likelihood that users will locate your video when searching or browsing on YouTube.", + "items": { + "$ref": "VideoSuggestionsTagSuggestion" + } + } + } + }, + "VideoSuggestionsTagSuggestion": { + "id": "VideoSuggestionsTagSuggestion", + "type": "object", + "description": "A single tag suggestion with it's relevance information.", + "properties": { + "categoryRestricts": { + "type": "array", + "description": "A set of video categories for which the tag is relevant. You can use this information to display appropriate tag suggestions based on the video category that the video uploader associates with the video. By default, tag suggestions are relevant for all categories if there are no restricts defined for the keyword.", + "items": { + "type": "string" + } + }, + "tag": { + "type": "string", + "description": "The keyword tag suggested for the video." + } + } + }, + "VideoTopicDetails": { + "id": "VideoTopicDetails", + "type": "object", + "description": "Freebase topic information related to the video.", + "properties": { + "relevantTopicIds": { + "type": "array", + "description": "Similar to topic_id, except that these topics are merely relevant to the video. These are topics that may be mentioned in, or appear in the video. You can retrieve information about each topic using Freebase Topic API.", + "items": { + "type": "string" + } + }, + "topicIds": { + "type": "array", + "description": "A list of Freebase topic IDs that are centrally associated with the video. These are topics that are centrally featured in the video, and it can be said that the video is mainly about each of these. You can retrieve information about each topic using the Freebase Topic API.", + "items": { + "type": "string" + } + } + } + }, + "WatchSettings": { + "id": "WatchSettings", + "type": "object", + "description": "Branding properties for the watch.", + "properties": { + "backgroundColor": { + "type": "string", + "description": "The text color for the video watch page's branded area." + }, + "featuredPlaylistId": { + "type": "string", + "description": "An ID that uniquely identifies a playlist that displays next to the video player." + }, + "textColor": { + "type": "string", + "description": "The background color for the video watch page's branded area." + } + } + } + }, + "resources": { + "activities": { + "methods": { + "insert": { + "id": "youtube.activities.insert", + "path": "activities", + "httpMethod": "POST", + "description": "Posts a bulletin for a specific channel. (The user submitting the request must be authorized to act on the channel's behalf.)\n\nNote: Even though an activity resource can contain information about actions like a user rating a video or marking a video as a favorite, you need to use other API methods to generate those activity resources. For example, you would use the API's videos.rate() method to rate a video and the playlistItems.insert() method to mark a video as a favorite.", + "parameters": { + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet and contentDetails.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Activity" + }, + "response": { + "$ref": "Activity" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube" + ] + }, + "list": { + "id": "youtube.activities.list", + "path": "activities", + "httpMethod": "GET", + "description": "Returns a list of channel activity events that match the request criteria. For example, you can retrieve events associated with a particular channel, events associated with the user's subscriptions and Google+ friends, or the YouTube home page feed, which is customized for each user.", + "parameters": { + "channelId": { + "type": "string", + "description": "The channelId parameter specifies a unique YouTube channel ID. The API will then return a list of that channel's activities.", + "location": "query" + }, + "home": { + "type": "boolean", + "description": "Set this parameter's value to true to retrieve the activity feed that displays on the YouTube home page for the currently authenticated user.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "mine": { + "type": "boolean", + "description": "Set this parameter's value to true to retrieve a feed of the authenticated user's activities.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties.", + "required": true, + "location": "query" + }, + "publishedAfter": { + "type": "string", + "description": "The publishedAfter parameter specifies the earliest date and time that an activity could have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be included in the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time", + "location": "query" + }, + "publishedBefore": { + "type": "string", + "description": "The publishedBefore parameter specifies the date and time before which an activity must have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be excluded from the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time", + "location": "query" + }, + "regionCode": { + "type": "string", + "description": "The regionCode parameter instructs the API to return results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. YouTube uses this value when the authorized user's previous activity on YouTube does not provide enough information to generate the activity feed.", + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "ActivityListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.readonly" + ] + } + } + }, + "channelBanners": { + "methods": { + "insert": { + "id": "youtube.channelBanners.insert", + "path": "channelBanners/insert", + "httpMethod": "POST", + "description": "Uploads a channel banner image to YouTube. This method represents the first two steps in a three-step process to update the banner image for a channel:\n\n- Call the channelBanners.insert method to upload the binary image data to YouTube. The image must have a 16:9 aspect ratio and be at least 2120x1192 pixels.\n- Extract the url property's value from the response that the API returns for step 1.\n- Call the channels.update method to update the channel's branding settings. Set the brandingSettings.image.bannerExternalUrl property's value to the URL obtained in step 2.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + } + }, + "request": { + "$ref": "ChannelBannerResource" + }, + "response": { + "$ref": "ChannelBannerResource" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.upload" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "application/octet-stream", + "image/jpeg", + "image/png" + ], + "maxSize": "6MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/youtube/v3/channelBanners/insert" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/youtube/v3/channelBanners/insert" + } + } + } + } + } + }, + "channelSections": { + "methods": { + "delete": { + "id": "youtube.channelSections.delete", + "path": "channelSections", + "httpMethod": "DELETE", + "description": "Deletes a channelSection.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube channelSection ID for the resource that is being deleted. In a channelSection resource, the id property specifies the YouTube channelSection ID.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "insert": { + "id": "youtube.channelSections.insert", + "path": "channelSections", + "httpMethod": "POST", + "description": "Adds a channelSection for the authenticated user's channel.", + "parameters": { + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet and contentDetails.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "ChannelSection" + }, + "response": { + "$ref": "ChannelSection" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "list": { + "id": "youtube.channelSections.list", + "path": "channelSections", + "httpMethod": "GET", + "description": "Returns channelSection resources that match the API request criteria.", + "parameters": { + "channelId": { + "type": "string", + "description": "The channelId parameter specifies a YouTube channel ID. The API will only return that channel's channelSections.", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of the YouTube channelSection ID(s) for the resource(s) that are being retrieved. In a channelSection resource, the id property specifies the YouTube channelSection ID.", + "location": "query" + }, + "mine": { + "type": "boolean", + "description": "Set this parameter's value to true to retrieve a feed of the authenticated user's channelSections.", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more channelSection resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channelSection resource, the snippet property contains other properties, such as a display title for the channelSection. If you set part=snippet, the API response will also contain all of those nested properties.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "ChannelSectionListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "update": { + "id": "youtube.channelSections.update", + "path": "channelSections", + "httpMethod": "PUT", + "description": "Update a channelSection.", + "parameters": { + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet and contentDetails.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "ChannelSection" + }, + "response": { + "$ref": "ChannelSection" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "channels": { + "methods": { + "list": { + "id": "youtube.channels.list", + "path": "channels", + "httpMethod": "GET", + "description": "Returns a collection of zero or more channel resources that match the request criteria.", + "parameters": { + "categoryId": { + "type": "string", + "description": "The categoryId parameter specifies a YouTube guide category, thereby requesting YouTube channels associated with that category.", + "location": "query" + }, + "forUsername": { + "type": "string", + "description": "The forUsername parameter specifies a YouTube username, thereby requesting the channel associated with that username.", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of the YouTube channel ID(s) for the resource(s) that are being retrieved. In a channel resource, the id property specifies the channel's YouTube channel ID.", + "location": "query" + }, + "managedByMe": { + "type": "boolean", + "description": "Set this parameter's value to true to instruct the API to only return channels managed by the content owner that the onBehalfOfContentOwner parameter specifies. The user must be authenticated as a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "mine": { + "type": "boolean", + "description": "Set this parameter's value to true to instruct the API to only return channels owned by the authenticated user.", + "location": "query" + }, + "mySubscribers": { + "type": "boolean", + "description": "Set this parameter's value to true to retrieve a list of channels that subscribed to the authenticated user's channel.", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "The onBehalfOfContentOwner parameter indicates that the authenticated user is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more channel resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, statistics, topicDetails, and invideoPromotion.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channel resource, the contentDetails property contains other properties, such as the uploads properties. As such, if you set part=contentDetails, the API response will also contain all of those nested properties.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "ChannelListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner", + "https://www.googleapis.com/auth/youtubepartner-channel-audit" + ] + }, + "update": { + "id": "youtube.channels.update", + "path": "channels", + "httpMethod": "PUT", + "description": "Updates a channel's metadata.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "The onBehalfOfContentOwner parameter indicates that the authenticated user is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are id and invideoPromotion.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Channel" + }, + "response": { + "$ref": "Channel" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "guideCategories": { + "methods": { + "list": { + "id": "youtube.guideCategories.list", + "path": "guideCategories", + "httpMethod": "GET", + "description": "Returns a list of categories that can be associated with YouTube channels.", + "parameters": { + "hl": { + "type": "string", + "description": "The hl parameter specifies the language that will be used for text values in the API response.", + "default": "en-US", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of the YouTube channel category ID(s) for the resource(s) that are being retrieved. In a guideCategory resource, the id property specifies the YouTube channel category ID.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more guideCategory resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a guideCategory resource, the snippet property contains other properties, such as the category's title. If you set part=snippet, the API response will also contain all of those nested properties.", + "required": true, + "location": "query" + }, + "regionCode": { + "type": "string", + "description": "The regionCode parameter instructs the API to return the list of guide categories available in the specified country. The parameter value is an ISO 3166-1 alpha-2 country code.", + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "GuideCategoryListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "i18nLanguages": { + "methods": { + "list": { + "id": "youtube.i18nLanguages.list", + "path": "i18nLanguages", + "httpMethod": "GET", + "description": "Returns a list of supported languages.", + "parameters": { + "hl": { + "type": "string", + "description": "The hl parameter specifies the language that should be used for text values in the API response.", + "default": "en_US", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more i18nLanguage resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "I18nLanguageListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "i18nRegions": { + "methods": { + "list": { + "id": "youtube.i18nRegions.list", + "path": "i18nRegions", + "httpMethod": "GET", + "description": "Returns a list of supported regions.", + "parameters": { + "hl": { + "type": "string", + "description": "The hl parameter specifies the language that should be used for text values in the API response.", + "default": "en_US", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more i18nRegion resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "I18nRegionListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "liveBroadcasts": { + "methods": { + "bind": { + "id": "youtube.liveBroadcasts.bind", + "path": "liveBroadcasts/bind", + "httpMethod": "POST", + "description": "Binds a YouTube broadcast to a stream or removes an existing binding between a broadcast and a stream. A broadcast can only be bound to one video stream.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the unique ID of the broadcast that is being bound to a video stream.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.", + "required": true, + "location": "query" + }, + "streamId": { + "type": "string", + "description": "The streamId parameter specifies the unique ID of the video stream that is being bound to a broadcast. If this parameter is omitted, the API will remove any existing binding between the broadcast and a video stream.", + "location": "query" + } + }, + "parameterOrder": [ + "id", + "part" + ], + "response": { + "$ref": "LiveBroadcast" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube" + ] + }, + "control": { + "id": "youtube.liveBroadcasts.control", + "path": "liveBroadcasts/control", + "httpMethod": "POST", + "description": "Controls the settings for a slate that can be displayed in the broadcast stream.", + "parameters": { + "displaySlate": { + "type": "boolean", + "description": "The displaySlate parameter specifies whether the slate is being enabled or disabled.", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube live broadcast ID that uniquely identifies the broadcast in which the slate is being updated.", + "required": true, + "location": "query" + }, + "offsetTimeMs": { + "type": "string", + "description": "The offsetTimeMs parameter specifies a positive time offset when the specified slate change will occur. The value is measured in milliseconds from the beginning of the broadcast's monitor stream, which is the time that the testing phase for the broadcast began. Even though it is specified in milliseconds, the value is actually an approximation, and YouTube completes the requested action as closely as possible to that time.\n\nIf you do not specify a value for this parameter, then YouTube performs the action as soon as possible. See the Getting started guide for more details.\n\nImportant: You should only specify a value for this parameter if your broadcast stream is delayed.", + "format": "uint64", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.", + "required": true, + "location": "query" + }, + "walltime": { + "type": "string", + "description": "The walltime parameter specifies the wall clock time at which the specified slate change will occur.", + "format": "date-time", + "location": "query" + } + }, + "parameterOrder": [ + "id", + "part" + ], + "response": { + "$ref": "LiveBroadcast" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube" + ] + }, + "delete": { + "id": "youtube.liveBroadcasts.delete", + "path": "liveBroadcasts", + "httpMethod": "DELETE", + "description": "Deletes a broadcast.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube live broadcast ID for the resource that is being deleted.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube" + ] + }, + "insert": { + "id": "youtube.liveBroadcasts.insert", + "path": "liveBroadcasts", + "httpMethod": "POST", + "description": "Creates a broadcast.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part properties that you can include in the parameter value are id, snippet, contentDetails, and status.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "LiveBroadcast" + }, + "response": { + "$ref": "LiveBroadcast" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube" + ] + }, + "list": { + "id": "youtube.liveBroadcasts.list", + "path": "liveBroadcasts", + "httpMethod": "GET", + "description": "Returns a list of YouTube broadcasts that match the API request parameters.", + "parameters": { + "broadcastStatus": { + "type": "string", + "description": "The broadcastStatus parameter filters the API response to only include broadcasts with the specified status.", + "enum": [ + "active", + "all", + "completed", + "upcoming" + ], + "enumDescriptions": [ + "Return current live broadcasts.", + "Return all broadcasts.", + "Return broadcasts that have already ended.", + "Return broadcasts that have not yet started." + ], + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of YouTube broadcast IDs that identify the broadcasts being retrieved. In a liveBroadcast resource, the id property specifies the broadcast's ID.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "mine": { + "type": "boolean", + "description": "The mine parameter can be used to instruct the API to only return broadcasts owned by the authenticated user. Set the parameter value to true to only retrieve your own broadcasts.", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "LiveBroadcastListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.readonly" + ] + }, + "transition": { + "id": "youtube.liveBroadcasts.transition", + "path": "liveBroadcasts/transition", + "httpMethod": "POST", + "description": "Changes the status of a YouTube live broadcast and initiates any processes associated with the new status. For example, when you transition a broadcast's status to testing, YouTube starts to transmit video to that broadcast's monitor stream. Before calling this method, you should confirm that the value of the status.streamStatus property for the stream bound to your broadcast is active.", + "parameters": { + "broadcastStatus": { + "type": "string", + "description": "The broadcastStatus parameter identifies the state to which the broadcast is changing. Note that to transition a broadcast to either the testing or live state, the status.streamStatus must be active for the stream that the broadcast is bound to.", + "required": true, + "enum": [ + "complete", + "live", + "testing" + ], + "enumDescriptions": [ + "The broadcast is over. YouTube stops transmitting video.", + "The broadcast is visible to its audience. YouTube transmits video to the broadcast's monitor stream and its broadcast stream.", + "Start testing the broadcast. YouTube transmits video to the broadcast's monitor stream. Note that you can only transition a broadcast to the testing state if its contentDetails.monitorStream.enableMonitorStream property is set to true." + ], + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies the unique ID of the broadcast that is transitioning to another status.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "broadcastStatus", + "id", + "part" + ], + "response": { + "$ref": "LiveBroadcast" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube" + ] + }, + "update": { + "id": "youtube.liveBroadcasts.update", + "path": "liveBroadcasts", + "httpMethod": "PUT", + "description": "Updates a broadcast. For example, you could modify the broadcast settings defined in the liveBroadcast resource's contentDetails object.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part properties that you can include in the parameter value are id, snippet, contentDetails, and status.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a broadcast's privacy status is defined in the status part. As such, if your request is updating a private or unlisted broadcast, and the request's part parameter value includes the status part, the broadcast's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the broadcast will revert to the default privacy setting.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "LiveBroadcast" + }, + "response": { + "$ref": "LiveBroadcast" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube" + ] + } + } + }, + "liveStreams": { + "methods": { + "delete": { + "id": "youtube.liveStreams.delete", + "path": "liveStreams", + "httpMethod": "DELETE", + "description": "Deletes a video stream.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube live stream ID for the resource that is being deleted.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube" + ] + }, + "insert": { + "id": "youtube.liveStreams.insert", + "path": "liveStreams", + "httpMethod": "POST", + "description": "Creates a video stream. The stream enables you to send your video to YouTube, which can then broadcast the video to your audience.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part properties that you can include in the parameter value are id, snippet, cdn, and status.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "LiveStream" + }, + "response": { + "$ref": "LiveStream" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube" + ] + }, + "list": { + "id": "youtube.liveStreams.list", + "path": "liveStreams", + "httpMethod": "GET", + "description": "Returns a list of video streams that match the API request parameters.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of YouTube stream IDs that identify the streams being retrieved. In a liveStream resource, the id property specifies the stream's ID.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set. Acceptable values are 0 to 50, inclusive. The default value is 5.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "mine": { + "type": "boolean", + "description": "The mine parameter can be used to instruct the API to only return streams owned by the authenticated user. Set the parameter value to true to only retrieve your own streams.", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more liveStream resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, cdn, and status.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "LiveStreamListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.readonly" + ] + }, + "update": { + "id": "youtube.liveStreams.update", + "path": "liveStreams", + "httpMethod": "PUT", + "description": "Updates a video stream. If the properties that you want to change cannot be updated, then you need to create a new stream with the proper settings.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part properties that you can include in the parameter value are id, snippet, cdn, and status.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. If the request body does not specify a value for a mutable property, the existing value for that property will be removed.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "LiveStream" + }, + "response": { + "$ref": "LiveStream" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube" + ] + } + } + }, + "playlistItems": { + "methods": { + "delete": { + "id": "youtube.playlistItems.delete", + "path": "playlistItems", + "httpMethod": "DELETE", + "description": "Deletes a playlist item.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube playlist item ID for the playlist item that is being deleted. In a playlistItem resource, the id property specifies the playlist item's ID.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "insert": { + "id": "youtube.playlistItems.insert", + "path": "playlistItems", + "httpMethod": "POST", + "description": "Adds a resource to a playlist.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet, contentDetails, and status.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "PlaylistItem" + }, + "response": { + "$ref": "PlaylistItem" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "list": { + "id": "youtube.playlistItems.list", + "path": "playlistItems", + "httpMethod": "GET", + "description": "Returns a collection of playlist items that match the API request parameters. You can retrieve all of the playlist items in a specified playlist or retrieve one or more playlist items by their unique IDs.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of one or more unique playlist item IDs.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more playlistItem resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlistItem resource, the snippet property contains numerous fields, including the title, description, position, and resourceId properties. As such, if you set part=snippet, the API response will contain all of those properties.", + "required": true, + "location": "query" + }, + "playlistId": { + "type": "string", + "description": "The playlistId parameter specifies the unique ID of the playlist for which you want to retrieve playlist items. Note that even though this is an optional parameter, every request to retrieve playlist items must specify a value for either the id parameter or the playlistId parameter.", + "location": "query" + }, + "videoId": { + "type": "string", + "description": "The videoId parameter specifies that the request should return only the playlist items that contain the specified video.", + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "PlaylistItemListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ], + "supportsSubscription": true + }, + "update": { + "id": "youtube.playlistItems.update", + "path": "playlistItems", + "httpMethod": "PUT", + "description": "Modifies a playlist item. For example, you could update the item's position in the playlist.", + "parameters": { + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet, contentDetails, and status.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a playlist item can specify a start time and end time, which identify the times portion of the video that should play when users watch the video in the playlist. If your request is updating a playlist item that sets these values, and the request's part parameter value includes the contentDetails part, the playlist item's start and end times will be updated to whatever value the request body specifies. If the request body does not specify values, the existing start and end times will be removed and replaced with the default settings.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "PlaylistItem" + }, + "response": { + "$ref": "PlaylistItem" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "playlists": { + "methods": { + "delete": { + "id": "youtube.playlists.delete", + "path": "playlists", + "httpMethod": "DELETE", + "description": "Deletes a playlist.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube playlist ID for the playlist that is being deleted. In a playlist resource, the id property specifies the playlist's ID.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "insert": { + "id": "youtube.playlists.insert", + "path": "playlists", + "httpMethod": "POST", + "description": "Creates a playlist.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet and status.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Playlist" + }, + "response": { + "$ref": "Playlist" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "list": { + "id": "youtube.playlists.list", + "path": "playlists", + "httpMethod": "GET", + "description": "Returns a collection of playlists that match the API request parameters. For example, you can retrieve all playlists that the authenticated user owns, or you can retrieve one or more playlists by their unique IDs.", + "parameters": { + "channelId": { + "type": "string", + "description": "This value indicates that the API should only return the specified channel's playlists.", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of the YouTube playlist ID(s) for the resource(s) that are being retrieved. In a playlist resource, the id property specifies the playlist's YouTube playlist ID.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "mine": { + "type": "boolean", + "description": "Set this parameter's value to true to instruct the API to only return playlists owned by the authenticated user.", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more playlist resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and status.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlist resource, the snippet property contains properties like author, title, description, tags, and timeCreated. As such, if you set part=snippet, the API response will contain all of those properties.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "PlaylistListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "update": { + "id": "youtube.playlists.update", + "path": "playlists", + "httpMethod": "PUT", + "description": "Modifies a playlist. For example, you could change a playlist's title, description, or privacy status.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet and status.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a playlist's privacy setting is contained in the status part. As such, if your request is updating a private playlist, and the request's part parameter value includes the status part, the playlist's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the playlist will revert to the default privacy setting.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Playlist" + }, + "response": { + "$ref": "Playlist" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "search": { + "methods": { + "list": { + "id": "youtube.search.list", + "path": "search", + "httpMethod": "GET", + "description": "Returns a collection of search results that match the query parameters specified in the API request. By default, a search result set identifies matching video, channel, and playlist resources, but you can also configure queries to only retrieve a specific type of resource.", + "parameters": { + "channelId": { + "type": "string", + "description": "The channelId parameter indicates that the API response should only contain resources created by the channel", + "location": "query" + }, + "channelType": { + "type": "string", + "description": "The channelType parameter lets you restrict a search to a particular type of channel.", + "enum": [ + "any", + "show" + ], + "enumDescriptions": [ + "Return all channels.", + "Only retrieve shows." + ], + "location": "query" + }, + "eventType": { + "type": "string", + "description": "The eventType parameter restricts a search to broadcast events.", + "enum": [ + "completed", + "live", + "upcoming" + ], + "enumDescriptions": [ + "Only include completed broadcasts.", + "Only include active broadcasts.", + "Only include upcoming broadcasts." + ], + "location": "query" + }, + "forContentOwner": { + "type": "boolean", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe forContentOwner parameter restricts the search to only retrieve resources owned by the content owner specified by the onBehalfOfContentOwner parameter. The user must be authenticated using a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided.", + "location": "query" + }, + "forMine": { + "type": "boolean", + "description": "The forMine parameter restricts the search to only retrieve videos owned by the authenticated user. If you set this parameter to true, then the type parameter's value must also be set to video.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "order": { + "type": "string", + "description": "The order parameter specifies the method that will be used to order resources in the API response.", + "default": "SEARCH_SORT_RELEVANCE", + "enum": [ + "date", + "rating", + "relevance", + "title", + "videoCount", + "viewCount" + ], + "enumDescriptions": [ + "Resources are sorted in reverse chronological order based on the date they were created.", + "Resources are sorted from highest to lowest rating.", + "Resources are sorted based on their relevance to the search query. This is the default value for this parameter.", + "Resources are sorted alphabetically by title.", + "Channels are sorted in descending order of their number of uploaded videos.", + "Resources are sorted from highest to lowest number of views." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a search result, the snippet property contains other properties that identify the result's title, description, and so forth. If you set part=snippet, the API response will also contain all of those nested properties.", + "required": true, + "location": "query" + }, + "publishedAfter": { + "type": "string", + "description": "The publishedAfter parameter indicates that the API response should only contain resources created after the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).", + "format": "date-time", + "location": "query" + }, + "publishedBefore": { + "type": "string", + "description": "The publishedBefore parameter indicates that the API response should only contain resources created before the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).", + "format": "date-time", + "location": "query" + }, + "q": { + "type": "string", + "description": "The q parameter specifies the query term to search for.", + "location": "query" + }, + "regionCode": { + "type": "string", + "description": "The regionCode parameter instructs the API to return search results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code.", + "location": "query" + }, + "relatedToVideoId": { + "type": "string", + "description": "The relatedToVideoId parameter retrieves a list of videos that are related to the video that the parameter value identifies. The parameter value must be set to a YouTube video ID and, if you are using this parameter, the type parameter must be set to video.", + "location": "query" + }, + "safeSearch": { + "type": "string", + "description": "The safeSearch parameter indicates whether the search results should include restricted content as well as standard content.", + "enum": [ + "moderate", + "none", + "strict" + ], + "enumDescriptions": [ + "YouTube will filter some content from search results and, at the least, will filter content that is restricted in your locale. Based on their content, search results could be removed from search results or demoted in search results. This is the default parameter value.", + "YouTube will not filter the search result set.", + "YouTube will try to exclude all restricted content from the search result set. Based on their content, search results could be removed from search results or demoted in search results." + ], + "location": "query" + }, + "topicId": { + "type": "string", + "description": "The topicId parameter indicates that the API response should only contain resources associated with the specified topic. The value identifies a Freebase topic ID.", + "location": "query" + }, + "type": { + "type": "string", + "description": "The type parameter restricts a search query to only retrieve a particular type of resource. The value is a comma-separated list of resource types.", + "default": "video,channel,playlist", + "location": "query" + }, + "videoCaption": { + "type": "string", + "description": "The videoCaption parameter indicates whether the API should filter video search results based on whether they have captions.", + "enum": [ + "any", + "closedCaption", + "none" + ], + "enumDescriptions": [ + "Do not filter results based on caption availability.", + "Only include videos that have captions.", + "Only include videos that do not have captions." + ], + "location": "query" + }, + "videoCategoryId": { + "type": "string", + "description": "The videoCategoryId parameter filters video search results based on their category.", + "location": "query" + }, + "videoDefinition": { + "type": "string", + "description": "The videoDefinition parameter lets you restrict a search to only include either high definition (HD) or standard definition (SD) videos. HD videos are available for playback in at least 720p, though higher resolutions, like 1080p, might also be available.", + "enum": [ + "any", + "high", + "standard" + ], + "enumDescriptions": [ + "Return all videos, regardless of their resolution.", + "Only retrieve HD videos.", + "Only retrieve videos in standard definition." + ], + "location": "query" + }, + "videoDimension": { + "type": "string", + "description": "The videoDimension parameter lets you restrict a search to only retrieve 2D or 3D videos.", + "enum": [ + "2d", + "3d", + "any" + ], + "enumDescriptions": [ + "Restrict search results to exclude 3D videos.", + "Restrict search results to only include 3D videos.", + "Include both 3D and non-3D videos in returned results. This is the default value." + ], + "location": "query" + }, + "videoDuration": { + "type": "string", + "description": "The videoDuration parameter filters video search results based on their duration.", + "enum": [ + "any", + "long", + "medium", + "short" + ], + "enumDescriptions": [ + "Do not filter video search results based on their duration. This is the default value.", + "Only include videos longer than 20 minutes.", + "Only include videos that are between four and 20 minutes long (inclusive).", + "Only include videos that are less than four minutes long." + ], + "location": "query" + }, + "videoEmbeddable": { + "type": "string", + "description": "The videoEmbeddable parameter lets you to restrict a search to only videos that can be embedded into a webpage.", + "enum": [ + "any", + "true" + ], + "enumDescriptions": [ + "Return all videos, embeddable or not.", + "Only retrieve embeddable videos." + ], + "location": "query" + }, + "videoLicense": { + "type": "string", + "description": "The videoLicense parameter filters search results to only include videos with a particular license. YouTube lets video uploaders choose to attach either the Creative Commons license or the standard YouTube license to each of their videos.", + "enum": [ + "any", + "creativeCommon", + "youtube" + ], + "enumDescriptions": [ + "Return all videos, regardless of which license they have, that match the query parameters.", + "Only return videos that have a Creative Commons license. Users can reuse videos with this license in other videos that they create. Learn more.", + "Only return videos that have the standard YouTube license." + ], + "location": "query" + }, + "videoSyndicated": { + "type": "string", + "description": "The videoSyndicated parameter lets you to restrict a search to only videos that can be played outside youtube.com.", + "enum": [ + "any", + "true" + ], + "enumDescriptions": [ + "Return all videos, syndicated or not.", + "Only retrieve syndicated videos." + ], + "location": "query" + }, + "videoType": { + "type": "string", + "description": "The videoType parameter lets you restrict a search to a particular type of videos.", + "enum": [ + "any", + "episode", + "movie" + ], + "enumDescriptions": [ + "Return all videos.", + "Only retrieve episodes of shows.", + "Only retrieve movies." + ], + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "SearchListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "subscriptions": { + "methods": { + "delete": { + "id": "youtube.subscriptions.delete", + "path": "subscriptions", + "httpMethod": "DELETE", + "description": "Deletes a subscription.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube subscription ID for the resource that is being deleted. In a subscription resource, the id property specifies the YouTube subscription ID.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "insert": { + "id": "youtube.subscriptions.insert", + "path": "subscriptions", + "httpMethod": "POST", + "description": "Adds a subscription for the authenticated user's channel.", + "parameters": { + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet and contentDetails.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Subscription" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "list": { + "id": "youtube.subscriptions.list", + "path": "subscriptions", + "httpMethod": "GET", + "description": "Returns subscription resources that match the API request criteria.", + "parameters": { + "channelId": { + "type": "string", + "description": "The channelId parameter specifies a YouTube channel ID. The API will only return that channel's subscriptions.", + "location": "query" + }, + "forChannelId": { + "type": "string", + "description": "The forChannelId parameter specifies a comma-separated list of channel IDs. The API response will then only contain subscriptions matching those channels.", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of the YouTube subscription ID(s) for the resource(s) that are being retrieved. In a subscription resource, the id property specifies the YouTube subscription ID.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "mine": { + "type": "boolean", + "description": "Set this parameter's value to true to retrieve a feed of the authenticated user's subscriptions.", + "location": "query" + }, + "mySubscribers": { + "type": "boolean", + "description": "Set this parameter's value to true to retrieve a feed of the subscribers of the authenticated user.", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "order": { + "type": "string", + "description": "The order parameter specifies the method that will be used to sort resources in the API response.", + "default": "SUBSCRIPTION_ORDER_RELEVANCE", + "enum": [ + "alphabetical", + "relevance", + "unread" + ], + "enumDescriptions": [ + "Sort alphabetically.", + "Sort by relevance.", + "Sort by order of activity." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a subscription resource, the snippet property contains other properties, such as a display title for the subscription. If you set part=snippet, the API response will also contain all of those nested properties.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "SubscriptionListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "thumbnails": { + "methods": { + "set": { + "id": "youtube.thumbnails.set", + "path": "thumbnails/set", + "httpMethod": "POST", + "description": "Uploads a custom video thumbnail to YouTube and sets it for a video.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "The onBehalfOfContentOwner parameter indicates that the authenticated user is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner.", + "location": "query" + }, + "videoId": { + "type": "string", + "description": "The videoId parameter specifies a YouTube video ID for which the custom video thumbnail is being provided.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "videoId" + ], + "response": { + "$ref": "ThumbnailSetResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.upload", + "https://www.googleapis.com/auth/youtubepartner" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "application/octet-stream", + "image/jpeg", + "image/png" + ], + "maxSize": "2MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/youtube/v3/thumbnails/set" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/youtube/v3/thumbnails/set" + } + } + } + } + } + }, + "videoCategories": { + "methods": { + "list": { + "id": "youtube.videoCategories.list", + "path": "videoCategories", + "httpMethod": "GET", + "description": "Returns a list of categories that can be associated with YouTube videos.", + "parameters": { + "hl": { + "type": "string", + "description": "The hl parameter specifies the language that should be used for text values in the API response.", + "default": "en_US", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of video category IDs for the resources that you are retrieving.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies the videoCategory resource parts that the API response will include. Supported values are id and snippet.", + "required": true, + "location": "query" + }, + "regionCode": { + "type": "string", + "description": "The regionCode parameter instructs the API to return the list of video categories available in the specified country. The parameter value is an ISO 3166-1 alpha-2 country code.", + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "VideoCategoryListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "videos": { + "methods": { + "delete": { + "id": "youtube.videos.delete", + "path": "videos", + "httpMethod": "DELETE", + "description": "Deletes a YouTube video.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube video ID for the resource that is being deleted. In a video resource, the id property specifies the video's ID.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "getRating": { + "id": "youtube.videos.getRating", + "path": "videos/getRating", + "httpMethod": "GET", + "description": "Retrieves the ratings that the authorized user gave to a list of specified videos.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) for which you are retrieving rating data. In a video resource, the id property specifies the video's ID.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "VideoGetRatingResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "insert": { + "id": "youtube.videos.insert", + "path": "videos", + "httpMethod": "POST", + "description": "Uploads a video to YouTube and optionally sets the video's metadata.", + "parameters": { + "autoLevels": { + "type": "boolean", + "description": "The autoLevels parameter indicates whether YouTube should automatically enhance the video's lighting and color.", + "location": "query" + }, + "notifySubscribers": { + "type": "boolean", + "description": "The notifySubscribers parameter indicates whether YouTube should send notification to subscribers about the inserted video.", + "default": "true", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet, contentDetails, fileDetails, liveStreamingDetails, player, processingDetails, recordingDetails, statistics, status, suggestions, and topicDetails. However, not all of those parts contain properties that can be set when setting or updating a video's metadata. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response.", + "required": true, + "location": "query" + }, + "stabilize": { + "type": "boolean", + "description": "The stabilize parameter indicates whether YouTube should adjust the video to remove shaky camera motions.", + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Video" + }, + "response": { + "$ref": "Video" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.upload", + "https://www.googleapis.com/auth/youtubepartner" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "application/octet-stream", + "video/*" + ], + "maxSize": "64GB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/youtube/v3/videos" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/youtube/v3/videos" + } + } + } + }, + "list": { + "id": "youtube.videos.list", + "path": "videos", + "httpMethod": "GET", + "description": "Returns a list of videos that match the API request parameters.", + "parameters": { + "chart": { + "type": "string", + "description": "The chart parameter identifies the chart that you want to retrieve.", + "enum": [ + "mostPopular" + ], + "enumDescriptions": [ + "Return the most popular videos for the specified content region and video category." + ], + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) that are being retrieved. In a video resource, the id property specifies the video's ID.", + "location": "query" + }, + "locale": { + "type": "string", + "description": "DEPRECATED", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.\n\nNote: This parameter is supported for use in conjunction with the myRating parameter, but it is not supported for use in conjunction with the id parameter.", + "default": "5", + "format": "uint32", + "minimum": "1", + "maximum": "50", + "location": "query" + }, + "myRating": { + "type": "string", + "description": "Set this parameter's value to like or dislike to instruct the API to only return videos liked or disliked by the authenticated user.", + "enum": [ + "dislike", + "like" + ], + "enumDescriptions": [ + "Returns only videos disliked by the authenticated user.", + "Returns only video liked by the authenticated user." + ], + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.\n\nNote: This parameter is supported for use in conjunction with the myRating parameter, but it is not supported for use in conjunction with the id parameter.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, fileDetails, liveStreamingDetails, player, processingDetails, recordingDetails, statistics, status, suggestions, and topicDetails.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a video resource, the snippet property contains the channelId, title, description, tags, and categoryId properties. As such, if you set part=snippet, the API response will contain all of those properties.", + "required": true, + "location": "query" + }, + "regionCode": { + "type": "string", + "description": "The regionCode parameter instructs the API to select a video chart available in the specified region. This parameter can only be used in conjunction with the chart parameter. The parameter value is an ISO 3166-1 alpha-2 country code.", + "location": "query" + }, + "videoCategoryId": { + "type": "string", + "description": "The videoCategoryId parameter identifies the video category for which the chart should be retrieved. This parameter can only be used in conjunction with the chart parameter. By default, charts are not restricted to a particular category.", + "default": "0", + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "VideoListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "rate": { + "id": "youtube.videos.rate", + "path": "videos/rate", + "httpMethod": "POST", + "description": "Add a like or dislike rating to a video or remove a rating from a video.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube video ID of the video that is being rated or having its rating removed.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "rating": { + "type": "string", + "description": "Specifies the rating to record.", + "required": true, + "enum": [ + "dislike", + "like", + "none" + ], + "enumDescriptions": [ + "Records that the authenticated user disliked the video.", + "Records that the authenticated user liked the video.", + "Removes any rating that the authenticated user had previously set for the video." + ], + "location": "query" + } + }, + "parameterOrder": [ + "id", + "rating" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "update": { + "id": "youtube.videos.update", + "path": "videos", + "httpMethod": "PUT", + "description": "Updates a video's metadata.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet, contentDetails, fileDetails, liveStreamingDetails, player, processingDetails, recordingDetails, statistics, status, suggestions, and topicDetails.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a video's privacy setting is contained in the status part. As such, if your request is updating a private video, and the request's part parameter value includes the status part, the video's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the video will revert to the default privacy setting.\n\nIn addition, not all of those parts contain properties that can be set when setting or updating a video's metadata. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Video" + }, + "response": { + "$ref": "Video" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "watermarks": { + "methods": { + "set": { + "id": "youtube.watermarks.set", + "path": "watermarks/set", + "httpMethod": "POST", + "description": "Uploads a watermark image to YouTube and sets it for a channel.", + "parameters": { + "channelId": { + "type": "string", + "description": "The channelId parameter specifies a YouTube channel ID for which the watermark is being provided.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "The onBehalfOfContentOwner parameter indicates that the authenticated user is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner.", + "location": "query" + } + }, + "parameterOrder": [ + "channelId" + ], + "request": { + "$ref": "InvideoBranding" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.upload", + "https://www.googleapis.com/auth/youtubepartner" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "application/octet-stream", + "image/jpeg", + "image/png" + ], + "maxSize": "10MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/youtube/v3/watermarks/set" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/youtube/v3/watermarks/set" + } + } + } + }, + "unset": { + "id": "youtube.watermarks.unset", + "path": "watermarks/unset", + "httpMethod": "POST", + "description": "Deletes a watermark.", + "parameters": { + "channelId": { + "type": "string", + "description": "The channelId parameter specifies a YouTube channel ID for which the watermark is being unset.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "The onBehalfOfContentOwner parameter indicates that the authenticated user is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner.", + "location": "query" + } + }, + "parameterOrder": [ + "channelId" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + } + } +} diff --git a/third_party/src/code.google.com/p/google-api-go-client/youtube/v3/youtube-gen.go b/third_party/src/code.google.com/p/google-api-go-client/youtube/v3/youtube-gen.go new file mode 100644 index 0000000000000..ddbd0a6141d8a --- /dev/null +++ b/third_party/src/code.google.com/p/google-api-go-client/youtube/v3/youtube-gen.go @@ -0,0 +1,9393 @@ +// Package youtube provides access to the YouTube Data API. +// +// See https://developers.google.com/youtube/v3 +// +// Usage example: +// +// import "code.google.com/p/google-api-go-client/youtube/v3" +// ... +// youtubeService, err := youtube.New(oauthHttpClient) +package youtube + +import ( + "bytes" + "code.google.com/p/google-api-go-client/googleapi" + "encoding/json" + "errors" + "fmt" + "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 + +const apiId = "youtube:v3" +const apiName = "youtube" +const apiVersion = "v3" +const basePath = "https://www.googleapis.com/youtube/v3/" + +// OAuth2 scopes used by this API. +const ( + // Manage your YouTube account + YoutubeScope = "https://www.googleapis.com/auth/youtube" + + // View your YouTube account + YoutubeReadonlyScope = "https://www.googleapis.com/auth/youtube.readonly" + + // Manage your YouTube videos + YoutubeUploadScope = "https://www.googleapis.com/auth/youtube.upload" + + // View and manage your assets and associated content on YouTube + YoutubepartnerScope = "https://www.googleapis.com/auth/youtubepartner" + + // View private information of your YouTube channel relevant during the + // audit process with a YouTube partner + YoutubepartnerChannelAuditScope = "https://www.googleapis.com/auth/youtubepartner-channel-audit" +) + +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) + s.ChannelBanners = NewChannelBannersService(s) + s.ChannelSections = NewChannelSectionsService(s) + s.Channels = NewChannelsService(s) + s.GuideCategories = NewGuideCategoriesService(s) + s.I18nLanguages = NewI18nLanguagesService(s) + s.I18nRegions = NewI18nRegionsService(s) + s.LiveBroadcasts = NewLiveBroadcastsService(s) + s.LiveStreams = NewLiveStreamsService(s) + s.PlaylistItems = NewPlaylistItemsService(s) + s.Playlists = NewPlaylistsService(s) + s.Search = NewSearchService(s) + s.Subscriptions = NewSubscriptionsService(s) + s.Thumbnails = NewThumbnailsService(s) + s.VideoCategories = NewVideoCategoriesService(s) + s.Videos = NewVideosService(s) + s.Watermarks = NewWatermarksService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + + Activities *ActivitiesService + + ChannelBanners *ChannelBannersService + + ChannelSections *ChannelSectionsService + + Channels *ChannelsService + + GuideCategories *GuideCategoriesService + + I18nLanguages *I18nLanguagesService + + I18nRegions *I18nRegionsService + + LiveBroadcasts *LiveBroadcastsService + + LiveStreams *LiveStreamsService + + PlaylistItems *PlaylistItemsService + + Playlists *PlaylistsService + + Search *SearchService + + Subscriptions *SubscriptionsService + + Thumbnails *ThumbnailsService + + VideoCategories *VideoCategoriesService + + Videos *VideosService + + Watermarks *WatermarksService +} + +func NewActivitiesService(s *Service) *ActivitiesService { + rs := &ActivitiesService{s: s} + return rs +} + +type ActivitiesService struct { + s *Service +} + +func NewChannelBannersService(s *Service) *ChannelBannersService { + rs := &ChannelBannersService{s: s} + return rs +} + +type ChannelBannersService struct { + s *Service +} + +func NewChannelSectionsService(s *Service) *ChannelSectionsService { + rs := &ChannelSectionsService{s: s} + return rs +} + +type ChannelSectionsService struct { + s *Service +} + +func NewChannelsService(s *Service) *ChannelsService { + rs := &ChannelsService{s: s} + return rs +} + +type ChannelsService struct { + s *Service +} + +func NewGuideCategoriesService(s *Service) *GuideCategoriesService { + rs := &GuideCategoriesService{s: s} + return rs +} + +type GuideCategoriesService struct { + s *Service +} + +func NewI18nLanguagesService(s *Service) *I18nLanguagesService { + rs := &I18nLanguagesService{s: s} + return rs +} + +type I18nLanguagesService struct { + s *Service +} + +func NewI18nRegionsService(s *Service) *I18nRegionsService { + rs := &I18nRegionsService{s: s} + return rs +} + +type I18nRegionsService struct { + s *Service +} + +func NewLiveBroadcastsService(s *Service) *LiveBroadcastsService { + rs := &LiveBroadcastsService{s: s} + return rs +} + +type LiveBroadcastsService struct { + s *Service +} + +func NewLiveStreamsService(s *Service) *LiveStreamsService { + rs := &LiveStreamsService{s: s} + return rs +} + +type LiveStreamsService struct { + s *Service +} + +func NewPlaylistItemsService(s *Service) *PlaylistItemsService { + rs := &PlaylistItemsService{s: s} + return rs +} + +type PlaylistItemsService struct { + s *Service +} + +func NewPlaylistsService(s *Service) *PlaylistsService { + rs := &PlaylistsService{s: s} + return rs +} + +type PlaylistsService struct { + s *Service +} + +func NewSearchService(s *Service) *SearchService { + rs := &SearchService{s: s} + return rs +} + +type SearchService struct { + s *Service +} + +func NewSubscriptionsService(s *Service) *SubscriptionsService { + rs := &SubscriptionsService{s: s} + return rs +} + +type SubscriptionsService struct { + s *Service +} + +func NewThumbnailsService(s *Service) *ThumbnailsService { + rs := &ThumbnailsService{s: s} + return rs +} + +type ThumbnailsService struct { + s *Service +} + +func NewVideoCategoriesService(s *Service) *VideoCategoriesService { + rs := &VideoCategoriesService{s: s} + return rs +} + +type VideoCategoriesService struct { + s *Service +} + +func NewVideosService(s *Service) *VideosService { + rs := &VideosService{s: s} + return rs +} + +type VideosService struct { + s *Service +} + +func NewWatermarksService(s *Service) *WatermarksService { + rs := &WatermarksService{s: s} + return rs +} + +type WatermarksService struct { + s *Service +} + +type AccessPolicy struct { + // Allowed: The value of allowed indicates whether the access to the + // policy is allowed or denied by default. + Allowed bool `json:"allowed,omitempty"` + + // Exception: A list of region codes that identify countries where the + // default policy do not apply. + Exception []string `json:"exception,omitempty"` +} + +type Activity struct { + // ContentDetails: The contentDetails object contains information about + // the content associated with the activity. For example, if the + // snippet.type value is videoRated, then the contentDetails object's + // content identifies the rated video. + ContentDetails *ActivityContentDetails `json:"contentDetails,omitempty"` + + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the activity. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#activity". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the + // activity, including the activity's type and group ID. + Snippet *ActivitySnippet `json:"snippet,omitempty"` +} + +type ActivityContentDetails struct { + // Bulletin: The bulletin object contains details about a channel + // bulletin post. This object is only present if the snippet.type is + // bulletin. + Bulletin *ActivityContentDetailsBulletin `json:"bulletin,omitempty"` + + // ChannelItem: The channelItem object contains details about a resource + // which was added to a channel. This property is only present if the + // snippet.type is channelItem. + ChannelItem *ActivityContentDetailsChannelItem `json:"channelItem,omitempty"` + + // Comment: The comment object contains information about a resource + // that received a comment. This property is only present if the + // snippet.type is comment. + Comment *ActivityContentDetailsComment `json:"comment,omitempty"` + + // Favorite: The favorite object contains information about a video that + // was marked as a favorite video. This property is only present if the + // snippet.type is favorite. + Favorite *ActivityContentDetailsFavorite `json:"favorite,omitempty"` + + // Like: The like object contains information about a resource that + // received a positive (like) rating. This property is only present if + // the snippet.type is like. + Like *ActivityContentDetailsLike `json:"like,omitempty"` + + // PlaylistItem: The playlistItem object contains information about a + // new playlist item. This property is only present if the snippet.type + // is playlistItem. + PlaylistItem *ActivityContentDetailsPlaylistItem `json:"playlistItem,omitempty"` + + // PromotedItem: The promotedItem object contains details about a + // resource which is being promoted. This property is only present if + // the snippet.type is promotedItem. + PromotedItem *ActivityContentDetailsPromotedItem `json:"promotedItem,omitempty"` + + // Recommendation: The recommendation object contains information about + // a recommended resource. This property is only present if the + // snippet.type is recommendation. + Recommendation *ActivityContentDetailsRecommendation `json:"recommendation,omitempty"` + + // Social: The social object contains details about a social network + // post. This property is only present if the snippet.type is social. + Social *ActivityContentDetailsSocial `json:"social,omitempty"` + + // Subscription: The subscription object contains information about a + // channel that a user subscribed to. This property is only present if + // the snippet.type is subscription. + Subscription *ActivityContentDetailsSubscription `json:"subscription,omitempty"` + + // Upload: The upload object contains information about the uploaded + // video. This property is only present if the snippet.type is upload. + Upload *ActivityContentDetailsUpload `json:"upload,omitempty"` +} + +type ActivityContentDetailsBulletin struct { + // ResourceId: The resourceId object contains information that + // identifies the resource associated with a bulletin post. + ResourceId *ResourceId `json:"resourceId,omitempty"` +} + +type ActivityContentDetailsChannelItem struct { + // ResourceId: The resourceId object contains information that + // identifies the resource that was added to the channel. + ResourceId *ResourceId `json:"resourceId,omitempty"` +} + +type ActivityContentDetailsComment struct { + // ResourceId: The resourceId object contains information that + // identifies the resource associated with the comment. + ResourceId *ResourceId `json:"resourceId,omitempty"` +} + +type ActivityContentDetailsFavorite struct { + // ResourceId: The resourceId object contains information that + // identifies the resource that was marked as a favorite. + ResourceId *ResourceId `json:"resourceId,omitempty"` +} + +type ActivityContentDetailsLike struct { + // ResourceId: The resourceId object contains information that + // identifies the rated resource. + ResourceId *ResourceId `json:"resourceId,omitempty"` +} + +type ActivityContentDetailsPlaylistItem struct { + // PlaylistId: The value that YouTube uses to uniquely identify the + // playlist. + PlaylistId string `json:"playlistId,omitempty"` + + // PlaylistItemId: ID of the item within the playlist. + PlaylistItemId string `json:"playlistItemId,omitempty"` + + // ResourceId: The resourceId object contains information about the + // resource that was added to the playlist. + ResourceId *ResourceId `json:"resourceId,omitempty"` +} + +type ActivityContentDetailsPromotedItem struct { + // AdTag: The URL the client should fetch to request a promoted item. + AdTag string `json:"adTag,omitempty"` + + // ClickTrackingUrl: The URL the client should ping to indicate that the + // user clicked through on this promoted item. + ClickTrackingUrl string `json:"clickTrackingUrl,omitempty"` + + // CreativeViewUrl: The URL the client should ping to indicate that the + // user was shown this promoted item. + CreativeViewUrl string `json:"creativeViewUrl,omitempty"` + + // CtaType: The type of call-to-action, a message to the user indicating + // action that can be taken. + CtaType string `json:"ctaType,omitempty"` + + // CustomCtaButtonText: The custom call-to-action button text. If + // specified, it will override the default button text for the cta_type. + CustomCtaButtonText string `json:"customCtaButtonText,omitempty"` + + // DescriptionText: The text description to accompany the promoted item. + DescriptionText string `json:"descriptionText,omitempty"` + + // DestinationUrl: The URL the client should direct the user to, if the + // user chooses to visit the advertiser's website. + DestinationUrl string `json:"destinationUrl,omitempty"` + + // ForecastingUrl: The list of forecasting URLs. The client should ping + // all of these URLs when a promoted item is not available, to indicate + // that a promoted item could have been shown. + ForecastingUrl []string `json:"forecastingUrl,omitempty"` + + // ImpressionUrl: The list of impression URLs. The client should ping + // all of these URLs to indicate that the user was shown this promoted + // item. + ImpressionUrl []string `json:"impressionUrl,omitempty"` + + // VideoId: The ID that YouTube uses to uniquely identify the promoted + // video. + VideoId string `json:"videoId,omitempty"` +} + +type ActivityContentDetailsRecommendation struct { + // Reason: The reason that the resource is recommended to the user. + Reason string `json:"reason,omitempty"` + + // ResourceId: The resourceId object contains information that + // identifies the recommended resource. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // SeedResourceId: The seedResourceId object contains information about + // the resource that caused the recommendation. + SeedResourceId *ResourceId `json:"seedResourceId,omitempty"` +} + +type ActivityContentDetailsSocial struct { + // Author: The author of the social network post. + Author string `json:"author,omitempty"` + + // ImageUrl: An image of the post's author. + ImageUrl string `json:"imageUrl,omitempty"` + + // ReferenceUrl: The URL of the social network post. + ReferenceUrl string `json:"referenceUrl,omitempty"` + + // ResourceId: The resourceId object encapsulates information that + // identifies the resource associated with a social network post. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // Type: The name of the social network. + Type string `json:"type,omitempty"` +} + +type ActivityContentDetailsSubscription struct { + // ResourceId: The resourceId object contains information that + // identifies the resource that the user subscribed to. + ResourceId *ResourceId `json:"resourceId,omitempty"` +} + +type ActivityContentDetailsUpload struct { + // VideoId: The ID that YouTube uses to uniquely identify the uploaded + // video. + VideoId string `json:"videoId,omitempty"` +} + +type ActivityListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of activities, or events, that match the request + // criteria. + Items []*Activity `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#activityListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + // PrevPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the previous page in the result set. + PrevPageToken string `json:"prevPageToken,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` +} + +type ActivitySnippet struct { + // ChannelId: The ID that YouTube uses to uniquely identify the channel + // associated with the activity. + ChannelId string `json:"channelId,omitempty"` + + // ChannelTitle: Channel title for the channel responsible for this + // activity + ChannelTitle string `json:"channelTitle,omitempty"` + + // Description: The description of the resource primarily associated + // with the activity. + Description string `json:"description,omitempty"` + + // GroupId: The group ID associated with the activity. A group ID + // identifies user events that are associated with the same user and + // resource. For example, if a user rates a video and marks the same + // video as a favorite, the entries for those events would have the same + // group ID in the user's activity feed. In your user interface, you can + // avoid repetition by grouping events with the same groupId value. + GroupId string `json:"groupId,omitempty"` + + // PublishedAt: The date and time that the video was uploaded. The value + // is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + PublishedAt string `json:"publishedAt,omitempty"` + + // Thumbnails: A map of thumbnail images associated with the resource + // that is primarily associated with the activity. For each object in + // the map, the key is the name of the thumbnail image, and the value is + // an object that contains other information about the thumbnail. + Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"` + + // Title: The title of the resource primarily associated with the + // activity. + Title string `json:"title,omitempty"` + + // Type: The type of activity that the resource describes. + Type string `json:"type,omitempty"` +} + +type CdnSettings struct { + // Format: The format of the video stream that you are sending to + // Youtube. + Format string `json:"format,omitempty"` + + // IngestionInfo: The ingestionInfo object contains information that + // YouTube provides that you need to transmit your RTMP or HTTP stream + // to YouTube. + IngestionInfo *IngestionInfo `json:"ingestionInfo,omitempty"` + + // IngestionType: The method or protocol used to transmit the video + // stream. + IngestionType string `json:"ingestionType,omitempty"` +} + +type Channel struct { + // AuditDetails: The auditionDetails object encapsulates channel data + // that is relevant for YouTube Partners during the audition process. + AuditDetails *ChannelAuditDetails `json:"auditDetails,omitempty"` + + // BrandingSettings: The brandingSettings object encapsulates + // information about the branding of the channel. + BrandingSettings *ChannelBrandingSettings `json:"brandingSettings,omitempty"` + + // ContentDetails: The contentDetails object encapsulates information + // about the channel's content. + ContentDetails *ChannelContentDetails `json:"contentDetails,omitempty"` + + // ContentOwnerDetails: The contentOwnerDetails object encapsulates + // channel data that is relevant for YouTube Partners linked with the + // channel. + ContentOwnerDetails *ChannelContentOwnerDetails `json:"contentOwnerDetails,omitempty"` + + // ConversionPings: The conversionPings object encapsulates information + // about conversion pings that need to be respected by the channel. + ConversionPings *ChannelConversionPings `json:"conversionPings,omitempty"` + + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the channel. + Id string `json:"id,omitempty"` + + // InvideoPromotion: The invideoPromotion object encapsulates + // information about promotion campaign associated with the channel. + InvideoPromotion *InvideoPromotion `json:"invideoPromotion,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#channel". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the channel, + // such as its title, description, and thumbnail images. + Snippet *ChannelSnippet `json:"snippet,omitempty"` + + // Statistics: The statistics object encapsulates statistics for the + // channel. + Statistics *ChannelStatistics `json:"statistics,omitempty"` + + // Status: The status object encapsulates information about the privacy + // status of the channel. + Status *ChannelStatus `json:"status,omitempty"` + + // TopicDetails: The topicDetails object encapsulates information about + // Freebase topics associated with the channel. + TopicDetails *ChannelTopicDetails `json:"topicDetails,omitempty"` +} + +type ChannelAuditDetails struct { + // CommunityGuidelinesGoodStanding: Whether or not the channel respects + // the community guidelines. + CommunityGuidelinesGoodStanding bool `json:"communityGuidelinesGoodStanding,omitempty"` + + // ContentIdClaimsGoodStanding: Whether or not the channel has any + // unresolved claims. + ContentIdClaimsGoodStanding bool `json:"contentIdClaimsGoodStanding,omitempty"` + + // CopyrightStrikesGoodStanding: Whether or not the channel has any + // copyright strikes. + CopyrightStrikesGoodStanding bool `json:"copyrightStrikesGoodStanding,omitempty"` + + // OverallGoodStanding: Describes the general state of the channel. This + // field will always show if there are any issues whatsoever with the + // channel. Currently this field represents the result of the logical + // and operation over the community guidelines good standing, the + // copyright strikes good standing and the content ID claims good + // standing, but this may change in the future. + OverallGoodStanding bool `json:"overallGoodStanding,omitempty"` +} + +type ChannelBannerResource struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#channelBannerResource". + Kind string `json:"kind,omitempty"` + + // Url: The URL of this banner image. + Url string `json:"url,omitempty"` +} + +type ChannelBrandingSettings struct { + // Channel: Branding properties for the channel view. + Channel *ChannelSettings `json:"channel,omitempty"` + + // Hints: Additional experimental branding properties. + Hints []*PropertyValue `json:"hints,omitempty"` + + // Image: Branding properties for branding images. + Image *ImageSettings `json:"image,omitempty"` + + // Watch: Branding properties for the watch page. + Watch *WatchSettings `json:"watch,omitempty"` +} + +type ChannelContentDetails struct { + // GooglePlusUserId: The googlePlusUserId object identifies the Google+ + // profile ID associated with this channel. + GooglePlusUserId string `json:"googlePlusUserId,omitempty"` + + RelatedPlaylists *ChannelContentDetailsRelatedPlaylists `json:"relatedPlaylists,omitempty"` +} + +type ChannelContentDetailsRelatedPlaylists struct { + // Favorites: The ID of the playlist that contains the channel"s + // favorite videos. Use the playlistItems.insert and + // playlistItems.delete to add or remove items from that list. + Favorites string `json:"favorites,omitempty"` + + // Likes: The ID of the playlist that contains the channel"s liked + // videos. Use the playlistItems.insert and playlistItems.delete to + // add or remove items from that list. + Likes string `json:"likes,omitempty"` + + // Uploads: The ID of the playlist that contains the channel"s uploaded + // videos. Use the videos.insert method to upload new videos and the + // videos.delete method to delete previously uploaded videos. + Uploads string `json:"uploads,omitempty"` + + // WatchHistory: The ID of the playlist that contains the channel"s + // watch history. Use the playlistItems.insert and + // playlistItems.delete to add or remove items from that list. + WatchHistory string `json:"watchHistory,omitempty"` + + // WatchLater: The ID of the playlist that contains the channel"s watch + // later playlist. Use the playlistItems.insert and + // playlistItems.delete to add or remove items from that list. + WatchLater string `json:"watchLater,omitempty"` +} + +type ChannelContentOwnerDetails struct { + // ContentOwner: The ID of the content owner linked to the channel. + ContentOwner string `json:"contentOwner,omitempty"` + + // TimeLinked: The date and time of when the channel was linked to the + // content owner. The value is specified in ISO 8601 + // (YYYY-MM-DDThh:mm:ss.sZ) format. + TimeLinked string `json:"timeLinked,omitempty"` +} + +type ChannelConversionPing struct { + // Context: Defines the context of the ping. + Context string `json:"context,omitempty"` + + // ConversionUrl: The url (without the schema) that the player shall + // send the ping to. It's at caller's descretion to decide which schema + // to use (http vs https) Example of a returned url: + // //googleads.g.doubleclick.net/pagead/ + // viewthroughconversion/962985656/?data=path%3DtHe_path%3Btype%3D + // cview%3Butuid%3DGISQtTNGYqaYl4sKxoVvKA&labe=default The caller must + // append biscotti authentication (ms param in case of mobile, for + // example) to this ping. + ConversionUrl string `json:"conversionUrl,omitempty"` +} + +type ChannelConversionPings struct { + // Pings: Pings that the app shall fire (authenticated by biscotti + // cookie). Each ping has a context, in which the app must fire the + // ping, and a url identifying the ping. + Pings []*ChannelConversionPing `json:"pings,omitempty"` +} + +type ChannelListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of channels that match the request criteria. + Items []*Channel `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#channelListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + // PrevPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the previous page in the result set. + PrevPageToken string `json:"prevPageToken,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` +} + +type ChannelSection struct { + // ContentDetails: The contentDetails object contains details about the + // ChannelSection content, such as playlists and channels. + ContentDetails *ChannelSectionContentDetails `json:"contentDetails,omitempty"` + + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the ChannelSection. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#channelSection". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the + // ChannelSection, such as its type, style and title. + Snippet *ChannelSectionSnippet `json:"snippet,omitempty"` +} + +type ChannelSectionContentDetails struct { + // Channels: The channel ids for type multiple_channels. + Channels []string `json:"channels,omitempty"` + + // Playlists: The playlist ids for type single_playlist and + // multiple_playlists. For singlePlaylist, only one playlistId is + // allowed. + Playlists []string `json:"playlists,omitempty"` +} + +type ChannelSectionListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of ChannelSections that match the request criteria. + Items []*ChannelSection `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#channelSectionListResponse". + Kind string `json:"kind,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` +} + +type ChannelSectionSnippet struct { + // ChannelId: The ID that YouTube uses to uniquely identify the channel + // that published the channelSection. + ChannelId string `json:"channelId,omitempty"` + + // Position: The position of the channelSection in the channel. + Position int64 `json:"position,omitempty"` + + // Style: The style of the channelSection. + Style string `json:"style,omitempty"` + + // Title: The channelSection's title for multiple_playlists and + // multiple_channels. + Title string `json:"title,omitempty"` + + // Type: The type of the channelSection. + Type string `json:"type,omitempty"` +} + +type ChannelSettings struct { + // DefaultTab: Which content tab users should see when viewing the + // channel. + DefaultTab string `json:"defaultTab,omitempty"` + + // Description: Specifies the channel description. + Description string `json:"description,omitempty"` + + // FeaturedChannelsTitle: Title for the featured channels tab. + FeaturedChannelsTitle string `json:"featuredChannelsTitle,omitempty"` + + // FeaturedChannelsUrls: The list of featured channels. + FeaturedChannelsUrls []string `json:"featuredChannelsUrls,omitempty"` + + // Keywords: Lists keywords associated with the channel, + // comma-separated. + Keywords string `json:"keywords,omitempty"` + + // ModerateComments: Whether user-submitted comments left on the channel + // page need to be approved by the channel owner to be publicly visible. + ModerateComments bool `json:"moderateComments,omitempty"` + + // ProfileColor: A prominent color that can be rendered on this channel + // page. + ProfileColor string `json:"profileColor,omitempty"` + + // ShowBrowseView: Whether the tab to browse the videos should be + // displayed. + ShowBrowseView bool `json:"showBrowseView,omitempty"` + + // ShowRelatedChannels: Whether related channels should be proposed. + ShowRelatedChannels bool `json:"showRelatedChannels,omitempty"` + + // Title: Specifies the channel title. + Title string `json:"title,omitempty"` + + // TrackingAnalyticsAccountId: The ID for a Google Analytics account to + // track and measure traffic to the channels. + TrackingAnalyticsAccountId string `json:"trackingAnalyticsAccountId,omitempty"` + + // UnsubscribedTrailer: The trailer of the channel, for users that are + // not subscribers. + UnsubscribedTrailer string `json:"unsubscribedTrailer,omitempty"` +} + +type ChannelSnippet struct { + // Description: The description of the channel. + Description string `json:"description,omitempty"` + + // PublishedAt: The date and time that the channel was created. The + // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + PublishedAt string `json:"publishedAt,omitempty"` + + // Thumbnails: A map of thumbnail images associated with the channel. + // For each object in the map, the key is the name of the thumbnail + // image, and the value is an object that contains other information + // about the thumbnail. + Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"` + + // Title: The channel's title. + Title string `json:"title,omitempty"` +} + +type ChannelStatistics struct { + // CommentCount: The number of comments for the channel. + CommentCount uint64 `json:"commentCount,omitempty,string"` + + // HiddenSubscriberCount: Whether or not the number of subscribers is + // shown for this user. + HiddenSubscriberCount bool `json:"hiddenSubscriberCount,omitempty"` + + // SubscriberCount: The number of subscribers that the channel has. + SubscriberCount uint64 `json:"subscriberCount,omitempty,string"` + + // VideoCount: The number of videos uploaded to the channel. + VideoCount uint64 `json:"videoCount,omitempty,string"` + + // ViewCount: The number of times the channel has been viewed. + ViewCount uint64 `json:"viewCount,omitempty,string"` +} + +type ChannelStatus struct { + // IsLinked: If true, then the user is linked to either a YouTube + // username or G+ account. Otherwise, the user doesn't have a public + // YouTube identity. + IsLinked bool `json:"isLinked,omitempty"` + + // PrivacyStatus: Privacy status of the channel. + PrivacyStatus string `json:"privacyStatus,omitempty"` +} + +type ChannelTopicDetails struct { + // TopicIds: A list of Freebase topic IDs associated with the channel. + // You can retrieve information about each topic using the Freebase + // Topic API. + TopicIds []string `json:"topicIds,omitempty"` +} + +type ContentRating struct { + // AcbRating: Rating system in Australia - Australian Classification + // Board + AcbRating string `json:"acbRating,omitempty"` + + // BbfcRating: British Board of Film Classification + BbfcRating string `json:"bbfcRating,omitempty"` + + // CatvRating: Rating system for Canadian TV - Canadian TV + // Classification System + CatvRating string `json:"catvRating,omitempty"` + + // CatvfrRating: Rating system for French Canadian TV - Regie du cinema + CatvfrRating string `json:"catvfrRating,omitempty"` + + // CbfcRating: Rating system in India - Central Board of Film + // Certification + CbfcRating string `json:"cbfcRating,omitempty"` + + // ChvrsRating: Canadian Home Video Rating System + ChvrsRating string `json:"chvrsRating,omitempty"` + + // DjctqRating: Rating system in Brazil - Department of Justice, Rating, + // Titles and Qualification + DjctqRating string `json:"djctqRating,omitempty"` + + // EirinRating: Rating system in Japan - Eiga Rinri Kanri Iinkai + EirinRating string `json:"eirinRating,omitempty"` + + // FmocRating: Rating system in France - French Minister of Culture + FmocRating string `json:"fmocRating,omitempty"` + + // FskRating: Rating system in Germany - Voluntary Self Regulation of + // the Movie Industry + FskRating string `json:"fskRating,omitempty"` + + // IcaaRating: Rating system in Spain - Instituto de Cinematografia y de + // las Artes Audiovisuales + IcaaRating string `json:"icaaRating,omitempty"` + + // KmrbRating: Rating system in South Korea - Korea Media Rating Board + KmrbRating string `json:"kmrbRating,omitempty"` + + // MibacRating: Rating system in Italy - Ministero dei Beni e delle + // Attivita Culturali e del Turismo + MibacRating string `json:"mibacRating,omitempty"` + + // MpaaRating: Motion Picture Association of America rating for the + // content. + MpaaRating string `json:"mpaaRating,omitempty"` + + // OflcRating: Rating system in New Zealand - Office of Film and + // Literature Classification + OflcRating string `json:"oflcRating,omitempty"` + + // RtcRating: Rating system in Mexico - General Directorate of Radio, + // Television and Cinematography + RtcRating string `json:"rtcRating,omitempty"` + + // RussiaRating: Rating system in Russia + RussiaRating string `json:"russiaRating,omitempty"` + + // TvpgRating: TV Parental Guidelines rating of the content. + TvpgRating string `json:"tvpgRating,omitempty"` + + // YtRating: Internal YouTube rating. + YtRating string `json:"ytRating,omitempty"` +} + +type GeoPoint struct { + // Altitude: Altitude above the reference ellipsoid, in meters. + Altitude float64 `json:"altitude,omitempty"` + + // Latitude: Latitude in degrees. + Latitude float64 `json:"latitude,omitempty"` + + // Longitude: Longitude in degrees. + Longitude float64 `json:"longitude,omitempty"` +} + +type GuideCategory struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the guide category. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#guideCategory". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the + // category, such as its title. + Snippet *GuideCategorySnippet `json:"snippet,omitempty"` +} + +type GuideCategoryListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of categories that can be associated with YouTube + // channels. In this map, the category ID is the map key, and its value + // is the corresponding guideCategory resource. + Items []*GuideCategory `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#guideCategoryListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + // PrevPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the previous page in the result set. + PrevPageToken string `json:"prevPageToken,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` +} + +type GuideCategorySnippet struct { + ChannelId string `json:"channelId,omitempty"` + + // Title: Description of the guide category. + Title string `json:"title,omitempty"` +} + +type I18nLanguage struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the i18n language. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#i18nLanguage". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the i18n + // language, such as language code and human-readable name. + Snippet *I18nLanguageSnippet `json:"snippet,omitempty"` +} + +type I18nLanguageListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of supported i18n languages. In this map, the i18n + // language ID is the map key, and its value is the corresponding + // i18nLanguage resource. + Items []*I18nLanguage `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#i18nLanguageListResponse". + Kind string `json:"kind,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` +} + +type I18nLanguageSnippet struct { + // Hl: A short BCP-47 code that uniquely identifies a language. + Hl string `json:"hl,omitempty"` + + // Name: The human-readable name of the language in the language itself. + Name string `json:"name,omitempty"` +} + +type I18nRegion struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the i18n region. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#i18nRegion". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the i18n + // region, such as region code and human-readable name. + Snippet *I18nRegionSnippet `json:"snippet,omitempty"` +} + +type I18nRegionListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of regions where YouTube is available. In this map, the + // i18n region ID is the map key, and its value is the corresponding + // i18nRegion resource. + Items []*I18nRegion `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#i18nRegionListResponse". + Kind string `json:"kind,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` +} + +type I18nRegionSnippet struct { + // Gl: The region code as a 2-letter ISO country code. + Gl string `json:"gl,omitempty"` + + // Name: The human-readable name of the region. + Name string `json:"name,omitempty"` +} + +type ImageSettings struct { + // BackgroundImageUrl: The URL for the background image shown on the + // video watch page. The image should be 1200px by 615px, with a maximum + // file size of 128k. + BackgroundImageUrl *LocalizedProperty `json:"backgroundImageUrl,omitempty"` + + // BannerExternalUrl: This is used only in update requests; if it's set, + // we use this URL to generate all of the above banner URLs. + BannerExternalUrl string `json:"bannerExternalUrl,omitempty"` + + // BannerImageUrl: Banner image. Desktop size (1060x175). + BannerImageUrl string `json:"bannerImageUrl,omitempty"` + + // BannerMobileExtraHdImageUrl: Banner image. Mobile size high + // resolution (1440x395). + BannerMobileExtraHdImageUrl string `json:"bannerMobileExtraHdImageUrl,omitempty"` + + // BannerMobileHdImageUrl: Banner image. Mobile size high resolution + // (1280x360). + BannerMobileHdImageUrl string `json:"bannerMobileHdImageUrl,omitempty"` + + // BannerMobileImageUrl: Banner image. Mobile size (640x175). + BannerMobileImageUrl string `json:"bannerMobileImageUrl,omitempty"` + + // BannerMobileLowImageUrl: Banner image. Mobile size low resolution + // (320x88). + BannerMobileLowImageUrl string `json:"bannerMobileLowImageUrl,omitempty"` + + // BannerMobileMediumHdImageUrl: Banner image. Mobile size medium/high + // resolution (960x263). + BannerMobileMediumHdImageUrl string `json:"bannerMobileMediumHdImageUrl,omitempty"` + + // BannerTabletExtraHdImageUrl: Banner image. Tablet size extra high + // resolution (2560x424). + BannerTabletExtraHdImageUrl string `json:"bannerTabletExtraHdImageUrl,omitempty"` + + // BannerTabletHdImageUrl: Banner image. Tablet size high resolution + // (2276x377). + BannerTabletHdImageUrl string `json:"bannerTabletHdImageUrl,omitempty"` + + // BannerTabletImageUrl: Banner image. Tablet size (1707x283). + BannerTabletImageUrl string `json:"bannerTabletImageUrl,omitempty"` + + // BannerTabletLowImageUrl: Banner image. Tablet size low resolution + // (1138x188). + BannerTabletLowImageUrl string `json:"bannerTabletLowImageUrl,omitempty"` + + // BannerTvHighImageUrl: Banner image. TV size high resolution + // (1920x1080). + BannerTvHighImageUrl string `json:"bannerTvHighImageUrl,omitempty"` + + // BannerTvImageUrl: Banner image. TV size extra high resolution + // (2120x1192). + BannerTvImageUrl string `json:"bannerTvImageUrl,omitempty"` + + // BannerTvLowImageUrl: Banner image. TV size low resolution (854x480). + BannerTvLowImageUrl string `json:"bannerTvLowImageUrl,omitempty"` + + // BannerTvMediumImageUrl: Banner image. TV size medium resolution + // (1280x720). + BannerTvMediumImageUrl string `json:"bannerTvMediumImageUrl,omitempty"` + + // LargeBrandedBannerImageImapScript: The image map script for the large + // banner image. + LargeBrandedBannerImageImapScript *LocalizedProperty `json:"largeBrandedBannerImageImapScript,omitempty"` + + // LargeBrandedBannerImageUrl: The URL for the 854px by 70px image that + // appears below the video player in the expanded video view of the + // video watch page. + LargeBrandedBannerImageUrl *LocalizedProperty `json:"largeBrandedBannerImageUrl,omitempty"` + + // SmallBrandedBannerImageImapScript: The image map script for the small + // banner image. + SmallBrandedBannerImageImapScript *LocalizedProperty `json:"smallBrandedBannerImageImapScript,omitempty"` + + // SmallBrandedBannerImageUrl: The URL for the 640px by 70px banner + // image that appears below the video player in the default view of the + // video watch page. + SmallBrandedBannerImageUrl *LocalizedProperty `json:"smallBrandedBannerImageUrl,omitempty"` + + // TrackingImageUrl: The URL for a 1px by 1px tracking pixel that can be + // used to collect statistics for views of the channel or video pages. + TrackingImageUrl string `json:"trackingImageUrl,omitempty"` + + // WatchIconImageUrl: The URL for the image that appears above the + // top-left corner of the video player. This is a 25-pixel-high image + // with a flexible width that cannot exceed 170 pixels. + WatchIconImageUrl string `json:"watchIconImageUrl,omitempty"` +} + +type IngestionInfo struct { + // BackupIngestionAddress: The backup ingestion URL that you should use + // to stream video to YouTube. You have the option of simultaneously + // streaming the content that you are sending to the ingestionAddress to + // this URL. + BackupIngestionAddress string `json:"backupIngestionAddress,omitempty"` + + // IngestionAddress: The primary ingestion URL that you should use to + // stream video to YouTube. You must stream video to this + // URL. + // + // Depending on which application or tool you use to encode your + // video stream, you may need to enter the stream URL and stream name + // separately or you may need to concatenate them in the following + // format: + // + // STREAM_URL/STREAM_NAME + IngestionAddress string `json:"ingestionAddress,omitempty"` + + // StreamName: The HTTP or RTMP stream name that YouTube assigns to the + // video stream. + StreamName string `json:"streamName,omitempty"` +} + +type InvideoBranding struct { + ImageBytes string `json:"imageBytes,omitempty"` + + ImageUrl string `json:"imageUrl,omitempty"` + + Position *InvideoPosition `json:"position,omitempty"` + + TargetChannelId string `json:"targetChannelId,omitempty"` + + Timing *InvideoTiming `json:"timing,omitempty"` +} + +type InvideoPosition struct { + // CornerPosition: Describes in which corner of the video the visual + // widget will appear. + CornerPosition string `json:"cornerPosition,omitempty"` + + // Type: Defines the position type. + Type string `json:"type,omitempty"` +} + +type InvideoPromotion struct { + // DefaultTiming: The default temporal position within the video where + // the promoted item will be displayed. Can be overriden by more + // specific timing in the item. + DefaultTiming *InvideoTiming `json:"defaultTiming,omitempty"` + + // Items: List of promoted items in decreasing priority. + Items []*PromotedItem `json:"items,omitempty"` + + // Position: The spatial position within the video where the promoted + // item will be displayed. + Position *InvideoPosition `json:"position,omitempty"` +} + +type InvideoTiming struct { + // DurationMs: Defines the duration in milliseconds for which the + // promotion should be displayed. If missing, the client should use the + // default. + DurationMs uint64 `json:"durationMs,omitempty,string"` + + // OffsetMs: Defines the time at which the promotion will appear. + // Depending on the value of type the value of the offsetMs field will + // represent a time offset from the start or from the end of the video, + // expressed in milliseconds. + OffsetMs uint64 `json:"offsetMs,omitempty,string"` + + // Type: Describes a timing type. If the value is offsetFromStart, then + // the offsetMs field represents an offset from the start of the video. + // If the value is offsetFromEnd, then the offsetMs field represents an + // offset from the end of the video. + Type string `json:"type,omitempty"` +} + +type LiveBroadcast struct { + // ContentDetails: The contentDetails object contains information about + // the event's video content, such as whether the content can be shown + // in an embedded video player or if it will be archived and therefore + // available for viewing after the event has concluded. + ContentDetails *LiveBroadcastContentDetails `json:"contentDetails,omitempty"` + + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube assigns to uniquely identify the broadcast. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#liveBroadcast". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the event, + // including its title, description, start time, and end time. + Snippet *LiveBroadcastSnippet `json:"snippet,omitempty"` + + // Status: The status object contains information about the event's + // status. + Status *LiveBroadcastStatus `json:"status,omitempty"` +} + +type LiveBroadcastContentDetails struct { + // BoundStreamId: This value uniquely identifies the live stream bound + // to the broadcast. + BoundStreamId string `json:"boundStreamId,omitempty"` + + // EnableClosedCaptions: This setting indicates whether closed + // captioning is enabled for this broadcast. The ingestion URL of the + // closed captions is returned through the liveStreams API. + EnableClosedCaptions bool `json:"enableClosedCaptions,omitempty"` + + // EnableContentEncryption: This setting indicates whether YouTube + // should enable content encryption for the broadcast. + EnableContentEncryption bool `json:"enableContentEncryption,omitempty"` + + // EnableDvr: This setting determines whether viewers can access DVR + // controls while watching the video. DVR controls enable the viewer to + // control the video playback experience by pausing, rewinding, or fast + // forwarding content. The default value for this property is + // true. + // + // + // + // Important: You must set the value to true and also set the + // enableArchive property's value to true if you want to make playback + // available immediately after the broadcast ends. + EnableDvr bool `json:"enableDvr,omitempty"` + + // EnableEmbed: This setting indicates whether the broadcast video can + // be played in an embedded player. If you choose to archive the video + // (using the enableArchive property), this setting will also apply to + // the archived video. + EnableEmbed bool `json:"enableEmbed,omitempty"` + + // MonitorStream: The monitorStream object contains information about + // the monitor stream, which the broadcaster can use to review the event + // content before the broadcast stream is shown publicly. + MonitorStream *MonitorStreamInfo `json:"monitorStream,omitempty"` + + // RecordFromStart: Automatically start recording after the event goes + // live. The default value for this property is true. + // + // + // + // Important: You + // must also set the enableDvr property's value to true if you want the + // playback to be available immediately after the broadcast ends. If you + // set this property's value to true but do not also set the enableDvr + // property to true, there may be a delay of around one day before the + // archived video will be available for playback. + RecordFromStart bool `json:"recordFromStart,omitempty"` + + // StartWithSlate: This setting indicates whether the broadcast should + // automatically begin with an in-stream slate when you update the + // broadcast's status to live. After updating the status, you then need + // to send a liveCuepoints.insert request that sets the cuepoint's + // eventState to end to remove the in-stream slate and make your + // broadcast stream visible to viewers. + StartWithSlate bool `json:"startWithSlate,omitempty"` +} + +type LiveBroadcastListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of broadcasts that match the request criteria. + Items []*LiveBroadcast `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#liveBroadcastListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + // PrevPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the previous page in the result set. + PrevPageToken string `json:"prevPageToken,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` +} + +type LiveBroadcastSnippet struct { + // ActualEndTime: The date and time that the broadcast actually ended. + // This information is only available once the broadcast's state is + // complete. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) + // format. + ActualEndTime string `json:"actualEndTime,omitempty"` + + // ActualStartTime: The date and time that the broadcast actually + // started. This information is only available once the broadcast's + // state is live. The value is specified in ISO 8601 + // (YYYY-MM-DDThh:mm:ss.sZ) format. + ActualStartTime string `json:"actualStartTime,omitempty"` + + // ChannelId: The ID that YouTube uses to uniquely identify the channel + // that is publishing the broadcast. + ChannelId string `json:"channelId,omitempty"` + + // Description: The broadcast's description. As with the title, you can + // set this field by modifying the broadcast resource or by setting the + // description field of the corresponding video resource. + Description string `json:"description,omitempty"` + + // PublishedAt: The date and time that the broadcast was added to + // YouTube's live broadcast schedule. The value is specified in ISO 8601 + // (YYYY-MM-DDThh:mm:ss.sZ) format. + PublishedAt string `json:"publishedAt,omitempty"` + + // ScheduledEndTime: The date and time that the broadcast is scheduled + // to end. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) + // format. + ScheduledEndTime string `json:"scheduledEndTime,omitempty"` + + // ScheduledStartTime: The date and time that the broadcast is scheduled + // to start. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) + // format. + ScheduledStartTime string `json:"scheduledStartTime,omitempty"` + + // Thumbnails: A map of thumbnail images associated with the broadcast. + // For each nested object in this object, the key is the name of the + // thumbnail image, and the value is an object that contains other + // information about the thumbnail. + Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"` + + // Title: The broadcast's title. Note that the broadcast represents + // exactly one YouTube video. You can set this field by modifying the + // broadcast resource or by setting the title field of the corresponding + // video resource. + Title string `json:"title,omitempty"` +} + +type LiveBroadcastStatus struct { + // LifeCycleStatus: The broadcast's status. The status can be updated + // using the API's liveBroadcasts.transition method. + LifeCycleStatus string `json:"lifeCycleStatus,omitempty"` + + // PrivacyStatus: The broadcast's privacy status. Note that the + // broadcast represents exactly one YouTube video, so the privacy + // settings are identical to those supported for videos. In addition, + // you can set this field by modifying the broadcast resource or by + // setting the privacyStatus field of the corresponding video resource. + PrivacyStatus string `json:"privacyStatus,omitempty"` + + // RecordingStatus: The broadcast's recording status. + RecordingStatus string `json:"recordingStatus,omitempty"` +} + +type LiveStream struct { + // Cdn: The cdn object defines the live stream's content delivery + // network (CDN) settings. These settings provide details about the + // manner in which you stream your content to YouTube. + Cdn *CdnSettings `json:"cdn,omitempty"` + + // ContentDetails: The content_details object contains information about + // the stream, including the closed captions ingestion URL. + ContentDetails *LiveStreamContentDetails `json:"contentDetails,omitempty"` + + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube assigns to uniquely identify the stream. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#liveStream". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the stream, + // including its channel, title, and description. + Snippet *LiveStreamSnippet `json:"snippet,omitempty"` + + // Status: The status object contains information about live stream's + // status. + Status *LiveStreamStatus `json:"status,omitempty"` +} + +type LiveStreamContentDetails struct { + // ClosedCaptionsIngestionUrl: The ingestion URL where the closed + // captions of this stream are sent. + ClosedCaptionsIngestionUrl string `json:"closedCaptionsIngestionUrl,omitempty"` +} + +type LiveStreamListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of live streams that match the request criteria. + Items []*LiveStream `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#liveStreamListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + // PrevPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the previous page in the result set. + PrevPageToken string `json:"prevPageToken,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` +} + +type LiveStreamSnippet struct { + // ChannelId: The ID that YouTube uses to uniquely identify the channel + // that is transmitting the stream. + ChannelId string `json:"channelId,omitempty"` + + // Description: The stream's description. The value cannot be longer + // than 10000 characters. + Description string `json:"description,omitempty"` + + // PublishedAt: The date and time that the stream was created. The value + // is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + PublishedAt string `json:"publishedAt,omitempty"` + + // Title: The stream's title. The value must be between 1 and 128 + // characters long. + Title string `json:"title,omitempty"` +} + +type LiveStreamStatus struct { + StreamStatus string `json:"streamStatus,omitempty"` +} + +type LocalizedProperty struct { + // Default: Default value for the localized property. + Default string `json:"default,omitempty"` + + // Localized: The localized values. + Localized []*LocalizedString `json:"localized,omitempty"` +} + +type LocalizedString struct { + // Language: Language associated to this value. + Language string `json:"language,omitempty"` + + // Value: Value of the property. + Value string `json:"value,omitempty"` +} + +type MonitorStreamInfo struct { + // BroadcastStreamDelayMs: If you have set the enableMonitorStream + // property to true, then this property determines the length of the + // live broadcast delay. + BroadcastStreamDelayMs int64 `json:"broadcastStreamDelayMs,omitempty"` + + // EmbedHtml: HTML code that embeds a player that plays the monitor + // stream. + EmbedHtml string `json:"embedHtml,omitempty"` + + // EnableMonitorStream: This value determines whether the monitor stream + // is enabled for the broadcast. If the monitor stream is enabled, then + // YouTube will broadcast the event content on a special stream intended + // only for the broadcaster's consumption. The broadcaster can use the + // stream to review the event content and also to identify the optimal + // times to insert cuepoints. + // + // You need to set this value to true if you + // intend to have a broadcast delay for your event. + // + // Note: This property + // cannot be updated once the broadcast is in the testing or live state. + EnableMonitorStream bool `json:"enableMonitorStream,omitempty"` +} + +type PageInfo struct { + // ResultsPerPage: The number of results included in the API response. + ResultsPerPage int64 `json:"resultsPerPage,omitempty"` + + // TotalResults: The total number of results in the result set. + TotalResults int64 `json:"totalResults,omitempty"` +} + +type Playlist struct { + // ContentDetails: The contentDetails object contains information like + // video count. + ContentDetails *PlaylistContentDetails `json:"contentDetails,omitempty"` + + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the playlist. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#playlist". + Kind string `json:"kind,omitempty"` + + // Player: The player object contains information that you would use to + // play the playlist in an embedded player. + Player *PlaylistPlayer `json:"player,omitempty"` + + // Snippet: The snippet object contains basic details about the + // playlist, such as its title and description. + Snippet *PlaylistSnippet `json:"snippet,omitempty"` + + // Status: The status object contains status information for the + // playlist. + Status *PlaylistStatus `json:"status,omitempty"` +} + +type PlaylistContentDetails struct { + // ItemCount: The number of videos in the playlist. + ItemCount int64 `json:"itemCount,omitempty"` +} + +type PlaylistItem struct { + // ContentDetails: The contentDetails object is included in the resource + // if the included item is a YouTube video. The object contains + // additional information about the video. + ContentDetails *PlaylistItemContentDetails `json:"contentDetails,omitempty"` + + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the playlist item. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#playlistItem". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the playlist + // item, such as its title and position in the playlist. + Snippet *PlaylistItemSnippet `json:"snippet,omitempty"` + + // Status: The status object contains information about the playlist + // item's privacy status. + Status *PlaylistItemStatus `json:"status,omitempty"` +} + +type PlaylistItemContentDetails struct { + // EndAt: The time, measured in seconds from the start of the video, + // when the video should stop playing. (The playlist owner can specify + // the times when the video should start and stop playing when the video + // is played in the context of the playlist.) By default, assume that + // the video.endTime is the end of the video. + EndAt string `json:"endAt,omitempty"` + + // Note: A user-generated note for this item. + Note string `json:"note,omitempty"` + + // StartAt: The time, measured in seconds from the start of the video, + // when the video should start playing. (The playlist owner can specify + // the times when the video should start and stop playing when the video + // is played in the context of the playlist.) The default value is 0. + StartAt string `json:"startAt,omitempty"` + + // VideoId: The ID that YouTube uses to uniquely identify a video. To + // retrieve the video resource, set the id query parameter to this value + // in your API request. + VideoId string `json:"videoId,omitempty"` +} + +type PlaylistItemListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of playlist items that match the request criteria. + Items []*PlaylistItem `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#playlistItemListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + // PrevPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the previous page in the result set. + PrevPageToken string `json:"prevPageToken,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` +} + +type PlaylistItemSnippet struct { + // ChannelId: The ID that YouTube uses to uniquely identify the user + // that added the item to the playlist. + ChannelId string `json:"channelId,omitempty"` + + // ChannelTitle: Channel title for the channel that the playlist item + // belongs to. + ChannelTitle string `json:"channelTitle,omitempty"` + + // Description: The item's description. + Description string `json:"description,omitempty"` + + // PlaylistId: The ID that YouTube uses to uniquely identify the + // playlist that the playlist item is in. + PlaylistId string `json:"playlistId,omitempty"` + + // Position: The order in which the item appears in the playlist. The + // value uses a zero-based index, so the first item has a position of 0, + // the second item has a position of 1, and so forth. + Position int64 `json:"position,omitempty"` + + // PublishedAt: The date and time that the item was added to the + // playlist. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) + // format. + PublishedAt string `json:"publishedAt,omitempty"` + + // ResourceId: The id object contains information that can be used to + // uniquely identify the resource that is included in the playlist as + // the playlist item. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // Thumbnails: A map of thumbnail images associated with the playlist + // item. For each object in the map, the key is the name of the + // thumbnail image, and the value is an object that contains other + // information about the thumbnail. + Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"` + + // Title: The item's title. + Title string `json:"title,omitempty"` +} + +type PlaylistItemStatus struct { + // PrivacyStatus: This resource's privacy status. + PrivacyStatus string `json:"privacyStatus,omitempty"` +} + +type PlaylistListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of playlists that match the request criteria. + Items []*Playlist `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#playlistListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + // PrevPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the previous page in the result set. + PrevPageToken string `json:"prevPageToken,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` +} + +type PlaylistPlayer struct { + // EmbedHtml: An